/* hakobu OS – eine Datei, eigenes CSS. Farben und Komponenten-Muster wie Timekeeper: hakobu Design System v01
   (docs/design/hakobu-design-v01, Tokens 1:1 in tokens.css aus tokens-timekeeper-app.css). Systemschrift, keine Schatten,
   kleine Radien, Ensō tagsüber im Verlauf enso-light → enso-deep, nachts hell. Mobil zuerst, Tag/Nacht. */

/* „automatisch“: Nacht-Werte des Design Systems auch über die Systemeinstellung (tokens.css kennt nur data-theme=dark) */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #050505; --paper-raised: #171717; --ink: #f1f3f5; --ink-muted: #a7b2bd; --hairline: rgba(241, 243, 245, 0.14);
    --blue: #0a86b4; --blue-text: #8fd0ec; --band: rgba(16, 20, 22, 0.66); --band-deep: rgba(6, 8, 9, 0.8); --band-glow: #2b5772;
    --action: #cddfea; --on-action: #050505; --action-hover: #d7f0ff; --danger: #ffb4a8;
    --customer-orange: #ea691c; --customer-green: #2e7240; --customer-ochre: #8e5912; --customer-teal: #109b84;
  }
}

/* Aliase der App auf die Design-System-Tokens */
:root {
  --sheet: var(--paper-raised);
  --sheet-2: color-mix(in srgb, var(--paper) 70%, var(--ink) 5%);
  --muted: var(--ink-muted);
  --line: var(--hairline);
  --line-soft: color-mix(in srgb, var(--hairline) 60%, transparent);
  --control-border: color-mix(in srgb, var(--ink-muted) 55%, transparent);
  --indigo: var(--action); --indigo-ink: var(--on-action);
  --indigo-soft: color-mix(in srgb, var(--action) 12%, var(--paper-raised));
  --accent: var(--blue-text);
  --ext: var(--danger); --ext-soft: color-mix(in srgb, var(--danger) 12%, var(--paper-raised));
  --ok: var(--customer-green); --ok-soft: color-mix(in srgb, var(--customer-green) 13%, var(--paper-raised));
  /* Warnton: Text muss 4.5:1 erreichen – tagsüber Ocker, nachts Orange (Kundenfarben sonst nie als Text) */
  --part: var(--customer-ochre); --part-soft: color-mix(in srgb, var(--customer-orange) 13%, var(--paper-raised)); --count-ink: #ffffff;
  --me: var(--action); --me-ink: var(--on-action); --agent: var(--paper-raised);
  --enso-mode: gradient; --enso-ink: var(--ink);
  --side-bg: #0d1f2b; --side-ink: var(--on-band); --side-muted: rgba(232, 238, 243, 0.62); --side-hover: rgba(232, 238, 243, 0.07);
  --side-sel: #2b5772; --side-sel-ink: #ffffff; --side-line: rgba(232, 238, 243, 0.1);
  --shadow: none;
  --f-display: var(--font-sans); --f-body: var(--font-sans);
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 6px; --side: 288px;
  color-scheme: light;
}
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --part: var(--customer-orange); --count-ink: #050505; --paper-raised: #121212; --enso-mode: solid; --side-bg: #0d0d0d; --side-sel: #2b3a45; color-scheme: dark; } }
:root[data-theme="dark"] { --part: var(--customer-orange); --count-ink: #050505; --paper-raised: #121212; --enso-mode: solid; --side-bg: #0d0d0d; --side-sel: #2b3a45; color-scheme: dark; }

* { box-sizing: border-box; }
/* Basisgröße: Schriften und Abstände stehen in rem. Handy 90 % (LIEFERUNG-21); Desktop bleibt bei 16 px, also unverändert.
   Grenzen am Handy: kleinster Text --min-text, Eingabefelder 16 px, Tippflächen in px (Ende von work.css). */
html { font-size: 16px; --min-text: 0px; }
@media (max-width: 899px) { html { font-size: 14.4px; --min-text: 12px; } }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; } /* nur Verlauf/Listen scrollen */
body { margin: 0; background: var(--paper); color: var(--ink); font: .96875rem/1.55 var(--f-body); letter-spacing: .005em; -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
canvas.enso { display: block; flex: none; }
.app { height: 100dvh; }

/* ---------- Wortmarke */
.wordmark { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.wm-line { display: flex; align-items: baseline; gap: 1px; }
.wm-line b { font-weight: 700; font-size: 1.3125rem; color: var(--ink); letter-spacing: -.01em; }
.wm-os { font-weight: 500; font-size: max(var(--min-text), .8125rem); color: var(--muted); margin-left: 1px; }
.wm-sub { font-size: max(var(--min-text), .6875rem); letter-spacing: .02em; color: var(--muted); margin-top: .1875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-hero { align-items: center; }
.wm-hero .wm-line b { font-size: clamp(2.125rem, 4.4vw, 4rem); } .wm-hero .wm-os { font-size: clamp(1.1875rem, 2.2vw, 2rem); } .wm-hero .wm-sub { font-size: clamp(.8125rem, 1.2vw, 1.0625rem); letter-spacing: .04em; }

/* ---------- Laden / Login */
.loader, .login { height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: .875rem; padding: 1.5rem 1rem; text-align: center; }
.enso-hero { width: 168px; height: 168px; }
.login .enso-hero { width: 120px; height: 120px; }
/* Bühne für Login und Laden: Enso 40 % Breite (Handy fast voll), Wortmarke mittig im Ring */
.stage { position: relative; width: min(64vw, 68vh); min-width: 280px; max-width: 920px; } /* Zielbild login-ziel.png: Ring ≈ halbe Bildbreite */
.stage .stage-anchor { width: 100%; aspect-ratio: 1; }
.enso-full { position: fixed; inset: 0; width: 100vw; height: 100dvh; pointer-events: none; z-index: 0; }
.stage-center, .stage-below, .login .users { position: relative; z-index: 1; }
.stage-center { position: absolute; }
.stage-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center; pointer-events: none; }
@media (max-width: 700px) { .stage { width: 88vw; min-width: 0; } }
.wm-slot { min-height: 52px; display: flex; align-items: center; justify-content: center; }
.loader-step { font-family: var(--f-body); font-size: max(var(--min-text), .78125rem); color: var(--muted); letter-spacing: .04em; }
.loader-pct { font-family: var(--f-body); font-size: max(var(--min-text), .6875rem); color: var(--muted); }
/* fester Bereich unter dem Enso: Laden und Login gleich hoch → kein Sprung beim Übergang */
.stage-below a.btn { text-decoration: none; }
.stage-below { height: 132px; display: flex; flex-direction: column; align-items: center; gap: .5rem; flex: none; }
.login .users { display: flex; flex-direction: column; gap: .5rem; width: min(440px, 90vw); }
@media (prefers-reduced-motion: no-preference) {
  .login .users .btn { opacity: 0; transform: translateY(6px); animation: userIn .76s ease-out forwards; }
  .login .users .btn[data-k="1"] { animation-delay: .16s; } .login .users .btn[data-k="2"] { animation-delay: .32s; }
  @keyframes userIn { to { opacity: 1; transform: none; } }
}
.login .btn.user { justify-content: space-between; min-height: 52px; font-size: 1.0625rem; border-color: var(--control-border); }
/* Hover: Kontrastumkehr – Hintergrund wird zur (leicht durchscheinenden) Textfarbe, Schrift zur Papierfarbe */
.login .btn.user { transition: background-color .44s ease-out, color .44s ease-out, border-color .44s ease-out; }
.login .btn.user .pill { transition: background-color .44s ease-out, color .44s ease-out; }
.login .btn.user:hover, .login .btn.user:focus-visible { background: color-mix(in srgb, var(--ink) 86%, transparent); color: var(--paper); border-color: transparent; }
.login .btn.user:hover .pill, .login .btn.user:focus-visible .pill { background: color-mix(in srgb, var(--paper) 22%, transparent); color: var(--paper); }
.devwarn { font-size: max(var(--min-text), .78125rem); background: var(--part-soft); color: var(--part); padding: .375rem .625rem; border-radius: 8px; }
.note { font-size: max(var(--min-text), .8125rem); color: var(--muted); }

/* ---------- Grundgerüst */
.shell { height: 100dvh; display: grid; grid-template-columns: 1fr; position: relative; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; height: 100dvh; }
.sidebar { background: var(--side-bg); color: var(--side-ink); --ink: var(--side-ink); --muted: var(--side-muted); --ink-muted: var(--side-muted); --line: var(--side-line); --sheet-2: var(--side-hover); --enso-mode: solid; --enso-ink: var(--side-ink); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; height: 100dvh; }
.scrim { display: none; }
/* Handy: Liste als Startansicht, im Chat als ausklappbare Leiste */
@media (max-width: 899px) {
  .shell[data-view="list"] .main { display: none; }
  .shell[data-view="chat"] .sidebar, .shell[data-view="log"] .sidebar, .shell[data-view="settings"] .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 340px); z-index: 20; transform: translateX(-102%); transition: transform .22s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 40px rgb(0 0 0 / .2); }
  .shell.drawer-open .sidebar { transform: none !important; }
  .shell.drawer-open .scrim { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 15; }
  .shell[data-view="list"] .sidebar { padding-top: env(safe-area-inset-top); }
}
@media (min-width: 900px) {
  .shell { grid-template-columns: var(--side) minmax(0, 1fr); }
  .menu, .only-mobile { display: none !important; }
}
/* Einstellungen am Handy (Bug-Nachtrag B1): eine Spalte, volle Breite, große Tippziele, Tabellen scrollen in sich */
.settings .tablewrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
@media (max-width: 899px) {
  .only-desktop { display: none !important; }
  .log.settings { padding: .75rem .75rem calc(1.5rem + env(safe-area-inset-bottom)); gap: .75rem; }
  .settings .card { padding: .875rem; }
  .settings fieldset.pref { flex-direction: column; align-items: stretch; gap: .375rem; }
  .settings fieldset.pref legend { float: none; display: block; width: 100%; text-align: left; margin-bottom: .375rem; }
  .settings .seg2.light { display: grid; width: 100%; min-width: 0; }
  .settings .seg2.light button { min-height: 44px; font-size: .9375rem; text-align: left; }
  .settings .card .row { flex-direction: column; align-items: stretch; }
  .settings .card .btn { min-height: 44px; width: 100%; justify-content: flex-start; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Sidebar */
.side-head { display: flex; align-items: center; gap: .625rem; padding: calc(env(safe-area-inset-top) + 1rem) 1rem .75rem; }
.enso-logo { width: 30px; height: 30px; }
.side-actions { padding: .25rem .75rem .625rem; display: flex; flex-direction: column; gap: .625rem; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--side-hover); border-radius: 4px; padding: .1875rem; }
.seg2 button { border: 0; background: transparent; padding: .375rem .5rem; border-radius: 3px; font-size: .84375rem; color: var(--muted); }
.seg2 button[aria-pressed="true"] { background: var(--side-sel); color: var(--side-sel-ink); }
.side-list { flex: 1; overflow-y: auto; padding: .25rem .5rem .75rem; overscroll-behavior: contain; }
.side-group h3 { margin: .875rem .625rem .375rem; font: 600 max(var(--min-text), .6875rem)/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.side-group ul { list-style: none; margin: 0; padding: 0; }
.side-item { width: 100%; display: flex; align-items: center; gap: .625rem; text-align: left; border: 0; background: transparent; padding: .5625rem .625rem; border-radius: 4px; color: var(--side-ink); }
.side-item:hover { background: var(--sheet-2); }
.side-item[aria-current="true"] { background: var(--side-sel); color: var(--side-sel-ink); --muted: rgba(255,255,255,.72); }
.enso-mini { width: 22px; height: 22px; }
.si-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.si-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-prev { font-size: max(var(--min-text), .78125rem); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { min-width: 20px; height: 20px; padding: 0 .375rem; border-radius: 999px; background: var(--part); color: var(--count-ink); font: 600 max(var(--min-text), .71875rem)/1.25rem var(--f-mono); text-align: center; }
.side-foot { border-top: 1px solid var(--line); padding: .625rem .625rem calc(.625rem + env(safe-area-inset-bottom)) .875rem; display: flex; align-items: center; gap: .25rem; }
.me { flex: 1; display: flex; align-items: center; gap: .625rem; min-width: 0; }
.me-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--side-hover); color: var(--side-ink); font-weight: 600; flex: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.me-text b { font-weight: 500; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font: max(var(--min-text), .6875rem) var(--f-body); color: var(--muted); }
.empty { color: var(--muted); padding: 1.25rem .75rem; text-align: center; font-size: .90625rem; }

/* ---------- Knöpfe */
.btn { border: 1px solid var(--control-border); background: transparent; border-radius: 4px; min-height: 40px; padding: 0 1rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .375rem; font-size: .90625rem; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.primary { background: var(--action); border-color: var(--action); color: var(--on-action); }
.btn.primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.sidebar .btn.primary { background: var(--side-sel); border-color: var(--side-sel); color: var(--side-sel-ink); }
.btn.ok { background: var(--action); border-color: var(--action); color: var(--on-action); }
.btn.danger { color: var(--ext); border-color: var(--ext); background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { border: 0; background: transparent; width: 38px; height: 38px; border-radius: 4px; display: grid; place-items: center; color: var(--muted); flex: none; }
.iconbtn:hover { background: var(--sheet-2); color: var(--ink); }
.iconbtn.small { width: 28px; height: 28px; }
.linkbtn { border: 0; background: none; padding: 2px 0; font-size: max(var(--min-text), .78125rem); color: var(--muted); display: inline-flex; gap: .25rem; align-items: center; }
.linkbtn:hover { color: var(--blue-text); }
.linkbtn.danger:hover { color: var(--ext); }
.linkbtn.done, .copy.done { color: var(--ok); }
.pill { font: 600 max(var(--min-text), .6875rem)/1 var(--f-body); letter-spacing: .02em; padding: .25rem .5rem; border-radius: 4px; background: var(--sheet-2); color: var(--muted); white-space: nowrap; }
.pill.warn { background: var(--part-soft); color: var(--part); }
.pill.st-started { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--blue-text); }
.pill.st-done { background: var(--ok-soft); color: var(--ok); }
.pill.st-failed, .pill.st-cancelled { background: var(--ext-soft); color: var(--ext); }

/* ---------- Chat-Kopf */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chathead { display: flex; align-items: center; gap: .375rem; padding: calc(env(safe-area-inset-top) + .75rem) 1.25rem .75rem; background: var(--paper); border-bottom: 1px solid var(--line); min-height: 64px; }
.chathead .ttl { flex: 1; min-width: 0; }
.chathead h2 { margin: 0; font: 700 1.1875rem/1.25 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chathead .st { font: max(var(--min-text), .78125rem)/1.4 var(--f-body); color: var(--muted); display: flex; align-items: center; gap: .375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
.dot.running { background: var(--customer-green); } .dot.busy { background: var(--blue); } .dot.starting { background: var(--part); } .dot.failed { background: var(--ext); }
.offline { background: var(--part-soft); color: var(--part); font-size: max(var(--min-text), .8125rem); padding: .25rem .75rem; text-align: center; }

/* ---------- Verlauf */
.tlwrap { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.timeline { flex: 1; overflow-y: auto; padding: 18px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.timeline > * { max-width: 780px; width: 100%; margin-inline: auto; flex-shrink: 0; } /* nie zusammenquetschen */
.jump { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); border: 0; background: var(--action); color: var(--on-action); border-radius: 4px; padding: .4375rem .875rem; font-size: .84375rem; font-weight: 600; }
.jump[hidden] { display: none; }
.hero { margin: auto; display: flex; flex-direction: column; align-items: center; gap: .625rem; text-align: center; padding: 1.5rem 1rem; max-width: 520px; }
.hero h1 { margin: .375rem 0 0; font: 700 clamp(1.625rem, 5vw, 2.25rem)/1.15 var(--f-body); letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--muted); }
.hero.small .enso-hero { width: 120px; height: 120px; }
.enso-hero { width: 150px; height: 150px; }

.msg { display: flex; flex-direction: column; gap: .1875rem; }
.msg .who { font-size: max(var(--min-text), .75rem); color: var(--muted); padding: 0 .25rem; display: flex; gap: .375rem; align-items: center; flex-wrap: wrap; }
.av-static { width: 14px; height: 14px; border-radius: 50%; border: 2px dotted var(--muted); opacity: .7; }
.enso-av { width: 28px; height: 28px; }
.bubble { padding: .625rem .875rem; border-radius: var(--r); max-width: min(90%, 680px); overflow-wrap: anywhere; }
.msg.user { align-items: flex-end; }
.msg.user .bubble { background: var(--me); color: var(--me-ink); border-radius: 8px 8px 2px 8px; }
.msg.user .bubble .md a { color: inherit; }
.msg.agent .bubble { background: var(--agent); border: 1px solid var(--line); border-radius: 8px 8px 8px 2px; }
.msg.agent.stopped .bubble { border-color: var(--part); }
.msg.agent.live .who { font-family: var(--f-body); font-size: max(var(--min-text), .75rem); }
.msg.draft .bubble { border-style: dashed; }
.msg.system { align-items: center; }
.msg.system .bubble { color: var(--muted); font: max(var(--min-text), .75rem) var(--f-body); padding: 2px .5rem; }
.msg-actions { padding: 0 .25rem; opacity: .75; }
.msg:hover .msg-actions { opacity: 1; }
.msg.queued .bubble { opacity: .75; border: 1px dashed var(--me-ink); }
.qbadge { font: 600 max(var(--min-text), .6875rem) var(--f-body); background: var(--part-soft); color: var(--part); padding: 2px .5rem; border-radius: 4px; }
.qactions { display: flex; gap: .875rem; padding: 0 .25rem; }
.qedit { width: min(90%, 680px); display: flex; flex-direction: column; gap: .375rem; }
.qedit textarea { width: 100%; border: 1px solid var(--blue-text); border-radius: 4px; padding: .5rem .625rem; background: var(--sheet); resize: vertical; }
.qedit .row { display: flex; gap: .5rem; justify-content: flex-end; }

details.thinking { border-left: 1.5px solid var(--line); padding: 2px 0 2px 1rem; color: var(--muted); } /* gleiche Kante wie die Arbeitsspur */
details.thinking summary { cursor: pointer; font: max(var(--min-text), .75rem) var(--f-body); letter-spacing: .03em; list-style: none; display: inline-flex; gap: .375rem; align-items: baseline; padding: 2px 0; }
details.thinking summary::-webkit-details-marker { display: none; }
details.thinking summary::before { content: "›"; display: inline-block; width: .7em; text-align: center; transition: transform .2s ease-out; }
details.thinking[open] summary::before { transform: rotate(90deg); }
details.thinking summary:hover { color: var(--indigo); }
.think-body { max-width: 680px; }
.think-body { white-space: pre-wrap; font-size: .84375rem; margin-top: .375rem; max-height: 320px; overflow-y: auto; }

/* Markdown */
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: .45em 0; } .md h3, .md h4, .md h5, .md h6 { margin: .7em 0 .3em; font: 700 1.05em/1.3 var(--f-body); }
.md ul, .md ol { margin: .4em 0; padding-left: 1.35em; }
.md li.task { list-style: none; margin-left: -1.2em; display: flex; gap: .5rem; align-items: baseline; }
.md .box { width: 14px; height: 14px; border: 1.5px solid var(--muted); border-radius: 3px; display: inline-grid; place-items: center; font-size: max(var(--min-text), .625rem); flex: none; }
.md .box.on { background: var(--ok); border-color: var(--ok); color: var(--sheet); }
.md code { font-family: var(--f-mono); font-size: .88em; background: rgb(127 127 127 / .15); padding: .08em .35em; border-radius: 5px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: .9em 0; }
.md blockquote { margin: .5em 0; padding-left: .75rem; border-left: 3px solid var(--line); color: var(--muted); }
.md a { color: var(--blue-text); text-underline-offset: 2px; }
.codeblock { margin: .6em 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--paper); }
.codeblock figcaption { display: flex; justify-content: space-between; align-items: center; padding: .25rem .375rem .25rem .625rem; border-bottom: 1px solid var(--line-soft); font: max(var(--min-text), .6875rem) var(--f-mono); color: var(--muted); letter-spacing: .05em; }
.codeblock .copy { border: 0; background: none; font: max(var(--min-text), .71875rem) var(--f-mono); color: var(--muted); padding: .1875rem .375rem; border-radius: 6px; }
.codeblock .copy:hover { background: var(--sheet-2); color: var(--ink); }
.codeblock pre { margin: 0; padding: .625rem .75rem; overflow-x: auto; font-size: max(var(--min-text), .8125rem); line-height: 1.5; }
.codeblock pre code { background: none; padding: 0; font-size: inherit; }
.codeblock.open { border-style: dashed; }
.md .tablewrap { overflow-x: auto; margin: .6em 0; max-width: 100%; }
.md table { border-collapse: collapse; font-size: .93em; font-variant-numeric: tabular-nums; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: .3125rem .625rem; white-space: nowrap; text-align: left; }
.md th { font: 500 max(var(--min-text), .6875rem) var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.md .al-center { text-align: center; } .md .al-right { text-align: right; }

/* Dateien, Bilder */
.files { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .5rem; }
.file { display: inline-flex; align-items: center; gap: .375rem; border: 1px solid var(--line); border-radius: 4px; padding: .3125rem .5625rem; font-size: max(var(--min-text), .8125rem); text-decoration: none; color: var(--ink); background: var(--sheet); max-width: 100%; }
.file span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file small { color: var(--muted); font: max(var(--min-text), .6875rem) var(--f-body); }
.file.fremd { border-color: color-mix(in srgb, var(--ext) 60%, transparent); color: var(--ink); background: repeating-linear-gradient(135deg, var(--paper-raised) 0 6px, var(--ext-soft) 6px 9px); }
.file .x { border: 0; background: none; padding: 0; color: var(--muted); display: grid; }
.msg.user .bubble a.file { color: var(--ink); }
.thumbs { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .375rem; }
.thumb-btn { border: 0; padding: 0; background: none; border-radius: 10px; overflow: hidden; }
.thumb { display: block; width: 132px; height: 132px; object-fit: cover; transition: transform .2s; }
.thumb-btn:hover .thumb { transform: scale(1.03); }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 50; background: rgb(8 10 12 / .86); display: grid; place-items: center; animation: lbIn .18s ease-out; touch-action: none; }
.lb.closing { animation: lbOut .18s ease-in forwards; }
@keyframes lbIn { from { background: rgb(8 10 12 / 0); } } @keyframes lbOut { to { opacity: 0; } }
.lb-img { max-width: 94vw; max-height: 82vh; border-radius: 8px; box-shadow: 0 10px 40px rgb(0 0 0 / .4); user-select: none; -webkit-user-drag: none; }
.lb-bar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: .625rem; padding: calc(env(safe-area-inset-top) + .625rem) .875rem .625rem; color: #eef2f6; }
.lb-name { flex: 1; font: max(var(--min-text), .8125rem) var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-btn { border: 1px solid rgb(255 255 255 / .3); background: rgb(255 255 255 / .08); color: #fff; border-radius: 10px; padding: .4375rem .75rem; font-size: .875rem; text-decoration: none; }
.lb-close { width: 40px; padding: .4375rem 0; text-align: center; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); border: 0; width: 44px; height: 64px; border-radius: 10px; background: rgb(255 255 255 / .1); color: #fff; font-size: 1.875rem; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }

/* ---------- Arbeitsspur */
.trace { border-left: 1.5px solid var(--blue); padding-left: 1rem; opacity: .95; } /* gleiche Spalte wie die Antworten (Verlauf: max 780px, mittig) */
.trace .steps, .trace .step-detail { max-width: 680px; }
.trace:not(.open) { border-left-color: var(--line); } /* zu: wie die Gedanken; offen: Linie mit Punkten */
.trace-head { display: flex; align-items: baseline; gap: .5rem; border: 0; background: none; padding: 2px 0; text-align: left; width: 100%; color: var(--muted); }
.trace-caret { display: inline-block; width: .7em; text-align: center; font-size: max(var(--min-text), .75rem); transition: transform .2s ease-out; } /* wie bei den Gedanken */
.trace.open .trace-caret { transform: rotate(90deg); }
.trace-head { gap: .375rem; }
.trace-head:disabled { cursor: default; color: var(--muted); }
.trace-title { font: 600 max(var(--min-text), .6875rem) var(--f-body); letter-spacing: .1em; text-transform: uppercase; }
.trace-sum { font: max(var(--min-text), .75rem) var(--f-body); }
.trace-head:not(:disabled):hover .trace-sum { color: var(--indigo); }
.steps { list-style: none; margin: .25rem 0 2px; padding: 0; display: flex; flex-direction: column; gap: .375rem; }
.step { position: relative; }
.step-line { display: flex; align-items: baseline; gap: .5rem; border: 0; background: none; padding: 0; text-align: left; width: 100%; }
.step .node { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--blue); background: var(--paper); flex: none; margin-left: -1.34375rem; transform: translateY(1px); }
.step.ok .node { background: var(--blue); border-color: var(--blue); }
.step.running .node { border-color: var(--indigo); animation: pulse 1.2s ease-in-out infinite; }
.step.waiting .node { border-color: var(--part); background: var(--part-soft); }
.step.error .node, .step.cancelled .node { border-color: var(--ext); background: var(--ext-soft); }
@keyframes pulse { 50% { transform: translateY(1px) scale(1.35); } }
.step-label { font-size: .84375rem; flex: 1; }
.step-line small { font: max(var(--min-text), .6875rem) var(--f-body); color: var(--muted); }
.step-io { display: flex; flex-wrap: wrap; align-items: center; gap: .3125rem; margin: .25rem 0 2px; }
.step-io .arrow { color: var(--muted); font-size: max(var(--min-text), .75rem); }
.chip { font: max(var(--min-text), .75rem)/1.2 var(--f-body); border: 1px solid var(--line); background: var(--paper-raised); padding: .1875rem .4375rem; border-radius: 4px; display: inline-flex; gap: .375rem; align-items: baseline; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.fremd { border-color: color-mix(in srgb, var(--ext) 60%, transparent); color: var(--ext); background: repeating-linear-gradient(135deg, var(--paper-raised) 0 6px, var(--ext-soft) 6px 9px); }
.chip.val { border-color: var(--ok); background: var(--ok-soft); color: var(--ink); }
.chip.val small { color: var(--muted); }
.chip.unk { border-style: dashed; border-color: var(--part); background: var(--part-soft); }
.chip.err { border-color: var(--ext); background: var(--ext-soft); color: var(--ext); }
.step-detail { display: grid; grid-template-columns: auto 1fr; gap: .1875rem .625rem; margin: .375rem 0; font-size: max(var(--min-text), .78125rem); background: var(--sheet); border: 1px solid var(--line-soft); border-radius: 8px; padding: .5rem .625rem; }
.step-detail dt { font: max(var(--min-text), .65625rem) var(--f-body); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; }
.step-detail dd { margin: 0; overflow-wrap: anywhere; }
.step-detail code { font: max(var(--min-text), .71875rem) var(--f-mono); }

/* ---------- Karten */
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper-raised); padding: 1rem 1.125rem; display: flex; flex-direction: column; gap: .5rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.card .kicker { font: 600 max(var(--min-text), .6875rem) var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.card .kicker .iconbtn { margin-left: auto; }
.card h3 { margin: 0; font: 700 1.03125rem/1.3 var(--f-body); }
.card .sum { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .90625rem; max-height: 260px; overflow-y: auto; }
.card .pre { margin: 0; font: max(var(--min-text), .75rem) var(--f-mono); background: var(--paper); border-radius: 8px; padding: .5rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow-y: auto; }
.card .row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card input[type=text], .card textarea { width: 100%; border: 1px solid var(--control-border); border-radius: 4px; padding: .5625rem .6875rem; background: var(--paper-raised); resize: vertical; }
.card.approval { border-top: 3px solid var(--part); }
.card.approval.approved { border-top-color: var(--ok); } .card.approval.denied, .card.approval.cancelled { border-top-color: var(--ext); } .card.approval.merged { border-top-color: var(--line); opacity: .75; }
.stamp { position: absolute; right: 14px; top: 34px; font: 800 .875rem/1 var(--f-body); letter-spacing: .14em; padding: .375rem .625rem; border: 2.5px solid currentColor; border-radius: 6px; transform: rotate(-7deg); opacity: .85; pointer-events: none; }
.stamp.approved { color: var(--ok); } .stamp.denied, .stamp.cancelled { color: var(--ext); } .stamp.changes { color: var(--part); } .stamp.merged, .stamp.replaced { color: var(--muted); }
.stamp-in { animation: stamp .26s cubic-bezier(.2,1.4,.4,1); }
@keyframes stamp { from { transform: rotate(-7deg) scale(1.9); opacity: 0; } 70% { opacity: .95; } }
.card.task { border-left: 3px solid var(--indigo); }
.card.task.done { border-left-color: var(--ok); } .card.task.failed, .card.task.cancelled { border-left-color: var(--ext); }
.card .flag { background: var(--part-soft); color: var(--part); border-radius: 8px; padding: .375rem .625rem; font-size: .84375rem; }
.thumbs-rate { display: flex; gap: .375rem; }
.thumbs-rate button { border: 1px solid var(--control-border); background: transparent; border-radius: 4px; width: 42px; height: 36px; display: grid; place-items: center; color: var(--muted); transition: transform .12s; }
.thumbs-rate button:active { transform: scale(.92); }
.thumbs-rate button[aria-pressed="true"].up { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.thumbs-rate button[aria-pressed="true"].down { background: var(--ext-soft); color: var(--ext); border-color: var(--ext); }
details.corr summary { cursor: pointer; font-size: max(var(--min-text), .8125rem); color: var(--muted); list-style: none; display: inline-flex; gap: .375rem; align-items: center; }
details.corr summary::-webkit-details-marker { display: none; }
details.corr summary::before { content: "›"; display: inline-block; width: .7em; text-align: center; transition: transform .2s ease-out; }
details.corr[open] summary::before { transform: rotate(90deg); }
details.corr[open] { display: flex; flex-direction: column; gap: .375rem; }
.chatlink { color: var(--indigo); text-transform: none; letter-spacing: 0; }
.card.result { border-style: dashed; }
.card.result.bad { border-color: var(--part); }
.result-lines { margin: 0; padding-left: 1.1em; font-size: .875rem; display: flex; flex-direction: column; gap: .1875rem; }
.log { flex: 1; overflow-y: auto; padding: 1.125rem .875rem; display: flex; flex-direction: column; gap: .75rem; }
.log > * { max-width: 780px; width: 100%; margin-inline: auto; flex-shrink: 0; }

/* ---------- Eingabe */
.composer { background: var(--paper); padding: .375rem max(.75rem, env(safe-area-inset-right)) calc(.625rem + env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left)); }
.composer .inner { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: .375rem; position: relative; }
.composer .row { display: flex; align-items: flex-end; gap: 2px; background: var(--paper-raised); border: 1px solid var(--control-border); border-radius: 6px; padding: .25rem; }
.composer .row:focus-within { border-color: var(--blue-text); }
.composer textarea { flex: 1; resize: none; border: 0; background: transparent; padding: .5625rem .5rem; max-height: 40vh; min-height: 40px; line-height: 1.4; outline: none; }
.send { width: 40px; height: 40px; border-radius: 4px; border: 0; background: var(--action); color: var(--on-action); display: grid; place-items: center; flex: none; transition: background .15s, transform .1s; }
.send:active { transform: scale(.94); }
.send.stop { background: var(--ink); color: var(--paper); }
.send.stop svg.i { fill: currentColor; }
.pendingfiles { display: flex; flex-wrap: wrap; gap: .375rem; }
.hint { font-size: max(var(--min-text), .75rem); color: var(--muted); }
input[type=file] { display: none; }
.stopask { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .84375rem; background: var(--paper-raised); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .625rem; }
.stopask span { flex: 1 1 200px; }

/* Slash-Auswahl */
.palette { position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); max-height: min(46vh, 340px); overflow-y: auto; background: var(--paper-raised); border: 1px solid var(--control-border); border-radius: 6px; padding: .25rem; z-index: 5; }
.palette[hidden] { display: none; }
.pal-item { width: 100%; display: grid; grid-template-columns: auto auto 1fr; gap: 2px .625rem; align-items: baseline; text-align: left; border: 0; background: none; padding: .5rem .625rem; border-radius: 4px; }
.pal-item.on { background: var(--action); color: var(--on-action); --muted: color-mix(in srgb, var(--on-action) 75%, transparent); }
.pal-item.off { opacity: .5; }
.pal-name { font: 500 .875rem var(--f-mono); }
.pal-hint { font: max(var(--min-text), .75rem) var(--f-mono); color: var(--muted); }
.pal-desc { font-size: max(var(--min-text), .8125rem); color: var(--muted); grid-column: 3; text-align: right; }
@media (max-width: 560px) { .pal-desc { grid-column: 1 / -1; text-align: left; } }
.pal-empty { padding: .625rem; font-size: max(var(--min-text), .8125rem); color: var(--muted); }

/* ---------- Dialog, Toast */
dialog { border: 1px solid var(--line); border-radius: 6px; background: var(--paper-raised); color: var(--ink); padding: 1.375rem; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / .35); }
dialog h2 { margin: 0 0 .75rem; font: 700 1.25rem var(--f-body); }
dialog label { display: block; font-size: max(var(--min-text), .8125rem); color: var(--muted); margin: .75rem 0 .3125rem; }
dialog input[type=text] { width: 100%; border: 1px solid var(--control-border); border-radius: 4px; padding: .625rem .75rem; background: var(--paper-raised); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.seg button { border: 1px solid var(--control-border); border-radius: 4px; background: var(--paper); padding: .625rem; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.seg button small { color: var(--muted); font-size: max(var(--min-text), .78125rem); }
.seg button[aria-pressed="true"] { border-color: var(--action); background: var(--indigo-soft); outline: 1px solid var(--action); }
/* Sicherheitsprofil: .seg darf die Primärfarbe nicht mit dunkler Schrift auf heller Auswahl mischen. */
#sec-box button { color: var(--ink); border-color: var(--ink-muted); flex-direction: row; align-items: center; }
#sec-box button[aria-pressed="true"] { background: var(--action); color: var(--on-action); border-color: var(--action); }
#sec-box button[aria-pressed="true"]::before { content: "✓ "; }
#sec-box button[aria-pressed="true"]:hover { background: var(--action-hover); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.125rem; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .5rem .875rem; border-radius: 4px; font-size: .875rem; max-width: calc(100vw - 32px); z-index: 60; animation: toastIn .2s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 6px); } }

/* ---------- Kleines Ensō (C1): Original-Zeichen als Maske, statisch */
.ensomark { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border: 0; padding: 0; background: none; color: inherit; }
button.ensomark { cursor: pointer; border-radius: 50%; }
.em-ring { position: absolute; inset: 0; -webkit-mask: url("enso-mark.svg") center / contain no-repeat; mask: url("enso-mark.svg") center / contain no-repeat;
  background: linear-gradient(135deg, var(--enso-light), var(--enso-deep)); transition: opacity .3s; }
:root[data-theme="dark"] .em-ring, .sidebar .em-ring { background: var(--enso-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .em-ring { background: var(--enso-ink); } }
.em-glyph { position: relative; font-weight: 800; line-height: 1; font-size: .62em; color: var(--blue-text); }
.mood-freigabe .em-glyph { color: var(--part); }
.mood-frage .em-ring, .mood-freigabe .em-ring { opacity: .45; }
.em-14 { width: 14px; height: 14px; font-size: .875rem; } .em-20 { width: 20px; height: 20px; font-size: 1.25rem; } .em-22 { width: 22px; height: 22px; font-size: 1.375rem; }
.em-28 { width: 28px; height: 28px; font-size: 1.75rem; } .em-logo { width: 32px; height: 32px; font-size: 2rem; }
@media (prefers-reduced-motion: no-preference) {
  .mood-arbeitet .em-ring { animation: emSpin 7s linear infinite; }
  @keyframes emSpin { to { transform: rotate(360deg); } }
  .em-ack .em-ring { animation: emAck .5s ease-out, emSpin 7s linear infinite; }
  @keyframes emAck { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
  .em-listen.listening .em-ring { animation: emListen .7s ease-in-out; }
  @keyframes emListen { 50% { transform: scale(.88) rotate(-6deg); } }
}
.em-logo { transition: opacity .28s ease-out; }
.em-logo.landing { opacity: 0; transition: none; } /* sofort weg, beim Ankommen weich ein */
.em-listen { margin: 0 .25rem .625rem .375rem; align-self: flex-end; }

/* Übergang nach dem Laden: Enso fliegt ins Logo, Oberfläche blendet ein */
canvas.flying { z-index: 40; transition: opacity .28s ease-in; }
canvas.flying.gone { opacity: 0; }
.shell.app-enter { opacity: 0; }
.shell.app-enter.app-in { opacity: 1; transition: opacity .45s ease-out; }

/* ---------- Begrüßung (A3) */
.greeting { margin: auto; width: 100%; max-width: 720px; padding: 1.75rem 1rem; display: flex; flex-direction: column; gap: 1.125rem; }
.greeting.in-chat { padding-top: .5rem; }
.greet-head { display: flex; align-items: center; gap: 1.125rem; }
.greet-enso { border: 0; background: none; padding: 0; border-radius: 50%; flex: none; }
.greet-enso .enso-hero { width: 112px; height: 112px; }
.greeting h1 { margin: 0; font: 700 clamp(1.5rem, 4vw, 2rem)/1.15 var(--f-body); letter-spacing: -.01em; }
.greeting p { margin: .25rem 0 0; color: var(--muted); }
.suggest { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .625rem; }
.sg-card { text-align: left; border: 1px solid var(--line); background: var(--paper-raised); border-radius: 6px; padding: .875rem 1rem; display: flex; flex-direction: column; gap: .25rem; transition: border-color .2s, transform .15s; }
.sg-card:hover { border-color: var(--ink-muted); }
.sg-card:active { transform: scale(.99); }
.sg-card b { font-size: .96875rem; } .sg-card span { font-size: .84375rem; color: var(--muted); }
.promise { display: flex; flex-direction: column; gap: .625rem; }
.promise > p { margin: 0; font-size: .90625rem; color: var(--ink); }
.card.demo { max-width: 520px; }
@media (max-width: 560px) { .greet-head { flex-direction: column; text-align: center; } }

/* ---------- Fokus-Ansicht (C2, Variante B „Gesprächsachse“) */
.focus { position: fixed; inset: 0; z-index: 45; background: var(--paper);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 540px); grid-template-rows: minmax(0, 1fr); gap: 5vw; padding: 0 6vw; animation: lbIn .2s ease-out; }
.focus .enso-full { z-index: 0; }
.focus-left { display: grid; place-items: center; min-height: 0; position: relative; z-index: 1; }
.focus-stage { position: relative; width: min(72vh, 44vw); cursor: pointer; }
.focus-anchor { width: 100%; aspect-ratio: 1; }
.focus-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; padding-top: 4%; } /* optische Mitte des Rings liegt ~2 % tiefer */
.focus-state { font-size: clamp(1rem, 1.6vw, 1.3125rem); font-weight: 500; color: var(--ink); transition: transform .3s ease-out; text-align: center; }
.focus-center.shaped .focus-state { transform: translateY(min(26vh, 16vw)); } /* bei „?“/„!“ unter das Zeichen */
.focus-right { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 7vh 0 calc(3vh + env(safe-area-inset-bottom)); }
.focus-head { font-size: max(var(--min-text), .8125rem); color: var(--muted); display: flex; gap: .6em; padding: 0 2.75rem .75rem 0; border-bottom: 1px solid var(--line); flex: none; white-space: nowrap; overflow: hidden; }
.focus-head .sep { opacity: .5; }
/* Verlauf wie im Chat, nach oben weich ausgeblendet */
.focus-tl { flex: 1; min-height: 0; padding: 3rem .875rem .75rem 2px; scrollbar-gutter: stable; gap: .625rem; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 120px); mask-image: linear-gradient(to bottom, transparent 0, #000 120px); }
.focus-tl > * { max-width: none; }
.focus-tl > :first-child { margin-top: auto; }
.focus-tl .msg.agent .bubble, .focus-tl .msg.user .bubble { max-width: 92%; }
.focus-empty { color: var(--muted); }
.focus-hint { font-size: .84375rem; color: var(--muted); padding-left: .25rem; }
.focus-hint.err { color: var(--ext); }
.focus-voice { display: flex; align-items: center; gap: .625rem; padding: .5rem 0 .625rem; font-size: .84375rem; color: var(--muted); flex: none; }
.focus-voice[hidden] { display: none; }
.focus-voice .fv-label { flex: 1; }
.focus-voice .btn { min-height: 36px; }
.fv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.fv-dot.live { background: var(--ok); animation: fpulse 1.6s ease-in-out infinite; }
@keyframes fpulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 0%, transparent); } }
.caret { display: inline-block; width: .5em; height: 1em; vertical-align: -.12em; background: var(--blue); opacity: .7; margin-left: 2px; animation: caretBlink 1s steps(2) infinite; }
@keyframes caretBlink { 50% { opacity: 0; } }
.focus-composer { flex: none; }
.focus-composer .composer { background: transparent; padding: 0; }
.focus-composer .composer .inner { max-width: none; }
.qdot { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: var(--blue); opacity: .75; transition: transform .2s ease-out, opacity .2s; }
.qdot:hover, .qdot:focus-visible { transform: scale(1.4); opacity: 1; }
.ctx-preview { padding: .5rem .75rem; font-size: max(var(--min-text), .8125rem); color: var(--muted); max-width: 280px; border-bottom: 1px solid var(--line); margin-bottom: .25rem; white-space: pre-wrap; }
.focus-close { position: fixed; top: calc(env(safe-area-inset-top) + 12px); right: 12px; z-index: 2; }
@media (max-width: 900px) {
  .focus { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 0; padding: 0 1rem; }
  .focus-left { padding-top: calc(env(safe-area-inset-top) + 4vh); }
  .focus-stage { width: min(36vh, 74vw); }
  .focus-state { font-size: 1.0625rem; }
  .focus-center.shaped .focus-state { transform: translateY(min(13vh, 27vw)); }
  .focus-right { padding: 0 0 calc(.75rem + env(safe-area-inset-bottom)); }
  .focus-head { display: none; }
  .focus-tl { padding-top: 1.5rem; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 64px); mask-image: linear-gradient(to bottom, transparent 0, #000 64px); }
}
@media (prefers-reduced-motion: reduce) { .fv-dot.live, .caret { animation: none; } }

/* ---------- Einstellungen */
.settings .card { gap: .625rem; }
fieldset.pref { border: 0; padding: 0; margin: 0; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
fieldset.pref legend { float: left; width: 110px; font-size: .875rem; color: var(--muted); padding: 0; }
.seg2.light { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sheet-2); border-radius: 4px; padding: .1875rem; min-width: 220px; }
.seg2.light button { border: 0; background: transparent; padding: .375rem .75rem; border-radius: 3px; font-size: .875rem; color: var(--muted); }
.seg2.light button[aria-pressed="true"] { background: var(--action); color: var(--on-action); }
dialog.onboard { width: min(480px, calc(100vw - 32px)); }
dialog.onboard fieldset.pref { margin: .75rem 0; }
dl.keys { display: grid; grid-template-columns: auto 1fr; gap: .5rem .875rem; margin: .25rem 0 0; font-size: .875rem; }
dl.keys dt { margin: 0; } dl.keys dd { margin: 0; color: var(--muted); }
kbd { font: max(var(--min-text), .75rem) var(--f-mono); border: 1px solid var(--control-border); border-bottom-width: 2px; border-radius: 4px; padding: 1px .375rem; background: var(--paper-raised); }
.empty .note { margin-top: .25rem; }

/* Modell-Auswahl und Kontext-Füllstand im Chat-Kopf */
.model-sel { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 4px; padding: 0 .25rem; height: 22px; }
.model-sel:hover { border-color: var(--control-border); }
.ctx { display: inline-flex; align-items: center; gap: .375rem; margin-left: .375rem; }
.ctx-bar { width: 44px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; display: inline-block; }
.ctx-fill { display: block; height: 100%; width: 0; background: var(--blue); transition: width .4s ease-out; }
.ctx.warn .ctx-fill { background: var(--part); } .ctx.warn { color: var(--part); }
.chathead .st { flex-wrap: nowrap; }

/* ---------- Sprachmodus (C3) */
.voice { position: fixed; inset: 0; z-index: 46; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom)); }
.voice .enso-full { z-index: 0; }
.voice-stage { position: relative; z-index: 1; width: min(54vh, 82vw); }
.voice-anchor { width: 100%; aspect-ratio: 1; }
.voice-bottom { position: relative; z-index: 1; width: min(640px, 100%); display: flex; flex-direction: column; align-items: center; gap: .625rem; }
.voice-status { font-size: .9375rem; color: var(--ink); font-weight: 600; }
.voice-sub { min-height: 1.3em; font-size: .84375rem; color: var(--muted); text-align: center; }
.voice-transcript { width: 100%; max-height: 24vh; overflow-y: auto; display: flex; flex-direction: column; gap: .375rem; text-align: center; }
.voice-transcript p { margin: 0; font-size: 1.0625rem; line-height: 1.45; color: var(--ink); }
.voice-transcript .vt-du { color: var(--muted); }
.voice-close { position: fixed; top: calc(env(safe-area-inset-top) + 12px); right: 12px; z-index: 2; font-size: 1.125rem; }
.voice-mute[aria-pressed="true"] { border-color: var(--part); color: var(--part); }
.voice-approval { width: 100%; background: var(--paper-raised); border: 1px solid var(--line); border-top: 3px solid var(--part); border-radius: 6px; padding: 1rem 1.125rem; display: flex; flex-direction: column; gap: .5rem; }
.va-kicker { font: 600 max(var(--min-text), .6875rem) var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.va-title { font: 700 1.1875rem/1.3 var(--f-body); } .va-sum { white-space: pre-wrap; font-size: .9375rem; }
.va-row { display: grid; grid-template-columns: 1fr 1fr; gap: .625rem; margin-top: .25rem; } .va-row .btn { min-height: 52px; font-size: 1.0625rem; }
.composer .mic { align-self: flex-end; }

/* ---------- Archiv, Kontextmenü, Wischen */
.arch-toggle { width: 100%; display: flex; justify-content: space-between; border: 0; background: none; color: var(--muted); font: 600 max(var(--min-text), .6875rem)/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; padding: .875rem .625rem .375rem; }
.side-group.archive .side-item { opacity: .7; }
.side-group li { position: relative; }
.side-group li.swiped .side-item { transform: translateX(-148px); transition: transform .2s ease-out; }
.swipe-actions { position: absolute; right: 0; top: 0; bottom: 0; display: flex; gap: 2px; }
.swipe-actions button { border: 0; width: 72px; font-size: max(var(--min-text), .78125rem); font-weight: 600; color: #fff; }
.sw-arch { background: var(--side-sel); } .sw-del { background: var(--danger); border-radius: 0 4px 4px 0; }
.ctxmenu { position: fixed; z-index: 55; min-width: 210px; background: var(--paper-raised); border: 1px solid var(--control-border); border-radius: 6px; padding: .25rem; display: flex; flex-direction: column; }
.ctx-item { border: 0; background: none; text-align: left; padding: .5625rem .75rem; border-radius: 4px; font-size: .90625rem; color: var(--ink); }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--sheet-2); }
.ctx-item.danger { color: var(--danger); }

.audit-table { font-size: max(var(--min-text), .8125rem); } .audit-table td, .audit-table th { padding: .25rem .625rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.note.bad { color: var(--danger); }
.card .row a.btn { text-decoration: none; color: inherit; }

.chathead .st { overflow: hidden; } .ctx { flex: none; } .ctx-pct { font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .ctx-bar { width: 28px; } }

/* Gedanken und Arbeitsspur: 10px eingerückt, direkt aufeinanderfolgende ohne Abstand (eine Spur) */

/* =====================================================================
   Gesprächsstil B „Chat mit Rückgrat“ (Thread und Fokus): links eine durchgehende Spur mit Knoten für alles vom
   Agenten (Gedanken, Arbeitsspur, Antworten ohne Blase, Freigaben, Systemzeilen); deine Nachrichten bleiben rechte
   Blasen und hängen über eine Querlinie an der Spur; wartende gestrichelt. Ab deiner letzten Nachricht ist die
   Spur blau, solange gearbeitet wird.
   ===================================================================== */
.timeline { --rail: 4px; --ny: 10px; --gapy: 12px; --live: color-mix(in srgb, var(--blue) 55%, transparent); }
.timeline > :not(.greeting) { position: relative; padding-left: 26px; }
.timeline > :not(.greeting)::before { content: ""; position: absolute; left: var(--rail); top: 0; bottom: calc(-1 * var(--gapy)); width: 1px; background: var(--line); }
.timeline > :not(.greeting):first-child::before, .timeline > .greeting + *::before { top: var(--ny); }
.timeline > :not(.greeting):last-child::before { bottom: auto; height: var(--ny); }
.timeline > .act::before { background: var(--live); }
/* Knoten: ::after (Standard: kleiner grauer Punkt) */
.timeline > :not(.greeting)::after { content: ""; position: absolute; left: 0; top: calc(var(--ny) - 4.5px); width: 9px; height: 9px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--muted); background: var(--paper); }
/* Antworten: dunkler Punkt, Text ohne Blase */
.timeline > .msg.agent::after { background: var(--ink); border-color: var(--ink); }
.timeline > .msg.agent .who .ensomark { display: none; }
.timeline > .msg.agent .bubble { background: none; border: 0; padding: 2px 0 0; border-radius: 0; max-width: none; }
.timeline > .msg.agent.live::after { background: var(--blue); border-color: var(--blue); animation: railPulse 1.6s ease-in-out infinite; }
.timeline > .msg.agent.live .live-label { font-size: .84375rem; color: var(--ink); }
.timeline > .msg.agent .who, .timeline > .msg.agent .msg-actions { padding-left: 0; }
@keyframes railPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 45%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--blue) 0%, transparent); } }
/* Gedanken und Arbeitsspur: kleiner Knoten, keine eigene Linie mehr */
.timeline > details.thinking { border-left: 0; padding: 0 0 0 26px; --ny: 11px; }
.timeline > details.thinking::after, .timeline > .trace::after { width: 7px; height: 7px; left: 1px; top: calc(var(--ny) - 3.5px); background: var(--paper); }
.timeline > .trace { border-left: 0; padding-left: 26px; --ny: 11px; }
.timeline > .trace.open::after { background: var(--muted); border-color: var(--muted); }
.timeline > .trace.running::after { border-color: var(--blue); }
.timeline > .trace .step .node { position: absolute; left: -26px; margin-left: 0; top: 6px; }
.timeline > .trace .step.ok .node { width: 7px; height: 7px; left: -25px; top: 7px; background: var(--muted); border-color: var(--muted); }
.timeline > .trace .step.running .node { background: var(--blue); border-color: var(--blue); animation: railPulse 1.6s ease-in-out infinite; }
.timeline > :is(.trace, details.thinking) + :is(.trace, details.thinking) { margin-top: -6px; }
/* Karten (Freigabe, Aufgabe, Ergebnis) hängen an der Spur */
.timeline > .card { --ny: 18px; }
.timeline > .card { padding-left: 16px; width: calc(100% - 26px); max-width: 754px; translate: 13px 0; overflow: visible; } /* Spalte bleibt mittig, Karte 26 px eingerückt */
.timeline > .card::before { left: calc(var(--rail) - 26px); top: 0; }
.timeline > .card::after { left: -26px; }
.timeline > .card.approval.pending::after { background: var(--part); border-color: var(--part); }
.timeline > .card.task::after, .timeline > .card.result::after { width: 7px; height: 7px; left: -25px; top: calc(var(--ny) - 3.5px); background: var(--muted); border-color: var(--muted); }
/* Systemzeilen: winziger Punkt, links statt mittig */
.timeline > .msg.system { align-items: flex-start; --ny: 11px; }
.timeline > .msg.system .bubble { padding: 0; }
.timeline > .msg.system::after { width: 5px; height: 5px; left: 2px; top: calc(var(--ny) - 2.5px); border: 0; background: var(--muted); opacity: .6; }
/* Entscheidung über eine Freigabe: eigener Eintrag (wer, wann, was), Knoten in der Farbe der Entscheidung */
.msg.decision { font-size: .84375rem; gap: 2px; }
.msg.decision .dec { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; }
.msg.decision .dec strong { font-weight: 600; }
.msg.decision.approved .dec strong { color: var(--ok); } .msg.decision.denied .dec strong, .msg.decision.cancelled .dec strong { color: var(--ext); } .msg.decision.changes .dec strong { color: var(--part); }
.msg.decision .dec-title { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.msg.decision .dec-comment { margin-top: 2px; padding: 2px 0 2px .625rem; border-left: 2px solid var(--part); white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline > .msg.decision { --ny: 9px; }
.timeline > .msg.decision .who { padding-left: 0; }
.timeline > .msg.decision::after { width: 9px; height: 9px; }
.timeline > .msg.decision.approved::after { background: var(--ok); border-color: var(--ok); }
.timeline > .msg.decision:is(.denied, .cancelled)::after { background: var(--ext); border-color: var(--ext); }
.timeline > .msg.decision.changes::after { background: var(--part); border-color: var(--part); }
/* deine Nachricht: Knoten auf Höhe der Blase, Querlinie zur Blase */
.timeline > .msg.user { padding-left: 0; }
.timeline > .msg.user::after { display: none; }
.timeline > .msg.user .urow { position: relative; display: flex; align-items: center; width: 100%; }
.timeline > .msg.user .urow::before { content: ""; position: absolute; left: 0; top: 50%; margin-top: -4.5px; width: 9px; height: 9px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--me); background: var(--paper); z-index: 1; }
.timeline > .msg.user .urow .cn { flex: 1; min-width: 24px; height: 1px; background: var(--line); margin: 0 10px 0 9px; }
.timeline > .msg.user.act .urow::before { border-color: var(--blue); }
.timeline > .msg.user.act .urow .cn { background: var(--live); }
.timeline > .msg.user .bubble { max-width: 76%; flex: none; }
.timeline > .msg.user.queued .urow::before { border-style: dashed; border-color: var(--blue); }
.timeline > .msg.user.queued .urow .cn { background: none; border-top: 1px dashed var(--control-border); height: 0; }
.timeline > .msg.user.queued .bubble { background: transparent; color: var(--muted); border: 1px dashed var(--control-border); }
.timeline > .msg.user.queued::before { background: none; border-left: 1px dashed var(--control-border); width: 0; }
.focus-tl > .msg.user .bubble { max-width: 84%; }
@media (max-width: 560px) { .timeline > .msg.user .bubble { max-width: 84%; } }
@media (prefers-reduced-motion: reduce) { .timeline > .msg.agent.live::after, .timeline > .trace .step.running .node { animation: none; } }

/* Vorlesen im Sprachmodus: noch nicht gesprochen leicht transparent, gesprochen ganz normal (David) */
::highlight(tts-unread) { color: color-mix(in srgb, var(--ink) 38%, transparent); }

/* Version und Neuigkeiten */
.me-text small .ver { color: inherit; text-decoration: none; }
.me-text small .ver:hover { text-decoration: underline; }
.whatsnew { display: flex; align-items: center; gap: .75rem; padding: .5rem .875rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--blue) 8%, var(--paper)); font-size: .84375rem; }
.whatsnew > span { flex: 1; min-width: 0; }
.card.news details.release { border-top: 1px solid var(--line-soft, var(--line)); padding: .5rem 0 .25rem; }
.card.news details.release summary { cursor: pointer; font-size: .875rem; list-style: none; }
.card.news details.release summary::-webkit-details-marker { display: none; }
.card.news h4 { font: 600 max(var(--min-text), .6875rem) var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: .625rem 0 .25rem; }
.card.news ul { margin: 0; padding-left: 1.1em; font-size: .875rem; display: flex; flex-direction: column; gap: .25rem; }

