:root {
  color-scheme: dark;
  --bg: #050806;
  --bg-soft: #090f0d;
  --ink: #edf4ef;
  --muted: #9aa9a2;
  --line: #1f2d28;
  --line-strong: #33433d;
  --panel: #0d1412;
  --panel-soft: #111b18;
  --panel-strong: #172522;
  --input: #090f0d;
  --green: #53d39b;
  --green-strong: #20a773;
  --green-soft: rgba(83, 211, 155, 0.11);
  --amber: #f1bd5e;
  --amber-soft: rgba(241, 189, 94, 0.14);
  --red: #ff778b;
  --red-soft: rgba(255, 119, 139, 0.14);
  --blue: #75bfff;
  --blue-soft: rgba(117, 191, 255, 0.14);
  --violet: #b79cff;
  --violet-soft: rgba(183, 156, 255, 0.14);
  --cyan: #5bd8d4;
  --card-face: #e8eee8;
  --card-ink: #17201b;
  --felt: #123d31;
  --felt-border: #2b8562;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.52);
  --study-panel-height: calc(100vh - 190px);
}

@supports (height: 100dvh) {
  :root {
    --study-panel-height: calc(100dvh - 190px);
  }
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--line-strong) var(--bg-soft);
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #0d1311 0%, var(--bg) 48%, #030504 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

::selection {
  background: rgba(87, 214, 159, 0.32);
}

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

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(135deg, var(--green), var(--green-strong));
  color: #06100d;
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  transition: border-color 140ms ease, box-shadow 140ms ease, filter 140ms ease, transform 140ms ease;
}

button.secondary,
#clearFilters,
#clearTournamentFilters {
  background: var(--panel-soft);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: none;
}

button.compact {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button:not(:disabled):hover {
  border-color: rgba(87, 214, 159, 0.7);
  filter: brightness(1.05);
  transform: translateY(-1px);
}

button:not(:disabled):active {
  transform: translateY(0);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
  color: var(--ink);
  min-height: 36px;
  padding: 7px 10px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(154, 169, 162, 0.78);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: rgba(87, 214, 159, 0.78);
  outline: 2px solid rgba(87, 214, 159, 0.18);
  outline-offset: 2px;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

.app-shell {
  min-height: 100vh;
}

.app-shell.auth-hidden {
  display: none;
}

.auth-shell {
  display: none;
  min-height: 100vh;
  padding: 32px 16px;
  place-items: center;
}

.auth-shell.active {
  display: grid;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(83, 211, 155, 0.08), rgba(255, 255, 255, 0.012)),
    var(--panel);
  box-shadow: var(--shadow);
}

.auth-kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-mode-switch {
  display: flex;
  gap: 8px;
}

.auth-mode-switch[hidden] {
  display: none;
}

.auth-mode-switch button {
  flex: 1 1 0;
}

.auth-mode-switch button.active {
  color: var(--green);
  border-color: rgba(87, 214, 159, 0.4);
  background: var(--green-soft);
}

.auth-form label {
  display: grid;
  gap: 6px;
}

.auth-form span {
  color: var(--muted);
  font-size: 12px;
}

.auth-status {
  min-height: 20px;
  color: var(--muted);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.language-switch select {
  min-height: 32px;
  padding-right: 28px;
}

.user-pill {
  color: var(--blue);
  border-color: rgba(117, 191, 255, 0.32);
  background: rgba(117, 191, 255, 0.1);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(83, 211, 155, 0.12), rgba(117, 191, 255, 0.05) 48%, rgba(241, 189, 94, 0.08)),
    var(--bg-soft);
}

.topbar h1,
.topbar p,
.panel h2,
.import-band h2,
.import-band p {
  margin: 0;
}

.topbar h1 {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar p,
.import-band p,
.panel-header span,
.import-status {
  color: var(--muted);
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(87, 214, 159, 0.11);
  color: var(--green);
  border-color: rgba(87, 214, 159, 0.32);
  white-space: nowrap;
}

.tabbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 11, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.tab-button {
  flex: 0 0 auto;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  min-height: 34px;
}

.tab-button.active {
  color: #06100d;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  border-color: rgba(87, 214, 159, 0.6);
}

.tab-button[hidden] {
  display: none;
}

.tab-section {
  display: none;
}

.tab-section:not(.active) {
  display: none;
}

.tab-section.active {
  display: grid;
}

.workspace {
  display: grid;
  gap: 18px;
  padding: 18px clamp(16px, 3vw, 36px) 36px;
}

.import-band {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px 20px;
  align-items: center;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed rgba(87, 214, 159, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(87, 214, 159, 0.08), rgba(117, 191, 255, 0.04)),
    var(--panel);
}

.import-band.dragging {
  border-color: var(--green);
  background: var(--green-soft);
}

.import-band h2,
.panel h2 {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.import-actions input {
  width: min(380px, 48vw);
}

.import-status {
  grid-column: 1 / -1;
  min-height: 20px;
}

.import-guide {
  gap: 14px;
}

.import-guide-steps {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.import-history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  min-height: 360px;
}

.import-history-table {
  min-width: 820px;
}

.import-detail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid var(--line);
  min-height: 0;
}

.import-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

#importDetail {
  max-height: 520px;
  overflow: auto;
}

.import-run-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.import-file-log-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.import-file-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.import-file-log.failed,
.import-file-log.partial,
.import-file-log.unsupported {
  border-color: rgba(255, 119, 139, 0.34);
}

.import-file-log summary {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  cursor: pointer;
}

.import-file-log summary small {
  color: var(--muted);
}

.import-error-message,
.import-error-list {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--red);
}

