/* ===========================
   CSS カスタムプロパティ
   =========================== */
:root {
  /* 背景 */
  --bg-primary:  #080811;
  --bg-card:     #0f0f1c;
  --bg-input:    #0a0a16;
  --surface1:    #0f0f1c;
  --surface2:    #141425;
  --surface3:    #1a1a2e;

  /* 枠線 */
  --border:       #1e1e32;
  --border-focus: #6366f1;

  /* テキスト */
  --text-primary:   #e8e8f4;
  --text-secondary: #7070a0;
  --text-muted:     #48486a;

  /* アクセント */
  --accent:      #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.35);

  /* スコアカラー */
  --color-very-strong: #22c55e;
  --color-strong:      #4ade80;
  --color-neutral:     #eab308;
  --color-weak:        #f97316;
  --color-very-weak:   #ef4444;

  /* フォント・形 */
  --font-mono: 'SF Mono', 'Courier New', Courier, monospace;
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow:    0 4px 32px rgba(0,0,0,0.7);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.5);
}

/* ===========================
   リセット・ベース
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Hiragino Sans', 'Meiryo', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;  /* 横スクロール防止 */
}

/* リンクのデフォルトスタイルをリセット */
a { color: inherit; text-decoration: none; }
a:visited { color: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #2a2a40; border-radius: 3px; }

/* ===========================
   ヘッダー
   =========================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(8, 8, 17, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 0 8px var(--accent-glow);
}

.logo-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.header-date {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: center;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 7px 18px;
  background: transparent;
  border: 1px solid rgba(99,102,241,0.50);
  color: #a5b4fc;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.22s, border-color 0.22s, color 0.22s,
              transform 0.18s, box-shadow 0.22s, opacity 0.2s;
}
.header-cta:hover {
  background: rgba(99,102,241,0.10);
  border-color: rgba(99,102,241,0.80);
  color: #c7d2fe;
  transform: translateY(-1px);
}
/* 状態2: 判定を実行（緑・最強CTA） */
.header-cta.cta-exec {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(34,197,94,0.40);
}
.header-cta.cta-exec:hover {
  box-shadow: 0 6px 22px rgba(34,197,94,0.58);
  transform: translateY(-1px);
  color: #fff;
}
/* 状態3: 確認系（中間・パープル） */
.header-cta.cta-confirm {
  background: rgba(99,102,241,0.14);
  border-color: rgba(99,102,241,0.50);
  color: #a5b4fc;
  box-shadow: 0 4px 16px rgba(99,102,241,0.18);
}
.header-cta.cta-confirm:hover {
  background: rgba(99,102,241,0.24);
  border-color: rgba(99,102,241,0.80);
  color: #c7d2fe;
}
/* ローディング状態 */
.header-cta:disabled {
  opacity: 0.60;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===========================
   ヒーローセクション — デスクトップ2カラム
   =========================== */
.hero-section {
  background:
    radial-gradient(ellipse 70% 80% at 18% 55%, rgba(99,102,241,0.20) 0%, transparent 60%),
    radial-gradient(ellipse 45% 65% at 82% 18%, rgba(139,92,246,0.15) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 90% 85%, rgba(59,130,246,0.08) 0%, transparent 50%),
    linear-gradient(160deg, #090912 0%, #080811 60%, #07070f 100%);
  padding: 96px 48px 104px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(99,102,241,0.12);
}

/* ドットグリッド */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(99,102,241,0.20) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 40%, transparent 100%);
  pointer-events: none;
}

/* 右上装飾グロー */
.hero-section::after {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(139,92,246,0.10) 0%, transparent 65%);
  pointer-events: none;
  border-radius: 50%;
}

/* 2カラムflex（デスクトップ） */
.hero-inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 72px;
}

/* 左カラム */
.hero-content {
  flex: 1;
  min-width: 0;
}

