/* ─── Layout ──────────────────────────────────────────────── */
.page-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}

.hero-meta {
  font-size: 0.83rem; color: var(--muted); margin-bottom: 2.5rem;
  display: flex; gap: 1.2rem; flex-wrap: wrap;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

/* ─── Table of Contents ───────────────────────────────────── */
.toc {
  background: var(--slate);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--r);
  padding: 1.4rem 1.8rem;
  margin-bottom: 3rem;
}
.toc-title {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--gold); font-weight: 700; margin-bottom: 0.8rem;
}
.toc ol { padding-left: 1.3rem; }
.toc li { margin-bottom: 0.35rem; }
.toc a { font-size: 0.88rem; color: var(--muted); }
.toc a:hover { color: var(--gold); text-decoration: none; }

/* ─── Article body ────────────────────────────────────────── */
h2 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 3rem 0 1rem;
  color: var(--text);
  padding-top: 0.5rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2rem 0 0.6rem;
  color: var(--gold);
}

p {
  font-size: 0.96rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

p strong { color: var(--text); }

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
li {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  line-height: 1.7;
}
li strong { color: var(--text); }

/* ─── Callout box ─────────────────────────────────────────── */
.callout {
  background: var(--slate);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--r);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}
.callout-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--gold); font-weight: 700; margin-bottom: 0.5rem;
}
.callout p { margin-bottom: 0; font-size: 0.9rem; }

