:root {
  color-scheme: dark;
  --bg: #0b1017;
  --panel: #101823;
  --panel-2: #141f2b;
  --line: #243243;
  --line-soft: #1a2734;
  --text: #edf5ff;
  --muted: #8fa0b5;
  --subtle: #5f7186;
  --fold: #253448;
  --fold-2: #1b2634;
  --accent: #22d3b6;
  --good: #1fbf9a;
  --bad: #ff5c77;
  --warn: #f5b84b;
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  min-width: 320px;
  background:
    linear-gradient(180deg, #0f1721 0%, #0b1017 46%, #080c12 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex: 0 0 72px;
  min-height: 72px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 18, 27, 0.96);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #07110f;
  background: var(--accent);
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
  line-height: 1.15;
}

h2 {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1.1;
}

h3 {
  font-size: 13px;
  color: #c8d6e6;
  margin-bottom: 10px;
}

.brand p,
#sceneHint {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.bulk-download {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #284d49;
  border-radius: 8px;
  padding: 0 13px;
  color: #07110f;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.bulk-download:hover {
  filter: brightness(1.08);
}

.mode-tabs {
  display: flex;
  align-items: center;
  padding: 4px;
  background: #0a0f16;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-tab {
  border: 0;
  color: var(--muted);
  background: transparent;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.mode-tab.active {
  color: var(--text);
  background: var(--panel-2);
}

.workspace {
  flex: 1;
  min-height: 0;
  height: calc(100vh - 72px);
  overflow: hidden;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

body[data-mode="trainer"] .workspace,
body[data-mode="review"] .workspace {
  grid-template-columns: minmax(0, 1fr);
}

body[data-mode="paint"] .workspace {
  grid-template-columns: minmax(0, 1fr);
}

body[data-mode="trainer"] .sidebar,
body[data-mode="paint"] .sidebar,
body[data-mode="review"] .sidebar {
  display: none;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #0c121b;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  padding: 14px;
  flex: 0 0 auto;
  z-index: 10;
  background: #0c121b;
  border-bottom: 1px solid var(--line-soft);
}

.sidebar-head label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

#sceneSearch,
#trainerScene {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d14;
  color: var(--text);
  min-height: 38px;
  padding: 0 11px;
  outline: none;
}

#sceneSearch:focus,
#trainerScene:focus {
  border-color: var(--accent);
}

.scene-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
}

.category-section {
  margin-bottom: 6px;
}

.category-toggle {
  width: 100%;
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.category-toggle::before {
  content: "›";
  color: var(--subtle);
  font-size: 18px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 120ms ease;
}

.category-section.expanded .category-toggle::before {
  transform: rotate(90deg);
}

.category-toggle span {
  flex: 1;
}

.category-toggle em {
  color: var(--subtle);
  font-style: normal;
  font-size: 11px;
}

.category-toggle:hover {
  background: #111b27;
  color: #cbd8e7;
}

.category-panel {
  display: none;
  padding: 3px 0 8px;
}

.category-section.expanded .category-panel {
  display: grid;
  gap: 2px;
}

.scene-button {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cbd8e7;
  padding: 10px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.scene-button span {
  color: var(--subtle);
  font-size: 11px;
}

.scene-button:hover {
  background: #111b27;
}

.scene-button.active {
  background: #142334;
  border-color: #24455b;
  color: var(--text);
}

.view {
  display: none;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 18px;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.board-head,
.trainer-top {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 520px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
}

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

.mobile-scene-switcher {
  display: none;
}

.range-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 920px) 360px;
  gap: 18px;
  align-items: start;
  justify-content: center;
}

.matrix-wrap,
.detail-panel,
.trainer-main,
.trainer-side {
  border: 1px solid var(--line);
  background: rgba(16, 24, 35, 0.9);
  border-radius: var(--radius);
}

.matrix-wrap {
  height: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  display: grid;
  place-items: center;
}

.range-matrix {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 3px;
  width: min(100%, 920px, calc(100vh - 210px));
  max-width: none;
  margin: 0 auto;
}

.cell {
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  color: #edf5ff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: clamp(10px, 1.1vw, 14px);
  font-weight: 800;
  line-height: 1;
  min-width: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: #17202b;
  transition: transform 120ms ease, border-color 120ms ease, filter 120ms ease;
}

.cell span {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.cell-fill {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  background: #17202b;
}

.cell-segment {
  display: block;
  height: 100%;
  flex: 0 0 auto;
}

.cell-segment-raise {
  background: #df4f5d;
}

.cell-segment-call {
  background: #72b36a;
}

.cell-segment-fold {
  background: #4f80bd;
}

.cell:hover,
.cell.selected {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.35);
  filter: brightness(1.1);
}

.detail-panel,
.trainer-side {
  padding: 14px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}

.panel-section + .panel-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-title-row h3 {
  margin-bottom: 0;
}

.chart-download {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.chart-download:hover {
  text-decoration: underline;
}

.range-chart-preview {
  display: block;
  width: 100%;
  aspect-ratio: 1540 / 1660;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0a0f16;
}

.memory-blocks {
  display: grid;
  gap: 10px;
}

.memory-block {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.memory-block strong {
  display: block;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 3px;
}

.memory-block p,
.hand-detail {
  color: #b4c3d6;
  font-size: 13px;
  line-height: 1.55;
}

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

.hand-detail dl {
  margin: 0;
  display: grid;
  gap: 7px;
}

.hand-detail div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hand-detail dt {
  color: var(--muted);
}

.hand-detail dd {
  margin: 0;
  font-weight: 800;
}

.trainer-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 320px;
  gap: 18px;
}

.trainer-setup,
.trainer-drill {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
}

.trainer-setup.active,
.trainer-drill.active {
  display: flex;
}

.table-stage {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  place-items: center;
  gap: 18px;
  padding: 12px 0 28px;
}

.poker-table {
  width: min(900px, 82vw);
  height: min(460px, 42vh);
  min-height: 340px;
  position: relative;
}

.table-ring {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 18%;
  bottom: 12%;
  border: 6px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.seat {
  position: absolute;
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  border: 5px solid #3a3b3d;
  background: #191a1c;
  color: #f1f3f5;
  font-weight: 900;
  font-size: 24px;
  cursor: default;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45) inset;
}

.seat.active {
  border-color: #b9f7b2;
  color: #c9ffc4;
}

.seat-co {
  left: 31%;
  top: 6%;
}

.seat-btn {
  right: 31%;
  top: 6%;
}

.seat-sb {
  right: 7%;
  top: 38%;
}

.seat-bb {
  right: 31%;
  bottom: 7%;
}

.seat-utg {
  left: 31%;
  bottom: 7%;
}

.seat-hj {
  left: 7%;
  top: 38%;
}

.dealer-chip {
  position: absolute;
  top: 22%;
  right: 39%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f4f4f4;
  color: #151515;
  font-weight: 900;
  font-size: 18px;
}

.deck-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  background: #1f2022;
  padding: 10px;
  display: flex;
  gap: 5px;
}

.deck-stack span {
  width: 62px;
  height: 92px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #2e3032;
  color: #b7b7b7;
  font-weight: 900;
  font-size: 42px;
  line-height: 1;
}

.setup-stack {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.setting-block {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.setting-block label {
  color: #8f9092;
  font-size: 20px;
  font-weight: 800;
}

.scenario-row {
  display: flex;
  align-items: center;
}

.scenario-row #trainerScene {
  width: 390px;
  min-height: 48px;
  border: 0;
  background: #303134;
  color: #f0f0f0;
  font-size: 20px;
  font-weight: 800;
}

.scenario-row #trainerScene {
  width: 448px;
}

.start-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  margin-top: 10px;
}

