@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2"); }
:root {
  --bg: #f7f7f8; --surface: #ffffff; --surface2: #f0f0f2; --hover: #ebebee; --line: #e6e6ea;
  --fg: #16171a; --muted: #71737a; --faint: #a3a5ac;
  --accent: #5b5bd6; --accent-fg: #fff; --accent-soft: #ededfc;
  --rec: #e5484d; --ok: #30a46c; --warn: #d97706;
  --bubble: #ffffff; --bubble-fg: var(--fg); --chatbg: #f3f3f5;
  --shadow: 0 1px 2px rgba(16,17,20,.04), 0 4px 16px rgba(16,17,20,.05);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1012; --surface: #17181b; --surface2: #1f2024; --hover: #26272c; --line: #26272b;
    --fg: #ececee; --muted: #8e9099; --faint: #5d5f66;
    --accent: #8b8cf6; --accent-fg: #0f1012; --accent-soft: #23243d;
    --rec: #f2555a; --ok: #4cc38a; --warn: #f1a10d;
    --bubble: #1d1e22; --chatbg: #121315;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15.5px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.err { color: var(--rec); font-size: 14px; min-height: 1em; margin: 0; }

/* Icons */
.i { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i.sm { width: 15px; height: 15px; }
.i.xs { width: 13px; height: 13px; stroke-width: 2; }

/* Buttons */
button { font: inherit; color: inherit; background: var(--surface2); border: 0; border-radius: 12px; padding: 9px 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, color .15s, transform .1s, opacity .15s; }
button:hover { background: var(--hover); }
button:active { transform: scale(.96); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-fg); font-weight: 600; padding: 9px 16px 9px 18px; }
button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.primary .i { stroke-width: 2.2; width: 18px; height: 18px; }
button.round { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
button.icon { background: transparent; color: var(--muted); width: 40px; height: 40px; padding: 0; border-radius: 12px; }
button.icon:hover { background: var(--surface2); color: var(--fg); }
button.soft { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); font-weight: 500; font-size: 14px; padding: 8px 14px; }
button.soft .i { width: 18px; height: 18px; color: var(--muted); }
button.glass { background: rgba(255,255,255,.14); color: #fff; width: 48px; height: 48px; border-radius: 50%; padding: 0; backdrop-filter: blur(10px); }
button.glass:hover { background: rgba(255,255,255,.24); }
button.recording { background: var(--rec) !important; color: #fff !important; width: auto !important; padding: 0 14px 0 12px !important; border-radius: 99px !important; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
button.recording .ico { animation: pulse 1.2s infinite; display: inline-flex; }
@keyframes pulse { 50% { opacity: .35; } }
.lbl:empty { display: none; }
.ico { display: inline-flex; }

/* Logo */
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #a26ef5); display: flex; align-items: center; justify-content: center; color: #fff; }
.logo .i { width: 18px; height: 18px; stroke-width: 2.6; }
.logo.lg { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 6px; }
.logo.lg .i { width: 30px; height: 30px; }

/* Main screen */
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 64px; padding-top: max(16px, env(safe-area-inset-top)); }
.appHead { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 13px; color: var(--muted); margin: 32px 4px 10px; font-weight: 600; letter-spacing: 0; }

.composer { background: var(--surface); border-radius: 20px; padding: 16px 16px 10px; box-shadow: var(--shadow); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within, .composer.dragging { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft); }
.editor { width: 100%; min-height: 120px; max-height: 50vh; overflow-y: auto; outline: 0; color: var(--fg); font-size: 16.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.editor:empty::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; }
.editor img { display: none; }
.toolbar { display: flex; gap: 2px; align-items: center; padding-top: 8px; margin: 0 -6px; }
.toolbar .spacer { flex: 1; }

.attachments { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.attachments:empty { display: none; }
.att { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--surface2); display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); text-align: center; padding: 4px; }
.att img, .att video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.att .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px); }
.att .x .i { width: 13px; height: 13px; stroke-width: 2.4; }
.att .kind { position: absolute; left: 6px; bottom: 6px; color: #fff; display: flex; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.att.wide { width: auto; min-width: 76px; padding: 6px 34px 6px 8px; }
.att audio { height: 36px; }

/* Feed */
.feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.feed > .sub { color: var(--muted); text-align: center; padding: 28px 0; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; transition: border-color .15s, transform .15s; }
.item.clickable { cursor: pointer; }
.item.clickable:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.item.pending { border-style: dashed; }
.item .top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.item .title { font-weight: 600; overflow-wrap: anywhere; letter-spacing: -.005em; }
.item .sub { color: var(--muted); font-size: 14px; margin-top: 3px; overflow-wrap: anywhere; }
.item .sub:empty { display: none; }
.item .sub .i { margin: -2px 4px 0 0; }
.item .thumbs { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.item .thumbs img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; }
.item .thumbs span { font-size: 13px; color: var(--muted); background: var(--surface2); border-radius: 8px; padding: 4px 9px; display: inline-flex; align-items: center; gap: 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.item .time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.item .actions { display: flex; gap: 6px; }
.item .actions button { font-size: 13px; padding: 5px 10px; border-radius: 9px; }

.status { font-size: 12px; font-weight: 500; padding: 2px 9px 2px 8px; border-radius: 99px; background: var(--surface2); color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.processing, .status.queued { color: var(--warn); }
.status.processing::before, .status.uploading::before { animation: pulse 1.2s infinite; }
.status.uploading { color: var(--accent); }
.status.done { color: var(--ok); }
.status.error, .status.failed { color: var(--rec); }

/* Login */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login form { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 320px; text-align: center; }
.login h1 { font-size: 24px; }
.login .muted { margin: -4px 0 14px; font-size: 14px; }
.login input, .login button { width: 100%; }
.login input { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); outline: 0; transition: border-color .15s, box-shadow .15s; }
.login input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.login button { padding: 12px; }

/* Camera */
.overlay { position: fixed; inset: 0; background: #000; z-index: 20; display: flex; flex-direction: column; }
.overlay video { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #000; }
.camBar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: center; padding: 24px 20px max(24px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.shoot { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 4px solid rgba(255,255,255,.35); background-clip: padding-box; padding: 0; }
.shoot:hover { background: #fff; }
.shoot.video { background: var(--rec); }
.shoot.rec { border-radius: 18px; transform: scale(.78); }
.camTimer { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: var(--rec); color: #fff; padding: 4px 14px; border-radius: 99px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Viewer (tree / notes) */
.panel { background: var(--bg); }
.panelHead { display: flex; align-items: center; gap: 6px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--surface); }
.panelHead span { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panelBody { flex: 1; overflow: auto; padding: 16px; max-width: 820px; width: 100%; margin: 0 auto; }
.tree { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.tree li { padding: 10px 12px; border-radius: 10px; cursor: pointer; overflow-wrap: anywhere; display: flex; align-items: center; gap: 12px; }
.tree li:hover { background: var(--surface2); }
.tree li .i { color: var(--muted); }
.tree li[data-dir="true"] .i { color: var(--accent); }
.md { line-height: 1.65; }
.md img, .md video { max-width: 100%; border-radius: 12px; }
.md pre { background: var(--surface2); padding: 12px; border-radius: 10px; overflow: auto; }
.md table { border-collapse: collapse; } .md td, .md th { border: 1px solid var(--line); padding: 6px 10px; }
.md .fm { color: var(--muted); font-size: 13px; background: var(--surface2); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; }

.drop { position: fixed; inset: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; pointer-events: none; padding: 24px; }
.drop > div { border: 2px dashed var(--accent); color: var(--accent); border-radius: 24px; padding: 40px 48px; font-size: 18px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--surface); }
.drop .i { width: 32px; height: 32px; }
.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 99px; z-index: 40; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100vw - 32px); text-align: center; animation: toastIn .2s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Archive ---------- */
body.noscroll { overflow: hidden; }
.archive { position: fixed; inset: 0; z-index: 15; display: flex; background: var(--bg); }
.chats { width: 340px; flex-shrink: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.chatsHead { display: flex; align-items: center; gap: 4px; padding: 8px; padding-top: max(8px, env(safe-area-inset-top)); }
.chatsHead b { flex: 1; font-size: 18px; font-weight: 700; letter-spacing: -.02em; padding-left: 2px; }
.search { margin: 2px 12px 10px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; background: var(--surface2); color: var(--muted); }
.search .i { width: 17px; height: 17px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: inherit; padding: 9px 0; }
.chatList { list-style: none; margin: 0; padding: 0 8px 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.chatList li { display: flex; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; align-items: center; }
.chatList li:hover { background: var(--surface2); }
.chatList li.on { background: var(--accent-soft); }
.chatList li.hint { color: var(--muted); font-size: 14px; cursor: default; display: block; text-align: center; padding: 20px 12px; }
.chatList li.hint:hover { background: none; }
.chatList .ci { flex: 1; min-width: 0; }
.chatList .r1, .chatList .r2 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chatList .r1 b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatList .r2 span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatList .r2 i { font-style: normal; color: var(--faint); }
.chatList .r2 em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface2); border-radius: 99px; padding: 1px 7px; }
.chatList li.on .r2 em { background: var(--surface); }
.chatList .time { font-size: 12px; color: var(--faint); white-space: nowrap; }
.avatar { width: 44px; height: 44px; border-radius: 14px; overflow: hidden; flex-shrink: 0; background: var(--surface2); }
.avatar img, .avatar span { width: 100%; height: 100%; object-fit: cover; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 17px; }
.avatar span { background: var(--accent); }
.avatar span .i { width: 22px; height: 22px; }
.chatHead .avatar { width: 36px; height: 36px; border-radius: 11px; }
.chatHead .avatar span { font-size: 15px; }

.pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--chatbg); }
.paneEmpty { margin: auto; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.paneEmpty .i { width: 40px; height: 40px; stroke-width: 1.25; color: var(--faint); }
.chatView { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chatHead { display: flex; align-items: center; gap: 10px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--surface); }
.chatHead .ct { flex: 1; min-width: 0; }
.chatHead .t1 { font-weight: 600; }
.chatHead .t2 { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatHead .back { display: none; }
.tabs { display: flex; gap: 4px; padding: 4px 12px 10px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border-radius: 99px; padding: 5px 14px; font-size: 13.5px; font-weight: 500; background: transparent; color: var(--muted); }
.tabs button:hover { background: var(--surface2); color: var(--fg); }
.tabs button.on { background: var(--fg); color: var(--bg); }

.msgs { flex: 1; overflow-y: auto; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 8px; }
.day { text-align: center; margin: 14px 0 4px; }
.day span { color: var(--muted); font-size: 12px; font-weight: 500; background: var(--surface); padding: 3px 12px; border-radius: 99px; border: 1px solid var(--line); }
.msg { display: flex; justify-content: flex-end; }
.msg.flash .bubble { animation: flash 1.8s; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } }
.bubble { background: var(--bubble); color: var(--bubble-fg); border: 1px solid var(--line); border-radius: 18px 18px 6px 18px; padding: 8px 10px 6px; max-width: min(560px, 88%); min-width: 130px; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.bubble .mt { font-size: 13px; font-weight: 600; color: var(--accent); margin: 0 2px 5px; }
.bubble .text { white-space: pre-wrap; padding: 0 2px; }
.bubble .imgs { display: grid; gap: 3px; border-radius: 12px; overflow: hidden; margin-bottom: 6px; }
.bubble .imgs.n2, .bubble .imgs.n4 { grid-template-columns: 1fr 1fr; }
.bubble .imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.bubble .imgs img { width: 100%; max-height: 360px; object-fit: cover; display: block; cursor: zoom-in; }
.bubble .imgs:not(.n1) img { aspect-ratio: 1; }
.bubble video { width: 100%; max-height: 380px; border-radius: 12px; background: #000; margin-bottom: 6px; display: block; }
.bubble audio { width: 100%; min-width: 240px; margin-bottom: 4px; }
.bubble .tr, .fileList .tr { font-size: 13px; color: var(--muted); margin: 0 2px 6px; white-space: pre-wrap; display: flex; gap: 6px; }
.bubble .tr .i { margin-top: 3px; }
.bubble .doc { display: flex; gap: 10px; align-items: center; background: var(--surface2); border-radius: 12px; padding: 9px 12px; margin-bottom: 6px; color: inherit; }
.bubble .doc > .i { width: 24px; height: 24px; color: var(--accent); }
.bubble .doc b { font-weight: 500; }
.bubble .doc small { display: block; color: var(--muted); font-size: 12px; }
.bubble .meta { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.bubble .meta .time { font-size: 11px; color: var(--faint); }
.chip { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 99px; background: var(--surface2); color: var(--muted); gap: 5px; }
.chip:hover { background: var(--hover); color: var(--fg); }
.none { margin: auto; color: var(--muted); }

.mediaGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; }
.mediaGrid img, .mediaGrid .vid { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; display: block; border-radius: 8px; overflow: hidden; }
.mediaGrid .vid { position: relative; background: #000; }
.mediaGrid .vid video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.mediaGrid .vid span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.mediaGrid .vid span .i { width: 36px; height: 36px; padding: 9px 7px 9px 11px; border-radius: 50%; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); }
.linkList, .fileList { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.linkList li, .fileList li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.linkList .fi, .fileList .fi { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.linkList .fi .i, .fileList .fi .i { width: 18px; height: 18px; }
.linkList div, .fileList div { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.linkList a, .fileList a { font-weight: 600; overflow-wrap: anywhere; }
.linkList span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.linkList small, .fileList small { font-size: 12px; color: var(--faint); }
.fileList audio { width: 100%; margin-top: 6px; }

.chatComposer { background: var(--surface); border-top: 1px solid var(--line); padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.chatComposer .row { display: flex; gap: 2px; align-items: flex-end; }
.chatComposer .editor { flex: 1; min-height: 40px; max-height: 160px; background: var(--surface2); border-radius: 20px; padding: 8px 16px; font-size: 15.5px; margin: 0 4px; }
.chatComposer .editor:empty::before { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatComposer button { flex-shrink: 0; }
.chatComposer .attachments { margin: 0 0 8px; }

.lightbox { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.92); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img, .lightbox video { max-width: 96vw; max-height: 94vh; object-fit: contain; border-radius: 6px; }
#viewer { z-index: 22; }

@media (max-width: 799px) {
  .chats { width: 100%; border-right: 0; }
  .pane { display: none; }
  .archive.inChat .chats { display: none; }
  .archive.inChat .pane { display: flex; }
  .chatHead .back { display: inline-flex; }
}
@media (max-width: 400px) {
  .toolbar button.icon { width: 38px; }
  .chatComposer button.icon { width: 34px; }
}

/* ---------- Ask ---------- */
.composer.ask { margin-top: 16px; }
.composer.ask .editor { min-height: 52px; font-size: 16px; }
button.primary.ask { background: var(--ok); border-color: var(--ok); color: #06210f; }
.answers { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.answer { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.answer .q { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.answer .q b { color: var(--fg); font-weight: 600; flex: 1; overflow-wrap: anywhere; }
.answer .q button { font-size: 12px; padding: 2px 8px; }
.answer .st { font-size: 13px; color: var(--muted); margin-top: 6px; }
.answer .st.live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; animation: pulse 1s infinite; }
.answer .md { margin-top: 6px; overflow-wrap: anywhere; }
.answer .md p { margin: 6px 0; }
.answer .md strong { background: color-mix(in srgb, var(--ok) 18%, transparent); padding: 0 4px; border-radius: 4px; cursor: copy; }
.answer .err { margin-top: 6px; }
.answer .foot { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.answer .foot .time { font-size: 12px; color: var(--muted); margin-left: auto; }
.answer .foot button { font-size: 12px; padding: 3px 10px; }
.answer .older { opacity: .85; }
.hit { margin: 8px 0; }
.hit img { max-width: 100%; max-height: 420px; border-radius: 10px; display: block; cursor: zoom-in; }
.hit video { max-width: 100%; max-height: 420px; border-radius: 10px; display: block; }
.hit audio { width: 100%; }
.hit a.card { display: flex; gap: 10px; align-items: center; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: inherit; text-decoration: none; }
.hit a.card span { font-size: 24px; }
.hit a.card b { overflow-wrap: anywhere; font-weight: 600; }
.hit a.card small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.hit iframe { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; background: #fff; }
.moreAsks { align-self: center; font-size: 13px; }
.answer .q svg.i { width: 14px; height: 14px; flex-shrink: 0; align-self: center; }

/* ---------- Two fields: Merken / Fragen ---------- */
.fieldHead { display: flex; align-items: center; margin: -4px 0 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 10px 3px 8px; border-radius: 99px; }
.tag .i { width: 14px; height: 14px; stroke-width: 2; }
.composer .editor { min-height: 110px; }
.composer.ask { --accent: var(--ask); --accent-soft: var(--ask-soft); border-color: var(--line); }
.composer.ask:focus-within { border-color: color-mix(in srgb, var(--ask) 45%, var(--line)); box-shadow: var(--shadow), 0 0 0 4px var(--ask-soft); }
.composer.ask .editor { min-height: 110px; font-size: 16.5px; }
button.primary.ask { background: var(--ask); color: #fff; }
:root { --ask: #12a594; --ask-soft: #e0f6f2; }
@media (prefers-color-scheme: dark) { :root { --ask: #2ebfa8; --ask-soft: #10302b; } button.primary.ask { color: #0f1012; } }
.answers { margin-top: 12px; }
.answer { box-shadow: var(--shadow); }
.answer .q span { display: inline-flex; gap: 4px; color: var(--muted); }
.answer .foot button.chip { font-size: 12px; padding: 3px 10px; }
.answer .md strong { background: color-mix(in srgb, var(--ask) 18%, transparent); }
.hit a.card span { display: flex; color: var(--accent); }
.hit a.card span .i { width: 22px; height: 22px; }

/* ---------- Answer actions, file cards, preview, share sheet ---------- */
.answer .foot { flex-wrap: wrap; }
.answer .foot .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.answer .foot .acts[hidden] { display: none; }
.answer .foot .chip { font-size: 12.5px; padding: 5px 11px; }
.answer .foot .del { width: 32px; height: 32px; margin-left: -4px; }
.hit { margin: 10px 0; }
.hit > img { cursor: zoom-in; margin-bottom: 6px; }
.hit > video, .hit > audio { margin-bottom: 6px; }
.hit .card { display: flex; align-items: center; gap: 2px; background: var(--surface2); border: 0; border-radius: 12px; padding: 4px 4px 4px 4px; }
.hit .card .cardMain { flex: 1; min-width: 0; justify-content: flex-start; background: transparent; padding: 6px 8px; gap: 10px; text-align: left; }
.hit .card .cardMain:active { transform: none; }
.hit .card .fi { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hit .card .fi .i { width: 18px; height: 18px; }
.hit .card .cn { min-width: 0; display: flex; flex-direction: column; }
.hit .card .cn b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit .card .cn small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit .card button.icon { width: 36px; height: 36px; }
.hit .card button.icon:hover { background: var(--hover); }
@media (max-width: 480px) { .hit .card button.icon[data-prev] { display: none; } }

#sov { z-index: 24; }
.sovFrame { flex: 1; width: 100%; border: 0; background: var(--bg); }

.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.4); backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .15s; }
.sheetCard { width: 100%; max-width: 420px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 14px 12px max(12px, env(safe-area-inset-bottom)); box-shadow: 0 -8px 40px rgba(0,0,0,.25); animation: slideUp .2s ease-out; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheetCard { border-radius: 22px; } }
.sheetTitle { font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; padding: 2px 12px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheetItems { display: flex; flex-direction: column; gap: 2px; }
.sheetItems button { justify-content: flex-start; background: transparent; padding: 10px 12px; gap: 14px; font-weight: 500; border-radius: 12px; }
.sheetItems button:hover { background: var(--surface2); }
.sheetItems .si { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.sheetItems .si .i { width: 19px; height: 19px; }
.sheetCancel { width: 100%; margin-top: 8px; padding: 12px; font-weight: 600; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
.answer .body .md { cursor: copy; white-space: normal; }
.answer .body .md > p:only-child, .answer .body .md > p:first-child:last-child { font-size: 17px; font-weight: 500; letter-spacing: -.005em; }
.answer .body .md.ctx { cursor: auto; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.45; }
.answer .body .md.ctx > .i { float: left; margin: 2px 6px 0 0; color: var(--faint); }
.answer .body .md.ctx p { margin: 0; font-size: 13px; font-weight: 400; }
.answer .body .md.ctx .hit { margin: 8px 0 0; }

/* Hinweis im Android-Browser: App installieren */
.apkBanner { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 6px 8px 10px; margin-bottom: 14px; box-shadow: var(--shadow); }
.apkBanner .fi { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.apkBanner .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.apkBanner .txt b { font-size: 14px; font-weight: 600; }
.apkBanner .txt small { font-size: 12px; color: var(--muted); }
.apkBanner .dl { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 11px; flex-shrink: 0; }
.apkBanner .dl .i { width: 17px; height: 17px; stroke-width: 2.2; }
.apkBanner button.icon { width: 32px; height: 32px; }
.apkBanner button.icon .i { width: 17px; height: 17px; }

/* ---------- Fokus: Merken oder Fragen füllt den Bildschirm ---------- */
.cBody { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .42s cubic-bezier(.2, .8, .2, 1), opacity .3s ease; }
.cInner { min-height: 0; overflow: hidden; margin: -6px; padding: 6px; }
.composer { transition: border-color .15s, box-shadow .15s, padding .42s cubic-bezier(.2, .8, .2, 1), opacity .3s ease; }
.fieldHead { transition: margin .42s cubic-bezier(.2, .8, .2, 1); }
.swap { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.swap .i { width: 15px; height: 15px; transform: rotate(-90deg); }
main[data-mode="ask"] #composer .cBody,
main[data-mode="mem"] #askBox .cBody,
main[data-mode="mem"] #answersWrap { grid-template-rows: 0fr; opacity: 0; }
main[data-mode="ask"] #composer, main[data-mode="mem"] #askBox { padding: 10px 14px; cursor: pointer; box-shadow: none; opacity: .85; }
main[data-mode="ask"] #composer .fieldHead, main[data-mode="mem"] #askBox .fieldHead { margin: 0; }
main[data-mode="ask"] #composer .swap, main[data-mode="mem"] #askBox .swap { opacity: 1; }
main[data-mode="ask"] #composer:hover, main[data-mode="mem"] #askBox:hover { opacity: 1; }
main[data-mode="mem"] .composer.ask { margin-top: 12px; }
main[data-mode] .composer:not(.ask) .editor, main[data-mode] .composer.ask .editor { min-height: 160px; }
@media (prefers-reduced-motion: reduce) {
  .cBody, .composer, .fieldHead, .swap { transition: none; }
}

/* ---------- Verlauf: seitlich wischbar ---------- */
.history { margin-top: 14px; }
.histHead { display: flex; align-items: center; gap: 8px; padding: 0 2px 6px 4px; }
.histHead .ht { font-size: 13px; font-weight: 600; color: var(--muted); }
.histHead .hp { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.histHead .spacer { flex: 1; }
.histHead button.icon { width: 32px; height: 32px; }
.histHead button.icon .i { width: 18px; height: 18px; }
.histHead button:disabled { opacity: .3; }
.i.flip { transform: scaleX(-1); }
.answers { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; margin-top: 0; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 2px 10px; }
.answers::-webkit-scrollbar { display: none; }
.answers > .answer { flex: 0 0 min(88%, 540px); scroll-snap-align: start; box-shadow: none; }
.answers { touch-action: pan-x pan-y; }
.answers > .answer:only-child { flex-basis: 100%; }
@media (pointer: coarse) { .histHead button.icon { display: none; } }

/* ---------- Folgefragen ---------- */
.answer .turns:empty { display: none; }
.answer .turn { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.answer .turn .q .i { color: var(--ask); }
.answer .follow { display: flex; align-items: flex-end; gap: 6px; margin-top: 12px; background: var(--surface2); border-radius: 20px; padding: 4px 4px 4px 14px; }
.answer .follow[hidden] { display: none; }
.answer .follow .fEd { flex: 1; min-height: 0; max-height: 140px; font-size: 15px; padding: 7px 0; }
.answer .follow .fSend { width: 34px; height: 34px; flex-shrink: 0; }
.answer .follow .fSend .i { width: 17px; height: 17px; }
.answer.live .follow { opacity: .5; pointer-events: none; }
