/* ============ DESIGN TOKENS — Clean Office White ============ */
:root {
  /* surfaces */
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --surface-3: #F1F3F5;

  /* text */
  --text: #111827;
  --text-2: #4B5563;
  --text-3: #9CA3AF;
  --text-on-dark: #FFFFFF;
  --text-on-dark-2: rgba(255,255,255,0.72);

  /* borders */
  --border: #E5E7EB;
  --border-soft: #EEF0F2;
  --border-strong: #D1D5DB;

  /* signal */
  --indigo: #4F46E5;
  --indigo-soft: #EEF2FF;
  --indigo-text: #4338CA;
  --success: #16A34A;
  --success-soft: #ECFDF5;
  --success-text: #166534;
  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --warning-text: #92400E;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --danger-text: #B91C1C;

  /* dark accent */
  --ink: #111827;
  --ink-2: #1F2937;

  /* fonts */
  --font-body: 'Inter', -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* shadows */
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 12px 32px -8px rgba(17, 24, 39, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
pre { font-family: var(--font-mono); }

/* ============ APP LAYOUT ============ */
.app { display: flex; min-height: 100vh; }

/* Sidebar collapsed state */
.app.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  border-right: 0;
  overflow: hidden;
  padding: 0;
}
.app.sidebar-collapsed .content { padding-left: 64px; }

.sidebar-expand-btn {
  position: fixed;
  top: 18px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  font-size: 16px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.sidebar-expand-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.app.sidebar-collapsed .sidebar-expand-btn { display: flex; }

/* SIDEBAR */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 0 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 0 18px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.sidebar-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.sidebar-brand-name:active { opacity: 0.5; }
.sidebar-brand-name.click-feedback { opacity: 0.4; transition: opacity 0.08s; }
.sidebar-brand-en {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-3);
  margin-top: 2px;
}

.icon-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.sidebar-progress {
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 8px;
}
.sidebar-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.sidebar-progress-val { font-size: 13px; font-weight: 600; color: var(--text); }

.progress-bar { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--ink); width: 8%; transition: width 0.3s; }

.sidebar-nav { padding: 0 8px; flex: 1; }
.nav-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-3);
  padding: 14px 10px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s;
  margin-bottom: 1px;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.nav-item .nav-icon { font-size: 14px; line-height: 1; }
.nav-item > span:nth-child(2) { flex: 1; }
.nav-check { color: var(--success); font-size: 11px; font-weight: 700; }

.sidebar-footer {
  padding: 10px 14px 8px;
  margin-top: 8px;
  border-top: 1px solid var(--border-soft);
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}
.ai-status:hover { background: var(--surface-2); border-color: var(--border-strong); }
.ai-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.ai-status.connected .ai-status-dot { background: var(--success); }
.ai-status > span:nth-child(2) { flex: 1; }
.ai-status-arrow { color: var(--text-3); font-size: 11px; }

/* ============ MAIN ============ */
.content {
  flex: 1;
  min-width: 0;
  padding: 36px 44px 80px;
  max-width: 1180px;
}
.route { display: none; }
.route.active { display: block; }

/* ============ TYPOGRAPHY ============ */
.mono-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-3);
  font-weight: 500;
}
.text-indigo { color: var(--indigo); }
.text-2 { color: var(--text-2); }

/* HOME hero */
.home-hero { padding: 16px 0 36px; max-width: 720px; }
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; }
.dot-indigo { background: var(--indigo); }
.num-tag {
  background: var(--ink);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.6px;
}
.home-title {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -1.6px;
  line-height: 1.08;
  margin-bottom: 14px;
  color: var(--text);
}
.home-sub {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 26px;
  max-width: 560px;
}

.page-header { margin-bottom: 28px; }
.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.1;
  margin-bottom: 8px;
}
.page-subtitle {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
  max-width: 680px;
}

/* SECTION HEAD */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.section-head-title { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: all 0.15s;
  line-height: 1.2;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: white; border-color: var(--ink); }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-2); border: none; padding: 8px 14px; }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ============ STATS ============ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-3);
  margin-bottom: 10px;
  font-weight: 500;
}
.stat-val {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text);
}
.stat-val-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 6px;
  letter-spacing: 0;
}