/* Fokus schließen: Ansicht wird durchsichtig, nur der Partikelstrom fliegt zurück ins Logo */
.focus { transition: background-color .3s ease-out; }
.focus.closing { background: transparent; pointer-events: none; }
.focus.closing > :not(canvas) { opacity: 0; transition: opacity .2s ease-out; }
/* Status erst einblenden, wenn der Strom aus dem Logo in der Bühne angekommen ist */
.focus-center { animation: focusCenterIn .35s ease-out .75s both; }
@keyframes focusCenterIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .focus-center { animation: none; } }

/* Statustext im Enso: weich aus- und einblenden */
.focus-state { transition: opacity .32s ease-in-out, transform .3s ease-out; }
.focus-state.fade-out { opacity: 0; }
/* Bug B2: eigener Stop-Knopf, solange ein Lauf aktiv ist */
.composer .stopbtn { width: 40px; height: 40px; border-radius: 4px; background: var(--ink); color: var(--paper); margin-right: .25rem; }
.composer .stopbtn svg.i { fill: currentColor; }
.composer .stopbtn:hover { background: color-mix(in srgb, var(--ink) 85%, var(--paper)); color: var(--paper); }
/* Enso-Modus: kein kleines Enso in der Eingabe (das große Enso ist schon da) */
.focus-composer .em-listen { display: none; }