.start-training {
  border: 0;
  min-height: 62px;
  border-radius: 8px;
  padding: 0 22px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
}

.start-training {
  min-width: 310px;
  background: #b8fbb0;
  color: #183016;
}

.trainer-main,
.trainer-side {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
}

.trainer-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.question-surface {
  min-height: 360px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b111a;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 24px;
}

.drill-surface {
  min-height: 560px;
  align-content: center;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.question-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.question-meta .question-roll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: rgba(38, 211, 184, 0.42);
  background: rgba(38, 211, 184, 0.1);
  color: var(--text);
}

.question-roll strong {
  min-width: 2.2ch;
  color: var(--accent);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.drill-table-wrap {
  width: min(820px, 100%);
  display: grid;
  place-items: center;
}

.drill-poker-table {
  width: min(760px, 100%);
  height: 330px;
  position: relative;
}

.drill-poker-table .table-ring {
  left: 8%;
  right: 8%;
  top: 18%;
  bottom: 12%;
}

.drill-seat {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #3a3b3d;
  background: #191a1c;
  color: #f1f3f5;
  font-weight: 900;
  font-size: 19px;
  display: grid;
  place-items: center;
}

.drill-seat.hero {
  border-color: #b8fbb0;
  box-shadow: 0 0 0 3px rgba(184, 251, 176, 0.16);
  color: #d4ffd0;
}

.drill-seat.villain {
  border-color: #df4f5d;
  box-shadow: 0 0 0 3px rgba(223, 79, 93, 0.16);
}

.drill-seat-co {
  left: 31%;
  top: 4%;
}

.drill-seat-btn {
  right: 31%;
  top: 4%;
}

.drill-seat-sb {
  right: 5%;
  top: 38%;
}

.drill-seat-bb {
  right: 31%;
  bottom: 5%;
}

.drill-seat-utg {
  left: 31%;
  bottom: 5%;
}

.drill-seat-hj {
  left: 5%;
  top: 38%;
}

.hero-cards {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 9px;
  padding: 12px;
  border-radius: 10px;
  background: #1f2022;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
}

.hole-card {
  width: 74px;
  height: 104px;
  border-radius: 8px;
  background: #f1f3f5;
  color: #17191c;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  font-weight: 900;
}

.hole-card strong {
  font-size: 36px;
  line-height: 1;
}

.hole-card span {
  color: #df4f5d;
  font-size: 20px;
  line-height: 1;
}

.hole-card:first-child span,
.hole-card.suited span {
  color: #17191c;
}

.answer-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.answer-button,
.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
}

.answer-button {
  border: 1px solid var(--line);
  background: #121c28;
  color: var(--text);
  min-width: 86px;
}

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

.answer-button.correct {
  border-color: var(--good);
  background: rgba(31, 191, 154, 0.18);
}

.answer-button.wrong {
  border-color: var(--bad);
  background: rgba(255, 92, 119, 0.16);
}

.trainer-feedback {
  min-height: 23px;
  text-align: center;
  font-size: 14px;
}

.trainer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 0;
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: #03110f;
  font-weight: 900;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-grid div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b111a;
  padding: 12px 8px;
  text-align: center;
}

.stat-grid span {
  display: block;
  font-size: 22px;
  font-weight: 900;
}

.stat-grid label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.paint-head {
  align-items: center;
}

.paint-scene-control {
  min-width: min(460px, 42vw);
  display: grid;
  gap: 7px;
}

.paint-scene-control label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#paintScene {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d14;
  color: var(--text);
  min-height: 42px;
  padding: 0 11px;
  outline: none;
}

#paintScene:focus {
  border-color: var(--accent);
}

.paint-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 940px) 380px;
  gap: 18px;
  align-items: stretch;
  justify-content: center;
}

.paint-board-panel,
.paint-panel {
  border: 1px solid var(--line);
  background: rgba(16, 24, 35, 0.9);
  border-radius: var(--radius);
  min-height: 0;
  overflow: hidden;
}

.paint-board-panel {
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.paint-panel {
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
}

.paint-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.paint-status-row strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 3px;
}

.paint-score-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: #0b111a;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.paint-score-badge.good {
  border-color: rgba(31, 191, 154, 0.45);
  color: #8df0d1;
}

.paint-score-badge.near {
  border-color: rgba(245, 184, 75, 0.5);
  color: #ffd27a;
}

.paint-score-badge.bad {
  border-color: rgba(255, 92, 119, 0.5);
  color: #ff9bac;
}

