/*
 * Licensing — light theme.
 * Cool paper-grey page, white panels, PremierVPN steel blue for actions.
 * IBM Plex Sans for the interface; IBM Plex Mono only for keys and code.
 * No build step and no CDN: this file plus self-hosted fonts.
 */

/* ------------------------------------------------------------------ */
/* Fonts                                                               */
/* ------------------------------------------------------------------ */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */
:root {
  color-scheme: light;

  /* Surfaces */
  --page: #f3f5f7;          /* behind everything */
  --surface: #ffffff;       /* panels, header, sidebar */
  --sunken: #f7f8fa;        /* inputs, key boxes, code */
  --hover: #eef1f4;
  --line: #dfe3e8;
  --line-strong: #c9d0d8;

  /* Text */
  --ink: #1e2833;           /* headings, key values */
  --ink-2: #3c4856;         /* body */
  --muted: #66717e;         /* captions, labels */
  --faint: #98a1ab;         /* placeholders, disabled */

  /* Brand: PremierVPN steel blue, darkened for contrast on white */
  --brand: #3b6491;
  --brand-hover: #325680;
  --brand-press: #2b4b70;
  --brand-tint: #e9eff6;
  --brand-line: #c5d4e5;

  /* Status */
  --ok: #2d7650;     --ok-tint: #e7f3ec;     --ok-line: #bfdccb;
  --warn: #8f5c08;   --warn-tint: #fbf2df;   --warn-line: #ecd3a2;
  --bad: #b0352e;    --bad-tint: #f9e8e6;    --bad-line: #ecc1bd;
  --info: #3b6491;   --info-tint: #e9eff6;   --info-line: #c5d4e5;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;

  /* Radius by role, not one size for everything */
  --r-chip: 4px;
  --r-control: 6px;
  --r-panel: 8px;

  --shadow-pop: 0 1px 2px rgba(30, 40, 51, .06), 0 8px 24px rgba(30, 40, 51, .12);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --fast: 120ms;
  --base: 220ms;

  --sidebar-w: 232px;
  --gutter: 32px;

  /* Legacy token names still referenced from a few inline styles */
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-tertiary: var(--muted);
  --accent: var(--brand);
  --border-subtle: var(--line);
  --border-default: var(--line);
  --bg-raised: var(--surface);
  --bg-sunken: var(--sunken);
  --status-secure: var(--ok);
  --status-warning: var(--warn);
  --status-danger: var(--bad);
  --chart-muted: #c9d3df;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink-2);
  font: 400 14px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 12px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; }
