:root {
  --ink: #18212b;
  --muted: #61707a;
  --line: #d9e0dc;
  --ground: #f5f7f3;
  --paper: #fff;
  --violet: #6758d8;
  --violet-soft: #eceaff;
  --coral: #ef6a4f;
  --coral-soft: #fff0ec;
  --teal: #11786e;
  --teal-soft: #e6f5f1;
  --yellow: #f2c94c;
  --yellow-soft: #fff7d7;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(24, 33, 43, .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--ground); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--ground); font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.01em; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { min-height: 44px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
::selection { color: var(--paper); background: var(--violet); }
[hidden] { display: none !important; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; gap: 24px; padding: 22px 16px; color: #eaf0ee; background: var(--ink); min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 2px 8px 20px; color: inherit; border-bottom: 1px solid #35414a; text-decoration: none; }
.mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--coral); color: var(--ink); border-radius: 9px; font-weight: 900; font-size: 18px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.03em; }
.brand small { margin-top: 1px; color: #aebcc0; font-size: 11px; }
.rail h2 { margin: 0 8px 8px; color: #91a2a8; font-size: 11px; font-weight: 700; }
.nav-list { display: grid; gap: 4px; }
.nav-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; color: #bdc9ca; border-radius: 9px; text-decoration: none; }
.nav-list a:hover, .nav-list a[aria-current="true"] { color: #fff; background: #2c3942; }
.nav-list a[aria-current="true"] { box-shadow: inset 3px 0 0 var(--coral); }
.nav-list a span { width: 16px; text-align: center; }
.rail-foot { margin-top: auto; padding: 13px 12px; border: 1px solid #35414a; border-radius: 10px; color: #b9c6c8; font-size: 12px; }
.rail-foot strong { display: block; margin-bottom: 3px; color: #fff; font-size: 12px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(18px, 4vw, 48px); border-bottom: 1px solid var(--line); background: rgba(245, 247, 243, .96); }
.crumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.crumb strong { color: var(--ink); font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.status { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 11px; border: 1px solid #b8dcd5; border-radius: 999px; color: #19685f; background: var(--teal-soft); font-size: 12px; font-weight: 700; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--yellow); font-size: 12px; font-weight: 800; }
.mobile-nav { display: none; }
.content { max-width: 1440px; margin: 0 auto; padding: clamp(24px, 4vw, 48px); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 10px; font-size: clamp(29px, 4vw, 52px); line-height: 1.05; letter-spacing: -.055em; }
.page-title { max-width: 700px; margin: 0 0 10px; font-size: clamp(29px, 4vw, 52px); line-height: 1.05; letter-spacing: -.055em; }
.lead { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: 16px; }
.primary, .secondary, .link-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 9px; font-weight: 800; }
.primary { border: 0; color: var(--ink); background: var(--coral); box-shadow: 0 3px 10px rgba(24, 33, 43, .14); transition: transform .16s ease, box-shadow .16s ease; }
.primary:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(24, 33, 43, .18); }
.secondary { border: 1px solid var(--line); color: var(--ink); background: var(--paper); }
.secondary:hover { border-color: #9daca8; background: #fbfcfb; }
.link-button { border: 0; color: var(--muted); background: transparent; font-size: 13px; }
.full-button { width: 100%; margin-top: 14px; }
.panel, .route-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin-bottom: 4px; font-size: 18px; letter-spacing: -.03em; }
.panel-head p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.label { display: inline-flex; align-items: center; min-height: 30px; padding: 0 9px; border-radius: 999px; color: #5143c5; background: var(--violet-soft); font-size: 12px; font-weight: 800; white-space: nowrap; }
.label.pending { color: #7c5d06; background: var(--yellow-soft); }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.route-card { min-height: 250px; padding: 26px; }
.route-card h2 { margin-bottom: 8px; font-size: 28px; letter-spacing: -.045em; }
.route-card p:not(.eyebrow) { max-width: 35rem; color: var(--muted); }
.route-brand { background: #fffaf0; }
.route-image { background: #f1efff; }
.card-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 12px; color: var(--ink); background: var(--yellow); font-size: 24px; }
.route-image .card-icon { background: var(--violet); color: #fff; }
.activity-panel { box-shadow: none; }
.activity { display: grid; padding: 8px 22px 18px; }
.activity-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.activity-row:first-child { border-top: 0; }
.activity-row span, .history-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }
.activity-row small { color: var(--muted); }
.two-column, .studio-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.form-grid, .brief-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink); font-size: 12px; font-weight: 800; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid #cbd5d1; border-radius: 8px; color: var(--ink); background: var(--paper); }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--violet); outline: 3px solid var(--violet-soft); }
.help { color: var(--muted); font-size: 12px; font-weight: 400; }
.asset-controls { padding: 20px 22px 0; }
.dropzone { display: grid; place-items: center; gap: 5px; min-height: 150px; padding: 18px; border: 1px dashed #aab8b4; border-radius: 10px; color: var(--muted); background: #fbfcfb; text-align: center; cursor: pointer; }
.dropzone:hover { border-color: var(--violet); background: var(--violet-soft); }
.dropzone strong { color: var(--ink); }
.dropzone small { font-size: 12px; }
.upload-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #5143c5; background: var(--violet-soft); font-size: 24px; }
.asset-list { display: grid; gap: 10px; padding: 16px 22px 22px; }
.asset-item { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 11px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.asset-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--ground); }
.asset-item strong, .asset-item small { display: block; }
.asset-item small, .empty-note { color: var(--muted); font-size: 12px; }
.icon-button { min-width: 44px; min-height: 44px; padding: 0 9px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; }
.icon-button:hover { color: var(--ink); background: var(--ground); }
.token-form { display: grid; gap: 14px; padding: 20px 22px; }
.token-row { display: grid; grid-template-columns: 1fr 40px 84px; align-items: center; gap: 10px; font-size: 13px; }
.token-row input[type="color"] { width: 44px; height: 44px; min-height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; }
.token-row code { color: var(--muted); font-size: 11px; }
.token-preview { display: flex; align-items: center; gap: 12px; margin: 0 22px 20px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--ground); }
.token-preview > span { width: 36px; height: 36px; border-radius: 7px; background: var(--coral); }
.token-preview strong, .token-preview small { display: block; }
.token-preview small { color: var(--muted); font-size: 12px; }
.consent-panel .panel-copy { margin: 18px 22px 10px; color: var(--muted); font-size: 13px; }
.check { display: flex; gap: 9px; align-items: start; margin: 0 22px; color: var(--ink); font-size: 13px; }
.check input, .checklist input { width: 18px; height: 18px; flex: 0 0 auto; }
.vision-result { margin: 14px 22px 20px; padding: 13px; border-left: 3px solid var(--teal); color: var(--muted); background: var(--teal-soft); font-size: 13px; }
.vision-result p { margin: 5px 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 20px 22px 8px; }
.step { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 700; }
.step:not(:last-child)::after { content: ""; height: 1px; flex: 1; margin: 0 8px; background: var(--line); }
.step > span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--paper); background: #a6b3b0; font-size: 12px; }
.step.done > span { background: var(--teal); }
.step.active { color: var(--ink); }
.step.active > span { background: var(--violet); }
.studio-body { padding: 14px 22px 24px; }
.preview-frame { position: relative; display: grid; place-items: center; width: 100%; min-height: 370px; overflow: hidden; border: 1px solid #cbd5d1; border-radius: 11px; background: #dfe8e2; }
.preview-frame.ratio-1-1 { aspect-ratio: 1 / 1; min-height: auto; }
.preview-frame.ratio-4-5 { aspect-ratio: 4 / 5; min-height: auto; }
.preview-frame.ratio-9-16 { aspect-ratio: 9 / 16; min-height: 420px; }
.preview-frame.ratio-16-9 { aspect-ratio: 16 / 9; min-height: auto; }
.preview-frame img { width: 100%; height: 100%; object-fit: contain; }
.preview-empty { display: grid; gap: 6px; max-width: 320px; padding: 24px; color: var(--muted); text-align: center; }
.preview-empty strong { color: var(--ink); }
.preview-badge { position: absolute; z-index: 2; top: 14px; right: 14px; padding: 7px 9px; border-radius: 7px; color: var(--ink); background: rgba(255,255,255,.8); font-size: 12px; font-weight: 800; }
.preview-tabs { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.preview-tabs button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; }
.preview-tabs button.active { color: var(--ink); background: var(--yellow-soft); }
.preview-tabs span { margin-left: auto; color: var(--muted); font-size: 12px; }
.prompt-review { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 22px 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; }
.prompt-review strong, .prompt-review p { display: block; }
.prompt-review p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.form-actions .primary { white-space: normal; }
.form-actions > .help { flex: 1 1 220px; min-width: 0; }
.form-action-buttons { display: flex; flex: 1 1 280px; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.form-action-buttons > * { max-width: 100%; }
.token-export { display: flex; gap: 8px; padding-bottom: 18px; }
.token-export .secondary { flex: 1; padding-inline: 8px; font-size: 12px; }
.history-select { min-width: 44px; min-height: 44px; padding-inline: 10px; }
.history-row.is-active { background: var(--yellow-soft); }
.job-status { display: grid; gap: 3px; margin-top: 14px; padding: 12px; border-left: 3px solid var(--violet); color: var(--muted); background: var(--violet-soft); font-size: 13px; }
.job-status strong { color: var(--ink); }
.side-body { padding: 18px 20px 20px; }
.token-list { display: grid; gap: 14px; }
.token { display: flex; align-items: center; gap: 11px; }
.swatch { width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid rgba(24,33,43,.14); border-radius: 8px; }
.token strong, .token small { display: block; }
.token small { color: var(--muted); font-size: 12px; }
.rules { display: grid; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.checklist { display: grid; gap: 12px; color: var(--ink); font-size: 13px; }
.checklist label { display: flex; align-items: center; gap: 9px; }
.review-actions { display: grid; gap: 6px; margin-top: 8px; }
.export-actions { display: grid; gap: 9px; }
.export-actions small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.history-list { display: grid; padding: 8px 22px 18px; }
.history-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.history-row:first-child { border-top: 0; }
.history-row strong, .history-row small { display: block; }
.history-row small, .history-row time { color: var(--muted); font-size: 12px; }
.history-dot.success { background: var(--teal); }.history-dot.generating { background: var(--yellow); }.history-dot.failed { background: var(--coral); }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 16px; border: 1px solid var(--ink); border-radius: 9px; color: #fff; background: var(--ink); box-shadow: var(--shadow); font-size: 13px; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .rail { align-items: center; padding-inline: 10px; }
  .brand { min-width: 44px; min-height: 44px; padding-inline: 0; border-bottom: 0; }
  .mark { width: 44px; height: 44px; }
  .brand > span:last-child, .rail h2, .nav-list a:not([aria-current="true"]) { }
  .brand > span:last-child, .rail h2, .nav-list a span + span, .rail-foot { display: none; }
  .nav-list a { width: 48px; justify-content: center; padding: 8px; }
  .nav-list a[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--coral); }
  .topbar { padding-inline: 24px; }
  .content { padding: 30px 24px; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .rail { display: none; }
  .topbar { padding: 15px 18px; }
  .crumb > span { display: none; }
  .status { min-height: 32px; padding-inline: 9px; font-size: 11px; }
  .avatar { display: none; }
  .content { padding: 24px 16px 34px; }
  .page-head { display: block; margin-bottom: 22px; }
  h1 { font-size: 32px; }
  .lead { font-size: 15px; }
  .page-head .primary { width: 100%; margin-top: 18px; }
  .mobile-nav { display: flex; gap: 4px; overflow-x: auto; padding: 10px 8px; border-bottom: 1px solid var(--line); background: var(--paper); scrollbar-width: thin; }
  .mobile-nav a { display: inline-flex; align-items: center; flex: 1 1 auto; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 8px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 750; white-space: nowrap; }
  .mobile-nav a[aria-current="true"] { color: var(--ink); background: var(--yellow-soft); }
  .home-grid, .two-column, .studio-grid { grid-template-columns: 1fr; }
  .route-card { min-height: auto; }
  .panel-head { padding: 17px 16px; }
  .form-grid, .brief-form { grid-template-columns: 1fr; padding: 17px 16px; }
  .field.full { grid-column: auto; }
  .asset-controls { padding: 16px 16px 0; }
  .asset-list { padding-inline: 16px; }
  .token-form { padding-inline: 16px; }
  .token-preview, .consent-panel .panel-copy, .check, .vision-result, .token-export { margin-left: 16px; margin-right: 16px; }
  .token-export { display: flex; gap: 8px; padding-bottom: 18px; }
  .token-export .secondary { flex: 1; padding-inline: 8px; font-size: 12px; }
  .history-select { min-width: 44px; min-height: 44px; padding-inline: 10px; }
  .history-row.is-active { background: var(--yellow-soft); }
  .steps { padding: 17px 16px 5px; }
  .step { gap: 6px; font-size: 12px; }
  .step:not(:last-child)::after { margin: 0 4px; }
  .step > span { width: 22px; height: 22px; }
  .studio-body { padding: 12px 16px 18px; }
  .preview-frame { min-height: 280px; }
  .preview-frame.ratio-9-16 { min-height: 400px; }
  .preview-tabs span { display: none; }
  .brief-form { padding-inline: 0; }
  .prompt-review { align-items: stretch; flex-direction: column; margin-inline: 0; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .primary, .form-action-buttons { width: 100%; white-space: normal; }
  .form-action-buttons > * { flex: 1; }
  .history-row { grid-template-columns: 12px 1fr; }
  .history-row time { grid-column: 2; }
  .toast { right: 16px; bottom: 16px; }
}
@media (max-width: 360px) {
  .topbar { gap: 8px; }
  .top-actions .status { max-width: 124px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { padding-inline: 12px; }
  .panel-head, .studio-body { padding-inline: 13px; }
  .steps { padding-inline: 13px; }
  .step { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
