@import url('https://fonts.googleapis.com/css2?family=Darker+Grotesque:wght@600;700;800&family=Space+Mono:wght@400;700&family=Inter:wght@400;500;600&display=swap');

/* ---------- tokens ---------- */
:root {
  --bg: #0c0f0e;
  --surface-1: #1a1e1d;
  --surface-2: #222625;
  --surface-3: #2a2e2d;
  --text: #fafff9;
  --text-dim: rgba(250, 255, 249, .6);
  --text-muted: rgba(250, 255, 249, .4);
  --green: #00de81;
  --green-dim: rgba(0, 222, 129, .15);
  --alert: #ff4d6d;
  --alert-dim: rgba(255, 77, 109, .15);
  --blue: #5fa8ff;
  --amber: #ffb547;
  --border: rgba(250, 255, 249, .08);
  --border-strong: rgba(250, 255, 249, .16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-display: 'Darker Grotesque', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --font-body: 'Inter', system-ui, sans-serif;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, .28);
  --tabbar-h: 60px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
h1 { font-size: 34px; }
p { margin: 0 0 8px; line-height: 1.5; }
button, input, textarea, select { font-family: inherit; color: inherit; font-size: 15px; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding-left: 18px; }
img { max-width: 100%; display: block; }
::selection { background: var(--green-dim); color: var(--text); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* ---------- utility ---------- */
.mono { font-family: var(--font-mono); }
.mono-dim { font-family: var(--font-mono); color: var(--text-dim); font-size: 12px; }
.dim { color: var(--text-dim); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--green); margin-bottom: 6px;
}
.view-head { padding: 24px 20px 8px; }
.view-head h1 { margin-bottom: 2px; }
.empty-state {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-muted);
  padding: 32px 20px; text-align: left;
}

/* ---------- app shell / layout ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; padding-bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
.view-content { max-width: 1200px; margin: 0 auto; }
.sidebar { display: none; }

.boot-loading {
  display: flex; align-items: center; justify-content: center; height: 100vh;
  font-family: var(--font-mono); color: var(--text-muted); letter-spacing: .14em; text-transform: uppercase; font-size: 12px;
}

/* ---------- tab bar (mobile) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: var(--surface-1); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 44px; padding: 4px 2px; border-radius: var(--radius-sm); color: var(--text-muted);
}
.tab-item.active { color: var(--green); }
.tab-icon svg { width: 20px; height: 20px; display: block; }
.tab-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- toasts ---------- */
.toast-region {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
  z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-card);
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 92vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-err { border-color: var(--alert); color: var(--alert); }

/* ---------- login ---------- */
.login-screen { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 24px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
}
.login-logo { display: flex; justify-content: center; margin-bottom: 8px; }
.login-logo .logo-img { width: 120px; }
.login-title { font-family: var(--font-display); font-size: 28px; font-weight: 800; text-align: center; }
.login-sub {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); text-align: center; margin-bottom: 14px;
}
.login-error { font-family: var(--font-mono); font-size: 12px; color: var(--alert); margin: 2px 0 4px; }

/* ---------- form fields ---------- */
.field-label {
  display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 6px;
}
.input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); min-height: 44px;
}
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px var(--green-dim); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.textarea.small { min-height: 64px; }
.form-block { padding: 14px 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid transparent; transition: opacity .15s, background .15s;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--green); color: #06140d; font-weight: 700; }
.btn-primary:not([disabled]):hover { opacity: .88; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:not([disabled]):hover { border-color: var(--green); color: var(--green); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-danger-outline { background: transparent; border-color: rgba(255, 77, 109, .4); color: var(--alert); }
.btn-block { width: 100%; }
.btn-small { min-height: 34px; padding: 6px 12px; font-size: 11px; }
.btn-logout { justify-content: flex-start; padding-left: 0; }

/* ---------- segmented control / chips ---------- */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim);
  min-height: 36px;
}
.seg-btn.active { border-color: var(--green); color: var(--green); background: var(--green-dim); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; color: var(--text-dim); min-height: 36px;
}
.chip.active { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.chip-surface { background: var(--surface-3); border-color: transparent; color: var(--text-dim); padding: 4px 10px; font-size: 10px; }
.chip-surface.small { font-size: 10px; padding: 3px 8px; }
.chip-scope { background: var(--surface-3); border-color: transparent; color: var(--blue); padding: 4px 10px; font-size: 10px; }
.filter-row { padding: 0 20px 14px; }

/* ---------- mode cards ---------- */
.mode-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.mode-card {
  text-align: left; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
}
.mode-card.active { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.mode-card-title { font-family: var(--font-display); font-weight: 800; font-size: 19px; }
.mode-card-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.mode-card-hero { background: linear-gradient(135deg, var(--green-dim), var(--surface-2)); border: 1px solid var(--green); }
.mode-card-hero .mode-card-title { color: var(--green); letter-spacing: .04em; }
.mode-card-caption { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-top: 6px; }

/* ---------- toggle switch ---------- */
.toggle-row { display: flex; align-items: center; gap: 12px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 999px; transition: background .15s; }
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-dim); transition: transform .15s, background .15s;
}
.switch input:checked + .switch-track { background: var(--green-dim); border-color: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--green); }
.toggle-label { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }

/* ---------- concept picker ---------- */
.concept-list { display: flex; flex-direction: column; gap: 12px; padding: 0 20px; }
.concept-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.concept-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.concept-angle { margin: 4px 0 8px; color: var(--text-dim); font-size: 14px; }
.concept-justification {
  font-family: var(--font-mono); font-style: italic; font-size: 11.5px; color: var(--text-dim);
  border-left: 2px solid var(--green); padding-left: 10px; margin-bottom: 12px;
}
.link-skip {
  display: block; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  padding: 18px 20px; text-decoration: underline;
}

/* ---------- brief detail ---------- */
.back-link { display: inline-block; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.brief-header { padding: 24px 20px 10px; }
.brief-meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.pill { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.pill-dim { background: var(--surface-3); color: var(--text-dim); }
.pill-amber { background: rgba(255, 181, 71, .15); color: var(--amber); }
.pill-green { background: var(--green-dim); color: var(--green); }
.pill-red { background: var(--alert-dim); color: var(--alert); }
.context-snippet { font-size: 14px; color: var(--text); margin-top: 4px; }
.context-snippet.dim { font-family: var(--font-mono); color: var(--text-muted); font-size: 12px; }

.variants-grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 10px 20px 30px; }
.variant-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.variant-card.card-approved { border-color: var(--green); }
.variant-card.card-rejected { opacity: .5; }
.variant-card-head { display: flex; align-items: center; gap: 8px; }
.variant-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.variant-rationale { font-size: 13px; color: var(--text-dim); }
.evidence-list { display: flex; flex-direction: column; gap: 2px; }
.evidence-row { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

.lever-badge {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-dim);
}
.lever-faithful { color: var(--blue); background: rgba(95, 168, 255, .15); }
.lever-editorial { color: var(--amber); background: rgba(255, 181, 71, .15); }
.lever-conversion { color: var(--green); background: var(--green-dim); }
.lever-err { color: var(--alert); background: var(--alert-dim); }

/* ---------- skeletons ---------- */
.skeleton-stack { padding: 10px 20px; display: flex; flex-direction: column; gap: 16px; }
.skeleton-card, .variant-card-skeleton {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px;
}
.skel-line, .skel-badge, .skel-title { height: 12px; border-radius: 4px; background: var(--surface-3); margin-bottom: 10px; animation: pulse 1.4s ease-in-out infinite; }
.skel-badge { width: 70px; height: 18px; }
.skel-title { width: 60%; height: 18px; }
.skel-line.short { width: 40%; }
.skel-block, .skel-preview { height: 120px; border-radius: var(--radius-md); background: var(--surface-3); animation: pulse 1.4s ease-in-out infinite; }
.generating-caption { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.variant-card-error { align-items: stretch; }
.error-msg { font-family: var(--font-mono); font-size: 12px; color: var(--alert); }

/* ---------- version stepper ---------- */
.version-stepper { display: flex; flex-wrap: wrap; gap: 6px; }
.version-chip {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-dim);
}
.version-chip.active { border-color: var(--green); color: var(--green); background: var(--green-dim); }

/* ---------- preview ---------- */
.preview-wrap { position: relative; width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; overflow: hidden; }
.email-preview-wrap { height: 220px; }
.email-preview-frame { border: 0; display: block; }
.ad-preview-wrap { width: 100%; }
.ad-preview-frame { border: 0; width: 100%; height: 100%; display: block; }

/* ---------- copy block ---------- */
.copy-block { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.copy-row { display: flex; gap: 8px; font-size: 13px; }
.copy-key { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); flex-shrink: 0; padding-top: 2px; min-width: 52px; }
.copy-val { color: var(--text); }
.empty-copy { padding: 12px; }

/* ---------- qa panel ---------- */
.qa-panel { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.qa-toggle { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 40px; }
.qa-toggle-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.qa-toggle-count { flex: 1; text-align: left; }
.qa-caret { color: var(--text-muted); }
.qa-checks { padding: 4px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.qa-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.qa-icon { width: 14px; flex-shrink: 0; font-family: var(--font-mono); }
.qa-pass .qa-icon { color: var(--green); }
.qa-warn .qa-icon { color: var(--amber); }
.qa-fail .qa-icon { color: var(--alert); }
.qa-label { flex-shrink: 0; }
.qa-note { flex: 1; }

/* ---------- feedback / approve ---------- */
.feedback-block { display: flex; flex-direction: column; gap: 8px; }
.approve-row { display: flex; gap: 8px; }
.approve-row .btn { flex: 1; }

/* ---------- overlay ---------- */
#overlay-root { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(0, 0, 0, .7); }
#overlay-root.open { display: flex; flex-direction: column; }
.overlay-full { flex: 1; display: flex; flex-direction: column; background: var(--surface-1); }
.overlay-close {
  align-self: flex-end; width: 44px; height: 44px; font-size: 26px; color: var(--text);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.overlay-iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------- review ---------- */
.brief-list { display: flex; flex-direction: column; gap: 12px; padding: 0 20px 30px; }
.brief-card {
  display: block; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px;
}
.brief-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.brief-card-snippet { font-size: 13.5px; color: var(--text-dim); margin-bottom: 10px; min-height: 18px; }
.brief-card-foot { display: flex; align-items: center; gap: 12px; }
.dots { display: flex; gap: 4px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-3); }
.dot.filled { background: var(--green); }

/* ---------- library ---------- */
.template-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 20px 30px; }
.template-card {
  position: relative; text-align: left; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
}
.badge-locked {
  position: absolute; top: 10px; right: 10px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em;
  background: rgba(255, 181, 71, .15); color: var(--amber); padding: 3px 8px; border-radius: 999px;
}
.template-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; padding-right: 60px; }
.template-source { max-width: 100%; }

/* ---------- insights ---------- */
.summary-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 20px 20px; }
.summary-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.summary-card-head { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.stat-big { font-family: var(--font-display); font-weight: 800; font-size: 42px; line-height: 1; }
.stat-label { margin-bottom: 10px; }
.stat-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-top: 1px solid var(--border); }
.grade-dist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.grade-chip { font-family: var(--font-mono); font-size: 11px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-dim); display: inline-flex; gap: 6px; }
.grade-s { color: var(--green); background: var(--green-dim); }
.grade-a { color: var(--blue); background: rgba(95, 168, 255, .15); }
.grade-b { color: var(--text-dim); }
.grade-c { color: var(--amber); background: rgba(255, 181, 71, .15); }
.grade-d { color: var(--alert); background: var(--alert-dim); }

