:root {
    --bg: #090b10; --bg2: #0c0f15; --panel: #12161f; --panel2: #1a1f2b;
    --line: #242b39; --line2: #313a4d;
    --txt: #eaeef6; --muted: #98a2b6; --faint: #6b7589;
    --accent: #5b8cff; --accent-soft: rgba(91,140,255,.14); --accent2: #3ad6a3;
    --accent-2: #8fb3ff; --purple: #c98bff; --orange: #ff8a65;
    --good: #3ad6a3; --warn: #e6b450; --bad: #f0697a; --gold: #d9b25a;
    /* poker action mix (raise/call/fold) + red-suit tint — one source of truth */
    --pk-raise: #ff6b7d; --pk-call: #46d39a; --pk-fold: #8a93a6; --pk-suit: #d6455b;
    --radius: 12px;
    --elev1: 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.02);
    --elev2: 0 8px 24px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.03);
    --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; }
  body {
    background:
      radial-gradient(1200px 600px at 50% -10%, rgba(91,140,255,.06), transparent 60%),
      var(--bg);
    color: var(--txt);
    font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex; flex-direction: column;
    -webkit-font-smoothing: antialiased;
  }
  /* thin command accent line across the very top of the bridge */
  body::before {
    content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1001;
    background: linear-gradient(90deg, var(--accent), var(--accent2) 55%, transparent);
    opacity: .9;
  }
  header {
    position: sticky; top: 0; z-index: 50;
    background: linear-gradient(180deg, rgba(20,25,36,.92), rgba(16,20,29,.92));
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 10px 18px; display: flex; flex-direction: column; gap: 10px;
  }
  .titlebar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .brand { display: flex; align-items: center; gap: 9px; }
  .brand h1 { font-size: 16px; margin: 0; font-weight: 700; letter-spacing: .3px; }
  .brand h1::before {
    content: "◆"; color: var(--accent); margin-inline-end: 7px; font-size: 12px;
    text-shadow: 0 0 10px rgba(91,140,255,.7);
  }
  .brand .badge {
    font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--accent2);
    border: 1px solid rgba(58,214,163,.4); border-radius: 6px; padding: 2px 7px;
    background: rgba(58,214,163,.06);
  }
  .titlebar .sub { color: var(--muted); font-size: 12px; }
  .titlebar .spacer { flex: 1; }

  .lang-switch { display: inline-flex; gap: 4px; }
  .lang-btn {
    background: transparent; color: var(--muted); border: 1px solid var(--line);
    padding: 4px 11px; border-radius: 999px; cursor: pointer; font-size: 12px;
  }
  .lang-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

  .variantbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
  .variantbar .lbl { color: var(--muted); font-size: 12px; }
  .vtab {
    background: transparent; color: var(--txt); border: 1px solid var(--line);
    padding: 5px 13px; border-radius: 999px; cursor: pointer; font-size: 12px;
  }
  .vtab:hover { border-color: var(--accent2); }
  .vtab.active { background: var(--accent2); border-color: var(--accent2); color: #06281f; font-weight: 700; }
  .vtab.all.active { background: var(--accent); border-color: var(--accent); color: #fff; }

  .navrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .tabs { display: flex; gap: 6px; flex-wrap: wrap; }
  .tab {
    background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
    padding: 6px 15px; border-radius: 8px; cursor: pointer; font-size: 13px; user-select: none;
  }
  .tab:hover { border-color: var(--accent); }
  .tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

  .pc-btn {
    background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
    padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 12px; user-select: none;
  }
  .pc-btn:hover { border-color: var(--accent); }
  .pc-btn.active { background: var(--accent2); border-color: var(--accent2); color: #06281f; font-weight: 600; }
  .pc-btn.sm { padding: 3px 8px; font-size: 12px; line-height: 1; min-width: 26px; }
  .srv-ctrl button[data-act="restart"]:hover { border-color: var(--accent); }
  .srv-ctrl button[data-act="stop"]:hover { border-color: #e06a6a; color: #e06a6a; }
  .fl-vtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .fl-vtable th { text-align: start; font-weight: 600; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--line); }
  .fl-vtable td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
  .fl-vtable input[type="number"] { width: 92px; background: var(--panel2); color: var(--txt); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
  .fl-vtable input[type="number"]:focus { border-color: var(--accent); outline: none; }
  .mh-title { font-weight: 600; font-size: 12.5px; margin: 14px 0 6px; color: var(--txt); }
  .mh-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .mh-table th { text-align: start; font-weight: 600; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  .mh-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
  .mh-table .mh-spec { font-size: 11px; margin-top: 1px; }
  .mh-table .num { white-space: nowrap; }
  .mh-table .mh-buys { color: var(--muted); line-height: 1.45; }
  .ms-col.clickable { cursor: pointer; transition: border-color .12s, background .12s; }
  .ms-col.clickable:hover { border-color: var(--accent); }
  .ms-open { margin-top: 8px; font-size: 11.5px; color: var(--accent, #5b8cff); font-weight: 600; }
  .sprint-detail:empty { display: none; }
  .sprint-detail { margin: 12px 0 4px; }
  .sprint-plan { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px 14px; background: rgba(255,255,255,0.02); }
  .sprint-plan-body { line-height: 1.7; font-size: 13.5px; max-width: 70ch; }
  .sprint-plan-body h4 { margin: 18px 0 6px; font-size: 14px; color: var(--accent-2); }
  .sprint-plan-body p { margin: 0 0 12px; }
  .sprint-plan-body ul { margin: 0 0 12px; padding-inline-start: 20px; }
  .sprint-plan-body li { margin: 4px 0; }
  .sprint-plan-body b { color: var(--txt); }
  .sprint-plan-body .learn { border-inline-start: 3px solid #6dd28b; padding-inline-start: 12px; }
  .sprint-plan-body .ops { border-inline-start: 3px solid var(--accent, #5b8cff); padding-inline-start: 12px; }
  .sprint-plan-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: rgba(143,179,255,0.1); border: 1px solid rgba(143,179,255,0.18); border-radius: 4px; padding: 1px 5px; color: var(--accent-2); word-break: break-word; }
  .conv-chart { background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 6px; margin: 4px 0 6px; direction: ltr; overflow: hidden; }
  .conv-chart svg { display: block; overflow: visible; }
  /* Ladder history: full deployment table on desktop; only a few key points on
     mobile (the chart already shows the full path) — keeps the phone view light. */
  .ver-hist-compact { display: none; }
  @media (max-width: 640px) { .ver-hist-full { display: none; } .ver-hist-compact { display: block; } }
  .conv-chart text { font-family: inherit; }
  /* predicted-timetable forecast charts (the 'all' view) */
  .fc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 4px; }
  .fc-cell { background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 4px; overflow: hidden; }
  .fc-lbl { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
  @media (max-width: 560px) { .fc-grid { grid-template-columns: 1fr; } }
  .anchors-block { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line); }
  .anchors-tag { display: inline-block; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-2); background: rgba(143,179,255,0.1); border: 1px solid rgba(143,179,255,0.25); border-radius: 6px; padding: 2px 8px; margin-bottom: 8px; }
  .ph-timing { color: var(--accent-2); font-size: 11.5px; }
  .phase.done .ph-timing { color: #6dd28b; }
  .phase.current .ph-timing { color: var(--accent, #5b8cff); font-weight: 600; }

  main { flex: 1; min-height: 0; position: relative; overflow: auto; }
  .view { display: none; height: 100%; }
  .view.active { display: block; }
  /* Play = the embedded game panel (/gp/ iframe; all play UI lives there). */
  #view-play { padding: 0; background: var(--bg); }
  #play-embed { height: 100%; }
  #play-frame { width: 100%; height: 100%; border: 0; background: var(--bg); display: block; }

  .pad { padding: 18px 22px; max-width: 1180px; }
  h2.view-title { font-size: 17px; margin: 0 0 4px; font-weight: 700; }
  .view-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }
  table { border-collapse: collapse; width: 100%; margin-bottom: 18px; }
  .muted { color: var(--muted); }
  /* caption size utilities — retire repeated inline font-size on muted captions */
  .cap { font-size: 12px; }
  .cap-sm { font-size: 11px; }
  .err { color: var(--bad); }
  a { color: var(--accent); text-decoration: none; transition: color .12s; }
  a:hover { color: var(--accent2); text-decoration: underline; text-underline-offset: 2px; }
  /* rendered-markdown + narrative prose links read clearly as links + emphasized */
  .md a, .psec-body a, .pd-body a, .sprint-plan-body a, .timeline a, .hw-banner a {
    text-decoration: underline; text-underline-offset: 2px;
    text-decoration-color: rgba(91,140,255,.5); font-weight: 600;
  }
  .md a:hover, .psec-body a:hover, .pd-body a:hover, .sprint-plan-body a:hover, .timeline a:hover {
    text-decoration-color: var(--accent2); color: var(--accent2);
  }
  /* a no-op / out-of-scope link must not look or behave like a live one */
  .md a.muted, .acad-doc a.muted { text-decoration: none; cursor: default; font-weight: 400; opacity: .6; }

  .card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; margin-bottom: 16px; }
  .card h3 { margin: 0 0 4px; font-size: 14px; }
  .card .sub { color: var(--muted); font-size: 12px; margin-bottom: 10px; }

  /* generic data table */
  /* horizontal-scroll wrapper for wide bare tables (cadence + machine options)
     so they pan on narrow phones instead of forcing the whole page to scroll */
  .sb-link { color: var(--accent); cursor: pointer; }
  .sb-link:hover { text-decoration: underline; }
  .tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .tscroll .mh-table, .tscroll .fl-vtable { min-width: 360px; }
  .dtable { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px; }
  .dtable table { margin: 0; min-width: 560px; }
  .dtable th, .dtable td { text-align: start; padding: 9px 12px; font-size: 12.5px; border-bottom: 1px solid var(--line); vertical-align: top; }
  .dtable thead th { background: var(--panel2); color: var(--muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
  .dtable tr:last-child td { border-bottom: 0; }
  .dtable td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .dtable tbody tr:hover td { background: rgba(255,255,255,.02); }
  .kv td:first-child { color: var(--muted); width: 190px; font-weight: 600; }
  table.kv thead { display: none; }
  .fl-vtable td.fl-on-cell { text-align: center; }

  /* slim, MOBILE-ONLY collapse toggle for long data tables (hidden on desktop,
     so the desktop layout stays clean; <details open> keeps content visible) */
  .dtc { display: block; }
  .dtc > summary { display: none; }
  .dtc > summary::-webkit-details-marker { display: none; }

  /* ---- responsive data tables: row-as-card on narrow phones ----
     Below 640px the multi-column tables (squeezed + horizontally scrolling on a
     phone) collapse into stacked cards: the header row is hidden and every cell
     becomes a "Label" / value pair on its own full-width line, so the heavy-text
     column never gets squeezed. Mirrors the .md.compact tablewrap pattern. */
  @media (max-width: 640px) {
    .dtable { overflow-x: visible; }
    .dtable table, .dtable table.kv { min-width: 0; width: 100%; }
    .tscroll { overflow-x: visible; }
    .tscroll .mh-table, .tscroll .fl-vtable { min-width: 0; }

    /* generic dtable + the hand-built mh/fl tables all share the card treatment */
    .dtable table:not(.kv) thead,
    .mh-table thead, .fl-vtable thead { display: none; }
    .dtable table:not(.kv) tbody tr,
    .mh-table tbody tr, .fl-vtable tbody tr {
      display: block; padding: 9px 12px;
      border-bottom: 1px solid var(--line);
    }
    .dtable table:not(.kv) tbody tr:last-child,
    .mh-table tbody tr:last-child, .fl-vtable tbody tr:last-child { border-bottom: 0; }
    .dtable table:not(.kv) td,
    .mh-table td, .fl-vtable td {
      display: block; border: 0 !important; padding: 4px 0;
      white-space: normal; text-align: start;
      overflow-wrap: break-word; word-break: break-word;
    }
    /* label line above the value → value gets the full card width, no squeeze */
    .dtable table:not(.kv) td::before,
    .mh-table td[data-label]::before, .fl-vtable td[data-label]::before {
      content: attr(data-label); display: block;
      font-size: 10.5px; font-weight: 600; letter-spacing: .03em;
      text-transform: uppercase; color: var(--muted); margin-bottom: 1px;
    }
    /* spacer / unlabelled columns (sparklines, gate bars, action chips): no label,
       cell spans full width on its own */
    .dtable table:not(.kv) td[data-label=""]::before,
    .mh-table td:not([data-label])::before, .fl-vtable td:not([data-label])::before { display: none; }
    .dtable table:not(.kv) td:empty { display: none; }
    .dtable td.num { white-space: normal; }
    .fl-vtable td.fl-on-cell { text-align: start; }
    .fl-vtable input[type="number"] { width: 100%; max-width: 160px; }

    /* key/value tables: keep the 2-column read but let it use the full width */
    .dtable table.kv td:first-child, .kv td:first-child { width: 42%; }

    /* collapsible tables carry their borders on the summary + table (not the
       wrapper) so the toggle reads as one piece; kill the wrapper's own border */
    .dtable.dtc { border: 0; border-radius: 0; overflow: visible; }
    /* the mobile collapse toggle becomes visible + tappable */
    .dtc > summary {
      display: flex; align-items: center; gap: 8px; cursor: pointer;
      padding: 9px 12px; font-size: 12.5px; font-weight: 600; color: var(--txt);
      background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
      list-style: none; user-select: none; -webkit-user-select: none;
    }
    .dtc[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
    .dtc > summary .dtc-cap-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dtc > summary .dtc-cap-n {
      font-size: 11px; color: var(--muted); font-weight: 600;
      background: rgba(255,255,255,.05); border-radius: 999px; padding: 0 7px;
    }
    .dtc > summary .acc-chevron { margin-inline-start: auto; }
    .dtc[open] > summary .acc-chevron { transform: rotate(90deg); }
    .dtc[open] > table { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; }
  }

  .pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
  .pill.ok { background: rgba(56,211,159,.16); color: var(--accent2); }
  .pill.no { background: rgba(224,106,106,.16); color: var(--bad); }
  .pill.warn { background: rgba(224,179,74,.16); color: var(--warn); }
  .pill.info { background: rgba(91,140,255,.16); color: var(--accent); }

  /* phase ladder */
  .ladder { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; }
  .phase {
    flex: 1 1 150px; min-width: 150px; background: var(--panel); border: 1px solid var(--line);
    border-radius: 10px; padding: 10px 12px; position: relative;
  }
  .phase.done { border-color: rgba(56,211,159,.4); }
  .phase.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
  .phase .ph-top { display: flex; align-items: center; gap: 6px; }
  .phase .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
  .phase.done .dot { background: var(--accent2); }
  .phase.current .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.25); }
  .phase .nm { font-size: 13px; font-weight: 700; }
  .phase .st { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-inline-start: auto; }
  .phase.done .st { color: var(--accent2); }
  .phase.current .st { color: var(--accent); }
  .phase .ph-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
  .phase .ph-meta b { color: var(--txt); font-weight: 600; }
  .phase.clickable { cursor: pointer; transition: border-color .12s, transform .12s, background .12s; }
  .phase.clickable:hover { border-color: var(--accent); transform: translateY(-2px); }
  .phase.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
  .phase .ph-more { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
  /* clicked-phase detail panel */
  #phase-detail { background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 14px 16px; margin: 2px 0 18px; }
  #phase-detail .pd-head { display: flex; align-items: center; gap: 10px; }
  #phase-detail .pd-head h3 { margin: 0; font-size: 15px; }
  #phase-detail .pd-meta { color: var(--muted); font-size: 12px; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
  #phase-detail .pd-meta b { color: var(--txt); }
  #phase-detail .pd-body { font-size: 13px; line-height: 1.65; }
  #phase-detail .pd-body b { color: #fff; font-weight: 600; }
  #phase-detail .pd-body code { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 12px; }

  /* Plan accordions — phases + sprints expand IN PLACE (native <details>),
     collapsible, as clear bordered cards with a rotating chevron. */
  .ladder.acc-list { display: block; }
  .sprint-accs { display: block; margin: 6px 0 14px; }
  .acc { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 8px; overflow: hidden; }
  .acc > summary { list-style: none; cursor: pointer; padding: 11px 14px; transition: background .12s; }
  .acc > summary::-webkit-details-marker { display: none; }
  .acc > summary:hover { background: rgba(255,255,255,.02); }
  .acc[open] { border-color: var(--accent); }
  .phase-acc.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
  .phase-acc.done { border-color: rgba(56,211,159,.4); }
  .acc-chevron { margin-inline-start: auto; color: var(--muted); font-size: 12px; transition: transform .15s; display: inline-block; }
  .acc[open] .acc-chevron { transform: rotate(90deg); }
  .acc > summary .ph-top { display: flex; align-items: center; gap: 6px; }
  .acc > summary .ph-meta { margin-top: 6px; }
  .acc .pd-body { padding: 4px 14px 14px; }
  .sprint-acc > summary .ms-when { font-weight: 700; display: flex; align-items: center; gap: 6px; }
  .sprint-acc > summary .ms-body { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.5; }
  .sprint-acc > summary .ms-cost { font-size: 12px; margin-top: 7px; }

  /* overview: mission board + gauges + milestones */
  .ovgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
  .mcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; cursor: pointer; transition: border-color .12s, transform .12s; }
  .mcard:hover { border-color: var(--accent); transform: translateY(-2px); }
  .mcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
  .mcard-name { font-size: 14px; font-weight: 700; }
  .barwrap { height: 7px; background: var(--panel2); border-radius: 999px; overflow: hidden; margin-bottom: 9px; }
  .barwrap .bar { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 999px; }
  .mcard-meta { font-size: 12px; line-height: 1.6; }
  .mcard-meta .num { font-variant-numeric: tabular-nums; }
  .ms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .ms-col { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
  .ms-when { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--accent2); font-weight: 700; margin-bottom: 6px; }
  .ms-body { font-size: 12.5px; line-height: 1.55; }
  .ms-cost { font-size: 12px; margin-top: 8px; }
  @media (max-width: 560px) { .ms-grid { grid-template-columns: 1fr; } }

  /* academic course browser (Hold'em README) */
  .acad-wrap { display: flex; gap: 14px; align-items: flex-start; }
  .acad-nav { flex: 0 0 230px; display: flex; flex-direction: column; gap: 3px; max-height: 460px; overflow-y: auto; border-inline-end: 1px solid var(--line); padding-inline-end: 10px; }
  .acad-mod { display: block; padding: 7px 9px; border-radius: 7px; color: var(--txt); text-decoration: none; font-size: 12.5px; border: 1px solid transparent; }
  .acad-mod:hover { background: var(--panel2); }
  .acad-mod.active { background: rgba(91,140,255,.14); border-color: var(--accent); color: #fff; }
  .acad-doc { flex: 1; min-width: 0; max-height: 460px; overflow-y: auto; padding-inline-start: 4px; direction: inherit; text-align: start; }
  @media (max-width: 640px) {
    .acad-wrap { flex-direction: column; }
    .acad-nav { flex-basis: auto; width: 100%; border-inline-end: 0; border-bottom: 1px solid var(--line); padding-bottom: 8px; max-height: 200px; }
    .acad-doc { max-height: none; }
  }

  /* plan: collapsible narrative sections */
  .psec { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
  .psec > summary { cursor: pointer; padding: 11px 14px; font-weight: 700; font-size: 13.5px; list-style: none; display: flex; align-items: center; gap: 8px; }
  .psec > summary::-webkit-details-marker { display: none; }
  .psec > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
  .psec[open] > summary::before { transform: rotate(90deg); }
  .psec .psec-body { padding: 0 14px 14px; font-size: 13px; line-height: 1.65; color: var(--txt); }
  .psec .psec-body b { color: #fff; font-weight: 600; }
  .psec .psec-body ul { margin: 6px 0; padding-inline-start: 20px; }
  .psec .psec-body li { margin: 3px 0; }

  /* demo spotlight hero (Hold'em Overview) — token-only accents */
  .psec.hero {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent) inset;
    background: linear-gradient(180deg, var(--accent-soft), transparent 62%), var(--panel);
  }
  .psec.hero > summary { font-size: 15px; }
  .psec.hero > summary::before { color: var(--accent); }
  .hero-release {
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border-radius: 12px; padding: 10px 14px; margin: 2px 0 10px;
  }
  .hero-release-name { font-size: 17px; font-weight: 800; letter-spacing: .02em; }
  .hero-release-name b { color: var(--accent); }
  .hero-release-name .pill { margin-inline-start: 8px; vertical-align: 2px; }
  .hero-release-blurb { font-size: 12.5px; line-height: 1.62; margin-top: 4px; }
  .hero-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 10px; }
  .hero-chips .pill { font-size: 11.5px; padding: 3px 11px; }
  .hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 6px 0 12px; }
  .hero-beat { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
  .hero-beat h4 { margin: 0 0 6px; font-size: 13.5px; color: var(--accent-2); }
  .hero-beat-txt { font-size: 12.5px; line-height: 1.62; }
  .hero-cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
  .hero-cta .pc-btn { font-weight: 600; }

  /* plan: ALL — numbered timeline */
  .timeline { counter-reset: step; margin: 4px 0 18px; padding: 0; list-style: none; }
  .timeline li { position: relative; padding: 4px 0 14px; padding-inline-start: 38px; border-inline-start: 2px solid var(--line); margin-inline-start: 13px; }
  .timeline li:last-child { border-inline-start-color: transparent; }
  .timeline li::before { counter-increment: step; content: counter(step); position: absolute; inset-inline-start: -14px; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
  .timeline li b { color: #fff; font-weight: 600; }
  .timeline li .when { display: inline-block; color: var(--accent2); font-size: 11.5px; font-weight: 700; margin-bottom: 2px; }

  /* hardware option cards */
  .hw-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
  .hw-card h3 { margin: 0 0 2px; font-size: 14px; }
  .hw-card .meta { display: flex; gap: 18px; flex-wrap: wrap; margin: 9px 0 11px; }
  .hw-card .meta div { font-size: 12px; }
  .hw-card .meta .k { color: var(--muted); }
  .hw-proscons { display: flex; gap: 28px; flex-wrap: wrap; }
  .hw-proscons ul { margin: 4px 0; padding-inline-start: 18px; }
  .hw-proscons .pros li { color: var(--accent2); }
  .hw-proscons .cons li { color: var(--bad); }
  .hw-proscons .col-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
  .hw-banner { background: rgba(91,140,255,.10); border: 1px solid var(--accent); border-radius: 9px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; line-height: 1.6; }
  .hw-banner b { color: #fff; font-weight: 600; }
  .hw-banner u { text-decoration-color: var(--accent); text-underline-offset: 2px; }
  .hw-links { margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; }
  .hw-links a { font-size: 12px; color: var(--accent); text-decoration: none; }
  .hw-links a:hover { text-decoration: underline; }
  .hw-card .pill.warn { font-size: 10px; vertical-align: middle; }

  .equity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .equity input { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); padding: 6px 10px; border-radius: 6px; flex: 1 1 140px; min-width: 0; }
  .equity #equity-out, .equity .equity-out { flex-basis: 100%; }
  .equity button { background: var(--accent); border: 0; color: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer; }

  .spark { display: inline-block; vertical-align: middle; }

  /* rendered markdown (README tab) */
  .md { max-width: 880px; line-height: 1.65; }
  .md h1 { font-size: 22px; margin: 18px 0 10px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  .md h2 { font-size: 18px; margin: 22px 0 8px; }
  .md h3 { font-size: 15px; margin: 18px 0 6px; }
  .md h4 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); }
  .md p { margin: 8px 0; }
  .md ul, .md ol { margin: 8px 0; padding-left: 22px; }
  .md li { margin: 3px 0; }
  .md hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
  .md blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--accent); background: var(--panel2); border-radius: 0 8px 8px 0; color: var(--muted); }
  .md code { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
  .md pre { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; white-space: pre; margin: 12px 0; }
  .md pre code { background: none; border: 0; padding: 0; font-size: 12px; }
  .md strong { color: #fff; font-weight: 600; }
  .md .tablewrap { overflow-x: auto; margin: 12px 0; }
  .md table { border-collapse: collapse; width: 100%; margin: 0; min-width: 480px; }
  .md th, .md td { text-align: start; padding: 7px 11px; border: 1px solid var(--line); font-size: 13px; vertical-align: top; }

  /* Compact / "mobile" reading view — toggled per .md pane. Same source markdown,
     narrower column + larger type + each table row rendered as a labelled card. */
  .md-controls { display: flex; justify-content: flex-end; margin: -2px 0 10px; }
  .md.compact { max-width: 620px; margin-inline: auto; font-size: 16px; line-height: 1.8; }
  .md.compact h1 { font-size: 25px; } .md.compact h2 { font-size: 20px; } .md.compact h3 { font-size: 17px; }
  .md.compact li { margin: 3px 0; }
  .md.compact pre { font-size: 12.5px; }
  .md.compact .tablewrap { overflow-x: visible; }
  .md.compact .tablewrap table { min-width: 0; width: 100%; border: 0; }
  .md.compact .tablewrap thead { display: none; }
  .md.compact .tablewrap tr { display: block; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); padding: 7px 13px; margin-bottom: 11px; }
  .md.compact .tablewrap td { display: flex; gap: 12px; align-items: baseline; border: 0; padding: 5px 0; font-size: 14.5px; }
  .md.compact .tablewrap td + td { border-top: 1px dashed var(--line); }
  .md.compact .tablewrap td::before { content: attr(data-label); flex: 0 0 42%; font-weight: 600; color: var(--muted); }
  .md.compact .tablewrap td:empty { display: none; }
  .md th { background: var(--panel2); color: var(--txt); font-weight: 600; }
  .md tr:nth-child(even) td { background: rgba(255,255,255,.02); }
  /* nothing in a doc may overflow the narrow column — break long paths/URLs */
  .md { overflow-wrap: break-word; }
  .md code, .md a, .md.compact .tablewrap td { word-break: break-word; }
  /* iPhone-Air-class widths: dial the reading type down so it fits + realigns */
  @media (max-width: 470px) {
    .md { font-size: 14px; }
    .md h1 { font-size: 19px; } .md h2 { font-size: 16px; } .md h3 { font-size: 14px; }
    .md pre { font-size: 11.5px; }
    .md.compact { font-size: 15px; line-height: 1.72; max-width: 100%; }
    .md.compact h1 { font-size: 20px; } .md.compact h2 { font-size: 17px; } .md.compact h3 { font-size: 15px; }
    .md.compact .tablewrap td { font-size: 13.5px; }
    .md.compact .tablewrap td::before { flex-basis: 46%; }
  }
  /* README is English-only — keep it LTR even in an RTL shell */
  .md { direction: ltr; text-align: left; }
  /* Academic course follows the active language: Hebrew renders RTL/right.
     (Higher specificity than `.md`, so it wins for the course doc only.) */
  .md.acad-doc[dir="rtl"] { direction: rtl; text-align: right; }
  .md.acad-doc[dir="rtl"] pre,
  .md.acad-doc[dir="rtl"] code { direction: ltr; text-align: left; unicode-bidi: isolate; }
  .md.acad-doc[dir="rtl"] th,
  .md.acad-doc[dir="rtl"] td { text-align: start; }

  /* login gate */
  #login-gate { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: flex; align-items: center; justify-content: center; }
  #login-gate.hidden { display: none; }
  .login-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 34px 38px; text-align: center; width: 320px; max-width: 90vw; }
  .login-box h1 { margin: 0 0 4px; font-size: 28px; }
  .login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
  .login-box input { width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); padding: 10px 12px; border-radius: 8px; font-size: 16px; text-align: center; letter-spacing: 4px; margin-bottom: 12px; }
  .login-box button { width: 100%; background: var(--accent); border: 0; color: #fff; padding: 10px; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 600; }
  .login-box .login-err { color: var(--bad); font-size: 12px; margin-top: 10px; min-height: 14px; }
  /* two-tier login: the gameplay-only ("play" level) screen */
  .login-box .playonly-note { color: var(--txt); font-size: 13px; line-height: 1.6; margin: 0 0 18px; }
  .login-box .playonly-btn { display: block; width: 100%; box-sizing: border-box; background: var(--accent); color: #fff; padding: 12px; border-radius: 8px; font-size: 16px; font-weight: 700; text-decoration: none; margin-bottom: 10px; transition: background .12s; }
  .login-box .playonly-btn:hover { background: var(--accent2); color: #06281f; text-decoration: none; }
  .login-box button.playonly-alt { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: 13px; }
  .login-box button.playonly-alt:hover { border-color: var(--accent); color: var(--txt); }

  /* ---- bidi: data pages follow the active language (HE = rtl, EN = ltr) ---- */
  .pad { text-align: start; }
  .psec-body, .timeline li, .view-sub, .ph-meta { unicode-bidi: plaintext; }
  /* numbers/codes stay LTR even inside an RTL paragraph */
  .num, code, .dtable td.num { unicode-bidi: isolate; }

  /* ---- safe-area insets (iPhone notch / Dynamic Island / home bar) ---- */
  header { padding-top: calc(9px + env(safe-area-inset-top, 0px)); }
  main { padding-bottom: env(safe-area-inset-bottom, 0px); }

  /* ---- mobile (tuned for iPhone 17 Air, ~430px logical width) ---- */
  @media (max-width: 760px) {
    .brand h1 { font-size: 15px; }
    .titlebar .sub { display: none; }              /* free up the top row */
    .pad { padding: 14px 14px; }
    h2.view-title { font-size: 16px; }
    .tab { padding: 7px 12px; font-size: 13px; }   /* bigger tap targets */
    .vtab { padding: 6px 12px; font-size: 12px; }
    .lang-btn, .pc-btn { padding: 7px 12px; }
    .phase { flex-basis: 100%; min-width: 0; }       /* one phase card per row */
    .hw-proscons { gap: 16px; }
    .timeline li { padding-inline-start: 32px; }
    /* let the navbar's view tabs scroll horizontally instead of wrapping tall */
    .navrow { align-items: stretch; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
    .tab { flex: 0 0 auto; }
  }
  @media (max-width: 460px) {
    header { padding-left: 12px; padding-right: 12px; }
    .pad { padding: 12px 12px; }
    .variantbar .lbl { display: none; }
    .chooser-grid { grid-template-columns: 1fr; }
    .kv td:first-child { width: 130px; }
    .hw-card .meta { gap: 10px; }
  }

/* ============================================================================
   COMMAND-BRIDGE POLISH — instrument-panel finish over the base layout.
   Loaded last; tokens above already upgraded. Cosmetic only.
   ============================================================================ */

/* data reads like an instrument: tabular numerals everywhere it matters */
.num, .dtable td, .mcard-meta, .pot, .ms-cost, .pred-table td, code { font-variant-numeric: tabular-nums; }

/* nav tabs — segmented console control */
.tabs { gap: 4px; background: rgba(0,0,0,.18); padding: 3px; border-radius: 10px; border: 1px solid var(--line); }
.tab { background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 6px 14px; color: var(--muted); }
.tab:hover { color: var(--txt); background: rgba(255,255,255,.03); border-color: transparent; }
.tab.active { background: linear-gradient(180deg, #2a3550, #1f2740); border-color: var(--line2); color: #fff; box-shadow: var(--elev1); }

/* variant chips */
.vtab { transition: border-color .12s, background .12s, color .12s; }
.vtab.active, .vtab.all.active { box-shadow: 0 0 0 1px currentColor inset, 0 0 14px rgba(91,140,255,.18); }

/* status LED — pulsing when live */
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; vertical-align: middle; }
.led.on { background: var(--good); box-shadow: 0 0 0 3px rgba(58,214,163,.18); animation: ledPulse 1.8s ease-in-out infinite; }
.led.off { background: var(--faint); }
@keyframes ledPulse { 0%,100% { box-shadow: 0 0 0 2px rgba(58,214,163,.22); } 50% { box-shadow: 0 0 0 5px rgba(58,214,163,.05); } }

/* section headings get an accent rule — reads like a console label */
.pad h3 { position: relative; padding-inline-start: 11px; letter-spacing: .2px; }
.pad h3::before { content: ""; position: absolute; inset-inline-start: 0; top: 2px; bottom: 2px; width: 3px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent2)); }
.card h3::before, .hw-card h3::before, .psec > summary { /* keep card/summary headings clean */ }
.card h3, .hw-card h3, #phase-detail .pd-head h3 { padding-inline-start: 0; }
.card h3::before, .hw-card h3::before { display: none; }

/* view title — mission header */
h2.view-title { letter-spacing: .2px; }
h2.view-title::after { content: ""; display: block; height: 1px; margin-top: 8px; background: linear-gradient(90deg, var(--line2), transparent); }

/* cards lift on the board */
.card, .hw-card { box-shadow: var(--elev1); transition: border-color .14s, box-shadow .14s, transform .14s; }
.mcard:hover, .chooser-card:hover { box-shadow: var(--elev2); }

/* mission board cards — instrument tiles */
.mcard { background: linear-gradient(180deg, var(--panel), #10141d); }
.mcard-name { letter-spacing: .2px; }
.barwrap { height: 8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.barwrap .bar { box-shadow: 0 0 10px rgba(91,140,255,.45); transition: width .5s ease; }

/* the objective banner reads like a mission statement */
.hw-banner { background: linear-gradient(180deg, rgba(91,140,255,.10), rgba(91,140,255,.04)); box-shadow: var(--elev1); }

/* milestone columns — 1mo / 3mo readouts */
.ms-col { background: linear-gradient(180deg, var(--panel2), #141925); box-shadow: var(--elev1); }
.ms-when { color: var(--accent2); }

/* pills a touch crisper */
.pill { border: 1px solid transparent; }
.pill.ok { border-color: rgba(58,214,163,.3); }
.pill.no { border-color: rgba(240,105,122,.3); }
.pill.warn { border-color: rgba(230,180,80,.3); }

/* buttons — console keys */
.pc-btn, .lang-btn, .equity button { transition: border-color .12s, background .12s, color .12s, transform .06s; }
.pc-btn:active, .lang-btn:active, .equity button:active { transform: translateY(1px); }

/* refined scrollbars (webkit) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #3c465c; }

/* phase ladder current step glows a bit more on the bridge */
.phase.current { box-shadow: 0 0 0 1px var(--accent) inset, 0 0 16px rgba(91,140,255,.14); }
.phase.current .dot { box-shadow: 0 0 0 3px rgba(91,140,255,.28), 0 0 8px var(--accent); }

/* trainer fleet row hover */
.dtable tbody tr:hover td { background: rgba(91,140,255,.04); }

/* ============================================================================
   READABILITY — looser, friendlier text + the README doc-browser pane.
   ============================================================================ */

/* breathing room: every <br>-separated line in dense narratives gets a gap,
   and line-height opens up — no content edits needed */
.psec-body, .pd-body, .ms-body, #phase-detail .pd-meta { line-height: 1.8; }
.psec-body br, .pd-body br, .ms-body br { display: block; content: ""; margin-top: 8px; }
.psec-body ul, .pd-body ul { margin: 8px 0; padding-inline-start: 20px; }
.psec-body li, .pd-body li { margin: 5px 0; }
.psec-body p, .pd-body p { margin: 9px 0; }
.psec .psec-body { padding: 4px 15px 16px; }
#phase-detail { padding: 16px 18px; }
#phase-detail .pd-body { margin-top: 4px; }
.card .sub { line-height: 1.6; }

/* sprint card — clearly an optional accelerated path, not the roadmap */
.sprint-card { border-color: var(--warn); }
.sprint-card > h3 { color: var(--warn); }
.sprint-card .sub { color: var(--txt); opacity: .85; margin-bottom: 12px; }
.ms-col { padding: 13px 15px; }
.ms-body { line-height: 1.7; }

/* README / docs browser pane (LTR English docs; nav reused from .acad-*) */
.doc-pane { flex: 1; min-width: 0; max-height: calc(100vh - 230px); overflow-y: auto; padding-inline-start: 6px; }
.acad-doc { max-height: calc(100vh - 230px); }
.acad-nav { max-height: calc(100vh - 230px); }
.acad-mod { line-height: 1.4; }
@media (max-width: 640px) {
  .doc-pane, .acad-doc, .acad-nav { max-height: none; }
}

/* fleet settings — editable cadence controls */
.fl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0; }
.fl-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.fl-field input { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); padding: 7px 10px; border-radius: 7px; font-size: 13px; font-variant-numeric: tabular-nums; }
.fl-field input:focus { border-color: var(--accent); outline: none; }
.fl-checks { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.fl-chk { font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

/* ── Abstraction explorer ──────────────────────────────────────────────── */
.abs-vbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.abs-totals { font-size: 12.5px; color: var(--muted); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 13px; margin: 4px 0 14px; line-height: 1.5; }
.abs-totals b { color: var(--txt); }
.abs-controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center;
  justify-content: space-between; margin-bottom: 14px; }
.abs-streets { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.abs-st { background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: .12s; }
.abs-st:hover { border-color: var(--line2); }
.abs-st.active { background: var(--accent-soft); border-color: var(--accent); color: #fff; font-weight: 600; }
.abs-pick { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.abs-numlbl { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.abs-numlbl input { width: 92px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  padding: 7px 9px; border-radius: 7px; font-size: 13px; font-variant-numeric: tabular-nums; direction: ltr; }
.abs-numlbl input:focus { border-color: var(--accent); outline: none; }
.abs-metaline { font-size: 12px; margin-bottom: 10px; }
.abs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.abs-stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.abs-stat-k { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.abs-stat-v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; direction: ltr; text-align: start; }
.abs-bar { display: inline-block; width: 70px; height: 7px; background: var(--line); border-radius: 4px;
  overflow: hidden; vertical-align: middle; }
.abs-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.abs-exhead { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.abs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.abs-tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px;
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap; direction: ltr; }
.abs-hole { display: inline-flex; gap: 3px; }
.abs-sep { width: 9px; }
.abs-sep::before { content: "·"; color: var(--faint); }
.pcard { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 30px;
  padding: 0 5px; border-radius: 5px; background: #0d1017; border: 1px solid var(--line2);
  font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pcard.s-s { color: #e8edf6; }   /* spades  ♠ */
.pcard.s-h { color: #ff6b7d; }   /* hearts  ♥ */
.pcard.s-d { color: #5bb0ff; }   /* diamonds ♦ */
.pcard.s-c { color: #46d39a; }   /* clubs   ♣ */
@media (max-width: 560px) {
  .abs-controls { gap: 10px; }
  .abs-pick { width: 100%; }
  .abs-stats { grid-template-columns: 1fr; gap: 8px; }
  .abs-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .pcard { min-width: 23px; height: 28px; font-size: 13px; }
}

/* ── Learn tab visualizers ─────────────────────────────────────────────── */
.learn-card h3 { margin: 0 0 6px; font-size: 15px; }
.learn-card .sub { line-height: 1.65; margin-bottom: 12px; }
.lc-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.lc-ctrls { display: flex; flex-direction: column; gap: 9px; margin-bottom: 8px; max-width: 520px; }
.lc-ctrls label { display: grid; grid-template-columns: 70px 1fr 64px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.lc-ctrls input[type=range] { width: 100%; accent-color: var(--accent); }
.lc-val { font-variant-numeric: tabular-nums; color: var(--txt); text-align: end; direction: ltr; }
.lc-chart { background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 6px 0; overflow: hidden; }
.lc-readout { font-size: 13px; line-height: 1.7; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; direction: inherit; }
.lc-readout b { color: var(--txt); }
.lc-ax { fill: var(--muted); font-size: 9px; }
.lc-grid { stroke: var(--line); stroke-width: 1; }
.lc-floor { stroke: #6dd28b; stroke-width: 1.4; stroke-dasharray: 4 3; opacity: .8; }
.lc-curve { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.lc-mark { stroke: var(--accent2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.lc-dot { fill: var(--accent2); stroke: #06281f; stroke-width: 1.5; }
.eqh-streets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.eqh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.eqh-hand { background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.eqh-lbl { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.eqh-hand .abs-tile { border: 0; background: transparent; padding: 2px 0 6px; }
.eqh-emd { margin-top: 12px; font-size: 13px; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.eqh-emd b { color: var(--txt); }
.pg-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; direction: ltr; max-width: 560px; }
.pg-cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 3px; font-size: 9.5px; font-weight: 600; color: #eaf0fb; line-height: 1; overflow: hidden; }
.pg-eq { font-size: 8px; opacity: .75; font-weight: 400; margin-top: 1px; }
.pg-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.pg-bar { flex: 1; max-width: 200px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(130,140,120,.3), rgba(70,210,150,.85)); }
@media (max-width: 560px) {
  .eqh-grid { grid-template-columns: 1fr; }
  .lc-ctrls label { grid-template-columns: 54px 1fr 56px; }
  .pg-cell { font-size: 8px; } .pg-eq { display: none; }
}

/* CFR demo + betting tree */
.cfr-stat { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; margin: 8px 0 4px; }
.cfr-stat b { color: var(--txt); font-variant-numeric: tabular-nums; }
.cfr-table { width: 100%; max-width: 420px; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.cfr-table th { text-align: start; color: var(--muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.cfr-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.cfr-table td.num { font-variant-numeric: tabular-nums; }
.bt-track { stroke: var(--line2); stroke-width: 2; }
.bt-illegal { fill: rgba(240,105,122,.10); stroke: rgba(240,105,122,.3); stroke-dasharray: 3 3; }
.bt-dynbar { fill: url(#btgrad); fill: rgba(91,140,255,.35); stroke: var(--accent); stroke-width: 1; rx: 4; }
.bt-tick { stroke: var(--accent2); stroke-width: 1.5; }
.bt-chip { fill: var(--accent2); stroke: #06281f; stroke-width: 1.2; }
.bt-cap { stroke: var(--bad); stroke-width: 1.6; }
.bt-lbl { fill: var(--muted); font-size: 10px; }

/* "How to read this" guide + small captions (Learn tab) */
.howto { background: rgba(91,140,255,.06); border: 1px solid rgba(91,140,255,.25); border-radius: 9px; margin: 0 0 12px; }
.howto > summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--accent-2); list-style: none; }
.howto > summary::-webkit-details-marker { display: none; }
.howto-body { padding: 2px 12px 11px; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; line-height: 1.6; }
.howto-body b { color: var(--txt); }
.howto-k { display: inline-block; min-width: 96px; color: var(--muted); font-weight: 600; }
.lc-cap { font-size: 11px; color: var(--muted); margin: 6px 0 2px; }
@media (max-width: 560px) { .howto-k { display: block; min-width: 0; margin-bottom: 1px; } }

/* Learn TOC + regret-matching (RPS) bars */
.learn-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.learn-toc a { font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--txt); text-decoration: none; background: var(--panel2); }
.learn-toc a:hover { border-color: var(--accent); color: var(--accent2); text-decoration: none; }
.rps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.rps-h { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.rps-bars { display: flex; gap: 10px; align-items: flex-end; height: 96px; }
.rps-b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.rps-fill { width: 70%; background: linear-gradient(180deg, var(--accent2), var(--accent)); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .12s; }
.rps-bl { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
@media (max-width: 560px) { .rps-grid { gap: 10px; } .rps-bars { height: 80px; gap: 6px; } }

/* Tier-comparison ladder */
.tier-ladder { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tier-step { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; text-align: center; }
.tier-name { font-size: 11px; color: var(--muted); }
.tier-id { font-size: 18px; font-weight: 700; color: var(--accent2); font-variant-numeric: tabular-nums; }
.tier-of { font-size: 11px; }
.tier-arrow { color: var(--accent); font-size: 18px; }
.tier-buddies .abs-tile { margin-bottom: 6px; }
@media (max-width: 560px) { .tier-ladder { gap: 5px; } .tier-step { padding: 6px 9px; } .tier-arrow { font-size: 14px; } }

/* Equity calculator */
.eqc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.eqc-row select { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 13px; }
.eqc-row select:focus { border-color: var(--accent); outline: none; }
.eqc-vs { color: var(--muted); font-size: 12px; }
.eqc-bar { display: flex; height: 26px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); }
.eqc-fill { background: linear-gradient(90deg, var(--accent), var(--accent2)); min-width: 1px; }
.eqc-fill-b { background: var(--panel2); }
.eqc-nums { display: flex; justify-content: space-between; margin-top: 6px; font-size: 14px; font-variant-numeric: tabular-nums; }
.eqc-nums b { color: var(--txt); }

/* Strategy inspector */
.strat-grid .pg-cell { cursor: pointer; }
.strat-grid .pg-cell:hover { outline: 2px solid #fff; outline-offset: -2px; }
.strat-legend { display: flex; gap: 14px; font-size: 12px; margin: 8px 0; }
.strat-box { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.strat-bars { display: flex; height: 14px; border-radius: 5px; overflow: hidden; margin: 8px 0; }
.strat-seg { min-width: 0; }
.strat-mix { font-size: 12px; color: var(--muted); margin-top: 4px; }
.strat-act { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; margin: 2px 2px 0 0; font-variant-numeric: tabular-nums; }

/* Learn curriculum */
.curr-list { display: flex; flex-direction: column; gap: 8px; }
.curr-step { display: flex; align-items: center; gap: 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.curr-n { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.curr-body { flex: 1; min-width: 0; }
.curr-t { font-size: 13.5px; font-weight: 600; }
.curr-d { font-size: 12px; margin-top: 1px; }
.curr-step .pc-btn { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 560px) { .curr-step { flex-wrap: wrap; } .curr-step .pc-btn { width: 100%; margin-top: 2px; } }

/* Plan ↔ Learn cross-links */
.learn-banner { background: linear-gradient(180deg, rgba(58,214,163,.10), rgba(58,214,163,.04)); border: 1px solid rgba(58,214,163,.35); border-radius: 9px; padding: 9px 13px; margin: 10px 0 16px; font-size: 13px; cursor: pointer; transition: border-color .12s; }
.learn-banner:hover { border-color: var(--accent2); }
.phase-learn { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.phase-learn .pc-btn { background: var(--accent-soft); border-color: rgba(91,140,255,.3); }

/* Versions — chart titles + predicted-future summary */
.vc-title { font-size: 12px; font-weight: 600; color: var(--muted); margin: 4px 0 4px; }
/* fleet exploitability graphs — 2-up on desktop, stacked on mobile */
.vc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.vc-cell { min-width: 0; }
@media (max-width: 760px) { .vc-grid { grid-template-columns: 1fr; } }
.pf-sum { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0 10px; }
.pf-sum > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; }
.pf-k { font-size: 11px; color: var(--muted); }
.pf-v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: start; }

/* --- Learn curriculum modules (expandable lessons; each tool nested inside) --- */
.learn-module { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 12px; overflow: hidden; }
.learn-module[open] { border-color: var(--accent); }
.learn-module > summary { cursor: pointer; padding: 14px 16px; list-style: none; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; transition: background .12s; }
.learn-module > summary::-webkit-details-marker { display: none; }
.learn-module > summary:hover { background: rgba(255,255,255,.02); }
.learn-module > summary .lm-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #06121f; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.learn-module[open] > summary .acc-chevron { transform: rotate(90deg); }
.lm-title { flex: 1 1 auto; min-width: 0; unicode-bidi: plaintext; }
.lm-body { padding: 4px 16px 18px; }
.lm-intro { font-size: 14px; line-height: 1.7; color: var(--txt); margin: 4px 0 14px; unicode-bidi: plaintext; }
.lm-intro b { color: #fff; font-weight: 600; }
.lm-body .card.learn-card { margin-bottom: 14px; }
.lm-doc { max-height: none; margin: 6px 0 14px; }
.lm-back { margin-bottom: 12px; }

/* --- Universal 3-state expandable box (box3) — used panel-wide --- */
.box3-stack { display: block; }
.box3 { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 8px; overflow: hidden; }
.box3[open] { border-color: var(--accent); }
.box3 > summary.box3-sum { cursor: pointer; padding: 11px 13px; list-style: none; display: flex; align-items: flex-start; gap: 10px; transition: background .12s; user-select: none; -webkit-user-select: none; }
.box3 > summary::-webkit-details-marker { display: none; }
.box3 > summary:hover { background: rgba(255,255,255,.02); }
.box3-ic { flex: 0 0 auto; font-size: 16px; line-height: 1.45; }
.box3-tw { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.box3-title { font-weight: 700; font-size: 14px; color: #fff; unicode-bidi: plaintext; }
.box3-basic { font-size: 13px; color: var(--muted); line-height: 1.55; unicode-bidi: plaintext; }
.box3 > summary .acc-chevron { flex: 0 0 auto; align-self: center; }
.box3[open] > summary .acc-chevron { transform: rotate(90deg); }
.box3-body { padding: 2px 13px 13px; }
.box3-more { font-size: 13.5px; line-height: 1.7; color: var(--txt); unicode-bidi: plaintext; }
.box3-more b, .box3-deep-body b { color: #fff; font-weight: 600; }
.box3-more p, .box3-deep-body p { margin: 8px 0; }
.box3-deep { margin-top: 11px; border: 1px dashed var(--line); border-radius: 8px; background: rgba(120,180,255,.03); }
.box3-deep[open] { border-color: rgba(120,180,255,.35); }
.box3-deep > summary { cursor: pointer; padding: 8px 11px; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 6px; user-select: none; -webkit-user-select: none; }
.box3-deep > summary::-webkit-details-marker { display: none; }
.box3-deep > summary .acc-chevron { margin-inline-start: auto; }
.box3-deep[open] > summary .acc-chevron { transform: rotate(90deg); }
.box3-deep-body { padding: 4px 12px 13px; font-size: 13px; line-height: 1.75; color: var(--txt); unicode-bidi: plaintext; }
/* deep-content visual toolkit */
.b3math { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 5px; direction: ltr; unicode-bidi: isolate; display: inline-block; font-size: 12.5px; }
.b3eq { display: block; margin: 9px 0; text-align: center; }
.b3fig { margin: 11px 0; }
.b3cap { font-size: 12px; color: var(--muted); margin-top: 5px; unicode-bidi: plaintext; }
.b3tbl { border-collapse: collapse; margin: 9px 0; font-size: 12.5px; direction: ltr; }
.b3tbl th, .b3tbl td { border: 1px solid var(--line); padding: 4px 9px; text-align: start; }
.b3tbl th { background: rgba(255,255,255,.04); font-weight: 600; }
.b3bars { display: flex; align-items: flex-end; gap: 3px; height: 56px; margin: 8px 0; direction: ltr; }
.b3bar { flex: 1 1 auto; background: linear-gradient(180deg, var(--accent), rgba(120,180,255,.4)); border-radius: 2px 2px 0 0; min-height: 2px; }
.box3-deep-body .pcard { margin: 1px; }
.b3hand { display: inline-flex; gap: 3px; margin: 2px 4px 2px 0; vertical-align: middle; }

/* box3 depth indicator (●●● shows the 3 states) + interaction legend */
.box3-depth { flex: 0 0 auto; align-self: center; font-size: 9px; letter-spacing: 1px; color: var(--muted); }
.box3.has-deep .box3-depth::after { content: "\25CF\25CB\25CB"; }            /* ●○○ closed */
.box3.has-deep[open] .box3-depth::after { content: "\25CF\25CF\25CB"; }       /* ●●○ open */
.box3.has-deep[open]:has(.box3-deep[open]) .box3-depth::after { content: "\25CF\25CF\25CF"; } /* ●●● deeper */
.box3-legend { font-size: 12px; color: var(--muted); margin: 2px 0 12px; unicode-bidi: plaintext; }

/* Shared live-data freshness chip (Overview / Plan / Versions) */
.fresh-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--accent); background: rgba(120,180,255,.1); border: 1px solid rgba(120,180,255,.25); border-radius: 999px; padding: 1px 9px; white-space: nowrap; unicode-bidi: plaintext; }
.fresh-chip.stale { color: var(--muted); background: rgba(255,255,255,.04); border-color: var(--line); }

/* Header search button */
.search-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.search-btn:hover { border-color: var(--accent); }
.search-kbd { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
/* Search palette overlay */
.palette { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; }
.palette.hidden { display: none; }
.palette-box { width: 100%; max-width: 680px; background: var(--panel); border: 1px solid var(--accent); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); display: flex; flex-direction: column; max-height: 80vh; overflow: hidden; }
.palette-input { width: 100%; box-sizing: border-box; background: transparent; border: none; border-bottom: 1px solid var(--line); color: var(--txt); font-size: 16px; padding: 16px 18px; outline: none; }
.palette-results { overflow-y: auto; padding: 10px 14px 14px; }
.palette-group { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 10px 2px 6px; }
.palette-item { display: block; width: 100%; text-align: start; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--txt); padding: 9px 11px; font-size: 14px; cursor: pointer; }
.palette-item:hover { background: rgba(120,180,255,.08); border-color: rgba(120,180,255,.25); }
.palette-empty { color: var(--muted); padding: 18px 6px; text-align: center; }
.gloss-launch { cursor: pointer; }
.gloss-launch:hover { border-color: var(--accent); }

/* Changelog feed */
.cl-date { color: var(--muted); font-size: 12px; }
.cl-item .box3-title { font-weight: 600; font-size: 13.5px; }
.cl-item .box3-more { font-size: 12.5px; color: var(--muted); }

/* Lazy-loaded Learn module body (built on first open) */
.lm-heavy { min-height: 18px; }
.lm-loading { padding: 8px 2px; font-size: 13px; }

/* Hardware card — "Used in" plan/sprint cross-reference */
.hw-usage { font-size: 12.5px; line-height: 1.6; color: var(--txt); background: rgba(120,180,255,.05); border-inline-start: 2px solid rgba(120,180,255,.4); padding: 6px 10px; border-radius: 0 6px 6px 0; margin: 8px 0; unicode-bidi: plaintext; }
.hw-usage .k { color: var(--accent); font-weight: 600; }
.hw-usage b { color: #fff; }

/* Onboarding: sticky section nav (SPA feel) + box3 module tweaks */
.learn-toc-sticky { position: sticky; top: -1px; z-index: 20; background: var(--bg); padding: 9px 0 7px; margin: 4px 0 8px; border-bottom: 1px solid var(--line); }
/* Collapsible TOC (minify/extend): folds to a chip on mobile so the topic list
   stops dominating the screen; open by default on desktop. */
.toc-collapse > summary.toc-sum { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--txt); padding: 3px 2px; }
.toc-collapse > summary.toc-sum::-webkit-details-marker { display: none; }
.toc-collapse .toc-count { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 11px; color: var(--muted); }
.toc-collapse > summary .acc-chevron { margin-inline-start: auto; color: var(--muted); font-size: 12px; transition: transform .15s; display: inline-block; }
.toc-collapse[open] > summary .acc-chevron { transform: rotate(90deg); }
.toc-collapse[open] > .learn-toc { margin-top: 8px; }
/* Overview "all" section dividers (trainers → data → goal/plan) */
.ov-section { margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--txt); letter-spacing: .2px; }
.box3.learn-module { margin-bottom: 12px; }
.box3.learn-module > summary.box3-sum { padding: 13px 15px; }
.box3.learn-module .box3-ic { display: inline-flex; align-items: center; }
.box3.learn-module .box3-title { font-size: 15px; }
.box3.learn-module .box3-deep { margin-top: 12px; }

/* Glossary auto-link — click any term to open it in the search palette */
.term-link { color: var(--accent); text-decoration: none; border-bottom: 1px dotted rgba(120,180,255,.5); cursor: pointer; }
.term-link:hover { border-bottom-style: solid; background: rgba(120,180,255,.08); }

/* Poker teacher — warm, friendly accent on the lesson boxes */
.box3.poker3[open] { border-color: #e8b04b; }
.box3.poker3 .box3-ic { font-size: 18px; }
.box3.poker3 .box3-title { color: #ffe6b0; }
.box3.poker3 .box3-deep { border-color: rgba(232,176,75,.3); background: rgba(232,176,75,.04); }
.box3.poker3 .box3-deep > summary { color: #e8b04b; }

/* Hold'em poker tab — segmented control: Quick reference vs Course */
.pk-mode-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 10px 0 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel2); }
.pk-mode-tab { appearance: none; border: 0; cursor: pointer; padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--muted); background: transparent; transition: background .12s, color .12s; }
.pk-mode-tab:hover { color: var(--txt); }
.pk-mode-tab.active { background: #e8b04b; color: #2a1c02; }
.pk-mode[hidden] { display: none; }
.pk-course-banner { border: 1px solid rgba(232,176,75,.32); background: rgba(232,176,75,.05); border-radius: 12px; padding: 12px 15px; margin: 4px 0 12px; font-size: 13.5px; line-height: 1.7; }
.pk-course-banner b { color: #ffe6b0; }
.phl-cards b { font-family: var(--mono); font-weight: 700; white-space: nowrap; }

/* --- Mobile polish for the box3 curriculum views (Onboarding / Poker) --- */
@media (max-width: 760px) {
  /* the section nav becomes one swipeable row instead of a tall wrapping block */
  .learn-toc { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
  .learn-toc::-webkit-scrollbar { display: none; }
  .learn-toc a { flex: 0 0 auto; white-space: nowrap; }
  .learn-toc-sticky { padding: 6px 0 5px; margin: 2px 0 6px; }
  /* compact, title-forward folded lessons; the one-liner is clamped until opened */
  .box3 > summary.box3-sum { padding: 10px 12px; gap: 8px; }
  .box3.learn-module > summary.box3-sum, .box3.poker3 > summary.box3-sum { padding: 11px 12px; }
  .box3-basic { font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .box3[open] > summary .box3-basic { -webkit-line-clamp: initial; display: block; overflow: visible; }
  .box3.poker3 .box3-title { font-size: 15px; }
  .box3-body { padding: 2px 12px 13px; }
  .box3-deep-body { padding: 4px 10px 12px; }
  .box3-more, .box3-deep-body { font-size: 13.5px; line-height: 1.7; }
  /* tables/figures never overflow the viewport */
  .box3-deep-body .b3tbl, .box3-more .b3tbl { display: block; overflow-x: auto; max-width: 100%; }
  .box3-deep-body .b3bars { height: 48px; }
  .learn-banner { font-size: 12.5px; padding: 8px 10px; }
}

/* "Where we are · next gate" status card */
.gate-now { border-color: rgba(232,176,75,.35); background: linear-gradient(180deg, rgba(232,176,75,.05), transparent); }
.gate-now h3 { color: var(--warn); }
.gate-now .sub { font-size: 13px; line-height: 1.7; color: var(--txt); }
/* accent-edge modifiers (RTL-safe logical edge); bespoke card-accent colors kept literal */
.gate-now.blue { border-inline-start: 4px solid var(--accent); }
.gate-now.warn { border-inline-start: 4px solid #f5a623; }
.gate-now.live { border-inline-start: 4px solid #2ecc71; }
.gate-now.purple { border-inline-start: 4px solid #9b59b6; }

/* Live status banner (shared: Overview + Hold'em Overview + Dev-plan) */
.live-banner { border-color: rgba(46,204,113,.38); background: linear-gradient(180deg, rgba(46,204,113,.06), transparent); }
.live-banner .live-h { color: #2ecc71; margin: 0 0 8px; }
.live-tagline { font-size: 13px; line-height: 1.6; color: var(--txt); margin-bottom: 8px; }
.live-now { font-size: 13.5px; line-height: 1.7; color: var(--txt); margin-bottom: 6px; }
.live-graph { margin: 6px 0; }
.live-plan { font-size: 13px; line-height: 1.75; color: var(--txt); margin-top: 6px; }
.live-plan p { margin: 6px 0; }
.live-plan code { background: var(--panel2); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
.live-verdict { font-size: 13px; line-height: 1.75; color: var(--txt); margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed rgba(90,200,122,.4); }
.live-verdict h4 { color: #5ac87a; margin: 0 0 6px; font-size: 13.5px; }
.live-verdict p, .live-verdict ul { margin: 6px 0; }
.live-verdict li { margin: 3px 0; }
.live-reanalysis { font-size: 13px; line-height: 1.75; color: var(--txt); margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed rgba(255,138,101,.35); }
.live-reanalysis h4 { color: var(--orange); margin: 0 0 6px; font-size: 13.5px; }
.live-reanalysis p { margin: 6px 0; }
.live-reanalysis-tbl td, .live-reanalysis-tbl th { vertical-align: top; }

/* ---- Ladder STEP labels + the per-variant ladder climb (Ladder view) ---- */
.ph-step { font-size: 10px; font-weight: 700; letter-spacing: .3px; color: var(--accent);
  background: rgba(91,140,255,.14); border-radius: 999px; padding: 1px 7px; flex: none; }
.phase.done .ph-step { color: var(--accent2); background: rgba(56,211,159,.14); }
/* abilities (search / dynamic raises / multiway / super-max) are NOT ladder rungs
   — distinct purple chip so they never read as an abstraction-degree "Step N". */
.ph-step.ph-ability { color: var(--purple); background: rgba(201,139,255,.14); }
.phase.done .ph-step.ph-ability { color: var(--purple); background: rgba(201,139,255,.14); }

.lclimb { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.lstep { border: 1px solid var(--line); border-radius: 11px; background: var(--panel); overflow: hidden; }
.lstep-h { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.lstep-h .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.25); flex: none; }
.lstep > summary { list-style: none; cursor: pointer; padding: 11px 14px; transition: background .12s; }
.lstep > summary::-webkit-details-marker { display: none; }
.lstep > summary:hover { background: rgba(255,255,255,.02); }
.lstep[open] .acc-chevron { transform: rotate(90deg); }

/* PAST — minified, muted single line */
.lstep-past { border-color: rgba(56,211,159,.32); background: rgba(56,211,159,.03); }
.lstep-past .lstep-h { font-size: 12.5px; color: var(--muted); }
.lstep-past .lstep-h b { color: var(--txt); }
.lstep-ok { color: var(--accent2); font-weight: 700; }

/* CURRENT — emphasized rung */
.lstep-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset;
  background: linear-gradient(180deg, rgba(91,140,255,.06), transparent); padding: 13px 15px; }
.lstep-current .lstep-h { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.lstep-live-line { font-size: 13px; margin: 4px 0 6px; }
.lstep-req { font-size: 12px; margin: 6px 0; }
.lstep-detail-open { margin-top: 10px; font-size: 13.5px; line-height: 1.7; }

/* FUTURE — requirements-to-reach blocks */
.lstep-future { border-style: dashed; }
.lstep-future .lstep-tag { font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--warn); border: 1px solid rgba(232,176,75,.4); border-radius: 999px; padding: 1px 7px; margin-inline-start: 4px; }
.lstep-reqs { padding: 2px 14px 12px; font-size: 12.5px; line-height: 1.6; }
.lstep-reqrow { margin: 2px 0; }
.lstep-unlock { margin-top: 8px; font-size: 12.5px; color: var(--accent); background: rgba(91,140,255,.08);
  border-radius: 8px; padding: 6px 9px; }
.lstep-body { padding: 4px 14px 14px; font-size: 13.5px; line-height: 1.7; color: var(--txt); }

.lclimb-banner { border-color: rgba(91,140,255,.35); background: linear-gradient(180deg, rgba(91,140,255,.05), transparent); }
.lclimb-banner .sub { font-size: 13px; line-height: 1.7; color: var(--txt); }

/* --- Dev plan — engineering-lever roadmap badges/category chips --- */
.dp-disclaimer { font-size: 12px; color: var(--muted); margin: -4px 0 14px; padding: 6px 10px;
  border: 1px dashed var(--line); border-radius: 8px; }
.dp-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap; }
.dp-st-done    { color: #46d39a; border-color: rgba(70,211,154,.4);  background: rgba(70,211,154,.08); }
.dp-st-partial { color: #e6b450; border-color: rgba(230,180,80,.4);  background: rgba(230,180,80,.08); }
.dp-st-todo    { color: #93a0b5; border-color: var(--line);          background: rgba(255,255,255,.03); }
.dp-st-blocked { color: #e87b7b; border-color: rgba(232,123,123,.4); background: rgba(232,123,123,.08); }
.dp-cat { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  margin-inline-end: 6px; border: 1px solid var(--line); color: var(--muted); }
.dp-cat-A { color: #5b8cff; border-color: rgba(91,140,255,.4);  background: rgba(91,140,255,.08); }
.dp-cat-B { color: #46d39a; border-color: rgba(70,211,154,.4);  background: rgba(70,211,154,.08); }
.dp-cat-C { color: #e6b450; border-color: rgba(230,180,80,.4);  background: rgba(230,180,80,.08); }
.dp-cat-D { color: var(--purple); border-color: rgba(201,139,255,.4); background: rgba(201,139,255,.08); }
.dp-payoff { font-size: 12.5px; color: var(--txt); }
.dp-cathead { margin: 20px 0 8px; font-size: 14px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.dp-catblock { margin-bottom: 8px; }
.dp-intro .dp-prose, .dp-seq-list { font-size: 13.5px; line-height: 1.8; color: var(--txt); }
.dp-seq-list { padding-inline-start: 20px; }
.dp-seq-list li { margin-bottom: 6px; }
.dp-refs { font-size: 11.5px; margin-top: 8px; }
.dp-refs code, .dp-prose code { background: var(--panel2); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
/* Rust migration roadmap card — accented; phased table + test layers + gates */
.dp-roadmap { border-color: rgba(91,140,255,.35); }
.dp-roadmap h3 { display: flex; align-items: center; gap: 7px; }
.dp-roadmap .dp-prose { font-size: 13.5px; line-height: 1.8; color: var(--txt); margin: 4px 0 12px; }
.dp-roadmap .dp-prose b { color: #fff; font-weight: 600; }
.dp-roadmap .dp-prose code { background: var(--panel2); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
.dp-h4 { margin: 18px 0 7px; font-size: 12.5px; font-weight: 700; color: var(--accent-2);
  text-transform: uppercase; letter-spacing: .04em; }

/* ===========================================================================
   Hold'em deep onboarding (learn_holdem.js) — chapters, code toggle, key terms.
   Namespaced .hl-* so it can't collide with the rest of the panel.
   =========================================================================== */
.hl-wrap { margin-top: 2px; line-height: 1.7; }
.hl-wrap p { margin: 9px 0; }
.hl-wrap ul, .hl-wrap ol { margin: 8px 0; padding-inline-start: 22px; }
.hl-wrap li { margin: 4px 0; }
.hl-wrap b { color: #fff; font-weight: 600; }
.hl-wrap code { font-family: var(--mono); font-size: 12px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; unicode-bidi: isolate; }
.hl-lead { font-size: 14.5px; line-height: 1.72; margin: 4px 0 14px; color: var(--txt); }

/* nested expandable sub-section */
.hl-sec { border: 1px solid var(--line); border-radius: 10px; background: var(--panel2);
  margin: 11px 0; overflow: hidden; }
.hl-sec > summary { cursor: pointer; padding: 11px 14px; font-weight: 600; font-size: 14px;
  list-style: none; display: flex; align-items: center; gap: 8px; }
.hl-sec > summary::-webkit-details-marker { display: none; }
.hl-sec > summary::marker { content: ""; }
.hl-sec > summary:hover { background: rgba(255,255,255,.025); }
.hl-sec > summary .acc-chevron { margin-inline-start: auto; transition: transform .15s; color: var(--muted); }
.hl-sec[open] > summary .acc-chevron { transform: rotate(90deg); }
.hl-sec-body { padding: 2px 15px 14px; }
.hl-sec-body h4 { margin: 14px 0 4px; font-size: 13.5px; color: var(--accent); }

/* boxed equation / formula — always LTR */
.hl-eq { display: block; font-family: var(--mono); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; margin: 11px 0; overflow-x: auto;
  unicode-bidi: isolate; direction: ltr; text-align: left; font-size: 13px; color: var(--accent2); }

/* callouts */
.hl-note { border-inline-start: 3px solid var(--accent); background: var(--accent-soft);
  padding: 8px 13px; border-radius: 0 8px 8px 0; margin: 11px 0; font-size: 13.5px; }
.hl-flag { border-inline-start: 3px solid var(--warn); background: rgba(230,180,80,.08);
  padding: 8px 13px; border-radius: 0 8px 8px 0; margin: 11px 0; font-size: 13px; color: var(--txt); }

/* Python <-> Rust code block with a persisted global language toggle */
.hl-code { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 13px 0; background: var(--bg2); }
.hl-code-head { display: flex; align-items: center; gap: 10px; padding: 7px 11px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.hl-code-title { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.hl-code-tabs { margin-inline-start: auto; display: inline-flex; gap: 5px; }
.hl-lang-tab { font: 600 12px var(--mono); padding: 3px 13px; border-radius: 6px;
  border: 1px solid var(--line2); background: transparent; color: var(--muted); cursor: pointer; }
.hl-lang-tab:hover { color: var(--txt); }
/* default (no body class) = Python active */
.hl-lang-tab[data-l="py"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
body.hl-lang-rs .hl-lang-tab[data-l="py"] { background: transparent; color: var(--muted); border-color: var(--line2); }
body.hl-lang-rs .hl-lang-tab[data-l="rs"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.hl-pane { margin: 0; border: 0; border-radius: 0; padding: 12px 14px; overflow-x: auto;
  white-space: pre; background: var(--bg2); direction: ltr; text-align: left; unicode-bidi: isolate; }
.hl-pane.hl-rs { display: none; }                 /* python shown by default */
body.hl-lang-rs .hl-pane.hl-py { display: none; }
body.hl-lang-rs .hl-pane.hl-rs { display: block; }
.hl-pane code { font-family: var(--mono); font-size: 12px; background: none; border: 0;
  padding: 0; color: var(--txt); line-height: 1.55; }
.hl-explain { margin: 0; padding: 10px 14px 12px; border-top: 1px dashed var(--line); list-style: none; }
.hl-explain li { margin: 5px 0; font-size: 13px; padding-inline-start: 18px; position: relative; }
.hl-explain li::before { content: "→"; position: absolute; inset-inline-start: 0; color: var(--accent); }
.hl-explain code { font-family: var(--mono); font-size: 11.5px; }

/* "Key terms" footer — glossary links */
.hl-keyterms { margin: 16px 0 4px; padding-top: 11px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.hl-keyterms-lbl { font-size: 12px; font-weight: 600; color: var(--muted); margin-inline-end: 4px; }
.hl-term { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line2);
  background: var(--panel2); color: var(--accent); cursor: pointer; }
.hl-term:hover { background: var(--accent-soft); border-color: var(--accent); }
/* inner course link — jump to another module in-page (no markdown files) */
.hl-ilink { color: var(--accent); cursor: pointer; border-bottom: 1px dotted var(--accent);
  text-decoration: none; font-weight: 600; }
.hl-ilink:hover { border-bottom-style: solid; background: var(--accent-soft); }
.hl-ilink::after { content: " ↪"; font-size: .85em; opacity: .7; }

/* inline figure (SVG) */
.hl-fig { margin: 13px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.hl-fig svg { max-width: 100%; height: auto; display: block; }
.hl-fig-cap { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

@media (max-width: 560px) {
  .hl-code-head { flex-wrap: wrap; }
  .hl-code-tabs { margin-inline-start: 0; }
  .hl-pane code, .hl-pane { font-size: 11px; }
  .hl-sec-body { padding-inline: 11px; }
  .hl-lead { font-size: 14px; }
}

/* ── Play source picker (local vs remote game server) ───────────────────── */
#play-source { margin: 8px 0; text-align: center; }
.play-src-lbl { font-size: 12px; opacity: .7; margin-inline-end: 6px; }
.play-src-btn { padding: 5px 12px; border-radius: 7px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 13px; margin: 0 3px; }
.play-src-btn.on { background: var(--accent); color: #fff; }

/* ── Remote machines card (Hardware view) ───────────────────────────────── */
.rmt-card h3 { margin-bottom: 2px; }
.rmt-note.warn { padding: 8px 10px; border-radius: 8px; background: rgba(216,181,58,.12);
  border: 1px solid rgba(216,181,58,.35); font-size: 13px; margin: 8px 0; }
.rmt-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.rmt-add input, .rmt-add select { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line2);
  background: var(--panel); color: var(--txt); font-size: 13px; }
.rmt-add button { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; font-weight: 600; cursor: pointer; }
.rmt-pwnote { font-size: 11px; }
.rmt-host { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.rmt-host-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rmt-chip { font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.rmt-chip.ok { background: rgba(64,180,110,.18); color: #40b46e; border: 1px solid rgba(64,180,110,.4); }
.rmt-chip.warn { background: rgba(216,181,58,.15); color: var(--gold); border: 1px solid rgba(216,181,58,.4); }
.rmt-chip.off { background: rgba(160,160,160,.12); color: #999; border: 1px solid rgba(160,160,160,.3); }
.rmt-del { margin-inline-start: auto; background: transparent; border: none; color: #c05; cursor: pointer; font-size: 14px; }
.rmt-ops { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.rmt-vsel { padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel); color: var(--txt); }
.rmt-btn { padding: 5px 11px; border-radius: 6px; border: 1px solid var(--accent); background: transparent;
  color: var(--accent); font-weight: 600; cursor: pointer; font-size: 13px; }
.rmt-btn.play { background: var(--gold); border-color: var(--gold); color: #1a1a1a; }
.rmt-runs { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.rmt-runs th, .rmt-runs td { text-align: start; padding: 2px 8px; border-bottom: 1px solid var(--line); }
.rmt-log { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
  font-size: 11px; max-height: 160px; overflow: auto; white-space: pre-wrap; margin-top: 6px; }
.rmt-empty { padding: 8px 0; }

/* ── Academic library (Hold'em papers browser) ──────────────────────────── */
.acad-mod .acad-tag { display: block; font-size: 11px; opacity: .6; font-weight: 400; margin-top: 1px; }
.acad-toc-box { padding: 2px 0 6px 10px; border-inline-start: 2px solid var(--line); margin: 2px 0 6px 8px; }
.acad-toc { display: block; font-size: 12px; padding: 3px 8px; color: var(--muted); text-decoration: none; border-radius: 5px; }
.acad-toc:hover { background: rgba(76,139,245,.10); color: #cdd6e4; }
.acad-toc.active { color: var(--accent); font-weight: 600; }

/* ── Ladder: field-gauntlet measurement card ────────────────────────────── */
.gnt-card { margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: rgba(216,181,58,.08); border: 1px solid rgba(216,181,58,.30); }
.gnt-hd { font-weight: 600; font-size: 13px; color: var(--gold); margin-bottom: 3px; }
.gnt-now { font-size: 14px; }
.gnt-now .spark { vertical-align: middle; margin-inline-start: 6px; }
.gnt-opps { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; opacity: .85; }
.gnt-opp { white-space: nowrap; }

/* ── Ladder: floor-watch (done-iterating) card ──────────────────────────── */
.fw-card { margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: rgba(90,140,200,.08); border: 1px solid rgba(90,140,200,.30); }
.fw-hd { font-weight: 600; font-size: 13px; color: #7fb0e8; margin-bottom: 3px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fw-now { font-size: 14px; }
.fw-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.fw-flat { background: rgba(216,181,58,.20); color: #e0c14a; border: 1px solid rgba(216,181,58,.45); }
.fw-moving { background: rgba(90,180,120,.18); color: #78c98f; border: 1px solid rgba(90,180,120,.40); }

/* ── Accessibility (REVIEW_2026-07 L1) ──────────────────────────────────── */
/* Focus visibility: inputs above swap only border-color on :focus (a weak
   cue) and several controls zeroed the outline entirely. Restore a clear,
   keyboard-only ring everywhere — :focus-visible never triggers on mouse
   clicks, so the pointer experience is unchanged. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.tab:focus-visible, .vtab:focus-visible, .pc-btn:focus-visible,
.lang-btn:focus-visible, .mcard:focus-visible, .gloss-launch:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Reduced motion: honor the OS setting — collapse every transition/animation
   (incl. the LED pulse and bar sweeps) and drop smooth scrolling. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto !important; }
}

/* ── RTL polish (REVIEW_2026-07 L2) — mirror the .md physical props ─────── */
.md ul, .md ol { padding-left: 0; padding-inline-start: 22px; }
.md blockquote { border-left: 0; border-inline-start: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
[dir="rtl"] .md blockquote { border-radius: 8px 0 0 8px; }
