:root {
  --teal: #127b73;
  --teal-ink: #0d5f58;
  --teal-soft: #e2f1ee;
  --orange: #f08132;
  --orange-soft: #fdeee3;
  --orange-ink: #8a3b12;
  --ink: #161616;
  --ink-2: #3a3936;
  --muted: #6b6a66;
  --faint: #9b9a95;
  --bg: #ffffff;
  --panel: #f4f3f0;
  --card: #ffffff;
  --line: #e7e5e0;
  --line-2: #d9d7d1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 22, 22, 0.04), 0 8px 24px rgba(22, 22, 22, 0.06);
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 24px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: baseline; gap: 2px; }
.wordmark { font: 900 26px/1 var(--display); letter-spacing: -0.055em; }
.puck { width: 14px; height: 14px; transform: translateY(1px); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 14px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--panel); }
.nav a.active { background: var(--panel); color: var(--ink); font-weight: 600; }
.topbar-right { justify-self: end; display: flex; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill.warn { border-color: #f6c9a8; background: var(--orange-soft); color: var(--orange-ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.pill.warn .dot { background: var(--orange); }

/* ---------- generic */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-ink); }
.btn.primary:disabled { background: #cfd9d7; border-color: #cfd9d7; cursor: not-allowed; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font-size: 13.5px; color: var(--ink-2); }
.chip:hover { border-color: var(--teal); color: var(--teal-ink); }
.tag { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1.display { font: 900 clamp(40px, 6vw, 68px)/1.02 var(--display); letter-spacing: -0.055em; margin: 18px 0 12px; }
h2.display { font: 900 44px/1.05 var(--display); letter-spacing: -0.05em; margin: 0 0 8px; }
.section-title { font-weight: 700; font-size: 16px; margin: 0 0 14px; }
select.select { height: 34px; padding: 0 30px 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23161616' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center; appearance: none; font-size: 13.5px; }

/* ---------- home */
.home { max-width: 1120px; margin: 0 auto; padding: 48px 24px 80px; }
.hero { text-align: center; }
.hero p.lede { font-size: 17px; color: var(--muted); margin: 0 0 32px; }
.composer { max-width: 680px; margin: 0 auto; padding: 14px; border-radius: 16px; box-shadow: var(--shadow); text-align: left; position: relative; }
.composer.drag { outline: 2px dashed var(--teal); outline-offset: 4px; }
.media-row { display: flex; gap: 8px; align-items: center; min-height: 66px; flex-wrap: wrap; }
.thumb { position: relative; width: 48px; height: 66px; border-radius: 8px; background: #8c8a85 center/cover; overflow: hidden; flex: none; }
.thumb .dur { position: absolute; left: 4px; bottom: 4px; padding: 1px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 10.5px; font-weight: 600; }
.thumb .x { position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; line-height: 18px; padding: 0; display: none; }
.thumb:hover .x { display: block; }
.add-thumb { width: 48px; height: 66px; border-radius: 8px; border: 1.5px dashed var(--line-2); background: var(--panel); display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.ref-slot { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.ref-slot .thumb { width: 88px; height: 66px; outline: 2px solid var(--teal); outline-offset: 1px; }
.ref-slot .label { font-size: 12.5px; line-height: 1.35; }
.ref-slot .label b { color: var(--teal-ink); font-weight: 600; }
.ref-add { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px dashed var(--line-2); border-radius: 10px; background: transparent; font-size: 13px; color: var(--muted); }
.ref-add:hover { border-color: var(--teal); color: var(--teal-ink); }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; min-height: 70px; padding: 10px 2px; font-size: 15px; line-height: 1.5; }
.composer-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer-bar .meta { font-size: 13px; color: var(--muted); margin-left: 4px; }
.composer-bar .spacer { flex: 1; }
.empty-drop { flex: 1; display: flex; align-items: center; gap: 12px; padding: 8px 4px; color: var(--muted); font-size: 14px; }
.empty-drop button.link { border: 0; background: none; color: var(--teal-ink); font-weight: 600; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 680px; margin: 18px auto 0; }
.recent { margin-top: 64px; }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.grade-card .ba { position: relative; aspect-ratio: 9 / 13; border-radius: 12px; overflow: hidden; background: var(--panel) center/cover; border: 1px solid var(--line); }
.grade-card .ba .lbl { position: absolute; bottom: 8px; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }
.grade-card .ba .lbl.a { left: 8px; background: #fff; color: var(--ink); }
.grade-card .ba .lbl.b { right: 8px; background: rgba(22, 22, 22, 0.75); color: #fff; }
.grade-card h4 { margin: 10px 0 0; font-size: 14.5px; }
.grade-card p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-2); border-radius: var(--radius); }
.notice { max-width: 680px; margin: 0 auto 18px; padding: 12px 16px; border-radius: 12px; background: var(--orange-soft); border: 1px solid #f6c9a8; color: var(--orange-ink); font-size: 14px; text-align: left; }
.notice code { font-family: var(--mono); font-size: 12.5px; }

/* ---------- grade workspace */
.ws-head { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--line); background: #fff; }
.ws-head h1 { font-size: 18px; margin: 0; font-weight: 700; }
.ws-head .right { margin-left: auto; display: flex; gap: 10px; }
.ws { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 124px); background: var(--panel); }
.ws-left { border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.ws-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; overflow-y: auto; min-height: 0; }
body.in-ws { overflow: hidden; }
.ws-head h1 { cursor: text; border-radius: 8px; padding: 2px 6px; margin-left: -6px; }
.ws-head h1:hover { background: var(--panel); }
.title-input { font: inherit; font-size: 18px; font-weight: 700; border: 1px solid var(--teal); border-radius: 8px; padding: 2px 6px; width: min(480px, 50vw); outline: none; }
.ws-left-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.ws-left-foot { flex: none; padding: 12px 16px 14px; border-top: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; gap: 10px; }
.ws-left-foot .usage { padding: 0 4px; }
.follow-chips { justify-content: flex-start; margin: 0; gap: 6px; }
.follow-chips .chip { padding: 5px 11px; font-size: 12.5px; }
.ws-center { padding: 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.ws-right { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.prompt-bubble { background: var(--panel); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 14px; }
.steps .ico { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); margin-top: 2px; display: grid; place-items: center; }
.steps li.done .ico { background: var(--teal); border-color: var(--teal); }
.steps li.done .ico::after { content: ""; width: 8px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.steps li.active .ico { border-color: var(--teal); }
.steps li.active .ico::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); animation: pulse 1s infinite alternate; }
.steps li.error .ico { background: var(--orange); border-color: var(--orange); }
.steps li.todo { color: var(--faint); }
.steps .t { font-weight: 600; }
.steps li.todo .t { font-weight: 500; }
.steps .d { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
@keyframes pulse { from { opacity: 0.35; } to { opacity: 1; } }
.summary p { margin: 0 0 12px; font-size: 15px; }
.summary ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.know { background: var(--orange-soft); border: 1px solid #f6c9a8; border-radius: 12px; padding: 14px 16px; color: var(--orange-ink); font-size: 14px; }
.know h5 { margin: 0 0 6px; font-size: 12.5px; letter-spacing: 0.06em; }
.know ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.version-card { display: flex; gap: 12px; align-items: center; padding: 12px; }
.version-card .sw { width: 40px; height: 52px; border-radius: 8px; flex: none; }
.version-card .info { flex: 1; font-size: 13px; color: var(--muted); }
.version-card .info b { color: var(--ink); font-size: 15px; }
.followup { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.followup .row { display: flex; gap: 8px; align-items: flex-end; }
.followup textarea { flex: 1; border: 0; outline: 0; resize: none; min-height: 40px; max-height: 120px; padding: 6px 4px; font-size: 14.5px; }
.send { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--teal); color: #fff; display: grid; place-items: center; flex: none; }
.send:disabled { background: #cfd9d7; }
.note-chip { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 6px; background: var(--teal-soft); color: var(--teal-ink); font-size: 12.5px; font-weight: 600; }
.note-chip button { border: 0; background: none; color: inherit; padding: 0; font-size: 14px; line-height: 1; }
.queued { padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }

.hint { font-size: 13.5px; color: var(--muted); }
/* dragging the before/after divider must never select the labels or the page */
.player, .ba-slider { -webkit-user-select: none; user-select: none; }
.player { position: relative; border-radius: 18px; overflow: hidden; background: #111; box-shadow: var(--shadow); max-width: 100%; touch-action: none; }
.player canvas { display: block; max-width: 100%; max-height: calc(100vh - 260px); width: auto; height: auto; cursor: crosshair; }
.player .badge { position: absolute; top: 12px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; pointer-events: none; }
.player .badge.after { left: 12px; background: #fff; }
.player .badge.before { right: 12px; background: rgba(22, 22, 22, 0.8); color: #fff; }
.player .divider { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; cursor: ew-resize; }
.player .divider::before { content: ""; position: absolute; inset: 0 -12px; }
.player .knob { position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink); }
.player .controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); color: #fff; font-size: 12.5px; }
.player .play { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); display: grid; place-items: center; flex: none; }
.player input[type=range].seek { flex: 1; accent-color: #fff; }
.player .marker { position: absolute; width: 22px; height: 22px; margin: -11px; border-radius: 50%; background: var(--teal); border: 3px solid #fff; box-shadow: var(--shadow); pointer-events: none; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 14, 14, 0.55); color: #fff; text-align: center; backdrop-filter: blur(2px); }
.overlay .spin { width: 46px; height: 46px; margin: 0 auto 12px; animation: spin 1.6s linear infinite; }
.overlay .bar { width: 180px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); margin: 12px auto 0; overflow: hidden; }
.overlay .bar i { display: block; height: 100%; background: #fff; transition: width 0.3s; }
@keyframes spin { to { transform: rotate(360deg); } }
.ba-slider { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.ba-slider input { width: 260px; accent-color: var(--teal); }
.clip-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.clip-tabs button { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12.5px; }
.clip-tabs button.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }

.panel { padding: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }
.note-card textarea { width: 100%; min-height: 66px; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; outline: none; resize: vertical; margin: 8px 0 12px; }
.note-card textarea:focus { border-color: var(--teal); }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
details.tune summary { cursor: pointer; font-weight: 700; font-size: 16px; list-style: none; display: flex; justify-content: space-between; }
details.tune summary::after { content: "+"; color: var(--muted); }
details.tune[open] summary::after { content: "−"; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; margin-top: 10px; }
.slider span.v { color: var(--muted); font-variant-numeric: tabular-nums; }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--teal); }
.hue-input { background: linear-gradient(90deg, red, #ff0, lime, cyan, blue, #f0f, red); border-radius: 4px; height: 6px; }
.export-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
.export-grid select { width: 100%; }
.export-grid label { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.progress { height: 6px; border-radius: 3px; background: var(--panel); overflow: hidden; margin: 10px 0 4px; }
.progress i { display: block; height: 100%; background: var(--teal); width: 0; }
.usage { font-size: 12.5px; color: var(--muted); padding: 12px 16px; }

.machine { background: #161616; color: #e9e7e2; border-radius: 14px; padding: 16px 18px; font: 12.5px/1.75 var(--mono); min-height: 120px; }
.machine .hd { display: flex; justify-content: space-between; font: 600 13.5px var(--sans); margin-bottom: 8px; }
.machine .hd span { color: #8d8b86; font-weight: 400; font-size: 12px; }
.machine .cmd { color: #9fb7ff; }
.machine .ok { color: #8fd6a8; }
.machine .val { color: #f3c27a; }
.machine .err { color: #ff9b85; }

/* ---------- looks */
.looks-page { max-width: 1320px; margin: 0 auto; padding: 40px 24px 80px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.new-look { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1.5px dashed #a9d3cd; background: #f3f9f8; border-radius: var(--radius); margin: 24px 0 20px; }
.new-look .up { width: 50px; height: 50px; border-radius: 12px; background: var(--teal); color: #fff; display: grid; place-items: center; flex: none; font-size: 22px; }
.new-look .txt { flex: 1; }
.new-look b { font-size: 16px; }
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.look-card { display: flex; gap: 14px; padding: 14px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.look-card.on { border: 2px solid var(--teal); padding: 13px; }
.look-card h4 { margin: 0; font-size: 16px; }
.look-card p { margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.mini-scene { position: relative; width: 96px; height: 128px; border-radius: 10px; overflow: hidden; flex: none; }
.mini-scene i { position: absolute; left: 50%; top: 42%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; }
.swatches { display: flex; gap: 6px; }
.swatches span { width: 22px; height: 22px; border-radius: 5px; }
.palette { display: flex; height: 34px; border-radius: 9px; overflow: hidden; margin: 14px 0 18px; }
.palette span { flex: 1; }
.look-detail { position: sticky; top: 84px; padding: 24px; }
.look-detail h3 { font-size: 24px; margin: 0; letter-spacing: -0.02em; }
.look-detail .kv dd { text-align: left; }
.look-detail .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- grade detail (saved) */
.saved { max-width: 900px; margin: 0 auto; padding: 32px 24px 80px; }
.saved-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; margin-top: 20px; }

/* ---------- chat thread */
.msg { display: flex; flex-direction: column; gap: 6px; }
.msg.user { align-items: flex-end; }
.msg.user .bubble { max-width: 88%; background: var(--panel); border-radius: 14px 14px 4px 14px; padding: 10px 13px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.msg-label { font-size: 12px; color: var(--muted); }
.msg-imgs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.msg-imgs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.msg.ai { gap: 10px; font-size: 14.5px; }
.msg.ai p { margin: 0; }
.msg.ai ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.ai-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; }
.ai-avatar { width: 22px; height: 22px; display: grid; place-items: center; }
.ai-avatar svg { width: 20px; height: 20px; }
.version-card.on { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.attach-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.attach { position: relative; width: 52px; height: 52px; }
.attach img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.attach button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 13px; line-height: 20px; padding: 0; }
.attach-btn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.attach-btn:hover { background: var(--panel); color: var(--ink); }
.followup.drag { outline: 2px dashed var(--teal); outline-offset: 2px; }
.followup .row { align-items: flex-end; }
.followup textarea { overflow-y: hidden; }

/* ---------- account + sign in */
.account { position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; }
.menu { position: absolute; right: 0; top: 42px; min-width: 220px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); z-index: 30; }
.login { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px 16px; background: var(--panel); }
.login-card { width: 100%; max-width: 420px; padding: 32px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login-card h2.display { font-size: 40px; margin: 0; }
.login-card p { margin: 0; }
.btn.google { height: 44px; gap: 10px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.email-form { display: flex; flex-direction: column; gap: 10px; }
.email-form input { height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; outline: none; }
.email-form input:focus { border-color: var(--teal); }
.email-form .btn { height: 44px; }

/* ---------- server renders */
.srv { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.srv h4 { margin: 0 0 4px; font-size: 14.5px; }
.render-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.render-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.render-list li b { font-weight: 600; word-break: break-all; }
.render-list .progress { margin: 0; flex: none; }

/* ---------- toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); max-width: 520px; }
.toast.err { background: #8a2a12; }

@media (max-width: 1180px) {
  .ws { grid-template-columns: 300px minmax(0, 1fr); }
  .ws-main { grid-template-columns: minmax(0, 1fr); }
  .looks-page { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: auto 1fr; padding: 0 16px; }
  #model-pill { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; }
  .nav { justify-self: end; gap: 0; }
  .nav a { padding: 6px 8px; font-size: 13px; white-space: nowrap; }
  .ws-head { height: auto; min-height: 56px; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .ws-head h1 { font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ws-head .right { margin-left: 0; width: 100%; }
  .ws-head .right .btn { flex: 1; }
  .ws-left-body, .ws-center, .ws-right { padding: 16px; }
  .player canvas { max-height: 60vh; }
  .ba-slider input { width: 160px; }
  .composer-bar .select { max-width: 46%; }
  .looks-page, .saved { padding: 28px 16px 60px; }
  h2.display { font-size: 34px; }
  .new-look { flex-wrap: wrap; }
  .home { padding: 32px 16px 60px; }
  body.in-ws { overflow: auto; }
  .ws { grid-template-columns: minmax(0, 1fr); height: auto; }
  .ws-main { overflow: visible; }
  .ws-left { height: auto; border-right: 0; }
  .ws-left-body { overflow: visible; }
  .ws-left-foot { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -6px 16px rgba(22, 22, 22, 0.06); }
  .ref-slot { margin-left: 0; border-left: 0; padding-left: 0; }
  .saved-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nav a[data-route="home"] { display: none; }
  .topbar { padding: 0 12px; }
}
@media (max-width: 420px) {
  .wordmark { font-size: 22px; }
  .nav a { padding: 5px 6px; font-size: 12.5px; }
  .chip { padding: 6px 11px; font-size: 13px; }
  .login-card { padding: 24px 20px; }
}

/* ---------- desktop */
.link-btn { border: 0; background: none; padding: 0; color: var(--teal-ink); font-weight: 600; cursor: pointer; }
body.desktop { user-select: none; }
body.desktop input, body.desktop textarea, body.desktop .msg, body.desktop .summary { user-select: text; }

.look-tag { gap: 6px; }
.look-tag button { border: 0; background: none; color: inherit; padding: 0 0 0 2px; font-size: 15px; line-height: 1; }

/* ---------- plan & credits */
.account { display: flex; align-items: center; gap: 10px; }
.credits-pill { color: var(--ink); font-weight: 600; }
.credits-pill:hover { border-color: var(--teal); }
.plan-page { max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px; display: flex; flex-direction: column; gap: 22px; }
.plan-page h2.display { margin: 0; }
.lede-small { margin: -10px 0 0; font-size: 16px; }
.current-plan { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; padding: 18px 22px; }
.current-plan b { font-size: 20px; }
.current-plan .btn { margin-left: auto; }
.billing-toggle { align-self: center; display: inline-flex; padding: 4px; border-radius: 12px; background: var(--panel); }
.billing-toggle button { border: 0; background: none; padding: 8px 18px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.billing-toggle button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.save { color: var(--orange); font-weight: 700; margin-left: 4px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.price-card { padding: 24px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.price-card.featured { border: 2px solid var(--teal); padding: 23px; }
.price-card .tag { position: absolute; top: -12px; left: 22px; }
.price-card h3 { margin: 0; font-size: 18px; }
.price b { font: 900 40px/1 var(--display); letter-spacing: -0.04em; }
.price span { color: var(--muted); }
.price-card ul { margin: 6px 0 10px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; flex: 1; }
.pack-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.pill.warn.credits-pill { color: var(--orange-ink); }

/* ---------- export window */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(22, 22, 22, 0.45); display: grid; place-items: center; padding: 16px; }
.modal { position: relative; width: min(460px, 100%); padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
.modal h3 { margin: 0 0 16px; font-size: 20px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--panel); font-size: 18px; line-height: 1; }

/* ---------- own AI key */
.own-key { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.own-key-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.own-key-row input { flex: 1; min-width: 220px; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; outline: none; font-family: var(--mono); font-size: 13px; }
.own-key-row input:focus { border-color: var(--teal); }

/* monthly / yearly switch on the Plans page */
.period-toggle { display: inline-flex; gap: 4px; padding: 4px; margin: 22px 0 18px; border-radius: 999px; background: var(--panel); }
.period-toggle button { border: 0; background: none; padding: 8px 18px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.period-toggle button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.period-toggle .save { color: var(--teal); font-size: 12px; margin-left: 4px; }

/* export window: cloud export first, then the free local export and the LUT */
.exp-option { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.exp-option:first-of-type { border-top: 0; }
.exp-option .btn { align-self: flex-start; }