.paint-matrix-wrap {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.paint-matrix {
  width: min(100%, 900px, calc(100vh - 210px));
}

.paint-cell.blank .cell-fill {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    #131b25;
}

.paint-cell.filled {
  border-color: rgba(255, 255, 255, 0.12);
}

.paint-cell.missing {
  box-shadow: inset 0 0 0 2px rgba(255, 92, 119, 0.75);
}

.paint-cell.mistake {
  box-shadow: inset 0 0 0 2px rgba(255, 92, 119, 0.9);
}

.paint-cell.near {
  box-shadow: inset 0 0 0 2px rgba(245, 184, 75, 0.85);
}

.paint-cell.matched {
  box-shadow: inset 0 0 0 2px rgba(31, 191, 154, 0.65);
}

.selected-hand-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #0b111a;
  color: var(--text);
}

.paint-cell-status {
  display: grid;
  gap: 6px;
  color: #b4c3d6;
  font-size: 13px;
  line-height: 1.45;
}

.paint-controls {
  display: grid;
  gap: 12px;
}

.ratio-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 66px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ratio-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.ratio-row-raise input[type="range"] {
  accent-color: #df4f5d;
}

.ratio-row-call input[type="range"] {
  accent-color: #72b36a;
}

.ratio-row-fold input[type="range"] {
  accent-color: #4f80bd;
}

.ratio-row input[type="number"] {
  width: 66px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #080d14;
  color: var(--text);
  padding: 0 8px;
}

.paint-total-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}

.paint-total-row strong {
  color: var(--text);
}

.paint-action-row,
.quick-paint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-paint-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121c28;
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.quick-paint-row button:hover {
  border-color: var(--accent);
}

.paint-result {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  color: #b4c3d6;
  font-size: 13px;
  line-height: 1.45;
}

.paint-result strong {
  color: var(--text);
  font-size: 22px;
}

.paint-mistakes {
  display: grid;
  gap: 8px;
  color: #b4c3d6;
  font-size: 13px;
}

.paint-mistakes-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.paint-mistakes-grid .mistake-cell {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #0b111a;
  color: var(--text);
  padding: 0;
  text-align: center;
  cursor: pointer;
  display: grid;
  place-items: center;
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.paint-mistakes-grid .mistake-cell:hover {
  border-color: var(--accent);
  filter: brightness(1.12);
}

.paint-mistakes-grid .mistake-cell span {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.paint-mistakes-grid .mistake-cell.missing {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 92, 119, 0.18) 0,
      rgba(255, 92, 119, 0.18) 5px,
      rgba(255, 92, 119, 0.04) 5px,
      rgba(255, 92, 119, 0.04) 10px
    ),
    #141923;
  border-color: rgba(255, 92, 119, 0.72);
}

.paint-mistakes-grid .mistake-cell.mistake {
  background: rgba(255, 92, 119, 0.22);
  border-color: rgba(255, 92, 119, 0.82);
}

.paint-mistakes-grid .mistake-cell.near {
  background: rgba(245, 184, 75, 0.2);
  border-color: rgba(245, 184, 75, 0.78);
}

.review-template-view {
  overflow: auto;
  padding: 18px 22px;
}

.review-head {
  max-width: 1180px;
  margin: 0 auto 16px;
}

.review-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 28px;
}

.review-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 34, 0.96);
  padding: 16px;
  min-width: 0;
}

.review-flow,
.review-sheet {
  grid-column: 1 / -1;
}

.review-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.review-section-title span {
  min-width: 38px;
  height: 28px;
  border: 1px solid rgba(34, 211, 182, 0.48);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.review-section-title h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.review-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.review-checklist li,
.review-step-grid article,
.review-example-grid article,
.template-sheet div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b111a;
}

.review-checklist li {
  min-height: 132px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-checklist strong,
.review-step-grid strong,
.review-example-grid strong,
.template-sheet label {
  color: #edf5ff;
  font-weight: 900;
}

.review-checklist span,
.review-step-grid p,
.review-example-grid p,
.template-sheet span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.review-step-grid,
.review-example-grid,
.template-sheet {
  display: grid;
  gap: 10px;
}

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

.review-step-grid article,
.review-example-grid article {
  padding: 12px;
}

.review-step-grid p,
.review-example-grid p {
  margin-top: 6px;
}

.review-thesis {
  margin-top: 12px;
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  color: #c9d7e8;
  background: rgba(34, 211, 182, 0.06);
  font-size: 13px;
  line-height: 1.55;
}

.review-example-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.template-sheet div {
  min-height: 92px;
  padding: 12px;
}

.template-sheet label {
  display: block;
  margin-bottom: 7px;
}

.board-library-head {
  align-items: center;
}

.board-library-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.board-library-actions .ghost-button,
.import-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
}

.board-library-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 300px minmax(440px, 1fr) 360px;
  gap: 14px;
}

.board-library-index,
.board-note-editor,
.board-note-preview {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 24, 35, 0.9);
  overflow: hidden;
}

.board-library-index,
.board-note-preview {
  display: flex;
  flex-direction: column;
}

.board-note-preview {
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
}

.board-search-panel {
  flex: 0 0 auto;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 8px;
}

.board-search-panel label,
.board-note-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#boardNoteSearch,
#boardNoteSpotFilter,
#boardNoteTagFilter,
.board-note-form input,
.board-note-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d14;
  color: var(--text);
  outline: none;
}

#boardNoteSearch,
#boardNoteSpotFilter,
#boardNoteTagFilter,
.board-note-form input {
  min-height: 38px;
  padding: 0 11px;
}

.board-note-form textarea {
  min-height: 88px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.55;
}

#boardNoteSearch:focus,
#boardNoteSpotFilter:focus,
#boardNoteTagFilter:focus,
.board-note-form input:focus,
.board-note-form textarea:focus {
  border-color: var(--accent);
}

.board-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.board-note-stats {
  flex: 0 0 auto;
  padding: 9px 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  font-weight: 800;
}

.board-note-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.board-note-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 5px;
}

.board-note-item:hover {
  background: #111b27;
}

.board-note-item.active {
  background: #142334;
  border-color: #24455b;
}

.board-note-item strong {
  font-size: 15px;
  line-height: 1.2;
}

.board-note-item span,
.board-note-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.board-note-editor {
  overflow: auto;
  overscroll-behavior: contain;
}

.board-note-form {
  padding: 14px;
  display: grid;
  gap: 13px;
}

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

