/* Docked chart: single-column (your scenario) + drilled-down hands, beside a
 * "Full chart" slide-in drawer with the complete multi-column heatmap. */

/* header */
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.chart-title { font-size: 15px; font-weight: 700; }
.chart-auto { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.chart-auto b { color: var(--gold); }
.chart-auto-pos { color: var(--accent); }
.chart-full-btn {
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--gold); background: var(--panel-2); border: 1px solid var(--gold-soft);
  border-radius: 8px; padding: 6px 11px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.chart-full-btn:hover { filter: brightness(1.18); }

/* split body: single column | hands */
.chart-split { display: flex; flex: 1; min-height: 0; }
.chart-single { flex: 0 0 244px; overflow: visible; border-right: 1px solid var(--line); padding: 18px 14px; }
.chart-hands { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chart-hands .hands-head {
  padding: 10px 12px 8px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.hands-title { font-size: 14px; font-weight: 700; }
.hands-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.chart-hands .hands-body { flex: 1; overflow: auto; padding: 4px 10px 14px; }

.chart-hint { color: var(--muted); padding: 18px 12px; font-size: 12px; }
.chart-err { color: var(--red); padding: 18px 12px; line-height: 1.5; font-size: 12px; }

/* shared heatmap table bits (single column + full drawer) */
.chart-table { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { border: 1px solid var(--line); padding: 4px 7px; text-align: center; }
.chart-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel); color: #cfd3df; font-size: 11px; font-weight: 600; padding: 7px; white-space: nowrap;
}
.ch-rowhead { background: var(--panel); text-align: left; white-space: nowrap; }
.ch-corner { color: var(--muted); font-weight: 600; }
.ch-prev { display: inline-flex; gap: 2px; vertical-align: middle; }
.ch-rowlabel { font-size: 11.5px; color: var(--text); margin-left: 7px; }
.ctag {
  display: inline-block; font-size: 10px; font-weight: 700; color: #0c0c0e;
  background: #cfd3df; border-radius: 3px; padding: 0 4px; margin-left: 5px;
}
.ch-cell { min-width: 56px; cursor: pointer; font-size: 12px; font-weight: 600; min-height: 40px;}
.ch-n { display: block; font-size: 9px; opacity: 0.7; font-weight: 400; }
.chart-table .card { border-radius: 3px; }

/* docked hand info card */
.hand-summary {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 11px;
}
.hs-cards { display: flex; gap: 5px; justify-content: center; }
.hs-cards .card { border-radius: 6px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); }
.hs-cat { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.12; margin-top: 2px; }
.hs-tag {
  font-size: 11.5px; font-weight: 700; color: var(--gold);
  background: var(--panel-2); border: 1px solid var(--gold-soft); border-radius: 999px; padding: 3px 11px;
}
.hs-pos { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.hs-stats { display: flex; gap: 9px; width: 100%; margin-top: 6px; }
.hs-stat {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 6px;
}
.hs-num { font-size: 21px; font-weight: 800; line-height: 1; }
.hs-lbl { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 5px; }

/* heuristic "Suggested play" bar (handScore + ranges, not GTO) */
.sg { width: 100%; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.sg-head {
  font-size: 9.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; text-align: left;
}
.sg-spot { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--gold-soft); }
.sg-note { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: 0.7; cursor: help; }
.sg-row { display: grid; grid-template-columns: 42px 1fr 34px; align-items: center; gap: 8px; }
.sg-label { font-size: 11px; font-weight: 700; color: var(--text); text-align: left; }
.sg-track { height: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.sg-fill { display: block; height: 100%; border-radius: 5px 0 0 5px; }
.sg-pct { font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; }
.sg-raise .sg-fill { background: var(--gold); }
.sg-raise .sg-label { color: var(--gold); }
.sg-call .sg-fill { background: var(--blue); }
.sg-check .sg-fill { background: color-mix(in srgb, var(--blue) 55%, transparent); }
.sg-fold .sg-fill { background: color-mix(in srgb, var(--muted) 60%, transparent); }

/* postflop trainer aid — sits under the equity card, reusing the suggestion space */
.chart-aid { width: 100%; }
.chart-aid.on { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pf-aid { display: flex; flex-direction: column; gap: 6px; }
.pf-aid-head {
  font-size: 9.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; text-align: left;
}
.pf-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; }
.pf-k { font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; min-width: 52px; }
.pf-why { font-size: 11px; color: var(--text); line-height: 1.35; }
.pf-act { font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.pf-act.rec { color: var(--gold); border-color: var(--gold-soft); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.pf-act.ok { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 45%, transparent); }
.pf-act.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }

@keyframes chartAutoPulse {
  0%, 100% { outline-color: var(--gold-soft); box-shadow: 0 0 0 0 rgba(216, 180, 106, 0); }
  50% { outline-color: var(--gold); box-shadow: 0 0 11px 1px rgba(216, 180, 106, 0.5); }
}

/* hand rows (docked + drawer share) */
.hand-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 5px 8px;
  align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line);
}
.hand-row .hand-cards { display: inline-flex; gap: 2px; }
.hand-row code { font-size: 10.5px; color: var(--muted); }

/* the player's exact hand within the bucket (auto-detected + scrolled into view):
   a soft tint of the current highlight color — no border */
.hand-row.match {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  border-radius: 6px;
}
.hand-eq { font-weight: 700; color: var(--green); text-align: right; }
.hand-ci { grid-column: 2 / 4; text-align: right; color: var(--muted); font-size: 10px; }

/* full-chart slide-in drawer */
.chart-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(6, 7, 10, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.28s ease;
}
.chart-backdrop.show { opacity: 1; pointer-events: auto; }
.chart-drawer {
  position: fixed; top: 0; right: 0; z-index: 50; height: 100vh; width: min(900px, 94vw);
  display: flex; flex-direction: column; background: var(--bg-2);
  border-left: 1px solid var(--line); box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.22, 0.8, 0.25, 1);
}
.chart-drawer.show { transform: translateX(0); }
@media (max-width: 640px) {
  .chart-drawer {
    top: auto; bottom: 0; right: 0; left: 0;
    width: 100vw; height: 92dvh;
    border-left: none; border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .chart-drawer.show { transform: translateY(0); }
}
.chart-drawer .chart-legend {
  display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; padding: 9px 18px;
}
.chart-bar { width: 130px; height: 9px; border-radius: 3px;
  background: linear-gradient(90deg, hsl(0 52% 30%), hsl(60 52% 30%), hsl(120 52% 30%)); }
.chart-legend-note { margin-left: auto; font-style: italic; opacity: 0.8; }
.chart-scroll { flex: 1; overflow: auto; padding: 0 18px 22px; }

/* two sticky leading columns: cards, then category (fixed, uniform width) */
.ch-cards-col {
  position: sticky; left: 0; z-index: 1; width: 104px; min-width: 104px;
  background: var(--panel); text-align: center; padding: 4px 7px;
}
.ch-cat-col {
  position: sticky; left: 104px; z-index: 1;
  width: 158px; min-width: 158px; max-width: 158px;
  background: var(--panel); text-align: left; white-space: nowrap;
}
.chart-drawer thead .ch-cards-col, .chart-drawer thead .ch-cat-col { z-index: 3; }
.ch-cards-col .ch-prev { display: inline-flex; gap: 2px; vertical-align: middle; }
.ch-catname { font-size: 12.5px; color: var(--text); font-weight: 600; }
.ch-cat-col .ctag { margin-left: 6px; }

/* highlight via OUTLINE only — paints on top, sits at the cell edge, and does
   NOT set `position` on the <td> (which is undefined behaviour for table cells
   and was reflowing the cell's contents inline). Cell size/layout unchanged. */
.chart-drawer .ch-cell:hover { outline: 2px solid #fff; outline-offset: -1px; }
.chart-drawer .ch-cell.auto { outline: 3px solid var(--gold); outline-offset: -1px; animation: chartAutoPulse 1.5s ease-in-out infinite; }
.hands-close {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  width: 32px; height: 32px; border-radius: 8px; font-size: 18px; cursor: pointer; line-height: 1;
}
.hands-close:hover { color: var(--text); filter: brightness(1.2); }
