/* Kuniya Command - in the institution ERP's look (user, 29 Nov 2026): Inter / Plus Jakarta Sans, slate-50
   page, white cards with a slate-200 border and 8px corners, primary #2563eb, white top bar and bottom tab bar,
   Font Awesome icons; dark mode uses the ERP's slate-900/800. Light first, dark switch on the Me page (kcTheme). */
:root {
  --primary: #2563eb; --primary-ink: #1d4ed8; --primary-soft: rgba(37, 99, 235, .1); --primary-soft2: rgba(37, 99, 235, .05);
  --ground: #f8fafc; --outside: #e2e8f0; --card: #ffffff; --line: #e2e8f0; --line-2: #cbd5e1;
  --ink: #1e293b; --ink-strong: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #64748b; --icon: #94a3b8;
  --tile: #f1f5f9; --warn-bg: #fef3c7; --warn-ink: #92400e; --ok: #047857; --bad: #b91c1c; --bad-bg: #fee2e2;
  --font: Inter, 'Plus Jakarta Sans', 'Noto Sans Malayalam', 'Noto Sans Devanagari', ui-sans-serif, system-ui, sans-serif;
  --display: 'Plus Jakarta Sans', Inter, 'Noto Sans Malayalam', 'Noto Sans Devanagari', sans-serif;
  --radius: 8px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --primary: #3b82f6; --primary-ink: #93c5fd; --primary-soft: rgba(59, 130, 246, .16); --primary-soft2: rgba(59, 130, 246, .08);
  --ground: #020617; --outside: #000; --card: #0f172a; --line: #1e293b; --line-2: #334155;
  --ink: #e2e8f0; --ink-strong: #f8fafc; --ink-2: #cbd5e1; --muted: #94a3b8; --faint: #94a3b8; --icon: #64748b;
  --tile: #1e293b; --warn-bg: #422006; --warn-ink: #fcd34d; --ok: #34d399; --bad: #f87171; --bad-bg: #450a0a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--outside); font-family: var(--font); color: var(--ink); -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Phone first; on a laptop the same app sits in a centred column (user, 29 Nov 2026). */
.frame { max-width: 480px; margin: 0 auto; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--ground); position: relative; overflow: hidden; }
@media (min-width: 560px) { .frame { box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(15, 23, 42, .08); } }

/* ---- sign-in and PIN: the ERP's light sign-in look ---- */
.screen-signin .frame, .screen-setpin .frame, .screen-pin .frame, .screen-down .frame { background: var(--ground); color: var(--ink); }
.auth { flex: 1; display: flex; flex-direction: column; padding: max(48px, env(safe-area-inset-top)) 24px 24px; overflow-y: auto; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.brand h1 { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--ink-strong); letter-spacing: -.3px; }
.brand p { margin: 0; font-size: 14px; color: var(--muted); }
.logo { width: 64px; height: 64px; border-radius: 16px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 30px; flex-shrink: 0; }
.logo.sm { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
.logo[hidden] { display: none; }
.auth-form { margin-top: 32px; display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.auth-form label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 8px; }
.auth-form input[type=text], .auth-form input[type=password] { height: 48px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 16px; padding: 0 14px; }
.auth-form input:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
.auth-form .check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; font-size: 14px; color: var(--ink-2); }
.auth-form .check input { width: 18px; height: 18px; accent-color: var(--primary); }
.primary { height: 48px; border: 0; border-radius: var(--radius); background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; margin-top: 10px; }
.primary:hover { background: var(--primary-ink); }
.msg { margin: 6px 0; padding: 10px 12px; border-radius: var(--radius); background: var(--bad-bg); color: var(--bad); font-size: 14px; line-height: 1.45; border: 1px solid rgba(185, 28, 28, .2); }
.hint { margin: 16px 0 0; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.foot { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.foot span { display: flex; align-items: center; gap: 8px; }
.foot small { font-size: 12px; }

.pinpad { align-items: center; text-align: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; text-decoration: none; flex-shrink: 0; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.pinpad h1 { margin: 14px 0 0; font-family: var(--display); font-size: 22px; color: var(--ink-strong); }
.pinpad .sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); max-width: 300px; line-height: 1.45; }
.dots { display: flex; gap: 18px; margin-top: 26px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); }
.dots i.on { background: var(--primary); border-color: var(--primary); }
.dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 24px; margin-top: 32px; width: 100%; max-width: 280px; }
.keys button { height: 66px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink-strong); font-size: 24px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.keys button:active { background: var(--primary-soft); }
.keys button[data-k=del], .keys button.pk { background: transparent; border-color: transparent; color: var(--muted); }
.keys button.pk { color: var(--primary); }
.keys button.pk[hidden] { display: flex; visibility: hidden; }
.signout { margin-top: auto; padding-top: 16px; }
.link { background: none; border: 0; color: var(--primary); font-size: 14px; font-weight: 600; min-height: 44px; }