/* Übergang nach dem Laden/Login: Schleier blendet aus, während die Punkte ins Logo strömen */
.app-veil { position: fixed; inset: 0; z-index: 39; background: var(--paper); opacity: 1; pointer-events: none; }
.app-veil.out { opacity: 0; transition: opacity 1.1s cubic-bezier(.4, 0, .2, 1); }

/* Freigabe-Karte: was ausgeführt wird, vollständig (LIEFERUNG-7) */
.apr-fields { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .75rem; margin: .25rem 0 2px; font-size: .875rem; }
.apr-fields dt { color: var(--muted); font-size: max(var(--min-text), .78125rem); padding-top: 1px; }
.apr-fields dd { margin: 0; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.apr-fields dd.crit { font-weight: 600; }
.apr-long summary { cursor: pointer; list-style: none; }
.apr-long summary::-webkit-details-marker { display: none; }
.apr-long .apr-prev { white-space: pre-wrap; display: block; }
.apr-long .apr-cut { display: inline-block; margin-top: .25rem; font-size: max(var(--min-text), .75rem); color: var(--accent); border: 1px solid currentColor; border-radius: 3px; padding: 0 .375rem; }
.apr-long[open] .apr-prev { display: none; }
.apr-long .apr-full { white-space: pre-wrap; max-height: 50vh; overflow: auto; }
@media (max-width: 560px) { .apr-fields { grid-template-columns: 1fr; } .apr-fields dt { padding-top: .375rem; } }
.link-host { color: var(--muted); font-size: .88em; }
/* Quellen einer Antwort (LIEFERUNG-8) */
.msg .sources { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin-top: .25rem; font-size: max(var(--min-text), .78125rem); }
.msg .sources .src-k { color: var(--muted); font-size: max(var(--min-text), .6875rem); letter-spacing: .08em; text-transform: uppercase; margin-right: 2px; }
.msg .sources .src { color: var(--accent); text-decoration: none; border: 1px solid var(--line); border-radius: 4px; padding: 1px .4375rem; background: var(--paper-raised); }
.msg .sources .src:hover { text-decoration: underline; }
/* Link-Bestätigung (LIEFERUNG-9) */
.link-host { overflow-wrap: anywhere; }
.link-confirm { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--ink) 35%, transparent); display: grid; place-items: center; padding: 1rem; }
.link-confirm .lc-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--r); padding: 1.125rem; max-width: 560px; width: 100%; display: flex; flex-direction: column; gap: .625rem; }
.link-confirm .lc-url { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font: max(var(--min-text), .8125rem) var(--f-mono); background: var(--sheet-2); padding: .5rem; border-radius: 4px; max-height: 30vh; overflow: auto; }

