/* Doko app: the Refract language (a near-black field ruled by hairlines, one beam split into four
   bands of light) made into a workspace for talking to Doko. */

:root {
  --bg: #07090D;
  --rail: #0A0D12;
  --raise: #10151C;
  --raise-2: #151B24;
  --hover: rgba(237, 241, 244, 0.05);
  --line: #1A222C;
  --line-strong: #2A3441;
  --ink: #EDF1F4;
  --ink-2: #C9D1D9;
  --muted: #8E99A6;
  --faint: #5E6875;
  --accent: #86E5F2;
  --on-accent: #061015;
  --ice: #86E5F2;
  --violet: #9A8CFF;
  --orchid: #EE7FD6;
  --amber: #FFC07A;
  --danger: #FF8C8C;
  --ok: #7EE2A8;
  --split: linear-gradient(90deg, var(--ice), var(--violet) 36%, var(--orchid) 68%, var(--amber));
  --split-v: linear-gradient(180deg, var(--ice), var(--violet) 36%, var(--orchid) 68%, var(--amber));
  --code-bg: #0B0F15;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --font-turn: "Instrument Serif", Georgia, serif;
  --rail-w: 280px;
  --read: 760px;
  --radius: 12px;
  --radius-lg: 20px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F6F7F9;
  --rail: #EEF1F4;
  --raise: #FFFFFF;
  --raise-2: #F1F3F6;
  --hover: rgba(11, 16, 22, 0.05);
  --line: #E0E5EB;
  --line-strong: #C9D1DA;
  --ink: #0B1016;
  --ink-2: #26303B;
  --muted: #5A6573;
  --faint: #8A95A2;
  --accent: #0B7686;
  --on-accent: #FFFFFF;
  --ice: #12A3B6;
  --violet: #6D5CF0;
  --orchid: #C9479F;
  --amber: #D9821C;
  --danger: #C93838;
  --ok: #1E8E55;
  --code-bg: #F2F4F7;
  --shadow: 0 1px 2px rgba(11, 16, 22, 0.06), 0 18px 48px -26px rgba(11, 16, 22, 0.28);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sprite { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
kbd, .hint { font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.02em; color: var(--faint); }

/* ------------------------------------------------------------------ shell */

.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); height: 100dvh; transition: grid-template-columns 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.shell[data-rail="closed"] { grid-template-columns: 0 minmax(0, 1fr); }
.shell[data-rail="closed"] .rail { visibility: hidden; transform: translateX(-12px); opacity: 0; }

.rail {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--rail); border-right: 1px solid var(--line);
  transition: opacity 0.2s, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.28s;
}
.rail__top { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 8px; box-shadow: 0 0 0 1px var(--line-strong); }
.brand__word { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }

.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--muted); transition: background 0.15s, color 0.15s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

.rail__actions { display: grid; gap: 2px; padding: 4px 8px 10px; }
.rail__action { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 10px; color: var(--ink-2); text-align: left; transition: background 0.15s, color 0.15s; }
.rail__action span { flex: 1; }
.rail__action:hover { background: var(--hover); color: var(--ink); }
.rail__action .hint { opacity: 0; transition: opacity 0.15s; }
.rail__action:hover .hint { opacity: 1; }

.rail__scroll { flex: 1; overflow-y: auto; padding: 4px 8px 16px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.rail__group { margin-top: 14px; }
.rail__label { margin: 0 0 4px; padding: 0 10px; font: 500 10.5px/1.6 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.rail__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.rail__empty { margin: 18px 10px; color: var(--faint); font-size: 13px; }

.item { position: relative; display: flex; align-items: center; border-radius: 9px; }
.item__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 34px 0 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.item__link span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item__link svg { width: 16px; height: 16px; color: var(--faint); }
.item:hover .item__link, .item:focus-within .item__link { background: var(--hover); color: var(--ink); }
.item[aria-current="page"] .item__link { background: var(--raise-2); color: var(--ink); }
.item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--split-v); }
.item__more { position: absolute; right: 4px; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--muted); opacity: 0; transition: opacity 0.12s, background 0.12s; }
.item:hover .item__more, .item:focus-within .item__more, .item__more[aria-expanded="true"] { opacity: 1; }
.item__more:hover { background: var(--hover); color: var(--ink); }
.item__more svg { width: 16px; height: 16px; }
.item__rename { flex: 1; height: 32px; margin: 1px 0; padding: 0 10px; border-radius: 8px; border: 1px solid var(--accent); background: var(--raise); outline: none; font-size: 14px; }