.import-error-list {
  padding-left: 28px;
}

.import-snippet {
  max-height: 180px;
  overflow: auto;
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input);
  color: var(--muted);
  padding: 10px;
  white-space: pre-wrap;
  font-size: 12px;
}

.import-status-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 23px;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid rgba(83, 211, 155, 0.32);
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.import-status-chip.partial {
  border-color: rgba(241, 189, 94, 0.34);
  background: var(--amber-soft);
  color: var(--amber);
}

.import-status-chip.failed,
.import-status-chip.unsupported {
  border-color: rgba(255, 119, 139, 0.34);
  background: var(--red-soft);
  color: var(--red);
}

.overview-empty-banner {
  gap: 12px;
}

.overview-empty-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.legacy-email-banner {
  display: grid;
  gap: 12px;
  border-color: rgba(241, 189, 94, 0.45);
  background:
    linear-gradient(180deg, rgba(241, 189, 94, 0.08), rgba(255, 255, 255, 0.01)),
    var(--panel);
}

.legacy-email-banner[hidden] {
  display: none;
}

.legacy-email-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.legacy-email-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.legacy-email-form label {
  flex: 1 1 260px;
  display: grid;
  gap: 6px;
}

.legacy-email-form span {
  color: var(--muted);
  font-size: 12px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.inline-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.overview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(83, 211, 155, 0.035), rgba(255, 255, 255, 0)), var(--panel);
  box-shadow: var(--shadow);
}

.overview-toolbar h2 {
  margin: 0 0 3px;
  font-size: 18px;
}

.overview-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.metric {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-align: left;
}

.metric:nth-child(4n + 1) {
  border-top-color: var(--green);
}

.metric:nth-child(4n + 2) {
  border-top-color: var(--blue);
}

.metric:nth-child(4n + 3) {
  border-top-color: var(--amber);
}

.metric:nth-child(4n + 4) {
  border-top-color: var(--violet);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
}

.metric-clickable {
  cursor: pointer;
}

.metric-clickable:hover {
  border-color: var(--green);
  filter: none;
  transform: translateY(-1px);
}

.action-center {
  overflow: hidden;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.action-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 152px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.action-card span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.action-card.warning span {
  background: var(--amber-soft);
  color: var(--amber);
}

.action-card.danger span {
  background: var(--red-soft);
  color: var(--red);
}

.action-card.success span {
  background: var(--green-soft);
  color: var(--green);
}

.action-card h3 {
  margin: 0;
  font-size: 14px;
}

.action-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.saved-filters-panel {
  overflow: hidden;
}

.saved-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.saved-filter-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 156px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(117, 191, 255, 0.05), rgba(255, 255, 255, 0.01)),
    var(--panel-soft);
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.saved-filter-card.custom {
  border-color: rgba(87, 214, 159, 0.32);
}