.form-grid label,
.text-field {
  display: grid;
  gap: 7px;
}

.wide-field {
  grid-column: 1 / -1;
}

.board-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.danger-button {
  border-color: rgba(255, 92, 119, 0.45);
  color: #ff9bac;
}

.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.board-card-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.board-mini-card {
  width: 54px;
  height: 72px;
  border-radius: 7px;
  background: #f1f3f5;
  color: #17191c;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.board-mini-card strong {
  font-size: 23px;
  line-height: 1;
}

.board-mini-card em {
  color: #17191c;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
}

.board-mini-card.red em {
  color: #df4f5d;
}

.board-mini-card.empty {
  background: #17202b;
  color: var(--muted);
  border: 1px dashed var(--line);
  box-shadow: none;
}

.board-texture-summary {
  color: #b4c3d6;
  font-size: 13px;
  line-height: 1.5;
}

.board-texture-summary.warning {
  color: #ffd27a;
}

.board-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: #b4c3d6;
}

.board-tag-cloud span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: #0b111a;
  color: #c9d7e8;
  font-size: 12px;
  font-weight: 800;
}

.board-tag-cloud.small {
  margin: 8px 0 10px;
}

.related-board-list {
  display: grid;
  gap: 7px;
  color: #b4c3d6;
  font-size: 13px;
}

.related-board-list button {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b111a;
  color: var(--text);
  padding: 9px;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 4px;
}

.related-board-list button:hover {
  border-color: var(--accent);
}

.related-board-list span {
  color: var(--muted);
  font-size: 12px;
}

.board-note-readout {
  color: #c9d7e8;
  font-size: 13px;
  line-height: 1.55;
}

.board-note-readout header {
  display: grid;
  gap: 4px;
}

.board-note-readout header strong {
  color: var(--text);
  font-size: 16px;
}

.board-note-readout header span,
.board-note-readout h4 {
  color: var(--muted);
  font-size: 12px;
}

.board-note-readout section + section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.board-note-readout h4 {
  margin: 0 0 5px;
}