.rail__foot { padding: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.upgrade-nudge { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; text-align: left; background: var(--raise); border: 1px solid var(--line); overflow: hidden; transition: border-color 0.15s; }
.upgrade-nudge::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 1px; background: var(--split); opacity: 0.8; }
.upgrade-nudge:hover { border-color: var(--line-strong); }
.upgrade-nudge svg { color: var(--accent); }
.upgrade-nudge span { display: grid; line-height: 1.3; }
.upgrade-nudge strong { font-weight: 500; font-size: 13.5px; }
.upgrade-nudge small { color: var(--muted); font-size: 12px; }
.account { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 12px; text-align: left; transition: background 0.15s; }
.account:hover, .account[aria-expanded="true"] { background: var(--hover); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 500; font-size: 13px; color: var(--ink); background: var(--raise-2); box-shadow: 0 0 0 1px var(--line-strong); position: relative; }
.avatar::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; padding: 1px; background: var(--split); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.75; }
.account__text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.account__name { font-size: 14px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account__plan { font: 500 10.5px/1.5 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.account__chev { color: var(--faint); transform: rotate(180deg); width: 16px; height: 16px; }

.scrim { display: none; }

/* ------------------------------------------------------------------ stage */

.stage { position: relative; display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.topbar { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 14px; flex: none; }
.topbar__rail { display: none; }
.shell[data-rail="closed"] .topbar__rail { display: inline-grid; }
.topbar__title { flex: 1; min-width: 0; text-align: center; color: var(--muted); font-size: 13.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 12px; }
.topbar__end { display: flex; align-items: center; gap: 2px; }
.topbar__new { display: none; }
.shell[data-rail="closed"] .topbar__new { display: inline-grid; }
.model-pick { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 12px; border-radius: 10px; font-weight: 500; font-size: 15px; letter-spacing: -0.01em; color: var(--ink); transition: background 0.15s; }
.model-pick:hover, .model-pick[aria-expanded="true"] { background: var(--hover); }
.model-pick svg { width: 16px; height: 16px; color: var(--muted); }

/* The admin's message to everyone, under the top bar, until dismissed. */
.announce { flex: none; display: flex; align-items: center; gap: 10px; width: min(var(--read), 100% - 32px); margin: 0 auto 6px; padding: 8px 8px 8px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line-strong)); background: color-mix(in srgb, var(--accent) 7%, var(--raise)); color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.announce span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.announce .icon-btn { flex: none; width: 28px; height: 28px; }
.announce .icon-btn svg { width: 14px; height: 14px; }
.view { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.view__inner { width: min(var(--read), 100% - 40px); margin: 0 auto; padding: 12px 0 36px; }

/* ------------------------------------------------------------------ the empty state */

.hello { min-height: 100%; display: grid; align-content: center; justify-items: center; gap: 0; padding: 24px 20px calc(18vh); }
.hello__mark { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 22px; box-shadow: 0 0 0 1px var(--line-strong), 0 18px 40px -16px rgba(134, 229, 242, 0.35); }
.hello h1 { margin: 0; text-align: center; font-weight: 300; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.08; letter-spacing: -0.035em; }
.hello h1 .turn { font-family: var(--font-turn); font-style: italic; font-weight: 400; letter-spacing: -0.01em; text-shadow: -1.5px 0 rgba(154, 140, 255, 0.55), 1.5px 0 rgba(238, 127, 214, 0.45); }
:root[data-theme="light"] .hello h1 .turn { text-shadow: -1px 0 rgba(109, 92, 240, 0.35), 1px 0 rgba(201, 71, 159, 0.3); }
.hello__sub { margin: 12px 0 0; color: var(--muted); font-size: 15px; text-align: center; }
.slips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(var(--read), 100%); margin-top: 34px; }
.slip { position: relative; display: grid; gap: 6px; padding: 14px 14px 16px; border-radius: 14px; text-align: left; background: var(--raise); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; line-height: 1.4; overflow: hidden; transition: border-color 0.15s, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.slip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--split); transform: scaleX(0); transform-origin: left; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.slip:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.slip:hover::after { transform: scaleX(1); }
.slip__tag { font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }

/* ------------------------------------------------------------------ messages */

.thread { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }
.msg { position: relative; min-width: 0; }
.msg--user { display: grid; justify-items: end; }
.bubble { max-width: min(85%, 620px); padding: 11px 16px; border-radius: 18px 18px 6px 18px; background: var(--raise-2); border: 1px solid var(--line); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 9px; background: var(--raise); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); max-width: 260px; }
.file-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-chip small { color: var(--faint); font-family: var(--font-mono); font-size: 10.5px; }
.file-chip svg { width: 15px; height: 15px; color: var(--muted); }
.file-chip button { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: -4px; border-radius: 6px; color: var(--muted); }
.file-chip button:hover { background: var(--hover); color: var(--ink); }

.msg__head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; font: 500 11px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.msg__head img { width: 22px; height: 22px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-strong); }
.msg__head b { color: var(--ink-2); font-weight: 500; }

