/* Lumen Web — the desktop Lumen's look: ink on paper, monospace chrome, one accent (accent.js), ASCII touches.
   Tokens hang on <html> (early.js sets the theme there and on <body>); accent.js re-tints <body>, so its
   colors win without fighting over the cascade order. Anything that mixes the accent mixes it in place. */
:root {
  --lumen-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --lumen-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --lumen-accent: #d93a1e; --lumen-accent-strong: #b42c13;
  --lumen-ok: #3a9a5b; --lumen-warn: #d9831e; --lumen-bad: #d93a1e;
  --lumen-paper: #f6f5f2; --lumen-surface: #fbfaf8; --lumen-sunken: #efede9;
  --lumen-line: rgba(28, 27, 25, .13); --lumen-line-strong: rgba(28, 27, 25, .26);
  --lumen-text: #1c1b19; --lumen-muted: #7b776f; --lumen-faint: rgba(28, 27, 25, .07);
  --lumen-shadow: 0 1px 0 rgba(28, 27, 25, .04); --lumen-dot: rgba(28, 27, 25, .16);
  --pop-shadow: 0 12px 32px rgba(0, 0, 0, .14);
  --side-w: 280px; --maxw: 760px;
  color-scheme: light;
}
:root[data-ds-dark-theme] {
  --lumen-accent: #f0532f; --lumen-accent-strong: #ff6a45;
  --lumen-paper: #0f0e0d; --lumen-surface: #161513; --lumen-sunken: #1c1b18;
  --lumen-line: rgba(240, 232, 220, .11); --lumen-line-strong: rgba(240, 232, 220, .24);
  --lumen-text: #ece8e2; --lumen-muted: #8f8a82; --lumen-faint: rgba(240, 232, 220, .05);
  --lumen-shadow: none; --lumen-dot: rgba(240, 232, 220, .12);
  --pop-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box }
html, body { margin: 0; height: 100%; background: var(--lumen-paper); color: var(--lumen-text); font: 13px/1.5 var(--lumen-mono);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-font-smoothing: antialiased; overscroll-behavior: none }
body { overflow: hidden; -webkit-tap-highlight-color: transparent }
html, body { overflow-x: hidden; overscroll-behavior-x: none; max-width: 100% } /* nothing may pan the page sideways */
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit }
button { cursor: pointer; background: none; border: 0; padding: 0; margin: 0 }
button:disabled { cursor: default }
a { color: inherit }
[hidden] { display: none !important }
:focus { outline: none }
:focus-visible { outline: 1px dashed var(--lumen-accent); outline-offset: 2px }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px }
.i { width: 18px; height: 18px; flex: none; display: block }
::selection { background: color-mix(in srgb, var(--lumen-accent) 25%, transparent) }
/* thin scrollbars, the accent under the pointer */
* { scrollbar-width: thin; scrollbar-color: var(--lumen-line-strong) transparent }
::-webkit-scrollbar { width: 10px; height: 10px }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent }
::-webkit-scrollbar-thumb { background: var(--lumen-line-strong); border: 3px solid transparent; background-clip: content-box; border-radius: 2px }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--lumen-accent) 55%, var(--lumen-line-strong)); border: 3px solid transparent; background-clip: content-box }

/* the figlet wordmark with heat running through it */
.wordmark { margin: 0; font: 700 9.5px/1.05 var(--lumen-mono); letter-spacing: 0; white-space: pre; user-select: none;
  background: linear-gradient(100deg, var(--lumen-text) 0%, var(--lumen-text) 38%, var(--lumen-accent) 47%, var(--lumen-accent-strong) 50%, var(--lumen-accent) 53%, var(--lumen-text) 62%, var(--lumen-text) 100%);
  background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: heat 7s ease-in-out infinite }
:root[data-ds-dark-theme] .wordmark { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--lumen-accent) 18%, transparent)) }
/* dotted paper: the empty chat and the sign-in */
.paper { background-image: radial-gradient(circle, var(--lumen-dot) .8px, transparent 1.15px); background-size: 14px 14px; background-position: center }
.cursor { display: inline-block; margin-left: .1em; color: var(--lumen-accent); animation: blink 1.1s steps(1) infinite; font-weight: 400 }
.g-spin { display: inline-block; width: 1.2ch; text-align: center; color: var(--lumen-accent); font-style: normal; font-weight: 600; flex: none }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--lumen-paper); z-index: 100 }
.splash .wordmark { font-size: 12px; animation: heat 2.4s ease-in-out infinite }

/* ---------- buttons ---------- */
.btn { height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--lumen-line-strong); font: 500 12.5px var(--lumen-mono); display: inline-flex;
  align-items: center; justify-content: center; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; color: var(--lumen-text) }
.btn::before { content: "[ "; color: var(--lumen-muted); white-space: pre }
.btn::after { content: " ]"; color: var(--lumen-muted); white-space: pre }
.btn:hover:not(:disabled) { background: var(--lumen-faint) }
.btn-primary { background: var(--lumen-text); color: var(--lumen-paper); border-color: var(--lumen-text) }
.btn-primary::before, .btn-primary::after, .btn-danger::before, .btn-danger::after { color: inherit; opacity: .55 }
.btn-primary:hover:not(:disabled) { background: var(--lumen-accent); border-color: var(--lumen-accent); color: #fff }
.btn-danger { background: var(--lumen-bad); border-color: var(--lumen-bad); color: #fff }
.btn-danger:hover:not(:disabled) { background: var(--lumen-accent-strong); border-color: var(--lumen-accent-strong) }
.btn:disabled { opacity: .45 }
.btn-block { width: 100%; height: 44px; border-radius: 8px; font-size: 13.5px; font-weight: 600 }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px }
.icon-btn { width: 36px; height: 36px; border-radius: 6px; display: inline-grid; place-items: center; color: var(--lumen-muted); flex: none;
  transition: background .15s, color .15s; font: 600 15px/1 var(--lumen-mono) }
.icon-btn:hover { background: var(--lumen-faint); color: var(--lumen-text) }

/* ---------- sign-in: the onboarding's hearth, a terminal prompt ---------- */
.login { position: fixed; inset: 0; height: var(--vvh, 100dvh); display: grid; place-items: center; padding: 24px; overflow-y: auto;
  padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(24px, env(safe-area-inset-bottom)) }
.login::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 40%, var(--lumen-paper) 100%) }
.login-stage { position: relative; z-index: 1; width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: -4vh }
.login-hearth { display: flex; flex-direction: column; align-items: center; gap: 2px }
.login-fire { position: relative; min-height: 120px; display: flex; align-items: flex-end; justify-content: center }
/* the onboarding's warm breath under the fire */
.login-fire::before { content: ""; position: absolute; left: 50%; bottom: 2%; width: 62%; height: 58%; transform: translateX(-50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lumen-accent) 9%, transparent), transparent 100%); animation: breathe 4.5s ease-in-out infinite }
:root[data-ds-dark-theme] .login-fire::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--lumen-accent) 16%, transparent), transparent 100%) }
.login-fire canvas { display: block; cursor: pointer }
:root[data-ds-dark-theme] .login-fire canvas, :root[data-ds-dark-theme] .hero-fire canvas { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--lumen-accent) 45%, transparent)) }
.login-hearth .wordmark { font-size: 13px; line-height: 1.1 }
.login-card { width: 100%; display: flex; flex-direction: column; gap: 14px }
.login-tag { margin: 0; color: var(--lumen-accent); font-size: 11.5px; letter-spacing: .04em }
.login-tag::after { content: "█"; margin-left: 2px; animation: blink 1s steps(1) infinite }
.login-title { margin: -8px 0 0; font: 700 23px/1.25 var(--lumen-mono); letter-spacing: -.02em }
.login-sub { margin: -6px 0 6px; color: var(--lumen-muted); font-size: 12.5px; line-height: 1.6 }
.field { display: flex; flex-direction: column; gap: 6px }
.field > small { font-size: 10.5px; color: var(--lumen-muted); letter-spacing: .08em; text-transform: uppercase }
.prompt { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 14px; border-radius: 10px; border: 1px solid var(--lumen-line-strong);
  background: var(--lumen-surface); transition: border-color .15s, box-shadow .15s }
.prompt:focus-within { border-color: var(--lumen-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lumen-accent) 15%, transparent) }
.prompt > b { width: 1ch; color: var(--lumen-accent); font-weight: 700 }
.prompt input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font: 14px var(--lumen-mono); color: var(--lumen-text) }
.prompt input::placeholder { color: var(--lumen-line-strong) }
.prompt:has(input[aria-invalid="true"]) { border-color: var(--lumen-bad) }
.field-btn { height: 32px; padding: 0 8px; border-radius: 6px; color: var(--lumen-muted); font-size: 11px }
.field-btn:hover { color: var(--lumen-text); background: var(--lumen-faint) }
.login-err { min-height: 18px; margin: -4px 0 -4px; color: var(--lumen-bad); font-size: 12px }
.login-err:not(:empty)::before { content: "✗ " }
.login .btn-primary { background: var(--lumen-accent); border-color: var(--lumen-accent); color: #fff;
  box-shadow: 0 8px 22px -14px color-mix(in srgb, var(--lumen-accent) 80%, transparent) }
.login .btn-primary:hover:not(:disabled) { background: var(--lumen-accent-strong); border-color: var(--lumen-accent-strong) }
.shake { animation: shake .42s }
/* a wide screen: the onboarding's split stage, the hearth on the left and the prompt on the right */
@media (min-width: 900px) and (min-height: 560px) {
  .login-stage { max-width: 900px; flex-direction: row; justify-content: center; gap: clamp(56px, 8vw, 120px); margin-top: 0 }
  .login-hearth { flex: none; transform: translateY(-12px) }
  .login-hearth .wordmark { font-size: 15px; line-height: 1.12; margin-top: 6px }
  .login-card { width: 380px; flex: none }
}

/* ---------- layout ---------- */
.app { position: fixed; left: 0; right: 0; top: var(--vvt, 0); height: var(--vvh, 100dvh); display: flex; overflow: hidden }
.side { width: var(--side-w); flex: none; background: var(--lumen-sunken); display: flex; flex-direction: column; border-right: 1px solid var(--lumen-line);
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  transition: margin-left .24s cubic-bezier(.2, .8, .2, 1), visibility 0s; z-index: 20; font-size: 12.5px }
.app.side-off .side { margin-left: calc(-1 * var(--side-w)); visibility: hidden; transition: margin-left .24s cubic-bezier(.2, .8, .2, 1), visibility 0s .24s }
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .42); z-index: 30; animation: fade .2s }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--lumen-paper) }

/* sidebar: a terminal tree */
.side-top { display: flex; align-items: flex-start; justify-content: space-between; padding: 8px 0 12px 6px; flex: none }
.brand { display: block; text-decoration: none; color: inherit; border-radius: 4px; padding: 2px }
.new-chat { display: flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 8px; font-weight: 600; font-size: 13px;
  margin: 0 0 8px; flex: none; width: 100%; border: 1px dashed var(--lumen-line-strong); position: relative; transition: background .15s, border-color .15s, color .15s }
.new-chat b { color: var(--lumen-accent); font-weight: 600 }
.new-chat:hover { border-style: solid; background: var(--lumen-faint) }
.new-chat kbd { position: absolute; right: 8px; font: 10.5px var(--lumen-mono); padding: 0 4px; border-radius: 3px; border: 1px solid var(--lumen-line); color: var(--lumen-muted); opacity: 0; transition: opacity .15s }
.new-chat:hover kbd { opacity: 1 }
.search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; margin: 0 0 6px; border-radius: 6px; color: var(--lumen-muted);
  border: 1px solid transparent; flex: none; cursor: text; transition: border-color .15s }
.search:hover { background: var(--lumen-faint) }
.search:focus-within { border-color: var(--lumen-line-strong); background: var(--lumen-surface) }
.search-i { font-weight: 600; width: 1.4ch; text-align: center }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 12.5px; min-width: 0; color: var(--lumen-text); height: 100% }
.search input::placeholder { color: var(--lumen-muted) }
.search input::-webkit-search-cancel-button { -webkit-appearance: none }
/* the agent's card (js/agent.js): rows like the desktop's nav (Плагины · Пространство · Задачи) — a mini avatar or a glyph,
   the name, a muted line of what it does, a count. Empty, the slot takes no room */