.board-note-readout p {
  color: #d6e2f0;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .range-stage,
  .trainer-layout,
  .paint-layout,
  .review-layout {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 760px) {
  body,
  .app-shell {
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }

  body {
    background: #0b1017;
  }

  h2 {
    font-size: 22px;
    line-height: 1.12;
  }

  h3 {
    font-size: 12px;
  }

  .topbar,
  .board-head,
  .trainer-top {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    min-height: 0;
    padding: 10px 12px;
    gap: 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand p {
    max-width: calc(100vw - 72px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .top-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .bulk-download,
  .mode-tabs {
    width: 100%;
  }

  .bulk-download {
    min-height: 34px;
    font-size: 12px;
  }

  .mode-tabs {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .mode-tabs::-webkit-scrollbar {
    display: none;
  }

  .mode-tab {
    flex: 0 0 auto;
    min-width: 88px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .workspace {
    display: block;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    display: block;
    overflow: auto;
    min-height: auto;
    max-height: min(260px, 42vh);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body[data-mode="trainer"] .sidebar,
  body[data-mode="paint"] .sidebar,
  body[data-mode="review"] .sidebar {
    display: none;
  }

  .sidebar-head {
    top: 0;
    padding: 10px 12px;
  }

  .scene-list {
    padding: 6px;
  }

  .category-toggle {
    min-height: 32px;
  }

  .scene-button {
    padding: 8px;
  }

  .view {
    display: none;
    height: auto;
    overflow: visible;
    padding: 10px;
  }

  .view.active {
    display: block;
  }

  .review-template-view {
    padding: 10px;
  }

  .review-head {
    margin-bottom: 10px;
  }

  .review-layout {
    display: grid;
    gap: 10px;
    padding-bottom: 18px;
  }

  .review-panel {
    padding: 12px;
  }

  .review-section-title {
    margin-bottom: 10px;
  }

  .review-section-title h3 {
    font-size: 15px;
  }

  .review-checklist,
  .review-step-grid,
  .review-example-grid,
  .template-sheet {
    grid-template-columns: 1fr;
  }

  .review-checklist li,
  .template-sheet div {
    min-height: 0;
  }

  .review-checklist span,
  .review-step-grid p,
  .review-example-grid p,
  .template-sheet span,
  .review-thesis {
    font-size: 12px;
  }

  .detail-panel,
  .trainer-side,
  .paint-panel,
  .board-library-index,
  .board-note-editor,
  .board-note-preview {
    height: auto;
    max-height: none;
    padding: 12px;
  }

  .range-matrix {
    grid-template-columns: repeat(13, minmax(0, 1fr));
    width: min(100%, calc(100vw - 32px));
    gap: 1px;
  }

  .cell {
    border-radius: 2px;
    font-size: clamp(8px, 2.45vw, 11px);
  }

  .range-stage,
  .trainer-layout,
  .paint-layout {
    gap: 12px;
  }

  .board-head,
  .paint-head {
    gap: 10px;
    margin-bottom: 10px;
  }

  #sceneHint,
  .board-head p {
    font-size: 12px;
    line-height: 1.4;
  }

  .legend {
    justify-content: flex-start;
    max-width: none;
    gap: 6px;
  }

  .legend-item {
    padding: 5px 8px;
    font-size: 11px;
  }

  .matrix-wrap,
  .paint-board-panel {
    padding: 8px;
  }

  .memory-block p,
  .hand-detail {
    font-size: 12px;
  }

  .trainer-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .poker-table {
    width: 100%;
    height: 330px;
    min-height: 300px;
  }

  .seat {
    width: 66px;
    height: 66px;
    border-width: 4px;
    font-size: 18px;
  }

  .deck-stack span {
    width: 36px;
    height: 58px;
    font-size: 26px;
  }

  .drill-poker-table {
    height: 270px;
  }

  .drill-seat {
    width: 56px;
    height: 56px;
    font-size: 15px;
  }

  .hole-card {
    width: 52px;
    height: 76px;
  }

  .hole-card strong {
    font-size: 26px;
  }

  .trainer-main {
    padding: 10px;
  }

  .question-surface {
    min-height: 0;
    gap: 12px;
    padding: 12px;
  }

  .drill-surface {
    min-height: 0;
  }

  .question-meta {
    width: 100%;
  }

  .question-meta span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .answer-button {
    flex: 1 1 88px;
    min-height: 44px;
  }

  .trainer-actions .primary-button,
  .trainer-actions .ghost-button {
    flex: 1 1 124px;
    min-height: 42px;
  }

  .stat-grid {
    margin-bottom: 12px;
  }

  .scenario-row #trainerScene {
    width: min(320px, 78vw);
    font-size: 15px;
  }

  .paint-scene-control {
    min-width: 0;
    width: 100%;
  }

  .paint-layout {
    display: grid;
    overflow: visible;
  }

  .paint-panel {
    order: -1;
  }

  .paint-board-panel {
    overflow: visible;
  }

  .paint-status-row {
    align-items: stretch;
    flex-direction: column;
  }

  .ratio-row {
    grid-template-columns: 42px minmax(0, 1fr) 58px;
    gap: 7px;
  }

  .ratio-row input[type="number"] {
    width: 58px;
    min-height: 32px;
    padding: 0 6px;
  }

  .quick-paint-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-paint-row button {
    min-height: 38px;
  }

  .paint-action-row .primary-button,
  .paint-action-row .ghost-button {
    flex: 1 1 122px;
  }

  .paint-mistakes-grid {
    grid-template-columns: repeat(13, minmax(0, 1fr));
    gap: 2px;
  }

  .paint-mistakes-grid .mistake-cell {
    border-radius: 3px;
    font-size: clamp(7px, 2.05vw, 10px);
  }

  .start-row {
    flex-wrap: wrap;
  }

  .start-training {
    min-width: min(300px, 86vw);
  }
}

@media (max-width: 430px) {
  .topbar {
    padding: 9px 10px;
  }

  .bulk-download {
    min-height: 32px;
  }

  .mode-tab {
    min-width: 82px;
    font-size: 12px;
  }

  .view {
    padding: 8px;
  }

  .range-matrix {
    width: min(100%, calc(100vw - 24px));
  }

  .matrix-wrap,
  .paint-board-panel {
    padding: 6px;
  }

  .cell {
    font-size: clamp(7px, 2.35vw, 10px);
  }

  .paint-status-row,
  .paint-result,
  .paint-cell-status {
    font-size: 12px;
  }

  .ratio-row {
    grid-template-columns: 40px minmax(0, 1fr) 54px;
  }

  .ratio-row input[type="number"] {
    width: 54px;
  }

  .quick-paint-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body,
  .app-shell,
  .workspace,
  .view,
  .view.active {
    width: 100%;
    max-width: 100%;
  }

  body {
    min-height: 100dvh;
    overflow-x: hidden;
  }

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

  .topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    min-height: 58px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(8, 13, 20, 0.98);
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .brand h1 {
    max-width: calc(100vw - 142px);
    overflow: hidden;
    font-size: 18px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand p {
    display: none;
  }

  .top-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .bulk-download {
    width: auto;
    min-width: 50px;
    min-height: 36px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 0;
    box-shadow: 0 8px 22px rgba(34, 211, 182, 0.18);
  }

  .bulk-download::after {
    content: "图片包";
    font-size: 12px;
    font-weight: 900;
  }

  .mode-tabs {
    position: fixed;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 100;
    display: grid;
    width: auto;
    height: 58px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    padding: 5px;
    border-color: rgba(88, 118, 151, 0.42);
    border-radius: 18px;
    background: rgba(10, 16, 24, 0.96);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
  }

  .mode-tab {
    display: grid;
    min-width: 0;
    width: 100%;
    min-height: 0;
    place-items: center;
    padding: 0 4px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 900;
  }

  .workspace {
    display: block;
    height: auto;
    overflow: visible;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .sidebar {
    display: none !important;
  }

  .view {
    min-width: 0;
    overflow-x: hidden;
    padding: 12px;
  }

  .board-head {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
  }

  .board-head h2,
  .trainer-top h2 {
    font-size: 24px;
  }

  .board-head p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .legend {
    justify-content: flex-start;
    gap: 6px;
  }

  .mobile-scene-switcher {
    display: grid;
    gap: 6px;
  }

  .mobile-scene-switcher label,
  .paint-scene-control label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
  }

  .mobile-scene-switcher select,
  #paintScene {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #0b121b;
    color: var(--text);
    padding: 0 13px;
    font-weight: 900;
    outline: none;
  }

  .mobile-scene-switcher select:focus,
  #paintScene:focus {
    border-color: var(--accent);
  }

  .range-stage {
    display: block;
    overflow: visible;
  }

  .matrix-wrap,
  .detail-panel,
  .trainer-side,
  .paint-board-panel,
  .paint-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 14px;
    background: rgba(13, 21, 31, 0.96);
  }

  .matrix-wrap {
    height: auto;
    padding: 6px;
    place-items: stretch;
  }

  .range-matrix {
    width: 100%;
    gap: 2px;
  }

  .cell {
    width: 100%;
    min-width: 0;
    border-radius: 4px;
    font-size: clamp(8px, 2.55vw, 11px);
  }

  .detail-panel {
    margin-top: 10px;
    padding: 12px;
  }

  .chart-panel {
    display: none;
  }

  .memory-blocks {
    gap: 8px;
  }

  .memory-block {
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    background: #0a111a;
    padding: 9px 10px;
  }

  .table-stage {
    grid-template-rows: auto auto;
    gap: 16px;
    padding: 4px 0 18px;
  }

  .poker-table {
    width: 100%;
    max-width: 360px;
    height: min(86vw, 350px);
    min-height: 292px;
  }

  .table-ring {
    right: 5%;
    left: 5%;
  }

  .setup-stack {
    width: 100%;
    max-width: min(420px, calc(100vw - 24px));
  }

  .setting-block {
    width: 100%;
  }

  .scenario-row #trainerScene {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .start-row {
    width: 100%;
  }

  .start-training {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .trainer-layout {
    display: block;
    overflow: visible;
  }

  .trainer-main {
    border: 0;
    background: transparent;
    padding: 0;
  }

  .trainer-top {
    flex-direction: row;
    align-items: center;
    margin-bottom: 10px;
  }

  .trainer-top .ghost-button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }

  .question-surface {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(13, 21, 31, 0.98);
    padding: 12px;
  }

  .question-meta {
    justify-content: center;
  }

  .drill-poker-table {
    width: 100%;
    max-width: 360px;
    height: min(82vw, 330px);
    min-height: 280px;
  }

  .answer-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .answer-button {
    min-height: 52px;
    border-radius: 13px;
    font-size: 18px;
    font-weight: 900;
  }

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

  .trainer-actions .primary-button,
  .trainer-actions .ghost-button {
    min-height: 44px;
    border-radius: 12px;
  }

  .trainer-side {
    margin-top: 10px;
  }

  .paint-head {
    align-items: stretch;
  }

  .paint-head > div:first-child {
    display: none;
  }

  .paint-scene-control {
    width: 100%;
    min-width: 0;
  }

  .paint-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
  }

  .paint-panel {
    order: 0;
    padding: 12px;
  }

  .paint-board-panel {
    order: 1;
    padding: 8px;
  }

  .paint-status-row {
    flex-direction: row;
    align-items: center;
  }

  .paint-status-row strong {
    font-size: 13px;
  }

  .paint-score-badge {
    padding: 6px 8px;
    font-size: 11px;
  }

  .paint-matrix-wrap {
    overflow: visible;
  }

  .paint-controls {
    gap: 8px;
  }

  .ratio-row {
    grid-template-columns: 44px minmax(0, 1fr) 56px;
    min-width: 0;
  }

  .ratio-row > * {
    min-width: 0;
  }

  .ratio-row input[type="range"] {
    min-width: 0;
    width: 100%;
  }

  .quick-paint-row,
  .paint-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .quick-paint-row button,
  .paint-action-row .primary-button,
  .paint-action-row .ghost-button {
    min-width: 0;
    min-height: 42px;
    border-radius: 12px;
    overflow: hidden;
    padding: 0 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .paint-mistakes-grid {
    grid-template-columns: repeat(13, minmax(0, 1fr));
    gap: 2px;
  }
}

@media (max-width: 430px) {
  .topbar {
    min-height: 56px;
    padding: calc(7px + env(safe-area-inset-top)) 10px 7px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    max-width: calc(100vw - 132px);
    font-size: 17px;
  }

  .bulk-download {
    min-width: 48px;
    min-height: 34px;
    padding: 0 10px;
  }

  .mode-tabs {
    right: 10px;
    bottom: calc(9px + env(safe-area-inset-bottom));
    left: 10px;
    height: 56px;
    border-radius: 17px;
  }

  .mode-tab {
    font-size: 12px;
  }

  .workspace {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .view {
    padding: 10px;
  }

  .board-head h2,
  .trainer-top h2 {
    font-size: 22px;
  }

  .legend-item {
    padding: 5px 7px;
  }

  .matrix-wrap,
  .paint-board-panel {
    padding: 5px;
  }

  .cell {
    font-size: clamp(7px, 2.45vw, 10px);
  }

  .poker-table {
    height: min(88vw, 330px);
    min-height: 286px;
  }

  .drill-poker-table {
    height: min(86vw, 318px);
  }

  .question-surface {
    padding: 10px;
  }

  .paint-panel {
    padding: 10px;
  }
}

@media (max-width: 1180px) {
  .board-library-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .board-note-preview {
    grid-column: 1 / -1;
    min-height: 260px;
  }
}

@media (max-width: 760px) {
  .board-library-head {
    gap: 10px;
  }

  .board-library-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .board-library-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
  }

  .board-library-index,
  .board-note-editor,
  .board-note-preview {
    padding: 0;
    overflow: visible;
  }

  .board-note-preview {
    padding: 12px;
  }

  .board-note-list {
    max-height: 260px;
  }

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

  .board-note-form {
    padding: 12px;
  }

  .board-note-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-card-preview {
    justify-content: center;
  }
}

@media (max-width: 430px) {
  .board-library-actions,
  .board-filter-row,
  .board-note-actions {
    grid-template-columns: 1fr;
  }

  .board-mini-card {
    width: 48px;
    height: 66px;
  }
}

.review-hero {
  width: min(1380px, 100%);
  margin: 0 auto 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.review-hero p {
  margin-top: 7px;
  max-width: 760px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.review-cockpit {
  width: min(1380px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
  padding-bottom: 28px;
}

.review-index-panel,
.review-insight-panel {
  position: sticky;
  top: 88px;
}

.review-form-panel {
  padding: 0;
  overflow: hidden;
}

.review-search,
.hand-review-form input,
.hand-review-form select,
.hand-review-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d14;
  color: var(--text);
  outline: none;
}

.review-search,
.hand-review-form input,
.hand-review-form select {
  min-height: 38px;
  padding: 0 11px;
}

.hand-review-form textarea {
  min-height: 86px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.55;
}

.review-search:focus,
.hand-review-form input:focus,
.hand-review-form select:focus,
.hand-review-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 211, 182, 0.18);
}

.review-stats {
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-list {
  max-height: calc(100vh - 230px);
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 7px;
  padding-right: 2px;
}

.review-list.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.review-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #0b111a;
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 5px;
}

.review-item:hover {
  border-color: rgba(34, 211, 182, 0.38);
}

.review-item.active {
  background: #142334;
  border-color: #286073;
}

.review-item strong {
  font-size: 14px;
  line-height: 1.25;
}

.review-item span,
.review-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.review-folder {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(11, 17, 26, 0.68);
  overflow: hidden;
}

.review-folder + .review-folder {
  margin-top: 8px;
}

.review-folder-toggle {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #101926;
  color: var(--text);
  padding: 0 10px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.review-folder.collapsed .review-folder-toggle {
  border-bottom: 0;
}

.review-folder-toggle:hover {
  background: #132030;
}

.review-folder-toggle strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.review-folder-toggle em {
  min-width: 26px;
  height: 24px;
  border-radius: 999px;
  background: #0b111a;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.folder-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--muted);
  transition: transform 0.15s ease;
}

.review-folder.collapsed .folder-caret {
  transform: rotate(-90deg);
}

.review-folder.active-folder {
  border-color: #286073;
}

.review-folder-items {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.review-folder.collapsed .review-folder-items {
  display: none;
}

.review-step-map {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  padding: 10px;
  background: #0b111a;
  border-bottom: 1px solid var(--line);
}

.review-step-map div {
  min-height: 54px;
  border: 1px solid var(--line-soft);
  background: #101926;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
}

.review-step-map strong {
  color: var(--accent);
  font-size: 13px;
}

.review-step-map span {
  color: #c9d7e8;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.hand-review-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.review-block {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b111a;
  overflow: hidden;
}

.review-block-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line-soft);
  background: #101926;
}

.review-block-head span {
  min-width: 30px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(34, 211, 182, 0.11);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.review-block-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.review-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 13px;
}

.review-form-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.review-form-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.review-board-preview {
  min-height: 78px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.review-texture-summary {
  color: #c9d7e8;
  font-size: 13px;
  line-height: 1.55;
}

.decision-radar {
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.decision-radar div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b111a;
  padding: 10px;
  min-height: 70px;
  display: grid;
  gap: 7px;
}

.decision-radar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.decision-radar strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.compact-title {
  margin-top: 16px;
}

.review-generated-summary {
  display: grid;
  gap: 8px;
}

.review-generated-summary div {
  border-left: 3px solid rgba(34, 211, 182, 0.74);
  background: rgba(34, 211, 182, 0.06);
  padding: 9px 10px;
  display: grid;
  gap: 5px;
}

.review-generated-summary strong {
  color: var(--accent);
  font-size: 12px;
}

.review-generated-summary span {
  color: #d6e2f0;
  font-size: 13px;
  line-height: 1.52;
  white-space: pre-line;
}

.board-study-cockpit {
  width: min(1960px, calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 280px minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
  padding-bottom: 28px;
}

.board-study-index,
.board-study-toc-panel,
.board-study-summary {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 106px);
  overflow: auto;
}

.board-study-index {
  display: grid;
  gap: 10px;
}

.board-study-main {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.board-study-toc {
  position: static;
  padding: 0;
  border-top: 0;
  background: transparent;
}

.study-toc-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.study-toc-head span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.study-toc-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-toc-links {
  display: grid;
  gap: 7px;
}

.study-toc-links.primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.study-toc-links + .study-toc-links {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.study-toc-links button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #101823;
  color: #c8d7e8;
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-toc-links.primary button {
  background: #132033;
  color: var(--text);
}

.study-toc-links.sub button {
  width: 100%;
}

.study-toc-links.sub {
  max-height: min(44vh, 380px);
  overflow: auto;
  padding-right: 3px;
}

.study-toc-links button:hover,
.study-toc-links button:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(34, 211, 182, 0.18);
}

.study-toc-links .turn-link {
  border-color: rgba(96, 165, 250, 0.32);
}

.study-toc-links .river-link {
  border-color: rgba(244, 114, 182, 0.32);
}

.study-block {
  padding: 16px;
  scroll-margin-top: 150px;
}

.study-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 12px;
}

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

.study-form-grid.compact {
  margin-bottom: 12px;
}

.study-form-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.study-form-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.study-form-grid input,
.study-form-grid select,
.study-form-grid textarea,
.study-action-title input,
.study-action-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d14;
  color: var(--text);
  outline: none;
}

.study-form-grid input,
.study-form-grid select,
.study-action-title input {
  min-height: 38px;
  padding: 0 11px;
}

.study-form-grid textarea,
.study-action-card textarea {
  min-height: 86px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.55;
}

.study-form-grid input:focus,
.study-form-grid select:focus,
.study-form-grid textarea:focus,
.study-action-title input:focus,
.study-action-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 211, 182, 0.18);
}

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

.decision-table-card,
.street-case-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b111a;
  overflow: hidden;
}