.prose { color: var(--ink); font-size: 15.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 14px; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { margin: 26px 0 10px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; }
.prose h2 { font-size: 21px; }
.prose h3 { font-size: 18px; }
.prose h4, .prose h5, .prose h6 { font-size: 16px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--faint); }
.prose li.task { list-style: none; margin-left: -20px; display: flex; gap: 9px; align-items: baseline; }
.task__box { flex: none; width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--line-strong); transform: translateY(2px); }
.task__box--done { background: var(--accent); border-color: var(--accent); }
.prose blockquote { margin: 0 0 14px; padding: 2px 0 2px 16px; border-left: 2px solid var(--line-strong); color: var(--ink-2); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 24px 0; }
.math { font-variant-numeric: tabular-nums; white-space: nowrap; }
.math--block { display: block; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); text-align: center; font-size: 16.5px; white-space: pre-wrap; overflow-x: auto; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose code { font: 13.5px/1.5 var(--font-mono); padding: 1.5px 6px; border-radius: 6px; background: var(--raise-2); border: 1px solid var(--line); }
.prose strong { font-weight: 600; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
.prose th { font-weight: 500; color: var(--ink-2); background: var(--raise); }
.prose tr:last-child td { border-bottom: 0; }

.code { margin: 0 0 16px; border-radius: 12px; background: var(--code-bg); border: 1px solid var(--line); overflow: hidden; }
.code__bar { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--line); }
.code__lang { font: 500 11px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.code__copy { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 7px; color: var(--muted); font-size: 12.5px; }
.code__copy:hover { background: var(--hover); color: var(--ink); }
.code__copy svg { width: 14px; height: 14px; }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; }
.code pre code { font: 13.5px/1.62 var(--font-mono); padding: 0; border: 0; background: none; white-space: pre; }
.code--open { border-color: var(--line-strong); }
/* Prose in a block (a prompt, a message, plain text) wraps; code keeps its lines and scrolls. */
.code--wrap pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-k { color: var(--violet); }
.tk-s { color: var(--ok); }
.tk-n { color: var(--amber); }
.tk-c { color: var(--faint); font-style: italic; }
.tk-f { color: var(--ice); }

