:root {
  --paper: #f3f7ff;
  --paper-2: #e6efff;
  --card: #ffffff;
  --ink: #0f1b33;
  --ink-2: #4a5878;
  --ink-3: #8592ad;
  --line: #d6e1f5;
  --accent: #1f5fe0;
  --accent-ink: #ffffff;
  --accent-soft: #dbe7ff;
  --tag: #f5c518;
  --tag-ink: #231c05;
  --ok: #1f8a4c;
  --bad: #d92d20;
  --shadow: 0 1px 0 rgba(15, 40, 100, .05), 0 12px 30px -18px rgba(15, 40, 100, .35);
  --radius: 18px;
  --display: "Fredoka", "Onest", system-ui, sans-serif;
  --body: "Onest", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1220; --paper-2: #111a2e; --card: #131d33; --ink: #eaf0ff; --ink-2: #aab6d3; --ink-3: #7383a6;
    --line: #24324f; --accent: #4d8bff; --accent-ink: #06102a; --accent-soft: #16264a; --tag: #f5c518;
    --shadow: 0 12px 30px -18px rgba(0, 0, 0, .8); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b1220; --paper-2: #111a2e; --card: #131d33; --ink: #eaf0ff; --ink-2: #aab6d3; --ink-3: #7383a6;
    --line: #24324f; --accent: #4d8bff; --accent-ink: #06102a; --accent-soft: #16264a; --tag: #f5c518;
    --shadow: 0 12px 30px -18px rgba(0, 0, 0, .8); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -10%, var(--accent-soft), transparent 60%),
    var(--paper);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
/* grão de papel */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.1 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── topo ── */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 2px var(--card), 0 4px 14px -6px rgba(31, 95, 224, .6); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--accent); line-height: 1; display: flex; flex-direction: column; }
.brand-name em { font-family: var(--body); font-style: normal; font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.brand-name em img { height: 11px; width: auto; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.stores-pill { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.stores-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
@media (max-width: 560px) { .stores-pill { display: none; } }

.ghost-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: 14px;
  transition: border-color .2s, transform .2s;
}
.ghost-btn:hover { border-color: var(--ink-3); }
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--ink); color: var(--paper); border-radius: 999px; padding: 12px 20px; font-weight: 600; text-decoration: none;
  transition: transform .15s;
}
.primary-btn:hover { transform: translateY(-1px); }

/* ── chat ── */
.chat { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 24px 16px 180px; }

.welcome { padding: clamp(24px, 8vh, 90px) 0 20px; animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 14px; }
.welcome h1 { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 8vw, 76px); line-height: .98; margin: 0; letter-spacing: -.01em; }
.welcome h1 span { color: var(--accent); font-style: italic; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 480px; line-height: 1.5; margin: 18px 0 28px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 10px; }
.suggestions button {
  border: 1px dashed var(--ink-3); background: transparent; border-radius: 12px; padding: 10px 14px; font-size: 15px; color: var(--ink);
  transition: background .2s, border-color .2s, transform .2s; animation: rise .6s both;
}
.suggestions button:nth-child(2) { animation-delay: .06s; } .suggestions button:nth-child(3) { animation-delay: .12s; } .suggestions button:nth-child(4) { animation-delay: .18s; }
.suggestions button:hover { background: var(--card); border-style: solid; transform: translateY(-2px) rotate(-.4deg); }
.stalls { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 36px; font-size: 13px; color: var(--ink-3); }
.stalls strong { color: var(--ink-2); font-weight: 600; margin-right: 4px; }
.stalls span.off { text-decoration: line-through; }