.side-agent:empty { display: none }
.side-agent { flex: none; margin: 0 0 6px; display: flex; flex-direction: column; gap: 1px }
.nav-row { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 3px 8px; border-radius: 6px; color: var(--lumen-text); text-decoration: none;
  font-size: 13px; min-width: 0; text-align: left; width: 100%; transition: background .15s }
.nav-row:hover { background: var(--lumen-faint) }
.nav-row[aria-current="page"] { background: var(--lumen-faint); box-shadow: inset 2px 0 0 var(--lumen-accent) }
.nav-ico { width: 22px; height: 22px; flex: none; display: grid; place-items: center; font-style: normal }
.nav-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3 }
.nav-t > b, .nav-t > span { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.nav-t > small { color: var(--lumen-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.nav-n { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--lumen-accent); color: #fff; font: 600 10.5px/18px var(--lumen-mono); text-align: center }
.nav-n.ask { background: none; color: var(--lumen-accent); border: 1px solid var(--lumen-accent); line-height: 16px }
.chat-list { flex: 1; overflow-y: auto; margin: 0 -10px; padding: 0 10px 8px; overscroll-behavior: contain }
.grp { font: 600 11px var(--lumen-mono); color: var(--lumen-muted); padding: 14px 6px 5px; text-transform: lowercase; letter-spacing: .01em }
.grp:first-child { padding-top: 4px }
.grp::before { content: "// "; color: var(--lumen-line-strong) }
.grp.pin::before { content: "★ "; color: var(--lumen-muted) }
.ci { position: relative; display: flex; align-items: center; border-radius: 4px; margin: 1px 0 }
.ci:hover { background: var(--lumen-faint) }
.ci.on { background: var(--lumen-faint); box-shadow: inset 2px 0 0 var(--lumen-accent) }
.ci-a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 6px 0 8px; color: inherit;
  text-decoration: none; font-size: 12.5px; border-radius: 4px }
.ci-g { flex: none; width: 2ch; color: var(--lumen-line-strong); font-style: normal; white-space: pre }
.ci.on .ci-g, .ci.wait .ci-g, .ci.pin .ci-g { color: var(--lumen-accent) }
.ci-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ci.on .ci-t { font-weight: 600 }
.ci-time { flex: none; font-size: 10.5px; color: var(--lumen-muted) }
.ci-more { width: 26px; height: 26px; margin-right: 2px; border-radius: 4px; display: none; place-items: center; color: var(--lumen-muted); flex: none; font-weight: 700 }
.ci-more:hover { color: var(--lumen-accent); background: var(--lumen-sunken) }
.ci:hover .ci-more, .ci.on .ci-more, .ci-more:focus-visible, .ci-more[aria-expanded="true"] { display: grid }
.ci:hover .ci-time, .ci.on .ci-time, .ci:focus-within .ci-time { display: none }
.ci-rename { flex: 1; min-width: 0; height: 26px; margin: 2px 4px; border: 1px solid var(--lumen-accent); border-radius: 4px; padding: 0 6px;
  background: var(--lumen-paper); font: 12.5px var(--lumen-mono); outline: none }
.list-empty { color: var(--lumen-muted); font-size: 12px; padding: 18px 8px; line-height: 1.6 }
.list-empty::before { content: "└─ " ; color: var(--lumen-line-strong) }
.side-foot { display: flex; align-items: center; gap: 4px; padding-top: 8px; border-top: 1px dashed var(--lumen-line); margin-top: 4px; flex: none }
.side-act { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px; border-radius: 6px; font-size: 12.5px; color: var(--lumen-text);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.side-act b { color: var(--lumen-muted); font-weight: 600 }
.side-act:hover, .side-act[aria-expanded="true"] { background: var(--lumen-faint) }
.side-act:hover b, .side-act[aria-expanded="true"] b { color: var(--lumen-accent) }
#settings { flex: 1; justify-content: flex-start }
#logout { color: var(--lumen-muted); flex: 0 1 auto }
#logout:hover { color: var(--lumen-text) }

/* [● ◔ 5ч ост. 44% ▮▮▯▯▯ · нед ост. 53%]: what is LEFT, in words */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--lumen-line);
  background: transparent; color: var(--lumen-text); font: 500 11.5px/1 var(--lumen-mono); white-space: nowrap; transition: border-color .15s, background .15s; flex: none }
.pill::before { content: "["; color: var(--lumen-muted); margin-right: -2px }
.pill::after { content: "]"; color: var(--lumen-muted); margin-left: -2px }
.pill:hover, .pill[aria-expanded="true"] { border-color: var(--lumen-line-strong); background: var(--lumen-faint) }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lumen-muted); flex: none; display: inline-block }
.dot.ok, .dot[data-state="ok"] { background: var(--lumen-ok) }
.dot.off { background: var(--lumen-warn) }
.dot[data-state="busy"] { background: var(--lumen-warn); animation: pulse-o 1s steps(2) infinite }
.dot[data-state="bad"] { background: var(--lumen-bad); animation: pulse-o 1s steps(2) infinite }
.limits { gap: 0; padding: 0 7px; font-size: 11px; overflow: hidden; min-width: 0 }
.limits > * { flex: none }
.limits .dot { margin: 0 6px 0 3px }
.limits i { font-style: normal }
.limits .lim-ico { color: var(--lumen-muted); margin-right: .6ch }
.limits .lim-bars { color: var(--lumen-muted); font-size: 9px; letter-spacing: -1px; margin-left: .6ch }
.limits [data-l="warn"] { color: var(--lumen-warn) }
.limits [data-l="bad"] { color: var(--lumen-bad) }
.limits[data-l="bad"] { border-color: color-mix(in srgb, var(--lumen-bad) 45%, var(--lumen-line)) }
.limits .lim-off { color: var(--lumen-muted) }

/* header */
.top { height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 10px;
  display: flex; align-items: center; gap: 4px; flex: none; position: relative; z-index: 5; background: var(--lumen-paper);
  border-bottom: 1px solid transparent; transition: border-color .2s }
.top.scrolled { border-bottom-color: var(--lumen-line) }
.title { flex: 1; min-width: 0; margin: 0 6px; font: 600 13px var(--lumen-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.top-tools { display: flex; align-items: center; gap: 6px; flex: none }
#chat-more { font-size: 16px; letter-spacing: 0 }
#chat-more[aria-expanded="true"] { background: var(--lumen-faint); color: var(--lumen-accent) }
#side-show, #top-new { display: none }
.app.side-off #side-show, .app.side-off #top-new { display: inline-grid }
#side-show .ph { display: none }
.only-phone { display: none !important }
.title-in { width: 100%; height: 30px; border: 1px solid var(--lumen-accent); border-radius: 5px; padding: 0 8px; background: var(--lumen-surface);
  font: 600 13px var(--lumen-mono); color: var(--lumen-text); outline: none }

/* a page in place of the conversation (the agent's screens): .page-in is the column, .tabs the desktop's underlined tabs */
.page { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom) }
.page-in { max-width: calc(var(--maxw) + 48px); margin: 0 auto; padding: 14px 24px 32px }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--lumen-line); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none }
.tab { position: relative; height: 34px; padding: 0 2px; color: var(--lumen-muted); font: 500 12.5px var(--lumen-mono); white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center }
.tab:hover { color: var(--lumen-text) }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--lumen-accent) }
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--lumen-accent) }
.main.paged > .scroll, .main.paged > .dock, .main.paged > .jump, .main.paged > .drop { display: none !important }

/* thread */
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; position: relative }
.main.is-empty { background-image: radial-gradient(circle, var(--lumen-dot) .8px, transparent 1.15px); background-size: 14px 14px; background-position: center }
.main.is-empty .top, .main.is-empty .dock { background: transparent }
.thread { max-width: calc(var(--maxw) + 48px); margin: 0 auto; padding: 18px 24px 28px; min-height: 100%; display: flex; flex-direction: column }
.msgs { display: flex; flex-direction: column; gap: 22px }
.msgs:empty { display: none }

/* empty chat: the fire, a greeting with a cursor, the ornament, dashed suggestions */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 0 20px; animation: fade .3s }
.hero-fire { display: flex; justify-content: center; min-height: 40px }
.hero-fire canvas { display: block; cursor: pointer }
.hello h2 { font: 500 20px/1.3 var(--lumen-mono); margin: 4px 0 6px; letter-spacing: 0 }
.hello p { margin: 0; color: var(--lumen-muted); font-size: 12px }
.hello p b { color: var(--lumen-accent); font-weight: 500 }
.ornament { margin: 12px 0 0; color: var(--lumen-muted); font: 11.5px/1.7 var(--lumen-mono); white-space: pre }
.ornament b { color: var(--lumen-text); font-weight: 600 }
.ornament .orn-l { color: var(--lumen-muted) }
.sugg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; width: 100%; max-width: 620px }
.sug { text-align: left; border: 1px dashed var(--lumen-line-strong); border-radius: 6px; padding: 9px 12px; min-height: 58px; background: color-mix(in srgb, var(--lumen-paper) 70%, transparent);
  transition: background .15s, border-color .15s, color .15s }
.sug:hover { border-color: var(--lumen-accent); background: color-mix(in srgb, var(--lumen-accent) 6%, var(--lumen-paper)) }
.sug b { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 2px }
.sug b::before { content: "▸ "; color: var(--lumen-accent) }
.sug span { font-size: 11.5px; color: var(--lumen-muted); line-height: 1.4; display: block }

/* messages */
.msg { position: relative; animation: rise .2s ease-out }
.msg.user { align-self: flex-end; max-width: min(82%, 620px); display: flex; flex-direction: column; align-items: flex-end; gap: 4px }
.bubble { background: var(--lumen-sunken); border: 1px solid var(--lumen-line); border-radius: 10px; padding: 9px 14px; white-space: pre-wrap; overflow-wrap: anywhere;
  font: 15px/1.55 var(--lumen-sans) }
.u-files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end }
.u-img { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--lumen-line); background: var(--lumen-sunken) }
.u-img img { display: block; max-width: 240px; max-height: 240px; width: auto; height: auto; object-fit: cover }
.u-file { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 8px; border: 1px solid var(--lumen-line-strong);
  text-decoration: none; max-width: 280px; background: var(--lumen-surface) }
.u-file > .fi { width: 32px; height: 32px; border-radius: 6px; background: var(--lumen-sunken); color: var(--lumen-accent); display: grid; place-items: center; flex: none; font-weight: 700; border: 1px solid var(--lumen-line) }
.u-file span { min-width: 0; display: flex; flex-direction: column; line-height: 1.3 }
.u-file b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.u-file small { font-size: 11px; color: var(--lumen-muted) }
.u-tag { font-size: 11px; color: var(--lumen-muted) }
.msg.user.editing { align-self: stretch; max-width: none }
.edit { width: 100%; background: var(--lumen-surface); border: 1px solid var(--lumen-text); border-radius: 10px; padding: 10px 12px }
.edit-ta { width: 100%; border: 0; background: none; resize: none; font: 15px/1.55 var(--lumen-sans); outline: none; max-height: 50vh; display: block }
.edit-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px }
.msg.bot { width: 100% }
.acts { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .15s; min-height: 26px }
.acts:empty { display: none }
.msg.user .acts { margin-top: 0 }
.msg:hover .acts, .msg:focus-within .acts, .msg.bot.last .acts { opacity: 1 }
.act { height: 26px; min-width: 26px; padding: 0 6px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  color: var(--lumen-muted); font-size: 13px; transition: background .15s, color .15s }
.act:hover { background: var(--lumen-faint); color: var(--lumen-text) }
.act .i { width: 15px; height: 15px; stroke-width: 1.6 }
.act.ok { color: var(--lumen-ok) }
.m-err { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; color: var(--lumen-bad);
  background: color-mix(in srgb, var(--lumen-bad) 6%, transparent); border: 1px dashed color-mix(in srgb, var(--lumen-bad) 55%, transparent) }
.m-err > b { font-weight: 700 }
.m-err span { flex: 1; min-width: 0; overflow-wrap: anywhere }
.m-err .btn { height: 26px; padding: 0 8px; font-size: 11.5px; margin: -2px -2px -2px 0 }
.m-err.stopped { color: var(--lumen-muted); background: none; border: 0; padding: 0; font-size: 12px }