.msg__foot { display: flex; align-items: center; gap: 2px; margin-top: 10px; min-height: 30px; }
.act { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--faint); transition: background 0.12s, color 0.12s; }
.act:hover { background: var(--hover); color: var(--ink); }
.act svg { width: 16px; height: 16px; }
.msg--user .msg__foot { justify-content: flex-end; opacity: 0; transition: opacity 0.15s; }
.msg--user:hover .msg__foot, .msg--user:focus-within .msg__foot { opacity: 1; }
.msg__meta { margin-left: 8px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.06em; color: var(--faint); }
.note { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.note--error { color: var(--danger); }
.note .link-btn { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.edit-box { width: min(85%, 620px); display: grid; gap: 8px; }
.edit-box textarea { width: 100%; min-height: 90px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--accent); background: var(--raise); resize: vertical; outline: none; }
.edit-box div { display: flex; justify-content: flex-end; gap: 8px; }

/* Thinking: the Doko mark, cut from the logo, with a band of split light passing through it and a
   soft halo that follows the light. When the model reasons, the mark takes on a violet tint. */
.mind {
  --mind-band: linear-gradient(115deg, transparent 38%, var(--ice) 44%, var(--violet) 49%, var(--orchid) 54%, var(--amber) 59%, transparent 65%);
  --mind-base: color-mix(in srgb, var(--muted) 34%, transparent);
  position: relative; width: 48px; height: 38px; margin: 4px 0 2px;
  animation: mind-breathe 2.8s ease-in-out infinite;
}
.mind__glow, .mind__mark, .mind__glow::before { position: absolute; inset: 0; }
.mind__glow { filter: blur(7px); opacity: 0.65; transition: opacity 0.6s; }
.mind__glow::before, .mind__mark {
  content: "";
  -webkit-mask: url(/assets/logo-mark.png) center / contain no-repeat;
  mask: url(/assets/logo-mark.png) center / contain no-repeat;
  background-image: var(--mind-band);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  animation: mind-light 1.9s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}
.mind__mark { background-color: var(--mind-base); transition: background-color 0.6s; }
.mind--deep { --mind-base: color-mix(in srgb, var(--violet) 30%, color-mix(in srgb, var(--muted) 30%, transparent)); }
.mind--deep .mind__glow { opacity: 0.9; }
@keyframes mind-light { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@keyframes mind-breathe { 0%, 100% { transform: scale(0.96); } 50% { transform: scale(1); } }
.caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; border-radius: 2px; background: var(--split-v); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.jump { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--raise); border: 1px solid var(--line-strong); color: var(--ink); box-shadow: var(--shadow); z-index: 3; }

/* ------------------------------------------------------------------ composer */

.dock { flex: none; width: min(var(--read), 100% - 32px); margin: 0 auto; padding: 0 0 12px; }
.composer { position: relative; display: grid; gap: 4px; padding: 10px 10px 8px 14px; border-radius: var(--radius-lg); background: var(--raise); border: 1px solid var(--line-strong); box-shadow: var(--shadow); transition: border-color 0.15s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.composer::before { content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 1px; background: var(--split); opacity: 0.55; border-radius: 1px; }
.composer.is-busy::before { opacity: 1; background-size: 200% 100%; animation: travel 1.6s linear infinite; background-image: linear-gradient(90deg, var(--ice), var(--violet), var(--orchid), var(--amber), var(--ice)); }
@keyframes travel { to { background-position: -200% 0; } }
.composer textarea { width: 100%; min-height: 28px; max-height: 40vh; padding: 6px 4px 4px 0; border: 0; outline: none; resize: none; background: none; font-size: 15.5px; line-height: 1.55; color: var(--ink); }
.composer textarea::placeholder { color: var(--faint); }
.composer__files { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 4px; }
.composer__bar { display: flex; align-items: center; gap: 6px; }
.composer__spacer { flex: 1; }
.composer__count { font: 500 10.5px/1 var(--font-mono); color: var(--faint); }
.chip-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--ink-2); transition: background 0.15s, color 0.15s; }
.chip-btn:hover { background: var(--hover); color: var(--ink); }
.toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 13.5px; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.toggle svg { width: 16px; height: 16px; }
.toggle:hover { color: var(--ink); background: var(--hover); }
.toggle[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.send { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--bg); transition: opacity 0.15s, transform 0.15s; }
.send svg { width: 18px; height: 18px; stroke-width: 2.1; }
.send:disabled { opacity: 0.25; cursor: default; }
.send:not(:disabled):hover { transform: translateY(-1px); }
.send.is-stop { background: var(--ink); }
.dock__note { margin: 8px 0 0; text-align: center; font-size: 11.5px; color: var(--faint); }

/* ------------------------------------------------------------------ project page */

