/* Mozog: jeden chat ako v Claude. Svetlá a tmavá téma podľa systému. */
:root {
  --bg: #faf9f5;
  --panel: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #f0eee6;
  --bubble: #f0eee6;
  --fg: #1f1e1d;
  --muted: #6b6963;
  --faint: #9a978f;
  --border: rgba(31, 30, 29, .12);
  --border-strong: rgba(31, 30, 29, .24);
  --hover: rgba(31, 30, 29, .06);
  --accent: #d97757;
  --accent-press: #c96846;
  --on-accent: #ffffff;
  --danger: #c4452f;
  --ok: #3b8a55;
  --rec: #e5484d;
  --scrim: rgba(20, 20, 19, .32);
  --shadow: 0 1px 2px rgba(31, 30, 29, .04), 0 6px 24px rgba(31, 30, 29, .06);
  --pop: 0 8px 30px rgba(31, 30, 29, .14);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --w: 768px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --panel: #1b1a19;
    --surface: #1f1e1d;
    --surface-2: #262624;
    --bubble: #2a2926;
    --fg: #ecebe7;
    --muted: #a3a19b;
    --faint: #7a7872;
    --border: rgba(236, 235, 231, .1);
    --border-strong: rgba(236, 235, 231, .2);
    --hover: rgba(236, 235, 231, .07);
    --danger: #ec7a64;
    --ok: #74c28c;
    --scrim: rgba(0, 0, 0, .5);
    --shadow: none;
    --pop: 0 10px 34px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  background: var(--bg); color: var(--fg);
  font: 16px/1.55 -apple-system, "SF Pro Text", Inter, system-ui, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button, label[role="button"] { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.muted { color: var(--muted); }
.grow { flex: 1; }

.ibtn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: 12px; color: var(--muted); transition: background .15s, color .15s;
}
.ibtn:hover { background: var(--hover); color: var(--fg); }
.ibtn:active { background: var(--hover); }

/* ---------- appka ---------- */
.app {
  position: fixed; left: 0; right: 0; top: 0; height: var(--app-h, 100dvh);
  display: flex; flex-direction: column;
}
.bar {
  flex: none; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left));
  position: relative; z-index: 2;
}
.bar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; pointer-events: none;
  background: linear-gradient(var(--bg), transparent);
}
.bar .title { text-align: center; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; position: relative; -webkit-overflow-scrolling: touch; }
.thread { max-width: var(--w); margin: 0 auto; padding: 12px 20px 28px; }

/* prázdny chat */
.welcome {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 24px 16px 64px; text-align: center; animation: fade .3s ease;
}
.welcome h1 { margin: 0; font-size: 27px; line-height: 1.25; font-weight: 500; letter-spacing: -.02em; }
.sugg { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sugg button {
  min-height: 40px; padding: 8px 15px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; color: var(--muted); transition: background .15s, color .15s, border-color .15s;
}
.sugg button:hover { background: var(--hover); color: var(--fg); border-color: var(--border-strong); }

/* správy */
.day { text-align: center; font-size: 12px; color: var(--faint); margin: 22px 0 4px; letter-spacing: .02em; }
.turn { padding: 6px 0 10px; scroll-margin-top: 16px; border-radius: 14px; }
.turn.flash { animation: flash 1.8s ease; }
.turn.new { animation: rise .2s ease; }
.user { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin: 6px 0 18px; }
.bubble {
  max-width: min(85%, 600px); background: var(--bubble); padding: 9px 16px; border-radius: 20px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.atts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 85%; }
.att-img { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.att-img img { display: block; width: 132px; height: 132px; object-fit: cover; }
.atts .att-img:only-child img { width: auto; height: auto; max-width: min(260px, 70vw); max-height: 260px; }
.att-file {
  display: flex; align-items: center; gap: 10px; max-width: 260px; padding: 8px 12px 8px 10px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--fg); text-decoration: none; font-size: 14px;
}
.att-file .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: var(--on-accent); }
.ficon .i { width: 18px; height: 18px; }

.bot { position: relative; }
.label {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 3px 11px 3px 9px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--muted);
}
.label .i { color: var(--accent); }
.status { display: flex; align-items: center; gap: 10px; min-height: 30px; color: var(--muted); font-size: 15px; }
.md + .status { margin-top: 2px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.2s ease-in-out infinite; }
.status .txt { animation: fade .2s ease; }
.note-line { color: var(--faint); font-size: 14px; margin-top: 4px; }
.errline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--danger); font-size: 15px; margin-top: 4px; }
.errline button { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; }
.tools { display: flex; margin: 2px 0 0 -12px; opacity: .85; }
.tools .ibtn { width: 40px; height: 40px; }
.tools .ibtn .i { width: 18px; height: 18px; }
.tools .ibtn.loading .i { animation: pulse 1s ease-in-out infinite; }
.tools .ibtn.on { color: var(--accent); }

