/* ───────────────────────── Atelier ─────────────────────────
   Darkroom-editorial: warm black, paper ink, one accent per mode.
   Conversations are set like a magazine — prompts as headlines,
   answers as body copy, a numbered margin rail. */

:root {
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  --bg: #0e0d0b;
  --bg-2: #161511;
  --bg-3: #1e1c17;
  --surface: rgba(255, 248, 230, 0.035);
  --surface-2: rgba(255, 248, 230, 0.06);
  --line: rgba(236, 230, 217, 0.09);
  --line-2: rgba(236, 230, 217, 0.18);
  --ink: #ece6d9;
  --ink-2: #a8a295;
  --ink-3: #6f6a60;
  --on-accent: #0e0d0b;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);

  --c-ask: #c8f25a;
  --c-code: #5ee6d0;
  --c-image: #ff8a5b;
  --c-video: #ff6fa8;
  --c-ideas: #ffc94a;
  --c-build: #9fb0ff;
  --accent: var(--c-ask);

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
  --dock-h: 170px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #f3eee3; --bg-2: #ebe5d7; --bg-3: #e2dbcb;
    --surface: rgba(40, 30, 10, 0.035); --surface-2: rgba(40, 30, 10, 0.06);
    --line: rgba(40, 30, 10, 0.1); --line-2: rgba(40, 30, 10, 0.2);
    --ink: #1b1a16; --ink-2: #5b564c; --ink-3: #8d877a; --on-accent: #fbf8f1;
    --shadow: 0 30px 80px -40px rgba(60, 40, 10, 0.35);
    --c-ask: #4d7a00; --c-code: #0a7c6d; --c-image: #c4481c; --c-video: #b3265f; --c-ideas: #936400; --c-build: #3a4fc9;
    color-scheme: light;
  }
}
:root[data-theme='light'] {
  --bg: #f3eee3; --bg-2: #ebe5d7; --bg-3: #e2dbcb;
  --surface: rgba(40, 30, 10, 0.035); --surface-2: rgba(40, 30, 10, 0.06);
  --line: rgba(40, 30, 10, 0.1); --line-2: rgba(40, 30, 10, 0.2);
  --ink: #1b1a16; --ink-2: #5b564c; --ink-3: #8d877a; --on-accent: #fbf8f1;
  --shadow: 0 30px 80px -40px rgba(60, 40, 10, 0.35);
  --c-ask: #4d7a00; --c-code: #0a7c6d; --c-image: #c4481c; --c-video: #b3265f; --c-ideas: #936400; --c-build: #3a4fc9;
  color-scheme: light;
}

[data-mode='ask'], [data-kind='ask'] { --accent: var(--c-ask); }
[data-mode='code'], [data-kind='code'] { --accent: var(--c-code); }
[data-mode='image'], [data-kind='image'] { --accent: var(--c-image); }
[data-mode='video'], [data-kind='video'] { --accent: var(--c-video); }
[data-mode='ideas'], [data-kind='ideas'] { --accent: var(--c-ideas); }
[data-mode='build'], [data-kind='build'] { --accent: var(--c-build); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* atmosphere */
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 60; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.halo {
  position: fixed; left: 50%; bottom: -38vh; width: 120vw; height: 70vh; translate: -50% 0;
  pointer-events: none; z-index: 0; opacity: 0.16;
  background: radial-gradient(closest-side, var(--accent), transparent 70%);
  filter: blur(40px);
  transition: background 0.8s var(--ease);
}

/* ── top bar ── */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: linear-gradient(var(--bg) 40%, transparent);
  -webkit-app-region: drag;
}
.top > * { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 26px; letter-spacing: -0.01em; }
.brand-mark {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--accent); border-top-color: transparent; rotate: -30deg;
  position: relative; transition: border-color 0.5s var(--ease), rotate 0.8s var(--ease);
}
.brand-mark::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--ink); scale: 0.55; }
body.busy .brand-mark { animation: spin 1.1s linear infinite; }
@keyframes spin { to { rotate: 330deg; } }
.top-right { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  color: var(--ink-2); transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.subtle { width: 36px; height: 36px; }
.icon-btn.on { color: var(--accent); }
.key-state { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-right: 8px; transition: background 0.3s; }
.key-state.ok { background: var(--c-ask); box-shadow: 0 0 12px var(--c-ask); }
.key-state.bad { background: var(--c-video); }

/* ── stage ── */
#stage {
  position: relative; z-index: 1; height: 100dvh; overflow-y: auto; overflow-x: hidden;
  padding: calc(env(safe-area-inset-top) + 76px) 16px calc(var(--dock-h) + 40px);
  scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}