.project { padding-top: 28px; }
.project__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.project__eyebrow { font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.project h1 { margin: 8px 0 0; font-weight: 300; font-size: 34px; letter-spacing: -0.03em; }
.project__card { margin-top: 22px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--raise); }
.project__card h2 { margin: 0 0 6px; font: 500 11px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.project__card p { margin: 0; color: var(--ink-2); white-space: pre-wrap; font-size: 14px; }
.project__chats { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.project__chats a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.project__chats a:hover { color: var(--accent); }
.project__chats small { font: 500 11px/1.8 var(--font-mono); color: var(--faint); white-space: nowrap; }

/* ------------------------------------------------------------------ menus, dialogs, toasts */

.layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.layer > * { pointer-events: auto; }
.menu { position: fixed; min-width: 220px; max-width: min(340px, calc(100vw - 16px)); padding: 6px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line-strong); box-shadow: var(--shadow); animation: pop 0.14s cubic-bezier(0.2, 0.8, 0.2, 1); z-index: 50; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border-radius: 9px; text-align: left; font-size: 14px; color: var(--ink-2); }
.menu__item:hover, .menu__item:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.menu__item svg { width: 16px; height: 16px; color: var(--muted); }
.menu__item--danger, .menu__item--danger svg { color: var(--danger); }
.menu__item[aria-disabled="true"] { opacity: 0.55; }
.menu__sep { height: 1px; margin: 6px 4px; background: var(--line); }
.menu__head { padding: 8px 10px 6px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.menu__text { display: grid; flex: 1; line-height: 1.3; }
.menu__text small { color: var(--faint); font-size: 12px; }
.badge { font: 500 10px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--muted); }
.badge--lit { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.meter { display: grid; gap: 6px; padding: 8px 10px 10px; }
.meter__row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.meter__bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter__bar span { display: block; height: 100%; background: var(--split); border-radius: 4px; }
.meter__bar--high span { background: var(--danger); }
.meter__note { font-size: 11.5px; color: var(--faint); }

.dialog-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 8, 0.62); backdrop-filter: blur(6px); animation: fade 0.16s ease-out; }
:root[data-theme="light"] .dialog-wrap { background: rgba(20, 26, 34, 0.32); }
@keyframes fade { from { opacity: 0; } }
.dialog { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; border-radius: 20px; background: var(--raise); border: 1px solid var(--line-strong); box-shadow: var(--shadow); animation: rise 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.dialog--wide { width: min(980px, 100%); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 6px 22px; }
.dialog__head h2 { margin: 0; font-weight: 500; font-size: 19px; letter-spacing: -0.02em; }
.dialog__body { padding: 8px 22px 22px; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field .field__label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field small { color: var(--faint); font-size: 12px; }
.input, .field textarea, .field select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); outline: none; transition: border-color 0.15s; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 500; border: 1px solid var(--line-strong); color: var(--ink); transition: background 0.15s, border-color 0.15s, opacity 0.15s; }
.btn:hover { background: var(--hover); }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--solid:hover { background: var(--ink); opacity: 0.9; }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 16px; height: 16px; }

.tabs { display: flex; gap: 2px; padding: 4px 22px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { position: relative; height: 40px; padding: 0 12px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--split); border-radius: 2px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row__text { display: grid; gap: 2px; }
.row__text strong { font-weight: 500; font-size: 14px; }
.row__text small { color: var(--muted); font-size: 12.5px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line-strong); }
.seg button { height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--raise-2); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }

.search { width: min(640px, 100%); align-self: start; margin-top: 12vh; }
.search__input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search__input svg { color: var(--muted); }
.search__input input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; }
.search__list { list-style: none; margin: 0; padding: 8px; max-height: 52vh; overflow-y: auto; }
.search__hit { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border-radius: 10px; text-align: left; }
.search__hit strong { font-weight: 500; font-size: 14px; }
.search__hit small { color: var(--muted); font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.search__hit[aria-selected="true"], .search__hit:hover { background: var(--hover); }
.search__empty { padding: 26px 16px; text-align: center; color: var(--faint); font-size: 14px; }
mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px 18px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); }
.plan--lit { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg)), var(--bg) 60%); }
.plan--lit::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; background: var(--split); border-radius: 2px; }
.plan__name { display: flex; justify-content: space-between; align-items: center; min-height: 20px; font: 500 11px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.plan__price { margin: 4px 0 0; font-weight: 300; font-size: 40px; letter-spacing: -0.04em; line-height: 1; }
.plan__price small { margin-left: 6px; font: 400 13px var(--font-ui); letter-spacing: 0; color: var(--muted); }
/* The same price in Nepali rupees, at Nepal Rastra Bank's rate. */
.plan__npr { margin: 6px 0 0; font: 500 12.5px var(--font-mono); letter-spacing: 0.02em; color: var(--muted); }
.plans__rate { margin: 14px 0 0; color: var(--faint); font-size: 12px; line-height: 1.5; }
.topup__amount .topup__npr { color: var(--muted); font-family: var(--font-mono); }
.plan__tag { margin: 0; color: var(--muted); font-size: 13.5px; }
.plan ul { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.plan li { display: flex; gap: 8px; align-items: baseline; }
.plan li svg { width: 14px; height: 14px; color: var(--accent); transform: translateY(2px); }
.plan .btn { margin-top: auto; }
.test-banner { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--amber) 55%, transparent); color: var(--ink-2); font-size: 13px; background: color-mix(in srgb, var(--amber) 6%, transparent); }
.test-banner svg { color: var(--amber); width: 16px; height: 16px; transform: translateY(2px); }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow); animation: rise 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); max-width: calc(100vw - 32px); }
.toast--error { background: var(--danger); color: #160606; }

/* ------------------------------------------------------------------ phones and narrow windows */

@media (max-width: 900px) {
  .shell, .shell[data-rail="closed"] { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); box-shadow: var(--shadow); }
  .shell[data-rail="open"] .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(3, 5, 8, 0.55); }
  .topbar__rail, .topbar__new { display: inline-grid; }
  .slips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .view__inner { width: calc(100% - 28px); }
  .dock { width: calc(100% - 20px); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .topbar { padding: 0 6px; }
  .topbar__title { display: none; }
  .bubble { max-width: 92%; }
  .hello { padding-bottom: 8vh; }
  .slip:nth-child(n + 3) { display: none; }
  .dialog-wrap { padding: 0; align-items: end; }
  .dialog { border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .search { margin-top: 0; }
  .dock__note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  /* The mark holds still with the light resting in its middle. */
  .mind, .mind__mark, .mind__glow::before { animation: none; }
  .mind__mark, .mind__glow::before { background-position: 50% 0; }
}
.toggle__chev { width: 14px !important; height: 14px !important; margin-left: -2px; color: var(--faint); }
.toggle[data-effort="high"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.msg__auto { padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-strong); font-size: 9.5px; letter-spacing: 0.12em; }

/* Plugins: the rail entry, the plugin window, the steps a reply takes, and asking to allow a change. */
.plugin-link { width: 100%; padding-right: 12px; text-align: left; }
.plugin-link__icon { width: 18px; height: 18px; object-fit: contain; flex: none; }
.plugin-link span { flex: 1; }
.plugin-link__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--line-strong); }
.plugin-link__dot.is-on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.plugin-link__dot.is-paused { background: var(--faint); box-shadow: none; }
.plugin__head { display: flex; align-items: center; gap: 16px; padding: 6px 0 16px; border-bottom: 1px solid var(--line); }
.plugin__icon { width: 60px; height: 60px; padding: 8px; border-radius: 16px; background: #FFFFFF; box-shadow: 0 0 0 1px var(--line-strong); object-fit: contain; flex: none; }
.plugin__title { display: flex; align-items: center; gap: 10px; }
.plugin__title strong { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.plugin__blurb { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.plugin__can { list-style: none; margin: 14px 0 4px; padding: 0; display: grid; gap: 9px; }
.plugin__can li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.plugin__can svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.plugin__note { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--raise-2); color: var(--muted); font-size: 13px; line-height: 1.55; }
.plugin .row { border-bottom: 0; padding-bottom: 0; }

.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch__track { width: 40px; height: 24px; border-radius: 12px; background: var(--line-strong); transition: background 0.2s; position: relative; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform 0.2s; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); background: var(--bg); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.step { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--raise); color: var(--muted); font-size: 12.5px; }
.step img { width: 16px; height: 16px; object-fit: contain; }
.step svg { width: 13px; height: 13px; }
.step--done svg { color: var(--ok); }
.step--failed svg, .step--declined svg { color: var(--danger); }
.step--running, .step--asking { color: var(--ink-2); border-color: var(--line-strong); }
.step__spin { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.allow { margin: 0 0 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line-strong)); background: var(--raise); display: grid; gap: 8px; max-width: 560px; }
.allow__head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.allow__head img { width: 18px; height: 18px; object-fit: contain; }
.allow__label { font-size: 15px; font-weight: 500; }
.allow__detail { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 2px 0 0; font-size: 13px; }
.allow__detail dt { color: var(--faint); text-transform: capitalize; }
.allow__detail dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.allow__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.allow__done { margin: 0; color: var(--muted); font-size: 13px; }

.prose .md-img { display: block; max-width: min(100%, 440px); height: auto; margin: 6px 0 14px; border-radius: 12px; border: 1px solid var(--line); }

/* Doko Video: photos in the composer and in messages, the video card in a reply, and the studio. */
.rail__action[aria-current="page"] { background: var(--raise-2); color: var(--ink); }
.file-chip--photo img { width: 22px; height: 22px; margin-left: -4px; border-radius: 5px; object-fit: cover; }
.photo-thumb { width: 132px; height: 132px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: var(--raise); }
.toast--action { display: flex; align-items: center; gap: 14px; }
.toast--action button { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; color: inherit; }

