:root {
  color-scheme: dark;
  --ink: #e7efed;
  --muted: #a0afac;
  --subtle: #72827f;
  --canvas: #0a1113;
  --paper: #131c1e;
  --line: #2a393c;
  --forest: #267765;
  --forest-2: #0a2425;
  --mint: #7bd4b6;
  --mint-soft: #15362f;
  --coral: #ee7b5e;
  --coral-soft: #3a2421;
  --gold: #d7ad52;
  --blue: #6f9eb2;
  --violet: #9a8ac9;
  --shadow: 0 18px 55px rgba(0, 0, 0, .34);
  --radius: 18px;
  --sidebar-width: 238px;
  --hand-font-desktop: 18px;
  --hand-font-mobile: 16px;
  --hand-font-size: var(--hand-font-desktop);
  --editor-ui-font: calc(var(--hand-font-desktop) * .72);
  --builder-max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page-loading-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}
.page-loading-bar.is-active { opacity: 1; }
.page-loading-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--mint), #d7f6e9);
  box-shadow: 0 0 10px rgba(123, 212, 182, .72);
  transition: width .22s ease-out;
}
.page-loading-bar.is-complete i { transition-duration: .1s; }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 30px 20px 22px;
  color: #f8f9f3;
  background:
    radial-gradient(circle at 10% 92%, rgba(142, 210, 189, .13), transparent 26%),
    linear-gradient(168deg, #153f3e, #0d2c2c 70%);
  border-right: 1px solid rgba(255,255,255,.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  padding: 0 8px;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 6px);
  align-items: end;
  gap: 3px;
  width: 29px;
  height: 31px;
  padding: 6px 4px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 9px;
  transform: rotate(-2deg);
  background: rgba(255,255,255,.07);
}

.brand-mark i { display: block; width: 6px; border-radius: 4px; background: var(--mint); }
.brand-mark i:nth-child(1) { height: 10px; opacity: .65; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 13px; opacity: .8; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.2px; }
.brand small { display: block; margin-top: 1px; color: rgba(255,255,255,.48); font-size: 8px; font-weight: 600; letter-spacing: 2.25px; }

.nav-list { display: grid; gap: 7px; margin-top: 52px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border: 0;
  padding: 12px 14px;
  border-radius: 11px;
  color: rgba(255,255,255,.64);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}