/* the answer: sans text, mono for what is code or structure */
.md { font: 15.5px/1.65 var(--lumen-sans); overflow-wrap: anywhere }
.md > :first-child { margin-top: 0 }
.md > :last-child { margin-bottom: 0 }
.md p { margin: 0 0 .8em }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 1.3em 0 .5em; line-height: 1.35; font-family: var(--lumen-mono); font-weight: 650; letter-spacing: -.01em }
.md h1 { font-size: 1.3em } .md h2 { font-size: 1.12em } .md h3 { font-size: 1em } .md h4, .md h5, .md h6 { font-size: .95em }
.md h2::before { content: "## "; color: var(--lumen-muted); font-weight: 500 }
.md h3::before { content: "### "; color: var(--lumen-muted); font-weight: 500 }
.md ul, .md ol { margin: 0 0 .8em; padding-left: 1.5em }
.md li { margin: .25em 0 }
.md li > p { margin: .25em 0 }
.md ul > li::marker { content: "–  "; color: var(--lumen-muted); font-family: var(--lumen-mono) }
.md ol > li::marker { color: var(--lumen-muted); font: .88em var(--lumen-mono) }
.md ul.tasks { list-style: none; padding-left: .1em }
.md ul.tasks > li::marker { content: none }
.md li.task { display: flex; gap: 8px; align-items: baseline }
.md li.task > div { flex: 1; min-width: 0 }
.tick { flex: none; font: 600 .82em var(--lumen-mono); color: var(--lumen-muted) }
.tick::before { content: "[ ]"; white-space: pre }
.tick.on { color: var(--lumen-ok) }
.tick.on::before { content: "[x]" }
.md a { color: var(--lumen-accent); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px }
.md a:hover { text-decoration-style: solid }
.md strong { font-weight: 650 }
.md code { font-family: var(--lumen-mono); font-size: .84em; background: var(--lumen-faint); border: 1px solid var(--lumen-line); padding: .08em .35em; border-radius: 4px }
.md .code { margin: 0 0 1em; border-radius: 8px; overflow: hidden; background: var(--lumen-surface); border: 1px solid var(--lumen-line-strong) }
.code-head { display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 4px 0 12px; font: 11.5px var(--lumen-mono);
  color: var(--lumen-muted); border-bottom: 1px dashed var(--lumen-line); background: var(--lumen-sunken) }
.code-head > span::before { content: "┌─ "; color: var(--lumen-accent) }
.code-copy { font: 11px var(--lumen-mono); height: 22px; padding: 0 7px; border-radius: 4px; color: var(--lumen-muted); text-transform: lowercase }
.code-copy:hover { background: var(--lumen-faint); color: var(--lumen-accent) }
.md pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 12.5px/1.6 var(--lumen-mono); tab-size: 4 }
.md pre code { background: none; border: 0; padding: 0; font-size: inherit; border-radius: 0; white-space: pre }
.table-wrap { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--lumen-line-strong); border-radius: 8px }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.5; overflow-wrap: break-word } /* scrolls sideways rather than splitting words */
.md th, .md td { padding: 7px 12px; border-bottom: 1px solid var(--lumen-line); text-align: left; vertical-align: top }
.md td + td, .md th + th { border-left: 1px solid var(--lumen-line) }
.md th { font: 600 12px var(--lumen-mono); background: var(--lumen-sunken); white-space: nowrap }
.md tr:last-child td { border-bottom: 0 }
.md blockquote { margin: 0 0 1em; padding: 2px 0 2px 14px; border-left: 2px solid var(--lumen-accent); color: var(--lumen-muted) }
.md hr { border: 0; border-top: 1px dashed var(--lumen-line-strong); margin: 1.5em 0 }
.md img { max-width: 100%; border-radius: 8px }
.steer { margin: 0 0 1em; padding: 8px 12px; border-radius: 8px; background: var(--lumen-sunken); border: 1px solid var(--lumen-line); font-size: 14.5px }
.steer-who { display: block; font: 11px var(--lumen-mono); color: var(--lumen-muted); margin-bottom: 2px }
.steer-who::before { content: "↳ " ; color: var(--lumen-accent) }
.steer > :last-child { margin-bottom: 0 }
/* the reply as it streams: a blinking block cursor in the accent */
.caret { display: inline; margin-left: 2px; font: 400 .95em/1 var(--lumen-mono); color: var(--lumen-accent); animation: blink 1.05s steps(1) infinite }
.caret::before { content: "█" }

/* the work log: a turn's steps in one compact list (desktop .lumen-wl) */
.work { margin: 0 0 10px; font: 12px/1.5 var(--lumen-mono); color: var(--lumen-muted) }
.wl-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; color: var(--lumen-text); min-height: 22px; flex-wrap: wrap }
.wl-head .wl-time { color: var(--lumen-muted) }
.think-w { font-style: normal; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(90deg, var(--lumen-muted) 0%, var(--lumen-muted) 40%, var(--lumen-text) 50%, var(--lumen-muted) 60%, var(--lumen-muted) 100%);
  background-size: 300% 100%; animation: shimmer 2.2s linear infinite }
.wl-now { flex-basis: 100%; padding-left: calc(1.2ch + 6px); color: var(--lumen-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.wl-all { margin-left: 4px; padding: 0 6px; border: 1px dashed var(--lumen-line-strong); border-radius: 4px; color: var(--lumen-muted); font: 11px var(--lumen-mono) }
.wl-all:hover { color: var(--lumen-accent); border-color: var(--lumen-accent) }
.wl-done { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; color: var(--lumen-muted); text-align: left; border-radius: 4px; padding: 1px 4px 1px 0 }
.wl-done:hover:not(:disabled) { color: var(--lumen-text) }
.wl-done:disabled { cursor: default }
.wl-done .cv { color: var(--lumen-line-strong) }
.wl-done:hover .cv, .wl-done[aria-expanded="true"] .cv { color: var(--lumen-accent) }
.wl-done .bad { color: var(--lumen-bad) }
.wl-list { list-style: none; margin: 2px 0 0; padding: 0 0 0 2px; border-left: 1px dashed var(--lumen-line-strong); animation: fade .2s }
.work[data-state="run"]:not(.all) .wl-list > li:not(:nth-last-child(-n+4)) { display: none }
.wl-list > li { position: relative; padding: 1px 0 1px 12px }
.wl-step { display: flex; gap: 7px; min-width: 0; white-space: nowrap; cursor: pointer; border-radius: 4px }
.wl-step:hover { background: var(--lumen-faint) }
.wl-step i { flex: none; width: 1.4ch; font-style: normal; text-align: center; color: var(--lumen-accent) }
.wl-step b { flex: none; font-weight: 600; color: var(--lumen-text) }
.wl-step span { min-width: 0; overflow: hidden; text-overflow: ellipsis }
.wl-step em { display: none }
.wl-step.open { flex-wrap: wrap; white-space: pre-wrap; word-break: break-word }
.wl-step.open span { overflow: visible; flex: 1 1 60% }
.wl-step.open em, .wl-step.err em { display: block; flex-basis: 100%; padding-left: calc(1.4ch + 7px); font-style: normal; color: var(--lumen-bad); white-space: pre-wrap; overflow-wrap: anywhere }
/* a subagent: its row and, on a tap, its own work under it */
.wl-ag { display: flex; gap: 7px; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 4px; background: none; font: inherit; color: inherit; text-align: left; white-space: nowrap; cursor: pointer }
.wl-ag:hover { background: var(--lumen-faint) }
.wl-ag i { flex: none; width: 1.4ch; font-style: normal; text-align: center; color: var(--lumen-accent) }
.wl-ag b { flex: none; font-weight: 600; color: var(--lumen-text) }
.wl-ag span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--lumen-text) }
.wl-ag em { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-style: normal; color: var(--lumen-muted) }
.wl-ag em::before { content: '· ' }
.wl-ag u { flex: none; text-decoration: none; color: var(--lumen-muted) }
.wl-agent.run .wl-ag em { color: var(--lumen-accent) }
.wl-agent.err .wl-ag i { color: var(--lumen-bad) }
.wl-sub { display: none; list-style: none; margin: 2px 0 4px .7ch; padding: 0 0 0 2px; border-left: 1px dashed var(--lumen-line-strong); overflow-wrap: anywhere }
.wl-agent.open > .wl-sub { display: block }
.wl-sub > li { padding: 1px 0 1px 12px }
.wl-sub .wl-say { color: var(--lumen-muted) }
.wl-step.err i { color: var(--lumen-bad) }
.work[data-state="run"] .wl-list > li.wl-step:last-child b { color: var(--lumen-accent) }
.wl-say { margin: 3px 0; color: var(--lumen-text); font: 13px/1.5 var(--lumen-sans); white-space: pre-wrap; overflow-wrap: anywhere }
.wl-say code { font: 11.5px var(--lumen-mono); padding: 0 3px; border-radius: 3px; background: var(--lumen-faint) }

/* the plan: ┌─ план · 2/5  ████░░░░░░ 40% */
.plan { padding: 10px 14px 8px; margin: 2px 0 12px; border-radius: 8px; background: var(--lumen-surface); border: 1px solid var(--lumen-line-strong);
  font: 12.5px/1.55 var(--lumen-mono); animation: fade .2s }
.plan header { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; margin-bottom: 4px; white-space: pre; flex-wrap: wrap }
.plan .plan-bar { color: var(--lumen-accent); font-weight: 500 }
.plan-step { display: flex; gap: 8px; align-items: baseline; padding: 1px 0 }
.plan-box { color: var(--lumen-muted); white-space: pre; flex: none }
.plan-t { min-width: 0; overflow-wrap: anywhere }
.plan-step[data-status="done"] .plan-t { color: var(--lumen-muted); text-decoration: line-through; text-decoration-color: var(--lumen-line-strong) }
.plan-step[data-status="done"] .plan-box { color: var(--lumen-ok) }
.plan-step[data-status="active"] .plan-box, .plan-step[data-status="active"] .plan-t { color: var(--lumen-accent); font-weight: 600 }
.plan-step .g-spin { margin-left: auto }
.plan footer { color: var(--lumen-line-strong); font-size: 11.5px; display: flex; min-width: 0 }
.plan .plan-now { color: var(--lumen-muted); white-space: pre; overflow: hidden; text-overflow: ellipsis; min-width: 0 }

/* approvals: ┌─ claude просит разрешение */
.approvals { display: flex; flex-direction: column; gap: 10px; margin-top: 14px }
.approvals:empty { display: none }
.appr { border-radius: 8px; padding: 12px 14px; background: var(--lumen-surface); border: 1px solid var(--lumen-line-strong); border-left: 3px solid var(--lumen-accent);
  font: 12.5px/1.5 var(--lumen-mono); animation: rise .18s ease-out }
.appr-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; white-space: pre; min-width: 0 }
.appr-head > span::before { content: "┌─ "; color: var(--lumen-accent) }
.appr-tool { margin-left: auto; color: var(--lumen-muted); font-weight: 400; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px }
.appr-sum { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; max-height: 200px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--lumen-sunken); border: 1px solid var(--lumen-line); font: 12px/1.5 var(--lumen-mono) }
.appr details { margin: -4px 0 10px; color: var(--lumen-muted); font-size: 11.5px }
.appr summary { cursor: pointer; width: max-content; border-radius: 4px }
.appr details pre { margin: 6px 0 0; padding: 8px 10px; border-radius: 6px; background: var(--lumen-sunken); border: 1px solid var(--lumen-line);
  font: 11.5px/1.5 var(--lumen-mono); overflow: auto; max-height: 260px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--lumen-text) }
.appr-btns { display: flex; gap: 8px; flex-wrap: wrap }
.appr-btns .btn { height: 30px; font-size: 12px }
.q { margin-top: 4px }
.q + .q { border-top: 1px dashed var(--lumen-line); padding-top: 10px; margin-top: 10px }
.q-h { display: inline-block; font-size: 11px; color: var(--lumen-accent); margin-bottom: 4px }
.q-h::before { content: "<" } .q-h::after { content: ">" }
.q-t { margin: 0 0 8px; font: 500 14.5px/1.5 var(--lumen-sans) }
.q-multi { font: 11px var(--lumen-mono); color: var(--lumen-muted) }
.q-opts { display: flex; flex-direction: column; gap: 2px }
.q-opt { display: flex; align-items: baseline; gap: 9px; text-align: left; padding: 6px 8px; border-radius: 5px; width: 100%; transition: background .15s }
.q-opt:hover { background: var(--lumen-faint) }
.q-opt[aria-pressed="true"] { background: color-mix(in srgb, var(--lumen-accent) 9%, transparent); box-shadow: inset 2px 0 0 var(--lumen-accent) }
.q-box { flex: none; font-style: normal; color: var(--lumen-muted); white-space: pre }
.q-box::before { content: "( )" }
.q-opt.multi .q-box::before { content: "[ ]" }
.q-opt[aria-pressed="true"] .q-box { color: var(--lumen-accent); font-weight: 700 }
.q-opt[aria-pressed="true"] .q-box::before { content: "(•)" }
.q-opt.multi[aria-pressed="true"] .q-box::before { content: "[x]" }
.q-opt span { display: flex; flex-direction: column; min-width: 0 }
.q-opt b { font-weight: 600; font-size: 12.5px }
.q-opt small { color: var(--lumen-muted); font-size: 11.5px; line-height: 1.4; margin-top: 1px }
.q-other-w { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; height: 34px; padding: 0 10px; border: 1px solid var(--lumen-line-strong); border-radius: 6px; background: var(--lumen-paper) }
.q-other-w:focus-within { border-color: var(--lumen-accent) }
.q-other-w > b { color: var(--lumen-accent) }
.q-other { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 12.5px var(--lumen-mono) }