.decision-table-card > header,
.street-case-card > header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #101926;
}

.decision-table-card strong,
.street-case-card strong {
  color: var(--text);
  font-size: 13px;
}

.decision-table-card header button,
.street-case-card header button,
.add-case-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101823;
  color: #cfe0f3;
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 800;
}

.decision-table-card header button:hover,
.street-case-card header button:hover,
.add-case-button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.decision-column-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}

.study-action-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1622;
  padding: 10px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.study-action-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-content: start;
  gap: 7px;
  align-items: start;
}

.study-action-card textarea {
  min-height: 72px;
}

.study-action-title button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 92, 119, 0.45);
  border-radius: 8px;
  background: rgba(255, 92, 119, 0.08);
  color: #ff9bac;
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
}

.street-case-list {
  display: grid;
  gap: 12px;
}

.street-case-card {
  padding-bottom: 12px;
  scroll-margin-top: 150px;
}

.street-case-card .study-form-grid,
.street-case-card .street-decision-grid {
  padding: 12px 12px 0;
}

.add-case-button {
  width: 100%;
  margin-top: 12px;
  min-height: 42px;
  color: var(--accent);
  background: rgba(34, 211, 182, 0.06);
}

.board-study-summary .review-board-preview {
  min-height: 74px;
}

.old-review-cockpit {
  display: none !important;
}