.callout-green {
  border-left-color: var(--chip-green);
}
.callout-green .callout-label { color: #6fd98f; }

.callout-red {
  border-left-color: var(--chip-red);
}
.callout-red .callout-label { color: var(--chip-red-light); }

/* ─── Tag table ───────────────────────────────────────────── */
.tag-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}
.tag-table thead th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: var(--slate2);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.tag-table td,
.tag-table tbody th {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.tag-table tbody th { text-align: left; }
.tag-table tbody tr:last-child > * { border-bottom: none; }
.tag-table .tag-pos { color: #6fd98f; font-weight: 800; font-size: 1.05rem; }
.tag-table .tag-zero { color: var(--muted); font-weight: 800; font-size: 1.05rem; }
.tag-table .tag-neg { color: var(--chip-red-light); font-weight: 800; font-size: 1.05rem; }
.tag-table .cards { color: var(--text); font-weight: 600; }

/* ─── Bet ramp table ──────────────────────────────────────── */
.ramp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}
.ramp-table thead th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: var(--slate2);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.ramp-table td,
.ramp-table tbody th {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.ramp-table tbody th { text-align: left; }
.ramp-table tbody tr:last-child > * { border-bottom: none; }
.ramp-table .units { color: var(--gold); font-weight: 700; }
.ramp-table .edge-pos { color: #6fd98f; font-weight: 600; }
.ramp-table .edge-neg { color: var(--chip-red-light); font-weight: 600; }

/* ─── Steps ───────────────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1.5rem 0;
}
.step {
  display: flex;
  gap: 1.2rem;
  position: relative;
  padding-bottom: 1.6rem;
}
.step:last-child { padding-bottom: 0; }
.step-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.step-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--felt-mid);
  border: 2px solid rgba(216,176,76,0.3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; color: var(--gold);
  position: relative; z-index: 1;
}
.step-line {
  flex: 1; width: 2px;
  background: linear-gradient(to bottom, rgba(216,176,76,0.25), rgba(216,176,76,0.03));
  margin-top: 4px;
}
.step:last-child .step-line { display: none; }
.step-body { padding-top: 0.3rem; }
.step-body h4 { font-size: 0.98rem; font-weight: 700; margin-bottom: 0.3rem; color: var(--text); }
.step-body p { font-size: 0.88rem; margin-bottom: 0; }

/* ─── Systems comparison ──────────────────────────────────── */
.systems-compare {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.sys-box {
  background: var(--slate);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.2rem;
}
.sys-box-name {
  font-weight: 800; font-size: 0.95rem; margin-bottom: 0.3rem; color: var(--text);
}
.sys-box-level {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gold); font-weight: 600; margin-bottom: 0.6rem;
}
.sys-box p { font-size: 0.82rem; margin-bottom: 0; }

/* ─── CTA banner ──────────────────────────────────────────── */
.guide-cta {
  background: linear-gradient(135deg, rgba(14,58,47,0.7) 0%, rgba(9,27,23,0.9) 100%);
  border: 1px solid rgba(216,176,76,0.2);
  border-radius: var(--r);
  padding: 2.5rem 2rem;
  text-align: center;
  margin: 3rem 0;
}
.guide-cta h2 { margin: 0 0 0.6rem; font-size: 1.4rem; }
.guide-cta p { margin-bottom: 1.5rem; font-size: 0.92rem; }
.btn-gold {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--gold); color: var(--felt-dark);
  font-weight: 800; font-size: 0.92rem;
  padding: 0.75rem 1.6rem; border-radius: 999px;
  text-decoration: none; transition: background 0.2s, transform 0.15s;
}
.btn-gold:hover { background: var(--gold-bright); transform: translateY(-1px); text-decoration: none; }

/* ─── FAQ ─────────────────────────────────────────────────── */
.faq-list { margin-top: 1.5rem; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 0.75rem;
  background: var(--slate);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item:hover { border-color: var(--gold-20); }
.faq-item summary {
  padding: 1rem 1.3rem;
  font-weight: 700; font-size: 0.95rem;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  color: var(--text); user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 1.2rem; color: var(--gold);
  flex-shrink: 0; transition: transform 0.25s; font-weight: 400; line-height: 1;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] { border-color: var(--gold-20); }
.faq-item[open] summary { color: var(--gold); }
.faq-answer {
  padding: 0 1.3rem 1.1rem;
  font-size: 0.88rem; color: var(--muted); line-height: 1.75;
  border-top: 1px solid var(--border); padding-top: 0.9rem;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  nav { padding: 0.9rem 1.2rem; }
  .page-wrap { padding: 2.5rem 1rem 5rem; }
  .systems-compare { grid-template-columns: 1fr; }
  h2 { font-size: 1.3rem; }
}

/* ─── Basic strategy tables ───────────────────────────────── */
.table-scroll { overflow-x: auto; margin: 1.2rem 0 1.8rem; -webkit-overflow-scrolling: touch; }
.bs-table { width: 100%; min-width: 340px; border-collapse: separate; border-spacing: 2px; font-size: 0.82rem; }
.bs-table caption { caption-side: top; text-align: left; color: var(--muted); font-size: 0.8rem; padding-bottom: 0.4rem; }
.bs-table th { color: var(--muted); font-weight: 700; padding: 0.35rem 0.2rem; text-align: center; }
.bs-table tbody th { color: var(--text); text-align: left; padding-left: 0.4rem; white-space: nowrap; }
.bs-table td { text-align: center; font-weight: 800; padding: 0.42rem 0.1rem; border-radius: 4px; color: var(--text); }
.a-h { background: rgba(184, 58, 58, 0.32); }
.a-s { background: rgba(45, 138, 69, 0.34); }
.a-d { background: rgba(216, 176, 76, 0.42); color: #fff6dc; }
.a-ds { background: rgba(216, 176, 76, 0.2); color: var(--gold-bright); }
.a-p { background: rgba(90, 140, 220, 0.34); }
.bs-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 0.6rem 0 1.4rem; font-size: 0.82rem; color: var(--muted); }
.bs-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.bs-legend b { display: inline-block; min-width: 2rem; text-align: center; padding: 0.15rem 0.3rem; border-radius: 4px; color: var(--text); }

/* ─── Calculator ──────────────────────────────────────────── */
.calc { background: var(--slate); border: 1px solid var(--border); border-radius: var(--r); padding: 1.4rem; margin: 1.6rem 0 2rem; }
.calc-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.calc label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.35rem; }
.calc input[type="number"], .calc select {
  width: 100%; padding: 0.6rem 0.7rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 1rem;
}
.calc .checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; }
.calc .checks label { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; text-transform: none; letter-spacing: 0; font-size: 0.88rem; color: var(--text); font-weight: 500; margin: 0; cursor: pointer; }
.calc .checks input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--gold); }
.rc-field { display: flex; gap: 0.5rem; }
.rc-field input { flex: 1; min-width: 0; }
.sign-toggle {
  flex-shrink: 0; width: 48px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--slate2); color: var(--gold); font: inherit; font-size: 1.2rem; font-weight: 800; cursor: pointer;
}
.sign-toggle:hover { border-color: var(--gold-20); }
.calc-outputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1.3rem; }
.calc-out { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem; text-align: center; }
.calc-out .v { display: block; font-size: 1.6rem; font-weight: 900; color: var(--gold); line-height: 1.2; }
.calc-out .k { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.2rem; }
.calc-note { font-size: 0.8rem; color: var(--muted); margin: 0.9rem 0 0; }
.formula { font-size: 1.15rem; font-weight: 800; text-align: center; padding: 1rem; border: 1px dashed var(--gold-20); border-radius: var(--r); margin: 1rem 0 1.4rem; color: var(--text); }
.ramp-table tr.is-active > * { background: var(--gold-10); }
.ramp-table tr.is-active > th { color: var(--gold); }