/* jump to bottom */
.jump { position: absolute; left: 50%; bottom: calc(var(--dock-h, 120px) + 14px); width: 32px; height: 32px; margin-left: -16px; border-radius: 6px;
  background: var(--lumen-surface); border: 1px solid var(--lumen-line-strong); box-shadow: var(--pop-shadow); display: grid; place-items: center; z-index: 6;
  color: var(--lumen-text); animation: fade .15s; font: 600 14px/1 var(--lumen-mono) }
.jump:hover { color: var(--lumen-accent); border-color: var(--lumen-accent) }

/* composer: a framed terminal prompt with ┌┐└┘ corners */
.dock { flex: none; padding: 4px 16px max(10px, env(safe-area-inset-bottom)); position: relative; background: var(--lumen-paper); z-index: 4 }
.dock > * { max-width: var(--maxw); margin-left: auto; margin-right: auto }
.composer { position: relative; background: var(--lumen-surface); border: 1px solid var(--lumen-line-strong); border-radius: 10px; padding: 4px 6px 6px;
  box-shadow: var(--lumen-shadow); transition: border-color .15s; cursor: text }
.composer:focus-within { border-color: var(--lumen-text) }
.corner { position: absolute; font: 13px/1 var(--lumen-mono); font-style: normal; color: var(--lumen-muted); pointer-events: none; z-index: 2; transition: color .15s }
.corner.tl { top: -7px; left: -5px } .corner.tr { top: -7px; right: -5px }
.corner.bl { bottom: -6px; left: -5px } .corner.br { bottom: -6px; right: -5px }
.composer:focus-within .corner { color: var(--lumen-accent) }
#input { display: block; width: 100%; border: 0; outline: none; resize: none; background: none; font: 13.5px/1.55 var(--lumen-mono);
  padding: 9px 8px 4px; max-height: 40vh; min-height: 38px; overflow-y: auto }
#input::placeholder { color: var(--lumen-muted) }
.composer { container: composer / inline-size }
.composer-row { display: flex; align-items: center; gap: 6px; min-width: 0 }
/* the composer bar's tags, as the desktop's: [◆ сервер ▾] where Claude works, the limits, the model */
.target { gap: 6px; padding: 0 8px; height: 28px; color: var(--lumen-text); border-color: color-mix(in srgb, var(--lumen-accent) 40%, var(--lumen-line)); max-width: 40% }
.target .sm { font-style: normal; color: var(--lumen-accent); font-size: 11px }
.target .tg-l { min-width: 0; overflow: hidden; text-overflow: ellipsis }
.target .cv, .model-btn .cv { color: var(--lumen-muted); font-weight: 400; font-size: 10px }
.target[data-t="mac"] { border-color: var(--lumen-line-strong) }
.target:hover, .target[aria-expanded="true"] { border-color: var(--lumen-accent); background: color-mix(in srgb, var(--lumen-accent) 6%, transparent) }
.composer-row .limits { height: 28px }
.model-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; border-radius: 6px; font: 600 12px var(--lumen-mono);
  color: var(--lumen-text); white-space: nowrap; border: 1px solid transparent; flex: none }
.model-btn:hover, .model-btn[aria-expanded="true"] { background: var(--lumen-faint); border-color: var(--lumen-line) }
.model-btn .eff { color: var(--lumen-muted); font-weight: 500 }
/* a narrower box sheds the extras instead of wrapping: the bars, the words, the effort, then the week */
@container composer (max-width: 640px) { .limits .lim-bars { display: none } }
@container composer (max-width: 560px) { .limits .lim-w, .limits .lim-ico { display: none } .model-btn .eff { display: none } }
@container composer (max-width: 400px) { .limits .lim-wk { display: none } .target { max-width: 34% } }
@container composer (max-width: 330px) { .target .tg-l { display: none } }
/* a long model name ("по умолчанию") shrinks with an ellipsis instead of pushing the send button off a phone screen */
@container composer (max-width: 420px) { .model-btn { flex: 0 1 auto; min-width: 0; overflow: hidden } .model-btn > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis } }
.attach { width: 30px; height: 30px; border-radius: 50%; background: var(--lumen-sunken); display: grid; place-items: center; color: var(--lumen-text);
  font: 400 17px/1 var(--lumen-mono); flex: none; transition: background .15s, color .15s }
.attach:hover { background: color-mix(in srgb, var(--lumen-accent) 12%, var(--lumen-sunken)); color: var(--lumen-accent) }
.note { flex: 1; min-width: 0; font-size: 11.5px; color: var(--lumen-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px }
.send { width: 34px; height: 32px; border-radius: 8px; background: var(--lumen-text); color: var(--lumen-paper); display: grid; place-items: center; flex: none;
  font: 700 16px/1 var(--lumen-mono); transition: background .15s, color .15s, transform .12s }
.send:hover:not(:disabled) { background: var(--lumen-accent); color: #fff }
.send:active:not(:disabled) { transform: translateY(1px) }
.send:disabled { background: var(--lumen-faint); color: var(--lumen-muted) }
.send.stop { background: var(--lumen-accent); color: #fff; font-size: 12px }
.foot-note { display: flex; justify-content: center; gap: 4px 18px; flex-wrap: wrap; font-size: 10.5px; color: var(--lumen-muted); margin: 7px auto 0 }
.ctx { white-space: nowrap }
.ctx[data-l="warn"] { color: var(--lumen-warn) } .ctx[data-l="bad"] { color: var(--lumen-bad) }
.hint { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; color: var(--lumen-muted); padding: 6px 10px; margin-bottom: 9px;
  border: 1px dashed var(--lumen-line-strong); border-radius: 6px; line-height: 1.45; animation: fade .2s; background: var(--lumen-paper) }
.hint > b { color: var(--lumen-accent) }
.hint.off { border-style: solid; border-color: color-mix(in srgb, var(--lumen-bad) 50%, transparent); color: var(--lumen-text) }
.hint.off span b { color: var(--lumen-bad) }
.hint > span { flex: 1; min-width: 0 }
.hint span b { font-weight: 600; color: var(--lumen-text) }
.hint .dot { margin: 0 4px 1px 4px; vertical-align: middle }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 4px 2px }
.chip { position: relative; border-radius: 6px; border: 1px solid var(--lumen-line-strong); background: var(--lumen-paper); display: flex; align-items: center; gap: 8px; overflow: hidden }
.chip.img { width: 58px; height: 58px }
.chip.img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s }
.chip.up.img img { opacity: .45 }
.chip.file { height: 46px; padding: 0 30px 0 6px; max-width: 250px }
.chip .fi { width: 32px; height: 32px; border-radius: 5px; background: var(--lumen-sunken); border: 1px solid var(--lumen-line); color: var(--lumen-accent); display: grid; place-items: center; flex: none; font-weight: 700 }
.chip-n { min-width: 0; display: flex; flex-direction: column; line-height: 1.25 }
.chip-n b { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.chip-n small { font-size: 10.5px; color: var(--lumen-muted) }
.chip.err { border-color: var(--lumen-bad); border-style: dashed }
.chip.err .chip-n small { color: var(--lumen-bad) }
.chip-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 4px; background: var(--lumen-text); color: var(--lumen-paper); display: grid; place-items: center;
  font: 700 11px/1 var(--lumen-mono) }
.chip-x::before { content: ""; position: absolute; inset: -9px }
.chip-p { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--lumen-accent); width: calc(var(--p, 0) * 100%); transition: width .15s }
.chip.img .chip-spin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) }
.slash { position: absolute; bottom: 100%; left: 16px; right: 16px; margin: 0 auto 10px; background: var(--lumen-surface); border: 1px solid var(--lumen-line-strong);
  border-radius: 8px; box-shadow: var(--pop-shadow); max-height: min(340px, 45vh); overflow-y: auto; padding: 6px; z-index: 10; animation: pop .12s steps(3) }
.sl { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 5px; cursor: pointer; min-height: 32px; font-size: 12.5px }
.sl[aria-selected="true"] { background: var(--lumen-faint) }
.sl[aria-selected="true"] b::before { content: "› "; color: var(--lumen-accent) }
.sl b { font-weight: 600; white-space: nowrap }
.sl small { color: var(--lumen-muted); font-size: 11.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.sl em { font-style: normal; font-size: 10.5px; color: var(--lumen-muted); flex: none }
.sl em::before { content: "<" } .sl em::after { content: ">" }
.drop { position: absolute; inset: 8px; border: 1px dashed var(--lumen-accent); border-radius: 10px; background: color-mix(in srgb, var(--lumen-paper) 90%, var(--lumen-accent));
  display: grid; place-items: center; z-index: 30; font: 600 13px var(--lumen-mono); color: var(--lumen-accent); pointer-events: none; animation: fade .12s }

/* menus, sheets, dialogs, toasts: the desktop's .lumen-pop */
.layer { position: fixed; inset: 0; pointer-events: none; z-index: 50 }
.layer > * { pointer-events: auto }
.pop { position: fixed; min-width: 230px; max-width: min(360px, calc(100vw - 16px)); background: var(--lumen-surface); color: var(--lumen-text); border: 1px solid var(--lumen-line-strong);
  border-radius: 8px; box-shadow: var(--pop-shadow); padding: 10px 6px 6px; animation: pop .12s steps(3); max-height: calc(var(--vvh, 100dvh) - 16px); overflow-y: auto;
  font: 12.5px/1.45 var(--lumen-mono) }
.pop-sec { margin: 0 8px 7px; font: 600 11.5px/1.2 var(--lumen-mono); color: var(--lumen-muted); white-space: pre; overflow: hidden; display: flex; gap: 8px; align-items: center }
.pop-sec::after { content: ""; flex: 1; height: 0; border-top: 1px solid var(--lumen-line-strong); min-width: 12px }
.pop-sec b { order: 2; color: var(--lumen-accent); font-weight: 600 }
.pop-sec:not(:first-child) { margin-top: 10px }
.mi { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 5px; font-size: 12.5px; text-align: left; min-height: 30px }
.mi:hover { background: var(--lumen-faint); color: var(--lumen-accent) }
.mi:focus-visible { outline: none; background: var(--lumen-faint); box-shadow: inset 2px 0 0 var(--lumen-accent) }
.mi > i { width: 14px; flex: none; text-align: center; font-style: normal; color: var(--lumen-muted); transition: color .15s }
.mi:hover > i { color: var(--lumen-accent) }
.mi.danger, .mi.danger > i { color: var(--lumen-bad) }
.mi.ok > i { color: var(--lumen-ok) } .mi.off > i { color: var(--lumen-warn) }
.mi .mi-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35 }
.mi .mi-t b { font-weight: 600; color: var(--lumen-text) }
.mi .mi-t small { color: var(--lumen-muted); font-size: 11.5px; margin-top: 1px }
.mi[aria-checked="true"] > i { color: var(--lumen-accent); transform: scale(1.15) }
.mi[aria-checked="true"] .mi-t b::after { content: "  ◆"; color: var(--lumen-accent); white-space: pre }
.pop-sep { border: 0; border-top: 1px dashed var(--lumen-line); margin: 6px 4px }
.pop-note { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 8px 2px; color: var(--lumen-muted); font-size: 11px; border-top: 1px dashed var(--lumen-line); margin-top: 8px }
.pills { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 8px 4px }
.pills .pill { height: 26px; cursor: pointer; color: var(--lumen-muted); border-style: dashed }
.pills .pill:hover { color: var(--lumen-text) }
.pills .pill[aria-checked="true"] { color: var(--lumen-accent); border-style: solid; border-color: var(--lumen-accent); background: color-mix(in srgb, var(--lumen-accent) 7%, transparent) }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 8px 12px }
.swatch { position: relative; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--lumen-line-strong); display: grid; place-items: center }
.swatch i { width: 16px; height: 16px; border-radius: 3px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08) }
.swatch:hover { border-color: var(--lumen-text) }
.swatch[aria-checked="true"], .swatch.on { border: 1.5px solid var(--lumen-text) }
.swatch[aria-checked="true"]::after, .swatch.on::after { content: "▲"; position: absolute; bottom: -12px; font: 8px/1 var(--lumen-mono); color: var(--lumen-text) }
/* the own color: a rainbow until one is picked; the native input lies over it, invisible */
.swatch.custom { cursor: pointer; overflow: visible }
.swatch.custom i { background: var(--sw, conic-gradient(#d93a1e, #c98a0b, #2f9a57, #14918b, #2d6fd6, #9446cf, #d43d7c, #d93a1e)) }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0 }
.lim-pop { min-width: 300px }
.lim-row { padding: 6px 8px 8px }
.lim-row + .lim-row { border-top: 1px dashed var(--lumen-line) }
.lim-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px }
.lim-head b { font-weight: 600 }
.lim-head span { color: var(--lumen-muted) }
.lim-head span b { color: var(--lumen-text); font-weight: 700 }
.lim-bar { font: 11px/1.1 var(--lumen-mono); color: var(--lumen-accent); letter-spacing: -.5px; margin: 5px 0 3px; white-space: pre; overflow: hidden }
.lim-reset { font-size: 11px; color: var(--lumen-muted) }
.lim-row[data-l="warn"] .lim-bar, .lim-row[data-l="warn"] .lim-head span b { color: var(--lumen-warn) }
.lim-row[data-l="bad"] .lim-bar, .lim-row[data-l="bad"] .lim-head span b { color: var(--lumen-bad) }
.lim-none { margin: 4px 8px 8px; color: var(--lumen-muted) }
.lim-refresh { margin-left: auto; border: 1px solid var(--lumen-line-strong); border-radius: 5px; padding: 1px 8px; font: 11px var(--lumen-mono); color: var(--lumen-text) }
.lim-refresh:hover { border-color: var(--lumen-accent); color: var(--lumen-accent) }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .42); animation: fade .15s }
.pop.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; width: 100%; border-radius: 12px 12px 0 0; border-bottom: 0;
  padding: 6px 10px max(14px, env(safe-area-inset-bottom)); animation: sheet .26s cubic-bezier(.2, .8, .2, 1); max-height: 85dvh; font-size: 13.5px }