/* ---- top bar (the ERP header) ---- */
.bar { height: 56px; flex-shrink: 0; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 10px 0 12px; padding-top: env(safe-area-inset-top); box-sizing: content-box; position: relative; z-index: 3; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who strong { font-family: var(--display); font-size: 16px; font-weight: 700; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span.speaking { color: var(--primary); }
.icon { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; font-size: 16px; text-decoration: none; }
.icon[hidden] { display: none; }
#speakBtn .off, #speakBtn[aria-pressed=false] .on { display: none; }
#speakBtn[aria-pressed=false] .off { display: inline; }
#speakBtn[aria-pressed=true] { color: var(--primary); }
.badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); font-style: normal; }
.badge[hidden] { display: none; }

.notif { flex-shrink: 0; display: flex; align-items: center; gap: 8px; background: var(--primary-soft2); border-bottom: 1px solid var(--line); color: var(--ink-2); padding: 8px 8px 8px 14px; font-size: 13.5px; }
.notif[hidden] { display: none; }
.notif i { color: var(--primary); }
.notif span { flex: 1; }
.notif button { min-height: 36px; border: 0; border-radius: var(--radius); background: var(--primary); color: #fff; font-weight: 600; padding: 0 12px; }
.notif button.x { background: transparent; color: var(--muted); font-size: 22px; min-width: 40px; padding: 0; }

/* ---- views ---- */
.views { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; overflow-y: auto; padding: 14px 14px 20px; overscroll-behavior: contain; }
.view[hidden] { display: none; }
.vhead { margin: 2px 2px 12px; }
.vhead h2 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ink-strong); }
.vhead p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 10px; margin: 0; }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }
.list { display: flex; flex-direction: column; gap: 10px; }
.list .m > .card { width: 100%; max-width: none; }