/* ============ STAGE CARDS ============ */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.stage-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stage-done { border-left: 3px solid var(--success); }
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.stage-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.stage-meta { display: flex; gap: 10px; align-items: center; }
.stage-card h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 6px; }
.stage-card p { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin-bottom: 16px; }
.stage-foot { display: flex; justify-content: space-between; align-items: center; }
.link-arrow {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  transition: all 0.15s;
}
.stage-card:hover .link-arrow { color: var(--indigo); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}
.badge-mono { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.8px; background: var(--surface-3); color: var(--text-2); }
.badge-success { background: var(--success-soft); color: var(--success-text); font-weight: 600; }

/* learn-list */
.learn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
}
.learn-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 32px;
  list-style: none;
}
.learn-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}
.learn-list .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--indigo);
  font-weight: 600;
  padding-top: 3px;
  flex-shrink: 0;
}

/* ============ CARDS COMMON ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 14px;
}
.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-3);
  margin-bottom: 8px;
  font-weight: 600;
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin-bottom: 10px;
}
.card-title-sm {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}
.card-text {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.card-bad { border-left: 3px solid var(--danger); }
.card-good { border-left: 3px solid var(--success); }
.card-task { background: var(--indigo-soft); border-color: rgba(79,70,229,0.15); }
.card-task .card-title { color: var(--text); }

/* CALLOUT */
.callout {
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid;
}
.callout-info { background: var(--surface); border-color: var(--border); }
.callout-info .callout-title { color: var(--text); }
.callout-warn { background: var(--warning-soft); border-color: rgba(217,119,6,0.20); }
.callout-warn .callout-title { color: var(--warning-text); }
.callout-warn p { color: var(--warning-text); }
.callout-indigo { background: var(--indigo-soft); border-color: rgba(79,70,229,0.20); }
.callout-indigo .callout-title { color: var(--indigo-text); }
.callout-indigo p { color: var(--indigo-text); }
.callout-title { font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.callout p { color: var(--text-2); font-size: 14px; }

/* TAGS */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.tag-bad { background: var(--danger-soft); color: var(--danger-text); }
.tag-good { background: var(--success-soft); color: var(--success-text); }
.tag-system { background: #DBEAFE; color: #1E40AF; }
.tag-user { background: #F3E8FF; color: #6B21A8; }
.tag-indigo { background: var(--indigo-soft); color: var(--indigo-text); }

/* QUOTE BOX (showing prompts/outputs) */
.quote-box {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  font-family: var(--font-body);
}
.note-bad { font-size: 13px; color: var(--danger-text); line-height: 1.55; margin-top: 10px; }
.note-good { font-size: 13px; color: var(--success-text); line-height: 1.55; margin-top: 10px; }

/* CODE */
.code-block {
  background: var(--ink);
  color: #E5E7EB;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-x: auto;
}
.inline-code {
  background: var(--surface-3);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.bullet-list { list-style: none; padding-left: 0; }
.bullet-list li {
  position: relative;
  padding-left: 14px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 4px;
}
.bullet-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--text-3);
  font-weight: 700;
}

.meta-when {
  font-size: 12.5px;
  color: var(--warning-text);
  margin-bottom: 12px;
}

/* TWO-COL layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

/* COMPARE TABLE */
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td {
  padding: 12px 18px;
  text-align: left;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-soft);
}
.compare-table th {
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
}
.compare-table td { color: var(--text-2); }
.compare-table td:first-child { font-weight: 600; color: var(--text); }
.compare-table tr:last-child td { border-bottom: none; }

/* TAB BAR */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.tab-pill {
  background: transparent;
  border: none;
  padding: 8px 14px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.tab-pill:hover { color: var(--text); }
.tab-pill.active {
  color: var(--text);
  border-bottom-color: var(--ink);
  font-weight: 600;
}
.tab-bar-sm .tab-pill { padding: 6px 10px; font-size: 12.5px; }

/* SCENARIO GRID (recognize tab 3) */
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.scenario-grid > .card { margin-bottom: 0; }
.kv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.kv-box { background: var(--surface-2); border-radius: 6px; padding: 10px 12px; }
.kv-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; font-weight: 600; }
.kv-val { font-size: 12.5px; color: var(--text); line-height: 1.55; }
.tip-line { font-size: 12.5px; color: var(--indigo); margin-top: 10px; font-weight: 500; }

/* PM Summary */
.pm-summary {
  background: var(--ink);
  color: white;
  border-radius: 12px;
  padding: 28px 32px;
  margin: 20px 0;
}
.pm-summary h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: white;
}
.pm-summary > p { font-size: 14px; opacity: 0.85; margin-bottom: 18px; line-height: 1.6; }
.pm-item {
  background: rgba(255,255,255,0.08);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13.5px;
  line-height: 1.55;
}

