/* ========================================
   カラーパレット（ラグマス公式テイスト・ファンタジー強化）
   ======================================== */
:root {
  --rom-bg: #e8f0fb;
  --rom-bg-gradient: linear-gradient(180deg, #1e3a6e 0%, #2d5599 40%, #3e72bf 100%);
  --rom-primary: #3463b1;
  --rom-primary-dark: #1e3a6e;
  --rom-primary-light: #5a82c5;
  --rom-secondary: #599dbf;
  --rom-cyan: #7fd8ff;
  --rom-cyan-glow: #b8ecff;
  --rom-accent: #e9c33a;
  --rom-accent-dark: #a68e20;
  --rom-accent-light: #ffe58a;
  --rom-text: #1a2942;
  --rom-muted: #6b7a90;
  --rom-attack: #d14b3a;
  --rom-attack-light: #ff9077;
  --rom-defense: #3463b1;
  --rom-card: #ffffff;
  --rom-card-hover: #f7faff;
  --rom-border: #cfdbec;
  --rom-border-strong: #9fb3d1;
  --rom-result: #1f7a44;
  --rom-shadow-sm: 0 2px 6px rgba(36, 60, 120, 0.08);
  --rom-shadow: 0 10px 32px rgba(28, 50, 100, 0.18), 0 2px 6px rgba(28, 50, 100, 0.08);
  --rom-shadow-up: 0 -8px 28px rgba(28, 50, 100, 0.2);
  --rom-glow-cyan: 0 0 18px rgba(127, 216, 255, 0.55), 0 0 36px rgba(127, 216, 255, 0.25);
  --rom-glow-gold: 0 0 14px rgba(233, 195, 58, 0.6), 0 0 28px rgba(233, 195, 58, 0.25);
  --rom-radius: 14px;
  --rom-radius-sm: 8px;
  --rom-radius-pill: 999px;
  --rom-font: "メイリオ", Meiryo, "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ========================================
   リセット・ベース
   ======================================== */
* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--rom-font);
  margin: 0;
  padding: 0;
  color: var(--rom-text);
  line-height: 1.5;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -5%, rgba(127, 216, 255, 0.35), transparent 45%),
    radial-gradient(circle at 95% 8%, rgba(233, 195, 58, 0.18), transparent 40%),
    radial-gradient(circle at 50% 110%, rgba(127, 216, 255, 0.2), transparent 55%),
    linear-gradient(180deg, #dfeaf9 0%, #e8f0fb 30%, #eef3fa 100%);
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 15% 20%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(1px 1px at 78% 14%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1.2px 1.2px at 42% 68%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 88% 55%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 8% 84%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 62% 92%, rgba(255, 255, 255, 0.5), transparent 60%);
  background-size: 100% 100%;
  opacity: 0.7;
}

.app-header,
.calc-tabs,
.app-main,
.app-footer,
.result-panel {
  position: relative;
  z-index: 1;
}

/* ========================================
   アプリヘッダー（ヒーロー）
   ======================================== */
.app-header {
  background: var(--rom-bg-gradient);
  color: #fff;
  padding: 36px 20px 30px;
  position: relative;
  border-bottom: 1px solid rgba(233, 195, 58, 0.4);
  box-shadow: 0 8px 28px rgba(20, 40, 80, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.app-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(127, 216, 255, 0.42), transparent 65%),
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 10%, rgba(233, 195, 58, 0.2), transparent 60%);
  pointer-events: none;
}

.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(233, 195, 58, 0.3) 15%,
    var(--rom-accent) 50%,
    rgba(233, 195, 58, 0.3) 85%,
    transparent 100%);
  box-shadow: 0 0 16px rgba(233, 195, 58, 0.8);
}

.app-header__inner {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  text-align: center;
}

.app-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  line-height: 1.15;
}

.app-title__main {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #ffffff 0%, #e0f2ff 45%, #7fd8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 0 8px rgba(127, 216, 255, 0.65))
    drop-shadow(0 0 20px rgba(127, 216, 255, 0.35))
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.app-title__deco {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--rom-accent);
  filter: drop-shadow(0 0 4px rgba(233, 195, 58, 0.9));
  -webkit-text-fill-color: var(--rom-accent);
}

.app-title__deco-line {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rom-accent), transparent);
  box-shadow: 0 0 6px rgba(233, 195, 58, 0.8);
}