.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.msg { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.msg-user { align-self: flex-end; max-width: min(78%, 560px); }
.msg-user .bubble { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 18px 18px 4px 18px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-bot { display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.msg-bot .avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--card); }
.msg-bot .content { min-width: 0; }
.steps { list-style: none; margin: 4px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.step { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.step::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.step.done::before { border: none; animation: none; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.prose { line-height: 1.6; font-size: 16px; overflow-wrap: anywhere; }
.prose p { margin: 0 0 10px; } .prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 20px; }
.prose strong { font-weight: 650; }
.prose code { background: var(--paper-2); border-radius: 6px; padding: 1px 5px; font-size: .92em; }
.prose a { color: var(--accent); }
.prose h3, .prose h4, .prose h5, .prose h6 { font-family: var(--display); font-weight: 600; line-height: 1.25; margin: 14px 0 8px; color: var(--ink); }
.prose h3 { font-size: 20px; } .prose h4 { font-size: 17.5px; } .prose h5, .prose h6 { font-size: 16px; }
.prose > :first-child { margin-top: 0; }
.prose li { margin: 3px 0; } .prose li::marker { color: var(--accent); font-weight: 600; }
.prose blockquote { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.prose del { opacity: .6; }
.md-table { margin: 4px 0 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.md-table table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 14.5px; line-height: 1.4; }
.md-table th { background: var(--accent); color: var(--accent-ink); font-weight: 600; text-align: left; padding: 9px 12px; white-space: nowrap; }
.md-table td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: normal; word-break: normal; max-width: 240px; }
.md-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--paper) 70%, var(--card)); }
.md-table .al-right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.md-table .al-center { text-align: center; }
.msg-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.msg-tools .listen-btn { margin-top: 0; }
.pdf-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 10px; box-shadow: var(--shadow); max-width: 420px; }
.pdf-card .pdf-icon { flex: none; width: 38px; height: 46px; border-radius: 6px; background: var(--bad); color: #fff; font: 700 11px/46px var(--body); text-align: center; letter-spacing: .5px; }
.pdf-card .pdf-info { flex: 1; min-width: 0; }
.pdf-card .pdf-info strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }
.pdf-card .pdf-info span { font-size: 13px; color: var(--ink-3); }
.error-note { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 8px; }