.pop.sheet::before { content: "───"; display: block; text-align: center; color: var(--lumen-line-strong); margin: 0 auto 8px; letter-spacing: -1px }
.pop.sheet .mi { min-height: 44px; font-size: 14px; align-items: center }
.pop.sheet .pill { height: 34px; padding: 0 12px; font-size: 13px }
.pop.sheet .swatch { width: 36px; height: 36px }
.dialog { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); background: var(--lumen-paper);
  border-radius: 8px; padding: 18px 20px 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .22); animation: dpop .15s steps(3); border: 1px solid var(--lumen-line-strong);
  font: 12.5px/1.5 var(--lumen-mono) }
.dialog .corner { color: var(--lumen-accent); font-size: 14px }
.dialog .corner.tl { top: -8px; left: -6px } .dialog .corner.tr { top: -8px; right: -6px }
.dialog .corner.bl { bottom: -7px; left: -6px } .dialog .corner.br { bottom: -7px; right: -6px }
.dialog h2 { margin: 0 0 8px; font: 700 14px var(--lumen-mono) }
.dialog h2::before { content: "┌─ "; color: var(--lumen-accent) }
.dialog p { margin: 0 0 18px; color: var(--lumen-muted); overflow-wrap: anywhere }
.dialog-btns { display: flex; gap: 8px; justify-content: flex-end }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h, 110px) + 18px); z-index: 60; display: flex; flex-direction: column;
  gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px) }
.toast { background: var(--lumen-text); color: var(--lumen-paper); padding: 9px 14px; border-radius: 8px; font: 12.5px/1.45 var(--lumen-mono); box-shadow: 0 14px 36px rgba(0, 0, 0, .25);
  animation: tin .18s steps(4); text-align: center; transition: opacity .3s }
.toast.err { background: var(--lumen-bad); color: #fff }
.toast.err::before { content: "◆ " }
.toast.out { opacity: 0 }

/* ---------- phones ---------- */
@media (max-width: 767px) {
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 330px); transform: translateX(-102%); visibility: hidden; margin: 0 !important;
    transition: transform .26s cubic-bezier(.2, .8, .2, 1), visibility 0s .26s; z-index: 40; box-shadow: none; border-right: 0; font-size: 13.5px }
  .app.drawer .side { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 40px rgba(0, 0, 0, .25) }
  .app.side-off .side { margin-left: 0 }
  #side-show { display: inline-grid !important }
  #side-show .ph { display: block } #side-show .dk { display: none }
  #top-new { display: none !important }
  .only-phone { display: inline-grid !important }
  .top { padding-left: 4px; padding-right: max(6px, env(safe-area-inset-right)); gap: 2px; height: calc(50px + env(safe-area-inset-top)) }
  .title { font-size: 13px; margin: 0 4px }
  .top-tools { gap: 2px }
  .target, .composer-row .limits { height: 32px }
  .limits .lim-bars, .limits .lim-w, .limits .lim-ico, .limits .lim-wk, .model-btn .eff { display: none } /* webviews without container queries */
  .model-btn { padding: 0 6px; height: 32px }
  .thread { padding: 12px 14px 20px }
  .page-in { padding: 10px 14px 24px }
  .msgs { gap: 20px }
  .msg.user { max-width: 88% }
  .u-img img { max-width: 200px; max-height: 200px }
  .dock { padding-left: 10px; padding-right: 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)) }
  .foot-note { display: none }
  .hello h2 { font-size: 17px }
  .ornament { font-size: 10.5px }
  .sugg { gap: 6px; margin-top: 16px }
  .sug { padding: 8px 10px; min-height: 0 }
  .sug span { font-size: 11px }
  /* iOS zooms into any field under 16px when the keyboard opens (and the zoomed page then pans sideways): all of them */
  input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), textarea, select { font-size: 16px !important }
  .ci-a { height: 40px; font-size: 13.5px }
  .nav-row { min-height: 42px; font-size: 14px }
  .new-chat { height: 42px; font-size: 14px }
  .search { height: 38px }
  .side-act { height: 38px; font-size: 13.5px }
  .slash { left: 10px; right: 10px }
  .md { font-size: 16px }
  .md pre { font-size: 12.5px }
  .wl-say { font-size: 13.5px }
  .login-title { font-size: 21px }
  .toasts { max-width: calc(100vw - 24px) }
}
@media (pointer: coarse) {
  .ci-more { display: grid; color: var(--lumen-muted) }
  .ci-time { display: none }
  .acts { opacity: 1 }
  .msg.user .acts { opacity: .85 }
  .act { height: 34px; min-width: 34px }
  .new-chat kbd { display: none }
}

/* ---------- motion ---------- */
@keyframes heat { 0%, 100% { background-position: 100% 0 } 50% { background-position: 0% 0 } }
@keyframes blink { 50% { opacity: 0 } }
@keyframes pulse-o { 50% { opacity: .25 } }
@keyframes fade { from { opacity: 0 } }
@keyframes tin { from { opacity: 0 } }
@keyframes pop { from { opacity: 0 } }
@keyframes dpop { from { opacity: 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(5px) } }
@keyframes sheet { from { transform: translateY(100%) } }
@keyframes breathe { 50% { opacity: .65; transform: translateX(-50%) scale(.96) } }
@keyframes shimmer { from { background-position: 100% 0 } to { background-position: 0% 0 } }
@keyframes shake { 20%, 60% { transform: translateX(-6px) } 40%, 80% { transform: translateX(6px) } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important }
}

/* ================= Agent v2 (ag-): one calm thread — shared block: the same in src/pages.css and webclient/static/app.css; keep in step ================= */
.ag-root { --ag-soft: color-mix(in srgb, var(--lumen-text) 4%, var(--lumen-paper)); --ag-soft2: color-mix(in srgb, var(--lumen-text) 7.5%, var(--lumen-paper));
  --ag-tint: color-mix(in srgb, var(--lumen-accent) 7%, var(--lumen-paper)); --ag-sans: var(--lumen-sans, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif);
  container: ag / inline-size; display: flex; flex-direction: column; min-height: 0; height: 100%; position: relative; overflow: hidden;
  font: 12.5px/1.5 var(--lumen-mono); color: var(--lumen-text); background: var(--lumen-paper); }
:where(.ag-root), :where(.ag-root) :where(*, *::before, *::after) { box-sizing: border-box; }
:where(.ag-root) :where(button, input, textarea, select) { font: inherit; color: inherit; }
:where(.ag-root) button { cursor: pointer; }
.ag-root [hidden] { display: none !important; }
.ag-root code { font: 11.5px var(--lumen-mono); background: var(--lumen-faint); border-radius: 4px; padding: 1px 5px; }
.ag-wrap { width: 100%; max-width: 744px; margin: 0 auto; padding: 0 28px; box-sizing: border-box; }
.ag-grow { flex: 1; }
.ag-muted { color: var(--lumen-muted); }

/* --- top: the character, the name, one line about now, pause --- */
.ag-top { flex: none; border-bottom: 1px solid var(--lumen-line); background: var(--lumen-paper); position: relative; z-index: 3; }
.ag-head { display: flex; align-items: center; gap: 14px; padding-top: 16px; padding-bottom: 10px; }
.ag-char { width: 44px; height: 44px; flex: none; display: grid; place-items: center; overflow: visible; }
.ag-who { flex: 1; min-width: 0; }
.ag-name { font: 700 15px/1.25 var(--lumen-mono); letter-spacing: .01em; }
.ag-state { display: flex; align-items: center; gap: 7px; margin-top: 2px; color: var(--lumen-muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.ag-state span { overflow: hidden; text-overflow: ellipsis; }
.ag-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--lumen-ok); flex: none; }
.ag-state.ask { color: var(--lumen-accent); } .ag-state.ask i { background: var(--lumen-accent); animation: ag-pulse 1.6s ease-in-out infinite; }
.ag-state.busy i { background: var(--lumen-warn); animation: ag-pulse 1s ease-in-out infinite; }
.ag-state.off i { background: var(--lumen-muted); opacity: .6; }
.ag-state.bad i { background: var(--lumen-bad); }
@keyframes ag-pulse { 50% { opacity: .25; } }
.ag-pausebtn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--lumen-muted); display: grid; place-items: center; font-size: 14px; flex: none; transition: background .15s, color .15s; }
.ag-pi { display: inline-flex; gap: 3.5px; } .ag-pi i { width: 3.5px; height: 14px; border-radius: 1.5px; background: currentColor; }
.ag-pi.play { gap: 0; } .ag-pi.play i { width: 0; height: 0; border-radius: 0; background: none; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent currentColor; margin-left: 2px; }
.ag-pausebtn:hover, .ag-pausebtn[aria-expanded="true"] { background: var(--ag-soft2); color: var(--lumen-text); }
.ag-menu { position: absolute; right: 28px; top: 58px; min-width: 210px; padding: 6px; border-radius: 12px; background: var(--lumen-surface); border: 1px solid var(--lumen-line-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14); z-index: 10; display: flex; flex-direction: column; }
.ag-menu button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; display: flex; gap: 8px; }
.ag-menu button:hover { background: var(--ag-soft2); }
.ag-menu hr { border: 0; border-top: 1px solid var(--lumen-line); margin: 5px 4px; width: auto; }
.ag-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.ag-tabs::-webkit-scrollbar { display: none; }
.ag-tab { position: relative; border: 0; background: transparent; padding: 9px 12px 11px; color: var(--lumen-muted); font: 500 12.5px var(--lumen-mono); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.ag-tab:first-child { margin-left: -12px; }
.ag-tab:hover { color: var(--lumen-text); }
.ag-tab[aria-selected="true"] { color: var(--lumen-text); font-weight: 700; }
.ag-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--lumen-accent); }
.ag-tab em { font: 600 10.5px/1 var(--lumen-mono); font-style: normal; min-width: 16px; height: 16px; padding: 0 5px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--lumen-accent); color: #fff; }
.ag-tab em.dot { min-width: 7px; width: 7px; height: 7px; padding: 0; }