.app-title__sub {
  font-size: 11px;
  letter-spacing: 0.4em;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  text-transform: uppercase;
  padding: 3px 14px;
  border-top: 1px solid rgba(127, 216, 255, 0.35);
  border-bottom: 1px solid rgba(127, 216, 255, 0.35);
  text-shadow: 0 0 10px rgba(127, 216, 255, 0.5);
}

/* ========================================
   タブナビゲーション
   ======================================== */
.calc-tabs {
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
  border-bottom: 1px solid var(--rom-border);
  box-shadow: 0 4px 16px rgba(28, 50, 100, 0.12);
  position: relative;
}

/* 結果表示ボタン フラッシュアニメーション */
@keyframes result-toggle-flash {
  0%, 100% {
    transform: scale(1);
    background: linear-gradient(180deg, #4a7bc8 0%, #2d5599 50%, #1e3a6e 100%);
    color: #fff;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.25),
      0 2px 8px rgba(28, 50, 100, 0.3);
  }
  25%, 70% {
    transform: scale(1.08);
    background: linear-gradient(180deg, #ffe58a 0%, #e9c33a 50%, #a68e20 100%);
    color: #3d2e0a;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      0 0 24px rgba(255, 229, 138, 0.95),
      0 0 48px rgba(233, 195, 58, 0.65),
      0 4px 14px rgba(28, 50, 100, 0.3);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  }
}

.result-toggle.is-flashing {
  animation: result-toggle-flash 0.8s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .result-toggle.is-flashing {
    animation: none;
    box-shadow:
      0 0 0 2px var(--rom-accent),
      0 0 18px rgba(233, 195, 58, 0.7);
  }
}

.calc-tabs::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(127, 216, 255, 0.5) 40%, rgba(127, 216, 255, 0.5) 60%, transparent);
  pointer-events: none;
}

.calc-tabs__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 12px;
}

.calc-tabs__category {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--rom-muted);
  margin: 6px 4px 4px;
  letter-spacing: 0.1em;
}

.calc-tabs__category::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 11px;
  background: var(--rom-accent);
  border-radius: 2px;
}

.calc-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}

.calc-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #eef3fa 100%);
  border: 1.5px solid rgba(207, 219, 236, 0.8);
  border-radius: var(--rom-radius-pill);
  color: var(--rom-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(28, 50, 100, 0.06);
}

.calc-tab:hover {
  background: linear-gradient(180deg, #ffffff 0%, #dfe9f7 100%);
  border-color: var(--rom-cyan);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 10px rgba(127, 216, 255, 0.35);
}

.calc-tab__icon {
  font-size: 14px;
  line-height: 1;
}

.calc-tab.is-active {
  background: linear-gradient(180deg, #4a7bc8 0%, #2d5599 50%, #1e3a6e 100%);
  color: #fff;
  border-color: rgba(233, 195, 58, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 6px rgba(0, 0, 0, 0.18),
    0 0 14px rgba(127, 216, 255, 0.5),
    0 4px 12px rgba(28, 50, 100, 0.35);
  text-shadow: 0 0 8px rgba(127, 216, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.4);
}

.calc-tab.is-active .calc-tab__icon {
  filter: drop-shadow(0 0 4px rgba(255, 229, 138, 0.9));
}

/* ========================================
   メインコンテナ
   ======================================== */
.app-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 260px;
}

.calc-panel {
  display: none;
  background: var(--rom-card);
  border-radius: var(--rom-radius);
  box-shadow: var(--rom-shadow);
  overflow: hidden;
  animation: fadeIn 0.25s ease-out;
  position: relative;
  border: 1px solid rgba(207, 219, 236, 0.8);
}

.calc-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(127, 216, 255, 0.7) 20%,
    rgba(233, 195, 58, 0.9) 50%,
    rgba(127, 216, 255, 0.7) 80%,
    transparent 100%);
  z-index: 2;
  box-shadow: 0 0 12px rgba(127, 216, 255, 0.5);
}

.calc-panel.is-active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.calc-panel__header {
  padding: 20px 22px 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(127, 216, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--rom-border);
}

.calc-panel__header h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 800;
  color: var(--rom-primary-dark);
  padding: 0;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}