/* 右カラム */
.hero-preview {
  flex-shrink: 0;
  width: 340px;
  perspective: 1200px;
  position: relative;
}
/* グローハロ（カード後方の光） */
.hero-preview::before {
  content: '';
  position: absolute;
  inset: -48px;
  background: radial-gradient(ellipse at 55% 50%, rgba(99,102,241,0.28) 0%, transparent 68%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 18px;
  background: rgba(99,102,241,0.10);
  border-radius: 20px;
  font-size: 12px;
  color: #a5b4fc;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  position: relative;
  isolation: isolate;
}
/* グラデーションボーダー（シマー） */
.hero-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(90deg,
    rgba(99,102,241,0.5),
    rgba(167,139,250,0.8),
    rgba(96,165,250,0.6),
    rgba(99,102,241,0.5));
  background-size: 300% 100%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: badge-shimmer 4s linear infinite;
  pointer-events: none;
}
@keyframes badge-shimmer {
  0%   { background-position: 0%   0%; }
  100% { background-position: 300% 0%; }
}

.hero-headline {
  font-size: clamp(36px, 3.6vw, 56px);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

.ha-green { color: var(--color-very-strong); text-shadow: 0 0 32px rgba(34,197,94,0.55); }
.ha-red   { color: var(--color-very-weak);   text-shadow: 0 0 32px rgba(239,68,68,0.55); }
.ha-blue  {
  background: linear-gradient(120deg, #818cf8 0%, #a78bfa 50%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 28px;
  max-width: 540px;
}
.hero-sub strong { color: var(--text-primary); }
.hero-br { display: none; }

.hero-flow {
  display: flex;
  align-items: center;
  justify-content: flex-start;  /* 左寄せ（デスクトップ） */
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15,15,28,0.85);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 10px;
  padding: 10px 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.hero-step:hover {
  border-color: rgba(99,102,241,0.38);
  box-shadow: 0 4px 20px rgba(99,102,241,0.12);
}
/* ステップ: 現在アクティブ */
.hero-step.step-active {
  border-color: rgba(99,102,241,0.55);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.20), 0 4px 20px rgba(99,102,241,0.18);
  background: rgba(99,102,241,0.12);
}
.hero-step.step-active .hf-num {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  box-shadow: 0 0 10px rgba(99,102,241,0.55);
}
/* ステップ: 完了済み */
.hero-step.step-done {
  opacity: 0.50;
  border-color: rgba(99,102,241,0.15);
}
.hero-step.step-done .hf-num {
  background: rgba(99,102,241,0.25);
}

.hf-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.hf-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.hf-note {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.hf-arrow { font-size: 16px; color: var(--text-muted); }

/* CTA行（ボタン＋信頼要素） */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: rgba(99,102,241,0.08);
  border: 1.5px solid rgba(99,102,241,0.55);
  color: #a5b4fc;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 0.22s, border-color 0.22s, color 0.22s, transform 0.18s, box-shadow 0.22s;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}
.hero-cta:hover {
  background: rgba(99,102,241,0.16);
  border-color: rgba(99,102,241,0.85);
  color: #c7d2fe;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.22);
}
.hero-cta:active { transform: scale(0.97); }

/* CTA補足テキスト */
.hero-cta-hint {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-top: -4px;
  width: 100%;
}

/* 信頼要素 */
.hero-trust {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.trust-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

/* ===========================
   ヒーロー プレビューカード
   =========================== */
.hero-preview-card {
  background: linear-gradient(160deg, #111128 0%, #0d0d20 100%);
  border: 1px solid rgba(99,102,241,0.22);
  border-radius: 22px;
  padding: 22px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 2px 0 rgba(255,255,255,0.06) inset,
    0 32px 80px rgba(0,0,0,0.75),
    0 0 100px rgba(99,102,241,0.14);
  position: relative;
  overflow: hidden;
  transform: rotateY(-6deg) rotateX(2deg) translateZ(0);
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94),
              box-shadow 0.5s ease;
  will-change: transform;
}
.hero-preview:hover .hero-preview-card {
  transform: rotateY(-2deg) rotateX(1deg) translateZ(8px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 2px 0 rgba(255,255,255,0.06) inset,
    0 40px 100px rgba(0,0,0,0.8),
    0 0 130px rgba(99,102,241,0.20);
}

/* 上辺グラデーションライン */
.hero-preview-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(99,102,241,0.6) 30%,
    rgba(167,139,250,0.8) 50%,
    rgba(99,102,241,0.6) 70%,
    transparent 100%);
}

/* 右下コーナーの光 */
.hero-preview-card::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

.hpc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.hpc-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.hpc-sample {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #86efac;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.22);
  border-radius: 8px;
  padding: 2px 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
/* 拍動するLIVEドット */
.hpc-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,0.9);
  animation: live-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

/* SVGリング */
.hpc-ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 14px;
}
.hpc-ring {
  width: 130px;
  height: 130px;
  transform: rotate(-90deg);
}
.hpc-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 8;
}
/* r=42, 周長=263.89, 72%表示→offset=73.89 */
.hpc-ring-fill {
  fill: none;
  stroke: #4ade80;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 263.89;
  stroke-dashoffset: 73.89;
  animation: ring-glow-pulse 3s ease-in-out infinite;
}
@keyframes ring-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(74,222,128,0.55)); }
  50%       { filter: drop-shadow(0 0 18px rgba(74,222,128,0.90)); }
}
.hpc-score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hpc-score {
  font-size: 46px;
  font-family: var(--font-mono);
  font-weight: 800;
  background: linear-gradient(135deg, #4ade80 0%, #86efac 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.hpc-unit {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* 判定ラベル */
.hpc-judgment {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-strong);
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 14px;
}

/* 指標グリッド */
.hpc-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 12px;
}
.hpc-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: var(--bg-primary);
  border-radius: 5px;
  font-size: 11px;
}
.hpc-m-label { color: var(--text-muted); }
.hpc-m-val   { color: var(--text-secondary); font-family: var(--font-mono); font-size: 10px; }
.hpc-m-val.pos { color: var(--color-strong); }

