/* =====================================================
   ポーカー勝率・期待値計算＆学習クイズ スタイルシート
   PC・Android・iPhone（モバイルファースト）対応
   ===================================================== */

:root {
  --bg-page: #0b141a;
  --bg-surface: #132029;
  --bg-surface-alt: #1b2c37;
  --bg-table: radial-gradient(ellipse at center, #14533c 0%, #0d3b2a 65%, #08261b 100%);
  --border-table: #286a50;
  --border-subtle: rgba(255, 255, 255, 0.1);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #10b981;
  --accent-hover: #059669;
  --gold: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;

  /* 2色デッキ（デフォルト） */
  --suit-s: #1e293b;
  --suit-h: #dc2626;
  --suit-d: #dc2626;
  --suit-c: #1e293b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* 4色デッキモード */
body.four-color {
  --suit-s: #1e293b;
  --suit-h: #dc2626;
  --suit-d: #2563eb;
  --suit-c: #15803d;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ==================== ヘッダー・タブ ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 20, 26, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.brand-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-chip input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  margin: 0;
}

.mode-tabs {
  max-width: 760px;
  margin: 0 auto;
  padding: 4px 16px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tab-btn {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #042016;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

/* ==================== メインコンテナ ==================== */
.app-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 14px calc(32px + env(safe-area-inset-bottom));
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-panel.active {
  display: flex;
}

/* ==================== ポーカーテーブル ==================== */
.poker-table {
  background: var(--bg-table);
  border: 2px solid var(--border-table);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a7f3d0;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.street-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fcd34d;
  border: 1px solid rgba(252, 211, 77, 0.3);
}

/* カードスロット */
.card-slots {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.board-slots {
  justify-content: center;
}

.players-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hand-slots {
  justify-content: flex-start;
}

.card-slot {
  position: relative;
  width: 56px;
  height: 78px;
  border-radius: 10px;
  border: 2px dashed rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.card-slot.large {
  width: 62px;
  height: 86px;
}

.card-slot:active {
  transform: scale(0.95);
}

.card-slot:hover {
  border-color: rgba(255, 255, 255, 0.6);
}

.card-slot.optional {
  border-color: rgba(255, 255, 255, 0.16);
}

.slot-hint {
  font-size: 0.72rem;
  font-weight: 600;
}

/* 選択済みトランプカードデザイン */
.card-slot.filled,
.playing-card {
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: var(--shadow-card);
  color: #1e293b;
}

.playing-card {
  width: 56px;
  height: 78px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.playing-card.mystery {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  border: 1px solid #475569;
  color: #94a3b8;
  font-size: 1.4rem;
  font-weight: 700;
}

.card-rank {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.card-suit {
  font-size: 1.3rem;
  line-height: 1.05;
}

.suit-s { color: var(--suit-s); }
.suit-h { color: var(--suit-h); }
.suit-d { color: var(--suit-d); }
.suit-c { color: var(--suit-c); }

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== パネルカード・入力UI ==================== */
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-alt);
  padding: 4px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.stepper-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.stepper-btn:active {
  background: var(--accent);
  color: #042016;
}

.stepper-value {
  min-width: 44px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.bet-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.input-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.input-group input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.quick-bet-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-label {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-right: 2px;
}

.chip-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn:active {
  background: var(--accent);
  color: #042016;
}

/* ボタン共通 */
.btn-primary {
  padding: 13px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #10b981, #059669);
  color: #042016;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary.small {
  padding: 6px 10px;
  font-size: 0.76rem;
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.74rem;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  white-space: nowrap;
  flex-shrink: 0;
}

.full-width {
  width: 100%;
}

/* ==================== 計算結果表示 ==================== */
.validation-alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-size: 0.84rem;
  font-weight: 600;
}

.result-placeholder,
.result-loading {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 18px 8px;
}

.result-loading {
  color: #6ee7b7;
  font-weight: 700;
}

.assumption-bar {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
}

.assumption-bar.fixed {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.decision-banner {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border-left: 5px solid var(--accent);
  background: rgba(16, 185, 129, 0.12);
}

.decision-banner.strong {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
}

.decision-banner.call {
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
}

.decision-banner.marginal {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}

.decision-banner.fold {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.decision-title {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.decision-reason {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  opacity: 0.94;
}

.decision-caveat {
  margin: 6px 0 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.metric-box.highlight {
  border-color: rgba(16, 185, 129, 0.5);
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.metric-value {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 2px 0;
}

.metric-value.positive { color: #34d399; }
.metric-value.negative { color: #f87171; }

.metric-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* 比較ゲージバー */
.equity-bar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.equity-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.equity-bar-track {
  position: relative;
  height: 16px;
  background: var(--bg-surface-alt);
  border-radius: 999px;
  overflow: visible;
  border: 1px solid var(--border-subtle);
}

.equity-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #059669, #34d399);
  transition: width 0.35s ease;
}

.pot-odds-marker {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 3px;
  background: #f59e0b;
  transform: translateX(-50%);
  border-radius: 2px;
}

.marker-label {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
}

.analysis-box {
  background: rgba(0, 0, 0, 0.22);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.85rem;
}

.analysis-key {
  color: var(--text-secondary);
  white-space: nowrap;
}

.analysis-val {
  font-weight: 700;
  text-align: right;
}

.analysis-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
}

/* ==================== クイズモード ==================== */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
}

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.cat-stat-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-alt);
  padding: 3px 8px;
  border-radius: 999px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1rem;
  font-weight: 800;
}

.stat-value.accent {
  color: var(--gold);
}

.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.cat-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #042016;
}

.quiz-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-cat-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.quiz-situation-note {
  font-size: 0.76rem;
  color: #cbd5e1;
}

.quiz-question-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.quiz-board-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.quiz-cards-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.quiz-matchup {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
}

.quiz-player-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.quiz-vs {
  font-weight: 900;
  color: #fbbf24;
  font-size: 1rem;
}

.quiz-bet-banner {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.86rem;
}

.quiz-bet-banner strong {
  color: #fcd34d;
  font-size: 0.98rem;
}

/* 4択・2択ボタン */
.quiz-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice-btn {
  padding: 16px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.choice-btn:disabled {
  cursor: default;
}

.choice-btn.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

.choice-btn.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* 解説パネル */
.quiz-feedback {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feedback-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
}

.feedback-badge.ok {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.feedback-badge.ng {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.feedback-exact {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fcd34d;
}

.feedback-explanation {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.feedback-tip {
  background: rgba(56, 189, 248, 0.12);
  border-left: 4px solid #38bdf8;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.84rem;
  color: #bae6fd;
}

/* ==================== カードピッカーモーダル ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.picker-sheet {
  width: 100%;
  max-width: 600px;
  max-height: 86vh;
  background: var(--bg-surface);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

@media (min-width: 640px) {
  .picker-sheet {
    border-radius: var(--radius-lg);
  }
}

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.picker-header h2 {
  margin: 0;
  font-size: 1rem;
}

.picker-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
}

.picker-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picker-suit-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

@media (min-width: 520px) {
  .picker-suit-row {
    grid-template-columns: repeat(13, 1fr);
  }
}

.picker-card-btn {
  height: 46px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  line-height: 1.05;
}

.picker-card-btn .pk-rank {
  font-size: 0.88rem;
}

.picker-card-btn .pk-suit {
  font-size: 0.85rem;
}

.picker-card-btn:disabled {
  opacity: 0.22;
  cursor: not-allowed;
  background: #475569;
  border-color: #334155;
}

.picker-card-btn.selected-current {
  outline: 3px solid var(--accent);
  outline-offset: -2px;
}

/* ==================== 小画面スマホ微調整 ==================== */
@media (max-width: 420px) {
  .card-slot {
    width: 50px;
    height: 70px;
  }
  .card-slot.large {
    width: 54px;
    height: 76px;
  }
  .playing-card {
    width: 48px;
    height: 68px;
  }
  .card-rank {
    font-size: 1.1rem;
  }
  .card-suit {
    font-size: 1.15rem;
  }
  .metric-value {
    font-size: 1.12rem;
  }
}

/* ==================== 広告枠・フッター・解説ページ ==================== */
.ad-slot {
  margin: 4px 0;
  min-height: 0;
  text-align: center;
}
.ad-slot .ad-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.site-intro {
  font-size: 14px;
  color: var(--text-secondary);
}
.site-intro h2 { font-size: 16px; color: var(--text-primary); margin: 0 0 8px; }
.site-intro p { margin: 0 0 8px; }
.site-intro ul { margin: 0; padding-left: 20px; }
.site-intro a, .site-footer a, .article a { color: var(--info); }

.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 10px;
}
.site-footer p { margin: 4px 0; }

.article-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 20, 26, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding-top: env(safe-area-inset-top);
}
.article-header .header-inner a.brand { color: var(--text-primary); text-decoration: none; }
.article-header .back-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
}

.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 8px;
  font-size: 15.5px;
  line-height: 1.85;
}
.article h1 { font-size: 24px; line-height: 1.4; margin: 0 0 6px; }
.article .lead { color: var(--text-secondary); margin: 0 0 20px; }
.article h2 {
  font-size: 19px;
  margin: 32px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
}
.article h3 { font-size: 16px; margin: 22px 0 6px; color: var(--gold); }
.article p { margin: 0 0 14px; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 14px; }
.article li { margin-bottom: 4px; }
.article .formula {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 14px;
  font-weight: bold;
  text-align: center;
}
.article .note {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0 0 14px;
  font-size: 14px;
}
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 14px;
}
.article th, .article td {
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  text-align: left;
}
.article th { background: var(--bg-surface-alt); }
.article .cta {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #04130d;
  font-weight: bold;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 24px 0;
}
.guide-list { list-style: none; padding: 0 !important; }
.guide-list li {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px !important;
}
.guide-list a { font-weight: bold; }
.guide-list span { display: block; font-size: 13.5px; color: var(--text-secondary); }