.icon { flex: none; display: inline-block; vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code, kbd, pre, .mono { font-family: var(--font-mono); }
code { font-size: 12.5px; color: var(--ink); background: var(--hover); padding: 1px 5px; border-radius: 3px; }
pre { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-control); padding: 12px 14px; overflow: auto; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; margin: 0; }
kbd { font-size: 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
::selection { background: #cddcec; color: var(--ink); }
.num, .tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Type scale (1.2 ratio from 14px) */
.t-display { font: 600 40px/1.12 var(--font-sans); color: var(--ink); letter-spacing: -0.01em; }
.t-title-1 { font: 600 28px/1.2 var(--font-sans); color: var(--ink); }
.t-title-2 { font: 600 20px/1.3 var(--font-sans); color: var(--ink); }
.t-title-3 { font: 600 16px/1.4 var(--font-sans); color: var(--ink); }
.t-body { font-size: 15px; line-height: 1.6; }
.t-callout { font-size: 13px; line-height: 1.5; }
.t-caption { font-size: 12px; line-height: 1.45; color: var(--muted); }
.t-micro { font: 500 11px/1.3 var(--font-sans); color: var(--muted); }
.t-label { font: 500 12px/1.35 var(--font-sans); color: var(--muted); }
.t-mono-label { font: 500 12px/1.35 var(--font-sans); color: var(--muted); }
.t-primary { color: var(--ink); }
.t-secondary { color: var(--ink-2); }
.t-muted { color: var(--muted); }
.t-danger { color: var(--bad); }
.t-secure { color: var(--ok); }
.t-warning { color: var(--warn); }
.t-accent { color: var(--brand); }
.t-right { text-align: right; }
.t-center { text-align: center; }
.t-nowrap { white-space: nowrap; }
.t-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.t-strong { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------------ */
/* Layout helpers                                                      */
/* ------------------------------------------------------------------ */
.stack > * + * { margin-top: var(--stack, 16px); }
.stack-sm { --stack: 8px; }
.stack-lg { --stack: 24px; }
.stack-xl { --stack: 32px; }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.row-wrap { flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.row-top { align-items: flex-start; }
.gap-xs { --gap: 4px; } .gap-sm { --gap: 8px; } .gap-lg { --gap: 20px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: var(--gap, 16px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mt-0 { margin-top: 0 !important; } .mt-sm { margin-top: 8px; } .mt { margin-top: 16px; } .mt-lg { margin-top: 24px; } .mt-xl { margin-top: 40px; }
.mb-0 { margin-bottom: 0 !important; } .mb-sm { margin-bottom: 8px; } .mb { margin-bottom: 16px; } .mb-lg { margin-bottom: 24px; }
.w-full { width: 100%; }
@media (max-width: 1100px) {
  .grid-main-side { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hide-sm { display: none !important; }
}
@media (max-width: 360px) { .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ */
/* App shell: sidebar + main                                           */
/* ------------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 12px 12px;
  overflow-y: auto;
}

/* Logo: keyhole mark + store name */
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: none; color: var(--brand); }
.brand__mark svg { width: 100%; height: 100%; }
.brand__name { font: 600 15px/1.2 var(--font-sans); }
.brand__sub { display: block; font: 400 12px/1.3 var(--font-sans); color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav__section { font: 500 12px/1 var(--font-sans); color: var(--muted); padding: 20px 10px 8px; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px;
  border-radius: var(--r-control);
  color: var(--ink-2); font-weight: 500; font-size: 14px;
  text-decoration: none;
}
.nav__item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav__item .icon { color: var(--muted); }
.nav__item.is-active { background: var(--brand-tint); color: var(--brand-press); font-weight: 600; }
.nav__item.is-active .icon { color: var(--brand); }
.nav__count { margin-left: auto; font: 500 12px/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted); }
.sidebar__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-control); color: var(--ink-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-press); font: 600 12px/1 var(--font-sans); flex: none; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar .topbar__menu { display: none; }
.topbar--compact { display: none; }
.topbar--compact + .content, .main > .content:first-child { padding-top: 32px; }
.content { padding: 28px var(--gutter) 64px; width: 100%; max-width: 1320px; }
.content--narrow { max-width: 960px; }

@media (max-width: 960px) {
  :root { --gutter: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 272px; transform: translateX(-102%); transition: transform var(--base) var(--ease); box-shadow: var(--shadow-pop); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar .topbar__menu { display: inline-flex; }
  .topbar--compact { display: flex; }
}
.scrim { position: fixed; inset: 0; background: rgba(30, 40, 51, .35); opacity: 0; pointer-events: none; transition: opacity var(--base); z-index: 50; }

/* Search field (⌘K) */
.search { position: relative; flex: 1 1 auto; max-width: 480px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 36px; padding: 0 56px 0 34px;
  background: var(--sunken); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-control);
  font: 400 14px var(--font-sans);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }

/* Page heading */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head__title { font: 600 24px/1.25 var(--font-sans); color: var(--ink); }
.page-head__sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ */
/* Panels, figures, data lists                                         */
/* ------------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 20px 22px;
  min-width: 0;
}
.card--flush { padding: 0; overflow: hidden; }
.card--sunken { background: var(--sunken); }
.card--hero { background: var(--surface); }
.card--tint-warning { background: var(--warn-tint); border-color: var(--warn-line); }
.card--tint-danger { background: var(--bad-tint); border-color: var(--bad-line); }
.card--tint-secure { background: var(--ok-tint); border-color: var(--ok-line); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card--flush .card__head { padding: 16px 22px 0; margin-bottom: 12px; }
.card__title { font: 600 15px/1.4 var(--font-sans); color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card__title .icon { color: var(--muted); }
.card__sub { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.card__foot { border-top: 1px solid var(--line); margin: 18px -22px -20px; padding: 12px 22px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.card--flush .card__foot { margin: 0; }

/* Figures: a row of tiles reads as one strip divided by rules */
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px 20px; min-width: 0; position: relative; }
.grid-4:has(> .tile) { gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.grid-4 > .tile { border: 0; border-radius: 0; }
.tile__label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tile__label .icon { display: none; }
.tile__value { margin-top: 6px; font: 600 26px/1.15 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__value small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.tile__value--text { font-size: 18px; line-height: 1.3; white-space: normal; }
.tile__meta { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.tile__spark { display: none; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--bad); }

.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 0; margin: 0; }
.dl dt { padding: 10px 0; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.dl dd { padding: 10px 0 10px 24px; margin: 0; text-align: right; color: var(--ink); border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.dl dt:first-of-type, .dl dd:first-of-type { border-top: 0; }
.dl--left dd { text-align: left; }

/* Product initials */
.mark { width: 40px; height: 40px; flex: none; border-radius: var(--r-control); display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-press); font: 600 14px/1 var(--font-sans); }
.mark--sm { width: 30px; height: 30px; font-size: 12px; }
.mark--lg { width: 56px; height: 56px; font-size: 18px; }
.mark--hero { width: 64px; height: 64px; font-size: 21px; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
  --h: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 14px;
  border-radius: var(--r-control);
  border: 1px solid var(--brand);
  background: var(--brand); color: #fff;
  font: 500 14px/1 var(--font-sans);
  text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; }
.btn:active { background: var(--brand-press); border-color: var(--brand-press); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { background: var(--hover); border-color: var(--line-strong); }
.btn--secondary:active { background: var(--line); border-color: var(--line-strong); }
.btn--ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn--ghost:hover { background: var(--hover); color: var(--ink); border-color: transparent; }
.btn--ghost:active { background: var(--line); border-color: transparent; }
.btn--danger { background: var(--bad); border-color: var(--bad); }
.btn--danger:hover, .btn--danger:active { background: #962b25; border-color: #962b25; }
.btn--danger-ghost { background: var(--surface); color: var(--bad); border-color: var(--bad-line); }
.btn--danger-ghost:hover, .btn--danger-ghost:active { background: var(--bad-tint); border-color: var(--bad-line); }
.btn--sm { --h: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn--lg { --h: 44px; padding: 0 20px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon { width: var(--h); padding: 0; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* Status labels & banners                                             */
/* ------------------------------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: var(--r-chip);
  font: 500 12px/1 var(--font-sans);
  color: var(--ink-2);
  background: var(--hover);
  white-space: nowrap; vertical-align: middle;
}
.chip__dot { display: none; }
.chip--secure { color: var(--ok); background: var(--ok-tint); }
.chip--warning { color: var(--warn); background: var(--warn-tint); }
.chip--danger { color: var(--bad); background: var(--bad-tint); }
.chip--info { color: var(--brand-press); background: var(--brand-tint); }
.chip--mono { font: 400 12px/1 var(--font-sans); color: var(--muted); background: transparent; border: 1px solid var(--line); }

.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2);
  font-size: 14px;
}
.banner .icon { margin-top: 2px; color: var(--muted); }
.banner__body { flex: 1; min-width: 0; }
.banner__body strong { color: var(--ink); }
.banner__actions { display: flex; gap: 8px; flex: none; align-self: center; }
.banner--secure { background: var(--ok-tint); border-color: var(--ok-line); }
.banner--secure .icon { color: var(--ok); }
.banner--warning { background: var(--warn-tint); border-color: var(--warn-line); }
.banner--warning .icon { color: var(--warn); }
.banner--danger { background: var(--bad-tint); border-color: var(--bad-line); }
.banner--danger .icon { color: var(--bad); }
.banner--info { background: var(--info-tint); border-color: var(--info-line); }
.banner--info .icon { color: var(--info); }
.banner + .banner { margin-top: 10px; }

/* Flash toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { box-shadow: var(--shadow-pop); animation: toast-in var(--base) var(--ease); }
.toast.banner--secure, .toast.banner--warning, .toast.banner--danger, .toast.banner--info { background-color: var(--surface); border-left-width: 3px; }
.toast.banner--secure { border-left-color: var(--ok); }
.toast.banner--warning { border-left-color: var(--warn); }
.toast.banner--danger { border-left-color: var(--bad); }
.toast.banner--info { border-left-color: var(--brand); }
.toast.is-leaving { animation: toast-out 180ms var(--ease) forwards; }
.toast__close { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; margin: -2px -4px 0 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font: 500 12.5px/1.2 var(--font-sans); color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--sunken);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8f9fb; }
.table .is-link { cursor: pointer; }
.table td:first-child, .table th:first-child { padding-left: 22px; }
.table td:last-child, .table th:last-child { padding-right: 22px; }
.table .cell-main { color: var(--ink); font-weight: 500; }
.table .cell-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; font-weight: 400; }
.table .cell-actions { text-align: right; white-space: nowrap; }
.table--compact td { padding-top: 8px; padding-bottom: 8px; }
.table--inset td:first-child, .table--inset th:first-child { padding-left: 0; }
.table--inset td:last-child, .table--inset th:last-child { padding-right: 0; }
.table--inset th { background: none; }
.table tr.is-dim td { opacity: 0.6; }
.table tr.is-selected td { background: var(--brand-tint); }

/* Licence keys: the one place a monospaced face earns its keep */
.key { font: 500 13px/1.2 var(--font-mono); color: var(--ink); letter-spacing: 0.02em; white-space: nowrap; }
.key--lg { font-size: 18px; letter-spacing: 0.05em; }
.keybox { display: flex; align-items: center; gap: 12px; justify-content: space-between; background: var(--sunken); border: 1px dashed var(--line-strong); border-radius: var(--r-control); padding: 10px 10px 10px 14px; }
.keybox .key { overflow: hidden; text-overflow: ellipsis; }

.empty { text-align: center; padding: 44px 24px; color: var(--muted); }
.empty .icon { margin: 0 auto 12px; color: var(--faint); }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { max-width: 380px; margin: 0 auto 18px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: 16px; }
.label { font: 500 13px/1.3 var(--font-sans); color: var(--ink); display: flex; justify-content: space-between; gap: 10px; }
.label .t-caption { font-weight: 400; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; min-height: 38px;
  padding: 8px 11px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  font: 400 14px/1.4 var(--font-sans);
  transition: border-color var(--fast), box-shadow var(--fast);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: #b3bcc7; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.input:disabled { background: var(--sunken); color: var(--muted); }
.input--mono { font-family: var(--font-mono); font-size: 13px; }
.input--lg { min-height: 44px; font-size: 15px; }
.input--code { font: 500 22px/1 var(--font-mono); letter-spacing: 0.3em; text-align: center; min-height: 54px; }
.textarea { min-height: 110px; resize: vertical; }
.textarea--mono { font: 400 12.5px/1.55 var(--font-mono); }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366717e' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--r-control) 0 0 var(--r-control); }
.input-group .btn { border-radius: 0 var(--r-control) var(--r-control) 0; height: auto; }
.input-affix { position: relative; }
.input-affix__pre { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.input-affix .input { padding-left: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .field + .field { margin-top: 0; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid .span-2 { grid-column: auto; } }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.form-error { color: var(--bad); font-size: 12.5px; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.check__text small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Radio choices (e.g. how email is sent) */
.choice-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-control); }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; border-top: 1px solid var(--line); }
.choice:first-child { border-top: 0; }
.choice:hover { background: var(--sunken); }
.choice:has(input:checked) { background: var(--brand-tint); }
.choice input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.choice strong { display: block; color: var(--ink); font-weight: 500; }
.choice small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 7px 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; padding-top: 0; }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; transition: background var(--fast); flex: none; }
.switch__track::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,.2); transition: transform var(--base) var(--ease); }
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Filter buttons (segmented) */
.segmented { display: inline-flex; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--r-control); overflow: hidden; flex-wrap: wrap; background: var(--surface); }
.segmented a, .segmented button, .segmented > label { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; color: var(--ink-2); font: 500 13px/1 var(--font-sans); text-decoration: none; border: 0; border-left: 1px solid var(--line); background: none; cursor: pointer; white-space: nowrap; }
.segmented > :first-child { border-left: 0; }
.segmented a:hover, .segmented button:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.segmented .is-active { background: var(--brand-tint); color: var(--brand-press); }
.segmented .count { font: 400 12px/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { display: inline-flex; gap: 8px; align-items: center; padding: 10px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--brand); }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.filters .input, .filters .select { min-height: 34px; padding-top: 5px; padding-bottom: 5px; width: auto; }
.filters .input { min-width: 240px; flex: 1 1 260px; }

/* Dropdown (details/summary) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); padding: 5px; }
.dropdown__menu--up { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
.dropdown__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 4px; color: var(--ink-2); font: 400 14px/1.2 var(--font-sans); background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; }
.dropdown__item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.dropdown__item .icon { color: var(--muted); }
.dropdown__item--danger { color: var(--bad); }
.dropdown__item--danger .icon { color: var(--bad); }
.dropdown__sep { height: 1px; background: var(--line); margin: 5px 4px; }
.dropdown__label { padding: 8px 10px 4px; font-size: 12px; color: var(--muted); }

/* Dialog */
dialog.modal { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); color: var(--ink-2); padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
dialog.modal::backdrop { background: rgba(30, 40, 51, .4); }
.modal__body { padding: 22px; }
.modal__title { font: 600 17px/1.35 var(--font-sans); color: var(--ink); margin-bottom: 8px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--sunken); border-radius: 0 0 var(--r-panel) var(--r-panel); }

/* Meter (install slots) */
.meter { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.meter__fill { height: 100%; border-radius: inherit; background: var(--brand); }
.meter--warning .meter__fill { background: #c48a1c; }
.meter--danger .meter__fill { background: var(--bad); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.list--flush > li { padding-left: 22px; padding-right: 22px; }
.list--flush > li:first-child { padding-top: 11px; }
.list--flush > li:last-child { padding-bottom: 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.dot--secure { background: var(--ok); }
.dot--warning { background: #c48a1c; }
.dot--danger { background: var(--bad); }
.dot--info { background: var(--brand); }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 14px 20px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line-strong); }
.timeline li::after { content: ""; position: absolute; left: 6.5px; top: 17px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li:last-child { padding-bottom: 0; }

/* Charts */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font: 400 11px var(--font-sans); }
.chart .grid line { stroke: var(--line); }
.chart .bar { fill: var(--brand); }
.chart .bar--muted { fill: #c9d3df; }
.chart .bar:hover { fill: var(--brand-press); }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#chartFill); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--brand); display: inline-block; }
.legend i.muted { background: #c9d3df; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bars__row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 13px; }
.bars__track { height: 8px; background: var(--hover); border-radius: 4px; overflow: hidden; }
.bars__fill { height: 100%; background: var(--brand); border-radius: inherit; }

/* ------------------------------------------------------------------ */
/* Public store                                                        */
/* ------------------------------------------------------------------ */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: 1120px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 24px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-nav a.link { color: var(--ink-2); font-weight: 500; padding: 8px 12px; border-radius: var(--r-control); }
.site-nav a.link:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.site-main { max-width: 1120px; margin: 0 auto; padding: 40px 24px 80px; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.site-footer__inner { max-width: 1120px; margin: 0 auto; padding: 24px; display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
@media (max-width: 720px) { .site-nav .hide-sm { display: none; } .site-header__inner { gap: 12px; } }

/* Store intro: plain text on the page, no box */
.hero { padding: 24px 0 8px; max-width: 760px; }
.hero__eyebrow { display: none; }
.hero__title { font: 600 38px/1.15 var(--font-sans); letter-spacing: -0.01em; color: var(--ink); max-width: 680px; }
.hero__lead { font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 600px; margin: 14px 0 0; }
.hero__actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
@media (max-width: 720px) { .hero { padding-top: 8px; } .hero__title { font-size: 29px; } }

.product-head { display: flex; gap: 20px; align-items: flex-start; padding: 16px 0 8px; max-width: 820px; }
.product-head__name { font: 600 34px/1.15 var(--font-sans); color: var(--ink); }
.product-head__meta { margin: 6px 0 0; color: var(--muted); }
@media (max-width: 720px) { .product-head { flex-direction: column; gap: 14px; } .product-head__name { font-size: 28px; } }

.how { margin-top: 56px; gap: 32px; }
.how > div { border-top: 1px solid var(--line-strong); padding-top: 16px; }
.how p { margin: 6px 0 0; color: var(--ink-2); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 48px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.section-title h2 { font: 600 18px/1.3 var(--font-sans); }

.product-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-panel); padding: 20px;
  color: inherit; text-decoration: none;
  transition: border-color var(--fast);
}
.product-card:hover { border-color: var(--brand-line); text-decoration: none; }
.product-card:hover .product-card__name { color: var(--brand); }
.product-card__top { display: flex; gap: 14px; align-items: center; }
.product-card__name { font: 600 16px/1.3 var(--font-sans); color: var(--ink); }
.product-card__desc { color: var(--ink-2); font-size: 14px; flex: 1; margin: 0; min-height: 42px; }
.product-card__foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
.price { font: 600 19px/1 var(--font-sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.price small { font: 400 13px var(--font-sans); color: var(--muted); margin-left: 3px; }

.price-card { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px; position: relative; }
.price-card.is-featured { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.price-card__badge { position: absolute; top: -11px; left: 18px; }
.price-card__badge .chip { background: var(--brand); color: #fff; }
.price-card__name { font: 600 15px/1.3 var(--font-sans); color: var(--ink); }
.price-card .price { font-size: 28px; }
.feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list .icon { color: var(--ok); margin-top: 2px; }

.prose { color: var(--ink-2); font-size: 15px; line-height: 1.65; max-width: 72ch; }
.prose p { margin: 0 0 14px; }
.prose h2, .prose h3 { margin: 22px 0 10px; }
.prose ul { margin: 0 0 14px; padding-left: 18px; }
.prose li + li { margin-top: 4px; }
.prose li::marker { color: var(--muted); }
.changelog { white-space: pre-wrap; font: 400 13px/1.6 var(--font-mono); color: var(--ink-2); }

/* ------------------------------------------------------------------ */
/* Sign-in                                                             */
/* ------------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth__panel { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.auth__form { width: 100%; max-width: 380px; margin: 0 auto; }
.auth__aside { background: var(--page); border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; padding: 56px; }
.auth__title { font: 600 26px/1.25 var(--font-sans); color: var(--ink); margin: 32px 0 6px; }
.auth__alt { margin-top: 24px; font-size: 14px; color: var(--muted); text-align: center; }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth__aside { display: none; } .auth__panel { padding: 32px 20px; } }

/* A licence, drawn as the thing it is: a key on a slip of paper */
.licence-slip { max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: 0 1px 2px rgba(30, 40, 51, .05); overflow: hidden; }
.licence-slip__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px dashed var(--line-strong); font-size: 13px; color: var(--muted); }
.licence-slip__body { padding: 18px; }
.licence-slip__key { font: 500 17px/1.2 var(--font-mono); color: var(--ink); letter-spacing: 0.05em; }
.licence-slip__rows { margin-top: 14px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; }
.licence-slip__rows dt { color: var(--muted); }
.licence-slip__rows dd { margin: 0; color: var(--ink); }
.auth__copy { max-width: 400px; margin-top: 28px; }
.auth__copy p { color: var(--ink-2); margin: 6px 0 0; }

/* Minimal centred layout (errors, receipts) */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.center-card { width: 100%; max-width: 520px; text-align: center; }
.error-code { font: 600 56px/1 var(--font-sans); color: var(--faint); }

/* QR */
.qr { background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-control); width: 172px; height: 172px; display: grid; place-items: center; }
.qr img, .qr canvas { width: 150px; height: 150px; image-rendering: pixelated; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font: 500 14px var(--font-mono); color: var(--ink); letter-spacing: 0.05em; }
.codes span { background: var(--sunken); border: 1px solid var(--line); border-radius: 4px; padding: 8px; text-align: center; }

/* Copy button feedback */
[data-copy].is-copied { color: var(--ok) !important; border-color: var(--ok-line) !important; }

/* Receipt */
.receipt { max-width: 760px; margin: 40px auto; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .receipt { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Context tweaks */
.site-header .brand { padding: 0; }
.auth .brand { padding: 0 0 8px; }
input[type=file].input { padding: 5px; cursor: pointer; }
input[type=file]::file-selector-button { margin-right: 12px; height: 28px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--sunken); color: var(--ink); font: 500 13px var(--font-sans); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--hover); }
