[hidden] { display: none !important; }

/* ---------- auth gate ---------- */
.auth-gate {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--text); font-family: 'IBM Plex Sans', system-ui, sans-serif;
}
.auth-card {
  width: 340px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 26px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.5);
}
.auth-tabs {
  display: flex; background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 3px; gap: 2px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 7px; border: none; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 600; background: transparent; color: var(--muted);
}
.auth-tab.on { background: var(--panel2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.auth-submit { width: 100%; justify-content: center; padding: 10px; margin-top: 16px; font-size: 14px; }
.auth-error {
  margin-top: 12px; font-size: 12.5px; color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 8px; padding: 9px 11px; line-height: 1.5;
}
.auth-info {
  margin-top: 12px; font-size: 12.5px; color: var(--text); background: color-mix(in srgb, #5aa469 12%, transparent);
  border: 1px solid color-mix(in srgb, #5aa469 35%, transparent); border-radius: 8px; padding: 9px 11px; line-height: 1.5;
}

:root {
  --bg: #16171b;
  --panel: #1c1e23;
  --panel2: #212429;
  --border: #2b2e35;
  --text: #e7e8ea;
  --muted: #8b8f98;
  --accent: #c98a3f;
  --accent-text: #1a1206;
  --cell-empty: #24272e;
  --cell-text-on: #f5f5f7;
  --cell-text-off: #5c606a;
  --hover: #262a31;
  --input-bg: #14151a;
  --danger: #c9564f;
}
body.light {
  --bg: #efece6;
  --panel: #ffffff;
  --panel2: #f6f3ee;
  --border: #dcd7ce;
  --text: #22242a;
  --muted: #6d7079;
  --accent: #b3752b;
  --accent-text: #fff7ec;
  --cell-empty: #e7e3db;
  --cell-text-on: #ffffff;
  --cell-text-off: #a49f95;
  --hover: #f0ece4;
  --input-bg: #f3f0ea;
  --danger: #b8433c;
}

* { box-sizing: border-box; }
body { margin: 0; }
input, button, textarea, select { font-family: inherit; font-size: inherit; }
input:focus, textarea:focus { outline: none; }
textarea { resize: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,.35); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

#app {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- top bar ---------- */
.topbar {
  height: 52px; flex: 0 0 52px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-badge {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  background: var(--panel2);
  display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(6, 1fr);
  gap: 1.5px; padding: 3px;
}
.brand-cell { border-radius: 1px; }
.brand-word { display: flex; flex-direction: column; line-height: 1; gap: 2px; }
.brand-title { font-weight: 800; font-size: 14px; letter-spacing: -.01em; color: var(--text); }
.brand-dot { color: #5aa469; }
.brand-sub { font-size: 7.5px; font-weight: 700; letter-spacing: .16em; color: var(--muted); }
.tabs {
  display: flex; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px;
}
.tab-btn {
  padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 600; background: transparent; color: var(--muted);
}
.tab-btn.on { background: var(--panel2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.spacer { flex: 1; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel2); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}

/* ---------- layout ---------- */
.body-row { flex: 1; display: flex; min-height: 0; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 274px; flex: 0 0 274px;
  display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--border);
  min-height: 0;
}
.search-wrap { position: relative; padding: 12px 12px 8px; }
.search-icon {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 12px; pointer-events: none;
}
.search-input {
  width: 100%; padding: 8px 10px 8px 26px;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px;
}
.sidebar-actions { display: flex; gap: 6px; padding: 0 12px 10px; }
.btn-ghost-sm {
  flex: 1; padding: 7px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); cursor: pointer; font-size: 12px; font-weight: 500;
}
.tree { flex: 1; overflow-y: auto; padding: 0 6px 12px; }
.tree-empty {
  padding: 26px 16px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.7;
}
.tree-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px 6px 8px;
  border-radius: 7px; cursor: pointer; color: var(--text); margin-bottom: 1px;
}
.tree-row.selected { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.tree-row.dragover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tree-caret {
  width: 14px; flex: 0 0 auto; text-align: center; color: var(--muted);
  font-size: 9px; cursor: pointer;
}
.tree-caret.hidden { visibility: hidden; }
.tree-icon { font-size: 13px; width: 15px; text-align: center; flex: 0 0 auto; opacity: .85; }
.tree-label {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px;
}
.tree-meta {
  font-size: 10.5px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; flex: 0 0 auto;
}
.tree-rename {
  flex: 1; min-width: 0; padding: 2px 6px;
  background: var(--input-bg); border: 1px solid var(--accent); border-radius: 5px;
  color: var(--text); font-size: 13px;
}

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; overflow: auto; background: var(--bg); }

.empty-state {
  height: 100%; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px; color: var(--muted); padding: 40px; text-align: center;
}
.empty-state .big { font-size: 40px; opacity: .5; font-family: 'IBM Plex Mono', monospace; }
.empty-state .desc { font-size: 14px; max-width: 320px; line-height: 1.6; }

.editor-wrap { padding: 18px 22px 28px; max-width: 1100px; }

.meta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.field-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.field-input {
  width: 100%; padding: 9px 11px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
}
.field-name-input { font-size: 15px; font-weight: 600; }
.field-name { flex: 1; min-width: 220px; }
.field-pos { width: 130px; }
.field-stack { width: 120px; }
.field-tags { flex: 1; min-width: 200px; }

.content-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }

.grid-col { flex: 1; min-width: 420px; max-width: 620px; }
.grid { display: grid; grid-template-columns: repeat(13,1fr); gap: 3px; user-select: none; }
.grid-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; font-weight: 600;
  border-radius: 4px; cursor: pointer; overflow: hidden;
}
.grid-cell span { text-shadow: 0 1px 2px rgba(0,0,0,.4); pointer-events: none; }
.grid-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; color: var(--muted); font-size: 12px;
}
.grid-footer .mono { font-family: 'IBM Plex Mono', monospace; }
.grid-footer b { color: var(--text); }
.tool-hint { font-size: 11px; }

.right-col { width: 330px; flex: 0 0 330px; display: flex; flex-direction: column; gap: 16px; }
.panel-box { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.panel-title {
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
}
.btn-tiny {
  font-size: 11px; padding: 4px 9px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); cursor: pointer;
}

.drag-handle {
  flex: 0 0 auto; width: 14px; text-align: center; color: var(--muted); cursor: grab; font-size: 12px; user-select: none;
}
.drag-handle:active { cursor: grabbing; }

.action-list { display: flex; flex-direction: column; gap: 6px; }
.action-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; background: var(--panel2);
}
.action-row.selected { border-color: var(--accent); background: var(--hover); }
.action-row.dragover, .split-row.dragover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.action-swatch {
  width: 18px; height: 18px; border-radius: 5px; flex: 0 0 auto; cursor: pointer;
  border: 1px solid rgba(0,0,0,.25);
}
.action-name-input {
  flex: 1; min-width: 0; background: transparent; border: none; color: var(--text);
  font-size: 13px; font-weight: 500; padding: 2px 0;
}
.action-delete {
  width: 20px; height: 20px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 14px; border-radius: 4px;
}
.fold-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; background: var(--panel2);
}
.fold-row.selected { border-color: var(--accent); background: var(--hover); }
.fold-swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px dashed var(--muted); flex: 0 0 auto; }
.fold-label { flex: 1; font-size: 13px; font-weight: 500; color: var(--muted); }

