/* Mobile first (360 px), big targets, system fonts that draw Bangla, light and dark. */
:root {
  --bg: #f5f8f7; --card: #ffffff; --ink: #14201e; --muted: #50625f; --line: #cdd9d6;
  --brand: #0f766e; --brand-ink: #ffffff; --accent: #b45309; --good: #166534; --bad: #b91c1c; --warn-bg: #fef3c7;
  --focus: #1d4ed8; --radius: 14px;
  font-family: "Noto Sans Bengali", "Kalpurush", "Siyam Rupali", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1715; --card: #16221f; --ink: #eaf2f0; --muted: #a3b8b4; --line: #2c3f3b;
    --brand: #2dd4bf; --brand-ink: #04211e; --accent: #fbbf24; --good: #4ade80; --bad: #f87171; --warn-bg: #3b2f0c; --focus: #93c5fd;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 18px; line-height: 1.55; overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent; }
.sprite { position: absolute; }
.offscreen { position: absolute; left: -9999px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus, main:focus { outline: none; }
h1 { font-size: 1.55rem; line-height: 1.3; margin: 0; }
h2.small { font-size: 0.95rem; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
p { margin: 0; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; max-width: 560px; margin: 0 auto; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--brand); text-decoration: none; }
main { max-width: 560px; margin: 0 auto; padding: 8px 16px 96px; outline: none; }
.pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.center { text-align: center; align-items: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.row.between { justify-content: space-between; }
.row.between > * { flex: 0 1 auto; }
.row.wrap { flex-wrap: wrap; }
.row.links { justify-content: space-between; flex-wrap: wrap; }
.row.links > * { flex: 0 1 auto; }
.muted { color: var(--muted); font-size: 0.92rem; }
.lead-text { color: var(--muted); }
.ok { color: var(--good); font-weight: 600; }
.warn { color: var(--bad); font-weight: 600; }
.banner { background: var(--warn-bg); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; }
.from { font-weight: 700; color: var(--accent); }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.q { font-weight: 600; display: flex; align-items: center; gap: 8px; }

.ic { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; vertical-align: middle; }
.ic.lead { width: 1.7em; height: 1.7em; color: var(--brand); }
.ic.big { width: 2.2em; height: 2.2em; }
.ic.mini { width: 1em; height: 1em; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 18px; border-radius: var(--radius);
  border: 2px solid var(--brand); background: transparent; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; touch-action: manipulation; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.alt { background: var(--card); }
.btn.big { min-height: 62px; font-size: 1.2rem; }
.btn.wa { background: #15803d; border-color: #15803d; color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; min-height: 44px; padding: 6px 4px; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 0.95rem; cursor: pointer; }
.chip.pick[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.chip.tag { cursor: default; font-weight: 700; letter-spacing: 0.08em; }
.count-chip { cursor: default; font-weight: 700; color: var(--good); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.input { width: 100%; min-height: 52px; padding: 10px 14px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; }
.input.code { letter-spacing: 0.12em; text-transform: uppercase; text-align: center; font-weight: 700; }
.bigcode { font-size: 1.9rem; font-weight: 800; letter-spacing: 0.1em; text-align: center; color: var(--brand); word-break: keep-all; }
.tick { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; min-height: 44px; }
.tick input { width: 28px; height: 28px; flex: none; accent-color: var(--brand); margin-top: 2px; }

.consent { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.consent li { display: flex; gap: 12px; align-items: center; }
.more summary, .qtext summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--brand); }
.more p { font-size: 0.92rem; color: var(--muted); }
html[lang="bn"] .en-only, html[lang="en"] .bn-only { display: none; }

.wall { min-height: 70vh; justify-content: center; }
.tip { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 0.95rem; }
.result { font-weight: 700; }
.result.good { color: var(--good); } .result.meh { color: var(--accent); } .result.bad { color: var(--bad); }

.setting-cur { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dots { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.dots li { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.dots li.done { background: var(--good); } .dots li.now { background: var(--brand); }
.situation { font-size: 1.1rem; font-weight: 600; }
.persona { display: flex; gap: 8px; align-items: center; margin-top: 8px; color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.agent.speaking { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.qtext p { padding: 4px 0 0; color: var(--muted); }
.hint { border-color: var(--brand); }
.hint-text { font-size: 1.1rem; font-weight: 700; }
.nudge { font-size: 0.9rem; color: var(--muted); margin-top: 6px; }
.turn { font-weight: 800; color: var(--brand); font-size: 1.2rem; }
.waiting { font-weight: 600; padding: 16px 0; }
.sheet { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 8px; }
.sheet li { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding-bottom: 6px; font-size: 0.95rem; }

.capture { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; }
.meter { width: 100%; max-width: 320px; height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform 60ms linear; }
.recbtn { width: 112px; height: 112px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.recbtn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.recbtn.on { background: var(--bad); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.reclabel { font-weight: 700; text-align: center; }
.count { color: var(--bad); font-weight: 700; }
.review { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.review .row { align-items: stretch; }
.big-play { width: 100%; }

.queue-state { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.queue-state.wait { color: var(--accent); } .queue-state.ok { color: var(--good); }
.spin { width: 1em; height: 1em; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.9s linear infinite; }
.impact { background: var(--warn-bg); border-radius: var(--radius); padding: 12px 14px; font-weight: 600; }
.bar { height: 16px; background: var(--line); border-radius: 8px; overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; background: var(--brand); }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.qbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); font-size: 0.9rem; display: flex; flex-direction: column; align-items: center; z-index: 5; }
.qmain { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.qwhy { color: var(--accent); font-size: 0.85rem; text-align: center; }
.toast { position: fixed; left: 12px; right: 12px; bottom: 76px; max-width: 520px; margin: 0 auto; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: var(--radius); display: flex; gap: 10px; align-items: center; justify-content: space-between; z-index: 10; }
.toast .chip { color: var(--ink); }

@keyframes pulse { 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--bad) 25%, transparent); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.stack.wide { width: 100%; }
.center > .stack, .center .btn { width: 100%; }

/* version 2: the call to the front desk */
.bubble { background: var(--card); border: 2px solid var(--line); border-radius: 18px 18px 18px 4px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bubble.speaking { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.bubble-who { font-size: 0.85rem; font-weight: 700; color: var(--brand); margin: 0; }
.bubble-text { font-size: 1.15rem; font-weight: 600; line-height: 1.55; margin: 0; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 0.95rem; }
.turncue { margin: 0; padding: 10px 12px; border-radius: var(--radius); font-weight: 700; text-align: center; }
.turncue.speaking { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.turncue.tap { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); }
.turncue.turn { background: var(--good); color: #fff; animation: cue 1.4s ease-in-out infinite; }
@keyframes cue { 50% { transform: scale(1.03); } }
.history { display: flex; flex-direction: column; gap: 6px; border-left: 3px solid var(--line); padding-left: 10px; }
.hist p { margin: 0; font-size: 0.9rem; }
.hist-desk { color: var(--muted); }
.hist-you { color: var(--good); font-weight: 600; }
.fork .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.persona-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.persona-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 96px; padding: 12px 8px; text-align: center; white-space: normal; }
.persona-btn strong { font-size: 1.2rem; }
.sheet-dept summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.goals { margin: 0; padding-left: 20px; }
.goals li { margin: 4px 0; }
@media (prefers-reduced-motion: reduce) { .turncue.turn { animation: none; } }

/* live call with SHEFA */
.live-log { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; }
.live-turn { border-radius: 18px; padding: 10px 14px; border: 2px solid var(--line); background: var(--card); max-width: 92%; }
.live-turn.shefa { align-self: flex-start; border-radius: 18px 18px 18px 4px; }
.live-turn.you { align-self: flex-end; border-radius: 18px 18px 4px 18px; background: color-mix(in srgb, var(--brand) 8%, var(--card)); }
.live-turn .bubble-text { font-size: 1.05rem; }
.live-turn .small { font-size: 0.8rem; margin: 2px 0 0; }
.cue { font-weight: 700; margin: 0; }