.calc-panel__header h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 22px;
  background: linear-gradient(180deg, var(--rom-accent-light) 0%, var(--rom-accent) 50%, var(--rom-accent-dark) 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(233, 195, 58, 0.6);
}

.calc-panel__desc {
  margin: 0;
  font-size: 12px;
  color: var(--rom-muted);
  line-height: 1.6;
  padding-left: 14px;
}

.calc-panel__body {
  padding: 18px 20px 22px;
}

/* ========================================
   セクション見出し（攻撃側/防御側）
   ======================================== */
.section-heading {
  font-size: 14px;
  font-weight: 700;
  margin: 16px 0 10px;
  padding: 6px 12px;
  border-radius: var(--rom-radius-sm);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.05em;
}

.section-heading:first-child {
  margin-top: 0;
}

.section-heading {
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 4px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(28, 50, 100, 0.18);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.section-heading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
  pointer-events: none;
}

.section-heading--attack {
  background: linear-gradient(135deg, #ff8c67 0%, #e8704a 40%, #c13c2d 100%);
}

.section-heading--defense {
  background: linear-gradient(135deg, #6b92d5 0%, #3463b1 45%, #1e3a6e 100%);
}

.section-heading--common {
  background: linear-gradient(135deg, #9aa8c0 0%, #6b7a94 45%, #3d4b66 100%);
}

.section-heading__icon {
  font-size: 13px;
}

/* ========================================
   フォームグループ
   ======================================== */
.form-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fafcff 0%, #f2f6fc 100%);
  border-radius: var(--rom-radius-sm);
  border: 1px solid rgba(207, 219, 236, 0.55);
  transition: all 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.form-group:hover {
  background: linear-gradient(180deg, #fff 0%, #e9f2fc 100%);
  border-color: var(--rom-cyan);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 10px rgba(127, 216, 255, 0.2);
}

.form-group:focus-within {
  background: #fff;
  border-color: var(--rom-cyan);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 3px rgba(127, 216, 255, 0.25);
}

.form-group__label {
  flex: 1 1 180px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rom-text);
  min-width: 140px;
}

.form-group__unit {
  font-size: 13px;
  color: var(--rom-muted);
  font-weight: 600;
}

.form-group__hint {
  flex: 1 0 100%;
  font-size: 11px;
  color: var(--rom-muted);
  margin: 2px 0 0;
  padding-left: 2px;
}

/* ========================================
   入力フィールド
   ======================================== */
input[type=number],
input[type=text] {
  font-size: 15px;
  font-weight: 700;
  padding: 8px 10px;
  width: 96px;
  border: 1.5px solid var(--rom-border);
  border-radius: var(--rom-radius-sm);
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
  color: var(--rom-primary-dark);
  transition: all 0.15s ease;
  -moz-appearance: textfield;
  font-family: inherit;
  text-align: right;
  box-shadow: inset 0 2px 3px rgba(28, 50, 100, 0.06);
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number]:focus,
input[type=text]:focus,
select:focus {
  outline: none;
  border-color: var(--rom-cyan);
  box-shadow:
    inset 0 2px 3px rgba(28, 50, 100, 0.04),
    0 0 0 3px rgba(127, 216, 255, 0.28),
    0 0 8px rgba(127, 216, 255, 0.35);
  background: #fff;
}

select {
  font-size: 14px;
  padding: 8px 28px 8px 10px;
  border: 1.5px solid var(--rom-border);
  border-radius: var(--rom-radius-sm);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='%233463b1' d='M2 4l4 4 4-4z'/></svg>") no-repeat right 8px center / 12px;
  color: var(--rom-text);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  max-width: 100%;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  min-width: 140px;
  font-weight: 600;
}

/* ========================================
   +/- 調整ボタン
   ======================================== */
.adjust-group {
  display: inline-flex;
  gap: 4px;
}

.adjust-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--rom-primary-dark);
  background: linear-gradient(180deg, #ffffff 0%, #f0f4fa 100%);
  border: 1.5px solid var(--rom-border);
  border-radius: var(--rom-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  font-family: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(28, 50, 100, 0.08);
}

.adjust-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 10px rgba(28, 50, 100, 0.18);
}

.adjust-btn:active {
  transform: translateY(0) scale(0.96);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.adjust-btn--plus {
  color: #1f7a44;
  background: linear-gradient(180deg, #ffffff 0%, #e6f5ec 100%);
  border-color: #b5dcc5;
}

.adjust-btn--minus {
  color: #c13c2d;
  background: linear-gradient(180deg, #ffffff 0%, #fbe8e4 100%);
  border-color: #f0c0b6;
}

.adjust-btn--plus:hover {
  background: linear-gradient(180deg, #2d9055 0%, #1f7a44 100%);
  border-color: #155a30;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.adjust-btn--minus:hover {
  background: linear-gradient(180deg, #e45c4a 0%, #c13c2d 100%);
  border-color: #8a2e22;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* 旧クラス名互換（個別ページ用） */
.adjustBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 36px;
  padding: 0 10px;
  margin-left: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--rom-primary-dark);
  background: #fff;
  border: 1.5px solid var(--rom-border);
  border-radius: var(--rom-radius-sm);
  cursor: pointer;
  font-family: inherit;
}

.adjustBtn:hover {
  background: var(--rom-primary);
  color: #fff;
}

/* ========================================
   結果パネル（画面下部固定）
   ======================================== */
.result-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(127, 216, 255, 0.15), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #edf2fa 100%);
  border-top: 1px solid rgba(233, 195, 58, 0.5);
  box-shadow: 0 -10px 32px rgba(28, 50, 100, 0.22);
  z-index: 15;
  max-height: 65vh;
  overflow-y: auto;
}

.result-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(233, 195, 58, 0.4) 20%,
    var(--rom-accent) 50%,
    rgba(233, 195, 58, 0.4) 80%,
    transparent 100%);
  box-shadow: 0 0 14px rgba(233, 195, 58, 0.7);
  pointer-events: none;
}

.result-panel__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.result-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 10px;
  cursor: pointer;
  gap: 10px;
}

.result-panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--rom-primary-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.05em;
}

.result-panel__title::before {
  content: "◆";
  color: var(--rom-accent);
  font-size: 13px;
  filter: drop-shadow(0 0 5px rgba(233, 195, 58, 0.8));
}

.result-toggle {
  background: linear-gradient(180deg, #4a7bc8 0%, #2d5599 50%, #1e3a6e 100%);
  color: #fff;
  border: 1px solid rgba(233, 195, 58, 0.5);
  padding: 8px 18px;
  border-radius: var(--rom-radius-pill);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 8px rgba(28, 50, 100, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.05em;
}

.result-toggle:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 14px rgba(28, 50, 100, 0.4),
    0 0 10px rgba(127, 216, 255, 0.4);
}

.result-panel__body {
  padding: 2px 0 14px;
}

.result-panel.is-collapsed .result-panel__body {
  display: none;
}

.result-block {
  display: none;
}

.result-block.is-active {
  display: block;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 12px;
  margin: 4px 0;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  border-radius: var(--rom-radius-sm);
  border: 1px solid var(--rom-border);
  gap: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(28, 50, 100, 0.04);
}

.result-item__label {
  font-size: 12px;
  color: var(--rom-muted);
  flex: 1 1 auto;
}

.result-item__value {
  font-size: 17px;
  font-weight: 800;
  color: var(--rom-result);
  white-space: nowrap;
  font-family: "Courier New", monospace;
}

.result-item__unit {
  font-size: 12px;
  color: var(--rom-muted);
  font-weight: 600;
  margin-left: 2px;
}

.result-item--highlight {
  background:
    radial-gradient(ellipse at top right, rgba(255, 229, 138, 0.4), transparent 60%),
    linear-gradient(135deg, #fff6d6 0%, #fde5a3 100%);
  border-color: var(--rom-accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 12px rgba(233, 195, 58, 0.35);
  position: relative;
}

.result-item--highlight::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--rom-accent-light), var(--rom-accent), var(--rom-accent-dark));
  border-radius: var(--rom-radius-sm) 0 0 var(--rom-radius-sm);
  box-shadow: 0 0 8px rgba(233, 195, 58, 0.8);
}

.result-item--highlight .result-item__value {
  color: #8a6e10;
  font-size: 20px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ========================================
   フッター
   ======================================== */
.app-footer {
  text-align: center;
  padding: 18px 16px;
  font-size: 11px;
  color: var(--rom-muted);
  border-top: 1px solid var(--rom-border);
  background: #fff;
  margin-top: 20px;
}

.app-footer a {
  color: var(--rom-primary);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* ========================================
   トップページ（旧index互換）
   ======================================== */
.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 20px 24px;
  background: #fff;
  min-height: 100vh;
}

.container h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px 0;
  text-align: center;
  color: var(--rom-primary-dark);
}

.container h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 16px 0 8px;
  padding: 8px 0 8px 12px;
  border-left: 4px solid var(--rom-primary);
  color: var(--rom-primary-dark);
}