.saved-filter-card:hover,
.saved-filter-card:focus-visible {
  border-color: rgba(87, 214, 159, 0.72);
  background:
    linear-gradient(180deg, rgba(83, 211, 155, 0.1), rgba(255, 255, 255, 0.014)),
    var(--panel-soft);
  outline: none;
  transform: translateY(-1px);
}

.saved-filter-type {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.saved-filter-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.saved-filter-card small {
  color: var(--muted);
  line-height: 1.35;
}

.saved-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.saved-filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-top: auto;
}

.leaderboard-shell {
  gap: 18px;
}

.leaderboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(83, 211, 155, 0.1), rgba(117, 191, 255, 0.06) 52%, rgba(241, 189, 94, 0.08)),
    var(--panel);
}

.leaderboard-hero h2,
.leaderboard-hero p {
  margin: 0;
}

.leaderboard-hero h2 {
  margin-top: 4px;
  font-size: 24px;
}

.leaderboard-hero p {
  margin-top: 6px;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.45;
}

.leaderboard-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.leaderboard-grid.wide {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
}

.gamification-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.gamification-card {
  display: grid;
  gap: 6px;
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top-color: var(--green);
  border-radius: 8px;
  background: var(--panel-soft);
}

.gamification-card:nth-child(2n) {
  border-top-color: var(--blue);
}

.gamification-card:nth-child(3n) {
  border-top-color: var(--amber);
}

.gamification-card span,
.gamification-card small {
  color: var(--muted);
}

.gamification-card strong {
  font-size: 24px;
  line-height: 1;
}

.leaderboard-profile-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.leaderboard-profile-form label {
  display: grid;
  gap: 6px;
}

.leaderboard-profile-form label > span {
  color: var(--muted);
  font-size: 12px;
}

.toggle-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
}

.toggle-row input {
  min-height: auto;
}

.leaderboard-table {
  min-width: 780px;
}

.leaderboard-table tbody tr.active {
  background: rgba(83, 211, 155, 0.08);
}

.leaderboard-user-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.achievement-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  max-height: 520px;
  overflow: auto;
}

.achievement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.achievement.unlocked {
  border-color: rgba(83, 211, 155, 0.42);
  background:
    linear-gradient(135deg, rgba(83, 211, 155, 0.1), rgba(255, 255, 255, 0.01)),
    var(--panel-soft);
}

.achievement strong,
.achievement span {
  display: block;
}

.achievement span,
.achievement small {
  color: var(--muted);
  font-size: 12px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.overview-deep-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.4fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.overview-list {
  display: grid;
}

.overview-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.overview-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}

.overview-button:hover {
  background: rgba(87, 214, 159, 0.08);
  filter: none;
  transform: none;
}

.overview-row:last-child {
  border-bottom: 0;
}

.overview-row span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  min-width: 0;
}

.overview-row small {
  color: var(--muted);
  font-size: 11px;
}

.overview-row strong {
  text-align: right;
  white-space: nowrap;
}

.overview-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-split > div:first-child {
  border-right: 1px solid var(--line);
}

.overview-split h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-table {
  overflow-x: auto;
}

.overview-table table {
  min-width: 0;
}

.overview-table tbody tr {
  cursor: default;
}

.goal-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.goal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.goal-copy {
  display: grid;
  gap: 3px;
}

.goal-copy span {
  color: var(--muted);
  font-size: 12px;
}

.goal-progress {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--input);
}

.goal-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.bankroll-panel {
  min-width: 0;
}