/* ── carrossel de produtos ── */
.reminder-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 10px; box-shadow: var(--shadow); max-width: 420px; }
.reminder-card.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.reminder-card.off { opacity: .75; }
.reminder-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0 0 4px; }
.reminder-text { margin: 0 0 10px; }
.reminder-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reminder-actions .primary-btn { border: 0; padding: 9px 16px; }
.reminder-result { margin: 0; font-size: 14px; color: var(--ink-2); }
.reminder-card.ok .reminder-result { color: var(--ok); }
.shelf-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 8px; font-weight: 600; }
.shelf {
  list-style: none; margin: 0 -16px; padding: 6px 16px 18px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 220px);
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; overscroll-behavior-x: contain;
}
.card {
  scroll-snap-align: start; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: rise .5s both;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .2s;
}
.card:hover { transform: translateY(-4px) rotate(-.3deg); border-color: var(--ink-3); }
.card-hit { all: unset; cursor: pointer; display: flex; flex-direction: column; flex: 1; position: relative; }
.card-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.card-img { position: relative; aspect-ratio: 1; background: #fff; display: grid; place-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.card-img img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card-img.empty::before { content: "sem imagem"; color: var(--ink-3); font-size: 13px; }
.card-body { padding: 26px 14px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { margin: 0; font-size: 14.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin: auto 0 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.card-store { font-weight: 600; color: var(--ink-2); }
.card-link { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 0 14px 14px; }
.card-link:hover { text-decoration: underline; }

/* etiqueta de preço — cartão pendurado com furo */
.tag {
  --h: 30px;
  position: relative; display: inline-flex; align-items: center; height: var(--h); padding: 0 12px 0 20px;
  background: var(--tag); color: var(--tag-ink); font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
  font-variant-numeric: tabular-nums;
}
.tag::before { content: ""; position: absolute; left: 8px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.tag small { font-weight: 600; font-size: .72em; margin-left: 4px; opacity: .75; }
.card .tag { position: absolute; z-index: 1; left: 10px; bottom: -15px; transform: rotate(-3deg); box-shadow: 0 6px 12px -6px rgba(0,0,0,.35); }
.tag.none { background: var(--paper-2); color: var(--ink-2); font-weight: 500; font-size: 13px; }
.card .sold { position: absolute; top: 10px; right: 10px; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; }

/* ── compositor ── */
.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 18px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 62%, transparent);
}
.composer-box {
  max-width: 820px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 22px; padding: 8px 8px 8px 18px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.composer-box:focus-within { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--accent); }
.composer textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; font-size: 16px; line-height: 1.5; padding: 8px 0; max-height: 160px; }
.composer textarea::placeholder { color: var(--ink-3); }
.mic { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); display: grid; place-items: center; flex: none; transition: background .2s, color .2s; }
.mic:hover { color: var(--ink); border-color: var(--ink-3); }
.mic.rec { background: var(--bad); border-color: var(--bad); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.mic.busy { opacity: .5; cursor: progress; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 25%, transparent); } }
.voice-note { margin: 6px 4px 0; font-size: 13px; color: var(--ink-2); }
.listen-btn { margin-top: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--ink-2); }
.listen-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.call-panel { position: fixed; left: 50%; transform: translateX(-50%); bottom: 112px; z-index: 30; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 10px 10px 10px 18px; box-shadow: var(--shadow); width: min(520px, calc(100% - 32px)); }
.call-panel[hidden] { display: none; }
.call-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 35%, transparent); flex: none; }
.call-info { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 14px; }
.call-info span { opacity: .75; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-timer { font-variant-numeric: tabular-nums; font-size: 13px; opacity: .8; }
.call-end { border: 0; border-radius: 999px; background: var(--bad); color: #fff; padding: 9px 16px; font-weight: 600; }
.send { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: transform .15s, opacity .2s; }
.send:hover { transform: rotate(-8deg); }
.send.stop { background: var(--ink); color: var(--paper); }
.send.stop svg { display: none; }
.send.stop::after { content: ""; width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
.fineprint { text-align: center; font-size: 12px; color: var(--ink-3); margin: 10px 0 0; }

/* ── painel de detalhe ── */
.drawer { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(20, 14, 6, .45); opacity: 0; transition: opacity .3s; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--paper); overflow-y: auto;
  transform: translateX(104%); transition: transform .4s cubic-bezier(.2, .8, .2, 1); box-shadow: -20px 0 60px -30px rgba(0,0,0,.5);
}
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; }
.gallery-main { background: #fff; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; display: grid; place-items: center; padding: 28px; border-bottom: 1px solid var(--line); }
.gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; padding: 12px 20px 0; overflow-x: auto; }
.gallery-thumbs button { flex: none; width: 58px; height: 58px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; padding: 4px; }
.gallery-thumbs button[aria-current="true"] { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.drawer-body { padding: 20px 24px 36px; }
.d-store { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.drawer-body h2 { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.15; margin: 0 0 16px; }
.d-price { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.tag-lg { --h: 40px; font-size: 20px; padding: 0 16px 0 24px; }
.d-price s { color: var(--ink-3); }
.stock { font-size: 13px; font-weight: 600; }
.stock.in { color: var(--ok); } .stock.out { color: var(--bad); }
.d-desc { color: var(--ink-2); line-height: 1.6; white-space: pre-line; margin: 0 0 22px; }
.d-desc.loading { color: var(--ink-3); font-style: italic; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ── conta, pagamento e compras (via BayqiWallet-WebAPI) ── */
.wallet-pill { font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); white-space: nowrap; }
.login { position: relative; z-index: 1; flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: min(420px, 100%); display: grid; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); }
.login-card h1 { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0; }
.login-card h1 span { color: var(--accent); }
.login-card .lede, .login-card .eyebrow { margin: 0; }
.login-card label, .co-fields label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.login-card input, .co-fields input, .co-lines input {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%;
}
.login-card .primary-btn, .sheet .primary-btn { justify-content: center; border: 0; }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.sheet { border: 0; padding: 0; background: transparent; width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); color: var(--ink); }
.sheet::backdrop { background: rgba(20, 14, 6, .45); }
.sheet-body { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.sheet-body h2 { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.2; margin: 0; padding-right: 40px; }
.sheet .d-store { margin: 0; }
.co-status { font-size: 14px; color: var(--ink-2); }
.co-lines { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; align-items: center; }
.co-lines dt { color: var(--ink-2); font-size: 14px; }
.co-lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.co-lines input { width: 80px; padding: 6px 8px; text-align: right; }
.co-lines .total { font-weight: 700; font-size: 17px; color: var(--ink); border-top: 1px solid var(--line); padding-top: 8px; }
.co-note { margin: 0; font-size: 13px; color: var(--ink-2); }
.co-fields { display: grid; gap: 12px; }
.co-done { text-align: center; display: grid; gap: 8px; }
.co-done strong { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--ok); }
.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 60dvh; overflow: auto; }
.orders li { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; font-size: 14px; }
.orders .o-head { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 12px; }
.orders .o-title { font-weight: 600; }
.orders .o-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.orders .o-status { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--paper-2); }
.orders .o-status.Cancelled { color: var(--bad); }
.orders .o-status.Delivered { color: var(--ok); }
.orders .ghost-btn { padding: 5px 10px; font-size: 13px; }
.orders .empty { color: var(--ink-3); border: 0; padding: 0; }
.gone { display: none !important; }
@media (max-width: 560px) {
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .topbar-actions .stores-pill { display: none; }
  .topbar-actions .ghost-btn { padding: 6px 10px; font-size: 13px; }
}