@media (max-width: 600px) {
  .calc { padding: 1rem; }
  .calc-inputs { gap: 0.75rem; }
  .calc-out .v { font-size: 1.35rem; }
  .calc-outputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bs-table { font-size: 0.74rem; }
}

/* ─── Strategy chart page ─────────────────────────────────── */
.hero-meta-tight { margin-bottom: 1.2rem; }
.chart-intro { color: var(--muted); font-size: 1rem; margin-bottom: 1rem; }
.chart-rules {
  font-size: 0.85rem; color: var(--muted); line-height: 1.6;
  padding: 0.7rem 0.9rem; margin-bottom: 1.2rem;
  border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; background: var(--slate);
}
.chart-rules strong { color: var(--text); }
.chart-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1rem; margin-bottom: 0.5rem;
}
.chart-toolbar .bs-legend { margin: 0; }
.chart-toolbar + h2 { margin-top: 1.5rem; }
.print-btn {
  padding: 0.45rem 0.9rem; border-radius: 8px; border: 1px solid var(--gold-20);
  background: var(--gold-10); color: var(--gold); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.print-btn:hover { background: var(--gold-15); }
.print-only { display: none; }

/* ─── Print: the strategy chart fits on one page ──────────── */
@media print {
  @page { margin: 10mm; }
  body { background: #fff; color: #000; line-height: 1.3; }
  .site-nav, .site-footer, .eyebrow, .hero-meta, .chart-intro, .print-btn,
  #how-to-use, #how-to-use ~ *,
  #hard-totals + p, #soft-totals + p, #pairs + p, .bs-table caption { display: none !important; }
  .page-wrap { max-width: none; padding: 0; }
  h1 { font-size: 16pt; margin: 0 0 4pt; color: #000; }
  h2 { font-size: 11pt; margin: 6pt 0 2pt; color: #000; break-after: avoid; }
  .chart-rules { background: none; border: none; padding: 0; margin: 0 0 4pt; font-size: 8pt; color: #000; }
  .chart-rules strong, .chart-rules a { color: #000; }
  .chart-toolbar { margin: 0 0 2pt; }
  .bs-legend { font-size: 8pt; color: #000; }
  .table-scroll { overflow: visible; margin: 0 0 4pt; break-inside: avoid; }
  .screen-only { display: none; }
  .print-only { display: block; margin-top: 6pt; font-size: 8pt; color: #444; }
  .bs-table { font-size: 8pt; border-spacing: 1px; table-layout: fixed; }
  .bs-table thead th:first-child { width: 10%; }
  .bs-table th, .bs-table td, .bs-legend b { color: #000 !important; padding: 1.5pt 1pt; }
  .bs-table td, .bs-legend b { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .a-h { background: #f3b8b8; }
  .a-s { background: #b8e2c2; }
  .a-d { background: #f0d785; }
  .a-ds { background: #f8ecc4; }
  .a-p { background: #bcd0f0; }
}

/* ─── Practice trainer ────────────────────────────────────── */
.trainer [hidden] { display: none !important; }
.tr-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem; align-items: end; }
.tr-modes { display: flex; gap: 0.5rem; }
.tr-mode {
  flex: 1 1 0; min-height: 44px; padding: 0.55rem 0.6rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--slate2); color: var(--muted); font: inherit; font-size: 0.86rem; font-weight: 700; cursor: pointer;
}
.tr-mode:hover { border-color: var(--gold-20); }
.tr-mode[aria-pressed="true"] { background: var(--gold-10); border-color: var(--gold-20); color: var(--gold); }
.tr-mode:disabled { opacity: 0.4; cursor: not-allowed; }
.tr-note { font-size: 0.82rem; margin: 0.8rem 0 0; }
.tr-panel { margin-top: 1.1rem; }
.tr-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
#panel-tc .tr-settings { grid-template-columns: minmax(0, 1fr); max-width: 14rem; }
.trainer select:disabled { opacity: 0.55; }

.tr-stage {
  min-height: 13rem; margin: 1rem 0; padding: 1.2rem 0.8rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem;
  border-radius: 12px; border: 1px solid rgba(216, 176, 76, 0.14);
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-mid) 75%);
}
.tr-cards { display: flex; gap: 0.6rem; justify-content: center; min-height: calc(clamp(64px, 20vw, 92px) * 1.4); }
.tr-cards.is-blank { visibility: hidden; }
.pcard {
  position: relative; width: clamp(64px, 20vw, 92px); aspect-ratio: 5 / 7;
  display: flex; align-items: center; justify-content: center;
  background: #f6f1e3; color: #1b1f1d; border-radius: 10px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  animation: pcard-in 0.12s ease-out;
}
/* Four-colour deck: spades black, hearts red, diamonds blue, clubs green */
.pcard.suit-hearts { color: #b83a3a; }
.pcard.suit-diamonds { color: #1f5fbf; }
.pcard.suit-clubs { color: #1d7a3a; }
.pc-rank { position: absolute; top: 0.35rem; left: 0.5rem; font-size: 1.1rem; line-height: 1; }
.pc-suit { font-size: clamp(1.8rem, 6vw, 2.5rem); line-height: 1; }
@keyframes pcard-in { from { opacity: 0.2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pcard { animation: none; } }

.tr-progress { width: 100%; max-width: 20rem; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.tr-progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.15s; }
.tr-progress-text { font-size: 0.78rem; margin: 0; min-height: 1.2em; }
.tr-msg { margin: 0; text-align: center; font-size: 0.92rem; color: var(--text); max-width: 34rem; }
.tr-msg.is-right { color: #6fd98f; }
.tr-msg.is-wrong { color: var(--chip-red-light); }

.tr-question { display: grid; grid-template-columns: repeat(2, minmax(0, 9rem)); gap: 0.75rem; }
.tr-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(3.8rem, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.tr-ans {
  min-height: 52px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--gold); font: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer;
}
.tr-ans:hover:not(:disabled) { border-color: var(--gold); }
.tr-ans:disabled { opacity: 0.5; cursor: default; }

.tr-answer { margin-bottom: 1rem; }
.tr-answer .tr-btn { flex-shrink: 0; }
.tr-controls { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tr-btn {
  min-height: 44px; padding: 0.55rem 1.2rem; border-radius: 999px; border: 1px solid var(--gold-20);
  background: var(--gold-10); color: var(--gold); font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.tr-btn:hover:not(:disabled) { background: var(--gold-15); }
.tr-btn.primary { background: var(--gold); border-color: var(--gold); color: var(--felt-dark); }
.tr-btn.primary:hover:not(:disabled) { background: var(--gold-bright); }
.tr-btn.subtle { margin-left: auto; background: none; border-color: var(--border); color: var(--muted); }
.tr-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.tr-review-wrap { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.8rem; }
.tr-review-wrap summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--gold); }
.tr-review { list-style: none; padding: 0; margin: 0.8rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tr-chip {
  margin: 0; padding: 0.15rem 0.45rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); font-size: 0.78rem; line-height: 1.6; color: var(--muted); white-space: nowrap;
}
.tr-chip .rk { color: var(--text); font-weight: 700; }
.tr-chip.suit-hearts .rk { color: var(--chip-red-light); }
.tr-chip.suit-diamonds .rk { color: #86b4ff; }
.tr-chip.suit-clubs .rk { color: #6fd98f; }
.tr-chart .tag-table { margin: 0.8rem 0 0; }
.tr-privacy { font-size: 0.82rem; margin-top: -1rem; }

@media (max-width: 600px) {
  .tr-top { grid-template-columns: minmax(0, 1fr); }
  .tr-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .tr-settings > div:first-child { grid-column: 1 / -1; }
  #panel-tc .tr-settings > div:first-child { grid-column: auto; }
  .tr-mode { font-size: 0.8rem; padding: 0.5rem 0.3rem; }
}

/* ─── Download page ───────────────────────────────────────── */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 0.1em 0.35em;
}
.dl-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem 1.5rem;
  background: var(--slate); border: 1px solid var(--gold-20); border-radius: var(--r);
  padding: 1.4rem; margin: 0 0 1.2rem;
}
.dl-card[hidden] { display: none; }
.dl-app { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.dl-app img { border-radius: 12px; flex-shrink: 0; }
.dl-app strong { display: block; font-size: 1.05rem; color: var(--text); }
.dl-app span { font-size: 0.85rem; color: var(--muted); }
.dl-btn { justify-content: center; font-size: 1rem; padding: 0.85rem 1.8rem; }
.dl-sha, .dl-links { grid-column: 1 / -1; margin: 0; font-size: 0.82rem; }
.dl-sha code, .dl-fingerprint code { word-break: break-all; }
.dl-ios .tr-btn, .dl-ios .btn-gold { display: inline-flex; align-items: center; text-decoration: none; }
.dl-ios-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.dl-ios { margin-top: 0; }
.dl-facts {
  list-style: none; padding: 0; margin: 0 0 1rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem;
}
.dl-facts li {
  margin: 0; padding: 0.8rem 0.9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  line-height: 1.4;
}
.dl-facts strong { display: block; color: var(--gold); font-size: 0.92rem; }
.dl-facts span { font-size: 0.8rem; }
.dl-fingerprint { font-size: 0.85rem; }

@media (max-width: 600px) {
  .dl-card { grid-template-columns: minmax(0, 1fr); padding: 1.1rem; }
  .dl-btn { width: 100%; }
  .dl-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Basic strategy trainer ──────────────────────────────── */
.bs-settings { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem 1.5rem; }
.bs-settings > div:first-child { min-width: 12rem; }
.bs-settings .checks { padding-bottom: 0.4rem; }
.bs-stage { gap: 0.7rem; }
.bs-side { display: flex; align-items: center; gap: 1rem; }
.bs-side-label {
  width: 3.6rem; text-align: right; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.bs-stage .tr-cards { min-height: 0; justify-content: flex-start; min-width: calc(clamp(54px, 15vw, 74px) * 2 + 0.6rem); }
.bs-stage .pcard { width: clamp(54px, 15vw, 74px); }
.bs-stage .pc-rank { font-size: 1rem; }
.pcard.back {
  background: repeating-linear-gradient(45deg, #8f3232 0 6px, #a63d3d 6px 12px);
  border: 3px solid #f6f1e3;
}
.bs-hand { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--muted); text-align: center; }
.bs-plays { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.bs-plays .tr-ans { font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; }
.tr-ans.is-answer { opacity: 1; border-color: #6fd98f; color: #6fd98f; background: rgba(45, 138, 69, 0.18); }
.tr-ans.is-wrong { opacity: 1; border-color: var(--chip-red-light); color: var(--chip-red-light); }
kbd {
  font: inherit; font-size: 0.68rem; font-weight: 700; color: var(--muted);
  padding: 0.05rem 0.3rem; border: 1px solid var(--border); border-radius: 4px;
}
.bs-misses { margin: 0.8rem 0 0; padding-left: 1.2rem; }
.bs-misses li { font-size: 0.85rem; margin-bottom: 0.25rem; }
.bs-misses strong { color: var(--gold); }

@media (max-width: 600px) {
  .bs-settings > div:first-child { flex: 1 1 100%; }
  .bs-side { gap: 0.6rem; }
  .bs-side-label { width: 3rem; }
  .bs-plays .tr-ans { font-size: 0.92rem; padding: 0 0.2rem; }
}
@media (hover: none) { .bs-plays kbd { display: none; } }

/* ─── Systems hub ─────────────────────────────────────────── */
.sys-matrix { min-width: 520px; }
.sys-matrix td { text-align: center; font-size: 0.95rem !important; padding: 0.6rem 0.3rem; }
.sys-matrix thead th:not(:first-child) { text-align: center; padding: 0.6rem 0.3rem; }
.sys-matrix tbody th { white-space: nowrap; color: var(--text); font-weight: 600; }

/* ─── Sources list ────────────────────────────────────────── */
.sources li { font-size: 0.88rem; }