/* ── welcome ── */
.welcome { max-width: 980px; margin: 0 auto; padding: 4vh 0 0; }
.welcome.gone { display: none; }
.eyebrow {
  font: 500 11px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 18px;
}
.greeting {
  font: 400 clamp(46px, 8.4vw, 104px)/0.95 var(--serif); letter-spacing: -0.025em; margin: 0 0 6vh;
  animation: rise 0.9s var(--ease) both;
}
.greeting em { color: var(--accent); transition: color 0.6s var(--ease); }
.greet-name:not(:empty)::before { content: ', '; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.tile {
  --accent: var(--c-ask);
  position: relative; overflow: hidden; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  padding: 18px 18px 16px; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between;
  transition: border-color 0.3s, transform 0.4s var(--ease), background 0.3s;
  animation: rise 0.8s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 150ms);
}
.tile:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-3px); background: var(--surface-2); }
.tile:nth-child(1) { grid-column: span 3; grid-row: span 2; min-height: 310px; }
.tile:nth-child(2) { grid-column: span 3; }
.tile:nth-child(3) { grid-column: span 2; }
.tile:nth-child(4) { grid-column: span 1; }
.tile:nth-child(5) { grid-column: span 3; }
.tile:nth-child(6) { grid-column: span 3; }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-name { font: 400 30px/1 var(--serif); font-style: italic; }
.tile:nth-child(1) .tile-name { font-size: 54px; }
.tile-key { font: 500 10px/1 var(--mono); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 6px; }
.tile-desc { color: var(--ink-2); font-size: 14px; margin: 8px 0 0; max-width: 32ch; }
.tile-try { font: 400 12px/1.45 var(--mono); color: var(--accent); margin-top: 14px; opacity: 0.85; }
.tile-try::before { content: '→ '; }
.tile-glyph {
  position: absolute; right: -30px; bottom: -30px; width: 150px; height: 150px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); opacity: 0.6; pointer-events: none;
  transition: scale 0.6s var(--ease);
}
.tile-glyph::after { content: ''; position: absolute; inset: 28px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); }
.tile:nth-child(1) .tile-glyph { width: 280px; height: 280px; right: -60px; bottom: -80px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent); }
.tile:hover .tile-glyph { scale: 1.12; }
.tile:nth-child(4) .tile-desc, .tile:nth-child(4) .tile-try { display: none; }
.tile:nth-child(4) { justify-content: flex-start; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── stream ── */
.stream { list-style: none; margin: 0 auto; padding: 0; max-width: 860px; }
.entry {
  display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 0 18px;
  padding: 26px 0 30px; border-top: 1px solid var(--line);
  animation: rise 0.6s var(--ease) both;
}
.entry:first-child { border-top: 0; }
.rail { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.rail-num { font: 400 38px/0.9 var(--serif); color: var(--ink-3); letter-spacing: -0.02em; }
.rail-kind { font: 500 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.rail-kind::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.rail-time { font: 400 10px/1 var(--mono); color: var(--ink-3); }

.prompt {
  font: 400 clamp(24px, 3.2vw, 34px)/1.12 var(--serif); letter-spacing: -0.01em; margin: 0 0 16px;
  white-space: pre-wrap; overflow-wrap: anywhere; cursor: text;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.prompt.open { -webkit-line-clamp: unset; }
.prompt-thumbs { display: flex; gap: 8px; margin: -6px 0 16px; }
.prompt-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-2); }

.meta-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 400 11px/1.4 var(--mono); color: var(--ink-3); margin-bottom: 12px; }
.meta-line b { color: var(--ink-2); font-weight: 500; }

.status { display: inline-flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); color: var(--ink-2); letter-spacing: 0.04em; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; scale: 0.7; } }
.shimmer {
  background: linear-gradient(90deg, var(--ink-3) 20%, var(--ink) 50%, var(--ink-3) 80%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.8s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.error-box {
  border: 1px solid color-mix(in srgb, var(--c-video) 45%, transparent); background: color-mix(in srgb, var(--c-video) 8%, transparent);
  border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; color: var(--ink);
}
.error-box b { color: var(--c-video); font-weight: 600; }

/* thinking trace */
.think { border-left: 2px solid var(--line-2); padding: 2px 0 2px 14px; margin: 0 0 16px; }
.think summary { list-style: none; cursor: pointer; font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.think summary::-webkit-details-marker { display: none; }
.think summary::after { content: '+'; font-size: 14px; }
.think[open] summary::after { content: '−'; }
.think-body { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; max-height: 320px; overflow: auto; margin-top: 8px; }

/* prose */
.prose { font-size: 16.5px; line-height: 1.72; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 0.9em; }
.prose h1, .prose h2, .prose h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; line-height: 1.15; margin: 1.3em 0 0.45em; }
.prose h1 { font-size: 1.9em; } .prose h2 { font-size: 1.6em; } .prose h3 { font-size: 1.3em; font-style: italic; }
.prose h4 { font: 600 0.8em/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin: 1.4em 0 0.5em; }
.prose strong { font-weight: 650; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: 0.3em 0; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin: 1em 0; padding: 0.2em 0 0.2em 1.1em; border-left: 2px solid var(--accent); color: var(--ink-2); font-family: var(--serif); font-size: 1.2em; font-style: italic; }
.prose hr { border: 0; height: 1px; background: var(--line-2); margin: 2em 0; }
.prose a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose :not(pre) > code { font: 0.86em var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 0.12em 0.4em; border-radius: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92em; margin: 1em 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.prose th { font: 600 11px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.prose img { max-width: 100%; border-radius: var(--r-md); }
.caret { display: inline-block; width: 0.5em; height: 1.05em; background: var(--accent); vertical-align: -0.15em; margin-left: 2px; animation: blink 1s steps(2) infinite; border-radius: 2px; }
@keyframes blink { 50% { opacity: 0; } }

/* code blocks */
.codeblock { margin: 1.1em 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); overflow: hidden; }
.codeblock-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font: 500 11px/1 var(--mono); color: var(--ink-3); letter-spacing: 0.06em; }
.codeblock-bar .acts { display: flex; gap: 2px; }
.mini {
  font: 500 11px/1 var(--mono); color: var(--ink-2); padding: 7px 9px; border-radius: 7px; letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 6px; transition: background 0.2s, color 0.2s;
}
.mini:hover { background: var(--surface-2); color: var(--ink); }
.mini svg { width: 14px; height: 14px; }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.6 var(--mono); tab-size: 2; }
.codeblock code { font-family: inherit; background: none; }

/* highlight.js — themed with our tokens */
.hljs-comment, .hljs-quote { color: var(--ink-3); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-meta .hljs-keyword { color: var(--c-build); }
.hljs-string, .hljs-attr + .hljs-string, .hljs-template-tag, .hljs-regexp { color: var(--c-ask); }
.hljs-number, .hljs-literal, .hljs-symbol { color: var(--c-ideas); }
.hljs-title, .hljs-title.function_, .hljs-section { color: var(--c-code); }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-property, .hljs-params { color: var(--c-image); }
.hljs-tag, .hljs-name, .hljs-selector-class, .hljs-selector-id { color: var(--c-video); }
.hljs-type, .hljs-class .hljs-title { color: var(--c-ideas); }
.hljs-meta { color: var(--ink-2); }

/* entry action row */
.actions { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 16px; margin-left: -9px; opacity: 0.55; transition: opacity 0.2s; }
.entry:hover .actions, .actions:focus-within { opacity: 1; }
@media (hover: none) { .actions { opacity: 1; } }

/* ── images ── */
.shots { display: grid; gap: 10px; }
.shot { position: relative; margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); max-width: 640px; }
.shot img, .shot video { display: block; width: 100%; height: auto; cursor: zoom-in; }
.shot video { cursor: default; }
.shot-acts {
  position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 4px; flex-wrap: wrap;
  opacity: 0; translate: 0 6px; transition: opacity 0.25s, translate 0.25s var(--ease);
}
.shot:hover .shot-acts, .shot:focus-within .shot-acts { opacity: 1; translate: 0 0; }
@media (hover: none) { .shot-acts { opacity: 1; translate: 0; } }
.shot-acts .mini { background: color-mix(in srgb, #0e0d0b 72%, transparent); color: #ece6d9; backdrop-filter: blur(10px); }
.shot-acts .mini:hover { background: #0e0d0b; }
.shot-acts .mini.accent { background: var(--accent); color: #0e0d0b; }

.developing {
  position: relative; border-radius: var(--r-md); overflow: hidden; max-width: 640px;
  background: var(--bg-2); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.developing::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 30% 40%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(50% 60% at 75% 70%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  animation: develop 3.2s ease-in-out infinite alternate;
  filter: blur(18px);
}
.developing::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
  background-size: 250% 100%; animation: shimmer 2.2s linear infinite;
}
.developing .status { position: relative; z-index: 1; background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 8px 12px; border-radius: 99px; backdrop-filter: blur(6px); }
@keyframes develop { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.25) translate(4%, -3%); } }

/* ── ideas ── */
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 4px; }
.idea {
  position: relative; border-radius: 16px; padding: 18px 18px 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  rotate: var(--tilt, 0deg); transition: rotate 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.3s;
  animation: deal 0.6s var(--ease) both; animation-delay: calc(var(--i) * 70ms);
  display: flex; flex-direction: column;
}
.idea::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px; opacity: 0.8; }
.idea:hover { rotate: 0deg; transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.idea-n { font: 400 34px/1 var(--serif); color: var(--accent); }
.idea h4 { font: 600 16px/1.3 var(--sans); margin: 8px 0 6px; }
.idea p { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 0 0 10px; flex: 1; }
.idea-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.idea-tags span { font: 500 10px/1 var(--mono); color: var(--ink-3); border: 1px solid var(--line-2); padding: 4px 6px; border-radius: 5px; }
.idea-acts { display: flex; gap: 2px; margin-left: -9px; border-top: 1px dashed var(--line-2); padding-top: 8px; }
@keyframes deal { from { opacity: 0; transform: translateY(24px) rotate(-4deg); } to { opacity: 1; transform: none; } }

/* ── app builder ── */
.appcard { border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow); }
.appbar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 6px; margin-right: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.dots i:first-child { background: var(--accent); }
.apptitle { font: 500 12px/1 var(--mono); color: var(--ink-2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.tabs button { font: 500 11px/1 var(--mono); padding: 6px 10px; border-radius: 7px; color: var(--ink-2); }
.tabs button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 0 var(--line-2); }
.appframe { display: block; width: 100%; height: min(62vh, 560px); border: 0; background: #fff; }
.appcode { margin: 0; max-height: min(62vh, 560px); overflow: auto; padding: 14px 16px; font: 12.5px/1.6 var(--mono); }
.appcode.live { color: var(--ink-2); }
.appfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--line); }
.appfoot .grow { flex: 1; }
.buildmeter { display: flex; align-items: center; gap: 12px; padding: 18px; }
.buildmeter .bar { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.buildmeter .bar i { display: block; height: 100%; width: 30%; background: var(--accent); border-radius: 3px; animation: indet 1.4s var(--ease) infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* ── dock: one card — mode tabs on top, input in the middle, a single strip of options ── */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 0 12px calc(env(safe-area-inset-bottom) + 12px);
  pointer-events: none;
}
.dock::before { content: ''; position: absolute; inset: -64px 0 0; background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 88%, transparent) 45%, var(--bg) 80%); pointer-events: none; }
.dock-inner { position: relative; max-width: 780px; margin: 0 auto; pointer-events: auto; }