@media (max-width: 1180px) {
  .review-cockpit {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .board-study-cockpit {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .board-study-index {
    grid-column: 1;
    grid-row: 1;
  }

  .board-study-toc-panel {
    grid-column: 1;
    grid-row: 2;
  }

  .board-study-main {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .board-study-summary {
    grid-column: 1;
    grid-row: 3;
  }

  .review-insight-panel {
    position: static;
    grid-column: 1 / -1;
  }

  .review-list {
    max-height: 520px;
  }
}

@media (max-width: 760px) {
  .review-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

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

  .review-cockpit {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 18px;
  }

  .board-study-cockpit {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 18px;
  }

  .review-index-panel,
  .review-insight-panel,
  .board-study-toc-panel,
  .board-study-index,
  .board-study-summary {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .board-study-index,
  .board-study-toc-panel,
  .board-study-main,
  .board-study-summary {
    grid-column: auto;
    grid-row: auto;
  }

  .board-study-toc-panel {
    order: 1;
  }

  .board-study-main {
    order: 2;
  }

  .board-study-index {
    order: 3;
  }

  .board-study-summary {
    order: 4;
  }

  .board-study-index {
    max-height: none;
    overflow: visible;
  }

  .board-study-toc {
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #0b111a;
  }

  .study-toc-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .study-toc-links {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .study-toc-links::-webkit-scrollbar {
    display: none;
  }

  .study-toc-links button {
    flex: 0 0 auto;
    min-height: 36px;
    font-size: 13px;
  }

  .study-toc-links.sub button {
    max-width: 190px;
  }

  .study-toc-links.sub {
    max-height: none;
    overflow-y: hidden;
  }

  .study-block,
  .street-case-card {
    scroll-margin-top: 136px;
  }

  .review-list {
    max-height: 240px;
  }

  .review-step-map {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 8px;
  }

  .review-step-map div {
    min-height: 48px;
  }

  .hand-review-form {
    padding: 10px;
    gap: 10px;
  }

  .review-form-grid,
  .decision-radar,
  .study-form-grid,
  .street-decision-grid {
    grid-template-columns: 1fr;
  }

  .decision-column-grid {
    grid-template-columns: 1fr;
  }

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

  .review-form-grid {
    padding: 11px;
    gap: 11px;
  }

  .hand-review-form input,
  .hand-review-form select {
    min-height: 42px;
  }

  .hand-review-form textarea {
    min-height: 104px;
  }

  .study-block {
    padding: 12px;
  }

  .study-form-grid input,
  .study-form-grid select,
  .study-action-title input {
    min-height: 42px;
  }

  .study-form-grid textarea,
  .study-action-card textarea {
    min-height: 104px;
  }
}

@media (max-width: 430px) {
  .review-actions {
    grid-template-columns: 1fr;
  }

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

body[data-mode="exploit"] .workspace {
  grid-template-columns: minmax(0, 1fr);
}

body[data-mode="exploit"] .sidebar {
  display: none;
}

.exploit-view {
  overflow: auto;
  padding: 26px min(4vw, 44px) 40px;
}

.exploit-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 18px;
  align-items: end;
  max-width: 1500px;
  margin: 0 auto 16px;
}

.exploit-hero p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.exploit-scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 18, 27, 0.9);
}

.exploit-scoreboard div {
  min-height: 66px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0a111a;
}

.exploit-scoreboard strong {
  font-size: 24px;
  line-height: 1;
}

.exploit-scoreboard span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.exploit-toolbar,
.exploit-guide,
.exploit-stats,
.exploit-list {
  max-width: 1500px;
  margin-right: auto;
  margin-left: auto;
}

.exploit-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 260px;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(16, 24, 35, 0.94);
}

.exploit-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.exploit-toolbar input,
.exploit-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #090f16;
  color: var(--text);
  padding: 0 12px;
}

.exploit-toolbar input:focus,
.exploit-toolbar select:focus {
  border-color: var(--accent);
}

.exploit-guide {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(34, 211, 182, 0.28);
  border-radius: 10px;
  background: rgba(34, 211, 182, 0.06);
  color: #b8c6d8;
  line-height: 1.6;
}

.exploit-guide strong {
  flex: 0 0 auto;
  color: var(--accent);
}

.exploit-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.exploit-stats span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  color: #aebdd0;
  background: #0a111a;
  font-size: 12px;
  font-weight: 900;
}

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