.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.nav-item:first-child svg { fill: currentColor; stroke: none; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.is-active { color: #fff; background: rgba(255,255,255,.11); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.nav-item.is-active::before { content: ""; position: absolute; left: -20px; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--mint); }

.sidebar-note {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-top: auto;
  padding: 13px;
  background: rgba(0,0,0,.13);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
}
.status-dot, .live-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(142,210,189,.11); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 11px; }
.sidebar-note small { margin-top: 3px; color: rgba(255,255,255,.45); font-size: 9px; }
.sidebar-footer { padding: 17px 7px 0; color: rgba(255,255,255,.26); font-family: "DM Mono", Consolas, monospace; font-size: 9px; letter-spacing: .5px; }
.sidebar-footer span { margin: 0 4px; color: var(--mint); }

.mobile-header { display: none; }
.main-content { min-height: 100vh; margin-left: var(--sidebar-width); }
.page { display: none; padding: 45px clamp(28px, 4vw, 64px) 70px; max-width: 1540px; margin: 0 auto; animation: pageIn .28s ease; }
.page.is-active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 30px; }
.page-heading h1 { margin: 3px 0 7px; font-size: clamp(28px, 3vw, 42px); line-height: 1.12; letter-spacing: -1.5px; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { margin: 0; color: #66847e; font-family: "DM Mono", Consolas, monospace; font-size: 9px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: white; background: var(--forest); box-shadow: 0 8px 18px rgba(18,59,58,.14); }
.btn-primary:hover { background: #0c3332; box-shadow: 0 10px 24px rgba(18,59,58,.21); }
.btn-light { color: var(--forest); background: #fff; }
.btn-ghost { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,.62); box-shadow: none; }
.btn-ghost:hover { background: #fff; }
.btn-danger { color: #a64d3a; border-color: #e3b7aa; background: #fff7f3; }
.btn-danger:hover { color: #8d3828; border-color: #d99582; background: var(--coral-soft); }
.btn-wide { min-width: 190px; }
.btn-icon { font-size: 11px; }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.text-btn { border: 0; padding: 3px; color: #416e68; background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card { position: relative; overflow: hidden; min-height: 133px; padding: 19px 20px 17px; border: 1px solid var(--line); border-radius: 15px; background: rgba(251,251,248,.86); box-shadow: 0 8px 30px rgba(20,50,48,.035); }
.stat-card::after { content: ""; position: absolute; right: -26px; bottom: -42px; width: 95px; height: 95px; border: 1px solid rgba(70,110,102,.08); border-radius: 50%; }
.stat-card.stat-accent { color: #fff; border-color: transparent; background: linear-gradient(145deg, #164443, #113635); }
.stat-card.stat-accent::after { border-color: rgba(255,255,255,.08); }
.stat-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.stat-accent .stat-label { color: rgba(255,255,255,.6); }
.stat-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; color: #57766f; background: #edf1eb; }
.stat-accent .stat-icon { color: var(--mint); background: rgba(255,255,255,.08); }
.stat-card > strong { display: block; margin-top: 12px; font-family: "DM Mono", Consolas, monospace; font-size: 29px; line-height: 1; letter-spacing: -1.5px; }
.stat-card > small { display: block; margin-top: 8px; color: var(--subtle); font-size: 9px; }
.stat-accent > small { color: rgba(255,255,255,.42); }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(251,251,248,.87); box-shadow: 0 10px 40px rgba(26,52,50,.04); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 18px; }
.recent-panel, .weak-panel { min-height: 294px; padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.panel-heading h2 { margin: 0 0 4px; font-size: 15px; letter-spacing: -.2px; }
.panel-heading p { margin: 0; color: var(--subtle); font-size: 10px; }
.pill { display: inline-block; padding: 5px 7px; border-radius: 6px; font-family: "DM Mono", Consolas, monospace; font-size: 8px; letter-spacing: 1px; }
.pill-warm { color: #a45f45; background: var(--coral-soft); }

.table-wrap { position: relative; margin-top: 19px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 9px 8px; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 9px; font-weight: 500; text-align: left; }
td { padding: 12px 8px; border-bottom: 1px solid #e9ebe6; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--ink); font-weight: 600; }
.score-good { color: #2b7464; font-family: "DM Mono", Consolas, monospace; font-weight: 600; }
.mode-tag { padding: 4px 6px; border-radius: 5px; color: #52756f; background: #e8f0eb; font-size: 9px; }

.empty-inline { display: none; flex-direction: column; align-items: center; justify-content: center; min-height: 175px; color: var(--muted); text-align: center; }
.empty-inline.is-visible { display: flex; }
.empty-inline.compact { min-height: 190px; }
.empty-glyph { margin-bottom: 8px; color: #9bb4ae; font-size: 24px; }
.empty-inline strong { font-size: 12px; }
.empty-inline small { margin-top: 5px; color: var(--subtle); font-size: 9px; }

.weak-list { display: grid; gap: 9px; margin-top: 18px; }
.weak-item { display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: #f3f4ef; }
.weak-hand { display: grid; place-items: center; width: 37px; height: 33px; border: 1px solid #d9dfd7; border-radius: 7px; background: #fff; font-family: "DM Mono", Consolas, monospace; font-weight: 600; font-size: 12px; }
.weak-bar { height: 4px; overflow: hidden; border-radius: 4px; background: #e0e5de; }
.weak-bar i { display: block; height: 100%; border-radius: inherit; background: var(--coral); }
.weak-copy strong, .weak-copy small { display: block; }
.weak-copy strong { margin-bottom: 6px; font-size: 9px; font-weight: 500; }
.weak-copy small { margin-top: 5px; color: var(--subtle); font-size: 8px; }
.weak-errors { color: #a96650; font-family: "DM Mono", Consolas, monospace; font-size: 9px; }

.practice-banner { position: relative; display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 25px; overflow: hidden; min-height: 142px; margin-top: 18px; padding: 25px 30px; color: #fff; border-radius: 17px; background: linear-gradient(105deg, #123b3a, #19504c); box-shadow: 0 14px 35px rgba(18,59,58,.12); }
.practice-banner::after { content: ""; position: absolute; right: 18%; top: -130px; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; }
.practice-banner h2 { position: relative; z-index: 1; margin: 4px 0; font-size: 20px; }
.practice-banner p:not(.eyebrow) { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.53); font-size: 10px; }
.practice-banner .eyebrow { color: var(--mint); }
.banner-art { position: relative; height: 85px; }
.banner-art span { position: absolute; display: grid; place-items: center; width: 58px; height: 78px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; color: rgba(255,255,255,.66); background: rgba(255,255,255,.08); backdrop-filter: blur(4px); font-family: Georgia, serif; font-size: 25px; box-shadow: 0 10px 20px rgba(0,0,0,.1); }
.banner-art span:nth-child(1) { left: 4px; transform: rotate(-11deg); }
.banner-art span:nth-child(2) { left: 44px; top: 2px; z-index: 2; }
.banner-art span:nth-child(3) { left: 84px; transform: rotate(11deg); }

/* Trainer */
.trainer-heading,
#page-trainer .setup-bar,
#page-trainer .trainer-empty,
#page-trainer .workbench { width: 100%; max-width: var(--builder-max-width); margin-inline: auto; }
.trainer-heading { margin-bottom: 21px; }
.timer-card { min-width: 115px; padding: 10px 15px; border-left: 1px solid #d7ddd5; }
.timer-card small, .timer-card strong { display: block; text-align: right; }
.timer-card small { color: var(--subtle); font-size: 9px; }
.timer-card strong { margin-top: 4px; font-family: "DM Mono", Consolas, monospace; font-size: 20px; letter-spacing: .5px; }
.setup-bar { display: grid; grid-template-columns: minmax(210px, 1.15fr) minmax(165px, .75fr) auto minmax(130px, .8fr) auto; align-items: end; gap: 14px; margin-bottom: 17px; padding: 17px 19px; }
.setup-bar.is-strategy { grid-template-columns: minmax(240px, 1.15fr) minmax(180px, .75fr) auto; }
.field { display: grid; gap: 7px; }
.field > span, .mode-control legend { color: #596765; font-size: 10px; font-weight: 600; }
.field b { color: var(--coral); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #d9dfd8; border-radius: 9px; outline: none; color: var(--ink); background: #fdfdfb; transition: .15s ease; }
.field input, .field select { height: 42px; padding: 0 12px; }
.field textarea { padding: 12px; resize: vertical; font-family: "DM Mono", Consolas, monospace; font-size: 11px; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #6c9d92; box-shadow: 0 0 0 3px rgba(108,157,146,.12); }
.compact-field select { min-width: 220px; }
.random-category-field select { min-width: 165px; }
.setup-training-actions { display: flex; align-items: center; gap: 7px; }
.setup-training-actions .btn { min-height: 42px; white-space: nowrap; }
#random-training.is-active { color: #245b52; border-color: #8bb5aa; background: #deede7; box-shadow: 0 0 0 3px rgba(91,145,132,.1); }
.mode-control { margin: 0; padding: 0; border: 0; }
.mode-control legend { margin-bottom: 7px; }
.segmented { display: flex; height: 42px; padding: 3px; border: 1px solid #d9dfd8; border-radius: 9px; background: #f1f3ee; }
.segmented button { min-width: 82px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; }
.segmented button.is-active { color: #234c48; background: #fff; box-shadow: 0 2px 7px rgba(22,58,55,.1); font-weight: 600; }
.segmented button:disabled { opacity: .55; cursor: not-allowed; }
.mode-help { display: flex; align-items: center; gap: 7px; min-height: 42px; color: var(--subtle); font-size: 9px; }
.mode-help > span { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid #ccd5ce; border-radius: 50%; color: #67827d; font-family: serif; font-size: 10px; }

.trainer-empty { display: flex; min-height: 480px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.trainer-empty h2 { margin: 18px 0 5px; font-size: 17px; }
.trainer-empty p { margin: 0; color: var(--subtle); font-size: 10px; }
.matrix-ghost { display: grid; grid-template-columns: repeat(6, 12px); grid-template-rows: repeat(6, 12px); gap: 2px; transform: rotate(-5deg); }
.matrix-ghost::before { content: ""; grid-area: 1 / 1 / 7 / 7; border-radius: 4px; opacity: .6; background: repeating-linear-gradient(90deg, #d9e0d8 0 12px, transparent 12px 14px), repeating-linear-gradient(#d9e0d8 0 12px, transparent 12px 14px); }
.is-hidden { display: none !important; }
.workbench { animation: pageIn .25s ease; }
.workbench-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 50px; margin: 7px 2px 10px; }
.session-title { display: flex; align-items: center; gap: 9px; font-size: max(13px, var(--editor-ui-font)); }
.session-title > span:last-child { padding: 5px 8px; border-radius: 6px; color: #50716b; background: #dfeae4; font-size: max(11px, calc(var(--editor-ui-font) * .82)); }
.brush-bar { display: flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.6); }
.brush-bar > span { padding: 0 7px; color: var(--muted); font-size: max(12px, calc(var(--editor-ui-font) * .86)); font-weight: 600; }
.brush-bar button { height: 34px; padding: 0 11px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: max(12px, calc(var(--editor-ui-font) * .86)); cursor: pointer; }
.brush-bar button:hover { background: #eef1ec; }
.brush-bar button.is-active { color: #fff; background: var(--forest); }
.custom-brush { display: flex; align-items: center; height: 34px; padding: 0 7px; border-left: 1px solid var(--line); color: var(--subtle); }
.custom-brush input { width: 48px; border: 0; outline: none; color: var(--ink); background: transparent; font-family: "DM Mono", Consolas, monospace; font-size: max(12px, calc(var(--editor-ui-font) * .86)); text-align: right; }
.custom-brush input::placeholder { color: var(--subtle); }
.custom-brush span { font-size: max(12px, calc(var(--editor-ui-font) * .86)); }
.custom-brush.is-active { border-left-color: transparent; border-radius: 6px; color: #fff; background: var(--forest); }
.custom-brush.is-active input { color: #fff; }
.strategy-trainer-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.strategy-action-palette { display: flex; align-items: center; gap: 4px; }
.strategy-action-btn { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.7); font-size: max(12px, calc(var(--editor-ui-font) * .86)); cursor: pointer; }
.strategy-action-btn i { width: 12px; height: 12px; border-radius: 4px; background: var(--action-color); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.strategy-action-btn.is-active { color: var(--ink); border-color: var(--action-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--action-color) 23%, transparent); font-weight: 700; }
.strategy-action-btn.is-default { opacity: .62; cursor: default; }
.strategy-training-brush { padding-block: 3px; }
.selection-count { display: flex; align-items: center; gap: 8px; }
.selection-count strong { font-family: "DM Mono", Consolas, monospace; font-size: max(20px, calc(var(--editor-ui-font) * 1.3)); }
.selection-count span { color: var(--muted); font-size: max(12px, calc(var(--editor-ui-font) * .86)); }
.matrix-scroll { width: 100%; overflow: hidden; padding: 13px; border-radius: 14px; }
.range-matrix { container-type: inline-size; display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 3px; width: 100%; min-width: 0; margin: 0 auto; }
.range-cell { --fill: 0%; --answer-fill: var(--fill); position: relative; isolation: isolate; display: flex; align-items: flex-start; justify-content: flex-start; min-width: 0; aspect-ratio: 1.22; overflow: hidden; padding: min(7px, .8cqw) min(6px, .45cqw); border: 1px solid #d5dcd4; border-radius: 5px; color: #263533; background: #f7f8f4; font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif; font-size: var(--hand-font-size); font-size: min(var(--hand-font-size), max(8px, 3.1cqw)); font-weight: 700; line-height: 1; text-align: left; cursor: pointer; user-select: none; transition: transform .1s ease, border-color .12s ease, box-shadow .12s ease; }
.range-cell::before { content: ""; position: absolute; z-index: -2; inset: 0; background: var(--type-bg, #f3f4ef); }
.range-cell::after { content: ""; position: absolute; z-index: -1; inset: auto 0 0; height: var(--fill); background: var(--mint); transition: height .16s cubic-bezier(.2,.8,.2,1); }
.range-cell.pair { --type-bg: #e9ece5; }
.range-cell.suited { --type-bg: #f3f6f0; }
.range-cell.offsuit { --type-bg: #f8f4ee; }
.range-cell:hover { z-index: 2; border-color: #819c95; box-shadow: 0 4px 12px rgba(21,57,54,.12); transform: translateY(-1px); }
.range-matrix.is-painting, .range-matrix.is-painting .range-cell { cursor: crosshair; }
.range-matrix.is-painting .range-cell:hover { transform: none; }
.range-cell.is-selected { color: #123a37; border-color: #80b9a9; }
.range-cell .cell-weight { position: absolute; right: 3px; bottom: 2px; color: rgba(12,60,53,.65); font-size: 6px; }
.range-cell.strategy-cell { color: #172421; text-shadow: 0 1px rgba(255,255,255,.52); }
.range-cell.strategy-cell::before { background: var(--strategy-bg, #e4e7e1); }
.range-cell.strategy-cell::after { display: none; }
.range-cell.strategy-cell .cell-weight { padding: 1px 2px; border-radius: 3px; color: #1f2f2b; background: rgba(255,255,255,.62); text-shadow: none; }
.range-cell:focus-visible { outline: 2px solid var(--coral); outline-offset: 1px; }
.matrix-caption { display: flex; gap: 16px; align-items: center; padding: 9px 5px; color: var(--subtle); font-size: 8px; }
.matrix-caption > span { display: inline-flex; align-items: center; gap: 5px; }
.matrix-caption .hint { margin-left: auto; }
.legend-cell { width: 10px; height: 10px; border: 1px solid #d2d8d1; border-radius: 2px; }
.legend-cell.pair { background: #e9ece5; }
.legend-cell.suited { background: #f3f6f0; }
.legend-cell.offsuit { background: #f8f4ee; }
.trainer-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.trainer-answer-compare { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; color: var(--muted); }
.trainer-answer-compare.is-hidden { display: none; }
.trainer-answer-compare > span { color: var(--ink); font-size: 10px; font-weight: 700; }
.trainer-answer-compare > small { font-size: 10px; }
.trainer-answer-compare-hold { width: 36px; min-width: 36px; min-height: 34px; border-radius: 8px; }
.range-matrix.is-answer-preview { box-shadow: inset 0 0 0 2px rgba(46,130,111,.42); }

.range-cell.feedback { cursor: default; }
.range-cell.feedback:hover { transform: none; box-shadow: none; }
.range-cell.feedback::after { height: var(--answer-fill); }
.range-cell.feedback.status-correct.is-answer { border-color: #63aa90; background: #e0f0e8; }
.range-cell.feedback.status-correct.is-answer::after { background: #8ed2bd; }
.range-cell.feedback.status-missing { color: #8d593e; border: 2px solid #e7a35f; background: #fff5e6; box-shadow: inset 0 0 0 1px #fff; }
.range-cell.feedback.status-missing::after { background: repeating-linear-gradient(135deg, #f0bd77 0 4px, #f8d8a8 4px 8px); }
.range-cell.feedback.status-extra { color: #913e32; border: 2px solid #dc715b; background: #fbe8e2; }
.range-cell.feedback.status-extra::after { background: #e99580; }
.range-cell.feedback.status-frequency { color: #5d4b87; border: 2px solid #8e7eb7; background: #eeeaf6; }
.range-cell.feedback.status-frequency::after { background: #a697c8; }

.result-panel { margin-top: 17px; padding: 23px; }
.result-score { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.score-ring { --score: 0deg; position: relative; display: grid; place-items: center; width: 83px; height: 83px; border-radius: 50%; background: conic-gradient(var(--forest) var(--score), #e4e8e1 0); }
.score-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--paper); }
.score-ring strong, .score-ring small { position: relative; z-index: 1; display: block; text-align: center; }
.score-ring strong { font-family: "DM Mono", Consolas, monospace; font-size: 18px; }
.score-ring small { color: var(--subtle); font-size: 7px; }
.result-score h2 { margin: 4px 0; font-size: 19px; }
.result-score p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; }
.feedback-legend { display: flex; flex-wrap: wrap; gap: 17px; margin: 16px 0 3px; color: var(--muted); font-size: max(11px, calc(var(--editor-ui-font) * .8)); }
.feedback-legend span { display: flex; align-items: center; gap: 5px; }
.trainer-feedback-note { margin-bottom: 12px; }
.dot { width: 7px; height: 7px; border-radius: 2px; }
.dot.correct { background: var(--mint); }
.dot.missing { background: #e7a35f; }
.dot.extra { background: #dc715b; }
.dot.frequency { background: #8e7eb7; }
.mistake-groups { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; margin-top: 13px; }
.mistake-group { padding: 15px; border-radius: 12px; background: #f3f4ef; }
.mistake-group h3 { display: flex; justify-content: space-between; margin: 0 0 11px; font-size: max(14px, var(--editor-ui-font)); }
.mistake-group h3 span { color: var(--subtle); font-family: "DM Mono", Consolas, monospace; font-size: max(12px, calc(var(--editor-ui-font) * .86)); }
.mistake-chips { display: grid; grid-template-columns: 1fr; gap: 7px; min-height: 28px; }
.mistake-chip { padding: 9px 10px; border: 1px solid #dce1da; border-radius: 8px; background: white; font-family: "DM Mono", Consolas, monospace; font-size: max(14px, var(--editor-ui-font)); line-height: 1.35; }
.mistake-chip small { display: block; margin-top: 4px; color: #6f7d7c; font-size: max(12px, calc(var(--editor-ui-font) * .9)); line-height: 1.5; white-space: normal; }
.all-correct { color: #548076; font-size: max(12px, calc(var(--editor-ui-font) * .86)); }

/* Range library */
.library-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding: 15px 18px; }
.library-toolbar strong, .library-toolbar span { display: block; }
.library-toolbar strong { font-size: 12px; }
.library-toolbar > div > span { margin-top: 3px; color: var(--subtle); font-size: 8px; }
.format-tip { display: flex; align-items: center; gap: 10px; }
.format-tip span { color: var(--subtle); font-size: 8px; }
.format-tip code { padding: 7px 9px; border-radius: 6px; color: #526e68; background: #edf1eb; font-family: "DM Mono", Consolas, monospace; font-size: 9px; }
.range-library { display: grid; gap: 24px; }
.range-group { min-width: 0; }
.range-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 3px 10px; }
.range-group-heading > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.range-group-heading h2 { overflow: hidden; margin: 0; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.range-group-heading > span { flex: none; padding: 5px 8px; border-radius: 999px; color: #5f746f; background: #e8ede7; font-size: 9px; }
.range-group-mark { width: 7px; height: 22px; flex: none; border-radius: 999px; background: var(--mint); }
.range-group-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.range-card { position: relative; overflow: hidden; min-height: 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(251,251,248,.88); box-shadow: 0 8px 28px rgba(20,50,48,.035); transition: .18s ease; }
.range-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.range-card::after { content: ""; position: absolute; right: -35px; top: -35px; width: 100px; height: 100px; border: 14px solid rgba(21,67,63,.025); border-radius: 50%; }
.range-card-top { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 10px; }
.range-card h2 { overflow: hidden; margin: 0; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.range-title-button { display: block; max-width: 100%; overflow: hidden; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: inherit; line-height: inherit; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.range-title-button:hover { color: var(--mint); }
.range-title-button:focus-visible { border-radius: 4px; outline: 2px solid var(--mint); outline-offset: 3px; }
.range-card p { overflow: hidden; min-height: 0; margin: 4px 0 7px; color: var(--muted); font-size: max(11px, calc(var(--editor-ui-font) * .78)); line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.range-meta { display: flex; gap: 14px; padding: 6px 0; border-top: 1px solid #e6e9e3; border-bottom: 1px solid #e6e9e3; }
.range-meta div { display: grid; gap: 2px; }
.range-meta strong { font-family: "DM Mono", Consolas, monospace; font-size: max(13px, calc(var(--editor-ui-font) * .9)); }
.range-meta span { color: var(--subtle); font-size: max(10px, calc(var(--editor-ui-font) * .7)); }
.range-card-actions { display: flex; justify-content: space-between; align-items: center; gap: 5px; padding-top: 6px; }
.range-card-actions > div { display: flex; flex-wrap: nowrap; gap: 2px; }
.mini-btn { border: 0; padding: 6px 4px; border-radius: 6px; color: var(--muted); background: transparent; font-size: max(11px, calc(var(--editor-ui-font) * .82)); white-space: nowrap; cursor: pointer; }
.mini-btn:hover { color: var(--forest); background: #edf0eb; }
.mini-btn.danger:hover { color: #aa4c3a; background: var(--coral-soft); }
.practice-link { border: 0; padding: 6px 4px; color: #315f59; background: transparent; font-size: max(11px, calc(var(--editor-ui-font) * .82)); font-weight: 700; white-space: nowrap; cursor: pointer; }
.library-empty { grid-column: 1 / -1; display: flex; min-height: 350px; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #ccd5ce; border-radius: 16px; color: var(--muted); }
.library-empty strong { margin-top: 12px; font-size: 14px; }
.library-empty p { margin: 5px 0 14px; color: var(--subtle); font-size: 9px; }

/* Modal */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(8,25,25,.63); backdrop-filter: blur(5px); }
.modal-backdrop.is-open { display: flex; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card { position: relative; width: min(650px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 29px; border-radius: 18px; background: var(--paper); box-shadow: 0 28px 80px rgba(0,0,0,.24); animation: modalIn .2s ease; }
.modal-wide { width: min(960px, 100%); }
.modal-builder { width: min(var(--builder-max-width), 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-card h2 { margin: 4px 0 5px; font-size: 22px; }
.modal-intro { margin: 0 0 22px; color: var(--muted); font-size: 10px; }
.modal-builder #builder-form { margin-top: 18px; }
.modal-close { position: absolute; right: 18px; top: 18px; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: #eff1ed; font-size: 19px; cursor: pointer; }
.detail-range-header { padding-right: 36px; margin-bottom: 17px; }
.detail-range-header > div { min-width: 0; }
.detail-range-header .modal-intro { margin-bottom: 0; }
.detail-range-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.detail-range-footer .modal-actions { flex: none; margin-top: 0; }
.detail-range-compare { display: grid; min-width: 0; grid-template-columns: auto minmax(150px,220px) 42px; gap: 8px; align-items: center; }
.detail-range-compare[hidden] { display: none; }
.detail-range-compare > strong { color: var(--ink); font-size: 10px; white-space: nowrap; }
.detail-range-switcher { min-width: 0; }
.detail-range-switcher select { width: 100%; min-height: 40px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--paper); font-size: 11px; font-weight: 650; cursor: pointer; }
.detail-compare-hold { display: grid; width: 42px; min-width: 42px; min-height: 40px; place-items: center; padding: 0; border: 1px solid #77aa9c; border-radius: 9px; color: #285f55; background: #f4fbf8; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; transition: color .13s ease, background .13s ease, transform .13s ease; }
.detail-compare-hold svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.detail-compare-hold:not(:disabled):hover { background: #e5f4ee; }
.detail-compare-hold.is-active { color: white; background: #2e826f; transform: scale(.98); }
.detail-compare-hold:disabled { color: var(--subtle); border-color: var(--line); background: rgba(255,255,255,.45); cursor: wait; }
.detail-compare-hold:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.exam-mistake-backdrop.is-open { animation: examMistakeBackdrop .22s ease; }
.exam-mistake-card { width: min(560px,100%); overflow: visible; padding: 34px; border: 1px solid #e8b5a7; text-align: center; animation: examMistakeIn .34s cubic-bezier(.2,.85,.25,1.15); }
.exam-mistake-symbol { display: grid; width: 62px; height: 62px; margin: -2px auto 16px; place-items: center; border-radius: 50%; color: white; background: #c85f49; box-shadow: 0 10px 28px rgba(188,75,52,.28); font-size: 36px; font-weight: 650; line-height: 1; }
.exam-mistake-card .eyebrow { color: #b45743; }
.exam-mistake-card h2 { margin-top: 7px; color: #913f31; font-size: 28px; }
.exam-mistake-hand { margin: 5px 0 22px; color: var(--muted); font-family: "DM Mono", Consolas, monospace; font-size: 16px; font-weight: 700; }
.exam-mistake-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; text-align: left; }
.exam-mistake-summary > span { min-width: 0; padding: 14px 16px; border: 1px solid #e2e5df; border-radius: 11px; background: #f7f8f5; }
.exam-mistake-summary > span:first-child { border-color: #edc4b8; background: #fff2ed; }
.exam-mistake-summary small, .exam-mistake-summary strong { display: block; }
.exam-mistake-summary small { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.exam-mistake-summary strong { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.exam-mistake-frequency { margin-top: 18px; text-align: left; }
.exam-mistake-continue { width: 100%; min-height: 50px; margin-top: 24px; font-size: 14px; }
@keyframes examMistakeBackdrop { from { background: rgba(122,34,22,0); backdrop-filter: blur(0); } }
@keyframes examMistakeIn { 0% { opacity: 0; transform: translateY(18px) scale(.9); } 65% { transform: translateY(-3px) scale(1.015); } 100% { opacity: 1; transform: none; } }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 15px; }
.form-row-three { grid-template-columns: 1.05fr 1fr .8fr; }
.builder-form-row { margin-bottom: 12px; }
.builder-import-panel { margin: 0 0 12px; border: 1px solid #dce2da; border-radius: 12px; background: #f5f6f2; }
.builder-import-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 9px 13px; list-style: none; cursor: pointer; }
.builder-import-panel summary::-webkit-details-marker { display: none; }
.builder-import-panel summary > span { display: grid; gap: 2px; }
.builder-import-panel summary b { font-size: var(--editor-ui-font); }
.builder-import-panel summary small { color: var(--subtle); font-size: max(9px, calc(var(--editor-ui-font) * .72)); }
.builder-import-panel summary > i { color: #47716b; font-size: max(10px, calc(var(--editor-ui-font) * .78)); font-style: normal; font-weight: 600; }
.builder-import-panel[open] summary > i { font-size: 0; }
.builder-import-panel[open] summary > i::after { content: "收起"; font-size: max(10px, calc(var(--editor-ui-font) * .78)); }
.builder-import-fields { display: grid; grid-template-columns: 180px minmax(280px, 1fr) auto; align-items: end; gap: 10px; padding: 0 13px 3px; }
.builder-import-fields textarea { min-height: 64px; max-height: 140px; }
.builder-import-fields .btn { min-height: 42px; margin-bottom: 0; }
.builder-import-panel .parse-status { margin: 6px 13px 12px; }
.builder-caption { min-height: 43px; padding-top: 8px; }
.builder-action-percentages { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.builder-action-percentage { display: inline-flex; align-items: center; gap: 6px; min-height: 31px; padding: 6px 10px; border: 1px solid #dce1da; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.75); font-size: max(13px, calc(var(--editor-ui-font) * .95)); }
.builder-action-percentage i { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--action-color); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.builder-action-percentage b { color: var(--ink); font-weight: 600; }
.builder-action-percentage strong { color: #315d57; font-family: "DM Mono", Consolas, monospace; font-size: 1em; }
.builder-workspace { display: flex; flex-direction: column; gap: 10px; }
.builder-grid-area { min-width: 0; }
.builder-matrix-scroll { padding: 10px; background: #f0f2ed; box-shadow: none; }
.builder-matrix { width: 100%; max-width: none; min-width: 0; }
.builder-matrix .range-cell { aspect-ratio: 1.35; }
.builder-caption { padding-bottom: 0; }
.builder-actions > span { flex: 1; }
.action-sidebar { order: -1; display: grid; grid-template-columns: 72px 158px minmax(260px, 1fr) 300px; align-items: center; gap: 10px; min-height: auto; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: #f2f3ee; }
.action-sidebar-heading { display: flex; align-items: center; justify-content: center; margin: 0; }
.action-sidebar-heading button { width: 100%; min-height: 43px; border: 0; padding: 5px 7px; border-radius: 8px; color: #35655e; background: #dfece6; font-size: var(--editor-ui-font); font-weight: 600; cursor: pointer; }
.default-action-editor, .action-editor { position: relative; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 6px; min-height: 43px; padding: 7px; border: 1px solid #dce1da; border-radius: 9px; background: rgba(255,255,255,.73); }
.default-action-editor { grid-template-columns: 28px minmax(0,1fr); margin: 0; }
.action-color { --action-color: #d9ddd6; position: relative; display: block; width: 25px; height: 25px; border: 2px solid #fff; border-radius: 7px; background: var(--action-color); box-shadow: 0 0 0 1px rgba(20,48,44,.14); cursor: pointer; }
.action-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.action-name-input { min-width: 0; width: 100%; border: 0; border-bottom: 1px solid transparent; outline: none; color: var(--ink); background: transparent; font-size: var(--editor-ui-font); font-weight: 600; }
.action-name-input:focus { border-bottom-color: #7ea59c; }
.action-editor-list { display: flex; gap: 6px; max-width: 100%; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 2px; }
.action-editor { grid-template-columns: 28px 25px minmax(0,1fr) 22px; cursor: pointer; }
.action-editor { flex: 0 0 154px; }
.action-editor.is-active { border-color: #6d9a90; background: #fff; box-shadow: 0 0 0 2px rgba(86,139,127,.1); }
.action-select { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #dce1da; border-radius: 7px; color: transparent; background: #f1f3ef; font-size: 9px; cursor: pointer; }
.action-editor.is-active .action-select { color: #fff; border-color: var(--action-color); background: var(--action-color); }
.delete-action { display: grid; place-items: center; width: 21px; height: 21px; border: 0; border-radius: 6px; color: #9a7770; background: transparent; cursor: pointer; }
.delete-action:hover { color: #a24232; background: #f7e6df; }
.sidebar-brush { margin-top: 0; padding: 0 0 0 10px; border-top: 0; border-left: 1px solid var(--line); }
.sidebar-brush > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: var(--editor-ui-font); font-weight: 600; }
.brush-presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.brush-presets button { height: 31px; border: 1px solid #dce1da; border-radius: 6px; color: var(--muted); background: #fff; font-size: max(11px, calc(var(--editor-ui-font) * .9)); cursor: pointer; }
.brush-presets button.is-active { color: #fff; border-color: var(--forest); background: var(--forest); }
.sidebar-custom-weight { display: grid; grid-template-columns: 1fr 55px 13px; align-items: center; gap: 4px; margin-top: 6px; padding: 7px 8px; border: 1px solid #dce1da; border-radius: 7px; color: var(--subtle); background: #fff; font-size: max(11px, calc(var(--editor-ui-font) * .9)); }
.sidebar-custom-weight input { width: 100%; border: 0; outline: none; background: transparent; font-family: "DM Mono", Consolas, monospace; font-size: var(--editor-ui-font); text-align: right; }
.sidebar-custom-weight b { color: var(--muted); font-size: var(--editor-ui-font); }
.sidebar-custom-weight.is-active { border-color: #729c92; box-shadow: 0 0 0 2px rgba(92,143,131,.1); }
.weight-rule { display: none; gap: 7px; color: var(--subtle); }
.weight-rule > span { display: grid; place-items: center; flex: none; width: 16px; height: 16px; border: 1px solid #cdd6ce; border-radius: 50%; font-family: serif; font-size: 8px; }
.weight-rule p { margin: 1px 0 0; font-size: 7px; line-height: 1.5; }
.parse-status { display: flex; align-items: center; gap: 8px; min-height: 38px; margin-top: 9px; padding: 8px 10px; border-radius: 8px; color: #65736f; background: #eff2ed; font-size: 9px; }
.parse-status.is-good { color: #316a5e; background: #e1f0e9; }
.parse-status.is-error { color: #9d4d3a; background: #f8e6df; }
.status-symbol { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: rgba(255,255,255,.65); font-family: serif; font-size: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; }
.preview-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.preview-summary span { padding: 8px 11px; border-radius: 7px; color: #58706b; background: #ecf0eb; font-size: 11px; }
.preview-summary .category-summary { color: #245b52; background: #dcece5; font-weight: 700; }
.preview-summary .comparison-summary { color: #805226; background: #f7e7c9; font-weight: 750; }
.preview-summary .action-summary { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); }
.preview-summary .action-summary i { width: 11px; height: 11px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.preview-summary .action-summary b { font-weight: 700; }
.preview-summary .action-summary strong { color: var(--ink); font-family: "DM Mono", Consolas, monospace; font-size: 12px; }
.preview-scroll { padding: 9px; box-shadow: none; }
.preview-matrix { min-width: 0; }
.preview-matrix .range-cell { cursor: default; }
.preview-matrix .range-cell:hover { transform: none; box-shadow: none; }

/* Settings */
.settings-heading { margin-bottom: 22px; }
.settings-layout { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.15fr); gap: 18px; }
.settings-card { padding: 24px; }
.settings-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.settings-card-heading h2 { margin: 4px 0 5px; font-size: 20px; }
.settings-card-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.font-controls { display: grid; gap: 13px; }
.font-control { display: grid; grid-template-columns: 145px 1fr 65px; align-items: center; gap: 14px; padding: 14px; border: 1px solid #e0e4de; border-radius: 12px; background: #f5f6f2; }
.font-control span b, .font-control span small { display: block; }
.font-control span b { font-size: 13px; }
.font-control span small { margin-top: 4px; color: var(--subtle); font-size: 9px; }
.font-control input[type="range"] { width: 100%; accent-color: var(--forest); cursor: pointer; }
.font-control output { padding: 8px 6px; border: 1px solid #dce2da; border-radius: 8px; color: #315d57; background: white; font-family: "DM Mono", Consolas, monospace; font-size: 11px; font-weight: 600; text-align: center; }
.font-preview { margin-top: 16px; padding: 17px; border: 1px dashed #cdd7cf; border-radius: 13px; background: #f8f8f5; }
.font-preview > p { margin: 0 0 11px; color: var(--subtle); font-size: 9px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.settings-preview-cells { display: grid; grid-template-columns: repeat(3, minmax(68px, 1fr)); gap: 6px; }
.settings-preview-cells .range-cell { width: 100%; aspect-ratio: 1.35; cursor: default; }
.settings-preview-cells .range-cell:hover { border-color: #d5dcd4; box-shadow: none; transform: none; }
.settings-preview-cells .settings-preview-mix { --type-bg: linear-gradient(90deg, #e77b5d 0 35%, #e5bd55 35% 80%, #d9ddd6 80%); }
.settings-weight-preview { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: var(--editor-ui-font); }
.settings-weight-preview strong { margin-right: auto; font-weight: 600; }
.settings-weight-preview button { min-width: 48px; height: 31px; border: 1px solid #dce1da; border-radius: 6px; color: var(--muted); background: white; font-size: max(11px, calc(var(--editor-ui-font) * .9)); }
.action-settings-heading { align-items: center; }
.settings-add-action { min-height: 38px; }
.settings-action-list { display: grid; gap: 9px; }
.settings-action-row { --action-color: #d9ddd6; display: grid; grid-template-columns: 42px minmax(120px, 1fr) auto 32px; align-items: center; gap: 11px; min-height: 62px; padding: 10px 12px; border: 1px solid #dfe4dd; border-radius: 12px; background: #f7f8f4; }
.settings-action-row.is-default { background: #eef2ed; }
.settings-action-color { position: relative; width: 38px; height: 38px; overflow: hidden; border: 3px solid white; border-radius: 10px; background: var(--action-color); box-shadow: 0 0 0 1px rgba(20,48,44,.15); cursor: pointer; }
.settings-action-color input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; cursor: pointer; }
.settings-action-name { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #d8dfd8; border-radius: 8px; outline: none; color: var(--ink); background: white; font-size: 13px; font-weight: 600; }
.settings-action-name:focus { border-color: #6c9d92; box-shadow: 0 0 0 3px rgba(108,157,146,.12); }
.settings-action-kind { padding: 6px 8px; border-radius: 7px; color: #63736f; background: #e5ebe5; font-size: 9px; white-space: nowrap; }
.settings-action-row:not(.is-default) .settings-action-kind { color: #4b736b; background: #e0f0e8; }
.settings-delete-action { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; color: #9a7770; background: transparent; font-size: 18px; cursor: pointer; }
.settings-delete-action:hover { color: #a24232; background: #f7e6df; }
.settings-delete-action:disabled { visibility: hidden; }
.settings-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; padding: 11px 12px; border-radius: 10px; color: var(--muted); background: #eef1ec; }
.settings-note span { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border: 1px solid #c8d2ca; border-radius: 50%; font-family: Georgia, serif; font-size: 10px; }
.settings-note p { margin: 1px 0 0; font-size: 10px; line-height: 1.55; }
.settings-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; }

/* 6-max table exam */
.table-exam-heading { align-items: center; }
.exam-score-strip { display: flex; align-items: center; overflow: hidden; min-width: 518px; border: 1px solid var(--line); border-radius: 14px; background: rgba(251,251,248,.88); box-shadow: 0 8px 28px rgba(20,50,48,.04); }
.exam-score-strip > span { display: grid; min-width: 74px; padding: 11px 12px; text-align: center; }
.exam-score-strip > span + span { border-left: 1px solid var(--line); }
.exam-score-strip small { color: var(--muted); font-size: 9px; }
.exam-score-strip strong { margin-top: 3px; color: var(--forest); font-family: "DM Mono", Consolas, monospace; font-size: 20px; }
.table-exam-setup { display: grid; grid-template-columns: 135px minmax(220px, 1fr) 115px 110px minmax(145px, auto) auto; align-items: end; gap: 12px; margin-bottom: 17px; padding: 17px 19px; }
.exam-range-picker-field { grid-column: 2 / -1; }
.exam-category-picker-field { grid-column: 2 / -1; }
.exam-category-picker-field > span { display: flex; align-items: center; gap: 6px; }
.exam-category-picker-field small { color: var(--subtle); font-size: 9px; font-weight: 500; }
.exam-category-picker { display: flex; flex-wrap: wrap; gap: 7px; max-height: 102px; overflow-y: auto; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fdfdfb; }
.exam-category-choice { display: inline-flex; min-width: 0; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #d9dfd8; border-radius: 7px; color: var(--ink); background: #fff; font-size: 10px; font-weight: 600; cursor: pointer; }
.exam-category-choice:has(input:checked) { border-color: #6c9d92; color: #275f55; background: #e9f4ee; }
.exam-category-choice input { width: 13px; height: 13px; margin: 0; accent-color: var(--forest); }
.exam-category-choice b { color: inherit; font-size: 9px; }
.exam-range-picker-field > span { display: flex; align-items: center; gap: 6px; }
.exam-range-picker-field small { color: var(--subtle); font-size: 9px; font-weight: 500; }
.exam-range-picker { display: flex; flex-wrap: wrap; gap: 7px; max-height: 122px; overflow-y: auto; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fdfdfb; }
.exam-range-choice { display: inline-flex; min-width: 0; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #d9dfd8; border-radius: 7px; color: var(--ink); background: #fff; font-size: 10px; font-weight: 600; cursor: pointer; }
.exam-range-choice:has(input:checked) { border-color: #6c9d92; color: #275f55; background: #e9f4ee; }
.exam-range-choice input { width: 13px; height: 13px; margin: 0; accent-color: var(--forest); }
.exam-range-picker-empty { color: var(--muted); font-size: 10px; }
.overtime-setup { display: grid; grid-template-columns: minmax(260px,1fr) auto; align-items: end; gap: 14px; margin-bottom: 17px; padding: 18px 19px; }
.overtime-category-heading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.overtime-category-heading > div:first-child { display: grid; gap: 3px; }
.overtime-category-heading span { color: #596765; font-size: 11px; font-weight: 700; }
.overtime-category-heading small { color: var(--subtle); font-size: 9px; }
.overtime-category-heading > div:last-child { display: flex; gap: 6px; }
.overtime-category-heading button { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; color: #416e68; background: white; font-size: 9px; font-weight: 700; cursor: pointer; }
.overtime-category-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 8px; }
.overtime-category-choice { position: relative; display: block; cursor: pointer; }
.overtime-category-choice input { position: absolute; opacity: 0; pointer-events: none; }
.overtime-category-choice span { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 12px; border: 1px solid #dce1db; border-radius: 9px; color: #52615e; background: #fdfdfb; font-size: 10px; font-weight: 700; transition: .15s ease; }
.overtime-category-choice input:checked + span { color: #174b43; border-color: #79ad9e; background: #e9f5f0; box-shadow: inset 0 0 0 1px rgba(59,126,108,.08); }
.overtime-category-choice b { display: grid; min-width: 24px; height: 22px; place-items: center; border-radius: 999px; color: #5f7771; background: rgba(18,59,58,.07); font-family: "DM Mono", Consolas, monospace; font-size: 9px; }
.overtime-category-empty { grid-column: 1 / -1; padding: 14px; color: var(--muted); border: 1px dashed var(--line); border-radius: 9px; font-size: 10px; text-align: center; }
.overtime-date-heading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.overtime-date-heading > div { display: grid; gap: 3px; }
.overtime-date-heading > div span { color: #596765; font-size: 11px; font-weight: 700; }
.overtime-date-heading > div small { color: var(--subtle); font-size: 9px; }
.overtime-date-heading > label { display: flex; align-items: center; gap: 7px; color: #416e68; font-size: 10px; font-weight: 750; cursor: pointer; }
.overtime-date-heading input { width: 15px; height: 15px; accent-color: var(--mint); }
.overtime-date-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit,minmax(98px,1fr)); gap: 7px; }
.overtime-date-choice { position: relative; cursor: pointer; }
.overtime-date-choice input { position: absolute; opacity: 0; pointer-events: none; }
.overtime-date-choice span { display: grid; min-height: 48px; place-content: center; gap: 2px; border: 1px solid #dce1db; border-radius: 9px; color: #52615e; background: #fdfdfb; text-align: center; transition: .15s ease; }
.overtime-date-choice b { font-size: 10px; }
.overtime-date-choice small { color: var(--muted); font-family: "DM Mono", Consolas, monospace; font-size: 9px; }
.overtime-date-choice input:checked + span { color: #174b43; border-color: #79ad9e; background: #e9f5f0; box-shadow: inset 0 0 0 1px rgba(59,126,108,.08); }
.overtime-date-choice.is-empty { cursor: default; opacity: .42; }
.overtime-new-option { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 9px 12px; border: 1px solid #ead8ad; border-radius: 10px; background: #fffaf0; cursor: pointer; }
.overtime-new-option input { width: 16px; height: 16px; accent-color: #a47620; }
.overtime-new-option span { display: grid; gap: 2px; }
.overtime-new-option b { color: #765a23; font-size: 10px; }
.overtime-new-option small { color: #9a845c; font-size: 8px; }
.exam-new-limit-input { position: relative; display: block; }
.exam-new-limit-input input { padding-right: 38px; font-family: "DM Mono", Consolas, monospace; font-weight: 700; }
.exam-new-limit-input b { position: absolute; top: 50%; right: 12px; color: var(--muted); font-size: 11px; pointer-events: none; transform: translateY(-50%); }
.exam-new-limit-field.is-disabled { opacity: .55; }
.exam-new-limit-field.is-disabled input { cursor: not-allowed; }
.exam-auto-position { display: grid; gap: 5px; min-height: 42px; align-content: center; padding: 0 13px; border-left: 1px solid var(--line); }
.exam-auto-position span { color: var(--subtle); font-size: 8px; letter-spacing: .8px; text-transform: uppercase; }
.exam-auto-position strong { color: #4f6f69; font-size: 10px; font-weight: 600; }
.table-exam-empty { display: grid; min-height: 430px; place-content: center; justify-items: center; padding: 45px; text-align: center; }
.table-exam-empty h2 { margin: 20px 0 7px; font-size: 20px; }
.table-exam-empty p { max-width: 470px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.empty-table-glyph { position: relative; width: 150px; height: 82px; border: 8px solid #d9e1da; border-radius: 50%; background: #e8ede7; box-shadow: inset 0 0 0 2px white; }
.empty-table-glyph span { position: absolute; inset: 50% auto auto 50%; color: #70847e; font-family: "DM Mono", Consolas, monospace; font-size: 12px; font-weight: 700; transform: translate(-50%,-50%); }
.empty-table-glyph i { position: absolute; width: 25px; height: 14px; border-radius: 4px; background: #c9d2cb; }
.empty-table-glyph i:nth-of-type(1) { left: -24px; top: 26px; }
.empty-table-glyph i:nth-of-type(2) { right: 10px; top: -20px; }
.empty-table-glyph i:nth-of-type(3) { right: 10px; bottom: -20px; }
.table-exam-workbench { display: grid; grid-template-columns: 1fr; align-items: start; gap: 17px; }
.exam-table-panel { overflow: hidden; min-width: 0; padding: 18px; }
.exam-stage { min-width: 0; overflow: auto; padding: 63px 84px; scrollbar-width: thin; }
.exam-poker-table { position: relative; width: min(100%, 760px); min-width: 480px; aspect-ratio: 1.82; margin: 0 auto; border: 11px solid #224a44; border-radius: 50%; background:
  radial-gradient(circle at 50% 45%, rgba(255,255,255,.06), transparent 38%),
  linear-gradient(145deg, #287064, #19584f 72%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.15), inset 0 -22px 45px rgba(0,31,28,.18), 0 16px 35px rgba(19,54,50,.16); }
.exam-poker-table::after { content: ""; position: absolute; inset: 17px; border: 1px solid rgba(255,255,255,.13); border-radius: inherit; pointer-events: none; }
.exam-felt-mark { position: absolute; inset: 50% auto auto 50%; display: grid; width: 48%; justify-items: center; color: white; text-align: center; transform: translate(-50%,-50%); }
.exam-felt-mark > span { color: rgba(255,255,255,.48); font-family: "DM Mono", Consolas, monospace; font-size: 8px; letter-spacing: 2px; }
.exam-felt-mark strong { overflow: hidden; width: 100%; margin-top: 5px; font-size: clamp(13px,1.5vw,19px); text-overflow: ellipsis; white-space: nowrap; }
.exam-felt-mark small { margin-top: 8px; padding: 5px 11px; border-radius: 999px; color: #bce7da; background: rgba(5,42,38,.36); font-size: 9px; }
.exam-seat { position: absolute; z-index: 3; display: grid; grid-template-columns: 50px 1fr; align-items: center; gap: 11px; width: 164px; min-height: 74px; padding: 10px 12px; border: 1px solid #d8dfd9; border-radius: 14px; background: #fbfcf8; box-shadow: 0 10px 26px rgba(9,36,34,.16); }
.exam-avatar { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; color: #6b7977; background: #e5e9e4; font-family: "DM Mono", Consolas, monospace; font-size: 11px; font-weight: 700; }
.exam-seat strong, .exam-seat span { display: block; }
.exam-seat strong { font-family: "DM Mono", Consolas, monospace; font-size: 17px; line-height: 1; }
.exam-seat > div:nth-child(2) span { margin-top: 6px; color: var(--subtle); font-size: 11px; line-height: 1; }
.exam-seat.is-hero { color: white; border-color: #87cbb8; background: #123b3a; box-shadow: 0 0 0 3px rgba(142,210,189,.2), 0 10px 25px rgba(6,36,34,.25); }
.exam-seat.is-hero .exam-avatar { color: var(--forest); background: var(--mint); }
.exam-seat.is-hero > div:nth-child(2) span { color: rgba(255,255,255,.58); }
.exam-seat.is-folded { border-color: #e1e3de; background: #f1f2ee; box-shadow: 0 5px 14px rgba(9,36,34,.08); }
.exam-seat.is-folded .exam-avatar { color: #9aa39f; background: #e4e7e2; }
.exam-seat.is-folded > div:nth-child(2) span { color: #a05d4e; font-weight: 700; text-transform: uppercase; }
.exam-seat.is-raiser { border-color: #d5a64c; background: #fff8e7; box-shadow: 0 0 0 2px rgba(213,166,76,.13), 0 9px 22px rgba(9,36,34,.13); }
.exam-seat.is-raiser .exam-avatar { color: #fff8e7; background: #9a6b18; }
.exam-seat.is-raiser > div:nth-child(2) span { color: #986a17; font-weight: 750; text-transform: uppercase; }
.exam-seat-utg { right: 27%; top: 0; transform: translate(50%,-58%); }
.exam-seat-hj { right: 0; top: 50%; transform: translate(48%,-50%); }
.exam-seat-co { right: 27%; bottom: 0; transform: translate(50%,58%); }
.exam-seat-btn { left: 27%; bottom: 0; transform: translate(-50%,58%); }
.exam-seat-sb { left: 0; top: 50%; transform: translate(-48%,-50%); }
.exam-seat-bb { left: 27%; top: 0; transform: translate(-50%,-58%); }
.exam-hole-cards { position: absolute; z-index: -1; display: flex; gap: 2px; pointer-events: none; }
.exam-seat-bb .exam-hole-cards, .exam-seat-utg .exam-hole-cards { top: calc(100% - 13px); left: 50%; transform: translateX(-50%); }
.exam-seat-btn .exam-hole-cards, .exam-seat-co .exam-hole-cards { bottom: calc(100% - 3px); left: 50%; transform: translateX(-50%); }
.exam-seat-sb .exam-hole-cards { left: calc(100% - 3px); top: 50%; transform: translateY(-50%); }
.exam-seat-hj .exam-hole-cards { right: calc(100% - 3px); top: 50%; transform: translateY(-50%); }
.exam-posted-blind { position: absolute; z-index: 5; display: flex; align-items: center; gap: 7px; min-width: 70px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: white; background: rgba(8,47,43,.82); box-shadow: 0 5px 12px rgba(5,35,32,.2); pointer-events: none; }
.exam-posted-blind b { font-family: "DM Mono", Consolas, monospace; font-size: 12px; font-weight: 800; white-space: nowrap; }
.exam-posted-sb { left: calc(100% + 78px); top: 50%; transform: translateY(-50%); }
.exam-posted-bb { top: calc(100% + 58px); left: 50%; transform: translateX(-50%); }
.exam-chip-stack { position: relative; display: block !important; width: 22px; height: 18px; flex: none; }
.exam-chip-stack i { position: absolute; left: 0; width: 22px; height: 8px; border: 2px dashed rgba(255,255,255,.82); border-radius: 50%; background: #e2ad45; box-shadow: 0 2px 3px rgba(0,0,0,.2); }
.exam-chip-stack i:nth-child(1) { bottom: 0; }
.exam-chip-stack i:nth-child(2) { bottom: 5px; }
.exam-chip-stack i:nth-child(3) { bottom: 10px; }
.exam-posted-bb .exam-chip-stack i { background: #5a92c8; }
.exam-posted-raise { min-width: 78px; border-color: rgba(255,190,145,.4); background: rgba(92,42,30,.9); box-shadow: 0 6px 15px rgba(34,13,8,.3); }
.exam-posted-raise .exam-chip-stack i { background: #d76b50; }
.exam-posted-raise b { color: #fff4ed; font-size: 13px; letter-spacing: .02em; }
.exam-seat-bb > .exam-posted-raise, .exam-seat-utg > .exam-posted-raise { top: calc(100% + 58px); left: 50%; transform: translateX(-50%); }
.exam-seat-hj > .exam-posted-raise { right: calc(100% + 78px); top: 50%; transform: translateY(-50%); }
.exam-seat-co > .exam-posted-raise, .exam-seat-btn > .exam-posted-raise { bottom: calc(100% + 58px); left: 50%; transform: translateX(-50%); }
.exam-seat-sb > .exam-posted-raise { left: calc(100% + 78px); top: 50%; transform: translateY(-50%); }
.exam-playing-card { display: grid; width: 58px; height: 80px; grid-template-rows: auto 1fr; padding: 7px; border: 2px solid #d4d8d2; border-radius: 8px; color: #182423; background: #fff; box-shadow: 0 6px 14px rgba(0,0,0,.18); }
.exam-playing-card b { font-family: Georgia, serif; font-size: 23px; line-height: 1; }
.exam-playing-card i { align-self: end; justify-self: end; font-family: Georgia, serif; font-size: 28px; font-style: normal; line-height: 1; }
.exam-playing-card.suit-s { color: #192322; }
.exam-playing-card.suit-h { color: #d8493e; }
.exam-playing-card.suit-d { color: #3476d3; }
.exam-playing-card.suit-c { color: #27905a; }
.exam-playing-card.is-compact { width: 52px; height: 72px; padding: 5px; border-radius: 7px; }
.exam-playing-card.is-compact b { font-size: 20px; }
.exam-playing-card.is-compact i { font-size: 24px; }
.exam-card-back { width: 36px; height: 52px; border: 3px solid white; border-radius: 6px; background: repeating-linear-gradient(45deg,#d46d50 0 4px,#bd553d 4px 8px); box-shadow: 0 4px 9px rgba(0,0,0,.2); }
.dealer-button { position: absolute; right: -14px; bottom: -15px; z-index: 4; display: grid; width: 30px; height: 30px; place-items: center; border: 2px solid #d4d6d1; border-radius: 50%; color: #273936; background: white; box-shadow: 0 4px 10px rgba(0,0,0,.16); font-family: Georgia, serif; font-size: 12px; font-style: normal; font-weight: 700; }
.exam-decision-panel { position: static; display: grid; grid-template-columns: minmax(230px,.62fr) minmax(390px,1.38fr); gap: 15px; align-items: stretch; padding: 18px; }
.exam-overtime-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 42px; padding: 8px 10px 8px 14px; border: 1px solid #e2c98f; border-radius: 10px; color: #7b5b1b; background: #fff8e8; }
.exam-overtime-bar span { font-size: 10px; }
.exam-overtime-bar b { margin-right: 8px; font-size: 11px; }
.exam-overtime-bar button { min-height: 30px; padding: 0 11px; border: 1px solid #d8bd7c; border-radius: 7px; color: #765411; background: white; font-size: 9px; font-weight: 700; cursor: pointer; }
.exam-action-list { display: grid; grid-template-columns: 1fr; gap: 8px; align-content: start; }
.exam-action-button { --exam-action-color: #d9ddd6; position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 56px; overflow: hidden; padding: 0 14px 0 19px; border: 1px solid #dce1db; border-radius: 10px; color: var(--ink); background: #fff; font-size: 16px; font-weight: 750; cursor: pointer; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.exam-action-button::before { content: ""; position: absolute; inset: 0; background: var(--exam-action-color); opacity: 1; transform: scaleX(.018); transform-origin: left center; transition: transform .18s ease; }
.exam-action-button > span, .exam-action-button small { position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) {
  .exam-action-button:hover:not(:disabled) { border-color: var(--exam-action-color); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(26,52,50,.12); }
  .exam-action-button:hover:not(:disabled)::before { transform: scaleX(1); }
  .exam-action-button:hover:not(:disabled) small { background: rgba(255,255,255,.68); }
}
.exam-action-button small { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 7px; color: #53635f; background: #eef1ed; font-family: "DM Mono", Consolas, monospace; font-size: 10px; transition: background .16s ease; }
.exam-action-button:disabled { cursor: default; }
.exam-action-button.is-correct { border-color: #73af9f; background: #ebf7f1; }
.exam-action-button.is-wrong { border-color: #d98269; background: #fff0eb; }
.exam-action-button.is-chosen { box-shadow: 0 0 0 2px var(--exam-action-color); }
.exam-feedback { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 13px; min-width: 0; padding: 15px 17px; border: 1px solid #cfe4da; border-radius: 11px; background: #f0f8f4; }
.exam-feedback.is-wrong { border-color: #ecd0c6; background: #fff3ef; }
.exam-feedback-title { display: flex; align-items: center; gap: 12px; }
.exam-feedback-title > span { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 50%; color: white; background: #4f9683; font-size: 17px; }
.exam-feedback.is-wrong .exam-feedback-title > span { background: #c7654e; }
.exam-feedback-copy { min-width: 0; }
.exam-feedback-copy strong, .exam-feedback-copy b, .exam-feedback-copy small { display: block; }
.exam-feedback-copy strong { color: #245d51; font-size: 13px; }
.exam-feedback.is-wrong .exam-feedback-copy strong { color: #a24f3e; }
.exam-feedback-copy b { overflow: hidden; margin-top: 2px; font-family: "DM Mono", Consolas, monospace; font-size: 18px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.exam-feedback-copy small { margin-top: 5px; color: #5d7e77; font-size: 10px; font-weight: 650; }
.exam-frequency-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(79,115,107,.12); }
.exam-frequency-list > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; align-items: center; color: #536a65; font-size: 11px; font-weight: 650; }
.exam-frequency-list b { grid-column: 2; grid-row: 1; color: var(--ink); font-family: "DM Mono", Consolas, monospace; font-size: 14px; line-height: 1; text-align: right; }
.exam-frequency-list i { grid-column: 1 / -1; overflow: hidden; height: 8px; border-radius: 5px; background: rgba(20,48,44,.09); }
.exam-frequency-list em { display: block; height: 100%; border-radius: inherit; background: var(--exam-action-color); }
.exam-feedback-tools { grid-column: 2; grid-row: 1; display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px; margin: 0; padding: 0; border: 0; }
.exam-feedback-tool { min-height: 34px; padding: 0 13px; border: 1px solid #bed7ce; border-radius: 8px; color: #285f54; background: rgba(255,255,255,.72); font-size: 10px; font-weight: 700; cursor: pointer; }
.exam-feedback-tool:hover:not(:disabled) { border-color: #6eaa9a; background: white; }
.exam-feedback-tool:disabled { opacity: .48; cursor: default; }
.exam-feedback-tool#exam-mark-easy { color: #9a6a16; border-color: #e5cf9f; background: #fffaf0; }
.exam-feedback.is-wrong .exam-feedback-tool#exam-mark-easy { display: none; }
.exam-queue-complete { display: grid; min-height: 160px; place-content: center; justify-items: center; padding: 20px; border: 1px dashed #cbd9d2; border-radius: 12px; text-align: center; background: #f5f8f4; }
.exam-queue-complete > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: #37786a; background: #dceee7; font-size: 17px; }
.exam-queue-complete strong { margin-top: 10px; font-size: 14px; }
.exam-queue-complete p { max-width: 330px; margin: 6px 0 13px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.exam-queue-complete button { min-height: 36px; padding: 0 15px; border: 0; border-radius: 8px; color: white; background: var(--forest); font-size: 10px; font-weight: 700; cursor: pointer; }
.exam-next-button { width: 100%; margin-top: 13px; }

/* Learning progress */
.progress-heading { align-items: flex-end; }
.progress-filters { display: flex; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: 10px; }
.progress-filter { width: min(260px,100%); }
.progress-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 17px; }
.progress-summary-card { position: relative; display: grid; min-height: 126px; align-content: center; overflow: hidden; padding: 20px 22px; }
.progress-summary-card::after { content: ""; position: absolute; right: -23px; bottom: -34px; width: 90px; height: 90px; border-radius: 50%; background: #edf3ee; }
.progress-summary-card.is-due::after { background: #fff0e8; }
.progress-summary-card > span { color: var(--muted); font-size: 10px; font-weight: 650; }
.progress-summary-card > strong { position: relative; z-index: 1; margin-top: 7px; color: var(--forest); font-family: "DM Mono", Consolas, monospace; font-size: 27px; line-height: 1; }
.progress-summary-card > small { position: relative; z-index: 1; margin-top: 9px; color: var(--subtle); font-size: 9px; }
.progress-summary-card.is-due > strong { color: #bd654f; }
.progress-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 17px; align-items: start; }
.progress-ranges-panel, .progress-schedule-panel { padding: 21px; }
.progress-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.progress-panel-heading h2 { margin: 4px 0 0; font-size: 17px; }
.progress-panel-heading > span { color: var(--muted); font-size: 10px; }
.progress-groups { display: grid; gap: 19px; }
.progress-group { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fbfcf9; }
.progress-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: #f1f4ef; }
.progress-group-heading > div { min-width: 0; }
.progress-group-heading h3 { overflow: hidden; margin: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.progress-group-heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.progress-group-heading > strong { color: #315f56; font-family: "DM Mono", Consolas, monospace; font-size: 13px; }
.progress-range-head, .progress-range-row { display: grid; grid-template-columns: minmax(150px,1.4fr) 75px minmax(120px,1fr) 64px 72px 112px; gap: 12px; align-items: center; }
.progress-range-head { padding: 9px 15px; color: var(--subtle); font-size: 8px; letter-spacing: .5px; text-transform: uppercase; }
.progress-range-row { min-height: 59px; padding: 10px 15px; border-top: 1px solid #edf0eb; }
.progress-range-row > strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.progress-range-row > span { color: var(--muted); font-size: 9px; }
.progress-range-bar { display: grid; grid-template-columns: 1fr 38px; gap: 7px; align-items: center; }
.progress-range-bar i { overflow: hidden; height: 7px; border-radius: 999px; background: #e8ece7; }
.progress-range-bar em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#68ab99,#2e786b); }
.progress-range-bar b { color: #315f56; font-family: "DM Mono", Consolas, monospace; font-size: 9px; text-align: right; }
.progress-range-due { color: #b75d48 !important; font-weight: 700; }
.progress-empty { display: grid; min-height: 280px; place-content: center; justify-items: center; text-align: center; }
.progress-empty > span { color: #8bb1a7; font-size: 33px; }
.progress-empty strong { margin-top: 9px; font-size: 14px; }
.progress-empty p { max-width: 360px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.progress-next-review { padding: 16px; border-radius: 12px; color: white; background: linear-gradient(145deg,#184f49,#103b39); box-shadow: 0 10px 24px rgba(18,61,58,.13); }
.progress-next-review span, .progress-next-review small { display: block; color: rgba(255,255,255,.62); font-size: 9px; }
.progress-next-review strong { display: block; margin: 7px 0 4px; font-size: 17px; }
.progress-schedule-list { display: grid; gap: 2px; margin-top: 15px; }
.progress-schedule-list > div { display: grid; grid-template-columns: 9px 1fr auto; gap: 10px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.progress-schedule-list i { width: 8px; height: 8px; border-radius: 50%; background: #d7ddd8; }
.progress-schedule-list i.is-now { background: #ce6b53; }
.progress-schedule-list i.is-today { background: #e3ad45; }
.progress-schedule-list i.is-week { background: #66a696; }
.progress-schedule-list span b, .progress-schedule-list span small { display: block; }
.progress-schedule-list span b { font-size: 10px; }
.progress-schedule-list span small { margin-top: 3px; color: var(--subtle); font-size: 8px; }
.progress-schedule-list > div > strong { font-family: "DM Mono", Consolas, monospace; font-size: 16px; }
.progress-daily-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 17px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.progress-daily-heading strong { font-size: 11px; }
.progress-daily-heading small { color: var(--subtle); font-size: 8px; }
.progress-daily-list { display: grid; max-height: 430px; overflow-y: auto; scrollbar-gutter: stable; }
.progress-daily-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; min-height: 42px; padding: 7px 5px; border-bottom: 1px solid var(--line); }
.progress-daily-row span { display: flex; align-items: baseline; gap: 7px; }
.progress-daily-row b { color: var(--muted); font-size: 10px; font-weight: 700; }
.progress-daily-row small { color: var(--subtle); font-size: 8px; }
.progress-daily-row > strong { min-width: 28px; color: var(--subtle); font-family: "DM Mono", Consolas, monospace; font-size: 13px; text-align: right; }
.progress-daily-row.has-reviews b { color: var(--text); }
.progress-daily-row.has-reviews > strong { color: #78c7b2; font-size: 16px; }
.progress-schedule-later { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px 5px; border-bottom: 1px solid var(--line); }
.progress-schedule-later span b, .progress-schedule-later span small { display: block; }
.progress-schedule-later span b { font-size: 10px; }
.progress-schedule-later span small { margin-top: 3px; color: var(--subtle); font-size: 8px; }
.progress-schedule-later > strong { font-family: "DM Mono", Consolas, monospace; font-size: 16px; }
.progress-schedule-tip { margin: 15px 0 0; padding: 12px; border-radius: 10px; color: var(--muted); background: #eef2ed; font-size: 9px; line-height: 1.65; }

.toast { position: fixed; z-index: 200; left: 50%; bottom: 24px; max-width: min(420px, calc(100% - 30px)); padding: 11px 16px; border-radius: 9px; color: white; background: #153b39; box-shadow: 0 12px 32px rgba(0,0,0,.18); font-size: 10px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #9a4c3c; }

@media (max-width: 1380px) {
  #page-table-exam, #page-overtime { padding-right: 30px; padding-left: 30px; }
}

@media (max-width: 1200px) {
  .table-exam-workbench { grid-template-columns: 1fr; }
  .exam-decision-panel { position: static; }
}

@media (max-width: 1120px) {
  .setup-bar, .setup-bar.is-strategy { grid-template-columns: 1fr 1fr; }
  .setup-training-actions { grid-column: 1 / -1; }
  .mode-help { display: none; }
  .range-group-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .weak-list { grid-template-columns: repeat(2,1fr); }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .action-sidebar { grid-template-columns: 72px 150px minmax(250px,1fr); }
  .sidebar-brush { grid-column: 1 / -1; display: grid; grid-template-columns: 145px 1fr 210px; align-items: center; gap: 8px; padding: 8px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .sidebar-brush > span { margin: 0; }
  .sidebar-custom-weight { margin: 0; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-actions { grid-column: auto; }
  .table-exam-heading { align-items: flex-start; flex-direction: column; }
  .exam-score-strip { width: 100%; min-width: 0; }
  .table-exam-setup { grid-template-columns: 1fr 1fr; }
  .overtime-setup { grid-template-columns: 1fr; }
  .overtime-setup > .btn { width: 100%; }
  .table-exam-setup .exam-auto-position { border-left: 0; padding-left: 0; }
  .table-exam-setup > .btn { width: 100%; }
  .exam-decision-panel { grid-template-columns: minmax(210px,.7fr) minmax(330px,1.3fr); }
  .progress-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .progress-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --sidebar-width: 0px; --hand-font-size: var(--hand-font-mobile); --editor-ui-font: calc(var(--hand-font-mobile) * .72); }
  .sidebar { inset: 61px 12px auto; width: auto; padding: 16px; border-radius: 14px; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: .18s ease; box-shadow: 0 18px 50px rgba(0,0,0,.2); }
  .sidebar.is-open { opacity: 1; pointer-events: auto; transform: none; }
  .sidebar > .brand, .sidebar-note, .sidebar-footer { display: none; }
  .nav-list { margin: 0; }
  .nav-item.is-active::before { left: -16px; }
  .mobile-header { position: sticky; z-index: 60; top: 0; display: flex; align-items: center; justify-content: space-between; height: 62px; padding: 0 18px; color: white; background: var(--forest-2); }
  .mobile-header .brand { padding: 0; }
  .mobile-menu { display: grid; gap: 4px; width: 35px; height: 35px; place-content: center; border: 0; border-radius: 8px; background: rgba(255,255,255,.08); }
  .mobile-menu span { width: 15px; height: 1px; background: #fff; }
  .page { padding: 26px 15px 50px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .page-heading h1 { font-size: 29px; }
  .page-heading > .btn { width: 100%; }
  .page-heading .heading-actions { width: 100%; }
  .page-heading .heading-actions .btn { flex: 1; }
  .stat-grid { gap: 9px; }
  .stat-card { min-height: 119px; padding: 15px; }
  .stat-card > strong { font-size: 24px; }
  .recent-panel, .weak-panel { padding: 17px; }
  .weak-list { grid-template-columns: 1fr; }
  .practice-banner { grid-template-columns: 1fr; padding: 25px; }
  .banner-art { display: none; }
  .practice-banner .btn { width: fit-content; }
  .timer-card { position: absolute; right: 15px; top: 32px; }
  .trainer-heading { position: relative; }
  .trainer-heading > div:first-child { padding-right: 90px; }
  .setup-bar { grid-template-columns: 1fr; align-items: stretch; gap: 12px; }
  .setup-bar.is-strategy { grid-template-columns: 1fr; }
  .compact-field select { min-width: 0; }
  .setup-training-actions { grid-column: auto; }
  .setup-training-actions .btn { flex: 1; }
  .segmented button { flex: 1; }
  .setup-bar .btn { width: 100%; }
  .workbench-top { align-items: flex-start; flex-wrap: wrap; }
  .strategy-trainer-tools { order: 3; width: 100%; align-items: stretch; flex-direction: column; }
  .strategy-action-palette { overflow-x: auto; }
  .strategy-training-brush { width: 100%; }
  .brush-bar { order: 3; width: 100%; overflow-x: auto; }
  .brush-bar button { flex: 1; min-width: 45px; }
  .custom-brush { min-width: 64px; border-left: 0; background: #eef1ec; border-radius: 6px; }
  .matrix-scroll { padding: 7px; }
  .range-matrix { gap: 1px; }
  .matrix-caption { overflow-x: auto; white-space: nowrap; }
  .trainer-actions .btn { flex: 1; min-width: 0; }
  .result-score { grid-template-columns: auto 1fr; }
  .result-score .btn { grid-column: 1 / -1; }
  .mistake-groups { grid-template-columns: 1fr; }
  .library-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .format-tip { width: 100%; justify-content: space-between; }
  .range-group-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-three { grid-template-columns: 1fr; }
  .modal-card { padding: 23px 18px; }
  .detail-range-header { padding-right: 34px; }
  .detail-range-footer { position: sticky; z-index: 4; bottom: -1px; align-items: stretch; flex-direction: column; gap: 8px; margin: 10px -6px -4px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: rgba(18,27,29,.96); box-shadow: 0 -9px 24px rgba(0,0,0,.24); backdrop-filter: blur(8px); }
  .detail-range-compare { grid-template-columns: auto minmax(0,1fr) 46px; }
  .detail-range-switcher { width: 100%; }
  .detail-range-footer .modal-actions { display: flex; width: 100%; }
  .detail-range-footer .modal-actions .btn { flex: 1; min-width: 0; }
  .detail-compare-hold { min-width: 46px; width: 46px; min-height: 44px; padding: 0; }
  .detail-compare-hold svg { width: 21px; height: 21px; }
  .exam-mistake-card { padding: 27px 18px 20px; }
  .exam-mistake-summary { grid-template-columns: 1fr; }
  .exam-mistake-frequency { grid-template-columns: 1fr; }
  .builder-import-fields { grid-template-columns: 1fr; }
  .builder-import-fields .btn { width: 100%; }
  .action-sidebar { grid-template-columns: 1fr; align-items: stretch; }
  .action-editor-list { display: grid; grid-template-columns: 1fr; overflow: visible; }
  .action-editor { width: 100%; }
  .sidebar-brush { grid-column: auto; display: block; padding: 10px 0 0; border-top: 1px solid var(--line); }
  .sidebar-brush > span { margin-bottom: 7px; }
  .brush-presets { grid-template-columns: repeat(3,1fr); }
  .sidebar-custom-weight { margin-top: 6px; }
  .builder-matrix { min-width: 0; }
  .builder-caption { align-items: flex-start; }
  .builder-action-percentages { flex-wrap: nowrap; }
  .builder-actions { flex-wrap: wrap; }
  .builder-actions > span { display: none; }
  .builder-actions .btn { flex: 1; }
  .settings-card { padding: 18px; }
  .settings-card-heading { flex-direction: column; }
  .settings-add-action { width: 100%; }
  .font-control { grid-template-columns: 1fr 60px; }
  .font-control input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
  .font-control output { grid-column: 2; grid-row: 1; }
  .settings-preview-cells { grid-template-columns: repeat(3, minmax(65px, 1fr)); }
  .settings-weight-preview { flex-wrap: wrap; }
  .settings-weight-preview strong { width: 100%; }
  .settings-action-row { grid-template-columns: 38px minmax(0, 1fr) 30px; }
  .settings-action-kind { grid-column: 2; width: fit-content; }
  .settings-delete-action { grid-column: 3; grid-row: 1; }
  .settings-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .table-exam-heading { gap: 17px; }
  .exam-score-strip { width: 100%; min-width: 0; }
  .exam-score-strip > span { min-width: 0; flex: 1; padding: 9px 4px; }
  .exam-score-strip small { font-size: 8px; }
  .table-exam-setup { grid-template-columns: 1fr; padding: 15px; }
  .overtime-setup { grid-template-columns: 1fr; padding: 15px; }
  .overtime-category-heading { align-items: flex-start; }
  .overtime-category-list { grid-template-columns: 1fr 1fr; }
  .exam-overtime-bar { align-items: flex-start; flex-direction: column; }
  .exam-position-field { width: 100%; }
  .exam-auto-position { min-height: 36px; padding: 0; border-left: 0; }
  .table-exam-setup .btn { width: 100%; }
  .table-exam-empty { min-height: 360px; padding: 30px 18px; }
  .exam-table-panel { padding: 0; }
  .exam-table-panel .exam-stage {
    display: grid;
    min-height: 0;
    overflow: hidden;
    padding: 76px 30px 94px;
    place-items: center;
    background: radial-gradient(circle at 50% 38%, rgba(31,96,122,.24), transparent 58%);
  }
  .exam-stage .exam-poker-table {
    --mobile-seat-size: clamp(52px, 10vw, 72px);
    --mobile-card-width: clamp(24px, 4.2vw, 30px);
    --mobile-card-height: clamp(34px, 6vw, 43px);
    width: min(100%, 500px);
    min-width: 0;
    aspect-ratio: 500 / 323;
    border: clamp(7px, 1.4vw, 10px) solid #002f41;
    border-radius: 999px;
    background: linear-gradient(145deg, #28738f, #226a88 72%);
    box-shadow: inset 0 -18px 34px rgba(0,35,48,.2), 0 13px 28px rgba(0,0,0,.34);
  }
  .exam-stage .exam-poker-table::after { display: none; }
  .exam-felt-mark { width: 58%; }
  .exam-felt-mark > span { font-size: 6px; letter-spacing: 1.5px; }
  .exam-felt-mark strong { margin-top: 3px; font-size: 12px; }
  .exam-felt-mark small { margin-top: 5px; padding: 3px 6px; font-size: 0px; }
  .exam-poker-table .exam-seat {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
    width: var(--mobile-seat-size);
    min-height: var(--mobile-seat-size);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .exam-poker-table .exam-avatar {
    width: var(--mobile-seat-size);
    height: var(--mobile-seat-size);
    border: clamp(3px, .55vw, 4px) solid #002f41;
    color: #b8d1ce;
    background: #226a88;
    box-shadow: 0 4px 10px rgba(0,0,0,.34);
    font-size: 0px;
  }
  .exam-poker-table .exam-seat > div:nth-child(2) {
    position: absolute;
    z-index: 7;
    top: calc(var(--mobile-seat-size) - 13px);
    left: 50%;
    display: grid;
    min-width: 42px;
    max-width: 92px;
    justify-items: center;
    padding: 0;
    color: #e9f3f0;
    background: transparent;
    text-align: center;
    transform: translateX(-50%);
  }
  .exam-poker-table .exam-seat strong,
  .exam-poker-table .exam-seat > div:nth-child(2) span {
    display: block;
    width: max-content;
    max-width: 92px;
    overflow: hidden;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(0,47,65,.86);
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .exam-poker-table .exam-seat strong { color: #58b5dc; font-size: 10px; }
  .exam-poker-table .exam-seat > div:nth-child(2) span { margin-top: 1px; color: #f3e03b; font-size: 9px; }
  .exam-poker-table .exam-seat.is-hero,
  .exam-poker-table .exam-seat.is-folded,
  .exam-poker-table .exam-seat.is-raiser { border: 0; background: transparent; box-shadow: none; }
  .exam-poker-table .exam-seat.is-hero .exam-avatar { border-color: #47a9d1; color: transparent; background: #226a88; box-shadow: 0 0 0 3px rgba(71,169,209,.16), 0 4px 12px rgba(0,0,0,.38); }
  .exam-poker-table .exam-seat.is-hero > div:nth-child(2) { background: transparent; }
  .exam-poker-table .exam-seat.is-folded { opacity: 1; }
  .exam-poker-table .exam-seat.is-folded .exam-avatar { border-color: #002f41; color: transparent; background: #226a88; box-shadow: 0 4px 10px rgba(0,0,0,.28); }
  .exam-poker-table .exam-seat.is-raiser .exam-avatar { border-color: #47a9d1; color: transparent; background: #226a88; }
  .exam-poker-table .exam-seat.is-raiser > div:nth-child(2) { color: inherit; background: transparent; }
  .exam-seat-bb { left: 25%; top: 0; transform: translate(-50%,-56%); }
  .exam-seat-utg { right: 25%; top: 0; transform: translate(50%,-56%); }
  .exam-seat-sb { left: 0; top: 50%; transform: translate(-50%,-50%); }
  .exam-seat-hj { right: 0; top: 50%; transform: translate(50%,-50%); }
  .exam-seat-btn { left: 25%; bottom: 0; transform: translate(-50%,56%); }
  .exam-seat-co { right: 25%; bottom: 0; transform: translate(50%,56%); }
  .exam-poker-table .exam-hole-cards { z-index: 6; top: clamp(5px, 1vw, 8px); right: auto; bottom: auto; left: 50%; gap: 1px; transform: translateX(-50%); }
  .exam-playing-card { width: var(--mobile-card-width); height: var(--mobile-card-height); padding: 2px; border-width: 1px; border-radius: 4px; box-shadow: 0 3px 8px rgba(0,0,0,.3); }
  .exam-playing-card b { font-size: 12px; }
  .exam-playing-card i { font-size: 13px; }
  .exam-playing-card.is-compact { width: var(--mobile-card-width); height: var(--mobile-card-height); padding: 2px; border-radius: 4px; }
  .exam-playing-card.is-compact b { font-size: 11px; }
  .exam-playing-card.is-compact i { font-size: 12px; }
  .exam-card-back { width: var(--mobile-card-width); height: var(--mobile-card-height); border-width: 1px; border-radius: 4px; }
  .exam-posted-blind { gap: 3px; min-width: 0; padding: 3px 6px; border-color: rgba(71,169,209,.28); border-radius: 4px; background: rgba(0,47,65,.86); }
  .exam-posted-blind b { font-size: 10px; }
  .exam-chip-stack { width: 10px; height: 8px; }
  .exam-chip-stack i { width: 10px; height: 4px; border-width: 1px; }
  .exam-chip-stack i:nth-child(2) { bottom: 3px; }
  .exam-chip-stack i:nth-child(3) { bottom: 6px; }
  .exam-posted-sb { left: calc(100% + 8px); top: calc(50% + 25px); }
  .exam-posted-bb { top: calc(100% + 2px); }
  .exam-posted-raise { min-width: 0; }
  .exam-posted-raise b { font-size: 9px; }
  .exam-seat-bb > .exam-posted-raise { top: 18px; left: calc(100% + 4px); transform: none; }
  .exam-seat-utg > .exam-posted-raise { top: 18px; right: calc(100% + 4px); left: auto; transform: none; }
  .exam-seat-hj > .exam-posted-raise { right: calc(100% + 4px); top: 18px; transform: none; }
  .exam-seat-co > .exam-posted-raise { right: calc(100% + 4px); bottom: 15px; left: auto; transform: none; }
  .exam-seat-btn > .exam-posted-raise { bottom: 15px; left: calc(100% + 4px); transform: none; }
  .exam-seat-sb > .exam-posted-raise { left: calc(100% + 4px); top: 18px; transform: none; }
  .dealer-button { right: -5px; bottom: -5px; width: 18px; height: 18px; border-width: 1px; font-size: 8px; }
  .exam-decision-panel { padding: 18px; }
  .exam-decision-panel { grid-template-columns: 1fr; }
  .exam-feedback { grid-template-columns: 1fr; }
  .exam-feedback-tools { grid-column: 1; grid-row: 2; justify-content: flex-start; margin-top: 10px; }
  .exam-frequency-list { grid-column: 1; grid-row: 3; gap: 8px; }
  .progress-filters { width: 100%; flex-direction: column; align-items: stretch; }
  .progress-filter { width: 100%; }
  .progress-summary-grid { gap: 9px; }
  .progress-summary-card { min-height: 112px; padding: 16px; }
  .progress-summary-card > strong { font-size: 22px; }
  .progress-ranges-panel, .progress-schedule-panel { padding: 16px; }
  .progress-range-head { display: none; }
  .progress-range-row { grid-template-columns: minmax(0,1fr) auto; gap: 7px 12px; padding: 13px; }
  .progress-range-row > strong { font-size: 12px; }
  .progress-range-row .progress-range-bar { grid-column: 1 / -1; grid-row: 2; }
  .progress-range-row > span:nth-last-child(-n+3) { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Mistake reinforcement */
.mistakes-heading { margin-bottom: 18px; }
.mistakes-filter { display: grid; grid-template-columns: minmax(190px,1fr) 180px 180px auto; align-items: end; gap: 14px; margin-bottom: 14px; padding: 18px 20px; }
.mistakes-filter-copy { align-self: center; }
.mistakes-filter-copy strong, .mistakes-filter-copy span { display: block; }
.mistakes-filter-copy strong { font-size: 14px; }
.mistakes-filter-copy span { margin-top: 4px; color: var(--subtle); font-size: 9px; }
.number-suffix { position: relative; }
.number-suffix input { padding-right: 36px; }
.number-suffix > span { position: absolute; right: 12px; top: 50%; color: var(--subtle); font-size: 10px; transform: translateY(-50%); pointer-events: none; }
.mistakes-summary { min-height: 38px; margin: 0 3px 15px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.mistakes-summary strong { color: var(--mint); font-family: "DM Mono",Consolas,monospace; font-size: 13px; }
.range-card.mistake-range-card { border-color: #593c38; }
.mistake-match-badge { flex: none; padding: 5px 8px; border-radius: 999px; color: #f1a28e; background: #38231f; font-size: 9px; font-weight: 700; }
.mistake-category-label { overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mistakes-detail-card { width: min(1020px,100%); }
.mistakes-detail-summary strong { margin-left: 3px; color: var(--ink); font-family: "DM Mono",Consolas,monospace; }
.mistakes-legend { display: flex; flex-wrap: wrap; gap: 13px; margin: 4px 2px 10px; color: var(--muted); font-size: 9px; }
.mistakes-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mistakes-legend i { width: 13px; height: 13px; border: 2px solid #ef846b; border-radius: 3px; }
.mistakes-legend b { color: #eea18e; }
.mistakes-matrix-scroll { overflow-x: auto; }
.mistakes-matrix { min-width: 850px; gap: 4px; }
.mistakes-grid-loading { grid-column: 1 / -1; display: grid; min-height: 300px; place-items: center; color: var(--muted); font-size: 11px; }
.mistakes-grid-loading.is-error { color: #f0a08c; }
.mistakes-matrix .mistake-stat-cell { overflow: visible; aspect-ratio: 1.22; cursor: default; }
.mistakes-matrix .mistake-stat-cell:hover { transform: none; }
.mistake-stat-tooltip { position: absolute; z-index: 30; left: 50%; top: calc(100% + 6px); display: flex; width: max-content; max-width: 210px; gap: 8px; padding: 8px 10px; border: 1px solid #405255; border-radius: 7px; color: #dbe7e4; background: #0b1416; box-shadow: 0 8px 22px rgba(0,0,0,.45); font-family: "DM Mono",Consolas,monospace; font-size: 9px; font-weight: 500; line-height: 1.35; opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(-3px); transition: opacity .12s ease, transform .12s ease, visibility .12s; pointer-events: none; }
.mistake-stat-tooltip b { font-weight: 600; white-space: nowrap; }
.mistake-stat-tooltip b:nth-child(2) { color: #f0a08c; }
.mistake-stat-cell:hover .mistake-stat-tooltip,
.mistake-stat-cell:focus-visible .mistake-stat-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mistake-stat-cell:nth-child(13n+1) .mistake-stat-tooltip { left: 0; transform: translateY(-3px); }
.mistake-stat-cell:nth-child(13n+1):hover .mistake-stat-tooltip,
.mistake-stat-cell:nth-child(13n+1):focus-visible .mistake-stat-tooltip { transform: translateY(0); }
.mistake-stat-cell:nth-child(13n) .mistake-stat-tooltip { right: 0; left: auto; transform: translateY(-3px); }
.mistake-stat-cell:nth-child(13n):hover .mistake-stat-tooltip,
.mistake-stat-cell:nth-child(13n):focus-visible .mistake-stat-tooltip { transform: translateY(0); }
.mistake-stat-cell.is-matching { z-index: 1; border: 2px solid #ef846b; box-shadow: 0 0 0 2px rgba(239,132,107,.2), inset 0 0 20px rgba(200,82,58,.09); }
.mistake-stat-cell.is-matching:hover,
.mistake-stat-cell.is-matching:focus-visible { z-index: 20; }

@media (max-width: 760px) {
  .mistakes-filter { grid-template-columns: 1fr 1fr; }
  .mistakes-filter-copy { grid-column: 1 / -1; }
  .mistakes-filter .btn { grid-column: 1 / -1; width: 100%; }
  .mistakes-detail-card { padding-inline: 14px; }
}

/* Dark theme */
body {
  background:
    radial-gradient(circle at 82% -12%, rgba(45,121,105,.13), transparent 34%),
    radial-gradient(circle at 12% 96%, rgba(73,105,119,.09), transparent 30%),
    var(--canvas);
}
::selection { color: #071311; background: var(--mint); }
.sidebar { background: radial-gradient(circle at 10% 92%, rgba(123,212,182,.11), transparent 27%), linear-gradient(168deg,#102d2d,#07191b 72%); border-right-color: #213335; }
.main-content { background: linear-gradient(160deg,rgba(255,255,255,.012),transparent 38%); }
.eyebrow { color: #78a69d; }
.panel,
.stat-card,
.range-card,
.exam-score-strip { border-color: var(--line); background: rgba(19,28,30,.94); box-shadow: 0 12px 38px rgba(0,0,0,.2); }
.stat-card.stat-accent { background: linear-gradient(145deg,#17483f,#102f2c); }
.stat-icon { color: #8caaa4; background: #1d2b2d; }
.pill-warm { color: #f1a188; background: var(--coral-soft); }
td { border-bottom-color: #202e30; }
.score-good { color: #77ceb3; }
.mode-tag { color: #8fc9b8; background: #17342f; }
.weak-item,
.mistake-group { background: #172124; }
.weak-hand,
.mistake-chip { color: var(--ink); border-color: #304144; background: #202c2f; }
.weak-bar { background: #2a383a; }
.practice-banner { background: linear-gradient(105deg,#123d38,#174e46); box-shadow: 0 18px 40px rgba(0,0,0,.25); }
.btn-primary { color: #f7fffc; background: #267765; box-shadow: 0 9px 22px rgba(0,0,0,.25); }
.btn-primary:hover { background: #2f8b76; box-shadow: 0 11px 28px rgba(0,0,0,.32); }
.btn-light { color: #a5dfce; border-color: #35504e; background: #182628; }
.btn-ghost { color: var(--ink); border-color: var(--line); background: #182225; }
.btn-ghost:hover { background: #202e31; }
.btn-danger { color: #f29a82; border-color: #6b4038; background: #271d1c; }
.btn-danger:hover { color: #ffc0ae; border-color: #995746; background: #392522; }
.text-btn,
.practice-link { color: #87cdb9; }

.field > span,
.mode-control legend,
.overtime-category-heading span { color: #a7b6b3; }
.field input,
.field textarea,
.field select,
.settings-action-name { color: var(--ink); border-color: #344548; background: #111a1c; }
.field input:focus,
.field textarea:focus,
.field select:focus,
.settings-action-name:focus { border-color: #559c89; box-shadow: 0 0 0 3px rgba(85,156,137,.16); }
input::placeholder,
textarea::placeholder { color: #657572; }
select option { color: var(--ink); background: #111a1c; }
.segmented { border-color: #344548; background: #0f181a; }
.segmented button.is-active { color: #b9eadc; background: #223134; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
#random-training.is-active { color: #a9e1d1; border-color: #4e8e7d; background: #17362f; }
.mode-help > span,
.weight-rule > span { border-color: #415356; color: #91aaa5; }
.matrix-ghost::before { background: repeating-linear-gradient(90deg,#263537 0 12px,transparent 12px 14px),repeating-linear-gradient(#263537 0 12px,transparent 12px 14px); }
.session-title > span:last-child { color: #9bc8bb; background: #1c3430; }
.brush-bar,
.strategy-action-btn { border-color: var(--line); background: #151f22; }
.brush-bar button:hover { background: #223033; }
.brush-bar button.is-active,
.custom-brush.is-active,
.brush-presets button.is-active { color: #f7fffc; background: #267765; }
.strategy-action-btn.is-active { color: var(--ink); }
.range-cell { color: #d9e4e1; border-color: #314144; background: #182225; }
.range-cell::before { background: var(--type-bg,#1a2527); }
.range-cell.pair { --type-bg: #202b2d; }
.range-cell.suited { --type-bg: #172723; }
.range-cell.offsuit { --type-bg: #29231f; }
.range-cell:hover { border-color: #668f87; box-shadow: 0 5px 15px rgba(0,0,0,.35); }
.range-cell.is-selected { color: #0b2822; border-color: #76c2ac; }
.range-cell .cell-weight { color: rgba(219,242,234,.7); }
.range-cell.strategy-cell { color: #14211f; text-shadow: 0 1px rgba(255,255,255,.38); }
.range-cell.strategy-cell.is-default-only { color: #dce6e3; text-shadow: none; }
.range-cell.strategy-cell .cell-weight { color: #172723; background: rgba(243,248,245,.7); }
.legend-cell { border-color: #3b4a4c; }
.legend-cell.pair { background: #202b2d; }
.legend-cell.suited { background: #172723; }
.legend-cell.offsuit { background: #29231f; }
.score-ring { background: conic-gradient(var(--mint) var(--score),#283638 0); }
.range-cell.feedback.status-correct.is-answer { color: #cce8df; border-color: #4b907c; background: #17352e; }
.range-cell.feedback.status-missing { color: #f3c18a; border-color: #d88b43; background: #392c1d; box-shadow: inset 0 0 0 1px #584126; }
.range-cell.feedback.status-extra { color: #f0a08c; border-color: #c95d48; background: #3a2321; }
.range-cell.feedback.status-frequency { color: #c6b9e8; border-color: #8475ae; background: #2d2940; }

.format-tip code,
.range-group-heading > span,
.preview-summary span { color: #94aaa5; background: #1c292b; }
.range-card { background: #141e20; }
.range-meta { border-color: #29383a; }
.mini-btn:hover { color: #91d2bf; background: #1d2c2e; }
.library-empty { border-color: #3a4b4d; }
.modal-backdrop { background: rgba(2,8,9,.76); }
.modal-card { color: var(--ink); border: 1px solid #2e3f42; background: #121b1d; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.modal-close { color: #a8b7b4; background: #202c2f; }
.detail-range-switcher select { border-color: #344548; background: #1a2527; }
.detail-compare-hold { color: #9ed5c5; border-color: #426f64; background: #1c302c; }
.detail-compare-hold:not(:disabled):hover { background: #244038; }
.detail-compare-hold.is-active { color: #071512; background: var(--mint); }
.detail-compare-hold:disabled { color: #637673; border-color: #304043; background: #182225; }
.exam-mistake-card { border-color: #75443b; background: #1b1717; }
.exam-mistake-card h2 { color: #f29a82; }
.exam-mistake-card .eyebrow { color: #d97860; }
.exam-mistake-summary > span { border-color: #344548; background: #202a2c; }
.exam-mistake-summary > span:first-child { border-color: #6e4037; background: #352220; }
.builder-import-panel,
.builder-matrix-scroll,
.action-sidebar,
.font-control,
.font-preview,
.settings-action-row,
.settings-note { border-color: var(--line); background: #172124; }
.builder-action-percentage,
.default-action-editor,
.action-editor,
.brush-presets button,
.sidebar-custom-weight,
.settings-weight-preview button,
.font-control output { color: var(--muted); border-color: #344548; background: #202b2e; }
.action-editor.is-active { border-color: #5e9b8a; background: #233235; box-shadow: 0 0 0 2px rgba(94,155,138,.14); }
.action-color,
.settings-action-color { border-color: #d3ddda; }
.action-select { border-color: #344548; background: #1a2527; }
.parse-status { color: #9cadab; background: #1a2527; }
.parse-status.is-good { color: #99d8c5; background: #16362f; }
.parse-status.is-error { color: #efa18c; background: #39231f; }
.status-symbol { background: rgba(255,255,255,.08); }
.preview-summary .category-summary { color: #a3d7c8; background: #17362f; }
.preview-summary .comparison-summary { color: #f1d093; background: #3b2e1c; }
.preview-summary .action-summary { background: #202b2e; }
.action-sidebar-heading button { color: #a1d7c7; background: #1b3832; }
.settings-action-row.is-default { background: #192426; }
.settings-action-kind { color: #9aaba7; background: #223033; }
.settings-action-row:not(.is-default) .settings-action-kind { color: #9bd3c3; background: #18362f; }

.exam-score-strip strong,
.progress-summary-card > strong { color: var(--mint); }
.overtime-category-heading button,
.overtime-category-choice span { color: #afbfbc; border-color: #344548; background: #141e20; }
.overtime-category-choice input:checked + span { color: #b8e8da; border-color: #559985; background: #18372f; }
.overtime-category-choice b { color: #9fb5b0; background: rgba(123,212,182,.09); }
.overtime-date-heading > div span { color: #a7b6b3; }
.overtime-date-heading > label { color: #a8daca; }
.overtime-date-choice span { color: #afbfbc; border-color: #344548; background: #141e20; }
.overtime-date-choice input:checked + span { color: #b8e8da; border-color: #559985; background: #18372f; }
.overtime-new-option { border-color: #69542f; background: #2b2519; }
.overtime-new-option b { color: #e3c37d; }
.overtime-new-option small { color: #a9966e; }
.exam-category-picker,
.exam-range-picker { border-color: #344548; background: #141e20; }
.exam-category-choice,
.exam-range-choice { color: #afbfbc; border-color: #344548; background: #172124; }
.exam-category-choice:has(input:checked),
.exam-range-choice:has(input:checked) { color: #b8e8da; border-color: #559985; background: #18372f; }
.exam-category-choice input,
.exam-range-choice input { accent-color: #78cbb5; }
.exam-category-picker-field small,
.exam-range-picker-field small { color: #839692; }
.exam-auto-position strong { color: #91b7af; }
.empty-table-glyph { border-color: #304245; background: #1a282a; box-shadow: inset 0 0 0 2px #0f191b; }
.empty-table-glyph i { background: #344649; }
.empty-table-glyph span { color: #91a6a1; }
.exam-table-panel { background: #10191b; }
.exam-stage { background: radial-gradient(circle at 50% 50%,rgba(47,117,102,.07),transparent 55%); }
.exam-poker-table { border-color: #193d39; background: radial-gradient(circle at 50% 45%,rgba(255,255,255,.045),transparent 38%),linear-gradient(145deg,#1e6257,#12473f 72%); box-shadow: inset 0 0 0 3px rgba(255,255,255,.1),inset 0 -22px 45px rgba(0,15,14,.28),0 18px 42px rgba(0,0,0,.34); }
.exam-seat { color: var(--ink); border-color: #344649; background: #172225; box-shadow: 0 12px 28px rgba(0,0,0,.32); }
.exam-avatar { color: #9aaba8; background: #263437; }
.exam-seat.is-hero { color: white; border-color: #6eb9a5; background: #123b38; }
.exam-seat.is-folded { color: #82918e; border-color: #29373a; background: #111a1c; box-shadow: 0 6px 16px rgba(0,0,0,.22); }
.exam-seat.is-folded .exam-avatar { color: #677572; background: #202a2c; }
.exam-seat.is-raiser { color: #e9d29b; border-color: #7d6534; background: #292418; }
.exam-seat.is-raiser .exam-avatar { color: #292418; background: #d7b45d; }
.exam-seat.is-raiser > div:nth-child(2) span { color: #e0bc67; }
.exam-playing-card { border-color: #cbd3d0; background: #f7f8f5; }
.dealer-button { border-color: #c9cfcc; background: #eef1ed; }
.exam-overtime-bar { color: #dcc17d; border-color: #68532e; background: #2c2518; }
.exam-overtime-bar button { color: #e2c77f; border-color: #776139; background: #1c211e; }
.exam-action-button { color: var(--ink); border-color: #344548; background: #172124; }
.exam-action-button.is-flashing { color: #10201d; }
@media (hover: hover) and (pointer: fine) {
  .exam-action-button:hover:not(:disabled) { color: #10201d; }
}
.exam-action-button small { color: #a9b8b5; background: #263336; }
.exam-action-button.is-correct { color: #bfeadd; border-color: #4c8e7c; background: #17352e; }
.exam-action-button.is-wrong { color: #f0a18b; border-color: #b85b48; background: #3a2320; }
.exam-feedback { border-color: #315e53; background: #142d28; }
.exam-feedback.is-wrong { border-color: #694039; background: #34211f; }
.exam-feedback-copy strong { color: #92d4c1; }
.exam-feedback.is-wrong .exam-feedback-copy strong { color: #f09b84; }
.exam-feedback-copy small,
.exam-frequency-list > div { color: #9fb2ae; }
.exam-frequency-list { border-top-color: rgba(172,200,193,.13); }
.exam-frequency-list i { background: rgba(218,235,230,.1); }
.exam-feedback-tool { color: #a9d8ca; border-color: #416c61; background: #1a2d2a; }
.exam-feedback-tool:hover:not(:disabled) { border-color: #68a997; background: #223a35; }
.exam-feedback-tool#exam-mark-easy { color: #e3c57e; border-color: #715c34; background: #2d2619; }
.exam-queue-complete { border-color: #3b514c; background: #152122; }
.exam-queue-complete > span { color: #8fd2be; background: #173a32; }

.progress-summary-card::after { background: #1b2d2a; }
.progress-summary-card.is-due::after { background: #35221f; }
.progress-group { border-color: var(--line); background: #141e20; }
.progress-group-heading { border-color: var(--line); background: #1a2729; }
.progress-group-heading > strong,
.progress-range-bar b { color: #8fcbbb; }
.progress-range-row { border-top-color: #243235; }
.progress-range-bar i { background: #2a383a; }
.progress-next-review { background: linear-gradient(145deg,#174d45,#0e3532); box-shadow: 0 12px 28px rgba(0,0,0,.28); }
.progress-schedule-tip { background: #1a2527; }
.toast { background: #1c5148; box-shadow: 0 14px 36px rgba(0,0,0,.42); }

@media (max-width: 760px) {
  .custom-brush { background: #182326; }
}

/* Progress page readability */
#page-progress .eyebrow { font-size: 10px; letter-spacing: 2.2px; }
#page-progress .progress-filter > span { font-size: 12px; }
#page-progress .progress-summary-card { min-height: 138px; padding: 22px 24px; }
#page-progress .progress-summary-card > span { font-size: 12px; }
#page-progress .progress-summary-card > strong { margin-top: 9px; font-size: 31px; }
#page-progress .progress-summary-card > small { margin-top: 10px; font-size: 11px; }
#page-progress .progress-layout { grid-template-columns: minmax(0,1fr) 250px; gap: 18px; }
#page-progress .progress-ranges-panel,
#page-progress .progress-schedule-panel { padding: 25px; }
#page-progress .progress-panel-heading { margin-bottom: 20px; }
#page-progress .progress-panel-heading h2 { font-size: 21px; }
#page-progress .progress-panel-heading > span { font-size: 12px; }
#page-progress .progress-groups { gap: 22px; }
#page-progress .progress-group-heading { padding: 17px 18px; }
#page-progress .progress-group-heading h3 { font-size: 16px; }
#page-progress .progress-group-heading span { margin-top: 5px; font-size: 11px; }
#page-progress .progress-group-heading > strong { font-size: 16px; }
#page-progress .progress-range-head,
#page-progress .progress-range-row { grid-template-columns: minmax(135px,1.4fr) 72px minmax(112px,1fr) 58px 58px 88px; gap: 11px; }
#page-progress .progress-range-head { padding: 11px 18px; font-size: 10px; font-weight: 650; }
#page-progress .progress-range-row { min-height: 72px; padding: 13px 18px; }
#page-progress .progress-range-row > strong { font-size: 14px; }
#page-progress .progress-range-row > span { font-size: 11px; }
#page-progress .progress-range-bar { grid-template-columns: 1fr 40px; }
#page-progress .progress-range-bar i { height: 9px; }
#page-progress .progress-range-bar b { font-size: 11px; }
#page-progress .progress-next-review { padding: 19px; }
#page-progress .progress-next-review span,
#page-progress .progress-next-review small { font-size: 11px; }
#page-progress .progress-next-review strong { margin: 9px 0 6px; font-size: 22px; }
#page-progress .progress-schedule-list { margin-top: 18px; }
#page-progress .progress-schedule-list > div { padding: 15px 4px; }
#page-progress .progress-schedule-list span b { font-size: 12px; }
#page-progress .progress-schedule-list span small { margin-top: 4px; font-size: 10px; }
#page-progress .progress-schedule-list > div > strong { font-size: 18px; }
#page-progress .progress-daily-heading strong { font-size: 13px; }
#page-progress .progress-daily-heading small { font-size: 10px; }
#page-progress .progress-daily-row { min-height: 48px; padding: 9px 5px; }
#page-progress .progress-daily-row b,
#page-progress .progress-schedule-later span b { font-size: 12px; }
#page-progress .progress-daily-row small,
#page-progress .progress-schedule-later span small { font-size: 10px; }
#page-progress .progress-daily-row > strong { font-size: 15px; }
#page-progress .progress-daily-row.has-reviews > strong,
#page-progress .progress-schedule-later > strong { font-size: 18px; }
#page-progress .progress-schedule-tip { padding: 14px; font-size: 11px; }

@media (max-width: 1120px) {
  #page-progress .progress-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  #page-progress .progress-summary-card { min-height: 124px; padding: 18px; }
  #page-progress .progress-ranges-panel,
  #page-progress .progress-schedule-panel { padding: 18px; }
  #page-progress .progress-range-row { min-height: 76px; padding: 15px; }
  #page-progress .progress-range-row > strong { font-size: 14px; }
  #page-progress .progress-range-row > span:nth-last-child(-n+3) { font-size: 10px; }
}

/* Unified six-max replayer table: the same proportions on desktop and mobile. */
.exam-table-panel {
  width: min(100%, 640px);
  margin-inline: auto;
  padding: 0;
  border-color: #17495c;
  background: radial-gradient(circle at 50% 42%, #1f607a 0%, #103342 100%);
  box-shadow: none;
}

.exam-table-panel .exam-stage {
  display: grid;
  min-height: 0;
  overflow: hidden;
  /*
   * 上、左右、下留白。上下值随视口和座位一起放大：手机保持紧凑，
   * 大屏幕则为顶部手牌、底部行动标签和按钮预留足够的安全边距。
   */
  padding: clamp(60px, 15vw, 110px) clamp(35px, 8vw, 70px) clamp(64px, 16vw, 120px);
  place-items: center;
  background: transparent;
}

.exam-stage .exam-poker-table {
  /*
   * clamp(最小值, 首选响应式值, 最大值)
   * 浏览器会优先采用中间值，但最终结果不会小于第一个值，也不会大于第三个值。
   * 例如 clamp(24px, 5.4vw, 37px)：
   * - 窄屏时最小为 24px；
   * - 中间随视口宽度变化，5.4vw 等于视口宽度的 5.4%；
   * - 宽屏时最大为 37px。
   * 如果不需要响应式缩放，可以直接改成固定值，例如 30px。
   */
  --replayer-seat-size: clamp(52px, 14vw, 95px);
  /* 正面牌和牌背共用的宽度与高度。字号放大后被裁切时，需要相应增加牌高。 */
  --replayer-card-width: clamp(24px, 5.4vw, 37px);
  --replayer-card-height: clamp(36px, 8vw, 55px);
  --replayer-chip-width: clamp(10px, 1.8vw, 12px);
  --replayer-chip-height: clamp(4px, .75vw, 5px);
  --replayer-wager-diagonal: clamp(24px, 5.4vw, 46px);
  --replayer-wager-side-gap: clamp(9px, 2vw, 20px);
  --replayer-wager-top-gap: clamp(5px, 1vw, 10px);
  --replayer-wager-bottom-gap: clamp(5px, 1.3vw, 14px);
  width: min(100%, 500px);
  min-width: 0;
  /* 宽度保持不变，减小高度，形成更紧凑的椭圆牌桌。 */
  aspect-ratio: 500 / 285;
  border: clamp(7px, 1.5vw, 10px) solid #002f41;
  border-radius: 999px;
  background: #226a88;
  box-shadow: 0 14px 26px rgba(0,0,0,.32);
}

.exam-stage .exam-poker-table::after { display: none; }
.exam-stage .exam-felt-mark { width: 54%; }
.exam-stage .exam-felt-mark > span { color: rgba(255,255,255,.46); font-size: clamp(6px, 1vw, 8px); letter-spacing: 1.6px; }
.exam-stage .exam-felt-mark strong { width: auto; max-width: 100%; margin-top: 4px; padding: 3px 6px; border-radius: 3px; background: #002f41; font-size: clamp(12px, 2.6vw, 18px); line-height: 1.1; }

.exam-stage .exam-seat {
  display: grid;
  width: var(--replayer-seat-size);
  min-height: var(--replayer-seat-size);
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: white;
  background: transparent;
  box-shadow: none;
}

.exam-stage .exam-avatar {
  width: var(--replayer-seat-size);
  height: var(--replayer-seat-size);
  border: clamp(3px, .72vw, 5px) solid #002f41;
  color: transparent;
  background: #226a88;
  box-shadow: 0 4px 10px rgba(0,0,0,.34);
  font-size: 0;
}

.exam-stage .exam-seat > div:nth-child(2) {
  position: absolute;
  z-index: 7;
  top: calc(var(--replayer-seat-size) - 20px);
  left: 50%;
  display: grid;
  min-width: 42px;
  max-width: 162px;
  justify-items: center;
  padding: 0;
  color: white;
  background: transparent;
  text-align: center;
  transform: translateX(-50%);
}

.exam-stage .exam-seat strong,
.exam-stage .exam-seat > div:nth-child(2) span {
  display: block;
  width: max-content;
  max-width: 162px;
  overflow: hidden;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0,47,65,.86);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-stage .exam-seat strong { color: #47a9d1; font-size: clamp(10px, 2.2vw, 16px); }
.exam-stage .exam-seat > div:nth-child(2) span { margin-top: 1px; color: #f3e03b; font-size: clamp(9px, 2vw, 14px); font-weight: 750; text-transform: none; }
.exam-stage .exam-seat.is-hero,
.exam-stage .exam-seat.is-folded,
.exam-stage .exam-seat.is-raiser { border: 0; color: white; background: transparent; box-shadow: none; }
.exam-stage .exam-seat.is-folded { opacity: 1; }
.exam-stage .exam-seat.is-hero .exam-avatar,
.exam-stage .exam-seat.is-raiser .exam-avatar { border-color: #47a9d1; color: transparent; background: #226a88; }
.exam-stage .exam-seat.is-hero .exam-avatar { box-shadow: 0 0 0 3px rgba(71,169,209,.16), 0 4px 12px rgba(0,0,0,.38); }
.exam-stage .exam-seat.is-folded .exam-avatar { border-color: #002f41; color: transparent; background: #226a88; box-shadow: 0 4px 10px rgba(0,0,0,.28); }
.exam-stage .exam-seat.is-hero > div:nth-child(2),
.exam-stage .exam-seat.is-raiser > div:nth-child(2) { color: inherit; background: transparent; }

.exam-stage .exam-seat-bb { left: 25%; top: 0; transform: translate(-50%,-100%); }
.exam-stage .exam-seat-utg { right: 25%; top: 0; transform: translate(50%,-100%); }
.exam-stage .exam-seat-sb { left: 0; top: 50%; transform: translate(-68%,-50%); }
.exam-stage .exam-seat-hj { right: 0; top: 50%; transform: translate(68%,-50%); }
.exam-stage .exam-seat-btn { left: 25%; bottom: 0; transform: translate(-50%,88%); }
.exam-stage .exam-seat-co { right: 25%; bottom: 0; transform: translate(50%,88%); }

.exam-stage .exam-hole-cards {
  z-index: 6;
  top: clamp(7px, 2vw, 14px);
  right: auto;
  bottom: auto;
  left: 50%;
  display: flex;
  gap: 2px;
  transform: translateX(-50%);
}

.exam-stage .exam-playing-card,
.exam-stage .exam-playing-card.is-compact {
  /* 单列两行网格：第一行显示点数，第二行显示花色。 */
  display: grid;
  width: var(--replayer-card-width);
  height: var(--replayer-card-height);
  /* 防止过大的点数或花色绘制到牌框外。 */
  overflow: hidden;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  /* 两个文字元素的行框间距；字体字形本身仍可能带有额外视觉留白。 */
  row-gap: 1px;
  /* 将“点数 + 花色”作为一个整体垂直居中。 */
  align-content: center;
  align-items: center;
  /* 将点数和花色分别在牌面中水平居中。 */
  justify-items: center;
  /* 牌框内部留白；增加后会减少文字可使用的空间。 */
  padding: 0;
  border: 1px solid #cbd3d0;
  border-radius: 4px;
  background: linear-gradient(145deg,#fff,#f4f5f2);
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

.exam-stage .exam-playing-card b,
.exam-stage .exam-playing-card.is-compact b {
  /* b 元素代表牌面点数，例如 A、K、Q、J、T。 */
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  font-family: Arial, sans-serif;
  /* 最小 19px；中间按视口宽度的 3.7% 缩放；最大 27px。 */
  font-size: clamp(19px, 3.7vw, 27px);
  font-weight: 700;
  /* 控制字形行框高度；越小越靠近花色，过小则可能重叠或裁切。 */
  line-height: .72;
}
.exam-stage .exam-playing-card i,
.exam-stage .exam-playing-card.is-compact i {
  /* i 元素代表牌面花色，例如 ♠、♥、♦、♣。 */
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  font-family: "Segoe UI Symbol", Arial, sans-serif;
  /* 最小 25px；中间按视口宽度的 4.8% 缩放；最大 35px。 */
  font-size: clamp(25px, 4.8vw, 35px);
  font-style: normal;
  /* 与点数使用相同行框比例，使两者保持紧凑。 */
  line-height: .72;
}

/*
 * 答题按钮在桌面与手机上统一为一排三列。
 * 决策区改为单列后，按钮占第一行，回答反馈显示在下一行并占满宽度。
 */
.exam-decision-panel {
  width: min(100%, 640px);
  margin-inline: auto;
  grid-template-columns: minmax(0, 1fr);
}

.exam-action-list {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 10px;
}

.exam-action-button {
  min-width: 0;
}

#exam-action-list .exam-action-button,
#exam-action-list .exam-action-button::before {
  transition: none;
}

.exam-action-choice {
  display: grid;
  min-width: 0;
  gap: 6px;
}
.exam-action-choice > .exam-action-button { width: 100%; }
.exam-action-frequency-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.exam-action-frequency-option {
  min-width: 0;
  min-height: 26px;
  padding: 0;
  border: 1px solid #344548;
  border-radius: 6px;
  color: var(--subtle);
  background: #111a1c;
  font-family: "DM Mono", Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.exam-action-frequency-option:hover:not(:disabled) { color: var(--ink); border-color: #55706d; }
.exam-action-frequency-option.is-selected { color: #10201d; border-color: var(--mint); background: var(--mint); }
.exam-action-frequency-option:disabled { cursor: default; opacity: .55; }

.exam-feedback,
.exam-next-button {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  /*
   * 手机牌面空间较满：花色维持原位；点数缩小 1px，并在原有 1px
   * 下移基础上再下降约 3px，让点数离开牌框顶部但不把花色推到底部。
   */
  .exam-stage .exam-playing-card b,
  .exam-stage .exam-playing-card.is-compact b {
    font-size: 18px;
    transform: translateY(4px);
  }

  .exam-stage .exam-playing-card i,
  .exam-stage .exam-playing-card.is-compact i {
    transform: translateY(1px);
  }

  /* 窄屏减少按钮之间和内部的横向留白，仍保持 Fold / Raise / Call 同一排。 */
  .exam-action-list {
    gap: 6px;
  }

  .exam-action-button {
    padding-right: 9px;
    padding-left: 12px;
  }

  .exam-action-button small {
    width: 24px;
    height: 24px;
  }
}

.exam-stage .exam-card-back {
  width: var(--replayer-card-width);
  height: var(--replayer-card-height);
  border: 1px solid #f4f5f2;
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% 46%,rgba(255,74,82,.58),transparent 46%),
    repeating-linear-gradient(45deg,rgba(255,255,255,.08) 0 1px,transparent 1px 3px),
    linear-gradient(180deg,#ee111b,#b7060e);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 2px 4px rgba(0,0,0,.3);
}

.exam-stage .exam-posted-blind {
  z-index: 8;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: white;
  background: transparent;
  box-shadow: none;
}

.exam-stage .exam-posted-blind b,
.exam-stage .exam-posted-raise b {
  color: white;
  font-family: Arial, sans-serif;
  font-size: clamp(10px, 2.2vw, 16px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 2px #002f41;
  white-space: nowrap;
}

.exam-stage .exam-chip-stack { width: var(--replayer-chip-width); height: clamp(10px, 2.4vw, 17px); }
.exam-stage .exam-chip-stack i {
  left: 50%;
  width: var(--replayer-chip-width);
  height: var(--replayer-chip-height);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.32);
  transform: translateX(-50%);
}
.exam-stage .exam-chip-stack i:nth-child(1) { bottom: 0; }
.exam-stage .exam-chip-stack i:nth-child(2) { bottom: 2px; }
.exam-stage .exam-chip-stack i:nth-child(3) { bottom: 4px; }
.exam-stage .exam-posted-raise .exam-chip-stack i { background: #d76b50; }

/* Wagers sit between each player and the centre of the felt. */
.exam-stage .exam-posted-sb { left: calc(100% + var(--replayer-wager-side-gap)); top: 50%; transform: translateY(-50%); }
.exam-stage .exam-posted-bb { top: calc(100% + var(--replayer-wager-top-gap)); left: calc(50% + var(--replayer-wager-diagonal)); transform: translateX(-50%); }
.exam-stage .exam-seat-bb > .exam-posted-raise { top: calc(100% + var(--replayer-wager-top-gap)); left: calc(50% + var(--replayer-wager-diagonal)); transform: translateX(-50%); }
.exam-stage .exam-seat-utg > .exam-posted-raise { top: calc(100% + var(--replayer-wager-top-gap)); right: calc(50% + var(--replayer-wager-diagonal)); left: auto; transform: translateX(50%); }
.exam-stage .exam-seat-sb > .exam-posted-raise { left: calc(100% + var(--replayer-wager-side-gap)); top: 50%; transform: translateY(-50%); }
.exam-stage .exam-seat-hj > .exam-posted-raise { right: calc(100% + var(--replayer-wager-side-gap)); top: 50%; transform: translateY(-50%); }
.exam-stage .exam-seat-btn > .exam-posted-raise { bottom: calc(100% + var(--replayer-wager-bottom-gap)); left: calc(50% + var(--replayer-wager-diagonal)); transform: translateX(-50%); }
.exam-stage .exam-seat-co > .exam-posted-raise { right: calc(50% + var(--replayer-wager-diagonal)); bottom: calc(100% + var(--replayer-wager-bottom-gap)); left: auto; transform: translateX(50%); }

.exam-stage .dealer-button {
  right: -7px;
  bottom: -7px;
  width: clamp(16px, 3.4vw, 23px);
  height: clamp(16px, 3.4vw, 23px);
  border-width: 1px;
  font-size: clamp(8px, 1.6vw, 11px);
}
