/* The signed-in pages, the scan page and the report page. Colors, buttons, fields, tabs and
   the wordmark come from /lib/ui.css (generated from the free tool, the one source); this
   file only lays those parts out. */
/* Chart series, in validated order (light on --field, dark on its dark step). */
:root { --series-1: #257de0; --series-2: #f47230; --series-3: #00b894; --series-4: #f2a600; --series-5: #ee7fac; --series-6: #008a17; --series-7: #6a4ce2; }
@media (prefers-color-scheme: dark) { :root { --series-1: #338ced; --series-2: #e76624; --series-3: #00a888; --series-4: #d28e05; --series-5: #e24d8b; --series-6: #0aac23; --series-7: #9887ef; } }
body { min-height: 100dvh; }

/* Scan page: one centered card. */
.scan { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.card { width: 100%; max-width: 380px; border: 2px solid var(--ink); border-radius: var(--radius-lg); background: var(--paper); box-shadow: 6px 6px 0 var(--ink); padding: 22px 20px; }
.host { font-weight: 800; font-size: clamp(22px, 7vw, 30px); letter-spacing: -0.02em; overflow-wrap: anywhere; margin: 6px 0 14px; }
.bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 15%, transparent); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--signal); animation: fill 0.9s linear forwards; }
@keyframes fill { to { width: 100%; } }
.go { display: inline-block; margin-top: 16px; color: var(--ink); font-weight: 650; }
.problem h1 { font-size: 22px; margin: 6px 0 8px; }
.problem p { margin: 0; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .bar i { animation: none; width: 100%; } }

/* Pages */
main.tool, main.page { max-width: 640px; margin: 0 auto; padding: 14px 16px 60px; }
/* The same frame as the free tool, so the bar at the top doesn't move between pages. */
main.page { max-width: 1120px; padding-top: 4px; }
@media (min-width: 900px) { main.page { padding: 8px 24px 60px; } }
main.tool h1 { font-size: 28px; letter-spacing: -0.03em; margin: 0 0 4px; }
main.tool h2 { font-size: 18px; margin: 34px 0 10px; }
label { display: grid; gap: 5px; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
/* A button keeps the gap above it that these pages' forms are built around. Buttons that
   aren't .btn (text links, show/hide, chips) start plain. */
.btn { margin-top: 14px; }
button:not(.btn):not(.tab) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.out { margin-top: 14px; border: 1.5px dashed var(--ink); border-radius: var(--radius); padding: 12px; background: var(--field); font: 13px/1.5 ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
.status { margin-top: 10px; min-height: 1.4em; }
.status.error { color: var(--warn); }

/* App */
.note { color: var(--muted); margin: 0; font-size: 14px; }
button.link { text-decoration: underline; font-size: 15px; font-weight: 600; color: var(--ink); }
/* Tabs are the shared segmented control (.seg). */
.tabs-row { display: flex; margin-top: 16px; }
button.link { display: block; margin-top: 12px; }
.out.key { font-size: clamp(13px, 4.1vw, 20px); letter-spacing: 0.02em; text-align: center; padding: 18px 8px; white-space: nowrap; overflow-x: auto; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 15px; color: var(--ink); }
label.check input { width: auto; }

/* Scan page cards for non-link codes */
.fact-list { margin: 0; display: grid; gap: 2px; }
.fact-list dt { margin-top: 8px; }
.fact-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.fact-list a { color: var(--ink); font-weight: 600; }
.text-body { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 55dvh; overflow: auto; border: 1.5px dashed var(--ink); border-radius: var(--radius); background: var(--field); padding: 12px; margin-top: 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.scan .note { margin-top: 12px; }

/* Login */
main.tool h1 { font-size: clamp(28px, 8vw, 40px); line-height: 1.05; font-weight: 850; margin: 18px 0 10px; }

/* Codes */
.head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 14px; }
.head-row h1 { font-size: clamp(30px, 6vw, 40px); line-height: 1.05; letter-spacing: -0.04em; font-weight: 850; margin: 0; }
.head-row .count { color: var(--muted); flex: 1; }
.head-row .btn { margin-top: 0; }
.head-actions { display: flex; gap: 10px; }
@media (max-width: 520px) { .head-actions { width: 100%; } .head-actions .btn { flex: 1; text-align: center; } }
.code-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 196px), 1fr)); }
.code-card a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto auto auto 1fr; align-content: start; gap: 0 6px; height: 100%; overflow: hidden;
  color: inherit; text-decoration: none; background: var(--field); border: 2px solid var(--rule); border-radius: var(--radius-lg); transition: transform 0.1s, box-shadow 0.1s;
}
.code-card a > * { grid-column: 1 / -1; margin: 0 14px; }
/* Phones: two to a row. */
@media (max-width: 520px) { .code-grid { grid-template-columns: 1fr 1fr; gap: 12px; } .code-card a > * { margin: 0 10px; } .code-card .kind { margin-left: 10px; } .code-card .when { margin-right: 10px; } .code-card .summary { font-size: 15px; } }
.code-card .thumb-stage { position: relative; aspect-ratio: 4 / 3; margin: 0 0 12px; border-bottom: 2px solid var(--rule); }
.code-card .thumb { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; filter: drop-shadow(3px 3px 0 var(--shade)); }
.code-card .thumb-stage { grid-row: 1; }
/* Its scans, pinned to the corner of the stage. */
.code-card .scans { grid-row: 1; justify-self: end; align-self: start; z-index: 1; margin: 8px; padding: 1px 7px; color: var(--ink); font-weight: 650; background: var(--field); border: 1.5px solid var(--rule); border-radius: 6px; }
.code-card .kind { grid-column: 1; grid-row: 5; align-self: end; margin: 12px 0 12px 14px; white-space: nowrap; }
.code-card .when { grid-column: 2 / -1; grid-row: 5; align-self: end; margin: 12px 14px 12px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-card .when::before { content: "· "; }
.code-card a[href]:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--rule); }
.code-card .thumb:not([src]) { visibility: hidden; }
.more-codes { display: block; margin: 18px auto 0; }
.code-card .summary { overflow-wrap: anywhere; font-size: 16px; line-height: 1.25; letter-spacing: -0.01em; }
.code-card .kind, .code-card .when, .code-card .scans { font-size: 12px; }
.code-card.locked a, .code-card.off a { opacity: 0.6; }
.code-card.locked .thumb-stage { aspect-ratio: auto; height: 12px; border-bottom: 0; background: none; margin-bottom: 0; }
.code-card.frozen a { border-style: dashed; }
.code-card.locked .summary { font: 12px/1.4 ui-monospace, Menlo, monospace; }
#state:empty { display: none; }
.empty { border: 2px dashed var(--ink); border-radius: var(--radius-lg); padding: 40px 16px; text-align: center; }
.empty .btn { margin-top: 0; }