.bankroll-curve {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.bankroll-chart {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  padding: 12px;
}

.bankroll-chart svg {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}

.bankroll-chart path {
  fill: none;
  stroke-width: 3;
}

.bankroll-chart path.profit {
  stroke: var(--green);
}

.bankroll-chart path.loss {
  stroke: var(--red);
}

.bankroll-chart line.zero {
  stroke: var(--line-strong);
  stroke-dasharray: 4 4;
}

.bankroll-chart circle {
  fill: var(--ink);
  stroke: var(--panel);
  stroke-width: 1.5;
}

.bankroll-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.bankroll-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state.compact {
  padding: 14px;
}

.analysis-grid,
.hands-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(560px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.volume-header {
  align-items: start;
}

.volume-header > div:first-child {
  display: grid;
  gap: 4px;
}

.segmented-control {
  display: inline-flex;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 3px;
}

.segmented-control button {
  min-height: 28px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 0 10px;
  font-size: 12px;
}

.segmented-control button.active {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: #06100d;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 180px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

.bar {
  display: grid;
  grid-template-rows: 18px minmax(0, 1fr) 16px;
  align-items: end;
  gap: 5px;
  min-width: 34px;
  flex: 1;
  height: 100%;
}

.bar-fill {
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--green), var(--green-strong));
  width: 100%;
}

.bar-value {
  align-self: end;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.bar small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.study-layout {
  display: grid;
}

.review-layout {
  grid-template-columns: minmax(360px, 0.82fr) minmax(560px, 1.18fr);
  gap: 18px;
  align-items: stretch;
  height: var(--study-panel-height);
  min-height: 0;
}

.tournament-study-layout {
  grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.tournament-list-panel {
  grid-column: 1 / -1;
}

.tournament-hands-table {
  min-width: 920px;
}

.hands-layout {
  align-items: stretch;
  height: var(--study-panel-height);
  min-height: 0;
}

.hands-layout > .panel,
.review-layout > .panel,
.tournament-hands-panel,
.tournament-replay-panel {
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.tournament-hands-panel,
.tournament-replay-panel {
  height: var(--study-panel-height);
}

.hands-layout > .panel > .panel-header,
.review-layout > .panel > .panel-header,
.tournament-hands-panel > .panel-header,
.tournament-replay-panel > .panel-header {
  position: sticky;
  top: 0;
  z-index: 3;
}

.tournament-replay-panel {
  position: static;
  top: auto;
}

.review-table {
  min-width: 780px;
}

.review-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 12, 0.28);
}

.review-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.review-block-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.review-block-header span {
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.review-block-header strong {
  color: var(--ink);
}

.review-block p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.review-block-list {
  display: grid;
  gap: 7px;
}

.review-block-hand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}

.review-block-hand.active {
  border-color: var(--green);
  background: rgba(87, 214, 159, 0.11);
}

.review-block-hand > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.review-block-hand small {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-replay-panel {
  position: static;
  top: auto;
}

.study-controls {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.session-controls {
  flex-wrap: wrap;
}

.study-controls select {
  flex: 1;
}

.timeline-chart {
  min-height: 320px;
  padding: 16px;
}

.timeline-chart svg {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(87, 214, 159, 0.055), rgba(241, 189, 94, 0.045)),
    var(--input);
}

.timeline-chart .axis {
  stroke: var(--line);
  stroke-width: 2;
}

.timeline-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linejoin: round;
}

.timeline-chart circle {
  stroke: var(--panel);
  stroke-width: 2;
  cursor: pointer;
}

.timeline-chart circle.win {
  fill: var(--green);
}

.timeline-chart circle.loss {
  fill: var(--red);
}

.timeline-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  padding-top: 8px;
  font-size: 12px;
}

.event-list {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
  max-height: 420px;
  overflow: auto;
}

.event-row,
.combo-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(3, auto);
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
  color: var(--ink);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}

.event-row:hover,
.combo-row:hover,
.spot-card:hover,
.leak-card:hover {
  border-color: var(--line-strong);
  background: var(--panel-strong);
}

.preflop-matrix {
  display: grid;
  gap: 3px;
  padding: 16px;
  overflow: auto;
}

.matrix-row {
  display: grid;
  grid-template-columns: repeat(13, minmax(58px, 1fr));
  gap: 3px;
}

.matrix-cell {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 54px;
  padding: 5px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--input);
}

.matrix-cell span {
  font-size: 11px;
  color: var(--muted);
}

.matrix-win {
  background: color-mix(in srgb, var(--green-soft) calc(var(--intensity) * 100%), var(--panel));
}

.matrix-loss {
  background: color-mix(in srgb, var(--red-soft) calc(var(--intensity) * 100%), var(--panel));
}

.spot-summary,
.leak-list,
.combo-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.spot-card,
.leak-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 12px;
  box-shadow: none;
  text-align: left;
}

.leak-card.high {
  border-color: rgba(255, 119, 139, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 119, 139, 0.18), rgba(255, 119, 139, 0.06)),
    var(--panel);
}