/* ROWS */
.row { display: flex; align-items: center; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 18px; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.row-center { display: flex; justify-content: center; }
.link-muted { font-size: 13px; color: var(--text-2); cursor: pointer; }
.link-muted:hover { color: var(--text); }
.link-back { font-size: 13px; color: var(--text-2); cursor: pointer; display: inline-block; margin-bottom: 18px; }
.link-back:hover { color: var(--text); }

/* ============ ENTRY TEST ============ */
.chat-window {
  background: var(--ink);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ink);
}
.chat-header {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-dots { display: flex; gap: 5px; }
.chat-dot { width: 10px; height: 10px; border-radius: 50%; }
.chat-dot.r { background: #ff5f56; }
.chat-dot.y { background: #ffbd2e; }
.chat-dot.g { background: #27c93f; }
.chat-header-title {
  color: var(--text-on-dark-2);
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.chat-body { padding: 18px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--indigo);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}
.chat-bubble {
  background: rgba(255,255,255,0.08);
  color: var(--text-on-dark);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13.5px;
}
.chat-input-wrap { padding: 16px 18px 18px; background: rgba(0,0,0,0.20); border-top: 1px solid rgba(255,255,255,0.06); }
.chat-textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  color: var(--text-on-dark);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}
.chat-textarea:focus { outline: none; border-color: rgba(255,255,255,0.30); }
.chat-textarea::placeholder { color: rgba(255,255,255,0.30); }
.chat-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.chat-counter { font-family: var(--font-mono); font-size: 11px; color: var(--text-on-dark-2); letter-spacing: 0.6px; }

/* SCORE HERO */
.score-hero {
  background: var(--ink);
  color: white;
  border-radius: 12px;
  padding: 36px 28px;
  text-align: center;
  margin-bottom: 14px;
}
.score-rocket { font-size: 32px; margin-bottom: 4px; }
.score-val {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -2.5px;
  line-height: 0.95;
  margin-bottom: 10px;
}
.score-msg { font-size: 14px; opacity: 0.85; line-height: 1.6; max-width: 520px; margin: 0 auto; }

/* DIMENSIONS */
.dim-list { margin-top: 12px; }
.dim-row { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.dim-row:last-child { border-bottom: none; }
.dim-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.dim-name-wrap { display: flex; align-items: center; gap: 10px; }
.dim-dot { width: 8px; height: 8px; border-radius: 50%; }
.dim-dot.missing { background: #D1D5DB; }
.dim-dot.partial { background: var(--warning); }
.dim-dot.full { background: var(--success); }
.dim-name { font-size: 13.5px; font-weight: 600; }
.dim-weight {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
}
.dim-status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.dim-status.missing { background: var(--surface-3); color: var(--text-2); }
.dim-status.partial { background: var(--warning-soft); color: var(--warning-text); }
.dim-status.full { background: var(--success-soft); color: var(--success-text); }
.dim-comment { font-size: 12.5px; color: var(--text-2); line-height: 1.55; padding-left: 18px; }

/* ============ CO-STAR ============ */
.costar-letters {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.costar-letter-card {
  aspect-ratio: 1.4 / 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-3);
  position: relative;
}
.costar-letter-card:hover { border-color: var(--text-3); color: var(--text); }
.costar-letter-card.active { background: var(--ink); color: white; border-color: var(--ink); }
.costar-letter-card.done {
  background: var(--success-soft);
  border-color: rgba(22,163,74,0.30);
  color: var(--success-text);
}
.costar-letter-card.done::after {
  content: '✓';
  position: absolute;
  top: 4px; right: 6px;
  font-size: 11px;
  color: var(--success);
  font-weight: 700;
}
.costar-progress-line {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  text-align: center;
  margin-bottom: 24px;
}

.costar-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
}
.costar-step-badge {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}
.costar-step-name { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }

.costar-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; }

/* PRACTICE textarea */
.practice-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.65;
  resize: vertical;
  min-height: 140px;
  color: var(--text);
}
.practice-textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.06);
}
.practice-textarea::placeholder { color: var(--text-3); }
.practice-counter {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  text-align: right;
  margin-top: 6px;
  letter-spacing: 0.6px;
}