.topbottom-grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 0 20px 20px; }
.tb-head { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.tb-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.tb-name { flex: 1; font-size: 13px; }
.tb-metric { font-size: 12px; color: var(--text-dim); }

.sync-row { display: flex; gap: 10px; padding: 4px 20px 24px; flex-wrap: wrap; }
.sync-row .btn { flex: 1; min-width: 140px; }

.learnings-section { padding: 8px 20px 30px; }
.section-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head-row .eyebrow { margin-bottom: 0; }
.learnings-list { display: flex; flex-direction: column; gap: 8px; }
.learning-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
}
.learning-text { flex: 1; min-width: 160px; font-size: 13px; }
.conf-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-dim { background: var(--text-muted); }
.source-tag { text-transform: uppercase; }

/* ---------- clients ---------- */
.client-list { display: flex; flex-direction: column; gap: 12px; padding: 0 20px 30px; }
.client-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.client-card-head { width: 100%; text-align: left; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.client-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.swatch-chip { display: inline-flex; align-items: flex-end; padding: 3px; border-radius: 6px; width: 52px; height: 30px; border: 1px solid rgba(0, 0, 0, .2); }
.swatch-hex { font-size: 8.5px; background: rgba(0, 0, 0, .55); color: #fff; padding: 1px 3px; border-radius: 3px; }
.fonts-line { margin-top: 4px; }
.client-counts { margin-top: 2px; }
.client-card-body { padding: 0 16px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
.detail-block .detail-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.detail-list { font-size: 13px; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; padding-left: 16px; }
.detail-banned .detail-list { color: var(--alert); }
.voice-text { font-size: 13.5px; color: var(--text-dim); font-style: italic; }

/* ---------- desktop layout (>=900px) ---------- */
@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; width: 220px; flex-shrink: 0; background: var(--surface-1);
    border-right: 1px solid var(--border); padding: 24px 16px; position: sticky; top: 0; height: 100vh;
  }
  .sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; padding: 0 8px; }
  .sidebar-brand .logo-img { width: 26px; }
  .sidebar-word { font-family: var(--font-mono); font-size: 13px; letter-spacing: .1em; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: var(--radius-sm); color: var(--text-dim); min-height: 44px; }
  .nav-item:hover { background: var(--surface-2); color: var(--text); }
  .nav-item.active { color: var(--green); background: var(--green-dim); }
  .nav-icon svg { width: 18px; height: 18px; display: block; }
  .nav-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
  .sidebar-foot { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
  .main { padding-bottom: 0; }
  .view-content { padding: 0 8px; }
  .variants-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .topbottom-grid { grid-template-columns: 1fr 1fr; }
  .template-grid { grid-template-columns: repeat(3, 1fr); }
  .toast-region { bottom: 24px; }
}

@media (min-width: 1200px) {
  .variants-grid { grid-template-columns: repeat(3, 1fr); }
}