.leak-card.medium {
  border-color: rgba(241, 189, 94, 0.46);
  background:
    linear-gradient(135deg, rgba(241, 189, 94, 0.18), rgba(241, 189, 94, 0.06)),
    var(--panel);
}

.leak-card p {
  margin: 0;
  color: var(--muted);
}

.bar small {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  min-height: 180px;
  align-content: flex-start;
}

.tag,
.tag-auto,
.tag-manual {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.tag,
.tag-auto {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag-manual {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag-stack,
.study-badges,
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-stack {
  margin-top: 6px;
}

.review-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.review-badge.reviewed {
  background: var(--green-soft);
  color: var(--green);
}

.review-badge.unreviewed {
  background: var(--violet-soft);
  color: var(--violet);
}

.review-badge.note {
  background: var(--blue-soft);
  color: var(--blue);
}

.priority-badge.low {
  background: rgba(154, 169, 162, 0.14);
  color: var(--muted);
}

.priority-badge.medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.priority-badge.high {
  background: var(--red-soft);
  color: var(--red);
}

.table-wrap {
  overflow: auto;
}

.admin-users-help {
  margin: 0 0 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--panel-strong);
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.active {
  background: rgba(83, 211, 155, 0.07);
}

.admin-users-table {
  min-width: 920px;
}

.admin-users-table tbody tr,
.admin-users-table tbody tr:hover {
  cursor: default;
}

.admin-users-table .row-actions {
  justify-content: flex-end;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
  color: var(--muted);
}

.status-chip.ready {
  color: var(--green);
  border-color: rgba(83, 211, 155, 0.32);
  background: var(--green-soft);
}

.status-chip.missing {
  color: var(--amber);
  border-color: rgba(241, 189, 94, 0.32);
  background: var(--amber-soft);
}

.status-chip.corrupted {
  color: var(--red);
  border-color: rgba(255, 119, 139, 0.32);
  background: var(--red-soft);
}

.admin-users-table td > div:not(.row-actions) {
  display: grid;
  gap: 2px;
}

button.danger {
  background: var(--panel-soft);
  color: var(--red);
  border-color: rgba(255, 119, 139, 0.4);
  box-shadow: none;
}

.filters,
.tournament-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 150px));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.tournament-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 160px) repeat(5, auto) auto auto;
}

.filters label,
.tournament-filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.hands-table-wrap {
  max-height: 620px;
}

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

.num-positive {
  color: var(--green);
  font-weight: 650;
}

.num-negative {
  color: var(--red);
  font-weight: 650;
}

.cards {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.card {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 40px;
  border: 1px solid rgba(237, 244, 239, 0.22);
  border-radius: 5px;
  background: var(--panel-strong);
  color: #ffffff;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.22);
}

.card.heart {
  background: #cf3347;
}

.card.diamond {
  background: #2f74d8;
}

.card.spade {
  background: #101416;
  border-color: rgba(237, 244, 239, 0.34);
}

.card.club {
  background: #1f8b59;
}

.card.unknown {
  background: var(--line-strong);
}

.replay-panel {
  position: static;
  top: auto;
  overflow: auto;
}

.empty-state {
  padding: 28px 16px;
  color: var(--muted);
}

.replay-surface {
  display: grid;
  padding: 14px;
}

.replay-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 270px);
  gap: 14px;
  align-items: start;
}

.replay-main,
.replay-sidebar {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.replay-sidebar {
  position: static;
  top: auto;
}

.replay-hero-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid rgba(87, 214, 159, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(87, 214, 159, 0.1), rgba(117, 191, 255, 0.045)),
    var(--panel-soft);
  padding: 16px;
}

.hero-hand-block,
.hero-result-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.hero-hand-block strong {
  font-size: 18px;
  line-height: 1.1;
}

