/* BillTap — "phone on its side" from the Aroh Voice Assistant design: bill card left, voice panel right. */
:root {
  --ground: #0A0B14; --ground-2: #1A1640; --ink: #F2F1EC; --ink-dim: #A3A6BF;
  --card: #F7F5EF; --card-ink: #17181F; --card-dim: #5B5E6E; --rule: #E4E1D8; --rule-2: #ECE9E1;
  --accent: #5A3FE0; --accent-soft: #EEE9FF; --accent-line: #6B4EFF; --violet: #7C5CFF;
  --pend: #FFF8EC; --pend-line: #F2B84B; --pend-ink: #7A4B00;
  --cash-bg: #E3F4EA; --cash-ink: #0E5E33; --credit-bg: #FFF4E0;
  --panel: #151726; --panel-line: #2A2D44; --bubble: #2E3160; --bubble-old: #232640;
  --font: 'Sora', 'Noto Sans Devanagari', system-ui, sans-serif;
}
* { 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; }

#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; }

/* ---------- bill card ---------- */
.bill { 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; }
.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; }
.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; }
.chip.credit { background: var(--credit-bg); color: var(--pend-ink); }
.cols, .row { display: grid; grid-template-columns: minmax(0, 1fr) 60px 64px 40px 76px; 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; }
.row .name { display: flex; flex-direction: column; min-width: 0; }
.row .name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .name small { font-size: 11px; color: var(--card-dim); }
.row .qty, .row .amt { font-weight: 600; }
.row .amt { font-weight: 700; }
.row .gst { font-size: 12px; color: var(--card-dim); }
.row.last { margin: 2px -8px 0; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); border: 2px solid var(--accent-line); }
.row.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; }
.row.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; }
.bill-foot .note { font-size: 11px; color: var(--pend-ink); }
.btn-main { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.btn-main:disabled { background: #D8D4E6; color: #3A3D4C; cursor: default; }
.btn-sq { width: 44px; height: 44px; border-radius: 12px; border: 1px solid #D8D4E6; background: #fff; color: var(--card-ink); display: flex; align-items: center; justify-content: center; }

/* ---------- voice panel ---------- */
.voice { width: 248px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.voice .title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.voice .title > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.round.small { width: 36px; height: 36px; border-radius: 18px; flex-shrink: 0; }
.voice .title b { font-size: 13px; font-weight: 600; }
.voice .title small { font-size: 11px; color: var(--ink-dim); }
.talk { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; min-height: 0; }
.said { align-self: flex-end; max-width: 92%; padding: 6px 10px; border-radius: 12px 12px 4px 12px; background: var(--bubble); font-size: 13px; }
.said.old { background: var(--bubble-old); color: var(--ink-dim); font-size: 12px; }
.said small { display: block; color: var(--ink-dim); font-size: 10px; margin-top: 2px; }
.reply { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; }
.reply.old { color: var(--ink-dim); font-size: 12px; padding-left: 30px; }
.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); }
.hint { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--ink-dim); min-height: 18px; }
.typebox { display: flex; gap: 6px; }
.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; }
.mic-wrap { position: relative; width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; }
.mic-ring { position: absolute; inset: 0; border-radius: 34px; 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; }
.recording .mic { background: #3B1530; }
@keyframes spin { to { transform: rotate(360deg); } }

.orb { position: relative; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
.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 { min-height: 44px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--ground); color: var(--ink); padding: 0 12px; font: inherit; font-size: 15px; }
.login .err { color: #FF8FB8; font-size: 13px; min-height: 18px; }

/* portrait phone: bill on top, voice below */
@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; }
}
@media (min-width: 1000px) {
  .voice { width: 320px; }
  .cols, .row { grid-template-columns: minmax(0, 1fr) 80px 84px 52px 96px; }
  .row { font-size: 14px; min-height: 44px; }
}