/* LIEFERUNG-16: Texteingabe am Handy. Textfeld in voller Breite oben, Knöpfe in einer eigenen Zeile darunter
   (links Anhang, Kamera, Ensō; rechts Mikrofon, Stopp, Senden), Trefferflächen 44 px. Desktop unverändert. */
@media (pointer: coarse) and (max-width: 760px) {
  .composer .row { flex-wrap: wrap; align-items: center; gap: 0 2px; padding: 2px .25rem .25rem; }
  .composer .row > textarea { order: -1; flex: 1 0 100%; width: 100%; min-height: 44px; max-height: 50dvh; padding: .6875rem .5rem .375rem; text-align: left; }
  .composer .row > label.iconbtn[for$="-file"] { order: 1; }
  .composer .row > label.iconbtn[for$="-cam"] { order: 2; }
  .composer .row > .em-listen { order: 3; margin: 0 .375rem; align-self: center; }
  .composer .row > .mic { order: 4; margin-left: auto; align-self: center; }
  .composer .row > .stopbtn { order: 5; margin-right: 2px; }
  .composer .row > .send { order: 6; }
  .composer .row > .iconbtn, .composer .row > .send, .composer .row > .stopbtn { width: 44px; height: 44px; }
  .focus-composer .composer .row > .em-listen { display: none; }
  dialog.ask textarea { min-height: 88px; max-height: 50dvh; field-sizing: content; resize: none; }
  /* offene Tastatur: Versionshinweis weg, Chat-Kopf kompakt, Agent-fragen-Dialog direkt über der Tastatur */
  html.kbd .whatsnew { display: none; }
  html.kbd .chathead { min-height: 0; padding-top: calc(env(safe-area-inset-top) + .25rem); padding-bottom: .25rem; }
  html.kbd .chathead h2 { font-size: 1rem; }
  html.kbd .chathead .st { font-size: max(var(--min-text), .75rem); }
  html.kbd dialog.ask[open] { margin: auto auto .375rem; max-height: calc(100dvh - 12px); overflow-y: auto; }
}

