/* Kişisel Banka — "banka cüzdanı" görsel dili
   Kasa yeşili + pirinç; tutarlar ve AI işlem damgaları monospace (cüzdan satırı gibi) */

:root {
  --paper: #F6F7F5;
  --surface: #FFFFFF;
  --surface-2: #EEF1EE;
  --ink: #14211C;
  --ink-2: #4A5751;
  --muted: #7A867F;
  --line: #E1E6E2;
  --vault: #1F5C46;
  --vault-soft: #E3EFE9;
  --brass: #B8893B;
  --brass-soft: #F5ECDC;
  --in: #1F7A55;
  --out: #B4483B;
  --danger: #B4483B;
  --user-bubble: #1F5C46;
  --user-ink: #F4FAF7;
  --glass: rgba(246, 247, 245, 0.78);
  --shadow: 0 1px 2px rgba(20, 33, 28, 0.05), 0 6px 24px rgba(20, 33, 28, 0.06);

  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 22px;
  --tab-h: 58px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1412;
    --surface: #161E1B;
    --surface-2: #1D2723;
    --ink: #E8EEEA;
    --ink-2: #B5C1BA;
    --muted: #7F8C85;
    --line: #26322D;
    --vault: #5FB38F;
    --vault-soft: #17302A;
    --brass: #D4A957;
    --brass-soft: #2C2518;
    --in: #5FB38F;
    --out: #E07A6C;
    --danger: #E07A6C;
    --user-bubble: #23493B;
    --user-ink: #EAF5EF;
    --glass: rgba(14, 20, 18, 0.74);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --paper: #0E1412; --surface: #161E1B; --surface-2: #1D2723; --ink: #E8EEEA; --ink-2: #B5C1BA; --muted: #7F8C85;
  --line: #26322D; --vault: #5FB38F; --vault-soft: #17302A; --brass: #D4A957; --brass-soft: #2C2518; --in: #5FB38F;
  --out: #E07A6C; --danger: #E07A6C; --user-bubble: #23493B; --user-ink: #EAF5EF; --glass: rgba(14, 20, 18, 0.74);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); }
body {
  font: 16px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; font-size: 16px; }
a { color: var(--vault); }
:focus-visible { outline: 2px solid var(--vault); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

#app { height: var(--vvh, 100dvh); display: flex; flex-direction: column; }

/* ------------ açılış ------------ */
.boot { flex: 1; display: grid; place-items: center; }
.boot-mark { font: 750 44px var(--f-display); color: var(--vault); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ------------ giriş ------------ */
.login { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--sat) + 24px) 28px calc(var(--sab) + 24px); max-width: 420px; margin: 0 auto; width: 100%; }
.login h1 { font: 750 40px/1.02 var(--f-display); letter-spacing: -0.02em; margin: 0 0 6px; }
.login h1 span { color: var(--vault); }
.login p { color: var(--muted); margin: 0 0 32px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.field { width: 100%; padding: 15px 16px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); outline: none; }
.field:focus { border-color: var(--vault); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: var(--r-m); background: var(--vault); color: #fff; font-weight: 600; }
:root .btn { color: var(--paper); }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: var(--r-s); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }

/* ------------ kabuk ------------ */
.screen { flex: 1; min-height: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }
.topbar {
  padding: calc(var(--sat) + 6px) 10px 6px; display: flex; align-items: center; gap: 6px;
  background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line); position: relative; z-index: 5;
}
.topbar h2 { flex: 1; margin: 0; font: 650 17px/1.2 var(--f-display); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.topbar .lead { font: 750 28px/1.1 var(--f-display); letter-spacing: -0.02em; text-align: left; padding-left: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); flex: none; position: relative; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }
.badge { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--brass); color: #fff; font: 600 10px/16px var(--f-body); text-align: center; padding: 0 4px; }

.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pad { padding: 16px 16px calc(var(--tab-h) + var(--sab) + 24px); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tab-h) + var(--sab)); padding-bottom: var(--sab);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--glass); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--vault); }
body.chat-focus .tabbar { display: none; }

