
:root {
  --bg: #f5f7f9; --bg-tint: #eaf4f6; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f6;
  --ink: #0b1220; --ink-2: #334155; --muted: #5b6577; --faint: #8a94a6;
  --line: #e3e8ef; --line-strong: #cbd5e1;
  --brand: #0e7490; --brand-hover: #0b6079; --brand-ink: #ffffff; --brand-soft: #e3f3f6; --brand-line: #a5d8e2;
  --good: #15803d; --good-soft: #e4f6ea; --warn: #a14a05; --warn-soft: #fdf1dc; --bad: #b91c1c; --bad-soft: #fde8e8; --info: #1d4ed8; --info-soft: #e6eefe;
  --khqr: #e1232e;
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05); --sh-2: 0 2px 8px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --sh-3: 0 12px 32px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06);
  --ring: 0 0 0 3px rgba(14, 116, 144, .28);
  --t: 180ms cubic-bezier(.2, 0, 0, 1);
  --font: Inter, "Noto Sans Khmer", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e12; --bg-tint: #0d1a1f; --surface: #12161c; --surface-2: #161b22; --surface-3: #1c232c;
    --ink: #eef2f6; --ink-2: #c8d0db; --muted: #9aa5b4; --faint: #6f7a8a;
    --line: #252c36; --line-strong: #364151;
    --brand: #22d3ee; --brand-hover: #67e8f9; --brand-ink: #032229; --brand-soft: #0f2a31; --brand-line: #1f5966;
    --good: #4ade80; --good-soft: #10291b; --warn: #fbbf24; --warn-soft: #2e230b; --bad: #f87171; --bad-soft: #341414; --info: #93b4fd; --info-soft: #152340;
    --sh-1: none; --sh-2: 0 1px 0 rgba(255, 255, 255, .03); --sh-3: 0 16px 40px rgba(0, 0, 0, .5);
    --ring: 0 0 0 3px rgba(43, 184, 208, .35);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
img { max-width: 100%; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.015em; }
h1 { font-size: clamp(22px, 3vw, 28px); line-height: 1.2; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 16px; line-height: 1.35; font-weight: 650; margin: 0 0 10px; }
h3 { font-size: 14px; line-height: 1.4; font-weight: 650; margin: 0 0 6px; }
p { margin: 0 0 10px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
.num, .price, .order, td.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.lead { color: var(--muted); font-size: 14.5px; margin: 0 0 20px; max-width: 62ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }
:focus-visible { outline: none; box-shadow: var(--ring); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 56px; }
.wrap.narrow { max-width: 680px; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 14px; height: 14px; }
.icon.lg { width: 20px; height: 20px; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
/* the logo badge (src/web/brand.js BRAND_BADGE): the mark on the brand square, like the extension's headers */
.brand-mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--brand); color: var(--brand-ink); }
.brand-mark svg { display: block; }
.brand .tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); border-radius: var(--r-full); padding: 2px 8px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; }
.who .name { color: var(--ink); font-weight: 600; display: block; line-height: 1.2; }
.who .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; font-size: 12.5px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; display: inline-grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 12px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; line-height: 1.2; text-decoration: none; transition: background var(--t), border-color var(--t), box-shadow var(--t), transform var(--t); white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: var(--sh-1); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.block { width: 100%; }
.btn.lg { min-height: 44px; font-size: 14.5px; padding: 10px 20px; border-radius: var(--r); }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: var(--r-sm); gap: 5px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--muted); transition: background var(--t), color var(--t); }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.google { background: var(--surface); }