/* Account */
.panel { border: 2px solid var(--ink); border-radius: var(--radius-lg); background: var(--field); padding: 6px 14px 14px; }
main.tool section { margin-top: 8px; }

/* Sign-in page: the wordmark, a line, and one card. */
main.auth { max-width: 420px; margin: 0 auto; padding: 32px 16px 60px; }
main.auth .dbar { justify-content: center; margin: 0 0 14px; }
main.auth .dbar .brand svg { height: 46px; }
.auth-hero { text-align: center; }
.auth-hero h1 { font-size: clamp(26px, 7.5vw, 34px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 850; margin: 0 0 10px; }
.auth-hero .promise { justify-content: center; }
.auth-card { display: block; border: 2px solid var(--rule); border-radius: var(--radius-lg); background: var(--field); --control: var(--paper); box-shadow: 6px 6px 0 var(--rule); padding: 18px; margin-top: 20px; }
.auth-card h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-card .tabs-row { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 6px; }
.auth-card .tab { width: 100%; height: 40px; }
.auth-card .btn.wide { display: flex; width: 100%; margin-top: 18px; padding: 12px 14px; font-size: 16px; }
.auth-card button.link { display: block; margin: 16px auto 0; font-size: 14px; color: var(--muted); }
.auth-card .status { text-align: center; margin: 10px 0 0; min-height: 0; }
.auth-card .status:empty { display: none; }
/* Sign-up's human check: the checkout site's page, framed (Cloudflare's script never runs here). */
.auth-card .human { margin-top: 16px; }
.auth-card .human iframe { display: block; width: 100%; height: 65px; border: 0; background: transparent; color-scheme: normal; }
.auth-card .row { display: flex; gap: 10px; }
.auth-card .row button { flex: 1; }
.pw { position: relative; display: block; }
.pw input { padding-right: 62px; }
.pw .show { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); padding: 5px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pw .show:hover { color: var(--ink); }
input.username { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.waiting { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 9px 12px; border: 2px dashed var(--ink); border-radius: var(--radius); background: var(--field); min-width: 0; }
.waiting strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.waiting .mono { flex: none; color: var(--signal); }
@media (min-width: 700px) and (min-height: 760px) { main.auth { padding-top: 9vh; } }

/* Account: grouped settings. A small title over a card of rows: label, value, action. */
main.account { max-width: 720px; }
.page-title { font-size: clamp(30px, 6vw, 40px); line-height: 1.05; letter-spacing: -0.04em; font-weight: 850; margin: 18px 0 22px; }
.set { margin: 0 0 26px; }
.set-title { margin: 0 0 8px; font-weight: 400; }
.set-card { border: 2px solid var(--rule); border-radius: var(--radius-lg); background: var(--field); --control: var(--paper); overflow: hidden; }
.set-card > .row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 60px; }
.set-card > .row + .row, .set-card > .row-form + .row-status + .row, .set-card > .row-status + .row { border-top: 1.5px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.row-label { width: 116px; flex: none; }
.row-value { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-value.muted, .row-sub { color: var(--muted); }
.row-value.dots { letter-spacing: 0.12em; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.set-card .row-action { margin: 0; padding: 6px 12px; font-size: 14px; box-shadow: none; flex: none; }
.set-card .row-action:hover { box-shadow: 2px 2px 0 var(--ink); }
.row-form { padding: 4px 16px 16px; display: grid; gap: 2px; }
.row-form label { margin-top: 10px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions button { margin-top: 14px; }
.row-status { margin: 0; padding: 0 16px 12px; text-align: left; }
.row-status:empty { display: none; }
.plan-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.badge { font-size: 12px; font-weight: 600; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 6px; padding: 1px 7px; }
.meter { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.4s; }
.meter.full i { background: var(--warn); }

@media (max-width: 520px) {
  .set-card > .row { flex-wrap: wrap; gap: 4px 12px; }
  .row-label { width: 100%; }
  .row-value { flex: 1 1 0; }
}

/* Report */
.report { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); color: var(--muted); text-decoration: underline; }
.report-title { font-size: 24px; letter-spacing: -0.02em; margin: 6px 0 10px; }
.reasons { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.reasons legend { margin-bottom: 4px; }
.reasons label.check { margin-top: 0; }
.reasons input { accent-color: var(--ink); }

/* Back from a link */
#back .actions .btn { margin-top: 0; }

/* Pricing */
.pricing-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 0 20px; }
.pricing-head h1 { font-size: clamp(30px, 6vw, 40px); line-height: 1.05; letter-spacing: -0.04em; font-weight: 850; margin: 0; }
.billing-toggle { margin: 0; }
.billing-toggle .tab { padding: 0 14px; }
.saving { margin-left: 6px; font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--signal); color: #15130f; }
.saving:empty { display: none; }
.plan-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.plan-card { border: 2px solid var(--rule); border-radius: var(--radius-lg); background: var(--field); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.plan-card.featured { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--signal); }
.plan-card.featured .plan-name, .plan-card.featured .plan-price span, .plan-card.featured .plan-sub { color: inherit; opacity: 0.7; }
.plan-card.featured .btn { border-color: var(--paper); }
.plan-card.featured .btn.primary { box-shadow: 3px 3px 0 var(--paper); }
.plan-card.featured .btn:not(.primary) { background: none; color: var(--paper); }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; }
.plan-price strong { font-size: 38px; letter-spacing: -0.03em; line-height: 1; }
.plan-price span { color: var(--muted); }
.plan-sub { color: var(--muted); font-size: 14px; }
.plan-codes { margin-top: 10px; font-weight: 650; }
.plan-card .btn { margin-top: auto; padding-top: 11px; padding-bottom: 11px; }
.plan-card .plan-mark + .btn { margin-top: 18px; }
.plan-card .btn.disabled { opacity: 0.5; cursor: default; box-shadow: none; transform: none; }
.includes { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; padding: 0; margin: 22px 0 0; list-style: none; color: var(--muted); }
.includes li::before { content: "\2713"; color: var(--signal); font-weight: 800; margin-right: 5px; }
.promises { list-style: none; padding: 0; margin: 26px auto 0; max-width: 620px; display: grid; gap: 10px; }
.promises li { border-left: 3px solid var(--signal); padding: 2px 0 2px 12px; }
.free-static { text-align: center; color: var(--muted); margin: 28px 0 0; }
.free-static a { color: var(--ink); font-weight: 650; }

.price-notice { margin: 0; padding: 12px 16px; border-top: 1.5px solid color-mix(in srgb, var(--ink) 14%, transparent); background: color-mix(in srgb, var(--signal) 10%, var(--field)); font-size: 14.5px; }
label.check input { accent-color: var(--ink); }

/* Wide screens: the plans sit in the middle of the page's frame. */
@media (min-width: 701px) { .pricing-head, .plan-grid, .pricing .status { max-width: 960px; margin-left: auto; margin-right: auto; } }

/* Phones: the plans swipe sideways, the next one peeking in; dots show where you are. */
.plan-dots { display: none; }
@media (max-width: 700px) {
  .plan-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -16px; padding: 2px 16px 14px; gap: 12px; scroll-padding: 0 16px;
  }
  .plan-grid::-webkit-scrollbar { display: none; }
  .plan-card { flex: 0 0 82%; scroll-snap-align: center; }
  .plan-dots { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
  .plan-dots button { width: 9px; height: 9px; padding: 0; margin: 0; border: 1.5px solid var(--ink); border-radius: 3px; background: transparent; box-shadow: none; cursor: pointer; }
  .plan-dots button.on { background: var(--ink); }
}

/* Admin: tabs, then a list of items (a QR code or account, what's wrong, the numbers, actions). */
main.admin { max-width: 860px; }
.admin-tabs { margin: 0 0 18px; flex-wrap: wrap; }
.count-pill { display: inline-block; min-width: 1.6em; margin-left: 4px; padding: 0 5px; font-size: 12px; line-height: 1.5; background: var(--signal); color: #15130f; text-align: center; border-radius: 5px; }
.count-pill:empty { display: none; }
.admin-tab > label.check { margin: 0 0 12px; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.admin-item { border: 2px solid var(--ink); border-radius: 12px; background: var(--field); padding: 14px 16px; display: grid; gap: 10px; }
.item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.item-id { font: 700 15px ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.item-count { margin-left: auto; color: var(--ink); }
.off-badge { background: var(--ink); color: var(--paper); }
.reasons-row { display: flex; gap: 6px; flex-wrap: wrap; }
.reasons-row:empty { display: none; }
.reason-chip { border: 1.5px solid var(--ink); border-radius: 6px; padding: 2px 7px; color: var(--ink); }
.reason-chip.bad { background: color-mix(in srgb, var(--warn) 18%, var(--field)); border-color: var(--warn); }
.item-facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14.5px; }
.item-facts dt { align-self: center; }
.item-facts dd { margin: 0; overflow-wrap: anywhere; }
.item-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.item-actions button { margin-top: 0; padding: 7px 12px; font-size: 14px; }
.item-status { margin: 0; min-height: 0; }
.item-status:empty { display: none; }
.empty-note { border: 2px dashed var(--ink); border-radius: 12px; padding: 28px 16px; text-align: center; color: var(--muted); margin: 0; }
.admin .note { margin: 0 0 10px; }
.price-form .row-label { width: 140px; }
.price-input { display: flex; align-items: center; gap: 6px; margin: 0; width: 120px; flex: none; }
.price-input input { padding: 7px 9px; }
.price-unit { flex: 1; min-width: 0; }
.admin-log { list-style: none; margin: 0; padding: 0; border: 2px solid var(--ink); border-radius: 12px; background: var(--field); overflow: hidden; }
.admin-log li { display: grid; grid-template-columns: 9.5em 1fr auto; gap: 4px 14px; align-items: baseline; padding: 10px 14px; }
.admin-log li + li { border-top: 1.5px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.admin-log strong { font-weight: 650; min-width: 0; }
.log-tags, .log-facts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.log-facts { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.log-tags:empty, .log-facts:empty { display: none; }
button.chip { padding: 2px 8px; border: 1.5px solid var(--rule); border-radius: 6px; background: var(--field); font-size: 12px; font-weight: 700; color: var(--ink); }
button.chip:hover { background: var(--paper); }
.log-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; align-items: end; margin: 0 0 12px; }
.log-filters label { margin-top: 0; }
.log-filters select, .log-filters input:not([type="checkbox"]) { font: 15px/1.3 system-ui, sans-serif; color: var(--ink); background: var(--field); border: 1.5px solid var(--ink); padding: 8px 9px; width: 100%; text-transform: none; letter-spacing: 0; border-radius: var(--radius); }
.log-filters label.check { align-self: center; padding-top: 18px; }
.log-filters button { margin-top: 0; align-self: end; }
#log-status:empty { display: none; }
#log-more { margin-top: 12px; }
.relogin { margin-bottom: 18px; }
#tab-prices .set-title { margin-top: 6px; }
#prices-status, #limits-status { margin: 8px 0 22px; }
.limit-input { display: flex; align-items: center; gap: 8px; margin: 0; flex: none; }
.limit-input input { width: 96px; padding: 7px 9px; }
.limit-accounts { flex: 1; min-width: 0; }
.limit-form .row-label { width: 140px; }
.pv-item { white-space: nowrap; }
#prices-form .form-actions button { margin-top: 12px; }
.price-input input[aria-invalid="true"] { border-color: var(--warn); outline: 1.5px solid var(--warn); }
.price-unit del { color: var(--muted); }
.price-unit ins { text-decoration: none; font-weight: 750; color: var(--ink); background: color-mix(in srgb, var(--signal) 22%, transparent); padding: 0 3px; }
@media (max-width: 520px) {
  .item-count { margin-left: 0; width: 100%; }
  .item-facts { grid-template-columns: 1fr; gap: 0; }
  .item-facts dd + dt { margin-top: 6px; }
  .price-form .row-label { width: 100%; }
  .admin-log li { grid-template-columns: 1fr auto; }
  .log-when, .log-tags, .log-facts { grid-column: 1 / -1; }
  .log-filters { grid-template-columns: 1fr 1fr; }
  .price-form .price-unit { flex: 1 1 100%; }
  .limit-input input { width: 80px; }
  .set-card > .row.limit-form { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
  .limit-form .row-label { width: auto; }
  .limit-accounts { grid-column: 2; grid-row: 1; }
  .limit-input, .limit-form .row-action { grid-column: 1 / -1; justify-self: start; }
}

/* Admin analytics: figures, small multiples (one series each), horizontal bars, tables. */
.stats-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.stats-bar .tabs-row { margin: 0; }
.stats-bar .tab { padding: 0 12px; }
.stats-bar label.check { margin: 0; }
#stats-status:empty { display: none; }
.attention { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: var(--radius); background: color-mix(in srgb, var(--signal) 14%, var(--field)); }
.attention .mono { color: var(--ink); margin-right: 4px; }
.attention button { margin: 0; padding: 6px 11px; font-size: 14px; box-shadow: 2px 2px 0 var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 0 0 26px; }
.kpi { border: 2px solid var(--ink); border-radius: 12px; background: var(--field); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.kpi-value { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-sub { color: var(--muted); font-size: 13.5px; }
.stats-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 28px; margin: 0 0 26px; }
.stats-pair section { margin: 0; }
.hbars { display: grid; gap: 10px; border: 2px solid var(--ink); border-radius: 12px; background: var(--field); padding: 14px; }
.hbar { display: grid; grid-template-columns: 9.5em 1fr auto; gap: 10px; align-items: center; }
.hbar-label { font-size: 14.5px; }
.hbar-track { height: 14px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.hbar-fill { height: 100%; background: var(--signal); border-radius: 0 4px 4px 0; }
.hbar-value { color: var(--ink); white-space: nowrap; }
.table-wrap { overflow-x: auto; margin: 0 0 26px; border: 2px solid var(--ink); border-radius: 12px; background: var(--field); }
.stats-table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.stats-table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1.5px solid color-mix(in srgb, var(--ink) 20%, transparent); white-space: nowrap; }
.stats-table td { padding: 8px 12px; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); white-space: nowrap; }
.stats-table td:not(:first-child), .stats-table th:not(:first-child) { text-align: right; }
.retention td.ret-cell { text-align: center; font-variant-numeric: tabular-nums; color: var(--ink); border: 2px solid var(--field); }
.retention td.ret-deep { color: #15130f; }
.retention th:nth-child(n+3) { text-align: center; }
.numbers { margin: 0 0 18px; }
.numbers summary { cursor: pointer; margin-bottom: 10px; }
.stats-foot { margin-top: 4px; }
@media (max-width: 520px) {
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .admin-tabs .tab { padding: 0 9px; flex: none; }
  .admin-tabs .count-pill { margin-left: 2px; }
  .stats-table th, .stats-table td { padding-left: 9px; padding-right: 9px; }
  .kpi-value { font-size: 26px; }
  .hbar { grid-template-columns: 7.5em 1fr auto; }
}

/* Over time: one line chart with a toggling legend. */
.s1 { --c: var(--series-1); } .s2 { --c: var(--series-2); } .s3 { --c: var(--series-3); } .s4 { --c: var(--series-4); }
.s5 { --c: var(--series-5); } .s6 { --c: var(--series-6); } .s7 { --c: var(--series-7); }
.trend { margin: 0 0 26px; border: 2px solid var(--ink); border-radius: 12px; background: var(--field); padding: 14px 14px 8px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 10px; }
button.legend-item { padding: 5px 10px; border: 1.5px solid var(--rule); background: var(--field); border-radius: var(--radius); font: 600 13.5px system-ui, sans-serif; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
button.legend-item[aria-pressed="false"] { opacity: 0.45; border-style: dashed; }
button.legend-item[aria-pressed="false"] .key { background: var(--muted); }
.legend-total { color: var(--muted); font-size: 11px; }
.legend-total:empty { display: none; }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--c); flex: none; }
.trend-plot { position: relative; min-height: 220px; }
.trend-svg { display: block; overflow: visible; }
.trend-svg:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.trend-svg .grid { stroke: color-mix(in srgb, var(--ink) 10%, transparent); stroke-width: 1; }
.trend-svg .grid.base { stroke: color-mix(in srgb, var(--ink) 35%, transparent); }
.trend-svg .tick { fill: var(--muted); font: 11.5px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.trend-svg .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend-svg .dot { fill: var(--c); stroke: var(--field); stroke-width: 2; }
.trend-svg .crosshair { stroke: color-mix(in srgb, var(--ink) 45%, transparent); stroke-width: 1; }
.trend-svg .hit { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.trend-tip { position: absolute; z-index: 2; pointer-events: none; min-width: 150px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); padding: 8px 10px; display: grid; gap: 3px; }
.tip-head { color: var(--ink); margin-bottom: 2px; }
.tip-row { display: grid; grid-template-columns: 14px auto 1fr; gap: 7px; align-items: center; font-size: 13.5px; }
.tip-row strong { font-variant-numeric: tabular-nums; }
.tip-name { color: var(--muted); }
.trend .numbers { margin: 8px 0 4px; }
.trend .numbers .table-wrap { margin: 8px 0 6px; border-width: 1.5px; }

/* QR codes page: views, finding a QR code, labels, and the Scans view. */
.codes-tabs { margin: 0 0 14px; }
.code-tools { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(3, auto); gap: 8px; margin: 0 0 12px; }
.code-tools input, .code-tools select { font: 15px/1.3 system-ui, sans-serif; color: var(--ink); background: var(--field); border: 1.5px solid var(--ink); padding: 9px 10px; border-radius: var(--radius); min-width: 0; }
.code-tools input { width: 100%; }
.match { margin: 0 0 10px; }
.code-card .qr-label { margin-top: 8px; font-size: 12.5px; line-height: 1.3; color: var(--ink); background: color-mix(in srgb, var(--signal) 18%, transparent); padding: 2px 7px; border-radius: 5px; justify-self: start; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#no-match p { margin: 0 0 12px; }
#no-match button { margin: 0; }
.history-note { margin: -4px 0 12px; color: var(--muted); font-size: 14px; }
.history-note a { color: var(--ink); font-weight: 600; }
#scan-status:empty { display: none; }
.stats-bar #export { margin: 0; padding: 7px 12px; font-size: 14px; box-shadow: none; }
.legend-name { max-width: 16em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank td.rank-name { white-space: normal; min-width: 12em; }
.rank-name a { color: var(--ink); font-weight: 600; }
.rank-sub { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.quiet { display: block; color: var(--warn); font-size: 10.5px; }
@media (max-width: 620px) {
  .code-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .code-tools input { grid-column: 1 / -1; }
  .code-tools select { font-size: 14px; padding: 8px 6px; }
}

/* Dashboard feature flags */
.set-card > .row.flag-row { align-items: flex-start; gap: 12px; margin: 0; cursor: pointer; }
.flag-row input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.flag-text { display: grid; gap: 2px; font: 15px/1.4 system-ui, sans-serif; color: var(--ink); }
.flag-key { color: var(--muted); }
#flags-status { margin: 8px 0 22px; }
@media (max-width: 520px) { .rank th:nth-child(3), .rank td:nth-child(3) { display: none; } }

/* QR code names: the card's title; what it opens beneath; unnamed ones say so. */
.code-card .dest { margin-top: 2px; font-size: 13.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-card.unnamed .summary::after { content: "Unnamed"; display: block; margin-top: 2px; font: 600 12px system-ui, sans-serif; color: var(--warn); }
.code-card.locked.unnamed .summary::after { content: none; }

/* Dashboard: two-step sign-in */
.two-step { padding: 20px; max-width: 520px; margin-bottom: 18px; }
.two-step h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.two-step > .note { margin: 0 0 14px; }
.two-step-steps { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.two-step-steps > li { counter-increment: step; display: grid; gap: 6px; padding-left: 36px; position: relative; justify-items: start; }
.two-step-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; display: grid; place-items: center; background: var(--ink); color: var(--paper); border-radius: 6px; font: 700 13px system-ui, sans-serif; }
.step-note { color: var(--muted); font-size: 14px; }
.two-step-steps img { width: 180px; height: 180px; background: #fff; padding: 8px; border: 1.5px solid var(--ink); border-radius: var(--radius); }
.two-step-steps .btn { margin: 0; }
.two-step-key summary, .two-step-lost summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.key-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; flex-wrap: wrap; }
.key-row button { margin: 0; padding: 6px 12px; font-size: 14px; box-shadow: none; }
.two-step .secret { font: 14px/1.5 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.04em; overflow-wrap: anywhere; user-select: all; }
.two-step-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.two-step-form label { margin: 0; }
.two-step-form input { width: 9em; font-size: 22px; letter-spacing: 0.15em; }
.two-step-form button { margin: 0; }
#two-step-status:empty { display: none; }
.two-step-lost { margin-top: 14px; }
.two-step-lost .secret { display: block; margin-top: 6px; padding: 8px; background: var(--paper); border: 1.5px dashed var(--ink); border-radius: var(--radius); font-size: 12.5px; }
/* On phones, add to the app directly (you can't scan your own screen); elsewhere, scan. */
.only-narrow { display: none !important; }
@media (pointer: coarse) and (max-width: 820px) {
  .only-narrow { display: inline-flex !important; }
  .only-wide { display: none !important; }
}