.composer {
  position: relative; border-radius: 26px; overflow: hidden;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.composer::before { /* accent hairline across the top edge */
  content: ''; position: absolute; left: 22px; right: 22px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 70%, transparent), transparent);
  opacity: 0.7; transition: background 0.5s;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-2)); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.65), 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent); }
.composer.drag { border-style: dashed; border-color: var(--accent); }

/* mode tabs */
.modes {
  position: relative; display: flex; gap: 2px; padding: 6px 6px 0; overflow-x: auto; scrollbar-width: none;
}
.modes::-webkit-scrollbar { display: none; }
.mode {
  position: relative; z-index: 1; flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 12px; font: 500 13px/1 var(--sans); color: var(--ink-3);
  white-space: nowrap; transition: color 0.25s;
}
.mode svg { width: 16px; height: 16px; stroke-width: 1.8; }
.mode:hover { color: var(--ink-2); }
.mode[aria-selected='true'] { color: var(--accent); }
.mode-ink {
  position: absolute; z-index: 0; top: 6px; height: 34px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  transition: left 0.4s var(--ease), width 0.4s var(--ease), background 0.4s;
}

/* input row */
.composer-row { display: flex; align-items: flex-end; gap: 2px; padding: 6px 8px 4px; }
#input {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent;
  font: 400 16.5px/1.5 var(--sans); padding: 8px 6px; max-height: 38vh; min-height: 40px;
}
#input::placeholder { color: var(--ink-3); }
.composer-row .icon-btn { width: 40px; height: 40px; border-radius: 50%; }
.send {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; margin-left: 2px;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform 0.2s var(--ease), background 0.4s, box-shadow 0.4s;
}
.send:hover { transform: scale(1.06); }
.send:active { transform: scale(0.94); }
.send svg { stroke-width: 2.3; }
.send .i-stop { display: none; fill: currentColor; stroke: none; }
body.busy .send .i-send { display: none; }
body.busy .send .i-stop { display: block; }
#micBtn.listening { color: var(--c-video); animation: pulse 1.2s infinite; }