.welcome-qia { display: block; width: 132px; height: 132px; border-radius: 32px; object-fit: cover; margin-bottom: 18px; box-shadow: 0 18px 40px -20px rgba(31, 95, 224, .7); animation: wave 2.6s ease-in-out infinite; }
@keyframes wave { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-6px); } }
.call-face { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.qia-face { transition: transform .08s linear, box-shadow .12s; }
.qia-face.talking { animation: none; transform: scale(calc(1 + var(--talk, 0) * .16)) rotate(calc(var(--talk, 0) * -5deg)); box-shadow: 0 0 0 calc(var(--talk, 0) * 9px) color-mix(in srgb, var(--accent) 35%, transparent); }
@media (prefers-reduced-motion: reduce) { .welcome-qia { animation: none; } .qia-face.talking { transform: none; } }
.wallet-lines { margin: 0 0 10px; padding-left: 18px; font-size: 14px; color: var(--ink-2); }

.in-app body { min-height: 100dvh; }
.in-app .topbar { position: sticky; top: 0; z-index: 20; padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.in-app .brand-name em, .in-app .stores-pill, .in-app #logoutBtn, .in-app .fineprint, .in-app .stalls { display: none !important; }
.in-app .topbar-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
.in-app .topbar-actions::-webkit-scrollbar { display: none; }
.in-app .topbar-actions .ghost-btn { padding: 7px 12px; font-size: 13.5px; white-space: nowrap; min-height: 36px; }
.in-app .composer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.in-app .welcome h1 { font-size: clamp(30px, 8vw, 44px); }
.in-app .welcome-qia { width: 104px; height: 104px; }
.in-app .call-panel { bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (max-width: 480px) {
  .md-table table { font-size: 13.5px; }
  .md-table th, .md-table td { padding: 7px 10px; }
  .pdf-card { flex-wrap: wrap; }
  .pdf-card .primary-btn { width: 100%; }
}

.suspend-banner{margin:0 auto 10px;max-width:820px;padding:10px 14px;border-radius:12px;background:#fef3f2;border:1px solid #fecdca;color:#7a271a;font-size:14px;font-weight:600;text-align:center}
.pay-ref{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:10px 0 0;padding:10px 12px;border-radius:10px;background:var(--soft, #f3f7ff);font-size:14px}
.pay-ref dt{color:#4a5878}
.pay-ref dd{margin:0;font-weight:700;font-variant-numeric:tabular-nums;word-break:break-all}