/* home */
.hello { margin: 2px 2px 14px; }
.hello h1 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink-strong); }
.hello p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-width: 0; }
.kpi small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.kpi b { display: block; font-size: 17px; font-weight: 700; color: var(--ink-strong); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.warn { background: var(--warn-bg); border-color: transparent; }
.kpi.warn small, .kpi.warn b { color: var(--warn-ink); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 12px 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.25; }
.tile i { font-size: 20px; color: var(--primary); width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft2); display: flex; align-items: center; justify-content: center; }
.tile:hover, .tile:focus-visible { border-color: rgba(37, 99, 235, .5); background: var(--primary-soft2); }
.tile .badge { top: 8px; right: 8px; }
.section-h { margin: 18px 2px 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
#homeLatest .latest { display: block; text-decoration: none; color: inherit; }
#homeLatest .card { width: 100%; max-width: none; }

/* tile pages */
.chipbar { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 10px; scrollbar-width: none; }
.chipbar::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: 34px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.card.sec { width: 100%; max-width: none; margin-bottom: 10px; }
.sec-h { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink-strong); }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.items li:first-child { border-top: 0; padding-top: 2px; }
.items li > div { flex: 1; min-width: 0; }
.items strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.items span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.items em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.items li.warn em { color: var(--bad); }
.icards { display: flex; flex-direction: column; gap: 10px; }
.icard { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; color: inherit; background: var(--card); }
.icard:hover { border-color: rgba(37, 99, 235, .5); }
.icard-h strong { display: block; font-size: 14.5px; color: var(--ink-strong); }
.icard-h span { font-size: 12px; color: var(--muted); }
.icard-s { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.icard-s small { display: block; font-size: 11px; color: var(--muted); }
.icard-s b { font-size: 14px; color: var(--ink-strong); }
.page-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.btn { flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; height: auto; margin: 0; }

/* me */
.profile { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.profile strong { display: block; font-size: 16px; color: var(--ink-strong); }
.profile span { font-size: 13px; color: var(--muted); }
.settings { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.settings form { margin: 0; }
.set { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 0; border-top: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 15px; text-align: left; text-decoration: none; }
.settings > .set:first-child { border-top: 0; }
.set[hidden] { display: none; }
.set i { width: 22px; text-align: center; color: var(--primary); }
.set span { flex: 1; }
.set em { font-style: normal; font-size: 13px; color: var(--muted); }
.set.danger, .set.danger i { color: var(--bad); }
.sw { width: 40px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; flex-shrink: 0; transition: background .2s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sw.on { background: var(--primary); }
.sw.on::after { transform: translateX(16px); }
.fine { text-align: center; font-size: 12px; color: var(--muted); margin: 18px 0 0; }

/* ---- bottom tab bar (the ERP's mobile tab bar) with the AI in the centre ---- */
.tabbar { flex-shrink: 0; height: 62px; padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 25px rgba(0, 0, 0, .06); display: flex; align-items: stretch; justify-content: space-around; padding-left: 4px; padding-right: 4px; position: relative; z-index: 3; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--icon); text-decoration: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; }
.tabbar .ti { position: relative; width: 34px; height: 32px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on .ti { background: var(--primary-soft); }
.tabbar .ti .badge { top: -4px; right: -8px; }
.tabbar a.ai { position: relative; color: var(--primary); }
.ai-btn { width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 6px 18px rgba(37, 99, 235, .4), 0 0 0 5px var(--card); }
.tabbar a.ai.on .ai-btn { background: var(--primary-ink); }

/* ---- chat (the AI view) ---- */
.chatview { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chatview[hidden] { display: none; }
.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.chat > *, .m > * { flex-shrink: 0; }   /* cards clip their corners (overflow: hidden), which lets flex squash them to nothing */
.m { display: contents; }
.day { align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--tile); border-radius: 8px; padding: 4px 10px; margin: 4px 0; }
.b { max-width: 86%; border-radius: 4px 14px 14px 14px; padding: 10px 12px 6px; font-size: 14.5px; line-height: 1.5; background: var(--card); border: 1px solid var(--line); align-self: flex-start; word-wrap: break-word; }
.b.me { align-self: flex-end; background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 14px 4px 14px 14px; }
.b p { margin: 0; white-space: pre-line; }
.t { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--faint); margin-top: 3px; }
.b.me .t { color: rgba(255, 255, 255, .85); }
.card { width: 86%; max-width: 360px; align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card.first { border-radius: 4px var(--radius) var(--radius) var(--radius); }
.card .in { padding: 12px 14px 8px; }
.label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); }
.label i { margin-right: 2px; }
.label:has(i) { justify-content: flex-start; }
.label.navy { color: var(--ink-2); }
.pill { font-size: 11px; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); padding: 3px 8px; border-radius: 999px; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.card h3 { margin: 6px 0 0; font-size: 15px; font-weight: 700; color: var(--ink-strong); }
.card .txt { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); white-space: pre-line; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.tiles div { background: var(--tile); border-radius: var(--radius); padding: 8px; min-width: 0; }
.tiles small { display: block; font-size: 11px; color: var(--muted); }
.tiles b { font-size: 15px; color: var(--ink-strong); }
.tiles div.warn { background: var(--warn-bg); }
.tiles div.warn small, .tiles div.warn b { color: var(--warn-ink); }
.acts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 1px solid var(--line); }
.acts > * { min-height: 46px; border: 0; border-left: 1px solid var(--line); background: var(--card); color: var(--primary); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 6px; text-align: center; }
.acts > *:first-child { border-left: 0; }
.acts .yes { color: var(--ok); font-weight: 700; }
.acts .no { color: var(--bad); font-weight: 700; }
.card.done { opacity: .72; }
.done-line { font-size: 13px; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--line); }
.rows { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rows .r { display: grid; grid-template-columns: minmax(64px, 30%) 1fr auto; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.rows .r > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-bg { height: 10px; border-radius: 5px; background: var(--tile); overflow: hidden; }
.rows .bar-in { height: 10px; border-radius: 5px; background: var(--primary); min-width: 2px; }
.rows .r span:last-child { font-weight: 700; text-align: right; color: var(--ink-strong); }
.src { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 10px; }
.follow { width: 86%; max-width: 360px; display: flex; flex-direction: column; gap: 6px; align-self: flex-start; }
.follow > * { min-height: 42px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--primary); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 12px; }
.composer { flex-shrink: 0; padding: 0 0 10px; background: var(--ground); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 12px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex-shrink: 0; min-height: 34px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 0 14px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ask { display: flex; align-items: center; gap: 8px; padding: 0 10px; margin: 0; }
.field { flex: 1; min-width: 0; height: 48px; background: var(--card); border: 1px solid var(--line-2); border-radius: 24px; display: flex; align-items: center; gap: 6px; padding: 0 5px; }
.field input { flex: 1; min-width: 0; border: 0; height: 40px; font-size: 16px; background: transparent; outline: none; }
.field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.lang { height: 36px; min-width: 42px; border: 0; border-radius: 18px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 14px; padding: 0 10px; }
.send { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send[hidden] { display: none; }
.mic { width: 48px; height: 48px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.b.pending { opacity: .75; }
.b.thinking { display: flex; gap: 5px; padding: 14px 16px; }
.b.thinking i { width: 8px; height: 8px; border-radius: 50%; background: var(--icon); animation: blink 1.2s infinite; }
.b.thinking i:nth-child(2) { animation-delay: .2s; }
.b.thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: 86%; text-align: center; z-index: 9; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast[hidden] { display: none; }

/* Listening screen */
.listen { position: absolute; inset: 0; z-index: 8; background: #0f172a; color: #fff; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom)); }
.listen[hidden] { display: none; }
.listen .icon { background: transparent; border-color: rgba(255, 255, 255, .15); color: #fff; }
.ls-top { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #cbd5e1; }
.ls-gap { width: 40px; }
.langs { display: flex; gap: 6px; align-self: center; margin-top: 16px; background: #1e293b; padding: 4px; border-radius: 999px; }
.langs button { min-height: 40px; min-width: 64px; border: 0; border-radius: 999px; background: transparent; color: #cbd5e1; font-weight: 600; font-size: 15px; padding: 0 12px; }
.langs button[aria-pressed=true] { background: #3b82f6; color: #fff; font-weight: 700; }
.words { margin-top: 44px; font-size: 26px; line-height: 1.5; font-weight: 600; min-height: 150px; max-height: 40vh; overflow-y: auto; word-wrap: break-word; }
.words .interim { color: #94a3b8; }
.ls-hint { font-size: 13px; color: #94a3b8; margin: 8px 0 0; }
.wave { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 5px; height: 64px; }
.wave i { width: 5px; height: 10px; border-radius: 3px; background: #60a5fa; }
.listen.live .wave i { animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2n) { animation-delay: .15s !important; background: #3b82f6; }
.wave i:nth-child(3n) { animation-delay: .3s !important; }
.wave i:nth-child(5n) { animation-delay: .45s !important; }
@keyframes wave { 0%, 100% { height: 10px; } 50% { height: 54px; } }
.ls-ctl { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; }
.ls-side { min-width: 84px; min-height: 48px; border: 0; background: transparent; color: #e2e8f0; font-size: 15px; }
.ls-go { width: 84px; height: 84px; border-radius: 50%; border: 0; background: #3b82f6; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 10px rgba(59, 130, 246, .22), 0 0 0 22px rgba(59, 130, 246, .1); }
.ls-go .arrow, .ls-go.send .stop { display: none; }
.ls-go.send .arrow { display: block; }
.ls-foot { text-align: center; font-size: 12px; color: #94a3b8; margin: 18px 0 0; }
.listen button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }

/* Approve / Reject sheet */
.sheet-back { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); z-index: 7; display: flex; align-items: flex-end; }
.sheet-back[hidden] { display: none; }
.sheet { width: 100%; background: var(--card); color: var(--ink); border-radius: 16px 16px 0 0; padding: 10px 20px max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; max-height: 90%; overflow-y: auto; }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); align-self: center; }
.sheet h2 { margin: 0; font-family: var(--display); font-size: 20px; color: var(--ink-strong); }
.sheet .sub { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; white-space: pre-line; }
.sheet > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sheet textarea { width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; font-size: 16px; resize: none; line-height: 1.45; background: var(--card); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick:empty { display: none; }
.quick button { min-height: 34px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 0 12px; font-size: 13px; color: var(--ink-2); }
.sheet .alt { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; min-height: 44px; }
.sheet .alt[hidden] { display: none; }
.sheet .alt input { width: 20px; height: 20px; accent-color: var(--primary); }
.sheet .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.sheet .row button { min-height: 48px; border-radius: var(--radius); font-weight: 700; font-size: 15px; }
.sheet .cancel { border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); }
.sheet .go { border: 0; background: var(--bad); color: #fff; }
.sheet .go.yes { background: #059669; }
.sheet .go:disabled { opacity: .6; }
@media (prefers-reduced-motion: reduce) { .dots.shake, .b.thinking i, .listen.live .wave i { animation: none; } .listen.live .wave i { height: 30px; } }