/* options strip: one line, never wraps, fades at the edge */
.options {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; padding: 2px 12px 10px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.options:empty { display: none; }
.options::-webkit-scrollbar { display: none; }
.opt { flex: none; display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1 var(--mono); color: var(--ink-3); }
.chip, .opt select {
  appearance: none; -webkit-appearance: none; font: 500 11.5px/1 var(--mono); color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; cursor: pointer;
  white-space: nowrap; transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.options .chip, .options .opt select { flex: none; height: 28px; padding: 0 11px; border-radius: 99px; display: inline-flex; align-items: center; }
.opt select { padding-right: 24px !important; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 13px) 52%, calc(100% - 9px) 52%; background-size: 4px 4px; background-repeat: no-repeat; max-width: 210px; text-overflow: ellipsis; }
.opt select option { background: var(--bg-2); color: var(--ink); }
.chip:hover, .opt select:hover { border-color: var(--line-2); color: var(--ink); }
.chip.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip.danger:hover { color: var(--c-video); border-color: var(--c-video); }
.opt-sep { width: 1px; height: 14px; background: var(--line-2); flex: none; margin: 0 2px; }
.opt-note { flex: none; font: 400 11px/1 var(--mono); color: var(--ink-3); white-space: nowrap; padding-right: 24px; }

.attachments { display: flex; gap: 8px; padding: 10px 14px 0; }
.attachments:empty { display: none; }
.att { position: relative; width: 58px; height: 58px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); }
.att img { width: 100%; height: 100%; object-fit: cover; }
.att button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.7); color: #fff; display: grid; place-items: center; }
.att button svg { width: 12px; height: 12px; }

