:root {
  color-scheme: dark;
  --bg: #0d1017;
  --bg-2: #11151d;
  --panel: #161b24;
  --panel-2: #1c222d;
  --raise: #232a37;
  --line: #262d3a;
  --line-2: #323b4b;
  --text: #e9edf3;
  --text-2: #aab3c2;
  --muted: #6f7a8c;
  --accent: #7c6cf2;
  --accent-2: #9d90ff;
  --good: #34c77b;
  --bad: #ef5b5b;
  --warn: #f2b84b;

  --a-fold: #4f8ef7;
  --a-check: #33c27f;
  --a-call: #33c27f;
  --a-bet1: #f6b44c;
  --a-bet2: #f07b3f;
  --a-bet3: #e2483d;
  --a-allin: #b5244f;

  --s-s: #343c4c;
  --s-h: #d94452;
  --s-d: #3b7be0;
  --s-c: #2fa866;

  --cell: #1a1f29;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(1200px 600px at 70% -10%, rgba(124,108,242,.10), transparent 60%), var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(13,16,23,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; padding: 4px; border-radius: 8px; fill: #fff; background: linear-gradient(135deg, var(--accent), #4f8ef7); }
.brand b { font-weight: 800; margin-left: 2px; }
.top nav { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); padding: 3px; border-radius: 10px; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 7px; color: var(--text-2); font-weight: 500; font-size: 13px; }
.tab.active { background: var(--raise); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }

main { max-width: 1280px; margin: 0 auto; padding: 16px 16px 120px; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); min-width: 0;
}
.panel + .panel { margin-top: 12px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel-head .row, .panel-title, .panel-head .sub { white-space: nowrap; }
.panel-title { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.sub { color: var(--muted); font-size: 12px; }
.err { color: var(--bad); font-size: 13px; }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--raise); color: var(--text);
  border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 500;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: #2a3242; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.primary {
  border: 0; color: #fff; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #5f7cf5);
  box-shadow: 0 6px 20px rgba(124,108,242,.35);
}
.btn.primary:disabled { opacity: .5; }
.btn.block { width: 100%; padding: 13px; font-size: 15px; border-radius: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.input, textarea.input, select.input {
  width: 100%; min-width: 0; background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 9px 11px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,108,242,.18); }
textarea.input { resize: vertical; font: 12px/1.5 ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; }
.input.bad { border-color: var(--bad); }