.replay-context {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.replay-context-title {
  overflow: hidden;
  color: var(--ink);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-meta-line,
.context-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.replay-meta-line span,
.context-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(237, 244, 239, 0.035);
  color: var(--muted);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.context-chip {
  border-color: rgba(87, 214, 159, 0.28);
  background: var(--green-soft);
  color: var(--green);
}

.replay-progress {
  width: min(420px, 100%);
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(237, 244, 239, 0.08);
}

.replay-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.hero-hand-block p,
.hero-result-block span,
.insight-tile p,
.current-action-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-cards-line .card {
  width: 42px;
  height: 56px;
  font-size: 17px;
}

.hero-result-block {
  justify-items: end;
  text-align: right;
}

.hero-result-block strong {
  font-size: 18px;
}

.copy-hand-button {
  justify-self: start;
}

.replay-amount {
  display: inline-block;
  white-space: nowrap;
}

.filter-chip.replay-amount {
  display: inline-flex;
}

.inline-flag {
  display: inline-block;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(241, 93, 93, 0.14);
  color: var(--red);
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.showdown-flag {
  background: rgba(117, 191, 255, 0.14);
  color: var(--blue);
}

.sidebar-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0)),
    var(--panel-soft);
  padding: 12px;
}

.sidebar-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.result-card {
  border-color: rgba(87, 214, 159, 0.26);
  background:
    linear-gradient(135deg, rgba(87, 214, 159, 0.09), rgba(117, 191, 255, 0.04)),
    var(--panel-soft);
}

.result-card strong {
  font-size: 20px;
}

.hand-navigation {
  grid-template-columns: minmax(0, 1fr);
}

.hand-navigation strong {
  display: block;
  margin-top: 4px;
}

.hand-navigation-buttons,
.save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hand-navigation-buttons button {
  flex: 1;
  min-width: 92px;
}

.side-metrics {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.side-metrics > div {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.side-metrics > div:last-child {
  border-bottom: 0;
}

.side-metrics span,
.sidebar-card > span,
.current-action-topline span,
.review-workspace #saveStatus {
  color: var(--muted);
  font-size: 12px;
}

.side-metrics strong {
  font-size: 15px;
}

.hand-context-card {
  border-color: rgba(117, 191, 255, 0.24);
}

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

.context-metric-grid > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}

.context-metric-grid span {
  color: var(--muted);
  font-size: 11px;
}

.context-metric-grid strong {
  font-size: 14px;
}

.why-review-card {
  border-color: rgba(117, 191, 255, 0.24);
}

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

.insight-tile {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 11px;
}

.insight-tile span,
.current-action-card span {
  color: var(--muted);
  font-size: 12px;
}

.insight-tile strong,
.current-action-card strong {
  font-size: 15px;
}

.key-insight {
  grid-column: 1 / -1;
  border-color: rgba(241, 189, 94, 0.35);
  background:
    linear-gradient(135deg, rgba(241, 189, 94, 0.12), rgba(87, 214, 159, 0.05)),
    var(--panel-soft);
}

.key-insight p,
.current-action-card p {
  overflow-wrap: anywhere;
}

.replay-stage {
  display: grid;
  gap: 12px;
}

.replay-stage .table-visual {
  margin: 0;
}

.current-action-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  padding: 12px;
}

.current-action-card.hero-current {
  border-color: rgba(241, 189, 94, 0.45);
  background:
    linear-gradient(135deg, rgba(241, 189, 94, 0.14), rgba(241, 189, 94, 0.045)),
    var(--input);
}

.current-action-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.replay-controls {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.replay-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-timeline {
  display: grid;
  gap: 12px;
}

.street-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.street-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.street-header span {
  color: var(--muted);
  font-size: 12px;
}

.street-actions {
  display: grid;
}

.street-details {
  border-top: 1px solid var(--line);
  background: rgba(8, 13, 12, 0.2);
}

.street-details summary {
  cursor: pointer;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  list-style-position: inside;
}

.street-details summary:hover {
  color: var(--ink);
  background: rgba(87, 214, 159, 0.055);
}

.street-detail-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.action-timeline-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  padding: 9px 11px;
  text-align: left;
}

.action-timeline-row:last-child {
  border-bottom: 0;
}

.action-timeline-row:hover {
  background: rgba(87, 214, 159, 0.07);
  transform: none;
}

.action-timeline-row.active {
  background:
    linear-gradient(90deg, rgba(241, 189, 94, 0.18), rgba(241, 189, 94, 0.04));
}

.action-timeline-row.compact-action {
  min-height: 46px;
  background: rgba(255, 255, 255, 0.018);
}

.action-timeline-row.detail-action {
  min-height: 42px;
  opacity: 0.86;
  padding: 7px 11px;
}