/* LIEFERUNG-16a: Menüs und Dialoge passen in jede Höhe und scrollen in sich, ohne den Hintergrund mitzunehmen */
.ctxmenu { max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }
dialog[open] { max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }

/* Claude-Anmeldung (LIEFERUNG-18) */
.cauth { display: flex; flex-direction: column; gap: .625rem; }
.cauth-status { display: flex; align-items: center; gap: .5rem; font-weight: 600; overflow-wrap: anywhere; }
.cauth-status .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.cauth-status.ok .dot { background: var(--ok); } .cauth-status.logged_out .dot { background: var(--ext); }
.note.warn { color: var(--ext); }
.cauth-code input { flex: 1 1 220px; min-width: 0; min-height: 40px; padding: .5rem .625rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-raised); color: var(--ink); font: inherit; }
.msg.system.login-notice .bubble { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; text-align: left; border: 1px solid var(--ext); border-radius: 10px; padding: .75rem .875rem; background: var(--ext-soft); color: var(--ink); max-width: 560px; }
.msg.system.login-notice p { margin: 0; }
.cauth a.btn.primary, .cauth a.btn.primary:visited { color: var(--on-action); text-decoration: none; }

/* Bereich Agenten (LIEFERUNG-19) */
.ag-box, .ag-form { display: flex; flex-direction: column; gap: .625rem; min-width: 0; }
.ag-box p, #cauth-card > p { margin: 0; }
.ag-h { margin: .5rem 0 0; font: 600 max(var(--min-text), .6875rem) var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ag-field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.ag-field label { font-size: .84375rem; font-weight: 600; }
.ag-box select { width: 100%; max-width: 320px; min-height: 40px; padding: .5rem .625rem; border: 1px solid var(--control-border); border-radius: 4px; background: var(--paper-raised); color: var(--ink); font: inherit; }
.ag-src { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .625rem; min-width: 0; }
.ag-src .note { overflow-wrap: anywhere; min-width: 0; }
.ag-tag { font-size: max(var(--min-text), .75rem); padding: 1px .4375rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.ag-tag.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.ag-probe { display: flex; flex-direction: column; gap: .375rem; }
.ag-probe .note { overflow-wrap: anywhere; }
.ag-file { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .25rem .875rem; margin: 0; font-size: max(var(--min-text), .8125rem); }
.ag-file dt { font-family: var(--f-mono); color: var(--muted); }
.ag-file dd { margin: 0; overflow-wrap: anywhere; font-family: var(--f-mono); }
@media (max-width: 760px) {
  .ag-box input[type=text], .ag-box select { font-size: 1rem; min-height: 44px; max-width: none; }
  .ag-file { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ag-file dd { margin-bottom: .5rem; }
}