.exploit-card {
  position: relative;
  overflow: hidden;
  min-height: 286px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18, 28, 40, 0.98), rgba(10, 16, 24, 0.98));
  padding: 14px;
}

.exploit-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--bad);
}

.exploit-card.exploit-green::before {
  background: #72b36a;
}

.exploit-card.exploit-amber::before {
  background: var(--warn);
}

.exploit-card.exploit-blue::before {
  background: #5c95dd;
}

.exploit-card header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.exploit-card header > div {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
}

.exploit-card header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-pill,
.verdict-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.page-pill {
  color: #101823;
  background: var(--accent);
}

.verdict-pill {
  flex: 0 0 auto;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.04);
}

.verdict-red {
  color: #ff6b82;
}

.verdict-green {
  color: #97d68f;
}

.verdict-amber {
  color: #f7ca6a;
}

.verdict-blue {
  color: #8bbcff;
}

.exploit-handline {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.exploit-handline span,
.exploit-handline em {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a111a;
  padding: 0 12px;
  font-style: normal;
  font-weight: 900;
}

.exploit-handline span {
  justify-content: center;
  color: var(--text);
  font-size: 18px;
}

.exploit-handline em {
  color: #b9c8da;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.exploit-streets {
  display: grid;
  gap: 10px;
  margin: 2px 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(8, 13, 22, 0.58);
  padding: 12px;
}

.exploit-streets h4 {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0;
}

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

.exploit-street {
  display: grid;
  gap: 5px;
  min-width: 0;
  border-left: 2px solid rgba(97, 208, 183, 0.55);
  border-radius: 8px;
  background: rgba(15, 23, 36, 0.82);
  padding: 8px 9px;
}

.exploit-street span {
  color: #d9e5f3;
  font-size: 12px;
  font-weight: 900;
}

.exploit-street p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.exploit-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.exploit-card dl div {
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
}

.exploit-card dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.exploit-card dd {
  margin: 0;
  color: #d9e5f3;
  line-height: 1.58;
}

@media (max-width: 1180px) {
  .exploit-hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  body[data-mode="exploit"] .sidebar {
    display: none;
  }

  .mode-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mode-tab {
    min-width: 0;
    padding: 0 3px;
    font-size: clamp(10px, 2.7vw, 12px);
  }

  .exploit-view {
    padding: 12px 10px calc(86px + env(safe-area-inset-bottom));
  }

  .exploit-hero {
    gap: 10px;
    margin-bottom: 10px;
  }

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

  .exploit-toolbar {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .exploit-guide {
    display: grid;
    gap: 5px;
    padding: 11px;
  }

  .exploit-list {
    grid-template-columns: 1fr;
  }

  .exploit-card {
    min-height: 0;
    border-radius: 12px;
    padding: 12px;
  }

  .exploit-streets {
    padding: 10px;
  }

  .exploit-street-grid {
    grid-template-columns: 1fr;
  }
}