.action-timeline-row.setup-summary .action-type {
  color: var(--green);
}

.action-timeline-row.hero-action .action-main strong {
  color: var(--amber);
}

.action-timeline-row.aggressive-action .action-type {
  color: var(--red);
}

.action-timeline-row.call-action .action-type {
  color: var(--blue);
}

.action-timeline-row.fold-action .action-type {
  color: var(--muted);
}

.action-timeline-row.show-action .action-type {
  color: var(--blue);
}

.action-timeline-row.collect-action .action-type {
  color: var(--green);
}

.action-timeline-row.returned-action .action-type {
  color: var(--amber);
}

.action-timeline-row.all-in-action .action-dot {
  background: var(--red);
}

.action-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.action-timeline-row.hero-action .action-dot {
  background: var(--amber);
}

.action-timeline-row.compact-action .action-dot {
  width: 7px;
  height: 7px;
}

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

.action-main span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.action-side {
  display: grid;
  gap: 3px;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.action-type {
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
}

.review-workspace {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(241, 189, 94, 0.055), rgba(255, 255, 255, 0)),
    var(--panel-soft);
  padding: 12px;
}

.review-toolbar {
  display: grid;
  grid-template-columns: auto minmax(130px, 170px);
  gap: 10px;
  align-items: center;
}

.review-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.review-workspace .note-editor {
  padding: 0;
}

.review-workspace .note-editor button {
  justify-self: start;
}

.save-row button {
  min-width: 112px;
}

.save-row span {
  overflow-wrap: anywhere;
}

.board-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.board-cards .card {
  width: 34px;
  height: 45px;
}

.pot-pill {
  border: 1px solid rgba(237, 244, 239, 0.22);
  border-radius: 999px;
  background: rgba(8, 13, 12, 0.64);
  padding: 5px 10px;
  font-weight: 800;
}

.study-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 16px 0;
}

.study-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 11px;
}

.study-card.key-decision {
  grid-column: 1 / -1;
  border-color: rgba(87, 214, 159, 0.28);
  background:
    linear-gradient(135deg, rgba(87, 214, 159, 0.08), rgba(117, 191, 255, 0.04)),
    var(--panel-soft);
}

.study-card span {
  color: var(--muted);
  font-size: 12px;
}

.study-card strong {
  font-size: 15px;
}

.study-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.review-editor {
  display: grid;
  grid-template-columns: auto minmax(130px, 170px) 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 16px 0;
}

.review-editor label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.quick-tag.selected {
  border-color: rgba(241, 189, 94, 0.62);
  background: var(--amber-soft);
  color: var(--amber);
}

.table-visual {
  position: relative;
  height: 360px;
  margin: 0;
  border-radius: 50%;
  border: 10px solid var(--felt-border);
  background:
    linear-gradient(135deg, rgba(87, 214, 159, 0.08), rgba(0, 0, 0, 0.08)),
    var(--felt);
  box-shadow:
    inset 0 0 0 2px rgba(237, 244, 239, 0.16),
    inset 0 22px 44px rgba(0, 0, 0, 0.18);
}

.seat {
  position: absolute;
  width: 116px;
  min-height: 58px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(237, 244, 239, 0.2);
  border-radius: 7px;
  background: rgba(17, 27, 24, 0.94);
  padding: 7px;
  color: var(--ink);
}

.seat.has-cards {
  min-height: 82px;
}

.seat.hero {
  border-color: var(--amber);
  background:
    linear-gradient(135deg, rgba(241, 189, 94, 0.18), rgba(241, 189, 94, 0.07)),
    var(--panel);
}

.seat.active {
  border-color: rgba(241, 189, 94, 0.82);
  box-shadow:
    0 0 0 3px rgba(241, 189, 94, 0.25),
    0 0 24px rgba(241, 189, 94, 0.15);
}

.seat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.seat-stack {
  color: var(--muted);
  font-size: 12px;
}

.seat-cards {
  display: flex;
  margin: 5px 0 4px;
}

.seat-cards .cards {
  gap: 3px;
  flex-wrap: nowrap;
}

.seat-cards .card {
  width: 23px;
  height: 31px;
  border-radius: 4px;
  font-size: 11px;
}