.mix-section-label {
  font-size: 11px; color: var(--muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: .5px;
}
.mix-list { display: flex; flex-direction: column; gap: 6px; }
.mix-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; background: var(--panel2);
}
.mix-row.selected { border-color: var(--accent); background: var(--hover); }
.mix-swatch {
  width: 18px; height: 14px; border-radius: 4px; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.25); cursor: pointer; padding: 0;
}
.mix-name-input {
  flex: 1; min-width: 0; background: transparent; border: none; color: var(--text);
  font-size: 13px; font-weight: 500; padding: 2px 0;
}
.mix-delete {
  width: 20px; height: 20px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 14px; border-radius: 4px;
}

.tool-divider { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.tool-toggle-row { display: flex; gap: 6px; margin-bottom: 9px; }
.tool-btn {
  flex: 1; padding: 6px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
}
.tool-btn.on { background: var(--accent); color: var(--accent-text); }
.brush-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.brush-row { display: flex; gap: 5px; }
.brush-btn {
  flex: 1; padding: 6px; border-radius: 7px; cursor: pointer; font-size: 11.5px; font-weight: 600;
  font-family: 'IBM Plex Mono', monospace; border: 1px solid var(--border); background: var(--panel2); color: var(--text);
}
.brush-btn.on { background: var(--hover); box-shadow: inset 0 0 0 1px var(--accent); }

.stats-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 12px; font-size: 12.5px; align-items: center; }
.stats-head { color: var(--muted); font-size: 11px; }
.stats-head.right { text-align: right; }
.stats-name { display: flex; align-items: center; gap: 7px; overflow: hidden; }
.stats-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.stats-dot.fold-dot { border: 1px dashed var(--muted); }
.stats-dot.vpip-dot { background: #6b7280; }
.stats-pct { text-align: right; font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.stats-combos { text-align: right; font-family: 'IBM Plex Mono', monospace; color: var(--muted); }

.action-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.btn-ghost {
  padding: 9px 15px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500;
}
.btn-primary {
  padding: 9px 15px; background: var(--accent); border: 1px solid var(--accent); border-radius: 8px;
  color: var(--accent-text); cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-danger {
  padding: 9px 15px; background: transparent; border: 1px solid var(--danger); border-radius: 8px;
  color: var(--danger); cursor: pointer; font-size: 13px; font-weight: 500;
}

/* ---------- trainer ---------- */
.trainer-wrap { padding: 22px; max-width: 720px; margin: 0 auto; }
.trainer-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.trainer-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.trainer-empty {
  padding: 30px; text-align: center; color: var(--muted); background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; font-size: 13px;
}
.trainer-list { display: flex; flex-direction: column; gap: 6px; }
.trainer-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel);
}
.trainer-row.checked { background: var(--hover); }
.trainer-check {
  width: 18px; height: 18px; border-radius: 5px; flex: 0 0 auto; display: flex; align-items: center;
  justify-content: center; font-size: 12px; border: 1px solid var(--border); color: var(--accent-text);
  background: var(--input-bg);
}
.trainer-check.checked { background: var(--accent); }
.trainer-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trainer-path { font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.start-btn {
  margin-top: 16px; padding: 12px 22px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: none; background: var(--panel2); color: var(--muted); cursor: not-allowed;
}
.start-btn.enabled { background: var(--accent); color: var(--accent-text); cursor: pointer; }

.trainer-group-head {
  display: flex; align-items: center; justify-content: space-between; margin: 14px 0 2px; padding: 0 2px;
}
.trainer-group-head:first-child { margin-top: 0; }
.trainer-group-head span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.drill-form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.drill-form-actions .start-btn { margin-top: 0; }

.drill-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px;
}
.drill-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.drill-card-name { font-size: 15px; font-weight: 700; }
.drill-card-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.drill-card-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.drill-card-actions button { padding: 7px 12px; font-size: 12.5px; }
.drill-card .history-box { margin-top: 14px; padding: 0; background: transparent; border: none; }
.drill-card .history-box .missed-title { margin-bottom: 8px; }

.trainer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.trainer-score { font-family: 'IBM Plex Mono', monospace; font-size: 14px; }
.trainer-score .muted { color: var(--muted); }

.hand-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 32px 24px; text-align: center; margin-bottom: 16px;
}
.hand-range-name {
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}
.hand-label { font-family: 'IBM Plex Mono', monospace; font-size: 64px; font-weight: 600; letter-spacing: 2px; }