/* FEEDBACK CARD (real-time) */
.feedback-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface-2);
}
.feedback-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.feedback-score {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.feedback-status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-2);
}
.feedback-status.partial { background: var(--warning-soft); color: var(--warning-text); }
.feedback-status.full { background: var(--success-soft); color: var(--success-text); }
.feedback-bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.feedback-bar-fill { height: 100%; background: var(--text-3); transition: width 0.3s, background 0.3s; }
.feedback-bar-fill.partial { background: var(--warning); }
.feedback-bar-fill.full { background: var(--success); }
.feedback-details { font-size: 12.5px; line-height: 1.7; }
.feedback-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  color: var(--text-2);
}
.feedback-item.ok { color: var(--success-text); }
.feedback-item.warn { color: var(--warning-text); }
.feedback-item.bad { color: var(--danger-text); }
.feedback-item .ico { flex-shrink: 0; font-weight: 700; }

/* CELEBRATE final card */
.card-celebrate {
  text-align: center;
  padding: 36px 28px;
  background: var(--ink);
  color: white;
  border: none;
}
.celebrate-emoji { font-size: 44px; margin-bottom: 8px; }
.celebrate-title { font-size: 26px; font-weight: 700; letter-spacing: -0.6px; margin-bottom: 6px; }
.celebrate-sub { font-size: 14px; opacity: 0.85; }

.final-prompt {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  color: var(--text);
  margin-top: 8px;
}

/* ============ ADVANCED ============ */
.adv-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.adv-pick {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.adv-pick:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.adv-pick.active { background: var(--ink); color: white; border-color: var(--ink); }
.adv-pick-emoji { font-size: 22px; margin-bottom: 10px; display: block; }
.adv-pick-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.2px; }
.adv-pick-sub { font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
.adv-pick.active .adv-pick-sub { color: rgba(255,255,255,0.7); }

.adv-emoji-block {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.info-box { border: 1px solid; border-radius: 8px; padding: 14px 16px; font-size: 13px; line-height: 1.6; }
.info-box-title { font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.info-box-green { background: var(--success-soft); border-color: rgba(22,163,74,0.20); color: var(--success-text); }
.info-box-amber { background: var(--warning-soft); border-color: rgba(217,119,6,0.20); color: var(--warning-text); }

/* ============ SCENARIOS ============ */
.scen-list { display: flex; flex-direction: column; gap: 10px; }
.scen-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: all 0.15s;
}
.scen-row:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.scen-emoji-block {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.scen-emoji-sm { width: 36px; height: 36px; font-size: 18px; border-radius: 8px; }
.scen-info { flex: 1; min-width: 0; }
.scen-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 3px; letter-spacing: -0.2px; }
.scen-info .desc { font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; line-height: 1.5; }
.scen-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.scen-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-3);
  color: var(--text-2);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}
.row-arrow {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.scen-tpl-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.scen-tpl-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-family: var(--font-body);
  transition: all 0.15s;
}
.scen-tpl-pill:hover { color: var(--text); }
.scen-tpl-pill.active { background: var(--ink); color: white; border-color: var(--ink); font-weight: 600; }

.scen-workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.reference-keys {
  background: var(--indigo-soft);
  border: 1px solid rgba(79,70,229,0.15);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.reference-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.reference-tags .tag {
  background: rgba(79,70,229,0.10);
  color: var(--indigo-text);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  margin: 0;
  letter-spacing: 0.3px;
}

.ref-template-body {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px 14px;
  position: relative;
  min-height: 160px;
}
.ref-body-text {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0;
}
.ref-template-body.locked .ref-body-text { filter: blur(7px); user-select: none; }
.ref-lock-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  text-align: center;
}
.ref-template-body:not(.locked) .ref-lock-overlay { display: none; }
.ref-lock-overlay .lock-emoji { font-size: 24px; }
.ref-lock-overlay strong { font-size: 13px; color: var(--text); }