.seat-action {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.dealer {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--amber);
  color: #201409;
  font-size: 11px;
}

.board-zone {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 8px;
  justify-items: center;
  transform: translate(-50%, -50%);
  color: var(--ink);
}

.board-zone .cards {
  justify-content: center;
}

.board-zone .card {
  border-color: rgba(237, 244, 239, 0.68);
}

.board-cards .card {
  width: 38px;
  height: 50px;
  font-size: 15px;
}

.action-controls,
.note-editor {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.action-controls-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.current-action {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  padding: 9px 10px;
}

.action-list {
  max-height: 220px;
  overflow: auto;
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.action-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.action-row:last-child {
  border-bottom: 0;
}

.action-row.active {
  background: var(--amber-soft);
}

.raw-drawer {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.raw-drawer > button {
  justify-self: start;
}

.raw-hand {
  display: none;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input);
  color: var(--ink);
  padding: 12px;
  white-space: pre-wrap;
  font-size: 12px;
}

.raw-hand.open {
  display: block;
}

.summary-detail {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.summary-detail h3 {
  margin: 0;
  font-size: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(86px, auto) 1fr;
  gap: 8px 12px;
  align-items: baseline;
}

.summary-grid span {
  color: var(--muted);
}

.compact-chart {
  min-height: 220px;
}

.compact-chart svg {
  min-height: 180px;
}

.session-note-editor {
  padding: 16px;
}

.session-note-editor textarea {
  min-height: 92px;
}

.export-panel {
  max-width: 980px;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.export-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-decoration: none;
}

.export-card:hover {
  border-color: var(--green);
  background: var(--panel-strong);
}

.export-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 1120px) {
  .overview-grid,
  .overview-deep-grid,
  .leaderboard-grid,
  .leaderboard-grid.wide,
  .analysis-grid,
  .hands-layout,
  .review-layout,
  .tournament-study-layout,
  .import-history-layout,
  .import-band {
    grid-template-columns: 1fr;
  }

  .hands-layout,
  .review-layout {
    height: auto;
  }

  .hands-layout > .panel,
  .review-layout > .panel,
  .tournament-hands-panel,
  .tournament-replay-panel {
    height: auto;
    max-height: none;
    overflow: hidden;
  }

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

  .saved-filter-grid,
  .gamification-cards,
  .review-blocks,
  .inline-metrics,
  .export-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .replay-panel {
    position: static;
    overflow: hidden;
  }

  .import-detail {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .hands-layout > .panel > .panel-header,
  .review-layout > .panel > .panel-header,
  .tournament-hands-panel > .panel-header,
  .tournament-replay-panel > .panel-header {
    position: static;
  }

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

  .study-panel,
  .review-editor,
  .insight-strip,
  .replay-layout {
    grid-template-columns: 1fr;
  }

  .replay-sidebar {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar,
  .overview-toolbar,
  .volume-header,
  .leaderboard-hero,
  .leaderboard-controls,
  .import-actions,
  .action-controls-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  .overview-split {
    grid-template-columns: 1fr;
  }

  .bankroll-stats {
    grid-template-columns: 1fr;
  }

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

  .saved-filter-grid,
  .gamification-cards,
  .review-blocks,
  .inline-metrics,
  .export-grid {
    grid-template-columns: 1fr;
  }

  .overview-split > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .filters,
  .tournament-filters {
    grid-template-columns: 1fr;
  }

  .table-visual {
    height: 280px;
  }

  .replay-surface {
    padding: 12px;
  }

  .replay-hero-header,
  .review-toolbar {
    grid-template-columns: 1fr;
  }

  .current-action-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-result-block {
    justify-items: start;
    text-align: left;
  }

  .copy-hand-button {
    justify-self: start;
  }

  .action-timeline-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .action-side {
    grid-column: 2;
    justify-items: start;
  }

  .seat {
    width: 92px;
    min-height: 50px;
    font-size: 12px;
  }

  .seat.has-cards {
    min-height: 74px;
  }

  .seat-cards .card {
    width: 20px;
    height: 27px;
    font-size: 10px;
  }

  .hero-cards-line .card {
    width: 36px;
    height: 48px;
  }

  .board-cards .card {
    width: 31px;
    height: 41px;
  }
}