.container h2:nth-of-type(odd) {
  border-left-color: var(--rom-attack);
}

.container .form-group {
  display: block;
  margin: 6px 0;
  padding: 0;
  background: transparent;
  border: none;
}

.container .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  color: #444;
}

input[type=submit] {
  background-color: var(--rom-primary);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  padding: 12px;
  width: 100%;
  border-radius: var(--rom-radius-sm);
  transition: background-color 0.2s;
  font-family: inherit;
}

input[type=submit]:hover {
  background-color: var(--rom-primary-dark);
}

/* 旧結果パネル互換 */
.result-panel.result-collapsed .result-content {
  display: none;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  cursor: pointer;
}

.result-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--rom-primary-dark);
  padding: 0;
  border: none;
}

.result-content {
  padding: 0 20px 12px;
}

.result-content .form-group {
  margin: 0;
}

.result-content label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #555;
  padding: 1px 0;
  margin-bottom: 0;
}

.result-content b {
  font-size: 18px;
  color: var(--rom-result);
  font-weight: 700;
}

/* ========================================
   ハンバーガー・ドロワー（個別ページ用）
   ======================================== */
.hamburger {
  position: fixed;
  top: 8px;
  left: 8px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  z-index: 20;
  color: var(--rom-primary-dark);
  border-radius: var(--rom-radius-sm);
  box-shadow: var(--rom-shadow-sm);
}

