/* BillTap — the Aroh Voice Assistant design. #app.ph = phone on its side (BillPhone, Ph* boards, 844×390): sheet left, voice right.
   #app.tab = tablet (BillPro, Tab* boards, 1280×800): top bar, voice left, sheet right. Upright phone: sheet on top, voice below. */
:root {
  --ground: #0A0B14; --ground-2: #1A1640; --ink: #F2F1EC; --ink-dim: #A3A6BF; --ink-mono: #8C8FAA;
  --card: #F7F5EF; --card-ink: #17181F; --card-dim: #5B5E6E; --card-mid: #3A3D4C; --rule: #E4E1D8; --rule-2: #ECE9E1; --btn-line: #D8D4E6;
  --accent: #5A3FE0; --accent-ink: #3B25B8; --accent-soft: #EEE9FF; --accent-line: #6B4EFF; --violet: #7C5CFF;
  --pend: #FFF8EC; --pend-line: #F2B84B; --pend-ink: #7A4B00;
  --cash-bg: #E3F4EA; --cash-line: #B7E0C7; --cash-ink: #0E5E33; --credit-bg: #FFF4E0; --credit-line: #F2D29B; --grey-bg: #EFEDE6;
  --panel: #151726; --panel-line: #2A2D44; --bubble: #2E3160; --bubble-old: #232640;
  --font: 'Sora', 'Noto Sans Devanagari', system-ui, sans-serif; --mono: 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); color: var(--ink); font-family: var(--font); }