/* --- body --- */
.ag-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
/* never sideways: a long link or command (a notice's title, a to-do) wraps; code and tables scroll in their own box */
.ag-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scroll-behavior: auto; }
.ag-pane { padding-top: 22px; padding-bottom: 40px; overflow-wrap: anywhere; }
.ag-empty { text-align: center; color: var(--lumen-muted); padding: 56px 24px; font-size: 13px; line-height: 1.7; }
.ag-empty b { display: block; font: 400 22px/1 var(--lumen-mono); color: var(--lumen-line-strong); margin-bottom: 14px; letter-spacing: .1em; }
.ag-note-top { margin: 0 0 14px; padding: 9px 14px; border-radius: 10px; background: var(--ag-tint); font-size: 12.5px; display: flex; gap: 10px; align-items: baseline; }
.ag-note-top.bad { background: color-mix(in srgb, var(--lumen-bad) 11%, var(--lumen-paper)); }
.ag-note-top button { margin-left: auto; border: 0; background: transparent; color: var(--lumen-muted); font-size: 16px; line-height: 1; padding: 0 2px; }

/* --- buttons --- */
.ag-b { height: 32px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--lumen-line-strong); background: transparent; font: 500 12px var(--lumen-mono); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--lumen-text); transition: background .15s, border-color .15s, color .15s, transform .1s; }
.ag-b:hover { background: var(--ag-soft2); }
.ag-b:active { transform: translateY(1px); }
.ag-b.go { background: var(--lumen-accent); border-color: transparent; color: #fff; }
.ag-b.go:hover { background: var(--lumen-accent-strong); }
.ag-b.ghost { border-color: transparent; color: var(--lumen-muted); padding: 0 10px; }
.ag-b.ghost:hover { color: var(--lumen-text); }
.ag-b.arm { border-color: var(--lumen-bad); color: var(--lumen-bad); }
.ag-b:disabled { opacity: .5; pointer-events: none; }
.ag-b.sm { height: 28px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }

/* --- the thread --- */
.ag-thread { display: flex; flex-direction: column; gap: 14px; }
.ag-day { display: flex; align-items: center; gap: 14px; color: var(--lumen-muted); font-size: 11px; letter-spacing: .04em; margin: 14px 0 2px; }
.ag-day::before, .ag-day::after { content: ""; flex: 1; height: 1px; background: var(--lumen-line); }
.ag-m { display: flex; flex-direction: column; max-width: 100%; }
.ag-m.user { align-self: flex-end; align-items: flex-end; max-width: 84%; }
.ag-m.cont { margin-top: -8px; }
.ag-bub { font: 14px/1.65 var(--ag-sans); overflow-wrap: anywhere; }
.ag-m.user .ag-bub { background: var(--ag-tint); border-radius: 18px 18px 5px 18px; padding: 9px 15px; white-space: pre-wrap; }
.ag-m.agent .ag-bub { padding: 2px 0; }
.ag-m.local .ag-bub { opacity: .6; }
.ag-time { margin-top: 4px; color: var(--lumen-muted); font-size: 10.5px; letter-spacing: .02em; }
.ag-typing { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; color: var(--lumen-muted); font-size: 12px; }
.ag-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--lumen-muted); animation: ag-dots 1.2s infinite ease-in-out; }
.ag-typing i:nth-child(2) { animation-delay: .15s; } .ag-typing i:nth-child(3) { animation-delay: .3s; }
.ag-typing span { margin-left: 4px; }
@keyframes ag-dots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ag-md { font: 14px/1.65 var(--ag-sans); overflow-wrap: anywhere; }
.ag-md > :first-child { margin-top: 0; } .ag-md > :last-child { margin-bottom: 0; }
.ag-md p { margin: 0 0 .7em; }
.ag-md ul, .ag-md ol { margin: 0 0 .7em; padding-left: 1.3em; }
.ag-md li { margin: .25em 0; }
.ag-md li::marker { color: var(--lumen-muted); }
.ag-md h5 { margin: 1.35em 0 .5em; font: 600 11px/1.3 var(--lumen-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lumen-muted); }
.ag-md h5::before { content: "├─ "; color: var(--lumen-line-strong); }
.ag-md > h5:first-child { margin-top: 0; }
.ag-md a { color: var(--lumen-accent); text-underline-offset: 2px; }
.ag-md b { font-weight: 650; }
.ag-md blockquote { margin: 0 0 .7em; padding-left: 12px; border-left: 2px solid var(--lumen-line-strong); color: var(--lumen-muted); }
.ag-md pre { margin: 0 0 .7em; padding: 10px 12px; border-radius: 10px; background: var(--ag-soft2); overflow-x: auto; font: 12px/1.5 var(--lumen-mono); }
.ag-md code { font-size: 12px; }

/* cards in the thread */
.ag-card { background: var(--lumen-surface); border: 1px solid var(--lumen-line); border-radius: 16px; padding: 18px 20px; }
.ag-lab { display: flex; align-items: center; gap: 8px; font: 600 10.5px/1.2 var(--lumen-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lumen-muted); margin-bottom: 12px; }
.ag-lab b { color: var(--lumen-accent); font-weight: 700; }
.ag-lab .ag-grow { text-transform: none; letter-spacing: 0; }
.ag-brief { box-shadow: 0 1px 0 var(--lumen-line); }
.ag-brief .ag-title { font: 650 16px/1.35 var(--ag-sans); margin-bottom: 10px; }
.ag-prop { border-color: color-mix(in srgb, var(--lumen-accent) 38%, var(--lumen-line)); background: color-mix(in srgb, var(--lumen-accent) 3.5%, var(--lumen-surface)); }
.ag-prop .ag-title { font: 650 15px/1.4 var(--ag-sans); margin-bottom: 8px; }
.ag-why { margin: 10px 0 0; color: var(--lumen-muted); font: 13px/1.55 var(--ag-sans); }
.ag-why b { font: 600 10.5px var(--lumen-mono); letter-spacing: .06em; text-transform: uppercase; margin-right: 6px; }
.ag-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.ag-cmt { display: block; width: 100%; box-sizing: border-box; margin-top: 12px; resize: vertical; min-height: 54px; border: 1px solid var(--lumen-line-strong); border-radius: 10px; background: var(--lumen-paper); padding: 9px 12px; font: 13.5px/1.5 var(--ag-sans); outline: none; }
.ag-cmt:focus { border-color: var(--lumen-accent); }
.ag-res { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--lumen-line); color: var(--lumen-muted); font: 13px/1.55 var(--ag-sans); }

.ag-line { display: flex; align-items: baseline; gap: 9px; width: 100%; padding: 3px 2px; border: 0; background: transparent; text-align: left; color: var(--lumen-muted); font: 12.5px/1.5 var(--lumen-mono); }
.ag-line:hover { color: var(--lumen-text); }
.ag-line .g { flex: none; width: 1.2em; text-align: center; }
.ag-line .g.ok { color: var(--lumen-ok); } .ag-line .g.no, .ag-line .g.bad { color: var(--lumen-bad); }
.ag-line .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-line[aria-expanded="true"] .t { white-space: normal; }
.ag-line time { flex: none; font-size: 10.5px; }
.ag-detail { margin: 2px 0 4px 22px; padding: 10px 14px; border-radius: 12px; background: var(--ag-soft); }
.ag-detail .ag-md { font-size: 13.5px; }

.ag-notice { display: flex; gap: 10px; align-items: baseline; width: 100%; padding: 9px 14px; border: 0; border-radius: 12px; background: var(--ag-soft); text-align: left; font: 13px/1.5 var(--ag-sans); }
.ag-notice .g { flex: none; width: 1.3em; text-align: center; font-family: var(--lumen-mono); color: var(--lumen-muted); }
.ag-notice.warn .g { color: var(--lumen-warn); } .ag-notice.urgent .g { color: var(--lumen-accent); }
.ag-notice.urgent { background: var(--ag-tint); }
.ag-notice b { font-weight: 650; }
.ag-notice .p { color: var(--lumen-muted); }
.ag-notice time { margin-left: auto; padding-left: 10px; flex: none; color: var(--lumen-muted); font: 10.5px var(--lumen-mono); }
.ag-noticebox { display: flex; flex-direction: column; }
.ag-noticebox .ag-detail { margin: 4px 0 0; }

