:root {
  color-scheme: dark;
  --bg: #0c1113;
  --panel: #151c1e;
  --elevated: #1c2527;
  --border: #344042;
  --subtle: #293336;
  --text: #f3f5ee;
  --muted: #b0bdb9;
  --dim: #8f9d98;
  --lime: #d0f179;
  --green: #6addae;
  --amber: #f6cd7a;
  --red: #f0a295;
  --radius: 16px;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font: 16px/1.55 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
button, input, select { -webkit-tap-highlight-color: transparent; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
button { border: 1px solid transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
button, input, select, summary, .seat { transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease; }
button:disabled { opacity: .43; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.25; }
h1 { font-size: clamp(1.55rem, 2.7vw, 2.05rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.22rem, 2vw, 1.48rem); letter-spacing: -.035em; }
h3 { font-size: 1.04rem; letter-spacing: -.015em; }
h4 { font-size: .94rem; }
a { color: var(--lime); }
small { color: var(--muted); font-size: .8rem; }
svg { flex-shrink: 0; }
.shell { width: min(1480px, 100%); margin-inline: auto; padding-inline: clamp(16px, 4.1vw, 72px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 75px; padding-block: 9px; border-bottom: 1px solid var(--subtle); }
.brand, .top-actions, .section-head, .panel-head, .meta, .hero-cards, .minor-actions, .custom { display: flex; align-items: center; }
.brand { gap: 11px; line-height: 1.16; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border-radius: 11px; background: var(--lime); color: #192612; font-size: 1.55rem; font-weight: 800; }
.brand-mark svg { width: 26px; height: 26px; }
.brand-title { display: block; font-size: 1.2rem; font-weight: 750; letter-spacing: -.03em; }
.brand-sub { display: block; font: 500 .65rem/1.7 var(--mono); letter-spacing: .11em; color: var(--muted); }
.top-actions { gap: 8px; justify-content: flex-end; }
.btn, .chip, .quick-actions button, .actions-grid button, .bet-group button, .minor-actions button, .dialog-foot button, .hero-strip button:not(.card) {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; border: 1px solid var(--border);
  border-radius: 8px; background: #222c2e; color: var(--text); padding: 7px 13px; font-size: .89rem; font-weight: 600; line-height: 1.25;
}
.btn:hover:not(:disabled), .chip:hover:not(:disabled), .quick-actions button:hover:not(:disabled), .actions-grid button:hover:not(:disabled),
.bet-group button:hover:not(:disabled), .minor-actions button:hover:not(:disabled), .dialog-foot button:hover:not(:disabled), .hero-strip button:not(.card):hover {
  border-color: #6e827e; background: #2a3738;
}
.btn.primary, button.primary, .dialog-foot .primary { background: var(--lime); color: #1b2512; border-color: var(--lime); }
.btn.primary:hover:not(:disabled), button.primary:hover:not(:disabled), .dialog-foot .primary:hover:not(:disabled) { background: #ddff87; color: #111a07; border-color: #ddff87; }
.btn.ghost, button.ghost { color: #d3ded8; background: transparent; }
.btn svg { width: 16px; height: 16px; }
main { padding-bottom: 56px; }
.section-head { justify-content: space-between; gap: 20px; margin: 25px 0 14px; }
.eyebrow { color: var(--lime); font: 600 .69rem/1.5 var(--mono); letter-spacing: .1em; }
.section-head .eyebrow { margin-bottom: 5px; }
.meta { gap: 9px; flex-wrap: wrap; color: var(--muted); font-size: .84rem; }
.badge, .street-tag { display: inline-flex; align-items: center; gap: 6px; width: fit-content; border: 1px solid #425149; border-radius: 20px; padding: 3px 9px; color: #d5e5db; font-size: .77rem; font-weight: 600; }
.workspace, .analysis-grid { display: grid; align-items: stretch; gap: 15px; }
.workspace { grid-template-columns: minmax(0, 1.57fr) minmax(300px, 1fr); }
.table-panel, .controls-panel, .recommend-panel, .details-panel {
  min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
}
.table-panel { display: flex; flex-direction: column; background: #141d1c; }
.table-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 45px; padding: 10px 19px; border-bottom: 1px solid #2c3835; font-size: .84rem; color: var(--muted); }
.table-meta b, .table-meta strong { color: var(--text); }
.arena {
  position: relative; isolation: isolate; flex: 1 0 auto; width: 100%; height: clamp(296px, 26vw, 388px); min-height: 285px;
  background: radial-gradient(ellipse at 50% 49%, #233931 0%, #192622 51%, #151e1c 75%);
}
.felt {
  position: absolute; z-index: -1; inset: 14% 9%; border: 7px solid #25372e; border-radius: 49% / 51%;
  background:
    repeating-linear-gradient(34deg, transparent 0 3px, rgb(27 96 65 / 13%) 3px 4px),
    radial-gradient(ellipse at 51% 36%, #23664c, #194f3c 65%, #123f31);
  box-shadow: 0 0 0 1px #0c1813, 0 0 0 3px #38483a, 0 10px 20px #08130e80, inset 0 0 0 1px #598769, inset 0 0 15px #122d20bb;
}
.felt::after { content: ""; position: absolute; inset: 6.2% 3.8%; border: 1px solid #91b99a47; border-radius: inherit; pointer-events: none; }
.board-center {
  position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  transform: translate(-50%, -50%); text-align: center; white-space: nowrap;
}
.pot { display: inline-flex; align-items: baseline; justify-content: center; gap: 7px; color: #e4f1db; font: 650 .83rem/1.2 var(--mono); }
.pot strong, .pot b { font-size: 1.22rem; color: #efffdc; font-weight: 750; letter-spacing: -.04em; }
.pot span, .pot small { color: #cae2cf; }
.community, .hero-cards { display: flex; justify-content: center; align-items: center; gap: 5px; }
.card {
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: space-between; width: clamp(29px, 3.06vw, 47px);
  aspect-ratio: .695; min-height: 0; padding: 4px 5px; border: 1px solid #fff9; border-radius: 5px; background: #f2f4e9; color: #20292a;
  box-shadow: 0 2px 2px #06130f65; font: 740 clamp(1.04rem, 1.65vw, 1.45rem)/.96 var(--mono); text-align: left; letter-spacing: -.07em;
}
button.card:hover { translate: 0 -1px; }
.card .rank, .card b, .card strong { font: inherit; }
.card .suit, .card i, .card small { color: inherit; align-self: flex-end; font: normal 1.04em/.94 system-ui, sans-serif; }
.card.empty { display: grid; place-items: center; border: 1px dashed #a4c8ae7a; background: #254e3a75; box-shadow: none; color: #c3ddc1; font: 400 1rem var(--mono); }
.card.empty:hover { background: #2d5c47; }
.card.hearts, .card.h, .card[data-suit="h"], .pick-card.hearts, .pick-card.h, .pick-card[data-suit="h"] { color: #bb3a43; }
.card.diamonds, .card.d, .card[data-suit="d"], .pick-card.diamonds, .pick-card.d, .pick-card[data-suit="d"] { color: #1767a0; }
.card.clubs, .card.c, .card[data-suit="c"], .pick-card.clubs, .pick-card.c, .pick-card[data-suit="c"] { color: #24734e; }
.street-tag { padding: 2px 9px; border-color: #7aa38f66; background: #183a2e; color: #cfebda; }
.seat {
  position: absolute; z-index: 1; display: flex; align-items: center; justify-content: flex-start; gap: 6px;
  min-width: 68px; max-width: 106px; min-height: 44px; padding: 6px 9px; transform: translate(-50%, -50%);
  border: 1px solid #51635c; border-radius: 9px; background: #1d2926; color: var(--text); line-height: 1.1; text-align: left;
  box-shadow: 0 4px 10px #09140f55;
}
.seat:hover { border-color: #b1c5b6; background-color: #25362f; }
.seat.folded { color: #b1bab3; background-color: #1c2521; border-color: #3a4942; }
.seat.hero { border-color: #80a47a; }
.seat.active { border-color: var(--lime); box-shadow: 0 0 0 2px #b7d97836, 0 6px 12px #050a074d; background-color: #2d3926; }
.seat-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: #394b41; color: #d5e2d5; font: 600 .69rem/1 var(--mono); }
.seat.hero .seat-icon, .seat.active .seat-icon { color: #243118; background: var(--lime); }
.seat-info { display: grid; gap: 3px; min-width: 0; }
.seat-title { font-size: .84rem; font-weight: 700; white-space: nowrap; }
.seat-stack { font: 500 .72rem/1.2 var(--mono); color: #c3cfc5; white-space: nowrap; }
.seat-action { display: block; font-size: .67rem; line-height: 1.15; color: #b9c9bc; }
.seat.active .seat-action { color: var(--lime); }
.dealer:not(.seat) { color: #1d271b; background: #dae3c5; border-radius: 50%; font: 700 .67rem/1.15 var(--mono); padding: 2px 4px; }
.hero-strip { display: flex; align-items: center; gap: 13px; min-height: 74px; padding: 12px 18px; border-top: 1px solid #334139; background: #1a2420; }
.hero-cards { flex: 0 0 auto; }
.hero-cards .card { width: 33px; }
.hand-note { color: var(--muted); font-size: .82rem; }
.hand-note strong { display: block; color: var(--text); font-size: .94rem; }
.hero-strip > .btn:last-child { margin-left: auto; }
.controls-panel, .recommend-panel, .details-panel { padding: clamp(15px, 1.7vw, 25px); }
.controls-panel { display: flex; flex-direction: column; gap: 12px; }
.panel-head { justify-content: space-between; gap: 12px; }
.turn-title { font-size: clamp(1.18rem, 1.8vw, 1.47rem); font-weight: 700; line-height: 1.3; }
.quick-actions, .actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 7px; }
.quick-actions button, .actions-grid button { min-height: 43px; }
.actions-grid button:only-child { justify-self: stretch; }
.quick-actions button[data-action="fold"], .actions-grid button[data-action="fold"] { color: var(--red); border-color: #60443e; background: #342824; }
.quick-actions button[data-action="call"], .actions-grid button[data-action="call"], .actions-grid button[data-action="check"] { color: #e2eccd; border-color: #5a6650; background: #303b2b; }
.bet-group { display: grid; gap: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .bet-group .chip { flex: 1 1 auto; min-height: 35px; min-width: 48px; padding: 6px 8px; color: #e2e9e1; font-size: .83rem; }
.custom { gap: 7px; }
input, select { min-width: 0; max-width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #101718; color: var(--text); }
.custom input { flex: 1; width: 55%; min-height: 36px; }
.custom button { flex: 0 0 auto; }
.minor-actions { flex-wrap: wrap; gap: 8px; }
.minor-actions button { min-height: 31px; padding: 5px 8px; border-color: transparent; color: var(--muted); background: transparent; font-size: .81rem; }
.history { margin-top: auto; padding-top: 11px; border-top: 1px solid var(--subtle); }
.history summary { width: fit-content; cursor: pointer; color: var(--muted); font-size: .83rem; font-weight: 600; }
.hist-list { display: grid; gap: 0; max-height: 135px; overflow-y: auto; scrollbar-width: thin; }
.hist-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px 0; color: #d2ddd5; font-size: .82rem; border-bottom: 1px solid var(--subtle); }
.hist-row:last-child { border-bottom: 0; }
#analysis { scroll-margin-top: 15px; }
.analysis-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.recommend-panel, .details-panel { display: flex; flex-direction: column; gap: 14px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(90px,1fr)); gap: 9px; }
.metric { padding: 11px 12px; border: 1px solid #35403c; border-radius: 9px; background: #1b2521; }
.metric span, .metric small { display: block; color: var(--muted); font-size: .78rem; }
.metric strong, .metric b { display: block; margin-top: 3px; color: var(--lime); font: 650 clamp(1.3rem, 2.2vw, 1.8rem)/1.15 var(--mono); letter-spacing: -.075em; }
.recommendations { display: grid; gap: 7px; }
.advice-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--subtle); border-radius: 8px; background: #172020; }
.advice-row.high, .advice-row:has(.level.high) { border-color: #5a7048; background: #222e21; }
.advice-row small, .advice-row p { grid-column: 1 / -1; color: var(--muted); font-size: .83rem; line-height: 1.4; }
.level { display: inline-flex; align-items: center; width: fit-content; padding: 2px 8px; border: 1px solid #46504c; border-radius: 5px; color: #b9c5bc; background: #29322d; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.level.high { background: #344427; border-color: #647c46; color: var(--lime); }
.level.medium { background: #383426; border-color: #665d41; color: var(--amber); }
.outs-list, .distribution { display: grid; gap: 6px; }
.outs-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid var(--subtle); font-size: .88rem; }
.distribution .dist-row { display: grid; grid-template-columns: minmax(45px, 66px) 1fr 45px; align-items: center; gap: 9px; font-size: .81rem; }
.dist-row > :last-child { font: 500 .78rem var(--mono); text-align: right; }
.track { display: block; height: 5px; overflow: hidden; border-radius: 4px; background: #303a39; }
.track i { display: block; height: 100%; border-radius: inherit; background: #91b676; }
.dialog, dialog { width: min(565px, calc(100vw - 20px)); max-height: calc(100dvh - 28px); color: var(--text); border: 1px solid #53625d; border-radius: 14px; background: #182020; padding: 0; box-shadow: 0 20px 80px #0009; }
dialog::backdrop { background: #050b0bd9; }
.dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 19px; }
.dialog-head { border-bottom: 1px solid var(--subtle); }
.dialog-head button { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; background: #26302f; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); }
.dialog-body { padding: 15px 19px; }
.dialog-foot { justify-content: flex-end; border-top: 1px solid var(--subtle); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.field { display: grid; gap: 5px; color: var(--muted); font-size: .86rem; }
.field input, .field select { width: 100%; color: var(--text); }
.deck { display: grid; gap: 7px; }
.deck-row { display: grid; grid-template-columns: repeat(13,minmax(0,1fr)); gap: 3px; }
.pick-card { min-width: 0; min-height: 40px; padding: 3px 0; border: 2px solid transparent; border-radius: 4px; background: #e6ebe0; color: #24312d; font: 700 .86rem/1.12 var(--mono); }
.pick-card:hover:not(:disabled) { border-color: var(--lime); background: white; }
.pick-card.selected, .pick-card[aria-pressed="true"] { border-color: var(--lime); background: #d0edaa; box-shadow: inset 0 0 0 1px #354f29; }
.pick-card:disabled, .pick-card.disabled { border: 1px solid #3a4641; background: #2e3732; color: #64746b; opacity: .67; }
.toast { position: fixed; z-index: 5; bottom: 15px; left: 50%; transform: translateX(-50%); max-width: min(90vw,650px); padding: 10px 16px; border: 1px solid #596d5a; border-radius: 9px; background: #243328; color: #e8f3e7; box-shadow: 0 5px 22px #0005; }
.toast:empty { display: none; }
@media (min-width: 1600px) {
  .arena { height: 395px; }
}
@media (max-width: 1080px) {
  .shell { padding-inline: 22px; }
  .workspace { grid-template-columns: minmax(0,1.35fr) minmax(295px,1fr); gap: 11px; }
  .seat { min-width: 60px; padding: 5px 6px; gap: 4px; }
  .seat-icon { width: 18px; height: 18px; }
}
@media (max-width: 795px) {
  .workspace { grid-template-columns: 1fr; }
  .arena { height: clamp(275px, 49vw, 365px); }
  .controls-panel { gap: 11px; }
  .card { width: clamp(30px, 5.5vw, 43px); }
}
@media (max-width: 640px) {
  :root { --radius: 12px; }
  .shell { padding-inline: 12px; }
  .topbar { gap: 9px; min-height: 61px; }
  .brand { gap: 7px; }
  .brand-mark { width: 31px; height: 31px; flex-basis: 31px; border-radius: 8px; }
  .brand-mark svg { width: 22px; height: 22px; }
  .brand-title { font-size: 1rem; }
  .brand-sub { font-size: .57rem; }
  .top-actions { gap: 4px; }
  .top-actions .btn { min-height: 32px; padding: 5px 7px; font-size: .77rem; }
  .section-head { margin-top: 18px; gap: 8px; }
  .table-meta, .hero-strip { padding-inline: 12px; }
  .arena { min-height: 245px; height: clamp(245px, 64vw, 315px); }
  .seat { min-width: 52px; min-height: 34px; max-width: 78px; padding: 4px 6px; }
  .seat .seat-icon { display: none; }
  .seat-title { font-size: .73rem; }
  .seat-stack { font-size: .64rem; }
  .seat-action { font-size: .59rem; }
  .felt { inset-inline: 7.5%; border-width: 5px; }
  .card { width: clamp(25px, 6.6vw, 35px); font-size: 1rem; padding: 3px 4px; border-radius: 4px; }
  .community { gap: 3px; }
  .board-center { gap: 5px; }
  .hero-strip { gap: 9px; min-height: 62px; }
  .analysis-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .dialog-body, .dialog-head, .dialog-foot { padding: 12px 10px; }
  .deck-row { gap: 2px; }
  .pick-card { min-height: 33px; font-size: .73rem; }
}
@media (max-width: 370px) {
  .shell { padding-inline: 8px; }
  .topbar { flex-wrap: wrap; }
  .seat { min-width: 44px; }
  .seat.active { box-shadow: 0 0 0 1px #b7d97836; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
/* Desk sections and the persistent table controls. */
.section-head > div > .meta { margin-top: 5px; }
.text-btn { padding: 3px 0; background: transparent; border: 0; color: #c9dfaf; font-size: .83rem; font-weight: 600; }
.text-btn:hover:not(:disabled) { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }
.table-meta .text-btn { margin-left: auto; }
.table-meta .text-btn::before { content: "⚙"; margin-right: 5px; font-family: system-ui, sans-serif; }
#table-summary { font-variant-numeric: tabular-nums; }
#desk-street { color: var(--lime); border-color: #4a613b; background: #222e20; }
#hero-position { display: block; margin-top: 2px; font-weight: 600; color: #e0e8de; }
#hero-made { margin-left: auto; text-align: end; font-size: .84rem; }
#action-controls { display: flex; flex-direction: column; gap: 10px; }
#action-controls .primary { color: #1b2512; background: var(--lime); border-color: var(--lime); }
#action-controls .primary:hover:not(:disabled) { background: #dfff91; }
#action-controls .ghost { color: #d3ded8; background: #222a2b; }
#action-controls .chip { background: #26302d; color: #dae5d8; min-height: 37px; border-color: #405046; }
#action-controls .chip:hover:not(:disabled) { border-color: #8fa981; background: #31402f; }
#action-controls .minor-actions button { display: inline-flex; min-height: 30px; padding: 4px 7px; color: var(--muted); border-color: transparent; background: transparent; font-size: .8rem; }
#action-controls .custom { display: block; font-size: .84rem; }
.custom summary { color: var(--muted); cursor: pointer; width: fit-content; }
.custom form { display: flex; align-items: center; gap: 6px; padding-top: 6px; }
#action-controls .custom button { min-height: 36px; }
.seat-action { position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%); padding: 1px 5px; background: #13201be8; border-radius: 3px; white-space: nowrap; }
.seat-action:empty { display: none; }
.advice-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#analysis .model-note { display: block; margin-top: 12px; font-size: .79rem; line-height: 1.6; color: var(--dim); }
.dist-head { border-top: 1px solid var(--subtle); padding-top: 14px; margin-top: 2px; }
@media (max-width: 640px) {
  #action-controls .chip { flex: 1 1 63px; }
  .seat-action { top: calc(100% + 1px); padding-inline: 2px; }
}
.toast:not(.visible) { visibility: hidden; opacity: 0; pointer-events: none; }
.chip > span, .chip > small { display: block; white-space: nowrap; }
#action-controls .chip { flex-direction: column; gap: 3px; padding: 7px 6px; }
.chip > small { color: #b2c4b6; font: 500 .71rem/1.2 var(--mono); }
.custom form label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.custom form label span { white-space: nowrap; font-size: .78rem; color: var(--muted); }
.custom form input { width: 100%; }
.hist-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; }
.hist-row > :first-child { color: var(--dim); }
.hist-row > :last-child { font-variant-numeric: tabular-nums; }
/* Card selector, seat setup and detail trays. */
dialog { overflow: auto; }
.dialog-foot .text-btn { margin-right: auto; background: transparent; border-color: transparent; padding-inline: 0; color: var(--muted); }
.pick-slots { display: flex; gap: 7px; margin: 12px 0 16px; }
.pick-slot { min-width: 60px; min-height: 39px; padding: 6px 10px; border: 1px solid #526052; border-radius: 7px; color: #c5d3c7; background: #243027; font: 650 .89rem/1.1 var(--mono); }
.pick-slot.selected { color: var(--lime); border-color: #899b5c; background: #2b3626; }
.deck-box { display: grid; gap: 8px; }
.deck-row { grid-template-columns: 19px minmax(0, 1fr); align-items: center; gap: 5px; }
.deck { display: grid; grid-template-columns: repeat(13, minmax(0,1fr)); gap: 3px; }
.suit-head { text-align: center; color: #e4e9e3; font: 600 1.15rem/1 system-ui, sans-serif; }
.deck-row.h .suit-head { color: #f5a1a4; }
.deck-row.d .suit-head { color: #9ac9ec; }
.deck-row.c .suit-head { color: #9ed8b3; }
.pick-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.pick-card small { color: inherit; font: 500 .9em/1 system-ui, sans-serif; }
#settings-form { display: grid; gap: 15px; }
.field select { appearance: none; padding-right: 27px; background-image: linear-gradient(45deg, transparent 50%, #aebbad 50%), linear-gradient(135deg, #aebbad 50%, transparent 50%); background-position: calc(100% - 14px) center, calc(100% - 10px) center; background-repeat: no-repeat; background-size: 4px 4px; }
.seat-shortcuts, .stack-batch { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.seat-shortcuts > span { color: var(--muted); font-size: .85rem; margin-right: auto; }
.seat-shortcuts .chip, .stack-batch .chip { flex: 0 0 auto; }
.stack-settings { padding-top: 12px; border-top: 1px solid var(--subtle); }
.stack-settings summary { width: fit-content; cursor: pointer; color: #c9ddbb; font-size: .89rem; font-weight: 600; }
.stack-batch { margin-top: 10px; font-size: .86rem; }
.stack-batch input { width: 86px; margin-left: 4px; }
.form-error { color: var(--red); font-size: .84rem; }
.form-error:empty { display: none; }
.empty-note { margin: 0; color: var(--muted); font-size: .86rem; }
details.outs-row { display: block; width: 100%; padding: 0; border: 1px solid var(--subtle); border-radius: 8px; background: #1b2521; }
.outs-row summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; cursor: pointer; list-style: none; }
.outs-row summary::-webkit-details-marker { display: none; }
.outs-row summary::after { content: "＋"; font-size: .8rem; color: var(--muted); }
.outs-row[open] summary::after { content: "−"; }
.outs-row summary strong { margin-left: auto; color: var(--lime); font-size: .86rem; }
.outs-row > p { padding: 0 12px 5px; color: #c5d3c8; font-size: .8rem; }
.out-cards { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 12px 11px; }
.mini-card { padding: 1px 5px; border-radius: 3px; background: #d9e2d8; color: #1e2826; font: 700 .76rem/1.55 var(--mono); }
.mini-card.c { color: #246744; }
.mini-card.h { color: #ac313a; }
.mini-card.d { color: #1b6798; }
@media (max-width: 540px) {
  .deck-row { grid-template-columns: 16px minmax(0,1fr); align-items: start; }
  .suit-head { margin-top: 11px; }
  .deck { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
  .pick-card { min-height: 36px; font-size: .86rem; gap: 2px; }
  .deck-box { gap: 7px; }
  .dialog-head { position: sticky; top: 0; z-index: 1; background: #182020; }
  .dialog-foot { position: sticky; bottom: 0; background: #182020; }
}

#analysis-sub.action-summary { color: #d1e4b9; font-weight: 550; }

/* The active table and recommendation share the first screen. */
.shell { max-width: 1150px; padding-inline: clamp(10px, 3vw, 38px); }
.topbar { min-height: 60px; padding-block: 8px; border: 0; }
.brand-title { font-size: 1.12rem; letter-spacing: .015em; }
#table-summary { margin-top: 2px; color: var(--muted); font-size: .74rem; }
main { padding-bottom: 12px; }
.desk-status { justify-content: flex-start; min-height: 46px; padding-block: 7px; }
.desk-context { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex: 1; }
.desk-context h2 { color: var(--text); font-size: 1rem; white-space: nowrap; }
.desk-context .meta { display: block; font-size: .78rem; line-height: 1.4; }
.desk-status #action-controls:empty { display: none; }
.desk-status #settings { flex-shrink: 0; margin: 0; }
.btn-position { flex-shrink: 0; padding: 5px 10px; border: 1px solid #586c50; border-radius: 6px; background: #273425; color: #def0c5; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.btn-position:hover, .btn-position[aria-pressed="true"] { border-color: var(--lime); background: #36452a; }
.desk-status #action-controls button { min-height: 32px; padding-block: 3px; }
.table-workstation { background: #151e1c; }
.table-workstation .arena { flex: none; max-width: 930px; margin-inline: auto; height: clamp(260px, 39vh, 340px); min-height: 260px; }
.dealer-prompt { display: grid; justify-items: center; gap: 5px; color: #e4f2d9; font-size: .9rem; }
.dealer-prompt strong { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid #f1f3df; border-radius: 50%; background: #dbe5ca; color: #1a2b21; font: 750 1.1rem var(--mono); }
.choosing-dealer .seat { border: 1px dashed #a5be91; }
.choosing-dealer .seat:is(:hover,:focus-visible) { border-style: solid; border-color: var(--lime); background: #344430; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 5px 16px; border-top: 1px solid #334139; background: #1a2420; }
.table-footer .hero-strip { flex-wrap: nowrap; min-height: 44px; gap: 9px; padding: 0; border: 0; }
.table-footer .hero-cards .card { width: 27px; font-size: .96rem; padding: 2px 3px; }
.table-footer .recent-action { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.table-footer .hist-row { gap: 7px; padding: 0; border: 0; font-size: .77rem; }
.table-footer .hist-row:not(:first-child) { display: none; }
#history-all { white-space: nowrap; font-size: .78rem; }

@media (max-width: 640px) {
  .topbar { min-height: 55px; gap: 6px; }
  .top-actions { gap: 4px; }
  .top-actions .btn { min-height: 34px; padding: 5px 8px; font-size: .78rem; }
  .brand { gap: 7px; }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; font-size: 1.2rem; }
  .brand-title { font-size: .98rem; }
  #table-summary { font-size: .65rem; }
  .desk-status { gap: 7px; padding: 6px 9px; }
  .desk-context { display: block; }
  .desk-context .meta { font-size: .66rem; padding-top: 2px; }
  .desk-context h2 { font-size: .89rem; }
  .desk-status .badge { flex-shrink: 0; font-size: .69rem; padding-inline: 6px; }
  .desk-status #settings { font-size: .73rem; }
  .desk-status .btn-position { padding: 5px 7px; font-size: .73rem; }
  .desk-status:has(#action-controls:not(:empty)) { flex-wrap: wrap; }
  .desk-status:has(#action-controls:not(:empty)) .desk-context { flex-basis: 115px; }
  .desk-status #settings::before { content: none; }
  .table-workstation .arena { height: 270px; }
  .seat .seat-icon.dealer { display: flex; position: absolute; left: -6px; top: -8px; width: 16px; height: 16px; padding: 0; background: #e3e9ce; color: #21321c; font-size: .65rem; }
  .table-footer { flex-wrap: nowrap; gap: 4px; padding-inline: 9px; }
  .table-footer #history { display: none; }
  .table-footer .hero-strip { gap: 7px; }
  .hero-strip #hero-made { font-size: .74rem; }
}

/* Compact decision summary and the on-demand analysis dialog. */
#analysis {
  margin-top: 12px;
  padding: 12px clamp(12px, 2vw, 22px) 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.result-heading, .result-overview, .result-metrics, #alternatives {
  display: flex;
  align-items: center;
}
.result-heading { gap: 9px; }
.result-heading h2 { font-size: 1rem; }
.result-heading #show-analysis { margin-left: auto; min-height: 32px; }
.result-overview { justify-content: space-between; gap: 8px 24px; }
.result-choice { min-width: 0; }
#analysis-sub { display: block; font-size: .98rem; font-weight: 550; overflow-wrap: anywhere; }
#analysis-sub.action-summary { color: var(--lime); font-size: clamp(1.2rem, 2vw, 1.55rem); font-weight: 700; }
#alternatives { flex-wrap: wrap; gap: 3px 14px; color: var(--muted); font-size: .78rem; }
#alternatives:not(:empty) { margin-top: 2px; }
#alternatives small { color: var(--dim); font-size: .73rem; }
.result-metrics { flex-shrink: 0; gap: clamp(12px, 3vw, 40px); }
.result-metrics > div { display: grid; gap: 2px; }
.result-metrics span { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.result-metrics strong { font: 650 1.2rem/1.2 var(--mono); font-variant-numeric: tabular-nums; }
#analysis-dialog[open] {
  display: grid; grid-template-rows: auto auto minmax(0,1fr);
  max-height: min(620px, calc(100dvh - 28px)); overflow: hidden;
}
.result-tabs { display: flex; gap: 6px; padding: 12px 16px 0; }
.result-tabs button {
  flex: 1; padding: 7px 3px; border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--muted); font-size: .85rem;
}
.result-tabs button[aria-pressed="true"] { background: #2b3826; border-color: #6c8555; color: var(--lime); }
.result-body { overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 16px; }
@media (max-width: 640px) {
  #analysis { padding-block: 7px 11px; }
  .result-overview { align-items: flex-start; flex-direction: column; }
  .result-metrics { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .result-metrics > div { gap: 0; }
  .result-metrics strong { font-size: 1rem; }
}