/* ------------ sohbet ------------ */
#s-chat { padding-bottom: 0; }
.chat-scroll { padding: 14px 14px 18px; }
.chat-empty { padding: 48px 12px 0; }
.chat-empty h3 { font: 750 30px/1.08 var(--f-display); letter-spacing: -0.02em; margin: 0 0 10px; }
.chat-empty p { color: var(--muted); margin: 0 0 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; text-align: left; }
.chip:active { background: var(--surface-2); }

.msg { margin: 0 0 14px; display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 20px 20px 6px 20px; background: var(--user-bubble); color: var(--user-ink); white-space: pre-wrap; word-wrap: break-word; }
.msg.user .att { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 6px; max-width: 86%; }
.att img { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; display: block; }
.att .file { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; max-width: 240px; }
.att .file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg time { font: 11px var(--f-mono); color: var(--muted); margin-top: 4px; }

.msg.ai .md { padding: 2px 2px; word-wrap: break-word; }
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { font-family: var(--f-display); font-weight: 650; line-height: 1.2; margin: 14px 0 8px; }
.md h1 { font-size: 21px; } .md h2 { font-size: 19px; } .md h3 { font-size: 17px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md code { font: 13.5px var(--f-mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--surface-2); padding: 10px 12px; border-radius: 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0 0 10px; padding: 2px 12px; border-left: 3px solid var(--brass); color: var(--ink-2); }
.md .tbl { overflow-x: auto; margin: 0 0 10px; border: 1px solid var(--line); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.md th { font-weight: 600; background: var(--surface-2); font-size: 13px; }
.md td.num, .md th.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md img { max-width: 100%; border-radius: 12px; }

/* İmza öğe: AI işlem damgaları (cüzdan satırı) */
.trail { margin: 0 0 10px; border-left: 2px dashed var(--line); padding-left: 10px; display: flex; flex-direction: column; gap: 2px; }
.stamp { display: block; width: 100%; text-align: left; border-radius: 8px; }
.stamp-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; text-align: left; font: 12.5px/1.35 var(--f-mono); color: var(--ink-2); letter-spacing: 0.01em; }
.stamp-row .ic { width: 18px; text-align: center; flex: none; font-family: var(--f-body); }
.stamp-row .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stamp-row .ms { color: var(--muted); font-size: 11px; flex: none; }
.stamp.run .tt::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--brass); animation: pulse 1s infinite; vertical-align: middle; }
.stamp.fail .stamp-row { color: var(--danger); }
.stamp.memo .stamp-row { color: var(--brass); }
.stamp.memo .stamp-row .tt { font-weight: 500; }
.stamp-detail { display: none; margin: 2px 0 8px 26px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font: 12px/1.5 var(--f-mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.stamp.open .stamp-detail { display: block; }
.stamp-detail b { color: var(--ink); font-weight: 500; }
.thinking { font: 12.5px var(--f-mono); color: var(--muted); padding: 4px 4px; display: flex; gap: 8px; align-items: center; }
.thinking .dots::after { content: "…"; animation: pulse 1s infinite; }
.ai-img { margin: 6px 0 10px; }
.ai-img img { max-width: 100%; border-radius: 14px; border: 1px solid var(--line); display: block; }
.ai-img figcaption { font: 11.5px var(--f-mono); color: var(--muted); margin-top: 4px; }
.msg-foot { display: flex; gap: 10px; margin-top: 6px; font: 11px var(--f-mono); color: var(--muted); align-items: center; }
.msg-foot button { color: var(--muted); font: inherit; }

.composer { padding: 8px 10px calc(8px + var(--sab)); background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); margin-bottom: calc(var(--tab-h) + var(--sab)); }
body.chat-focus .composer { margin-bottom: 0; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { flex: 1; resize: none; max-height: 160px; min-height: 42px; padding: 10px 14px; border-radius: 21px; border: 1px solid var(--line); background: var(--surface); outline: none; line-height: 1.35; }
.composer textarea:focus { border-color: var(--vault); }
.send { width: 42px; height: 42px; border-radius: 50%; background: var(--vault); color: var(--paper); display: grid; place-items: center; flex: none; }
.send svg { width: 20px; height: 20px; }
.send.stop { background: var(--ink); }
.send.rec { background: var(--danger); animation: pulse 1s infinite; }
.pending-att { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.pending-att .pa { position: relative; flex: none; }
.pending-att img { width: 60px; height: 60px; object-fit: cover; border-radius: 12px; display: block; }
.pending-att .pf { height: 60px; display: flex; align-items: center; padding: 0 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; max-width: 160px; overflow: hidden; }
.pending-att .x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 22px; text-align: center; }
.pending-att .up { position: absolute; inset: 0; border-radius: 12px; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; font: 11px var(--f-mono); }

/* ------------ çekmece / sayfa (sheet) ------------ */
.overlay { position: fixed; inset: 0; background: rgba(10, 16, 14, .35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 360px); z-index: 41; background: var(--paper); transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; padding-top: var(--sat); box-shadow: var(--shadow); }
.drawer.on { transform: none; }
.drawer-head { padding: 12px 14px 8px; display: flex; gap: 8px; align-items: center; }
.drawer-head .field { padding: 10px 14px; }
.conv { display: block; width: 100%; text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.conv.on { background: var(--vault-soft); }
.conv .t { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .l { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .d { font: 11px var(--f-mono); color: var(--muted); }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92dvh; background: var(--paper); border-radius: var(--r-l) var(--r-l) 0 0; transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.sheet.on { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 4px; flex: none; }
.sheet-head { display: flex; align-items: center; padding: 4px 16px 8px; gap: 8px; }
.sheet-head h3 { flex: 1; margin: 0; font: 650 19px var(--f-display); }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(var(--sab) + 20px); }

/* ------------ varlıklar ------------ */
.passbook { position: relative; background: var(--surface); border-radius: var(--r-l); padding: 20px 18px 18px; box-shadow: var(--shadow); overflow: hidden; }
.passbook::before { /* cüzdan delikleri */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: radial-gradient(circle at 6px 0, var(--paper) 3px, transparent 3.5px) 0 0 / 14px 6px repeat-x;
}
.eyebrow { font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eyebrow button { font: inherit; color: var(--vault); letter-spacing: .04em; }
.big { font: 750 clamp(34px, 11vw, 46px)/1.05 var(--f-display); letter-spacing: -0.025em; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.big small { font-size: .45em; font-weight: 650; color: var(--muted); margin-left: 4px; }
.sub { font: 13px var(--f-mono); color: var(--ink-2); }
.delta-up { color: var(--in); } .delta-down { color: var(--out); }
.spark { width: 100%; height: 54px; margin-top: 12px; display: block; }
.dist { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 16px 0 10px; background: var(--surface-2); }
.dist i { display: block; height: 100%; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.legend b { font: 500 12px var(--f-mono); margin-left: auto; color: var(--ink-2); }
.legend .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }

.sec-title { font: 650 15px var(--f-display); margin: 26px 2px 10px; display: flex; justify-content: space-between; align-items: baseline; }
.sec-title small { font: 11px var(--f-mono); color: var(--muted); font-weight: 400; }
.card { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row .ri { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-size: 17px; flex: none; }
.row .rm { flex: 1; min-width: 0; }
.row .rt { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rs { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rv { text-align: right; flex: none; }
.row .rv .a { font: 500 15px var(--f-mono); font-variant-numeric: tabular-nums; }
.row .rv .b { font: 11.5px var(--f-mono); color: var(--muted); }
.tickers { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.tickers::-webkit-scrollbar { display: none; }
.ticker { flex: none; background: var(--surface); border-radius: 14px; padding: 10px 12px; min-width: 112px; box-shadow: var(--shadow); }
.ticker .n { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ticker .p { font: 500 15px var(--f-mono); margin-top: 2px; }
.ticker .c { font: 11px var(--f-mono); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty b { display: block; font: 650 17px var(--f-display); color: var(--ink); margin-bottom: 6px; }

/* ------------ hareketler ------------ */
.months { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.months::-webkit-scrollbar { display: none; }
.months button { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: 13px var(--f-mono); }
.months button.on { background: var(--vault); color: var(--paper); border-color: var(--vault); }
.io { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.io > div { background: var(--surface); border-radius: var(--r-m); padding: 14px; box-shadow: var(--shadow); }
.io .k { font: 11px var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.io .v { font: 650 21px var(--f-display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.cat { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cat:last-child { border-bottom: 0; }
.cat .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.cat .bar i { display: block; height: 100%; background: var(--vault); border-radius: 3px; }
.cat b { font: 500 13px var(--f-mono); }
.day { font: 11px var(--f-mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 18px 4px 6px; }
.amt-in { color: var(--in); } .amt-out { color: var(--out); }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search .field { padding: 10px 14px; }

/* ------------ notlar ------------ */
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.seg button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.note { display: block; width: 100%; text-align: left; background: var(--surface); border-radius: var(--r-m); padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.note .nk { font: 10.5px var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--brass); display: flex; gap: 8px; }
.note .nt { font-weight: 600; margin: 4px 0 2px; }
.note .nc { font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note .nd { font: 11px var(--f-mono); color: var(--muted); margin-top: 6px; }
.textarea { width: 100%; min-height: 180px; padding: 12px 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); outline: none; resize: vertical; line-height: 1.45; }

/* ------------ ayarlar ------------ */
.set-group { margin-bottom: 22px; }
.set-group > h4 { font: 500 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 4px 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; align-items: center; }
.kv:last-child { border-bottom: 0; }
.kv span:last-child { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); text-align: right; }
.kv select, .kv input[type=number] { background: var(--surface-2); border: 0; border-radius: 8px; padding: 6px 8px; font-size: 14px; max-width: 60%; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--surface-2); border-radius: 14px; transition: .2s; border: 1px solid var(--line); }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--vault); border-color: var(--vault); }
.switch input:checked + i::after { transform: translateX(18px); }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.stat3 > div { background: var(--surface); padding: 12px; }
.stat3 .k { font: 10.5px var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat3 .v { font: 650 18px var(--f-display); margin-top: 2px; font-variant-numeric: tabular-nums; }
.note-box { padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; background: var(--brass-soft); border-radius: var(--r-m); }
.note-box b { color: var(--ink); }
.log { padding: 9px 14px; border-bottom: 1px solid var(--line); font: 12px/1.45 var(--f-mono); }
.log .lv { display: inline-block; min-width: 44px; font-weight: 500; }
.log .lv.error { color: var(--danger); } .log .lv.warn { color: var(--brass); } .log .lv.info { color: var(--vault); }
.log .ld { color: var(--muted); white-space: pre-wrap; word-break: break-all; margin-top: 3px; display: none; }
.log.open .ld { display: block; }
.pill { display: inline-block; font: 10.5px var(--f-mono); padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.pill.ok { background: var(--vault-soft); color: var(--vault); } .pill.bad { background: rgba(180,72,59,.12); color: var(--danger); } .pill.warn { background: var(--brass-soft); color: var(--brass); }
.bench td { font: 12px var(--f-mono); padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.bench th { font: 500 11px var(--f-mono); text-align: left; padding: 6px 8px; color: var(--muted); }
.bench { width: 100%; border-collapse: collapse; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%) translateY(20px); bottom: calc(var(--tab-h) + var(--sab) + 70px); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 60; opacity: 0; transition: .25s; pointer-events: none; max-width: 90vw; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: var(--sat) 10px var(--sab); }
.lightbox img { max-width: 100%; max-height: 90dvh; border-radius: 10px; }

@media (min-width: 760px) {
  .pad, .chat-scroll { max-width: 720px; margin: 0 auto; width: 100%; }
  .composer-row, .pending-att { max-width: 720px; margin-left: auto; margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