.media-list { display: grid; gap: 12px; margin: 0 0 14px; }
.video-card { margin: 0; max-width: 560px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--raise); }
.video-card video { display: block; width: 100%; max-height: 70vh; background: #000; }
.video-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font: 500 11px/1.4 var(--font-mono); letter-spacing: 0.06em; color: var(--muted); }
.video-card__save { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-family: var(--font-ui); font-size: 12.5px; letter-spacing: 0; }
.video-card__save:hover { color: var(--accent); }
.video-card__save svg { width: 15px; height: 15px; }
.video-card__stage { position: relative; display: grid; place-items: center; align-content: center; gap: 10px; aspect-ratio: var(--shape); max-height: 60vh; background:
  radial-gradient(120% 80% at 50% 110%, color-mix(in srgb, var(--violet) 14%, transparent), transparent 60%),
  repeating-linear-gradient(90deg, transparent 0 23px, color-mix(in srgb, var(--line) 70%, transparent) 23px 24px); }
.video-card__label { font-size: 14px; color: var(--ink-2); }
.video-card__time { font: 500 11px/1 var(--font-mono); letter-spacing: 0.06em; color: var(--faint); }
.video-card__error { margin: 0; padding: 16px; color: var(--danger); font-size: 13.5px; }
/* A picture in a reply: the same card as a video, the picture opening full size. */
/* The card takes the picture's own shape, so the card, the drawing stage and the finished picture are
   one size: as wide as 480px allows, narrower for a tall picture, never taller than 62% of the window.
   A max-height on the inner parts would narrow them inside the card (aspect-ratio carries it across). */
.image-card { width: min(100%, 480px, calc(62vh * var(--shape))); max-width: none; }
.image-card .video-card__stage { width: 100%; max-height: none; }
.image-card__open { display: block; width: 100%; padding: 0; border: 0; background: var(--raise); cursor: zoom-in; }
.image-card__open img { display: block; width: 100%; height: auto; aspect-ratio: var(--shape); object-fit: cover; }
.picture-viewer { display: grid; place-items: center; }
.picture-viewer img { display: block; max-width: 100%; max-height: 74vh; border-radius: 14px; object-fit: contain; }

.stage.is-studio .dock, .stage.is-studio .jump { display: none; }
.studio { width: min(1120px, 100% - 40px); margin: 0 auto; padding: 18px 0 56px; }
.studio--loading { display: grid; place-items: center; min-height: 60vh; }
.studio__head h1, .studio__intro h1 { margin: 0; font-weight: 300; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.03em; }
.studio .turn { font-family: var(--font-turn); font-style: italic; font-weight: 400; letter-spacing: -0.01em; text-shadow: -1.5px 0 rgba(154, 140, 255, 0.55), 1.5px 0 rgba(238, 127, 214, 0.45); }
.studio__head .hello__sub { text-align: left; margin-top: 6px; }
.studio__intro { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 12vh 0; }
.studio__intro .mind { width: 72px; height: 58px; }
.studio__intro .hello__sub { max-width: 520px; }

.studio__composer { position: relative; margin: 20px 0 30px; padding: 16px; border-radius: 20px; background: var(--raise); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.studio__composer::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px; background: var(--split); opacity: 0.8; }
.studio__prompt { width: 100%; min-height: 84px; max-height: 40vh; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; line-height: 1.55; }
.studio__prompt::placeholder { color: var(--faint); }
.studio__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding: 12px 0 4px; border-top: 1px solid var(--line); }
.studio__setting { display: grid; gap: 6px; }
.studio__label { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.studio__label svg { width: 13px; height: 13px; }
.seg--small button { height: 28px; padding: 0 9px; font-size: 12.5px; }
.studio__add-photo { height: 36px; }
.studio__add-photo svg { width: 16px; height: 16px; }
.studio__photo { display: flex; align-items: center; gap: 8px; height: 40px; padding: 4px; border-radius: 12px; border: 1px solid var(--line-strong); font-size: 12.5px; color: var(--ink-2); }
.studio__photo img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.studio__actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 12px; }
.studio__left { margin-right: auto; font: 500 11px/1 var(--font-mono); letter-spacing: 0.06em; color: var(--faint); }
.studio__direct svg, .studio__make svg { width: 16px; height: 16px; }
.studio__direct.is-busy svg { animation: spin 1.2s linear infinite; }