.trainer-options { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.option-btn {
  min-width: 96px; padding: 14px 18px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.option-btn.best { background: #3f7a4e; border-color: #3f7a4e; color: #fff; }
.option-btn.wrong { background: var(--danger); border-color: var(--danger); color: #fff; }

.feedback-box {
  border-radius: 12px; padding: 16px; text-align: center; border: 1px solid var(--border);
}
.feedback-box.correct { background: color-mix(in srgb, #3f7a4e 18%, var(--panel)); border-color: #3f7a4e; }
.feedback-box.incorrect { background: color-mix(in srgb, var(--danger) 15%, var(--panel)); border-color: var(--danger); }
.feedback-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.feedback-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.feedback-chip { padding: 5px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 600; color: #fff; }
.next-hand-btn {
  margin-top: 14px; padding: 9px 20px; background: var(--accent); color: var(--accent-text);
  border: none; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px;
}

.missed-box {
  margin-top: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.missed-title {
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.missed-list { display: flex; flex-direction: column; gap: 5px; max-height: 180px; overflow: auto; }
.missed-row { display: flex; gap: 10px; align-items: center; font-size: 12.5px; }
.missed-label { font-family: 'IBM Plex Mono', monospace; font-weight: 600; width: 42px; }
.missed-chosen { color: var(--danger); }
.missed-correct { color: var(--muted); }

.history-box {
  margin-top: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.history-list { display: flex; flex-direction: column; max-height: 260px; overflow: auto; }
.history-row {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: none; }
.history-date { font-family: 'IBM Plex Mono', monospace; color: var(--muted); font-size: 11px; flex: 0 0 auto; width: 118px; margin-right: 10px; }
.history-ranges { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 10px; }
.history-score { font-family: 'IBM Plex Mono', monospace; font-weight: 600; flex: 0 0 auto; }
.history-score .muted { color: var(--muted); font-weight: 500; }

/* ---------- context menu ---------- */
.ctx-backdrop { position: fixed; inset: 0; z-index: 50; }
.ctx-menu {
  position: fixed; z-index: 51; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 5px; min-width: 170px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 1px;
}
.ctx-item {
  text-align: left; padding: 8px 11px; border: none; background: transparent; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text);
}
.ctx-item.danger { color: var(--danger); }

/* ---------- modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
}
.modal-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.split-panel { width: 320px; }
.split-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.split-title { font-size: 13px; font-weight: 600; }
.split-key { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 600; }
.split-rows { display: flex; flex-direction: column; gap: 12px; }
.split-row { display: flex; align-items: center; gap: 10px; }
.split-swatch { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; }
.split-name { flex: 1; font-size: 13px; font-weight: 500; }
.split-slider { flex: 1; accent-color: var(--accent); }
.split-weight {
  width: 42px; flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; gap: 1px;
}
.split-weight-input {
  width: 26px; text-align: right; font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600;
  background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--text); padding: 1px 0;
}
.split-weight-input:hover { background: var(--input-bg); }
.split-weight-input:focus { background: var(--input-bg); border-color: var(--accent); }
.split-fold-row {
  display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted);
}
.split-fold-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px dashed var(--muted); flex: 0 0 auto; }
.split-save-btn {
  width: 100%; padding: 8px; margin-top: 14px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500;
}
.split-actions { display: flex; gap: 8px; margin-top: 16px; }
.split-clear-btn {
  flex: 1; padding: 8px; background: transparent; border: 1px solid var(--danger); border-radius: 8px;
  color: var(--danger); cursor: pointer; font-size: 13px;
}
.split-done-btn {
  flex: 1; padding: 8px; background: var(--accent); border: none; border-radius: 8px;
  color: var(--accent-text); cursor: pointer; font-size: 13px; font-weight: 600;
}

.text-import-panel { width: 420px; max-width: 90vw; }
.text-import-field { margin-bottom: 14px; }

.color-panel { width: 290px; }
.color-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.color-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.color-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 7px; margin-bottom: 14px; }
.color-swatch-btn { aspect-ratio: 1; border-radius: 7px; cursor: pointer; border: 2px solid transparent; }
.color-swatch-btn.current { border-color: var(--text); }
.color-recent-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.color-recent-btn { width: 32px; height: 32px; border-radius: 7px; cursor: pointer; border: 2px solid transparent; }
.color-recent-btn.current { border-color: var(--text); }
.color-bottom-row { display: flex; align-items: center; gap: 10px; }
.color-native-input {
  width: 44px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: transparent;
  cursor: pointer; padding: 2px;
}
.color-custom-label { font-size: 12px; color: var(--muted); }
.color-ok-btn {
  padding: 7px 14px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); cursor: pointer; font-size: 13px;
}

/* ---------- viewer ---------- */
.viewer-wrap { padding: 18px 22px; height: 100%; overflow: auto; }
.viewer-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.viewer-vpip-toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; }
.viewer-vpip-toggle input { accent-color: var(--accent); cursor: pointer; }
.viewer-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; align-items: start; }
.viewer-card {
  min-width: 0; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.viewer-card-title { font-size: 13px; font-weight: 700; }
.viewer-card-sub { font-size: 11px; color: var(--muted); margin-top: -8px; }
.viewer-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; user-select: none; }
.viewer-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 7.5px; font-weight: 600;
  border-radius: 2px; overflow: hidden;
}