.stepper { display: flex; align-items: stretch; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.stepper button { border: 0; background: transparent; width: 36px; color: var(--text-2); font-size: 16px; }
.stepper button:hover { background: var(--raise); color: var(--text); }
.stepper input { flex: 1; width: 100%; min-width: 0; border: 0; background: transparent; text-align: center; font-weight: 600; padding: 9px 0; outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 500;
}
.chip.on { background: rgba(124,108,242,.16); border-color: var(--accent); color: #fff; }
.chip input { width: 44px; border: 0; background: transparent; outline: none; color: var(--text); text-align: center; }

.seg-ctl { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); padding: 3px; border-radius: 10px; gap: 2px; }
.seg-ctl button { border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.seg-ctl button.on { background: var(--raise); color: var(--text); }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }

/* ---------- playing cards ---------- */
.pc {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 44px; height: 60px; border-radius: 8px; color: #fff; font-weight: 800; line-height: 1;
  box-shadow: 0 2px 0 rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.18);
  user-select: none; flex: none;
}
.pc .r { font-size: 22px; letter-spacing: -.02em; }
.pc .s { font-size: 14px; margin-top: 3px; opacity: .9; }
.pc.s-s { background: linear-gradient(160deg, #4a5366, var(--s-s)); }
.pc.s-h { background: linear-gradient(160deg, #ec5c69, var(--s-h)); }
.pc.s-d { background: linear-gradient(160deg, #5592f0, var(--s-d)); }
.pc.s-c { background: linear-gradient(160deg, #43c07c, var(--s-c)); }
.pc.md { width: 34px; height: 46px; border-radius: 6px; }
.pc.md .r { font-size: 17px; } .pc.md .s { font-size: 11px; margin-top: 2px; }
.pc.sm { width: 22px; height: 30px; border-radius: 4px; }
.pc.sm .r { font-size: 12px; } .pc.sm .s { font-size: 8px; margin-top: 1px; }
.pc.slot { background: transparent; border: 1.5px dashed var(--line-2); box-shadow: none; color: var(--muted); }
.cards { display: flex; gap: 6px; align-items: center; }
.cards.tight { gap: 3px; }

.picker { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; margin-top: 12px; }
.picker button {
  aspect-ratio: 5 / 7; border: 0; border-radius: 5px; color: #fff; font-weight: 700; font-size: 12px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  transition: transform .08s, opacity .12s, box-shadow .12s;
}
.picker button small { font-size: 9px; opacity: .85; margin-top: 1px; }
.picker button.s-s { background: var(--s-s); } .picker button.s-h { background: var(--s-h); }
.picker button.s-d { background: var(--s-d); } .picker button.s-c { background: var(--s-c); }
.picker button.dim { opacity: .28; }
.picker button.sel { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff; transform: translateY(-1px); }
.picker button:disabled { cursor: default; }

/* ---------- setup ---------- */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.setup-grid > .panel + .panel { margin-top: 0; }
.board-slots { display: flex; gap: 8px; }
.ranges { display: grid; gap: 12px; }
.ranges > .panel + .panel { margin-top: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(13,16,23,.92) 30%);
}
.sticky-cta > div { max-width: 1280px; margin: 0 auto; }
@media (min-width: 960px) {
  .setup-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .setup-grid .span2 { grid-column: span 2; }
  .ranges { grid-template-columns: 1fr 1fr; }
  .sticky-cta > div { max-width: 420px; margin-right: max(16px, calc((100vw - 1280px) / 2 + 16px)); margin-left: auto; }
}

/* ---------- matrix ---------- */
.matrix { display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; touch-action: manipulation; user-select: none; }
.matrix.edit { touch-action: none; }
.cell {
  position: relative; aspect-ratio: 1; border-radius: 3px; overflow: hidden; background: var(--cell);
  border: 0; padding: 0; font-size: 10px; font-weight: 600; color: var(--text);
}
.cell .lbl { position: absolute; left: 3px; top: 2px; z-index: 2; line-height: 1; letter-spacing: -.02em; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
.cell .val { position: absolute; right: 3px; bottom: 2px; z-index: 2; font-size: 8.5px; line-height: 1; opacity: .9; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.cell.none .lbl { color: #4a5262; text-shadow: none; font-weight: 500; }
.cell .fill { position: absolute; left: 0; right: 0; bottom: 0; display: flex; }
.cell .fill i { display: block; height: 100%; }
.cell.sel { outline: 2px solid #fff; outline-offset: -2px; z-index: 3; }
.cell.on { background: linear-gradient(160deg, var(--accent-2), var(--accent)); }
.matrix .cell:hover:not(.none) { filter: brightness(1.12); }
@media (min-width: 600px) { .cell { font-size: 11px; } .cell .val { font-size: 9.5px; } }
@media (max-width: 380px) { .cell { font-size: 8.5px; } .cell .val { display: none; } }

/* ---------- result ---------- */
.spothead { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 12px; padding-right: 48px; }
.spothead .stats { display: flex; gap: 18px; flex-wrap: wrap; }
.spothead .more {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font-size: 18px; line-height: 1;
}
.spothead .more:hover { border-color: var(--line-2); color: var(--text); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.spothead .status { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (max-width: 700px) {
  .spothead { gap: 10px 14px; }
  .spothead .stats { gap: 14px; }
  .spothead .status { margin-left: 0; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); }
  .spothead .status > .stack { margin-right: auto; }
}
.ring { width: 38px; height: 38px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: var(--line-2); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .4s; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--raise); color: var(--text-2); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.done { color: var(--good); background: rgba(52,199,123,.12); }
.pill.solving, .pill.building { color: var(--accent-2); background: rgba(124,108,242,.14); }
.pill.solving .dot, .pill.building .dot { animation: pulse 1.2s infinite; }
.pill.error { color: var(--bad); background: rgba(239,91,91,.12); }
@keyframes pulse { 50% { opacity: .3; } }

.line { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.line::-webkit-scrollbar { display: none; }
.step {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: var(--panel); border-radius: 10px; padding: 5px 9px 5px 6px; font-size: 12px; font-weight: 500; color: var(--text-2);
}
.step:hover { border-color: var(--line-2); color: var(--text); }
.step .who { font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 5px; background: var(--raise); color: var(--text-2); }
.step .bar { width: 3px; height: 16px; border-radius: 2px; }
.step.cur { border-color: var(--accent); color: var(--text); background: rgba(124,108,242,.10); }
.step.cardstep { padding: 3px 6px; }
.step.back { padding: 5px 10px; font-size: 14px; color: var(--text); background: var(--raise); }
.sep { flex: none; color: var(--line-2); font-size: 12px; }

.layout { display: grid; gap: 12px; }
.layout > div > .panel + .panel { margin-top: 12px; }
@media (max-width: 959px) {
  /* one column: actions, then matrix, then categories; combo detail opens as a sheet */
  .layout { display: flex; flex-direction: column; }
  .layout > .main, .layout > .side { display: contents; }
  .layout .panel { margin-top: 0 !important; }
  #actPanel { order: 0; } #matrixPanel { order: 1; } #catPanel { order: 2; } #detailPanel { display: none; }
}
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .main .matrix { max-width: min(100%, calc(100vh - 250px)); margin: 0 auto; }
  .side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; scrollbar-width: thin; }
}

.acts { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.act {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--bg-2); border-radius: 11px; padding: 10px 10px 10px 14px;
  text-align: left; overflow: hidden; transition: border-color .12s, background .12s, transform .06s;
}
.act:active { transform: scale(.98); }
.act .lbl { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act .go { color: var(--muted); font-size: 18px; line-height: 1; }
.act:hover .go { color: var(--text); }
.act::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.act:hover { border-color: var(--line-2); background: var(--panel-2); }
.act .nm { font-weight: 600; font-size: 14px; }
.act .amt { color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 6px; }
.act .pct { font-weight: 700; font-size: 15px; }
.act .meter { grid-column: span 2; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.act .meter i { display: block; height: 100%; background: var(--c); border-radius: 2px; }
.freq { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 12px; background: var(--line); }
.freq i { display: block; height: 100%; }

.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lg {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg-2);
  border-radius: 999px; padding: 4px 10px 4px 8px; font-size: 12px; color: var(--text-2); font-weight: 500;
}
.lg i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.lg b { color: var(--text); font-weight: 600; }
.lg.on { border-color: var(--c); color: var(--text); }
.lg.off { opacity: .45; }

.who-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.who-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; letter-spacing: .03em; }
.badge.oop { background: rgba(79,142,247,.16); color: #8fb6fb; }
.badge.ip { background: rgba(246,180,76,.16); color: #f7c97a; }

.combos { display: grid; }
.combo { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.combo:last-child { border-bottom: 0; }
.combo .sbar { display: flex; height: 18px; border-radius: 5px; overflow: hidden; background: var(--line); }
.combo .sbar i { display: block; height: 100%; position: relative; }
.combo .sbar i span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: rgba(255,255,255,.95); text-shadow: 0 1px 2px rgba(0,0,0,.4); overflow: hidden; }
.combo .ev { font-weight: 700; font-size: 13px; min-width: 44px; text-align: right; }
.combo.blocked { opacity: .35; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.detail-head h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; }

.cats { display: grid; gap: 8px; }
.cat { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 10px; font-size: 12px; }
.cat .nm { color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat .bar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: var(--line); }
.cat .bar i { display: block; height: 100%; }
.cat .n { text-align: right; color: var(--muted); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 24px 10px; font-size: 13px; }
.center-msg { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 10px; text-align: center; }
.center-msg h2 { margin: 0; font-size: 18px; }

/* ---------- library ---------- */
.lib { display: grid; gap: 10px; }
@media (min-width: 760px) { .lib { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .lib { grid-template-columns: 1fr 1fr 1fr; } }
.job {
  display: grid; gap: 10px; text-align: left; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); border-radius: var(--radius); padding: 14px;
  transition: border-color .12s, transform .1s;
}
.job:hover { border-color: var(--line-2); transform: translateY(-1px); }
.job .ttl { font-weight: 600; font-size: 14px; }
.job .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.job .meta b { color: var(--text-2); font-weight: 600; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 14px; }
a.btn { text-decoration: none; }
.page-head h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }

/* ---------- sheet / toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(5,7,11,.6); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet-body {
  width: 100%; max-width: 560px; max-height: 82vh; overflow: auto; background: var(--panel);
  border: 1px solid var(--line-2); border-bottom: 0; border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease;
}
@keyframes up { from { transform: translateY(30px); } to { transform: none; } }
.grabber { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 4px auto 12px; }
@media (min-width: 760px) { .sheet { align-items: center; } .sheet-body { border-radius: 18px; border-bottom: 1px solid var(--line-2); padding-top: 18px; } .grabber { display: none; } }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--raise); border: 1px solid var(--line-2); color: var(--text); padding: 10px 14px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: fade .2s; max-width: calc(100vw - 32px);
}

/* ---------- preflop ---------- */
.seats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; min-width: min(100%, 360px); }
.seat {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px;
  border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 11px;
}
.seat b { font-size: 12px; font-weight: 700; }
.seat span { color: var(--muted); font-weight: 600; }
.seat.folded { opacity: .38; }
.seat.acting { border-color: var(--accent); background: rgba(124,108,242,.12); }
.seat.acting span { color: var(--accent-2); }
@media (max-width: 700px) { .seats { width: 100%; } }
@media (max-width: 480px) {
  .brand span { display: none; }
  .tab { padding: 6px 9px; }
}

/* ---------- preflop spots ---------- */
.spots { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); max-height: 420px; overflow: auto; padding-right: 2px; }
.spotbtn {
  display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); background: var(--bg-2);
  border-radius: 11px; padding: 10px 12px; transition: border-color .12s, background .12s;
}
.spotbtn:hover { border-color: var(--line-2); background: var(--panel-2); }
.spotbtn.on { border-color: var(--accent); background: rgba(124,108,242,.10); }
.spotbtn b { font-size: 13px; }
.spotbtn .sub { font-size: 11px; line-height: 1.35; }
.freq-tag { font-size: 12px; font-weight: 700; color: var(--accent-2); }
.group-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 10px; font-weight: 700; font-size: 15px; }

/* ---------- tree-size estimate above the solve button ---------- */
.estimate {
  font-size: 12px; color: var(--text-2); background: rgba(22,27,36,.92); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 10px; margin-bottom: 8px; backdrop-filter: blur(8px);
}
.estimate b { color: var(--text); }
.estimate.bad { border-color: var(--bad); color: #f3b0b0; }
.estimate.bad div { margin-top: 4px; }

/* bet tree: per-street blocks and memory options */
.street-block { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.street-name { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--accent-2); }
.opts { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.switch.opt { align-items: flex-start; }
.switch.opt input { flex: none; margin-top: 1px; }
.switch.opt span { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.switch.opt small { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* ---------- guidance and numbered setup steps ---------- */
.hint { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.step-title { display: inline-flex; align-items: center; gap: 8px; }
.step-title i {
  font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(124,108,242,.18); color: var(--accent-2); font-size: 11px; font-weight: 800; letter-spacing: 0;
}
.chips.owners { margin: -4px 0 10px; }

/* ranges: compact previews side by side on phones, tap to edit full width */
.spot-pick { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.spot-pick .spots { margin-top: 10px; }
.ranges { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rp { min-width: 0; }
.rp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.rp-head .sub { white-space: nowrap; }
.rp:not(.editing) .rp-tools .btn, .rp:not(.editing) .rp-help, .rp.editing .rp-tap { display: none; }
.rp:not(.editing) .rp-tools { width: 100%; }
.rp:not(.editing) .rp-tools select { width: 100% !important; }
.rp:not(.editing) .matrix { gap: 1px; cursor: pointer; }
.rp:not(.editing) .cell .lbl { display: none; }
.rp.editing { grid-column: 1 / -1; }
@media (min-width: 960px) {
  .rp.editing { grid-column: auto; }
  .rp-done { display: none; }
}

/* memory-saving options collapse */
details.opts > summary { cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 600; list-style: none; }
details.opts > summary::before { content: "▸ "; color: var(--muted); }
details.opts[open] > summary::before { content: "▾ "; }
details.opts[open] > summary { margin-bottom: 4px; }
@media (min-width: 960px) { .rp .matrix { max-width: 520px; } }

/* ---------- preflop → postflop flop panel ---------- */
.flop-panel .board-slots .pc { width: 40px; height: 54px; }
.solved { display: grid; gap: 6px; margin-bottom: 14px; }
.solved-board { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); text-decoration: none; color: var(--text); }
.solved-board:hover { border-color: var(--accent); }
.presets { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.preset { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); }
.preset b { font-size: 13px; }
.preset span { font-size: 11.5px; color: var(--muted); }
.preset.on { border-color: var(--accent); background: rgba(124,108,242,.10); }
@media (max-width: 600px) { .ranges > .panel .cell .lbl { display: none; } .ranges > .panel .matrix { gap: 1px; } }

/* out-of-range hands (solved with a tiny filler weight) */
.cell.ghost { outline: 1.5px dashed rgba(255,255,255,.45); outline-offset: -2px; }
.cell.ghost .lbl { color: var(--text-2); }
.ghost-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1.5px dashed rgba(255,255,255,.6); vertical-align: -1px; }

/* 3-way result: seat strip of three */
.seats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; max-width: 300px; }

/* tournament setup */
.mode-switch { display: flex; width: 100%; }
.mode-switch button { flex: 1; padding: 8px 10px; }
.icm-stacks { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.seat small { font-size: 10px; color: var(--muted); }

.pill.queued { color: var(--warn); background: rgba(242,184,75,.12); }

.combo .sbar.unreached { opacity: .55; outline: 1.5px dashed rgba(255,255,255,.45); outline-offset: 1px; }
/* full-height matrix: off-path hands keep their colors, slightly faded, dashed */
.cell.ghost .fill { opacity: .62; }
.cell.ghost .lbl { color: var(--text); }

/* cash setup: positions of the chosen table size */
.seat-names { display: flex; flex-wrap: wrap; gap: 6px; }

/* hover card on matrix cells (mouse only) */
.cell-tip { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; min-width: 190px; max-width: 260px;
  padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 12px; color: var(--text); opacity: 0; transition: opacity .08s; }
.cell-tip.on { opacity: 1; }
.cell-tip .tip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cell-tip .tip-head b { font-size: 15px; }
.cell-tip .tip-head span { color: var(--text-2); }
.cell-tip .freq { margin-bottom: 8px; }
.cell-tip .tip-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.cell-tip .tip-row span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.cell-tip .tip-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.cell-tip .tip-row.ev { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.cell-tip p { margin: 6px 0 0; color: var(--muted); }
.cell-tip .tip-row.zero { opacity: .4; }
.cell-tip .tip-row b small { margin-left: 6px; font-weight: 600; font-size: 11px; }
.cell-tip .tip-row b small.up { color: var(--good); }
.cell-tip .tip-row b small.down { color: var(--bad); }
.cell-tip .tip-why { margin: 8px 0 0; padding: 8px 0 0 14px; border-top: 1px solid var(--line); color: var(--text); line-height: 1.45; }
.cell-tip .tip-why li { margin: 2px 0; }
.cell-tip .tip-note { font-size: 11px; }
.cell-tip { max-width: 290px; }