/* ============ TEMPLATES ============ */
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13.5px;
  margin-bottom: 14px;
  color: var(--text);
}
.search-input:focus { outline: none; border-color: var(--ink); }
.search-input::placeholder { color: var(--text-3); }

.tpl-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  transition: all 0.15s;
}
.filter-pill:hover { color: var(--text); }
.filter-pill.active { background: var(--ink); color: white; border-color: var(--ink); font-weight: 600; }

.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.15s;
}
.tpl-row:hover { border-color: var(--border-strong); }
.tpl-emoji-block {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.tpl-info { flex: 1; min-width: 0; }
.tpl-info-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.tpl-info-top h4 { font-size: 14px; font-weight: 600; letter-spacing: -0.1px; }
.tpl-cat-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--indigo);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.tpl-desc { font-size: 12px; color: var(--text-2); margin-bottom: 7px; line-height: 1.55; }
.tpl-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tpl-tags .t {
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
}
.tpl-actions { display: flex; gap: 2px; flex-shrink: 0; }
.tpl-actions button {
  background: transparent;
  border: none;
  width: 28px; height: 28px;
  border-radius: 6px;
  color: var(--text-3);
  font-size: 13px;
  transition: all 0.15s;
}
.tpl-actions button:hover { background: var(--surface-3); color: var(--text); }
.tpl-actions button.starred { color: #F59E0B; }

/* ============ ACHIEVEMENTS ============ */
.ach-progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 26px;
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}
.ach-pct-val { font-size: 36px; font-weight: 700; letter-spacing: -1px; color: var(--text); }

.ach-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 12px;
}
.ach-section-head h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; }
.ach-section-head .count { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.8px; }

.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ach-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.ach-card.locked { opacity: 0.55; }
.ach-card-emoji-block {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ach-card.unlocked .ach-card-emoji-block { background: var(--warning-soft); }
.ach-card-info { flex: 1; min-width: 0; }
.ach-card-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.ach-card-name { font-size: 13.5px; font-weight: 600; letter-spacing: -0.1px; }
.ach-card.locked .ach-card-name { color: var(--text-3); }
.ach-card-desc { font-size: 12px; color: var(--text-2); line-height: 1.45; }
.ach-check { color: var(--success); font-size: 16px; font-weight: 700; }

.tier {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-transform: uppercase;
}
.tier-normal { background: var(--surface-3); color: var(--text-2); }
.tier-rare { background: #DBEAFE; color: #1E40AF; }
.tier-epic { background: #EDE9FE; color: #5B21B6; }
.tier-legend { background: var(--warning-soft); color: var(--warning-text); }

/* ============ LAB ============ */
.lab-badge {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}
.lab-badge-a { background: var(--ink); color: white; }
.lab-badge-b { background: var(--indigo); color: white; }

.lab-tips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.lab-tip {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 14px 16px;
}
.lab-tip strong { font-size: 13px; font-weight: 600; display: block; margin-bottom: 4px; }
.lab-tip p { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.50);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 880px; }
.modal-head {
  padding: 22px 24px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.modal-head h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
.modal-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.modal-body { padding: 8px 24px 16px; }
.modal-foot {
  padding: 14px 24px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-soft);
  margin-top: 8px;
}

.form-field { margin-bottom: 14px; }
.form-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.form-field input, .form-field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text);
}
.form-field input:focus, .form-field select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17,24,39,0.06);
}
.form-hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.modal-status {
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 10px;
  display: none;
}
.modal-status.show { display: block; }
.modal-status.ok { background: var(--success-soft); color: var(--success-text); }
.modal-status.err { background: var(--danger-soft); color: var(--danger-text); }
.modal-status.loading { background: var(--surface-3); color: var(--text-2); }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1100;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1180px) {
  .home-title { font-size: 36px; }
  .adv-picker { grid-template-columns: repeat(2, 1fr); }
  .lab-tips-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .two-col, .scen-workspace, .stats-row, .stage-grid, .tpl-grid, .ach-grid, .learn-list, .kv-row, .scenario-grid {
    grid-template-columns: 1fr;
  }
  .costar-letters { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { padding: 24px 16px; }
  .home-title { font-size: 30px; }
  .page-title { font-size: 26px; }
}