.hamburger:hover {
  background: #fff;
}

.drawer {
  position: fixed;
  top: 0;
  left: -340px;
  width: 300px;
  height: 100%;
  background: #fff;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  padding: 16px 16px 72px;
  transition: left 0.25s ease;
  z-index: 25;
  overflow-y: auto;
}

.drawer.open {
  left: 0;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  margin-left: auto;
  display: block;
  padding: 4px 8px;
  color: #666;
  border-radius: 4px;
}

.drawer-close:hover {
  background: #f0f0f0;
}

.drawer ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.drawer li {
  border-bottom: 1px solid #eef0f3;
}

.drawer a {
  color: var(--rom-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: block;
  padding: 12px 8px;
  border-radius: 4px;
}

.drawer a:hover {
  background-color: #f5f6f8;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 15;
  display: none;
}

.drawer-backdrop.show {
  display: block;
}

.drawer-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: var(--rom-primary-dark);
  padding: 4px 0 0;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 640px) {
  .calc-tabs__inner {
    padding: 8px 10px;
  }
  .app-header {
    padding: 20px 16px 18px;
  }
  .app-title__main {
    font-size: 20px;
  }
  .app-title__sub {
    font-size: 10px;
  }
  .app-main {
    padding: 14px 10px 280px;
  }
  .calc-panel__body {
    padding: 14px 14px 18px;
  }
  .calc-panel__header {
    padding: 14px 14px 10px;
  }
  .calc-panel__header h2 {
    font-size: 16px;
  }
  .form-group {
    padding: 6px 8px;
    gap: 6px;
  }
  .form-group__label {
    flex: 1 1 100%;
    font-size: 12px;
    min-width: auto;
  }
  input[type=number],
  input[type=text] {
    width: 84px;
    padding: 7px 8px;
    font-size: 14px;
  }
  select {
    font-size: 13px;
    padding: 7px 26px 7px 8px;
    min-width: 120px;
  }
  .adjust-btn {
    min-width: 36px;
    min-height: 34px;
    font-size: 12px;
    padding: 0 8px;
  }
  .calc-tab {
    font-size: 12px;
    padding: 7px 12px;
  }
  .result-item__value {
    font-size: 15px;
  }
  .result-item--highlight .result-item__value {
    font-size: 18px;
  }
  .container {
    padding: 52px 16px 20px;
  }
  .container h1 {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  .app-title__main {
    font-size: 18px;
  }
  .calc-tab {
    font-size: 11px;
    padding: 6px 10px;
  }
}