/* the composer */
.ag-comp { flex: none; padding-top: 6px; padding-bottom: 20px; background: linear-gradient(to top, var(--lumen-paper) 70%, transparent); }
.ag-compbox { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 22px; background: var(--lumen-surface); border: 1px solid var(--lumen-line-strong); box-shadow: 0 2px 10px rgba(0, 0, 0, .05); transition: border-color .15s, box-shadow .15s; }
.ag-compbox:focus-within { border-color: color-mix(in srgb, var(--lumen-accent) 60%, var(--lumen-line-strong)); box-shadow: 0 2px 14px color-mix(in srgb, var(--lumen-accent) 14%, transparent); }
.ag-compbox textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; font: 14px/1.5 var(--ag-sans); padding: 8px 0; max-height: 150px; min-height: 22px; }
.ag-compbox textarea::placeholder { color: var(--lumen-muted); }
.ag-send { width: 36px; height: 36px; border-radius: 50%; border: 0; flex: none; background: var(--lumen-accent); color: #fff; font: 700 19px/1 var(--lumen-mono); display: grid; place-items: center; padding: 0 0 2px; transition: background .15s, opacity .15s, transform .1s; }
.ag-send:hover { background: var(--lumen-accent-strong); }
.ag-send:disabled { opacity: .3; pointer-events: none; }
.ag-hint { margin: 7px 18px 0; color: var(--lumen-muted); font-size: 10.5px; }
.ag-under { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin: 7px 14px 0; }
.ag-under .ag-hint { margin: 0; }
.ag-modes { display: flex; gap: 4px; }
.ag-modes button { height: 22px; padding: 0 9px; border-radius: 99px; border: 1px solid var(--lumen-line-strong); background: transparent; color: var(--lumen-muted); font: 500 10.5px var(--lumen-mono); cursor: pointer; }
.ag-modes button:hover { color: var(--lumen-text); }
.ag-modes button[aria-pressed="true"] { background: var(--lumen-text); color: var(--lumen-paper); border-color: var(--lumen-text); }

/* --- tasks --- */
.ag-add { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 16px; border-radius: 14px; background: var(--lumen-surface); border: 1px solid var(--lumen-line); margin-bottom: 26px; }
.ag-add:focus-within { border-color: color-mix(in srgb, var(--lumen-accent) 55%, var(--lumen-line)); }
.ag-add span { color: var(--lumen-muted); }
.ag-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 14px var(--ag-sans); padding: 8px 0; }
.ag-sec { display: flex; align-items: center; gap: 8px; margin: 28px 0 10px; font: 600 11px/1.2 var(--lumen-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lumen-muted); }
.ag-sec:first-child { margin-top: 0; }
.ag-sec b { color: var(--lumen-accent); font-weight: 700; }
.ag-sec button { border: 0; background: transparent; padding: 0; letter-spacing: inherit; text-transform: inherit; font: inherit; color: inherit; }
.ag-sec button:hover { color: var(--lumen-text); }
.ag-stack { display: flex; flex-direction: column; gap: 8px; }
.ag-none { padding: 14px 4px; color: var(--lumen-muted); font: 13px var(--ag-sans); }
.ag-todo { display: flex; align-items: flex-start; gap: 13px; padding: 13px 14px 13px 16px; border-radius: 14px; background: var(--ag-soft); transition: opacity .3s, transform .3s; }
.ag-todo.ask { background: var(--ag-tint); }
.ag-todo.gone { opacity: 0; transform: translateX(14px); }
.ag-todo.done .ag-tt { text-decoration: line-through; color: var(--lumen-muted); }
.ag-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--lumen-line-strong); background: transparent; flex: none; margin-top: 1px; display: grid; place-items: center; font-size: 11px; color: transparent; padding: 0; transition: border-color .15s, background .15s, color .15s; }
.ag-check:hover { border-color: var(--lumen-ok); color: var(--lumen-ok); }
.ag-todo.done .ag-check { background: var(--lumen-ok); border-color: var(--lumen-ok); color: #fff; }
.ag-tmain { flex: 1; min-width: 0; }
.ag-tt { font: 14px/1.45 var(--ag-sans); overflow-wrap: anywhere; }
.ag-td { margin-top: 2px; color: var(--lumen-muted); font: 13px/1.5 var(--ag-sans); }
.ag-tm { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ag-chip { font: 500 10.5px/1 var(--lumen-mono); padding: 4px 8px; border-radius: 99px; background: var(--ag-soft2); color: var(--lumen-muted); }
.ag-chip.ask { background: var(--lumen-accent); color: #fff; }
.ag-tact { display: flex; gap: 2px; align-items: center; flex: none; opacity: .0; transition: opacity .15s; }
.ag-todo:hover .ag-tact, .ag-todo:focus-within .ag-tact, .ag-todo.ask .ag-tact { opacity: 1; }
@media (hover: none) { .ag-tact { opacity: 1; } }

/* --- results --- */
.ag-file { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--ag-soft); }
.ag-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--ag-soft2); display: grid; place-items: center; flex: none; font: 600 10px var(--lumen-mono); letter-spacing: .04em; color: var(--lumen-muted); text-transform: uppercase; }
.ag-ico.own { background: var(--ag-tint); color: var(--lumen-accent); }
.ag-fmain { flex: 1; min-width: 0; }
.ag-fname { font: 600 14px/1.35 var(--ag-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-fsub { margin-top: 2px; color: var(--lumen-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-fact { display: flex; gap: 6px; flex: none; }
.ag-preview { margin: 6px 0 4px; padding: 14px 16px; border-radius: 14px; background: var(--lumen-surface); border: 1px solid var(--lumen-line); max-height: 420px; overflow: auto; }
.ag-preview img { max-width: 100%; border-radius: 8px; display: block; }
.ag-preview pre { margin: 0; font: 12px/1.55 var(--lumen-mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- settings --- */
.ag-set { background: var(--lumen-surface); border: 1px solid var(--lumen-line); border-radius: 16px; padding: 4px 20px; margin-bottom: 22px; }
.ag-srow { display: flex; align-items: center; gap: 16px; padding: 15px 0; }
.ag-srow + .ag-srow { border-top: 1px solid var(--lumen-line); }
.ag-srow.col { flex-direction: column; align-items: stretch; gap: 10px; }
.ag-sl { flex: 1; min-width: 0; font: 14px/1.4 var(--ag-sans); }
.ag-sl small { display: block; margin-top: 3px; color: var(--lumen-muted); font: 12.5px/1.5 var(--ag-sans); }
.ag-in { height: 34px; padding: 0 12px; border: 1px solid var(--lumen-line-strong); border-radius: 9px; background: var(--lumen-paper); outline: none; font: 13px var(--lumen-mono); min-width: 0; }
.ag-in:focus { border-color: var(--lumen-accent); }
.ag-in.name { font: 600 14px var(--ag-sans); width: 200px; }
.ag-in[type="time"] { width: 132px; text-align: center; }
.ag-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-seg button { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--lumen-line-strong); background: transparent; font: 500 12px var(--lumen-mono); }
.ag-seg button:hover { background: var(--ag-soft2); }
.ag-seg button[aria-pressed="true"] { background: var(--lumen-text); color: var(--lumen-paper); border-color: var(--lumen-text); }
.ag-sw { width: 40px; height: 24px; border-radius: 99px; border: 0; padding: 0; background: var(--lumen-line-strong); position: relative; flex: none; transition: background .2s; }
.ag-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.ag-sw[aria-checked="true"] { background: var(--lumen-accent); }
.ag-sw[aria-checked="true"]::after { transform: translateX(16px); }
.ag-honest { margin: 2px 0 15px; padding: 11px 14px; border-radius: 11px; background: var(--ag-soft); color: var(--lumen-muted); font: 12.5px/1.6 var(--ag-sans); }
.ag-honest b { color: var(--lumen-text); font-weight: 600; }
.ag-saved { margin-left: auto; color: var(--lumen-ok); font: 500 11.5px var(--lumen-mono); letter-spacing: 0; text-transform: none; }
.ag-look { padding: 6px 0 16px; }
.ag-skins { display: flex; flex-wrap: wrap; gap: 10px; }
.ag-skin { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 96px; padding: 12px 12px 10px; border-radius: 14px; border: 1px solid var(--lumen-line); background: transparent; font: 500 11.5px var(--lumen-mono); color: var(--lumen-muted); transition: border-color .15s, background .15s; }
.ag-skin:hover { background: var(--ag-soft); }
.ag-skin[aria-pressed="true"] { border-color: var(--lumen-accent); background: var(--ag-tint); color: var(--lumen-text); }
.ag-skin-pv { height: 64px; display: grid; place-items: center; }
.ag-code { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; border-radius: 12px; background: var(--ag-soft); }
.ag-codebig { font: 700 24px var(--lumen-mono); letter-spacing: .14em; }
.ag-bound { display: flex; align-items: center; gap: 10px; padding: 10px 0; font: 14px var(--ag-sans); }
.ag-bound b::before { content: "◆ "; color: var(--lumen-ok); font-weight: 400; }

/* --- onboarding in the thread --- */
.ag-ask { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--lumen-surface); border: 1px solid var(--lumen-line); }
.ag-ask .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ag-ask .ag-in { flex: 1; min-width: 140px; height: 38px; font: 15px var(--ag-sans); }
.ag-ask .ag-in[type="time"] { flex: none; font-family: var(--lumen-mono); }
.ag-err { color: var(--lumen-bad); font-size: 12px; }
.ag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-hello { padding-top: 6vh; }

@container ag (max-width: 560px) {
  .ag-wrap { padding: 0 16px; }
  .ag-head { padding-top: 12px; gap: 12px; }
  .ag-menu { right: 16px; top: 54px; }
  .ag-tab:first-child { margin-left: -12px; }
  .ag-pane { padding-top: 16px; }
  .ag-card { padding: 16px; }
  .ag-m.user { max-width: 90%; }
  .ag-srow { flex-wrap: wrap; gap: 10px; }
  .ag-in.name { width: 100%; }
  .ag-set { padding: 2px 16px; }
  .ag-todo { flex-wrap: wrap; row-gap: 8px; } .ag-tmain { flex-basis: calc(100% - 40px); } .ag-tact { margin-left: 33px; flex-basis: 100%; }
  .ag-file { flex-wrap: wrap; } .ag-fmain { flex-basis: calc(100% - 60px); } .ag-fact { margin-left: 54px; }
  .ag-comp { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
/* --- goals («Работа», ag-g*): shared block, the same in src/pages.css and webclient/static/app.css; source ~/scratch/goals/goals.css via sync-goals-css.py --- */
.ag-tab em.calm { background: var(--ag-soft2); color: var(--lumen-text); }
.ag-gsec { display: flex; align-items: center; margin-top: 0; }
.ag-stack.tight { gap: 2px; }
.ag-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 22px; padding: 0 10px 0 9px; border-radius: 11px; background: var(--ag-soft2); color: var(--lumen-muted); font: 600 11px/1 var(--lumen-mono); white-space: nowrap; }
.ag-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--lumen-muted); }
.ag-pill.busy { color: var(--lumen-text); } .ag-pill.busy i { background: var(--lumen-warn); animation: ag-pulse 1.2s ease-in-out infinite; }
.ag-pill.ok { color: var(--lumen-ok); } .ag-pill.ok i { background: var(--lumen-ok); }
.ag-pill.ask { background: var(--lumen-accent); color: #fff; } .ag-pill.ask i { background: #fff; animation: ag-pulse 1.4s ease-in-out infinite; }
.ag-pill.warn { color: var(--lumen-warn); } .ag-pill.warn i { background: var(--lumen-warn); }
.ag-pill.bad { color: var(--lumen-bad); } .ag-pill.bad i { background: var(--lumen-bad); }
.ag-pill.off i { opacity: .55; }
.ag-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--lumen-muted); opacity: .6; }
.ag-dot.busy { background: var(--lumen-warn); opacity: 1; animation: ag-pulse 1.2s ease-in-out infinite; } .ag-dot.ok { background: var(--lumen-ok); opacity: 1; } .ag-dot.bad { background: var(--lumen-bad); opacity: 1; }

/* a goal card in the list */
.ag-g { cursor: pointer; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, box-shadow .15s; outline: none; }
.ag-g:hover, .ag-g:focus-visible { border-color: var(--lumen-line-strong); box-shadow: 0 2px 12px rgba(0, 0, 0, .05); }
.ag-g.blocked { border-color: color-mix(in srgb, var(--lumen-accent) 45%, var(--lumen-line)); background: color-mix(in srgb, var(--lumen-accent) 3.5%, var(--lumen-surface)); }
.ag-gtop { display: flex; align-items: flex-start; gap: 12px; }
.ag-gt { flex: 1; min-width: 0; font: 650 15px/1.4 var(--ag-sans); overflow-wrap: anywhere; }
.ag-gt.big { font-size: 20px; line-height: 1.3; }
.ag-gt.link { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0; margin-bottom: 8px; }
.ag-gt.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ag-gl { display: flex; gap: 10px; align-items: baseline; color: var(--lumen-muted); font: 13px/1.5 var(--ag-sans); min-width: 0; }
.ag-gl .ic { flex: none; width: 16px; text-align: center; font: 600 12px var(--lumen-mono); color: var(--lumen-muted); }
.ag-gl .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ag-gl.ask { color: var(--lumen-text); } .ag-gl.ask .ic { color: var(--lumen-accent); font-weight: 800; }
.ag-gc .ag-gl .tx { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ag-gc { cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 14px 18px; outline: none; }
.ag-gc .ag-lab { margin-bottom: 0; }
.ag-gc:hover { border-color: var(--lumen-line-strong); }
.ag-gc .ag-gt { font-size: 14px; }
.ag-gq .ag-md { margin-bottom: 2px; }
/* the budget: a hairline bar and two small numbers */
.ag-bud { display: flex; flex-direction: column; gap: 6px; }
.ag-bar { height: 4px; border-radius: 2px; background: var(--ag-soft2); overflow: hidden; }
.ag-bar i { display: block; height: 100%; border-radius: 2px; background: color-mix(in srgb, var(--lumen-text) 55%, var(--lumen-paper)); transition: width .4s; }
.ag-bud.hot .ag-bar i { background: var(--lumen-warn); }
.ag-bt { display: flex; justify-content: space-between; gap: 12px; color: var(--lumen-muted); font-size: 11px; letter-spacing: .01em; }
/* the goal's chats: small rows */
.ag-crows { display: flex; flex-direction: column; gap: 1px; margin: 0 -8px -6px; }
.ag-crows.big { margin: 0; gap: 2px; }
.ag-crow { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 7px 8px; border-radius: 8px; font: 12.5px var(--lumen-mono); min-width: 0; width: 100%; }
.ag-crow:hover { background: var(--ag-soft2); }
.ag-crow .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--ag-sans); font-size: 13px; }
.ag-crow .p { flex: none; color: var(--lumen-muted); font-size: 11px; }
.ag-more { padding: 2px 8px 0 25px; color: var(--lumen-muted); font-size: 11px; }
.ag-crows.big .ag-crow { padding: 10px 12px; border: 1px solid var(--lumen-line); border-radius: 12px; background: var(--lumen-surface); } .ag-crows.big .ag-crow:hover { border-color: var(--lumen-line-strong); }

/* the goal view */
.ag-gv { display: flex; flex-direction: column; gap: 16px; }
.ag-gv > .ag-sec { margin-bottom: -6px; }
.ag-back { align-self: flex-start; border: 0; background: transparent; color: var(--lumen-muted); font: 500 12px var(--lumen-mono); padding: 4px 8px 4px 0; margin-bottom: -4px; }
.ag-back:hover { color: var(--lumen-text); }
.ag-gh { display: flex; flex-direction: column; gap: 10px; }
.ag-gsub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--lumen-muted); font-size: 11.5px; }
.ag-gctl { margin-top: 0; } .ag-gctl .ag-b.ghost:first-child { margin-left: -10px; }
.ag-b.stop { background: var(--lumen-bad); border-color: transparent; color: #fff; }
.ag-stopq { padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--lumen-bad) 8%, var(--lumen-paper)); font: 13px/1.55 var(--ag-sans); }
.ag-stopq .ag-acts { margin-top: 12px; }
.ag-gnote-top { padding: 11px 14px; border-radius: 12px; background: var(--ag-tint); font: 13px/1.55 var(--ag-sans); color: var(--lumen-muted); }
.ag-gnote-top.bad { background: color-mix(in srgb, var(--lumen-bad) 9%, var(--lumen-paper)); color: var(--lumen-text); }
.ag-q .ag-md { font-size: 15px; }
.ag-q .ag-cmt { margin-top: 14px; }
.ag-res-card { border-color: color-mix(in srgb, var(--lumen-ok) 40%, var(--lumen-line)); }
.ag-res-card .ag-lab b { color: var(--lumen-ok); }
.ag-lab.ev { margin-top: 18px; }
.ag-ev { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--ag-soft2); font: 12px/1.6 var(--lumen-mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; }
.ag-gnote .ag-hint { margin-top: 6px; }
.ag-info { display: flex; flex-direction: column; border: 1px solid var(--lumen-line); border-radius: 14px; background: var(--lumen-surface); }
.ag-ir { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 13px 18px; } .ag-ir + .ag-ir { border-top: 1px solid var(--lumen-line); }
.ag-ir .k { color: var(--lumen-muted); font: 600 10.5px/1.9 var(--lumen-mono); letter-spacing: .06em; text-transform: uppercase; }
.ag-ir .v { font: 13px/1.6 var(--ag-sans); } .ag-ir .ag-md { font-size: 13.5px; }
/* the timeline */
.ag-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.ag-tl li { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.ag-tl li:last-child { padding-bottom: 0; }
.ag-tl li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--lumen-line); }
.ag-tl li:last-child::before { display: none; }
.ag-ti { flex: none; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: var(--ag-soft2); color: var(--lumen-text); font: 600 12px/1 var(--lumen-mono); }
.ag-ti.w { font-size: 9.5px; letter-spacing: -.02em; }
.ag-tl .k-evidence .ag-ti, .ag-tl .k-done .ag-ti { background: color-mix(in srgb, var(--lumen-ok) 16%, var(--lumen-paper)); color: var(--lumen-ok); }
.ag-tl .k-blocked .ag-ti { background: var(--lumen-accent); color: #fff; }
.ag-tl .k-answer .ag-ti { background: var(--ag-tint); color: var(--lumen-accent); border: 1px solid color-mix(in srgb, var(--lumen-accent) 30%, transparent); }
.ag-tl .k-error .ag-ti { background: color-mix(in srgb, var(--lumen-bad) 14%, var(--lumen-paper)); color: var(--lumen-bad); }
.ag-tl .k-budget .ag-ti { background: color-mix(in srgb, var(--lumen-warn) 16%, var(--lumen-paper)); color: var(--lumen-warn); }
.ag-tl .now .ag-ti { box-shadow: 0 0 0 4px color-mix(in srgb, var(--lumen-warn) 22%, transparent); animation: ag-pulse 1.6s ease-in-out infinite; }
.ag-tb { flex: 1; min-width: 0; padding-top: 3px; }
.ag-tm { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; font-size: 11px; color: var(--lumen-muted); }
.ag-tm b { font: 600 10.5px var(--lumen-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lumen-text); } .ag-tm time { letter-spacing: .02em; }
.ag-tb .ag-md { font-size: 13.5px; line-height: 1.6; }
.ag-tlink { margin-top: 6px; border: 0; background: transparent; padding: 0; color: var(--lumen-accent); font: 12px var(--lumen-mono); text-align: left; } .ag-tlink:hover { text-decoration: underline; text-underline-offset: 3px; }
/* a worker chat */
.ag-cvtop { flex: none; border-bottom: 1px solid var(--lumen-line); padding: 10px 0 12px; background: var(--lumen-paper); }
.ag-cvhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ag-cvhead .ag-back { margin: 0; flex-basis: 100%; text-align: left; }
.ag-cvt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-cvt .ag-gt { font-size: 15px; }
.ag-by { margin-bottom: 4px; color: var(--lumen-muted); font: 600 10px/1.2 var(--lumen-mono); letter-spacing: .06em; text-transform: uppercase; } .ag-by.you { color: var(--lumen-accent); }
.ag-m.user.cont .ag-by { display: none; }
.ag-cv .ag-m.agent .ag-md { font-size: 14px; }
/* the «+ Новая цель» form */
.ag-new { margin-bottom: 26px; display: flex; flex-direction: column; gap: 14px; }
.ag-new .ag-lab { margin-bottom: 0; }
.ag-f { display: flex; flex-direction: column; gap: 6px; }
.ag-f .fl, .ag-step .fl { font: 600 10.5px/1.2 var(--lumen-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lumen-muted); }
.ag-f .fl small { margin-left: 8px; font: 400 11px var(--ag-sans); letter-spacing: 0; text-transform: none; }
.ag-f .ag-cmt { margin-top: 0; }
.ag-in.wide { width: 100%; height: 38px; font: 13px var(--lumen-mono); }
.ag-steps { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; }
.ag-step { display: flex; flex-direction: column; gap: 6px; }
.ag-stp { display: inline-flex; align-items: center; height: 34px; border: 1px solid var(--lumen-line-strong); border-radius: 9px; overflow: hidden; }
.ag-stp button { width: 34px; height: 100%; border: 0; background: transparent; font: 500 16px var(--lumen-mono); color: var(--lumen-muted); } .ag-stp button:hover { background: var(--ag-soft2); color: var(--lumen-text); }
.ag-stp output { min-width: 44px; text-align: center; font: 600 13px var(--lumen-mono); }
.ag-new .ag-err { min-height: 0; color: var(--lumen-bad); font-size: 12.5px; } .ag-new .ag-err:empty { display: none; }
@container ag (max-width: 560px) {
  .ag-ir { grid-template-columns: 1fr; gap: 2px; padding: 12px 16px; }
  .ag-gt.big { font-size: 18px; }
  .ag-g { padding: 16px 16px; }
  .ag-g .ag-gtop { flex-direction: column; align-items: flex-start; gap: 10px; } .ag-g .ag-gtop .ag-pill { order: -1; }
  .ag-steps { gap: 14px 20px; }
  /* five tabs fit a phone without sideways scrolling: tighter labels, smaller badges */
  .ag-tabs { justify-content: space-between; }
  .ag-tab { padding: 9px 4px 11px; font-size: 11.5px; gap: 3px; flex: none; }
  .ag-tab:first-child { margin-left: -4px; } .ag-tab:last-child { margin-right: -4px; }
  .ag-tab[aria-selected="true"]::after { left: 4px; right: 4px; }
  .ag-tab em { min-width: 14px; height: 14px; padding: 0 3px; font-size: 9px; }
  .ag-tab em.dot { min-width: 6px; width: 6px; height: 6px; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { .ag-pill i, .ag-dot, .ag-tl .now .ag-ti { animation: none !important; } }
/* --- /goals --- */
@media (prefers-reduced-motion: reduce) {
  .ag-root *, .ag-root *::before, .ag-root *::after { animation: none !important; transition: none !important; }
}

/* web only: the page column is the agent's own full-height frame; the sidebar card */
.page-in.ag-root { max-width: none; margin: 0; padding: 0; height: 100%; }
.btn-ghost { border-color: transparent }
.btn-ghost::before, .btn-ghost::after { content: none }
.ag-side .nav-ico { width: 24px; height: 24px }
.ag-side-sub { display: block; color: var(--lumen-muted); font-size: 11px; font-weight: 400 !important }
.ag-sdot { min-width: 8px; height: 8px; border-radius: 4px; background: var(--lumen-accent); flex: none; display: inline-grid; place-items: center }
.ag-sdot:not(:empty) { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; color: #fff; font: 600 10.5px var(--lumen-mono); margin-left: 6px }
.ag-md .code { margin: 0 0 .7em; font-size: 12px }
.ag-md :is(h1, h2, h3, h4, h6) { margin: 1.35em 0 .5em; font: 600 11px/1.3 var(--lumen-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lumen-muted); }
.ag-md :is(h1, h2, h3, h4, h6)::before { content: "├─ "; color: var(--lumen-line-strong); }
.ag-md :is(h1, h2, h3, h4, h6):first-child { margin-top: 0; }
.ag-md hr { border: 0; border-top: 1px solid var(--lumen-line); margin: 1em 0; }
@media (max-width: 767px) { .page-in.ag-root { padding: 0 } }


/* ---------- voice: dictation, the call (js/call.js) ---------- */
.mic, .callbtn { width: 28px; height: 28px; font-size: 0 }
.mic .i, .callbtn .i { width: 16px; height: 16px }
.mic.rec { width: auto; padding: 0 9px 0 8px; gap: 6px; border-radius: 15px; display: inline-flex; align-items: center; color: var(--lumen-accent);
  background: color-mix(in srgb, var(--lumen-accent) 12%, var(--lumen-sunken)); font: 600 11.5px var(--lumen-mono) }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lumen-accent); animation: recpulse 1.1s ease-in-out infinite }
.mic.busy { font-size: 14px; color: var(--lumen-muted) }
@keyframes recpulse { 50% { opacity: .25; transform: scale(.7) } }
.vset { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 2px; min-width: 0 }
.vset .pills { padding: 0 }
.vsel { width: 100%; min-width: 0; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--lumen-line-strong); background: var(--lumen-surface);
  color: var(--lumen-text); font: 12px var(--lumen-mono); text-overflow: ellipsis }
.vnote { color: var(--lumen-muted); font-size: 11px; line-height: 1.45 }

.call { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; overflow: hidden; background-color: var(--lumen-paper);
  padding: max(14px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); animation: callin .22s ease-out }
@keyframes callin { from { opacity: 0 } }
@keyframes callglow { 50% { opacity: .6; transform: scale(.94) } }
.call-top { width: 100%; max-width: 520px; display: flex; justify-content: space-between; align-items: center; min-width: 0; font-size: 11.5px; color: var(--lumen-muted) }
.call-tag { color: var(--lumen-accent); letter-spacing: .04em }
.call-stage { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: min(5vh, 36px); min-width: 0 }
.call-char { min-width: 120px; min-height: 130px; display: grid; place-items: center }
.call-char.glyph { font: 700 84px/1 var(--lumen-mono); color: var(--lumen-accent); animation: callglow 3.2s ease-in-out infinite }
.call[data-s="hear"] .call-char.glyph { animation-duration: 1s }
.call[data-s="think"] .call-char.glyph { animation: recpulse .9s ease-in-out infinite }
.call-status { margin: 0; font-size: 12.5px; color: var(--lumen-muted); letter-spacing: .02em }
.call[data-s="hear"] .call-status { color: var(--lumen-accent) }
.call-txt { flex: 1; min-height: 0; width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; min-width: 0 }
.call-you { margin: 0; min-height: 1.5em; font-size: 14px; color: var(--lumen-muted); overflow-wrap: anywhere; text-align: center }
.call-you.live { color: var(--lumen-text) }
.call-reply { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overflow-wrap: anywhere; white-space: pre-wrap; font: 14px/1.6 var(--lumen-sans); color: var(--lumen-text);
  padding: 4px 2px; text-align: left }
.call-err { margin: 0; min-height: 0; color: var(--lumen-bad); font-size: 12px; text-align: center; overflow-wrap: anywhere }
.call-btns { flex: none; display: flex; gap: 10px; margin-top: 12px; width: 100%; max-width: 520px; justify-content: center; flex-wrap: wrap }
.call-btns .btn { height: 42px; padding: 0 16px }
.call-mic[aria-pressed="true"] { color: var(--lumen-muted) }
@media (prefers-reduced-motion: reduce) { .rec-dot, .call-char.glyph, .call { animation: none !important } }
/* the mic and the call button take room from the row: the server/Mac pill keeps its icon only, the limits step aside while recording */
@container composer (max-width: 420px) { .target .tg-l { display: none } .target .cv { display: none } }
.composer:has(.mic.rec) .limits { display: none }

/* the microphone in the agent's composers: dictation by Claude (the relay's /voice/transcribe) */
.ag-mic { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 36px; height: 36px; padding: 0 8px; border: 0; border-radius: 18px; background: transparent; color: var(--lumen-muted); cursor: pointer; font: 12px var(--lumen-mono); transition: background .15s, color .15s; }
.ag-mic:hover { background: var(--lumen-faint); color: var(--lumen-text); }
.ag-mic svg { width: 18px; height: 18px; }
.ag-mic.rec { background: var(--lumen-accent); color: #fff; }
.ag-mic.rec .rec-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: lumen-pulse 1.2s steps(2) infinite; }
.ag-mic.busy { opacity: .6; }