/* ---------- forms ---------- */
.field { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); transition: border-color var(--t), box-shadow var(--t); }
.field:hover { border-color: var(--faint); }
.field:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.field:disabled { background: var(--surface-3); color: var(--faint); }
textarea.field { resize: vertical; }
select.field { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
label.lbl, .lbl { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; color: var(--ink-2); }
.help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.input-group { display: flex; align-items: stretch; }
.input-group .field { border-radius: var(--r) 0 0 var(--r); }
.input-group .addon { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--r) var(--r) 0; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.switch { position: relative; display: inline-flex; flex: none; width: 36px; height: 20px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-full); background: var(--line-strong); transition: background var(--t); }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--t); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.check { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-1); }
.card + .card { margin-top: 12px; }
.plan-grid > .card + .card, .settings-grid > .card + .card, .tiers > * + * { margin-top: 0; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.section { margin-top: 32px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title h2 { margin: 0; font-size: 17px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

/* ---------- badges, status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; line-height: 1; border-radius: var(--r-full); padding: 4px 8px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge .icon { width: 11px; height: 11px; }
.badge.premium, .badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.pending, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.outline { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.msg { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); font-size: 13px; margin: 12px 0 0; border: 1px solid transparent; }
.msg .icon { margin-top: 1px; }
.msg.err { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.msg.ok { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.msg.info, .note { background: var(--brand-soft); color: var(--ink-2); border: 1px solid var(--brand-line); }
.note { display: flex; gap: 8px; padding: 10px 12px; border-radius: var(--r); font-size: 13px; }
.note .icon { color: var(--brand); margin-top: 1px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; max-width: min(560px, calc(100vw - 32px)); margin: 0; box-shadow: var(--sh-3); }

/* ---------- segmented control, tabs ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-3); }
.seg button { border: 0; background: none; min-height: 28px; padding: 4px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--muted); transition: background var(--t), color var(--t); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-2); }
.seg button .count { font-variant-numeric: tabular-nums; margin-left: 6px; font-size: 12px; color: var(--faint); }
.seg button.on .count { color: var(--brand); }

/* ---------- steps (subscription flow) ---------- */
.steps-bar { display: flex; align-items: center; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; font-size: 13px; color: var(--faint); flex-wrap: wrap; }
.steps-bar li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.steps-bar li + li::before { content: ""; width: 24px; height: 1px; background: var(--line-strong); }
.steps-bar .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; border: 1.5px solid var(--line-strong); }
.steps-bar li.on { color: var(--ink); }
.steps-bar li.on .n { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps-bar li.done { color: var(--muted); }
.steps-bar li.done .n { border-color: var(--brand); color: var(--brand); }

/* ---------- current plan strip ---------- */
.status-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); margin-bottom: 24px; flex-wrap: wrap; }
.status-strip .ico { width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.status-strip .ico.free { background: var(--surface-3); color: var(--muted); }
.status-strip .what { font-weight: 650; font-size: 14.5px; }
.status-strip .when { color: var(--muted); font-size: 13px; }
.status-strip .next { color: var(--muted); font-size: 12.5px; }

/* ---------- pricing ---------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: stretch; }
.tier { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--sh-1); cursor: pointer; transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.tier:hover { border-color: var(--brand-line); box-shadow: var(--sh-2); }
.tier.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--sh-2); }
.tier.static { cursor: default; background: var(--surface-2); }
.tier.static:hover { border-color: var(--line); box-shadow: var(--sh-1); }
.tier > input { position: absolute; opacity: 0; pointer-events: none; }
.tier:focus-within { box-shadow: var(--ring); }
.tier .flag { position: absolute; top: -10px; left: 16px; }
.tier-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 650; }
.tier-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; transition: border-color var(--t); }
.tier.on .tier-radio { border-color: var(--brand); }
.tier.on .tier-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price .amt { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1; }
.price .per { font-size: 13px; color: var(--muted); }
.tier .alt { font-size: 12.5px; color: var(--muted); margin-top: -8px; }
.perks { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.perks li { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.perks li .icon { width: 14px; height: 14px; margin-top: 2px; color: var(--good); }
.perks li.off { color: var(--faint); }
.perks li.off .icon { color: var(--faint); }

.lengths { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.length { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color var(--t), box-shadow var(--t); }
.length:hover { border-color: var(--brand-line); }
.length.on { border-color: var(--brand); background: var(--brand-soft); }
.length > input { position: absolute; opacity: 0; pointer-events: none; }
.length:focus-within { box-shadow: var(--ring); }
.length .days { font-weight: 700; }
.length .cost { font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
.length .sub { font-size: 12.5px; color: var(--muted); }
.length .save { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 700; color: var(--good); background: var(--good-soft); border-radius: var(--r-full); padding: 3px 8px; }

.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } }
.summary { position: sticky; top: 20px; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0 0 12px; font-size: 13px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 600; }
.summary .total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); margin-bottom: 12px; }
.summary .total .amt { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.rules { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.rules li { display: flex; gap: 8px; align-items: flex-start; }
.rules .icon { width: 14px; height: 14px; margin-top: 2px; color: var(--faint); }

.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
.compare th, .compare td { padding: 9px 14px; border-top: 1px solid var(--line); text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; color: var(--ink-2); }
.compare thead th { border-top: 0; font-size: 12.5px; font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
.compare td.sel, .compare th.sel { background: color-mix(in srgb, var(--brand-soft) 70%, transparent); }
.compare .yes { color: var(--good); display: inline-flex; }
.compare .no { color: var(--faint); display: inline-flex; }

.faq { display: grid; gap: 6px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 14px; }
.faq summary { cursor: pointer; list-style: none; padding: 10px 0; font-weight: 600; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--faint); transition: transform var(--t); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { color: var(--muted); font-size: 13px; padding-bottom: 12px; margin: 0; }

/* ---------- payment ---------- */
.pay { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 680px) { .pay { grid-template-columns: 1fr; justify-items: center; } .pay > div:last-child { justify-self: stretch; } }
.qr { width: 100%; max-width: 240px; aspect-ratio: 1; object-fit: contain; border-radius: var(--r-lg); border: 1px solid var(--line); background: #fff; }
.qr-missing { display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); font-size: 13px; background: var(--surface-2); }
.khqr { width: 240px; max-width: 100%; border-radius: 18px; overflow: hidden; background: #fff; color: #000; box-shadow: var(--sh-3); }
.khqr-head { position: relative; background: var(--khqr); color: #fff; font-weight: 800; letter-spacing: .1em; text-align: center; padding: 10px 0; font-size: 16px; }
.khqr-head::after { content: ""; position: absolute; right: 0; bottom: -14px; border-style: solid; border-width: 0 0 14px 14px; border-color: transparent transparent transparent var(--khqr); }
.khqr-body { padding: 16px 18px 18px; }
.khqr-name { font-size: 13px; color: #333; }
.khqr-amount { font-size: 20px; font-weight: 750; padding-bottom: 12px; border-bottom: 1px dashed #bbb; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.khqr-code svg { width: 100%; height: auto; display: block; }
.amount { font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.order { font-family: var(--mono); font-weight: 700; font-size: .95em; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.steps li::before { content: counter(s); flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.countdown { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.countdown strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-ok { text-align: center; padding: 32px 20px; }
.hero-ok .ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--good-soft); color: var(--good); }
.hero-ok .ico .icon { width: 24px; height: 24px; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty-state .icon { width: 24px; height: 24px; color: var(--faint); margin-bottom: 8px; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r); min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- admin console ---------- */
.console { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; background: linear-gradient(90deg, var(--surface) 0 219px, var(--line) 219px 220px, var(--bg) 220px); }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.side .brand { padding: 2px 8px 16px; font-size: 14.5px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px; border-radius: var(--r); border: 0; background: none; color: var(--muted); font-weight: 550; font-size: 13.5px; text-align: left; width: 100%; transition: background var(--t), color var(--t); }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.on { background: var(--brand-soft); color: var(--brand); }
.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--warn-soft); color: var(--warn); border-radius: var(--r-full); padding: 2px 7px; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.side-foot .email { font-size: 12.5px; max-width: 100%; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; padding: 24px 28px 56px; max-width: 1200px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0 0 2px; }
.page-head p { color: var(--muted); margin: 0; font-size: 13px; max-width: 72ch; }
.page-head .row:empty { display: none; }
@media (max-width: 960px) {
  .console { grid-template-columns: 1fr; grid-template-rows: auto 1fr; background: var(--bg); }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 2px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side .brand { padding: 0 8px 0 0; }
  .side .brand > span:not(.tag):not(.brand-mark) { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .side-foot form { margin: 0; }
  .side-foot .email { display: none; }
  .main { padding: 16px 16px 48px; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); text-align: left; transition: border-color var(--t), box-shadow var(--t); }
button.stat:hover { border-color: var(--brand-line); box-shadow: var(--sh-2); }
.stat.on { border-color: var(--brand); }
.stat .ico { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.stat .ico.warn { background: var(--warn-soft); color: var(--warn); }
.stat .ico.brand { background: var(--brand-soft); color: var(--brand); }
.stat .v { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .field { padding-left: 32px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; vertical-align: middle; padding: 10px 14px; border-top: 1px solid var(--line); }
thead th { border-top: 0; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; white-space: nowrap; }
tbody tr { transition: background var(--t); }
tbody tr:hover { background: var(--surface-2); }
tbody tr.waiting { box-shadow: inset 3px 0 0 var(--warn); }
td .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
td.req { min-width: 210px; }
td.req .row { flex-wrap: nowrap; }
td.req .num { white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.user-cell strong { display: block; font-weight: 600; }
.actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }

/* Templates page (admin): a picture, the name, who may use it */
.tpl-cell { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.tpl-cell strong { display: block; font-weight: 600; }
.tpl-thumb { flex: none; width: 88px; aspect-ratio: 16 / 9; border-radius: var(--r-sm, 6px); border: 1px solid var(--line); background: var(--surface-2); color: var(--faint); display: grid; place-items: center; overflow: hidden; }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-thumb.lg { width: min(100%, 320px); }
tbody tr.off .tpl-cell { opacity: .7; }
.tpl-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.plan-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 6px 0 2px 26px; }
.plan-checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.plan-checks[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.radio-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.radio-row input { margin-top: 3px; accent-color: var(--brand); }
.radio-row .help { display: block; }
.yt-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.yt-line .bad-text { display: inline-flex; align-items: center; gap: 4px; color: var(--bad); }
.yt-line img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.actions .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.plan-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.plan-card.off { opacity: .72; }
.plan-card .pc-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.plan-card .pc-head h2 { margin: 0; font-size: 15px; }
.plan-card .pc-id { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.plan-card .pc-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.plan-card .pc-foot { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 8px; flex-wrap: wrap; }
.plan-card .sub { color: var(--muted); font-size: 12px; }
.kicker { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.price-list, .feat-list { list-style: none; margin: 0; padding: 0; }
.price-list li, .feat-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.price-list li + li, .feat-list li + li { border-top: 1px dashed var(--line); }
.price-list strong { font-variant-numeric: tabular-nums; }
.feat-list .yes { color: var(--good); display: inline-flex; }
.feat-list .no { color: var(--faint); display: inline-flex; }
.feat-list .lim { font-weight: 650; font-variant-numeric: tabular-nums; }

/* dialogs: centred, and the side sheet */
dialog { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); }
dialog::backdrop { background: rgba(8, 12, 20, .5); backdrop-filter: blur(2px); }
dialog[open] { animation: pop 200ms cubic-bezier(.2, 0, 0, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog form, dialog .dlg { padding: 20px; }
dialog h2 { margin-bottom: 4px; font-size: 17px; }
dialog .foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; margin: 20px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }
dialog.sheet { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(520px, 100vw); border-radius: var(--r-lg) 0 0 var(--r-lg); border-right: 0; }
dialog.sheet[open] { animation: slide 240ms cubic-bezier(.2, 0, 0, 1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.dlg-head .grow h2 { margin: 0; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.now::before { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.timeline .t { font-weight: 650; }
.timeline .s { font-size: 12.5px; color: var(--muted); }
.fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 2px 14px; margin: 14px 0 0; }
.fieldset legend { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 0 6px; }
.price-row { display: grid; grid-template-columns: 1fr 1fr 1.3fr auto; gap: 8px; align-items: end; padding: 8px 0; }
.price-row + .price-row { border-top: 1px dashed var(--line); }
.price-row .lbl { margin: 0 0 3px; font-size: 11.5px; }
.price-row + .price-row { padding-top: 6px; }
.price-row + .price-row .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.feat-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; }
.feat-row + .feat-row { border-top: 1px solid var(--line); }
.feat-row strong { display: block; font-size: 13px; font-weight: 600; }
.feat-row .help { margin-top: 1px; }
.feat-row .limit { display: flex; align-items: center; gap: 10px; flex: none; font-size: 12.5px; }
.feat-row .limit .field { width: 84px; min-height: 32px; padding: 5px 8px; }
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.mode-card { position: relative; display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; transition: border-color var(--t); }
.mode-card:hover { border-color: var(--brand-line); }
.mode-card.on { border-color: var(--brand); background: var(--brand-soft); }
.mode-card .icon { color: var(--brand); margin-top: 2px; }
.mode-card strong { display: block; }
.mode-card span { color: var(--muted); font-size: 12.5px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }

/* ---------- footer, terms ---------- */
.foot-links { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.terms h2 { margin-top: 24px; }
.terms li { margin: 4px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .spin { animation: spin 2s linear infinite !important; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; gap: 10px; }
  .stat .ico { display: none; }
  .stat .v { font-size: 18px; }
  .stat .k { font-size: 12px; line-height: 1.3; }
  .side-foot .btn-text { display: none; }
  .side .nav-item { padding: 6px 8px; gap: 6px; }
  .side .brand { padding-right: 4px; }
}
@media (max-width: 430px) {
  .side .brand { display: none; }
  .side { padding-inline: 8px; }
  .side-foot .btn.sm { padding-inline: 10px; }
  /* the users table turns into one card per user */
  .table-wrap.cards { overflow: visible; border: 0; background: none; box-shadow: none; }
  .table-wrap.cards table, .table-wrap.cards tbody, .table-wrap.cards tr, .table-wrap.cards td { display: block; }
  .table-wrap.cards thead { display: none; }
  .table-wrap.cards tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; }
  .table-wrap.cards tr + tr { margin-top: 8px; }
  .table-wrap.cards td { border: 0; padding: 0; }
  .table-wrap.cards td + td { margin-top: 8px; }
  .table-wrap.cards td.req { min-width: 0; }
  .table-wrap.cards td.req .row { flex-wrap: wrap; }
  .table-wrap.cards .user-cell, .table-wrap.cards .tpl-cell { min-width: 0; }
  .table-wrap.cards .actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
  .table-wrap.cards .actions .icon-btn:first-of-type { margin-left: auto; }
  .table-wrap.cards td.empty { padding: 32px 8px; }
}
@media (max-width: 480px) {
  .card { padding: 16px; }
  .tier { padding: 16px; }
  .price .amt { font-size: 24px; }
}
/* the receipt picker beside "I have paid" (subscribe page) and the receipt viewer (admin) */
.receipt-box { border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 14px; margin-top: 20px; background: var(--surface-2); }
.receipt-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.receipt-pick label.btn { cursor: pointer; margin: 0; }
.receipt-pick:focus-within label.btn { box-shadow: var(--ring); }
.receipt-pick .grow { min-width: 0; overflow-wrap: anywhere; }
.receipt-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); }
.receipt-box .lbl { margin-top: 12px; }
details.later { margin-top: 16px; }
details.later > summary { cursor: pointer; font-weight: 600; color: var(--brand); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.later > summary::-webkit-details-marker { display: none; }
.md5-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.md5-line code { font-size: 11.5px; overflow-wrap: anywhere; color: var(--ink-2); }
.receipt-view { display: block; max-width: 100%; max-height: 60vh; margin: 12px auto 0; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); }
.receipt-mini { width: 40px; height: 40px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); cursor: zoom-in; display: block; padding: 0; background: var(--surface-2); }
.flag-dup { color: var(--bad); font-weight: 600; }
/* Khmer script needs taller lines */
:lang(km) body, body:lang(km) { line-height: 1.75; }
:lang(km) h1, :lang(km) h2, :lang(km) h3 { line-height: 1.45; letter-spacing: 0; }
.lang { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-full); background: var(--surface-3); }
.lang a { font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 3px 10px; border-radius: var(--r-full); }
.lang a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ---------- home page (GET /) ---------- */
.home .wrap { padding-block: 0; }
.h-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.h-bar { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.h-nav { display: flex; gap: 18px; }
.h-nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.h-nav a:hover { color: var(--brand); }
.h-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.h-acct { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 56px !important; }
.hero h1 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin: 0 0 16px; text-wrap: balance; }
:lang(km) .hero h1 { font-size: clamp(28px, 3.8vw, 42px); line-height: 1.35; }
.hero .lead { font-size: 16.5px; max-width: 54ch; }
.kicker { display: inline-block; margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
:lang(km) .kicker { letter-spacing: 0; text-transform: none; font-size: 13px; }
.hero-cta { gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sites { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-top: 24px; }
.site { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.site svg { color: var(--ink); }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: var(--r-xl); border: 1px solid var(--line); box-shadow: 0 24px 60px -24px rgba(15, 40, 60, .35); background: var(--surface-2); }
.shot figcaption { font-size: 12.5px; color: var(--muted); margin-top: 10px; text-align: center; }
.hero-shot img { background: #eef3f6; }
.h-title { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; font-weight: 750; letter-spacing: -.02em; text-align: center; margin: 0 auto 28px; max-width: 26ch; text-wrap: balance; }
.home .section { margin-top: 96px; }
.center { text-align: center; margin-inline: auto; }
.feats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.feat h3 { font-size: 15px; margin: 12px 0 6px; }
.feat p { margin: 0; color: var(--muted); font-size: 13.5px; }
.feat-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.feat-ico .icon { width: 18px; height: 18px; }
.showcase { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: 40px; align-items: center; margin-top: 64px; }
.showcase.flip { grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr); }
.showcase.flip .show-copy { order: 2; }
.show-copy h3 { font-size: 20px; margin: 0 0 8px; }
.show-copy p { color: var(--muted); font-size: 15px; margin: 0; }
.narrow-shot { max-width: 560px; justify-self: center; }
.how { list-style: none; counter-reset: how; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 960px; }
.how li { counter-increment: how; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.how li::before { content: counter(how); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 13px; }
.h-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; max-width: 960px; margin: 0 auto; }
.h-tier { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--r-lg); background: var(--surface-2); border: 1.5px solid var(--line); }
.h-tier.featured { background: var(--surface); border-color: var(--brand-line); box-shadow: var(--sh-2); }
.h-tier .flag { position: absolute; top: -10px; left: 16px; }
.h-tier .alt { font-size: 12.5px; color: var(--muted); margin-top: -8px; }
.h-tier .perks { flex: 1; }
.narrow-section { max-width: 760px; }
.cta { text-align: center; padding: 48px 16px !important; border-radius: var(--r-xl); background: var(--brand-soft); border: 1px solid var(--brand-line); max-width: 1048px; }
.cta h2 { font-size: clamp(20px, 2.4vw, 26px); margin: 0 0 18px; }
.home .foot-links { margin-top: 64px; padding-bottom: 32px; align-items: center; }
@media (max-width: 860px) {
  .hero, .showcase, .showcase.flip { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .showcase.flip .show-copy { order: 0; }
  .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how { grid-template-columns: minmax(0, 1fr); }
  .h-nav { display: none; }
  .home .section { margin-top: 64px; }
  .hero { padding-top: 32px !important; }
}
@media (max-width: 480px) { .feats { grid-template-columns: minmax(0, 1fr); } .h-acct span { display: none; } }

/* ---------- account page (GET /account) ---------- */
.acct-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.acct-head .avatar { width: 52px; height: 52px; font-size: 20px; }
.acct-head h1 { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
@media (max-width: 480px) { .tabs { gap: 0; } .tabs button { padding: 10px 9px; font-size: 13px; } }
/* A .seg whose buttons may go to a second row on a phone instead of breaking their labels (account page → Agents). */
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { white-space: nowrap; }
.acct-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.time-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 12px 0 4px; }
.time-bar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.orders { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.orders th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.orders td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.orders tr:last-child td { border-bottom: 0; }
.orders .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dev-list { list-style: none; margin: 0; padding: 0; }
.dev-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.dev-list li:first-child { border-top: 0; }
/* Account page → Agents: a setup command or key to copy. */
.snippet { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; background: var(--surface-3); border-radius: var(--r); padding: 12px 14px; margin: 10px 0 0; white-space: pre-wrap; word-break: break-all; }
.dev-list .ok-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.dev-list .off-dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--faint); flex: none; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.receipt-doc { max-width: 560px; margin: 0 auto; }
.receipt-doc dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 16px 0; font-size: 14px; }
.receipt-doc dt { color: var(--muted); }
.receipt-doc dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.receipt-doc .total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 14px; font-size: 18px; font-weight: 750; }
@media (max-width: 760px) { .acct-grid { grid-template-columns: minmax(0, 1fr); } .orders .opt { display: none; } }
@media print {
  .top, .tabs, .foot-links, .no-print, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* touch screens keep 44 px targets; mouse screens get the compact sizes */
@media (pointer: coarse) {
  .btn, .field, .nav-item { min-height: 44px; }
  .btn.sm { min-height: 40px; padding-inline: 12px; }
  .icon-btn { width: 44px; height: 44px; }
  .seg button { min-height: 40px; }
}