button { font: inherit; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.r { text-align: right; }
.dim { color: var(--card-dim); }
.grow { flex-grow: 1; }

/* ---------- shell ---------- */
#app { height: 100dvh; display: flex; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: radial-gradient(80% 120% at 90% 50%, var(--ground-2) 0%, var(--ground) 65%); overflow: hidden; }
#app.tab { flex-direction: column; gap: 0; padding: 0; background: radial-gradient(70% 90% at 12% 60%, var(--ground-2) 0%, var(--ground) 65%); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 16px 12px; min-height: 48px; }
.tb-left { display: flex; align-items: center; gap: 24px; min-width: 0; }
.vtitle { display: flex; flex-direction: column; gap: 2px; width: 312px; flex-shrink: 0; }
.vtitle b { font-size: 15px; font-weight: 600; }
.vtitle small { font-size: 12px; color: var(--ink-dim); }
.pills { display: flex; gap: 8px; min-width: 0; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--panel-line); display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; }
.pill span { overflow: hidden; text-overflow: ellipsis; }
.pill.strong { background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 600; }
.tb-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tab .tb-right .chip { min-height: 36px; padding: 0 16px; border-radius: 18px; font-size: 14px; display: flex; align-items: center; }
.seg { display: flex; padding: 4px; border-radius: 24px; background: var(--panel); border: 1px solid var(--panel-line); }
.seg button { min-height: 40px; padding: 0 20px; border-radius: 20px; border: 0; background: transparent; color: var(--ink-dim); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--cash-bg); color: var(--cash-ink); }
.seg button.credit.on { background: var(--credit-bg); color: var(--pend-ink); }
.seg.light { padding: 4px; border-radius: 14px; background: var(--rule-2); border: 0; }
.seg.light button { flex-grow: 1; min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--card-dim); white-space: nowrap; }
.seg.light button.on { background: #fff; color: var(--card-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.stage { flex-grow: 1; display: flex; gap: 16px; padding: 0 16px 16px; min-height: 0; }

/* ---------- the sheet (light card holding the document) ---------- */
.sheet { flex: 1 1 auto; min-width: 0; border-radius: 20px; background: var(--card); color: var(--card-ink);
  padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.tab .sheet { border-radius: 24px; padding: 16px; }
.sheet.doc { gap: 8px; }
.tab .sheet.doc { padding: 20px; gap: 16px; }
.bill-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bill-head .who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.bill-head .party { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-head .meta { font-size: 11px; color: var(--card-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { padding: 2px 10px; border-radius: 999px; border: 0; background: var(--cash-bg); color: var(--cash-ink); font-size: 12px; font-weight: 600; min-height: 28px; white-space: nowrap; display: inline-flex; align-items: center; }
.chip.credit { background: var(--credit-bg); color: var(--pend-ink); }
.chip.grey { background: var(--grey-bg); color: var(--card-mid); }
.chip.new { background: var(--accent-soft); color: var(--accent-ink); }
.chip.install { background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.install-help { font-size: 11px; line-height: 1.3; color: var(--card-dim); text-align: right; max-width: 55%; }
.tab .install-help { color: var(--ink-dim); max-width: 360px; }

/* bill, phone (BillPhone) */
.cols, .row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 60px 40px 72px; gap: 8px; }
.cols { padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: 10px; color: var(--card-dim); letter-spacing: .04em; text-transform: uppercase; }
.cols span:not(:first-child), .row > span:not(:first-child) { text-align: right; }
.lines { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; margin: 0 -10px; padding: 0 10px; }
.row { align-items: center; min-height: 38px; border-bottom: 1px solid var(--rule-2); font-size: 13px; }
.name { display: flex; flex-direction: column; min-width: 0; }
.name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name small { font-size: 11px; color: var(--card-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .qty, .trow .qty { font-weight: 600; }
.row .amt, .trow .amt { font-weight: 700; }
.row .gst { font-size: 12px; color: var(--card-dim); }
.row.last, .trow.last { margin: 2px -8px 0; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); border: 2px solid var(--accent-line); }
.row.last small, .row.last .gst, .trow.last .dim { color: var(--card-mid); }
.row.pend, .trow.pend { margin: 2px -8px 0; padding: 0 6px; border-radius: 10px; background: var(--pend); border: 2px solid var(--pend-line); animation: pulse 1.8s ease-in-out infinite; }
.pend .name small { color: var(--pend-ink); font-weight: 600; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242,184,75,0); } 50% { box-shadow: 0 0 0 5px rgba(242,184,75,.28); } }
.empty { margin: auto; text-align: center; color: var(--card-dim); font-size: 13px; line-height: 1.6; padding: 12px; }
.bill-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--rule); }
.bill-foot .sum { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bill-foot .sum small { font-size: 11px; color: var(--card-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-foot .total { font-size: 24px; font-weight: 700; line-height: 1.1; }
.bill-foot .acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.note { font-size: 11px; color: var(--pend-ink); font-weight: 600; }

/* bill, tablet (BillPro) */
.tgrid { display: grid; grid-template-columns: 28px minmax(0, 1fr) 84px 76px 72px 84px 52px 96px 44px; gap: 12px; align-items: center; }
.thead { padding: 0 8px 8px; border-bottom: 1px solid var(--rule); font-size: 11px; color: var(--card-dim); letter-spacing: .04em; text-transform: uppercase; }
.tab .lines { margin: 0; padding: 0; }
.trow { padding: 4px 8px; border-bottom: 1px solid var(--rule-2); font-size: 14px; flex-shrink: 0; }
.trow .dim { font-size: 13px; }
.trow .ix { color: var(--card-dim); }
.trow.last, .trow.pend { margin: 4px 0 0; padding: 4px 8px; border-radius: 12px; }
.trow.last .ix { color: var(--accent); font-weight: 600; }
.del { width: 44px; height: 44px; border: 0; background: transparent; color: var(--card-dim); display: flex; align-items: center; justify-content: center; }
.tnext { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 8px; font-size: 14px; color: var(--card-dim); flex-shrink: 0; }
.dash { height: 44px; border: 1.5px dashed #CFCAD9; border-radius: 12px; display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.dash svg { width: 18px; height: 18px; }
.tfoot { display: flex; gap: 16px; align-items: stretch; padding-top: 16px; border-top: 1px solid var(--rule); flex-shrink: 0; }
.tsum { flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-width: 0; }
.tsum .dim { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ttot { display: flex; align-items: baseline; gap: 12px; }
.ttot span:first-child { font-size: 14px; color: var(--card-dim); }
.ttot .num { font-size: 34px; font-weight: 700; line-height: 1; }
.tmid { width: 260px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--card-mid); }
.lab { font-size: 11px; color: var(--card-dim); letter-spacing: .06em; text-transform: uppercase; }
.tacts { width: 220px; display: flex; flex-direction: column; gap: 8px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.g2 .act:only-child { grid-column: 1 / 3; }

/* buttons */
.btn-main { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn-main:disabled { background: #D8D4E6; color: #3A3D4C; cursor: default; }
.tab .btn-main.big, .tab .tacts .btn-main { min-height: 52px; border-radius: 16px; font-size: 16px; }
.btn-sq { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--btn-line); background: #fff; color: var(--card-ink); display: flex; align-items: center; justify-content: center; }
.act { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--btn-line); background: #fff; color: var(--card-ink); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.tacts .act { font-size: 13px; }
.btn-sq.wa, .act.wa { background: #25D366; border-color: #25D366; color: #fff; }

/* ---------- document sheet (receive, pay, expense, dues, setup forms) ---------- */
.dhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.dtitle { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-grow: 1; }
.dtitle h2, .h2in { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; order: 1; }
.kick { font-size: 11px; color: var(--card-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; order: 2; min-width: 0; }
.h2in { font: inherit; font-size: 16px; font-weight: 600; color: var(--card-ink); background: transparent; border: 0; border-bottom: 1.5px dashed var(--btn-line); padding: 0; min-width: 0; width: 200px; flex-shrink: 1; }
.dhead .chip { padding: 4px 12px; }
.tab .dtitle { flex-direction: column; align-items: stretch; gap: 2px; }
.tab .kick { order: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.tab .dtitle h2, .tab .h2in { font-size: 24px; }
.tab .h2in { width: 420px; max-width: 100%; }
.tab .dhead .chip { font-size: 13px; }
.dbody { display: flex; gap: 24px; flex-grow: 1; min-height: 0; }
.dmain { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.dside { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.dacts { display: flex; gap: 8px; flex-shrink: 0; }
.dacts .btn-main { flex-grow: 1; }
.tab .dacts { flex-direction: column; gap: 12px; }
.dnote { font-size: 11px; color: var(--card-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.tab .dnote { font-size: 13px; white-space: normal; padding: 0 4px; }
.sec { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-shrink: 0; }
.sec b { font-size: 12px; font-weight: 600; color: var(--card-mid); }
.sec small { font-size: 11px; color: var(--card-dim); }
.tab .sec b { font-size: 13px; }
.tab .sec small { font-size: 12px; }
.say { font-size: 13px; line-height: 1.5; color: var(--card-dim); }

.cards { display: grid; gap: 8px; flex-shrink: 0; }
.cards.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tab .cards { gap: 10px; }
.card { padding: 6px 8px; border-radius: 14px; background: #fff; border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tab .card { padding: 14px 16px; }
.card > span { font-size: 11px; color: var(--card-dim); display: flex; justify-content: space-between; gap: 4px; white-space: nowrap; overflow: hidden; }
.card > span small { color: var(--pend-ink); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.tab .card > span { font-size: 12px; }
.card > b, .card input, .card select { font-size: 15px; font-weight: 700; color: var(--card-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card input, .card select { font-family: inherit; border: 0; background: transparent; padding: 0; min-width: 0; width: 100%; outline: none; }
.card input::placeholder, .h2in::placeholder, .fld::placeholder { color: #A9ABB8; font-weight: 400; }
.card input[type=file] { font-size: 11px; font-weight: 400; }
.tab .card > b, .tab .card input, .tab .card select { font-size: 20px; }
.card.wide { grid-column: span 2; }
.card .rs { display: flex; align-items: baseline; }
.card .rs input { flex: 1 1 auto; }
.card.got { border-color: var(--accent-line); }
.card.later { border-style: dashed; }
.card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.card.ok { background: var(--cash-bg); border-color: var(--cash-line); }
.card.ok > span, .card.ok input { color: var(--cash-ink); }
.card.warn { background: var(--credit-bg); border-color: var(--credit-line); }
.card.warn > span, .card.warn > b { color: var(--pend-ink); }
.c3 .card.ok .rs, .c3 .card.ok input, .c3 .card.warn > b, .c3 .card:first-child > b { font-size: 17px; }
.tab .c3 .card.ok, .tab .c3 .card.warn, .tab .c3 .card:first-child:not(label) { padding: 18px; }
.tab .c3 .card.ok .rs, .tab .c3 .card.ok input, .tab .c3 .card.warn > b, .tab .c3 .card:first-child:not(label) > b { font-size: 30px; }

.opts { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.tab .opts { gap: 8px; }
.opt { min-height: 36px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--btn-line); background: #fff; color: var(--card-ink); font-weight: 600; font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.opt small { font-weight: 400; font-size: 11px; color: var(--card-dim); }
.opt.on { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.tab .opt { min-height: 44px; padding: 0 14px; font-size: 14px; }
.fld { min-height: 36px; border-radius: 12px; border: 1px solid var(--rule); background: #fff; padding: 0 12px; font: inherit; font-size: 14px; color: var(--card-ink); min-width: 0; }
.tab .fld { min-height: 44px; }
.prow { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.prow .fld { flex: 1 1 auto; }

.lst { display: flex; flex-direction: column; padding: 2px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--rule); overflow-y: auto; min-height: 0; flex-shrink: 1; }
.tab .lst { padding: 4px 14px; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; flex-shrink: 0; }
.li + .li { border-top: 1px solid var(--rule); }
.tab .li { padding: 12px 0; }
.lt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt small { font-size: 11px; color: var(--card-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab .lt b { font-size: 15px; }
.tab .lt small { font-size: 12px; }
.lt small.okt { color: var(--cash-ink); }
.lt small.warnt { color: var(--pend-ink); }
.lv { font-size: 13px; font-weight: 700; white-space: nowrap; }
.tab .lv { font-size: 15px; }

/* dues, tablet (TabDues) */
.dtop { display: flex; gap: 16px; align-items: center; flex-shrink: 0; }
.dtop .seg { width: 420px; }
.owe { flex-grow: 1; display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; font-size: 14px; color: var(--card-dim); }
.owe b { font-size: 32px; font-weight: 700; line-height: 1; color: var(--card-ink); }
.dgrid { display: grid; grid-template-columns: minmax(0, 1fr) 100px 76px 110px; gap: 12px; align-items: center; }
.dgrid.li { display: grid; }
.dcols { padding: 0 14px; font-size: 11px; color: var(--card-dim); letter-spacing: .04em; text-transform: uppercase; }
.agebar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--rule-2); }
.agebar i, .age i { display: block; }
.age { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.age span { display: flex; align-items: center; gap: 8px; }
.age i { width: 12px; height: 12px; border-radius: 3px; }
.age b { font-weight: 600; }
.a1 { background: #B9AEF5; } .a2 { background: #E8A23A; } .a3 { background: #B4561B; }

/* ---------- home: one tile per screen ---------- */
.tiles { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(min-content, 1fr); align-content: stretch; gap: 10px; padding: 6px 0; min-height: 0; overflow-y: auto; }
.tab .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; }
.tile { border-radius: 16px; border: 1px solid var(--rule); background: #fff; color: var(--card-ink); padding: 12px; text-align: left;
  display: flex; flex-direction: column; gap: 4px; justify-content: center; min-height: 72px; }
.tab .tile { padding: 18px; gap: 6px; }
.tile:hover { border-color: var(--accent-line); }
.tile .ti { width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.tile b { font-size: 14px; font-weight: 600; }
.tab .tile b { font-size: 16px; }
.tile small { font-size: 11px; color: var(--card-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab .tile small { font-size: 13px; }
.empty.small { margin: 0; padding: 4px 0 0; font-size: 12px; }

/* ---------- voice panel ---------- */
.voice { width: 232px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.tab .voice { width: 320px; gap: 0; }
.voice .title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.voice .title > span:first-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.voice .title b { font-size: 13px; font-weight: 600; }
.voice .title small { font-size: 11px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbtns { display: flex; gap: 6px; flex-shrink: 0; }
.round.small { width: 36px; height: 36px; border-radius: 18px; flex-shrink: 0; }
.talk { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; min-height: 0; }
.tab .talk { gap: 12px; }
.said { align-self: flex-end; max-width: 92%; padding: 6px 10px; border-radius: 12px 12px 4px 12px; background: var(--bubble); font-size: 13px; line-height: 1.35; }
.said.old { background: var(--bubble-old); color: var(--ink-dim); font-size: 12px; padding: 5px 10px; }
.said small { display: block; color: var(--ink-mono); font-family: var(--mono); font-size: 10px; margin-top: 2px; }
.tab .said { max-width: 250px; padding: 8px 12px; border-radius: 16px 16px 4px 16px; font-size: 15px; line-height: 1.4; }
.tab .said.old { font-size: 14px; }
.reply { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; }
.tab .reply { font-size: 15px; line-height: 1.45; }
.reply.old { color: var(--ink-dim); font-size: 12px; padding-left: 30px; }
.tab .reply.old { font-size: 14px; padding-left: 36px; }
.reply.old .orb { display: none; }
.pick { min-height: 52px; padding: 6px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-line); color: var(--ink);
  display: flex; gap: 10px; align-items: center; text-align: left; }
.pick.first { background: var(--bubble-old); border: 2px solid var(--violet); }
.pick:hover { border-color: #B9A8FF; }
.pick .n { width: 28px; height: 28px; border-radius: 14px; background: var(--panel-line); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.pick.first .n { background: var(--violet); color: #fff; }
.pick span { display: flex; flex-direction: column; }
.pick b { font-size: 13px; }
.pick small { font-size: 11px; color: var(--ink-dim); }
.vfoot { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.tab .vfoot { gap: 12px; padding-top: 16px; }
.hint { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--ink-dim); min-height: 18px; }
.tab .hint { gap: 8px; font-size: 12px; }
.typebox { display: flex; gap: 6px; margin-top: 8px; }
.typebox input { flex: 1; min-width: 0; min-height: 40px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--panel); color: var(--ink); padding: 0 10px; font: inherit; font-size: 13px; }
.controls { display: flex; align-items: center; justify-content: space-between; }
.round { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--panel-line); background: var(--panel); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.tab .controls > .round { width: 48px; height: 48px; border-radius: 24px; }
.mic-wrap { position: relative; width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; }
.tab .mic-wrap { width: 80px; height: 80px; }
.mic-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #7C5CFF, #FF4FA3, #FFB547, #22D3EE, #7C5CFF); animation: spin 4s linear infinite; }
.recording .mic-ring { animation-duration: 1s; }
.busy .mic-ring { opacity: .45; }
.mic { position: relative; width: 60px; height: 60px; border-radius: 30px; border: 0; background: var(--ground); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.tab .mic { width: 70px; height: 70px; border-radius: 35px; }
.recording .mic { background: #3B1530; }
@keyframes spin { to { transform: rotate(360deg); } }

.orb { position: relative; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
.tab .reply .orb { width: 28px; height: 28px; }
.orb i { position: absolute; inset: 8%; border-radius: 50%; mix-blend-mode: screen; filter: blur(4px); opacity: .92; }
.orb i:nth-child(1) { background: #7C5CFF; animation: o1 7s ease-in-out infinite; }
.orb i:nth-child(2) { background: #FF4FA3; animation: o2 6s ease-in-out infinite; }
.orb i:nth-child(3) { background: #22D3EE; animation: o3 8s ease-in-out infinite; }
.orb i:nth-child(4) { background: #FFB547; inset: 24%; animation: o4 5s ease-in-out infinite; }
@keyframes o1 { 0%, 100% { transform: translate(-10%, -6%) scale(1); } 50% { transform: translate(8%, 6%) scale(1.12); } }
@keyframes o2 { 0%, 100% { transform: translate(10%, -4%) scale(.95); } 50% { transform: translate(-6%, 10%) scale(1.1); } }
@keyframes o3 { 0%, 100% { transform: translate(0, 12%) scale(1.05); } 50% { transform: translate(-10%, -8%) scale(.9); } }
@keyframes o4 { 0%, 100% { transform: scale(.8); } 50% { transform: scale(1.25); } }
.wave { display: flex; align-items: center; gap: 3px; height: 18px; }
.wave span { display: block; width: 3px; height: 100%; border-radius: 2px; background: linear-gradient(#22D3EE, #7C5CFF, #FF4FA3); animation: eq 1.1s ease-in-out infinite; }
.wave span:nth-child(2) { animation-delay: .15s; } .wave span:nth-child(3) { animation-delay: .3s; }
.wave span:nth-child(4) { animation-delay: .45s; } .wave span:nth-child(5) { animation-delay: .2s; }
.wave.still span { animation: none; transform: scaleY(.25); }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ---------- sign in ---------- */
.login { margin: auto; width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 20px; background: var(--panel); border: 1px solid var(--panel-line); }
.login h1 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-dim); }
.login input, .login select { min-height: 44px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--ground); color: var(--ink); padding: 0 10px; font: inherit; font-size: 15px; }
.login .err { color: #FF8FB8; font-size: 13px; min-height: 18px; }
.login .link { border: 0; background: none; color: var(--violet); font-size: 13px; font-weight: 600; padding: 6px 0; }
.login .hint { margin: 0; font-size: 13px; color: var(--ink-dim); }
.login.signup { width: min(420px, 100%); max-height: 100%; overflow-y: auto; }
.login .types { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.login .types-head { grid-column: 1 / -1; font-size: 12px; color: var(--ink-dim); }
.login .type { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--ground); color: var(--ink); font: inherit; text-align: left; }
.login .type b { font-size: 14px; }
.login .type small { font-size: 11px; color: var(--ink-dim); }
.login .type.on { border-color: var(--violet); box-shadow: 0 0 0 2px var(--violet) inset; }
.login .test-code { margin: 0; padding: 10px 12px; border-radius: 12px; background: #FFE066; color: #1D1B18; border: 2px solid #E0B400; font-size: 14px; font-weight: 600; }
.login .test-code b { font-size: 18px; letter-spacing: 2px; }

/* ---------- read-only lists: Products, Bills ---------- */
.lcount { margin: 0 0 6px; font-size: 12px; color: var(--card-dim); flex-shrink: 0; }

/* phone on its side: icon beside the text, so all tiles and their sample lines fit one screen */
@media (max-height: 500px) {
  .tile { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; row-gap: 1px; align-items: center; align-content: center; min-height: 0; padding: 4px 10px; border-radius: 12px; }
  .tile .ti { grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 9px; }
  .tile .ti svg { width: 18px; height: 18px; }
  .tile small { line-height: 1.25; }
  .tile b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tiles { gap: 6px; padding: 4px 0; }
  .empty.small { flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .login.signup { width: min(780px, 100%); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; padding: 12px 18px; }
  .login.signup > :not(label) { grid-column: 1 / -1; }
  .login.signup input, .login.signup select { min-height: 38px; }
  .login.signup .link { padding: 2px 0; }
}
/* phone upright: sheet on top, voice below; icon stays on top of the tile, smaller */
@media (orientation: portrait) and (max-width: 700px) {
  #app { flex-direction: column; }
  .voice { width: auto; flex: 0 0 auto; max-height: 46dvh; }
  .talk { min-height: 90px; }
  .cards.c4, .cards.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .row { grid-template-columns: minmax(0, 1fr) 48px 56px 34px 64px; gap: 6px; }
  .tile { min-height: 0; padding: 8px 10px; gap: 2px; border-radius: 14px; }
  .tile .ti { width: 28px; height: 28px; border-radius: 9px; }
  .tile .ti svg { width: 18px; height: 18px; }
  .tiles { gap: 8px; padding: 4px 0; }
}
