:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --panel-2: #171b21;
  --panel-3: #0f1317;
  --text: #f2f5f9;
  --muted: #8e98a4;
  --border: #252b33;
  --border-2: #1e242b;
  --accent: #ff8a2b;
  --accent-soft: rgba(255, 138, 43, 0.12);
  --accent-border: rgba(255, 138, 43, 0.38);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
  --gap: 5px;
  --chip-size: 0.74rem;
  --text-sm: 0.77rem;
  --text-xs: 0.68rem;
  --card-w: 28px;
  --card-h: 34px;
  --deck-gap: 2px;
  --deck-width: calc((13 * var(--card-w)) + (12 * var(--deck-gap)));
  --board-stage-frame: 14px;
  --board-stage-width: calc(var(--deck-width) + var(--board-stage-frame));
  --slot-w: 38px;
  --slot-h: 44px;
  --control-h: 28px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 138, 43, 0.34) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 138, 43, 0.26);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 138, 43, 0.42);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(255, 138, 43, 0.08), transparent 24%),
    radial-gradient(circle at top left, rgba(255, 138, 43, 0.05), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

.auth-body {
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(460px, calc(100vw - 18px));
  margin: 20px auto;
}

.auth-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18, 22, 27, 0.98), rgba(14, 18, 22, 0.98));
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.auth-block {
  display: grid;
  gap: 10px;
}

.app-shell,
.app-shell * {
  user-select: none;
  -webkit-user-select: none;
}

input,
textarea,
select,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea {
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 138, 43, 0.14);
}

.hidden {
  display: none !important;
}

.app-shell {
  width: max(320px, calc(100vw - 6px));
  min-height: calc(100vh - 6px);
  margin: 2px auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.brand h1,
.section-head h2,
.top10-card h3 {
  margin: 0;
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-weight: 700;
}

.brand h1 {
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-inline {
  color: var(--muted);
  font-size: var(--text-xs);
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  place-items: center;
  white-space: nowrap;
}

.utility-button,
.mini-button,
.close-button,
.top10-open {
  height: var(--control-h);
  padding: 0 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.utility-button:hover,
.mini-button:hover,
.close-button:hover,
.top10-open:hover,
.filter-chip:hover,
.deck-card:hover,
.slot-card:hover {
  border-color: var(--accent-border);
}

.utility-button {
  min-width: 34px;
  padding: 0 9px;
  text-transform: lowercase;
  font-size: var(--chip-size);
}

.mini-button {
  min-width: 34px;
  padding: 0 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: lowercase;
}

.finder-layout,
.top10-panel {
  min-height: 0;
}

.finder-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 5px;
  min-height: 100%;
}

.control-strip,
.results-panel,
.top10-panel,
.modal-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18, 22, 27, 0.98), rgba(14, 18, 22, 0.98));
  box-shadow: var(--shadow);
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(258px, 316px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  gap: 6px;
  padding: 5px;
}

.control-column {
  min-width: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  align-content: start;
}

.control-left {
  grid-template-rows: auto minmax(0, 1fr);
  padding: 5px 6px 6px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.control-workspace {
  min-width: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, var(--board-stage-width)) minmax(214px, 1fr);
  gap: 8px;
  align-items: start;
}

.board-stage {
  min-width: 0;
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 5px 6px 6px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  overflow: hidden;
}

.side-rail {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: start;
  padding: 5px 6px 6px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.side-rail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 4px;
  align-items: start;
}

.mode-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px;
}

.mode-head-solo {
  grid-template-columns: 1fr auto;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 14px;
  margin-bottom: 3px;
  color: rgba(255, 186, 128, 0.92);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid rgba(255, 138, 43, 0.18);
}

.mode-tabs,
.mode-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mode-tools {
  justify-content: flex-end;
}

.mode-status {
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  align-self: center;
}

.mode-tab {
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-xs);
  text-transform: lowercase;
}

.mode-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.left-mode-panel {
  display: grid;
  gap: 4px;
  min-height: 0;
}

.game-summary {
  min-height: 16px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.25;
}

.game-note {
  min-height: 14px;
}

.mini-table {
  position: relative;
  min-height: 116px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background:
    radial-gradient(circle at center, rgba(255, 138, 43, 0.05), transparent 52%),
    rgba(255, 255, 255, 0.015);
}

.mini-table::before {
  content: "";
  position: absolute;
  inset: 16px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  pointer-events: none;
}

