/* zeu design system — shared by the Customer, Shopkeeper and Admin websites. */
:root {
  --navy-50: #F2F3FB; --navy-100: #E6E8F7; --navy-200: #C9CDEF; --navy-400: #5A64C8;
  --navy: #0B1470; --navy-600: #121C88; --navy-800: #070D52; --navy-900: #050940;
  --ink: #0F1222; --ink-2: #2B2F42; --muted: #646A80; --muted-2: #8A8FA3; --line: #E4E6EE; --line-2: #EEF0F5;
  --surface: #FFFFFF; --canvas: #F6F7FB; --canvas-2: #FAFBFD;
  --green: #12805C; --green-bg: #E7F6EF; --green-dot: #2BB673;
  --amber: #8A5300; --amber-bg: #FFF3DC;
  --red: #C0352B; --red-bg: #FDECEA;
  --blue: #1F5FD1; --blue-bg: #E8F0FE;
  --r-xs: 8px; --r-sm: 12px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
  --sh-1: 0 1px 2px rgba(15,18,34,.06), 0 1px 1px rgba(15,18,34,.04);
  --sh-2: 0 8px 24px -12px rgba(11,20,112,.22), 0 2px 6px -2px rgba(15,18,34,.06);
  --sh-3: 0 24px 60px -20px rgba(7,13,82,.35);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Inter Tight", "DM Sans", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; } /* nothing may widen the page sideways (it shifts the fixed tab bar in the app) */
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -0.03em; line-height: 1.1; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--navy-400); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--navy-200); }

.mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 19px; transform: rotate(-4deg); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--navy); letter-spacing: -0.045em; }
.brand-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); background: var(--navy-100); border-radius: 6px; padding: 3px 7px; }
.brand.on-dark .brand-mark { background: #fff; color: var(--navy); }
.brand.on-dark .brand-name { color: #fff; }
.brand.on-dark .brand-tag { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- Buttons ---------- */
.btn { --h: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: background .15s var(--ease), border-color .15s, color .15s, box-shadow .15s, transform .08s; position: relative; user-select: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, var(--sh-1); }
.btn-primary:hover:not(:disabled) { background: var(--navy-600); }
.btn-secondary { background: var(--navy-50); color: var(--navy); }
.btn-secondary:hover:not(:disabled) { background: var(--navy-100); }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink-2); box-shadow: var(--sh-1); }
.btn-outline:hover:not(:disabled) { border-color: var(--navy-200); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--navy-50); color: var(--navy); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #A82B22; }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: var(--line); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-bg); border-color: #F3C9C4; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { background: #0E6B4D; }
.btn-sm { --h: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { --h: 52px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn-xl { --h: 60px; padding: 0 26px; font-size: 17px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent transparent; animation: spin .7s linear infinite; }
.btn-outline.is-loading::after, .btn-secondary.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--navy) var(--navy) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted-2); font-weight: 400; }
.input, .select, .textarea { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); transition: border-color .15s, box-shadow .15s; outline: none; font-size: 15px; }
.textarea { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.input::placeholder { color: var(--muted-2); }
.input:hover, .select:hover { border-color: #D3D6E2; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--navy-400); box-shadow: 0 0 0 4px rgba(90,100,200,.14); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23646A80' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-2); pointer-events: none; }
.input-icon > .input { padding-left: 42px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: var(--red); background: var(--red-bg); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); margin: 2px 0 0; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: #CDD0DC; transition: background .2s var(--ease); position: relative; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--green-dot); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--navy-400); outline-offset: 2px; }

/* ---------- Badges, chips, segmented ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--navy-50); color: var(--navy); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.gray { background: var(--line-2); color: var(--muted); }
.badge.lg { height: 30px; padding: 0 12px; font-size: 13.5px; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: var(--navy-50); color: var(--navy); padding: 4px 8px; border-radius: 6px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--muted); transition: all .15s var(--ease); }
.chip:hover { border-color: var(--navy-200); color: var(--navy); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .n { opacity: .6; margin-left: 4px; font-weight: 500; }

.seg { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 12px; gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border: 0; background: transparent; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 16px; letter-spacing: -0.015em; }
.card-body { padding: 22px; }
.divider { height: 1px; background: var(--line-2); border: 0; margin: 20px 0; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--navy-50); color: var(--navy-800); font-size: 14px; }
.banner svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.banner.warn { background: var(--amber-bg); color: #6B4100; }
.banner.danger { background: var(--red-bg); color: #8E2219; }
.banner.success { background: var(--green-bg); color: #0B5E43; }
.banner b { font-weight: 700; }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-100); color: var(--navy); font-weight: 700; font-size: 13.5px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.sq { border-radius: 12px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stat-label { color: var(--muted); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.stat-label svg { width: 16px; height: 16px; color: var(--muted-2); }
.stat-value { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.035em; color: var(--navy-800); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted-2); font-size: 12.5px; }
a.stat:hover { border-color: var(--navy-200); box-shadow: var(--sh-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: inherit; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); padding: 12px 16px; background: var(--canvas-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--canvas-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .cell-main { font-weight: 600; color: var(--ink); }
.table .cell-sub { font-size: 12.5px; color: var(--muted-2); }

/* ---------- Empty / skeleton ---------- */
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--navy-50); color: var(--navy); display: grid; place-items: center; margin-bottom: 6px; }
.empty-icon svg { width: 32px; height: 32px; }
.empty h3 { font-size: 22px; }
.empty p { color: var(--muted); max-width: 380px; }
.empty .btn { margin-top: 10px; }
.skel { background: linear-gradient(90deg, var(--line-2) 0%, #F7F8FB 50%, var(--line-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 500; font-size: 14.5px; box-shadow: var(--sh-3); animation: toast-in .25s var(--ease); pointer-events: auto; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success svg { color: #6EE7B7; }
.toast.error { background: #3A0E0B; }
.toast.error svg { color: #FCA5A5; }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: all .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-xl); width: min(520px, calc(100% - 24px)); max-height: calc(100% - 32px); box-shadow: var(--sh-3); color: var(--ink); background: var(--surface); }
dialog.modal::backdrop { background: rgba(5,9,64,.42); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { padding: 24px 24px 0; }
.modal-head h3 { font-size: 22px; }
.modal-head p { color: var(--muted); margin-top: 6px; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 0 24px 24px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; isolation: isolate; }
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); z-index: -1; }
.auth-hero::before { width: 720px; height: 720px; right: -300px; top: -280px; background: rgba(255,255,255,.035); }
.auth-hero::after { width: 520px; height: 520px; right: -200px; top: -160px; background: rgba(255,255,255,.03); }
.auth-hero .grid-bg { position: absolute; inset: 0; z-index: -2; opacity: .5; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.auth-hero-body { margin: auto 0; max-width: 560px; padding: 40px 0; }
.auth-hero .eyebrow { color: rgba(255,255,255,.66); margin-bottom: 18px; }
.auth-hero h1 { font-size: clamp(36px, 4.4vw, 58px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; }
.auth-hero .lead { color: rgba(255,255,255,.78); font-size: 17.5px; margin-top: 18px; max-width: 480px; line-height: 1.6; }
.auth-points { display: grid; gap: 14px; margin-top: 34px; }
.auth-point { display: flex; gap: 14px; align-items: flex-start; }
.auth-point .ic { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.1); display: grid; place-items: center; flex-shrink: 0; }
.auth-point .ic svg { width: 19px; height: 19px; }
.auth-point b { display: block; font-weight: 600; }
.auth-point span { color: rgba(255,255,255,.66); font-size: 14px; }
.auth-foot { color: rgba(255,255,255,.5); font-size: 13px; display: flex; gap: 18px; flex-wrap: wrap; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 30px; letter-spacing: -0.035em; }
.auth-card .sub { color: var(--muted); margin-top: 8px; font-size: 15.5px; }
.auth-card .stack { gap: 14px; margin-top: 28px; }
.g-btn-slot { min-height: 44px; display: flex; justify-content: center; }
.g-fallback { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 46px; border-radius: 999px; border: 1px solid #DADCE0; background: #fff; font-weight: 600; color: #3C4043; font-size: 15px; }
.g-fallback:disabled { opacity: 1; cursor: not-allowed; color: #9AA0A6; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.legal { font-size: 12.5px; color: var(--muted-2); line-height: 1.55; margin-top: 22px; }

/* ---------- App shell (shopkeeper + admin) ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar .brand { padding: 4px 8px 18px; }
.sb-section { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); padding: 14px 10px 6px; }
.sb-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; transition: background .12s; }
.sb-item svg { width: 19px; height: 19px; color: var(--muted-2); flex-shrink: 0; }
.sb-item:hover { background: var(--canvas); }
.sb-item.active { background: var(--navy-50); color: var(--navy); font-weight: 600; }
.sb-item.active svg { color: var(--navy); }
.sb-item .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.sb-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.sb-user .who { min-width: 0; flex: 1; }
.sb-user b { display: block; font-size: 14px; font-weight: 600; }
.sb-user small { display: block; font-size: 12px; color: var(--muted-2); }
.store-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--canvas-2); }
.store-card b { font-size: 14px; display: block; }
.store-card small { color: var(--muted-2); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.main-top { position: sticky; top: 0; z-index: 10; display: none; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); min-height: 60px; }
.page { padding: 32px 36px 64px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; letter-spacing: -0.04em; }
.page-head p { color: var(--muted); margin-top: 6px; }
.page-head .eyebrow { margin-bottom: 8px; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 20px; letter-spacing: -0.025em; }
.section-head .meta { color: var(--muted-2); font-size: 13.5px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 13.5px; margin-bottom: 12px; }
.crumbs a:hover { color: var(--navy); }

.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 10px; font-size: 11.5px; font-weight: 600; color: var(--muted-2); position: relative; min-width: 64px; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--navy); }
.tabbar .count { position: absolute; top: 2px; right: 14px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; }

/* ---------- Orders ---------- */
.order { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.order + .order { margin-top: 12px; }
.order.new { border-color: var(--navy-200); box-shadow: 0 0 0 4px var(--navy-50); }
.order-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.order-id { font-family: var(--mono); font-size: 13.5px; color: var(--muted); letter-spacing: .04em; }
.order-meta { font-size: 13px; color: var(--muted-2); margin-top: 2px; }
.item-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 15px; color: var(--ink-2); }
.item-row .r { font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.order-foot { border-top: 1px solid var(--line-2); margin-top: 14px; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.order-total { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tracker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 2px 0 16px; }
.tracker .s { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted-2); font-weight: 600; }
.tracker .s::before { content: ""; height: 5px; border-radius: 999px; background: var(--line-2); }
.tracker .s.on { color: var(--navy); }
.tracker .s.on::before { background: var(--navy); }
.tracker .s.now::before { background: linear-gradient(90deg, var(--navy) 50%, var(--navy-200) 50%); background-size: 200% 100%; animation: tracker 1.6s linear infinite; }
@keyframes tracker { to { background-position: -200% 0; } }
.code-box { display: inline-flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--canvas); border: 1px dashed #C9CDE0; }
.code-box b { font-family: var(--mono); font-size: 22px; letter-spacing: .28em; color: var(--navy); }
.code-input { width: 110px; letter-spacing: .3em; font-family: var(--mono); text-align: center; font-size: 17px; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar { width: 100%; max-width: 30px; background: var(--navy); border-radius: 6px 6px 3px 3px; min-height: 3px; transition: height .4s var(--ease); position: relative; }
.bars .bar.zero { background: var(--line); }
.bars .b:hover .bar { background: var(--navy-600); }
.bars .lbl { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.bars .b .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 2; display: none; }
.bars .b:hover .tip { display: block; }
/* Tips near the edges open inwards so they never stick out of the card */
.bars .b:nth-child(-n+6) .tip { left: 0; transform: none; }
.bars .b:nth-last-child(-n+6) .tip { left: auto; right: 0; transform: none; }
.meter { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--navy); border-radius: inherit; }

/* ---------- Feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy); flex-shrink: 0; }
.feed-ic svg { width: 16px; height: 16px; }
.feed-ic.green { background: var(--green-bg); color: var(--green); }
.feed-ic.amber { background: var(--amber-bg); color: var(--amber); }
.feed-ic.red { background: var(--red-bg); color: var(--red); }
.feed-ic.gray { background: var(--line-2); color: var(--muted); }
.feed-text { font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.feed-text b { color: var(--ink); font-weight: 600; }
.feed-time { font-size: 12px; color: var(--muted-2); margin-top: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 22px 34px; }
  .auth-hero-body { padding: 26px 0 0; }
  .auth-hero h1 { font-size: 34px; }
  .auth-hero .lead { font-size: 15.5px; }
  .auth-points, .auth-foot { display: none; }
  .auth-panel { padding: 32px 20px 48px; align-items: flex-start; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-top { display: flex; }
  .tabbar { display: flex; }
  .page { padding: 22px 16px 110px; }
  .page-head h1 { font-size: 26px; }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stat { padding: 14px; border-radius: 18px; }
  .stat-value { font-size: 23px; }
  .card-pad, .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .order { padding: 16px; border-radius: 18px; }
  .table th, .table td { padding: 11px 12px; }
  .toasts { bottom: 86px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Compact phone layout (all three sites) ---------- */
@media (max-width: 600px) {
  .page { padding: 16px 12px 100px; }
  .page-head { margin-bottom: 16px; gap: 10px; }
  .page-head h1 { font-size: 23px; }
  .page-head p { font-size: 13.5px; }
  .section { margin-top: 24px; }
  .section-head h2 { font-size: 17px; }
  .stats { gap: 8px; }
  .stat { padding: 12px; border-radius: 15px; gap: 6px; }
  .stat-label { font-size: 12.5px; }
  .stat-label svg { width: 14px; height: 14px; }
  .stat-value { font-size: 20px; }
  .stat-sub { font-size: 11.5px; }
  .order { padding: 13px; border-radius: 15px; }
  .order + .order { margin-top: 10px; }
  .order-top { margin-bottom: 10px; }
  .order-id { font-size: 12px; }
  .order-meta { font-size: 12px; }
  .item-row { font-size: 13.5px; }
  .order-total { font-size: 17px; }
  .order-actions { gap: 6px; }
  .card-head { padding: 12px 14px; }
  .card-head h3 { font-size: 15px; }
  .empty { padding: 30px 16px; }
  .empty-icon { width: 56px; height: 56px; border-radius: 16px; }
  .empty-icon svg { width: 26px; height: 26px; }
  .empty h3 { font-size: 18px; }
  .empty p { font-size: 14px; }
  .btn-lg { --h: 46px; font-size: 15px; }
  .btn-xl { --h: 52px; font-size: 16px; }
  .auth-hero { padding: 22px 18px 26px; }
  .auth-hero h1 { font-size: 28px; }
  .auth-hero .lead { font-size: 14.5px; margin-top: 10px; }
  .auth-panel { padding: 24px 16px 40px; }
  .auth-card h2 { font-size: 24px; }
  .auth-card .stack { margin-top: 20px; }
  dialog.modal { border-radius: 22px; }
  .modal-head { padding: 20px 18px 0; }
  .modal-head h3 { font-size: 19px; }
  .modal-body { padding: 16px 18px; }
  .modal-foot { padding: 0 18px 18px; }
}

/* Android app sign-in: "return to the app" screen shown in the Chrome tab */
.handoff { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--canvas); }
.handoff-card { width: min(420px, 100%); background: var(--surface); border-radius: 24px; padding: 28px 22px; box-shadow: var(--sh-2, 0 10px 40px rgba(11,20,112,.08)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.handoff-card .brand { margin-bottom: 6px; }
.handoff-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; }
.handoff-ic svg { width: 30px; height: 30px; }
.handoff-card h1 { font-size: 26px; letter-spacing: -0.03em; }
.handoff-card p { color: var(--muted); font-size: 14.5px; }
.handoff-card [aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* Product images (ui/product-art.js): uploaded photo or drawn packshot */
.p-art, .p-photo { display: block; width: 100%; height: 100%; }
.p-photo { object-fit: contain; }
.thumb, .inv-thumb, .pk-thumb, .photo-prev { display: grid; place-items: center; overflow: hidden; background: var(--canvas); border-radius: 10px; flex-shrink: 0; }
.inv-thumb { width: 40px; height: 40px; padding: 2px; }
.pk-thumb { width: 34px; height: 34px; padding: 2px; }
.photo-row { display: flex; gap: 14px; align-items: center; }
.photo-prev { width: 84px; height: 84px; border-radius: 14px; border: 1px solid var(--line); padding: 4px; }

.credits { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.credits li { padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.credits li:last-child { border-bottom: 0; }
.credits a { color: var(--navy); font-weight: 600; word-break: break-word; }
.credits span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
/* Real photos already have a white background: show them on white, edge to edge. */
.p-img:has(.p-photo), .thumb:has(.p-photo), .inv-thumb:has(.p-photo), .pk-thumb:has(.p-photo), .photo-prev:has(.p-photo) { background: #fff; padding: 0; }