/* phones: icon-only tabs except the active one; drop hint text */
@media (max-width: 640px) {
  .dock { padding: 0 8px calc(env(safe-area-inset-bottom) + 8px); }
  .composer { border-radius: 24px; }
  .mode { flex: 1 1 0; padding: 0 8px; min-width: 40px; }
  .mode span { display: none; }
  .mode[aria-selected='true'] { flex: 0 0 auto; padding: 0 12px; }
  .mode[aria-selected='true'] span { display: inline; }
  .opt-note { display: none; }
  .composer-row .icon-btn { width: 38px; height: 38px; }
}

/* ── drawers ── */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(5, 5, 4, 0.5); backdrop-filter: blur(3px); animation: fade 0.25s both; }
.drawer {
  position: fixed; top: 0; bottom: 0; z-index: 50; width: min(400px, 90vw);
  background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 16px);
  animation: slideL 0.4s var(--ease) both;
}
.drawer.left { left: 0; border-radius: 0 24px 24px 0; }
.drawer.right { right: 0; width: min(520px, 94vw); border-radius: 24px 0 0 24px; animation-name: slideR; }
@keyframes slideL { from { transform: translateX(-100%); } }
@keyframes slideR { from { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-head h3 { margin: 0; font-size: 32px; font-weight: 400; }
.search {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: 0; margin-bottom: 10px;
}
.search:focus { border-color: var(--line-2); }
.thread-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.thread-group { font: 500 10px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); padding: 16px 10px 8px; }
.thread {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; transition: background 0.2s;
}
.thread:hover, .thread.on { background: var(--surface-2); }
.thread-dots { display: flex; gap: 3px; flex: none; width: 30px; flex-wrap: wrap; }
.thread-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.thread-body { flex: 1; min-width: 0; }
.thread-title { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-sub { font: 400 11px/1.3 var(--mono); color: var(--ink-3); }
.thread .del { opacity: 0; }
.thread:hover .del { opacity: 1; }
@media (hover: none) { .thread .del { opacity: 0.6; } }
.empty-note { color: var(--ink-3); font-size: 14px; padding: 20px 10px; }

.lib-filter { display: flex; gap: 6px; margin-bottom: 12px; }
.lib-grid { flex: 1; overflow-y: auto; columns: 2 160px; column-gap: 8px; }
.lib-item { break-inside: avoid; margin-bottom: 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; position: relative; background: var(--surface); }
.lib-item img, .lib-item video { display: block; width: 100%; }
.lib-item.app { padding: 14px; }
.lib-item.app b { font: 400 22px/1.1 var(--serif); font-style: italic; display: block; margin-bottom: 6px; }
.lib-item.app span { font: 400 11px/1.3 var(--mono); color: var(--ink-3); }
.lib-item .tag { position: absolute; top: 6px; left: 6px; font: 500 9px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.6); color: #fff; }

/* ── dialogs ── */
dialog.sheet {
  width: min(600px, calc(100vw - 24px)); max-height: min(88dvh, 860px); padding: 0; border: 1px solid var(--line-2);
  border-radius: 26px; background: var(--bg-2); color: var(--ink); box-shadow: var(--shadow); overflow: hidden;
}
dialog.sheet[open] { animation: pop 0.4s var(--ease) both; }
dialog::backdrop { background: rgba(5, 5, 4, 0.6); backdrop-filter: blur(6px); }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(0.98); } }
.sheet-body { display: flex; flex-direction: column; max-height: min(88dvh, 860px); overflow-y: auto; padding: 22px 24px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { margin: 0; font-size: 40px; font-weight: 400; }
.field-group { padding: 16px 0; border-top: 1px solid var(--line); }
.field-group:first-of-type { border-top: 0; }
.field-group h4 { margin: 0 0 12px; font: 500 10px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 13.5px; font-weight: 500; }
.field small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12px; }
.field input:not([type='range']), .field textarea, .onboard input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; outline: 0; font-size: 14.5px;
}
.field input:focus, .field textarea:focus, .onboard input:focus { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2)); }
.field input[type='range'] { accent-color: var(--accent); }
.key-row { display: flex; gap: 6px; align-items: center; }
.key-row .chip { flex: none; padding: 10px 12px; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.model-grid .field > span { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.model-grid .field > span i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.model-grid .field input { font: 12.5px var(--mono) !important; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 3px; margin-bottom: 14px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip { display: inline-flex; align-items: center; }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.hint.ok { color: var(--c-ask); } .hint.bad { color: var(--c-video); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14.5px; padding: 11px 20px; border-radius: 12px; transition: transform 0.2s var(--ease); }
.btn-primary:hover { transform: translateY(-1px); }
.link-btn { color: var(--ink-3); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }

.onboard .sheet-body { padding: 30px 28px 24px; gap: 10px; }
.onboard-art { position: relative; height: 90px; margin-bottom: 8px; }
.onboard-art span { position: absolute; border-radius: 50%; border: 2px solid var(--c-ask); }
.onboard-art span:nth-child(1) { width: 80px; height: 80px; left: 0; top: 4px; border-top-color: transparent; animation: spin 6s linear infinite; }
.onboard-art span:nth-child(2) { width: 22px; height: 22px; left: 29px; top: 33px; background: var(--ink); border: 0; }
.onboard-art span:nth-child(3) { width: 16px; height: 16px; left: 10px; top: 4px; background: var(--c-image); border: 0; }
.onboard-title { font: 400 50px/0.98 var(--serif); letter-spacing: -0.02em; margin: 0 0 8px; }
.onboard-title em { color: var(--c-ask); }
.steps { margin: 0 0 8px; padding-left: 1.2em; color: var(--ink-2); font-size: 14.5px; }
.steps li { margin: 5px 0; }
.steps li::marker { color: var(--c-ask); font-family: var(--mono); font-size: 12px; }
.steps code { font: 12.5px var(--mono); background: var(--surface-2); padding: 2px 5px; border-radius: 5px; }
.onboard-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ── viewer ── */
.viewer { position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px); display: flex; flex-direction: column; animation: fade 0.25s both; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 12px 10px 18px; border-bottom: 1px solid var(--line); }
.viewer-title { flex: 1; min-width: 0; font: 400 22px/1.2 var(--serif); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-actions { display: flex; gap: 2px; }
.viewer-body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px; }
.viewer-body img { max-width: 100%; max-height: 100%; border-radius: var(--r-md); box-shadow: var(--shadow); }
.viewer-body iframe { width: 100%; height: 100%; border: 0; border-radius: var(--r-md); background: #fff; }
.viewer-body.full { padding: 0; }
.viewer-body.full iframe { border-radius: 0; }

/* ── toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 16px); translate: -50% 20px; z-index: 80; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 500; padding: 9px 16px; border-radius: 99px;
  transition: opacity 0.25s, translate 0.35s var(--ease); max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; translate: -50% 0; }

/* ── responsive ── */
@media (max-width: 760px) {
  .bento { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile, .tile:nth-child(n) { grid-column: span 1; grid-row: auto; min-height: 128px; padding: 14px; }
  .tile:nth-child(1) { grid-column: span 2; min-height: 170px; }
  .tile:nth-child(1) .tile-name { font-size: 42px; }
  .tile-name { font-size: 25px; }
  .tile-desc { font-size: 13px; }
  .tile-try { display: none; }
  .tile:nth-child(1) .tile-try { display: block; }
  .tile:nth-child(4) .tile-desc { display: block; }
  .entry { grid-template-columns: 1fr; padding: 20px 0 24px; }
  .rail { position: static; flex-direction: row; align-items: center; gap: 10px; padding: 0 0 8px; }
  .rail-num { font-size: 24px; }
  .prompt { font-size: 25px; }
  .prose { font-size: 16px; }
  .model-grid { grid-template-columns: 1fr; }
  .sheet-body { padding: 18px 18px; }
  dialog.sheet { border-radius: 22px; }
  .onboard-title { font-size: 42px; }
  .ideas { grid-template-columns: 1fr; }
  .idea { rotate: 0deg; }
}
@media (min-width: 1280px) {
  .stream { max-width: 900px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* enhanced-prompt caption: two lines, full text on hover */
.meta-line.enhanced { margin-top: -4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 640px; }
.meta-line.enhanced:hover { -webkit-line-clamp: unset; }

/* ── You panel ── */
.drawer.you { width: min(560px, 96vw); }
.you-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px 20px; }
.you-card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 16px; margin-bottom: 12px; }
.you-card h4 { margin: 0 0 12px; font: 500 10px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.you-card .field:last-child { margin-bottom: 0; }
.you-card textarea, .you-card input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; outline: 0; font-size: 14px; resize: vertical; }
.you-card textarea:focus, .you-card input:focus { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2)); }
#meLearned, #meStyle { font-size: 13.5px; line-height: 1.55; }
.sync-state { flex: 1; margin-left: 12px; font: 500 10px/1 var(--mono); letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase; }
.sync-state.ok { color: var(--c-ask); }
.mem-add { display: flex; gap: 6px; margin-bottom: 10px; }
.mem-add .chip { flex: none; padding: 9px 12px; }
.mem-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.mem-list li { display: flex; align-items: flex-start; gap: 8px; padding: 7px 4px 7px 10px; border-radius: 9px; font-size: 13.5px; line-height: 1.45; }
.mem-list li:hover { background: var(--surface-2); }
.mem-list li::before { content: ''; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 8px; }
.mem-list li span { flex: 1; }
.mem-list li small { font: 400 10px/1.8 var(--mono); color: var(--ink-3); flex: none; }
.mem-list li button { flex: none; opacity: 0.4; color: var(--ink-2); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; }
.mem-list li button:hover { opacity: 1; background: var(--surface-2); }
.mem-list li button svg { width: 13px; height: 13px; }
.src-list { list-style: none; margin: 10px 0 0; padding: 0; font: 400 11.5px/1.7 var(--mono); color: var(--ink-3); }
#impStatus:not(:empty) { margin-top: 10px; color: var(--ink-2); }

@media (pointer: coarse) { .tile-key { display: none; } }

/* ── provider status + connections (Settings) ── */
.prov-status { display: flex; flex-direction: column; gap: 4px; margin: 0; font: 400 12.5px/1.5 var(--mono); }
.prov-status .ok { color: var(--c-ask); }
.prov-status .bad { color: var(--ink-3); }
.conn-list { list-style: none; margin: 0 0 10px; padding: 0; }
.conn { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.conn.on .dot { background: var(--c-ask); box-shadow: 0 0 8px var(--c-ask); }
.conn b { font-weight: 600; min-width: 84px; }
.conn .hint { flex: 1; font-family: var(--mono); font-size: 11px; }

/* ── agent steps + approval cards ── */
.steps { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.step { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 13px; min-width: 0; }
.step b { font-weight: 600; flex: none; }
.step .step-sum { flex: 1; min-width: 0; color: var(--ink-3); font: 400 11.5px/1.3 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step i { font-style: normal; flex: none; font: 600 12px/1 var(--mono); color: var(--c-ask); }
.step.error i, .step.error b { color: var(--c-video); }
.step.declined { opacity: 0.6; }
.step.declined i { color: var(--ink-3); }
.svc { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font: 600 12px/1 var(--mono); }
.spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.approve-card { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line-2)); border-radius: 16px; background: color-mix(in srgb, var(--accent) 6%, var(--bg-2)); padding: 14px; animation: rise 0.4s var(--ease) both; }
.ac-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ac-head b { font-size: 15px; }
.ac-tag { margin-left: auto; font: 600 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.ac-fields { display: flex; flex-direction: column; gap: 8px; }
.ac-fields label { display: flex; flex-direction: column; gap: 4px; }
.ac-fields span { font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.ac-fields input, .ac-fields textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: 0; font-size: 14px; resize: vertical; line-height: 1.5; }
.ac-fields input:focus, .ac-fields textarea:focus { border-color: var(--accent); }
.ac-acts { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.ac-acts .btn-primary { padding: 9px 18px; font-size: 14px; }