.studio__tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.gallery { columns: 3 260px; column-gap: 14px; }
.tile { position: relative; break-inside: avoid; margin: 0 0 14px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--raise); }
.tile__open { display: block; width: 100%; padding: 0; background: #000; cursor: zoom-in; }
.tile video, .tile img { display: block; width: 100%; aspect-ratio: var(--shape); object-fit: cover; }
.tile__stage { display: grid; place-items: center; align-content: center; gap: 10px; aspect-ratio: var(--shape); padding: 14px; text-align: center; background: repeating-linear-gradient(90deg, transparent 0 23px, color-mix(in srgb, var(--line) 70%, transparent) 23px 24px); }
.tile__stage small { font: 500 11px/1 var(--font-mono); letter-spacing: 0.08em; color: var(--faint); }
.tile__error { margin: 0; color: var(--danger); font-size: 13px; }
.tile__meta { padding: 10px 12px 12px; display: grid; gap: 4px; }
.tile__meta p { margin: 0; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile__meta small { font: 500 10.5px/1.4 var(--font-mono); letter-spacing: 0.06em; color: var(--faint); }
.tile__meta--photo { display: flex; align-items: center; justify-content: space-between; }
.tile__fav { position: absolute; top: 8px; right: 8px; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(7, 9, 13, 0.55); color: #EDF1F4; opacity: 0; transition: opacity 0.15s; }
.tile:hover .tile__fav, .tile__fav:focus-visible, .tile__fav.is-on { opacity: 1; }
.tile__fav svg { width: 16px; height: 16px; }
.tile__fav.is-on svg { fill: var(--orchid); stroke: var(--orchid); }
.gallery__empty { padding: 24px 0; color: var(--muted); }
.gallery__empty p { margin: 0 0 14px; }
.gallery__starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

.viewer { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.viewer__video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
.viewer__side { display: grid; gap: 10px; }
.viewer__prompt { display: flex; gap: 8px; align-items: flex-start; }
.viewer__prompt p { margin: 0; flex: 1; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.viewer__meta { margin: 0; font: 500 11px/1.5 var(--font-mono); letter-spacing: 0.05em; color: var(--faint); }

@media (max-width: 720px) {
  .viewer { grid-template-columns: 1fr; }
  .studio__actions { flex-wrap: wrap; }
  .studio__left { width: 100%; }
}

.video-card__next { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.next-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--line-strong); color: var(--ink-2); font-size: 12.5px; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.next-btn:hover:not(:disabled) { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong)); background: var(--hover); }
.next-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.next-btn svg { width: 14px; height: 14px; }

.media-list + .prose--after, .prose + .media-list { margin-top: 4px; }

a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
a.btn svg { width: 15px; height: 15px; }

/* The length slider, in the studio and on a video's setup card. */
.length__row { display: flex; align-items: center; gap: 10px; height: 36px; }
.length__range { width: 180px; accent-color: var(--accent); cursor: pointer; }
.length__value { min-width: 38px; font: 500 13px/1 var(--font-mono); color: var(--ink); }

/* A directed shot waiting for its length and a press of Make video. */
.video-setup { max-width: 640px; padding: 14px 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line-strong)); background: var(--raise); position: relative; }
.video-setup::before { content: ""; position: absolute; left: 20px; right: 20px; top: -1px; height: 1px; background: var(--split); }
.video-setup__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.video-setup__head img { width: 20px; height: 20px; border-radius: 5px; }
.video-setup__head strong { color: var(--ink); font-weight: 500; }
.video-setup__shot { width: 100%; min-height: 84px; resize: vertical; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); font-size: 14px; line-height: 1.55; outline: none; }
.video-setup__shot:focus { border-color: var(--accent); }
.video-setup__row { border-top: 0; padding-top: 12px; }
.video-setup__uses { margin-right: auto; font: 500 11px/1.4 var(--font-mono); letter-spacing: 0.05em; color: var(--faint); }
.video-setup__done { margin: 0; color: var(--muted); font-size: 13.5px; }
@media (max-width: 560px) {
  .length__range { width: 140px; }
}

/* Billing: the Stripe note under the plans, the balance in the account menu, and topping up. */
.plans__note { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.plans__note svg { width: 14px; height: 14px; }
.plans__manage { margin-top: 6px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.meter__row--balance { display: flex; justify-content: space-between; padding: 2px 12px 8px; font-size: 13px; color: var(--muted); }
.meter__row--balance strong { color: var(--ink); font-weight: 500; font-family: var(--font-mono); }
.topup__now { margin: 0 0 14px; font: 500 13px/1 var(--font-mono); letter-spacing: 0.04em; color: var(--muted); }
.topup__amounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.topup__amount { display: grid; gap: 4px; padding: 16px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--raise); text-align: left; transition: border-color 0.15s, transform 0.15s; }
.topup__amount:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.topup__amount strong { font-size: 24px; font-weight: 300; letter-spacing: -0.02em; }
.topup__amount small { color: var(--faint); font-size: 12px; }
.topup__rates { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

.row__note { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