/* コメント */
.hpc-comment {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.65;
  padding: 10px 12px;
  background: rgba(99,102,241,0.04);
  border-left: 2px solid rgba(99,102,241,0.3);
  border-radius: 0 6px 6px 0;
}
.hpc-comment strong { color: var(--text-primary); }

/* ===========================
   アプリ本体レイアウト
   =========================== */
.app-main {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  padding: 32px 48px 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-panel {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}
.result-panel::-webkit-scrollbar { width: 4px; }
.result-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===========================
   カード（共通）
   =========================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-top: 1px;
}

.card-header-text { display: flex; flex-direction: column; gap: 3px; }

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 結果カード */
.result-card-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: center;
  margin-bottom: 16px;
}

/* ===========================
   入力グリッド
   =========================== */
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.input-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-item-full { grid-column: 1 / -1; }

.input-item label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}

.unit-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* フィールドラベル行 */
.field-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.field-label-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.range-badge {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  white-space: nowrap;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: 50%;
  color: #818cf8;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
  padding: 0;
  position: relative;
}
/* タップ領域を44×44pxに拡大（Apple HIG準拠） */
.help-btn::before {
  content: '';
  position: absolute;
  inset: -13px;
}
.help-btn:hover, .help-btn.active {
  background: rgba(99,102,241,0.2);
  border-color: var(--accent);
}

.help-text {
  margin: 2px 0 6px;
  padding: 10px 12px;
  background: rgba(99,102,241,0.06);
  border-left: 2px solid rgba(99,102,241,0.4);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.65;
  animation: fadeInDown 0.15s ease;
}
.help-text[hidden] { display: none; }

/* ===========================
   入力フィールド
   =========================== */
input[type="number"],
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  min-height: 44px;
}
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
input[type="number"]::placeholder,
textarea::placeholder { color: var(--text-secondary); opacity: 0.45; }
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { opacity: 0.3; }

/* ===========================
   チェックボックス
   =========================== */
.checkbox-group { display: flex; flex-direction: column; gap: 14px; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.checkbox-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: var(--bg-input);
  flex-shrink: 0;
  margin-top: 1px;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.checkbox-label:hover .checkbox-custom { border-color: var(--accent); }
.checkbox-text { line-height: 1.5; }
.checkbox-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 3px;
}