.seat-button {
  position: absolute;
  min-width: 38px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 700;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.seat-button:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.seat-button.selected {
  border-color: var(--accent-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.seat-button.actor {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.seat-button.unavailable {
  opacity: 0.38;
}

.mini-button:disabled,
.seat-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.seat-utg {
  left: 18px;
  top: 28px;
}

.seat-hj {
  left: 18px;
  bottom: 28px;
}

.seat-co {
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}

.seat-btn {
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
}

.seat-sb {
  right: 18px;
  top: 28px;
}

.seat-bb {
  right: 18px;
  bottom: 28px;
}

.action-stack {
  display: grid;
  gap: 3px;
}

.inline-control,
.size-row,
.search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.search-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.raw-line-row {
  grid-template-columns: minmax(0, 1fr);
}

.board-head {
  display: grid;
  grid-template-columns: max-content 88px auto;
  gap: 3px;
  align-items: stretch;
  justify-content: start;
  width: 100%;
  margin-bottom: 2px;
}

.control-label {
  min-width: 30px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
}

.line-row,
.arch-row {
  gap: 2px;
}

.row-status {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  min-width: 44px;
}

.filter-chip {
  min-height: 24px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--chip-size);
  line-height: 1;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.filter-chip:disabled,
.filter-chip.is-disabled {
  opacity: 0.38;
  cursor: default;
}

.deck-card.selected,
.slot-card.filled {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(255, 138, 43, 0.34);
}

.square-row .filter-chip {
  min-width: 30px;
  padding: 0 6px;
  border-radius: 8px;
}

.line-row .filter-chip {
  min-width: 48px;
  justify-content: center;
}

.arch-row .filter-chip {
  min-width: 42px;
  padding: 0 7px;
  justify-content: center;
}

.empty-state {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.3;
}

.search-input,
input,
select,
textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-size: var(--text-sm);
}

.search-input.slim,
input,
select {
  height: var(--control-h);
}

textarea {
  min-height: 88px;
  padding-top: 8px;
  padding-bottom: 8px;
  resize: vertical;
}

.board-slots {
  display: grid;
  grid-template-columns: repeat(5, var(--slot-w));
  gap: 3px;
  min-height: var(--slot-h);
  width: fit-content;
}

.slot-card {
  width: var(--slot-w);
  min-width: var(--slot-w);
  height: var(--slot-h);
  border-radius: 7px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  justify-items: center;
  padding: 4px 0 3px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.slot-card.empty {
  color: var(--muted);
  background: var(--panel);
  display: grid;
  place-items: center;
  padding: 0;
}

.board-deck {
  display: grid;
  gap: 3px;
  width: 100%;
}

.deck-row {
  display: grid;
  grid-template-columns: repeat(13, var(--card-w));
  gap: var(--deck-gap);
  width: fit-content;
}

.deck-card {
  width: var(--card-w);
  min-width: var(--card-w);
  height: var(--card-h);
  border-radius: 6px;
  padding: 3px 0 2px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  justify-items: center;
  font-weight: 700;
  cursor: pointer;
}

.deck-card[disabled] {
  cursor: default;
  opacity: 0.32;
}

.deck-rank {
  font-size: 0.92rem;
  line-height: 1;
}

.deck-suit-icon {
  font-size: 0.64rem;
  line-height: 1;
}

.deck-card.spade,
.slot-card.spade {
  background: linear-gradient(180deg, #545963, #474c55);
}

.deck-card.heart,
.slot-card.heart {
  background: linear-gradient(180deg, #ea5f8c, #d54a79);
}

.deck-card.diamond,
.slot-card.diamond {
  background: linear-gradient(180deg, #69a7d5, #5c97c3);
}

.deck-card.club,
.slot-card.club {
  background: linear-gradient(180deg, #88ad88, #799c79);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
}

.metric-box {
  min-width: 0;
  min-height: 30px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  font-size: var(--text-xs);
  color: var(--muted);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.metric-box-why {
  min-height: var(--slot-h);
  width: 88px;
  min-width: 88px;
  align-self: stretch;
}

.metric-box-why .metric-value {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  line-height: 1.15;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.metric-box strong {
  color: var(--text);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.metric-value {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.size-stack,
.arch-stack,
.bluff-stack,
.utility-stack {
  display: grid;
  gap: 3px;
  padding: 4px 5px 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  background: rgba(10, 13, 17, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
  overflow: hidden;
}

.utility-stack {
  min-width: 50px;
  justify-items: stretch;
  align-content: start;
}

.utility-stack .utility-button {
  width: 44px;
  justify-self: end;
}

.utility-stack .status-inline {
  width: 44px;
  padding: 0 2px;
}

.utility-stack .section-divider {
  gap: 0;
  justify-content: center;
  margin-bottom: 1px;
}

.utility-stack .section-divider::after {
  display: none;
}

.stack-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stack-head .section-divider {
  flex: 1;
  margin-bottom: 0;
}

.stack-head .mini-button {
  min-width: 40px;
}

.size-stack .size-row,
.arch-stack .search-input,
.arch-stack .chip-wrap {
  margin: 0;
}

.arch-stack {
  gap: 3px;
}

.bluff-delta-panel {
  display: grid;
  gap: 6px;
}

.bluff-delta-card {
  display: grid;
  gap: 6px;
}

.bluff-delta-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
}

.bluff-inline-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.bluff-inline-field span,
.bluff-stat-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bluff-inline-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.bluff-delta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.bluff-stat {
  min-width: 0;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  display: grid;
  gap: 4px;
  align-content: start;
}

.bluff-stat strong {
  min-width: 0;
  font-size: 0.73rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bluff-stat-pill .exploit-pill {
  width: fit-content;
  max-width: 100%;
}

.bluff-stat-wide {
  grid-column: 1 / -1;
}

.results-panel {
  min-height: 0;
  padding: 4px 6px 6px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 3px;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}

.results-head-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-badge {
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.section-head.compact {
  margin-bottom: 6px;
}

.section-note,
.modal-message {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
}

.results-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
}

.results-table-wrap > * + * {
  margin-top: 0;
}

.col-type { width: 92px; }
.col-node { width: 60px; }
.col-label { width: 100px; }
.col-sample { width: 72px; }
.col-pot { width: 60px; }
.col-range { width: 162px; }
.col-delta { width: 64px; }
.col-gtoest { width: 70px; }
.col-gtopts { width: 66px; }
.col-bluffs { width: 76px; }
.col-bf { width: 74px; }
.col-bc { width: 74px; }
.col-br { width: 74px; }
.col-actp { width: 82px; }
.col-callev { width: 82px; }

.review-table,
.results-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
  font-size: 0.73rem;
}

.results-table thead th {
  position: sticky;
  z-index: 1;
  background: #12161b;
}

.results-table thead .results-group-row th {
  top: 0;
  z-index: 3;
  height: 24px;
  padding: 4px 6px 3px;
  background: #10151b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 186, 128, 0.92);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  background-clip: padding-box;
}

.results-table thead .results-label-row th {
  top: 24px;
  z-index: 2;
  height: 24px;
  background-clip: padding-box;
}

.results-table th,
.review-table th,
.results-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.05;
}

.review-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.05;
}

.review-table td:first-child {
  font-weight: 700;
}

.results-table th {
  color: var(--muted);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.review-table th {
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.review-table {
  border-bottom: 1px solid rgba(255, 138, 43, 0.34);
}

.review-table .review-group-row th {
  padding: 5px 8px 4px;
  background: #10151b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 186, 128, 0.92);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
}

.review-table .review-group-row th:nth-child(2),
.review-table .review-group-row th:nth-child(3),
.review-table .review-group-row th:nth-child(4) {
  box-shadow: inset 1px 0 0 rgba(255, 138, 43, 0.18);
}

.review-table .review-label-row th {
  background: #12161b;
}

.review-table .review-label-row {
  display: none;
}

.review-table .summary-bluffdelta td {
  background: rgba(255, 255, 255, 0.012);
}

.review-table .summary-exact td {
  background: rgba(255, 138, 43, 0.035);
}

.results-head-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.help-tag {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 138, 43, 0.45);
  background: rgba(255, 138, 43, 0.08);
  color: var(--accent);
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  outline: none;
}

.help-tag::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 7px);
  transform: translateX(-50%);
  width: min(244px, calc(100vw - 28px));
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 138, 43, 0.25);
  background: rgba(12, 15, 19, 0.98);
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 8;
}

.help-tag::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid rgba(12, 15, 19, 0.98);
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 8;
}

.help-tag:hover::after,
.help-tag:hover::before,
.help-tag:focus-visible::after,
.help-tag:focus-visible::before {
  opacity: 1;
}

.result-row.clickable {
  cursor: pointer;
}

.result-row.clickable:hover td {
  background: rgba(255, 138, 43, 0.05);
}

.result-row.active td {
  background: rgba(255, 138, 43, 0.09);
}

.results-table tbody .summary-bluffdelta td {
  background: rgba(255, 255, 255, 0.012);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.results-table tbody .summary-bluffdelta td:first-child,
.results-table tbody .summary-average-view td:first-child {
  color: rgba(207, 224, 238, 0.94);
}

.results-table tbody .summary-average-view td {
  background: rgba(255, 255, 255, 0.018);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.results-table td:first-child,
.results-table tfoot td:first-child {
  font-weight: 700;
}

.results-table tbody td:nth-child(6),
.results-table tfoot td:nth-child(6),
.results-table tbody td:nth-child(11),
.results-table tfoot td:nth-child(11),
.results-table tbody td:nth-child(14),
.results-table tfoot td:nth-child(14) {
  border-left: 1px solid rgba(255, 138, 43, 0.18);
}

.results-table thead .results-group-row th:nth-child(2),
.results-table thead .results-group-row th:nth-child(3),
.results-table thead .results-group-row th:nth-child(4) {
  box-shadow: inset 1px 0 0 rgba(255, 138, 43, 0.18);
}

.results-table thead .results-label-row th:nth-child(6),
.results-table thead .results-label-row th:nth-child(11),
.results-table thead .results-label-row th:nth-child(14) {
  box-shadow: inset 1px 0 0 rgba(255, 138, 43, 0.18);
}

.results-table thead .results-label-row th:nth-child(5),
.results-table thead .results-label-row th:nth-child(7),
.results-table thead .results-label-row th:nth-child(8),
.results-table thead .results-label-row th:nth-child(9),
.results-table thead .results-label-row th:nth-child(10),
.results-table thead .results-label-row th:nth-child(11),
.results-table thead .results-label-row th:nth-child(12),
.results-table thead .results-label-row th:nth-child(13),
.results-table thead .results-label-row th:nth-child(14),
.results-table thead .results-label-row th:nth-child(15),
.results-table tbody td:nth-child(5),
.results-table tbody td:nth-child(7),
.results-table tbody td:nth-child(8),
.results-table tbody td:nth-child(9),
.results-table tbody td:nth-child(10),
.results-table tbody td:nth-child(11),
.results-table tbody td:nth-child(12),
.results-table tbody td:nth-child(13),
.results-table tbody td:nth-child(14),
.results-table tbody td:nth-child(15),
.results-table tfoot td:nth-child(5),
.results-table tfoot td:nth-child(7),
.results-table tfoot td:nth-child(8),
.results-table tfoot td:nth-child(9),
.results-table tfoot td:nth-child(10),
.results-table tfoot td:nth-child(11),
.results-table tfoot td:nth-child(12),
.results-table tfoot td:nth-child(13),
.results-table tfoot td:nth-child(14),
.results-table tfoot td:nth-child(15) {
  text-align: right;
}

.review-table td:nth-child(5),
.review-table td:nth-child(7),
.review-table td:nth-child(8),
.review-table td:nth-child(9),
.review-table td:nth-child(10),
.review-table td:nth-child(11),
.review-table td:nth-child(12),
.review-table td:nth-child(13) {
  text-align: right;
}

.review-table td:nth-child(6),
.review-table td:nth-child(9),
.review-table td:nth-child(12) {
  border-left: 1px solid rgba(255, 138, 43, 0.18);
}

.exploit-cell {
  min-width: 96px;
  text-align: left !important;
}

.exploit-pill-stack {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 3px;
  max-width: 100%;
  vertical-align: middle;
}

.delta-cell {
  min-width: 52px;
}

.exploit-pill {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #f4f6f8;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.exploit-pill.exploit-overbluff {
  border-color: rgba(96, 154, 108, 0.36);
  background: rgba(64, 114, 76, 0.24);
  color: #e1f0e4;
}

.exploit-pill.exploit-value-light {
  border-color: rgba(121, 176, 130, 0.3);
  background: rgba(92, 145, 102, 0.18);
  color: #e6f2e8;
}

.exploit-pill.exploit-nut-light {
  border-color: rgba(206, 187, 120, 0.28);
  background: rgba(183, 162, 94, 0.14);
  color: #f0ead4;
}

.exploit-pill.exploit-neutral,
.exploit-pill.exploit-loading,
.exploit-pill.exploit-pending,
.exploit-pill.exploit-overcall {
  border-color: rgba(210, 194, 151, 0.24);
  background: rgba(198, 182, 138, 0.12);
  color: #efe6d3;
}

.exploit-pill.exploit-overjam {
  border-color: rgba(224, 171, 118, 0.26);
  background: rgba(210, 147, 84, 0.14);
  color: #f4e1cf;
}

.exploit-pill.exploit-overfold {
  border-color: rgba(222, 145, 104, 0.28);
  background: rgba(191, 110, 71, 0.16);
  color: #f5ddd1;
}

.exploit-pill.exploit-value-heavy {
  border-color: rgba(212, 144, 98, 0.3);
  background: rgba(186, 118, 70, 0.18);
  color: #f4dfd2;
}

.exploit-pill.exploit-nut-heavy {
  border-color: rgba(190, 112, 88, 0.32);
  background: rgba(156, 83, 56, 0.2);
  color: #f3d9d1;
}

.exploit-pill.exploit-underbluff {
  border-color: rgba(160, 88, 90, 0.34);
  background: rgba(124, 53, 58, 0.24);
  color: #f1d4d6;
}

.exploit-pill.exploit-continue-press {
  border-color: rgba(82, 132, 103, 0.34);
  background: rgba(54, 96, 73, 0.24);
  color: #d7ebdd;
}

.exploit-pill.exploit-continue-lean {
  border-color: rgba(106, 145, 119, 0.28);
  background: rgba(78, 112, 90, 0.2);
  color: #e4f0e7;
}

.exploit-pill.exploit-hold-base {
  border-color: rgba(157, 145, 92, 0.26);
  background: rgba(128, 117, 68, 0.18);
  color: #f2ead0;
}

.exploit-pill.exploit-fold-lean {
  border-color: rgba(169, 121, 85, 0.3);
  background: rgba(138, 92, 57, 0.2);
  color: #f2ddd0;
}

.exploit-pill.exploit-fold-press {
  border-color: rgba(164, 83, 84, 0.34);
  background: rgba(121, 50, 54, 0.24);
  color: #f3d4d6;
}

.results-table tfoot td {
  position: sticky;
  background: #11161c;
  border-bottom: none;
  font-weight: 700;
}

.results-table tfoot .summary-avg td {
  bottom: 0;
  z-index: 2;
  border-top: 1px solid var(--accent-border);
}

.results-table tfoot .summary-final td {
  bottom: 0;
  z-index: 3;
  background: #0f1419;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.results-table tfoot .summary-final td:first-child {
  color: rgba(255, 186, 128, 0.96);
}

.results-table tfoot .summary-bluffdelta td {
  bottom: 30px;
  z-index: 4;
  background: #10161d;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.results-table tfoot .summary-bluffdelta td:first-child {
  color: rgba(207, 224, 238, 0.94);
}

.results-table tfoot .summary-exact td {
  bottom: 0;
  z-index: 5;
  background: #10161c;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.results-table tfoot .summary-exact td:first-child {
  color: rgba(223, 234, 248, 0.94);
}

.summary-input {
  width: 78px;
  min-width: 78px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 0.68rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
}

.summary-inline-button {
  min-width: 34px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: lowercase;
  cursor: pointer;
}

.summary-inline-button:hover {
  border-color: var(--accent-border);
}

.guide-panel {
  max-width: 860px;
}

.guide-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.guide-tab {
  min-width: 92px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.guide-tab:hover {
  color: var(--text);
}

.guide-tab.is-active {
  border-color: rgba(255, 138, 43, 0.42);
  background: rgba(255, 138, 43, 0.1);
  color: rgba(255, 229, 202, 0.96);
}

.guide-tab-panels {
  min-height: 0;
}

.guide-tab-panel[aria-hidden="true"] {
  display: none;
}

.guide-body {
  display: grid;
  gap: 14px;
  max-height: min(76vh, 860px);
  overflow: auto;
  padding-right: 2px;
}

.guide-section {
  display: grid;
  gap: 8px;
}

.guide-section h3 {
  margin: 0;
  font-size: 0.86rem;
}

.guide-section p,
.guide-section li {
  margin: 0;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.45;
}

.guide-section ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.guide-section pre {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  overflow: auto;
}

.guide-section code {
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 0.76rem;
}

.result-detail {
  margin-top: 6px;
  padding: 7px 8px 8px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
  display: grid;
  gap: 6px;
}

.result-detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.result-detail-head h3 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-stat {
  min-width: 92px;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  display: grid;
  gap: 2px;
}

.detail-stat strong {
  font-size: 0.61rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.detail-stat span {
  font-size: 0.82rem;
  color: var(--text);
}

.detail-stat.flag-overbluff span,
.detail-stat.flag-overcall span,
.detail-stat.flag-overjam span {
  color: #ffb36b;
}

.detail-stat.flag-underbluff span,
.detail-stat.flag-overfold span {
  color: #8cc4ff;
}

.bucket-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.69rem;
}

.bucket-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend-swatch.population {
  background: rgba(255, 138, 43, 0.9);
}

.legend-swatch.gto {
  background: rgba(93, 173, 255, 0.9);
}

.bucket-chart {
  min-height: 0;
  overflow-x: auto;
}

.bucket-chart-grid {
  display: grid;
  grid-template-columns: repeat(21, minmax(20px, 1fr));
  gap: 4px;
  align-items: end;
}

.bucket-col {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.bucket-bars {
  width: 100%;
  height: 96px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
}

.bucket-bar {
  width: calc(50% - 1px);
  min-height: 3px;
  border-radius: 3px 3px 0 0;
}

.bucket-bar.population {
  background: linear-gradient(180deg, rgba(255, 138, 43, 1), rgba(255, 138, 43, 0.55));
}

.bucket-bar.gto {
  background: linear-gradient(180deg, rgba(93, 173, 255, 1), rgba(93, 173, 255, 0.55));
}

.bucket-label {
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.result-detail-insights {
  display: grid;
  gap: 4px;
  padding-top: 2px;
}

.result-detail-insights p {
  margin: 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
}

.top10-panel {
  padding: 10px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.top10-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.top10-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--accent-border);
  background: linear-gradient(180deg, rgba(255, 138, 43, 0.12), rgba(255, 138, 43, 0.05));
}

.top10-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.top10-card p,
.top10-open span {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.usage-count {
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.top10-open {
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 10, 0.78);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 18px));
  margin: 6vh auto 0;
  padding: 14px;
}

.modal-panel.wide {
  width: min(820px, calc(100vw - 18px));
}

.entry-panel {
  width: min(980px, calc(100vw - 18px));
  max-height: calc(100vh - 22px);
  margin-top: 10px;
  overflow: auto;
}

.modal-form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.compact-entry-form {
  gap: 8px;
  margin-top: 8px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-entry-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
}

.full-span {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.compact-entry-form label {
  gap: 4px;
  font-size: 0.76rem;
}

.entry-panel textarea {
  min-height: 68px;
}

.admin-panel {
  width: min(960px, calc(100vw - 18px));
  max-height: calc(100vh - 20px);
  overflow: auto;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 10px;
}

.admin-section {
  display: grid;
  gap: 8px;
}

.admin-grid {
  display: grid;
  gap: 8px;
}

.admin-users-list {
  display: grid;
  gap: 8px;
}

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-user-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-user-main strong {
  font-size: 0.8rem;
}

.admin-user-main span {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 1320px) {
  .control-workspace {
    grid-template-columns: minmax(0, var(--board-stage-width)) minmax(206px, 1fr);
  }

  .board-head {
    grid-template-columns: max-content 86px auto;
  }

  .metric-box-why {
    width: 86px;
    min-width: 86px;
  }

  .compact-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .control-strip {
    grid-template-columns: minmax(248px, 300px) minmax(0, 1fr);
  }

  .control-workspace {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .side-rail {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    align-items: start;
  }

  .board-stage {
    width: min(100%, var(--board-stage-width));
  }
}

@media (max-width: 860px) {
  .control-strip {
    grid-template-columns: 1fr;
  }

  .control-left {
    border-bottom-color: var(--border-2);
  }

  .side-rail {
    grid-template-columns: 1fr;
  }

  .board-stage {
    width: 100%;
  }

  .board-head {
    grid-template-columns: max-content 80px auto;
  }

  .metric-box-why {
    width: 80px;
    min-width: 80px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: max(320px, calc(100vw - 6px));
    margin: 4px auto;
  }

  .entry-grid {
    grid-template-columns: 1fr;
  }

  .compact-entry-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-user-card {
    grid-template-columns: 1fr;
  }

  .admin-user-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