/* markdown */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .8em; }
.md h2, .md h3, .md h4 { line-height: 1.3; letter-spacing: -.01em; margin: 1.3em 0 .5em; }
.md h2 { font-size: 1.22em; font-weight: 650; }
.md h3 { font-size: 1.08em; font-weight: 650; }
.md h4 { font-size: 1em; font-weight: 650; }
.md ul, .md ol { margin: 0 0 .8em; padding-left: 1.45em; }
.md li { margin: .3em 0; }
.md li > ul, .md li > ol { margin: .3em 0 0; }
.md li::marker { color: var(--faint); }
.md strong { font-weight: 650; }
.md a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.md code { font: .87em/1.4 var(--mono); background: var(--hover); padding: .12em .36em; border-radius: 5px; }
.md pre { margin: 0 0 .8em; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.55; }
.md blockquote { margin: 0 0 .8em; padding-left: 14px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.md .table { margin: 0 0 .8em; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.md table { border-collapse: collapse; min-width: 100%; font-size: 14.5px; line-height: 1.45; }
.md th, .md td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.md th { font-weight: 600; background: var(--hover); white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }

/* karty e-mailov */
.card { margin: 14px 0 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); position: relative; animation: rise .2s ease; }
.card-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.card-head .who { color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-subj { font-weight: 600; margin: 8px 0 4px; overflow-wrap: anywhere; }
.card-meta { font-size: 13px; color: var(--faint); margin-bottom: 4px; overflow-wrap: anywhere; }
.card-body { color: var(--muted); font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.card-edit input, .card-edit textarea, .when input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); font-size: 16px; line-height: 1.45; outline: 0;
}
.card-edit input:focus, .card-edit textarea:focus, .when input:focus { border-color: var(--accent); }
.card-edit textarea { min-height: 180px; resize: vertical; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.when { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.when input { flex: 1 1 200px; width: auto; }
.card-status { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.card-status.ok { color: var(--ok); }
.card-status.bad { color: var(--danger); }
.card.compact { padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.card.compact .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.compact .st { flex: none; }
.card.compact .st.ok { color: var(--ok); }
.card.compact .st.bad { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-weight: 500; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { background: var(--accent-press); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.more { position: relative; margin-left: auto; }
.more > summary { list-style: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { background: var(--hover); }
.menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; min-width: 250px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--pop); animation: fade .15s ease;
}
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 9px; text-align: left; font-size: 15px; }
.menu button:hover { background: var(--hover); }

/* ---------- zložka na písanie ---------- */
.dock { flex: none; padding: 4px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.dock-in { max-width: var(--w); margin: 0 auto; position: relative; }
.composer {
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  padding: 8px 8px 6px 16px; box-shadow: var(--shadow); transition: border-color .15s;
}
.composer:focus-within { border-color: var(--border-strong); }
.composer textarea {
  display: block; width: 100%; margin: 0; padding: 6px 6px 2px 0; border: 0; outline: 0; resize: none; background: transparent;
  font-size: 16px; line-height: 1.5; max-height: calc(1.5em * 6 + 8px); overflow-y: auto;
}
.composer textarea::placeholder { color: var(--faint); }
.composer .row { display: flex; align-items: center; margin: 0 0 0 -10px; }
.composer.recording > :not(.rec) { display: none !important; }
.send { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.send > span {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); transition: background .15s, transform .15s, opacity .15s;
}
.send:hover > span { background: var(--accent-press); }
.send:active > span { transform: scale(.94); }
.send:disabled > span { opacity: .4; }
.send .i { width: 18px; height: 18px; stroke-width: 2.2; }
.send.stop > span { background: var(--fg); color: var(--bg); }

.files { display: flex; gap: 10px; overflow-x: auto; padding: 8px 8px 8px 0; margin-bottom: 2px; }
.fchip { position: relative; flex: none; animation: rise .15s ease; }
.fchip .thumb { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.fchip .doc { display: flex; align-items: center; gap: 10px; height: 64px; max-width: 220px; padding: 0 14px 0 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.fchip .doc .nm { font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.fchip .doc .sz { font-size: 12px; color: var(--faint); }
.fchip .x {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--fg); color: var(--bg); box-shadow: 0 0 0 2px var(--surface);
}
.fchip .x::after { content: ""; position: absolute; inset: -11px; }
.fchip .x .i { width: 13px; height: 13px; stroke-width: 2.4; }
.fchip.uploading::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.fchip.uploading::before {
  content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
.fchip.error .thumb, .fchip.error .doc { border-color: var(--danger); opacity: .6; }

.rec { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: -2px -0px -2px -10px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); flex: none; animation: blink 1.2s ease-in-out infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--muted); min-width: 38px; }
.wave { flex: 1; min-width: 0; height: 32px; }
.rec-note { flex: 1; color: var(--muted); font-size: 15px; }
.rec.stt .rec-dot, .rec.stt .wave, .rec.stt .rec-time { display: none; }
.rec.stt .rec-note::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

.down {
  position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 3; width: 38px; height: 38px; margin-left: -19px;
  display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); box-shadow: var(--pop); animation: fade .15s ease;
}
.down .i { width: 18px; height: 18px; }

/* ---------- bočný panel ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 21; top: 0; bottom: 0; left: 0; width: min(320px, 86vw);
  display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--border);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left);
  transform: translateX(-102%); visibility: hidden;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .2s;
}
.drawer.open { transform: none; visibility: visible; transition: transform .2s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.drawer.dragging { transition: none; }
.drawer-head { flex: none; display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 6px 0 18px; font-weight: 600; font-size: 15px; }
.history { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; overscroll-behavior: contain; }
.hgroup { padding: 14px 10px 4px; font-size: 12px; font-weight: 500; color: var(--faint); letter-spacing: .02em; }
.hitem {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 0 10px; border-radius: 10px;
  text-align: left; font-size: 15px; transition: background .15s;
}
.hitem span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hitem:hover, .hitem:active { background: var(--hover); }
.hitem.brief { color: var(--muted); }
.hitem.brief .i { color: var(--accent); width: 16px; height: 16px; }
.hempty { padding: 14px 10px; color: var(--faint); font-size: 14px; }

.prefs { flex: none; border-top: 1px solid var(--border); padding: 6px 8px; }
.prefs > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px;
  border-radius: 10px; color: var(--muted); cursor: pointer; font-size: 15px;
}
.prefs > summary::-webkit-details-marker { display: none; }
.prefs > summary:hover { background: var(--hover); }
.prefs > summary span { flex: 1; }
.prefs .chev { width: 16px; height: 16px; transition: transform .2s; }
.prefs[open] .chev { transform: rotate(180deg); }
.prefs-body { max-height: 58vh; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 8px 10px 10px; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.pref.col { flex-direction: column; align-items: stretch; gap: 8px; }
.pref > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.note { font-size: 13px; color: var(--faint); line-height: 1.35; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 11px; background: var(--hover); }
.seg button { min-height: 36px; border-radius: 8px; font-size: 13px; color: var(--muted); transition: background .15s, color .15s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 99px;
  background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s ease; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.sources > summary { cursor: pointer; font-size: 15px; min-height: 36px; display: flex; align-items: center; color: var(--fg); }
.sources ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sources li { display: grid; grid-template-columns: 10px 1fr auto; gap: 2px 10px; align-items: baseline; font-size: 14px; }
.sources .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); align-self: center; }
.sources .dot.bad { background: var(--danger); }
.sources .ago { font-size: 12px; color: var(--faint); margin: 0; }
.sources .msg { grid-column: 2 / 4; font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- PIN ---------- */
.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: min(340px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; animation: fade .25s ease; }
.auth-logo { width: 64px; height: 64px; border-radius: 16px; }
.auth h1 { margin: 6px 0 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.auth p { margin: 0; }
#pin {
  width: 100%; height: 54px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  text-align: center; font-size: 22px; letter-spacing: .35em; outline: 0; transition: border-color .15s;
}
#pin:focus { border-color: var(--accent); }
#pin::placeholder { letter-spacing: .05em; font-size: 16px; color: var(--faint); }
.btn-wide { width: 100%; min-height: 50px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 16px; transition: opacity .15s, background .15s; }
.btn-wide:disabled { opacity: .45; }
.btn-wide.ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.auth-err { min-height: 1.4em; color: var(--danger); font-size: 15px; }
.shake { animation: shake .35s ease; }

/* ---------- ostatné ---------- */
.drop {
  position: fixed; inset: 12px; z-index: 40; display: grid; place-items: center; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: 22px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  font-size: 18px; font-weight: 500; animation: fade .15s ease;
}
.confirm { width: min(360px, calc(100vw - 32px)); padding: 22px 20px 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--fg); box-shadow: var(--pop); }
.confirm::backdrop { background: var(--scrim); }
.confirm h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.confirm p { margin: 0 0 18px; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.confirm-btns { display: flex; gap: 8px; justify-content: flex-end; }
.confirm-btns .btn { min-height: 44px; }
.toast {
  position: fixed; z-index: 50; left: 50%; top: calc(env(safe-area-inset-top) + 58px); transform: translate(-50%, -8px);
  max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 12px;
  background: var(--fg); color: var(--bg); font-size: 14px; line-height: 1.4; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse { 0%, 100% { transform: scale(.7); opacity: .45; } 50% { transform: scale(1); opacity: 1; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes flash { 0%, 35% { background: color-mix(in srgb, var(--accent) 14%, transparent); } 100% { background: transparent; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (max-width: 600px) {
  .thread { padding: 8px 16px 24px; }
  .welcome h1 { font-size: 24px; }
  .bubble { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.ic { display: inline-flex; align-items: center; flex: none; }
.hitem .ic { overflow: visible; }