/* ===========================
   キーワードヒント
   =========================== */
.kw-hint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
}
.kw-hint-label {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 2px;
}
.kw-chip {
  font-size: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 8px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ===========================
   ボタン
   =========================== */
.button-group {
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.03em;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow:
    0 6px 24px rgba(34,197,94,0.40),
    0 0 0 1px rgba(34,197,94,0.25) inset,
    0 1px 0 rgba(255,255,255,0.18) inset;
  position: relative;
  overflow: hidden;
  font-size: 16px;
  padding: 16px 24px;
  letter-spacing: 0.02em;
}
/* 光走り */
.btn-primary::after {
  content: '';
  position: absolute;
  top: -20%; left: -70%;
  width: 45%; height: 140%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.20), transparent);
  transform: skewX(-12deg);
  animation: judge-shine 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes judge-shine {
  0%        { left: -70%; opacity: 0; }
  8%        { opacity: 1; }
  38%, 100% { left: 150%; opacity: 0; }
}
.btn-primary:hover {
  box-shadow:
    0 10px 32px rgba(34,197,94,0.55),
    0 0 0 1px rgba(34,197,94,0.35) inset,
    0 1px 0 rgba(255,255,255,0.22) inset;
  transform: translateY(-2px);
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ボタン下補足テキスト */
.btn-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* ===========================
   前回値復元バー
   =========================== */
.restore-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.btn-restore {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  min-height: 36px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.btn-restore:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(99,102,241,0.06);
}
.btn-restore:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* 保存完了トースト */
.save-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(10,10,20,0.96);
  border: 1px solid rgba(74,222,128,0.35);
  color: #4ade80;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  opacity: 0;
  pointer-events: none;
  z-index: 500;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6), 0 0 0 1px rgba(74,222,128,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* タグバッジ */
.tag-imp {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 3px;
  padding: 0 4px;
  vertical-align: middle;
  margin-left: 2px;
}
.tag-opt {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: rgba(156,163,175,0.12);
  color: #9ca3af;
  border: 1px solid rgba(156,163,175,0.2);
  border-radius: 3px;
  padding: 0 4px;
  vertical-align: middle;
  margin-left: 2px;
}

/* ===========================
   結果パネル — スコアリング
   =========================== */
.result-card {
  transform-origin: top center;
}
.result-card.result-animate {
  animation: resultReveal 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* SVG リング */
.score-ring-wrap {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 0 auto 16px;
}
.score-ring {
  width: 190px;
  height: 190px;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 10;
}
.ring-fill {
  fill: none;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 10;
  stroke-linecap: round;
  /* 周長: 2 * π * 52 ≈ 326.73 */
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1),
              stroke 0.4s ease;
}
.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.score-value {
  font-size: 58px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  transition: color 0.4s;
}
.score-unit {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* スコア数値カラークラス */
.score-value.very-strong { color: var(--color-very-strong); }
.score-value.strong      { color: var(--color-strong); }
.score-value.neutral     { color: var(--color-neutral); }
.score-value.weak        { color: var(--color-weak); }
.score-value.very-weak   { color: var(--color-very-weak); }

/* ===========================
   スコアスペクトラム
   =========================== */
.score-spectrum {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  height: 34px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.spectrum-band {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: flex 0.35s ease;
  cursor: default;
}
.spectrum-band.active { flex: 2.2; }
.ss-label { font-size: 10px; font-weight: 700; color: #fff; opacity: 0.9; white-space: nowrap; }
.ss-range { font-size: 9px; color: rgba(255,255,255,0.55); white-space: nowrap; }
.ss-very-weak   { background: linear-gradient(180deg, #991b1b, #7f1d1d); }
.ss-weak        { background: linear-gradient(180deg, #c2410c, #9a3412); }
.ss-neutral     { background: linear-gradient(180deg, #525252, #3f3f3f); }
.ss-strong      { background: linear-gradient(180deg, #1d4ed8, #1e40af); }
.ss-very-strong { background: linear-gradient(180deg, #15803d, #166534); }
.spectrum-band.active.ss-very-weak   { box-shadow: 0 0 14px rgba(239,68,68,0.5); }
.spectrum-band.active.ss-weak        { box-shadow: 0 0 14px rgba(249,115,22,0.5); }
.spectrum-band.active.ss-neutral     { box-shadow: 0 0 14px rgba(156,163,175,0.35); }
.spectrum-band.active.ss-strong      { box-shadow: 0 0 14px rgba(96,165,250,0.5); }
.spectrum-band.active.ss-very-strong { box-shadow: 0 0 14px rgba(74,222,128,0.5); }

/* ===========================
   判定ラベル
   =========================== */
.judgment {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  padding: 11px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  transition: color 0.4s, background 0.4s, border-color 0.4s;
  letter-spacing: 0.03em;
}
.judgment.very-strong { color: var(--color-very-strong); background: rgba(34,197,94,0.08);  border-color: rgba(34,197,94,0.25);  }
.judgment.strong      { color: var(--color-strong);      background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.25); }
.judgment.neutral     { color: var(--color-neutral);     background: rgba(234,179,8,0.08);  border-color: rgba(234,179,8,0.25);  }
.judgment.weak        { color: var(--color-weak);        background: rgba(249,115,22,0.08); border-color: rgba(249,115,22,0.25); }
.judgment.very-weak   { color: var(--color-very-weak);   background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.25);  }

/* bg クラス（JS互換） */
.bg-very-strong { background: rgba(34,197,94,0.08);  border-color: rgba(34,197,94,0.25)  !important; }
.bg-strong      { background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.25) !important; }
.bg-neutral     { background: rgba(234,179,8,0.08);  border-color: rgba(234,179,8,0.25)  !important; }
.bg-weak        { background: rgba(249,115,22,0.08); border-color: rgba(249,115,22,0.25) !important; }
.bg-very-weak   { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.25)  !important; }

/* テキストカラークラス（履歴など共通） */
.very-strong { color: var(--color-very-strong) !important; }
.strong      { color: var(--color-strong)      !important; }
.neutral     { color: var(--color-neutral)     !important; }
.weak        { color: var(--color-weak)        !important; }
.very-weak   { color: var(--color-very-weak)   !important; }

/* ===========================
   メタグリッド
   =========================== */
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.meta-item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.meta-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===========================
   コメントボックス
   =========================== */
.comment-box {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-bottom: 14px;
}
.comment-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.comment-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===========================
   キーワードアラート
   =========================== */
.keyword-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
#keyword-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.keyword-tag {
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.25);
  border-radius: 12px;
  color: #fde047;
  font-weight: 600;
}

/* ===========================
   指標別寄与度（折りたたみ）
   =========================== */
.breakdown-details { margin-top: 12px; }
.breakdown-summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 9px 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}
.breakdown-summary::-webkit-details-marker { display: none; }
.breakdown-summary::after { content: '▼'; font-size: 9px; color: var(--text-muted); transition: transform 0.2s; }
.breakdown-details[open] .breakdown-summary::after { transform: rotate(180deg); }
.breakdown-details[open] .breakdown-summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.breakdown-summary:hover { background: var(--surface3); }

.breakdown-section {
  background: var(--surface1);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 12px;
}
.breakdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.breakdown-name {
  width: 120px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breakdown-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.breakdown-bar-center {
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.2);
  z-index: 1;
}
.breakdown-bar-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 3px;
  transition: width 0.4s ease, left 0.4s ease;
}
.breakdown-contrib {
  width: 36px;
  font-size: 11px;
  font-family: var(--font-mono);
  text-align: right;
  flex-shrink: 0;
}

/* ===========================
   解釈ガイド
   =========================== */
.interp-guide {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.interp-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  background: var(--surface2);
  user-select: none;
  transition: background 0.15s;
}
.interp-summary::-webkit-details-marker { display: none; }
.interp-summary::after { content: '▼'; margin-left: auto; font-size: 9px; color: var(--text-muted); transition: transform 0.2s; }
.interp-guide[open] .interp-summary::after { transform: rotate(180deg); }
.interp-summary:hover { background: var(--surface3); }
.interp-rows { padding: 6px 0; background: var(--surface1); }
.interp-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.interp-row:last-child { border-bottom: none; }
.interp-badge {
  min-width: 58px;
  text-align: center;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.interp-badge.ss-very-weak   { background: #7f1d1d; }
.interp-badge.ss-weak        { background: #9a3412; }
.interp-badge.ss-neutral     { background: #3f3f3f; }
.interp-badge.ss-strong      { background: #1e40af; }
.interp-badge.ss-very-strong { background: #166534; }
.interp-content { flex: 1; }
.interp-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.interp-title.very-strong { color: var(--color-very-strong); }
.interp-title.strong      { color: var(--color-strong); }
.interp-title.neutral     { color: var(--color-neutral); }
.interp-title.weak        { color: var(--color-weak); }
.interp-title.very-weak   { color: var(--color-very-weak); }
.interp-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* ===========================
   セクション共通
   =========================== */
.section-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
}
.section-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

/* ===========================
   このツールについて
   =========================== */
.about-section {
  background: linear-gradient(180deg, var(--bg-primary) 0%, #0b0b17 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 72px 0;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);  /* デスクトップ: 3カラム固定 */
  gap: 20px;
}
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}
.about-card:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-2px);
}
.about-icon-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 6px;
  padding: 3px 10px;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.about-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.about-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ===========================
   履歴セクション
   =========================== */
.history-section {
  padding: 48px 0 80px;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.history-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-title-wrap .section-heading { margin-bottom: 0; }
.history-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 10px;
  font-family: var(--font-mono);
}
.history-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.btn-history {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  font-family: inherit;
}
.btn-compare {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(99,102,241,0.3);
}
.btn-compare:disabled {
  background: var(--surface2);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-compare:not(:disabled):hover {
  box-shadow: 0 4px 20px rgba(99,102,241,0.45);
  transform: translateY(-1px);
}
.btn-clear-history {
  background: transparent;
  color: var(--text-secondary);
}
.btn-clear-history:hover {
  color: var(--color-very-weak);
  border-color: rgba(239,68,68,0.35);
}

.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* チャート */
.chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 16px 8px;
  margin-bottom: 20px;
}
.chart-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
#score-chart { width: 100%; display: block; }

/* ===========================
   履歴カード
   =========================== */
.history-cards-wrap { }
.history-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.hist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.hist-card:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.hist-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hist-date {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex: 1;
  white-space: nowrap;
}

.history-check {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.hist-score-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hist-score-num {
  font-size: 38px;
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1;
}
.hist-judgment {
  font-size: 12px;
  font-weight: 700;
}

.hist-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.hist-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  padding: 3px 6px;
  background: var(--bg-primary);
  border-radius: 4px;
  gap: 4px;
}
.hm-label { color: var(--text-muted); white-space: nowrap; }
.hm-val   { color: var(--text-secondary); font-family: var(--font-mono); font-size: 10px; }

.hist-card-actions { display: flex; gap: 5px; }

.btn-load-rec, .btn-del-rec {
  flex: 1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  font-family: inherit;
  transition: all 0.15s;
}
.btn-load-rec {
  background: rgba(99,102,241,0.1);
  color: #a5b4fc;
  border-color: rgba(99,102,241,0.2);
}
.btn-load-rec:hover { background: rgba(99,102,241,0.2); border-color: var(--accent); }
.btn-del-rec {
  background: transparent;
  color: var(--text-muted);
}
.btn-del-rec:hover { background: rgba(239,68,68,0.08); color: var(--color-very-weak); border-color: rgba(239,68,68,0.2); }

/* ===========================
   比較パネル
   =========================== */
.comparison-panel {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.comparison-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.btn-close-comparison {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-close-comparison:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.comparison-body { padding: 16px; }

.comp-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.comp-score-box {
  flex: 1;
  text-align: center;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
}
.comp-date-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-family: var(--font-mono); }
.comp-score-num  { font-size: 40px; font-family: var(--font-mono); font-weight: 700; line-height: 1; }
.comp-judgment-label { font-size: 13px; font-weight: 600; margin-top: 4px; }
.comp-delta-box {
  text-align: center;
  padding: 0 8px;
}
.comp-delta-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.comp-delta-num   { font-size: 26px; font-family: var(--font-mono); font-weight: 700; }
.comp-delta-num.positive { color: var(--color-strong); }
.comp-delta-num.negative { color: var(--color-weak); }
.comp-delta-num.zero     { color: var(--text-muted); }

.comparison-table-scroll { overflow-x: auto; }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.comparison-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.comparison-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  white-space: nowrap;
}
.comparison-table tr:last-child td { border-bottom: none; }
.ct-center { text-align: center; }
.ct-metric { color: var(--text-primary); font-weight: 600; }
.diff-pos  { color: var(--color-strong); font-weight: 700; }
.diff-neg  { color: var(--color-weak);   font-weight: 700; }
.diff-zero { color: var(--text-muted); }

/* ===========================
   スマホ用スティッキーバー
   =========================== */
.mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(8, 8, 17, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  gap: 10px;
  align-items: center;
}
.btn-mobile-judge {
  flex: 1;
  padding: 15px 20px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(34,197,94,0.35);
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  font-family: inherit;
}
.btn-mobile-judge:active { transform: scale(0.98); opacity: 0.9; }
.btn-mobile-reset {
  padding: 15px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-mobile-reset:active { opacity: 0.7; }

/* ===========================
   アニメーション
   =========================== */
@keyframes resultReveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* セクションハイライト（移動先フィードバック） */
@keyframes sectionPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.00); }
  35%       { box-shadow: 0 0 0 10px rgba(99,102,241,0.22); }
}
.section-highlight { animation: sectionPulse 0.95s ease forwards; }

/* 結果カードハイライト（判定完了フィードバック） */
@keyframes resultPulse {
  0%, 100% { box-shadow: var(--shadow-sm); }
  35%       { box-shadow: 0 0 0 12px rgba(34,197,94,0.28), var(--shadow-sm); }
}
.result-highlight { animation: resultPulse 1.20s ease forwards; }

/* 履歴カードハイライト */
@keyframes histCardPulse {
  0%, 100% { box-shadow: none; }
  35%       { box-shadow: 0 0 0 8px rgba(99,102,241,0.20); }
}
.history-highlight { animation: histCardPulse 1.00s ease forwards; }

/* ==========================================================
   レスポンシブ — 4段階ブレークポイント
   mobile   : ≤767px
   tablet   : 768px–1023px
   desktop  : 1024px–1439px  ← デフォルトスタイルがここ
   wide     : ≥1440px
   ========================================================== */

/* ===========================
   Wide Desktop (≥1440px)
   =========================== */
@media (min-width: 1440px) {
  .hero-section  { padding: 100px 64px 100px; }
  .hero-inner    { gap: 88px; }
  .hero-headline { font-size: 60px; }
  .hero-preview  { width: 380px; }
  .app-main      { grid-template-columns: 1fr 460px; padding: 40px 64px 56px; }
  .section-inner { padding: 0 64px; }
}

/* ===========================
   Tablet (768px – 1023px)
   =========================== */
@media (max-width: 1023px) {
  /* ヒーロー: 1カラム中央揃え、プレビュー非表示 */
  .hero-section  { padding: 64px 32px 72px; }
  .hero-inner    { flex-direction: column; gap: 0; align-items: center; }
  .hero-content  { text-align: center; }
  .hero-preview  { display: none; }
  .hero-headline { font-size: clamp(32px, 5vw, 48px); }
  .hero-sub      { max-width: 560px; text-align: center; }
  .hero-flow     { justify-content: center; }
  .hero-actions  { flex-direction: column; align-items: center; gap: 16px; }
  .hero-trust    { justify-content: center; }

  /* アプリ: 2カラムを維持しつつ右カラムを狭く */
  .app-main  { grid-template-columns: 1fr 360px; padding: 24px 32px 40px; gap: 20px; }
  .section-inner { padding: 0 32px; }

  /* Aboutグリッド: タブレットも3カラム維持 */
}

/* ===========================
   Mobile (≤768px)
   =========================== */
@media (max-width: 768px) {
  /* ヘッダー */
  .header-cta  { display: none; }
  .header-date { flex: 1; text-align: right; }

  /* ヒーロー */
  .hero-section  { padding: 52px 20px 56px; }
  .hero-headline { font-size: clamp(28px, 8.5vw, 40px); }
  .hero-sub      { font-size: 14px; }
  .hero-br       { display: inline; }
  .hero-flow     { gap: 5px; }
  .hero-step     { padding: 8px 10px; }
  .hf-text       { font-size: 12px; }
  .hf-num        { width: 20px; height: 20px; font-size: 11px; }
  .hero-cta      { font-size: 15px; padding: 14px 30px; }
  .hero-actions  { flex-direction: column; align-items: center; gap: 14px; }
  .hero-trust    { justify-content: center; }

  /* アプリ: 1カラム */
  .app-main {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 100px;
    gap: 16px;
  }
  .input-panel { order: 1; }

  /* 結果パネル: 判定前は非表示、判定後はstickyで上部追従 */
  .result-panel {
    order: -1;
    display: none;
    position: static;
    max-height: none;
    overflow-y: visible;
  }
  .result-panel.result-confirmed {
    display: block;
    position: sticky;
    top: 60px;
    z-index: 90;
    max-height: 46vh;
    overflow-y: auto;
  }

  /* カード */
  .card        { padding: 16px; border-radius: var(--radius); }
  .card-step   { min-width: 34px; height: 34px; font-size: 13px; }
  .card-title  { font-size: 15px; }

  /* 入力グリッド: フィールド間隔を16px以上確保 */
  .input-grid  { gap: 16px; }
  .input-item  { margin-bottom: 0; }

  /* iOS zoom防止 + タップターゲット44px */
  input[type="number"],
  textarea { font-size: 16px; min-height: 46px; }

  /* ヘルプボタン: モバイルでも44×44タップ領域 */
  .help-btn { width: 22px; height: 22px; }
  .help-btn::before { inset: -11px; }

  /* 復元バー */
  .restore-bar { margin-bottom: 16px; }
  .btn-restore { min-height: 44px; font-size: 13px; }

  /* スコアリング */
  .score-ring-wrap { width: 160px; height: 160px; }
  .score-ring      { width: 160px; height: 160px; }
  .score-value     { font-size: 46px; }

  /* PCボタン非表示・スマホバー表示 */
  #pc-button-group { display: none; }
  .mobile-bar      { display: flex; }

  /* About */
  .about-section { padding: 40px 0; }
  .about-grid    { grid-template-columns: 1fr; gap: 10px; }

  /* セクション共通 */
  .section-inner    { padding: 0 16px; }
  .section-heading  { font-size: 20px; }
  .history-section  { padding: 36px 0 80px; }

  /* 履歴カード */
  .history-cards { grid-template-columns: 1fr 1fr; }
  .hist-score-num { font-size: 30px; }

  /* 履歴ヘッダー */
  .history-header  { flex-direction: column; align-items: flex-start; gap: 10px; }
  .history-actions { width: 100%; }
  .btn-compare     { flex: 1; }

  /* 比較パネル */
  .comparison-body  { padding: 12px; }
  .comp-score-row   { gap: 8px; }
}

/* ===========================
   Extra Small (≤480px)
   =========================== */
@media (max-width: 480px) {
  .hero-headline  { font-size: 28px; }
  .history-cards  { grid-template-columns: 1fr; }
  .hero-flow      { gap: 4px; }
  .hero-step      { padding: 7px 9px; }
  .hf-text        { font-size: 11px; }
  .input-grid     { gap: 16px; }
}
