/* NIMDEE website: the NIMDEE Site Desk palette (warm paper surfaces, navy ink, blue accent, gold mark, charcoal hero)
   with the add-in's numbered-card design. Inter (SIL Open Font License, fonts/LICENSE.txt) is served from this site. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f3f1ea;
  --surface-3: #f9f7f2;
  --text: #172033;
  --heading: #0e1c30;
  --muted: #5f6b80;
  --border: #e3ded0;
  --border-soft: #ece8dc;
  --accent: #3a63c9;
  --accent-hover: #235bc7;
  --accent-soft: #e8eefb;
  --gold: #c9962f;
  --gold-2: #e2b24c;
  --badge: #0e1c30;
  --badge-text: #ffffff;
  --hero-text: #ffffff;
  --hero-muted: #d4d4d8;
  --ok: #1a9c5c;
  --ok-soft: #e7f6ef;
  --warn: #b45f06;
  --warn-soft: #fff4df;
  --bad: #dc2626;
  --bad-soft: #fdebed;
  --hover-tint: rgba(58, 99, 201, 0.05);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 20, 30, 0.06), 0 2px 8px rgba(16, 20, 30, 0.05);
  --shadow-lg: 0 2px 4px rgba(16, 20, 30, 0.06), 0 14px 32px rgba(16, 20, 30, 0.12);
  --focus-ring: 0 0 0 3px rgba(58, 99, 201, 0.22);
  --hero-bg:
    radial-gradient(600px 400px at 12% 18%, rgba(109, 63, 209, 0.35), transparent 70%),
    radial-gradient(520px 380px at 88% 82%, rgba(214, 163, 58, 0.28), transparent 70%),
    radial-gradient(480px 360px at 80% 12%, rgba(45, 91, 209, 0.3), transparent 70%),
    linear-gradient(160deg, #16171a, #1f2024);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518;
    --surface: #1c1d21;
    --surface-2: #25262b;
    --surface-3: #222327;
    --text: #e4e4e7;
    --heading: #f4f4f5;
    --muted: #a1a1aa;
    --border: #303137;
    --border-soft: #2a2b30;
    --accent: #5b86f5;
    --accent-hover: #7da1ff;
    --accent-soft: #1f2a44;
    --badge: #f4f4f5;
    --badge-text: #141518;
    --ok: #34c281;
    --ok-soft: #15301f;
    --warn: #f0a63e;
    --warn-soft: #36290f;
    --bad: #ff6b74;
    --bad-soft: #3a1c1f;
    --hover-tint: rgba(125, 161, 255, 0.06);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 14px 32px rgba(0, 0, 0, 0.4);
    --focus-ring: 0 0 0 3px rgba(91, 134, 245, 0.35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
}
main { flex: 1; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.015em; color: var(--heading); font-weight: 750; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; }
.mid { max-width: 820px; }

/* Header and footer */
.site-header { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); text-decoration: none; font-weight: 800; letter-spacing: 0.14em; font-size: 0.95rem; }
.brand:hover { color: var(--heading); }
.brand img { width: 30px; height: 30px; }
.brand small { font-weight: 500; letter-spacing: 0; color: var(--muted); font-size: 0.8rem; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a:not(.btn) { color: var(--text); text-decoration: none; padding: 7px 11px; border-radius: 8px; font-weight: 550; font-size: 0.93rem; }
.nav a:not(.btn):hover { background: var(--surface-2); color: var(--heading); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; padding: 28px 0; margin-top: 56px; }
.site-footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--heading); }

@media (max-width: 560px) {
  .brand small { display: none; }
  .nav a:not(.btn) { padding: 7px 6px; }
  .nav .btn { padding: 7px 12px; }
}

/* Buttons (Site Desk: 10px corners, a soft white sheen on the primary) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--accent);
  background-color: var(--accent); background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
  color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 20, 30, 0.12), 0 4px 12px rgba(58, 99, 201, 0.25);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.btn:hover { background-color: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16, 20, 30, 0.12), 0 8px 18px rgba(58, 99, 201, 0.32); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: 0 1px 2px rgba(16, 20, 30, 0.05); }
.btn.secondary:hover { background: var(--surface-3); border-color: var(--accent); color: var(--heading); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--border); box-shadow: none; }
.btn.danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 0.87rem; }
.btn.block { width: 100%; padding: 12px; }
.btn.light { background: #fff; border-color: #fff; color: #16171a; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.btn.light:hover { background: #f4f1e8; border-color: #f4f1e8; color: #16171a; }
.btn.ghost-light { background: rgba(255, 255, 255, 0.06); color: #fff; border-color: rgba(255, 255, 255, 0.3); box-shadow: none; }
.btn.ghost-light:hover { border-color: #fff; background: rgba(255, 255, 255, 0.12); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.end { justify-content: flex-end; }

/* Hero (the Site Desk sign-in backdrop) */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-text); padding: 76px 0 84px; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #d6a33a, #b3306d, #6d3fd1, #2d5bd1, #0b7a6f); }
.hero h1, .hero h2 { color: #fff; }
.hero p.lead { color: var(--hero-muted); font-size: 1.12rem; max-width: 640px; }
.hero .eyebrow { color: var(--gold-2); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; font-weight: 700; color: var(--gold); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 6px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 3px 8px rgba(201, 150, 47, 0.35); }
.hero .actions { margin-top: 28px; }
.hero .fine { color: var(--hero-muted); font-size: 0.9rem; margin-top: 14px; }

.section { padding: 56px 0 0; }
.section-head { max-width: 680px; margin-bottom: 24px; }
.section-head.center { margin: 0 auto 8px; }
.section-head p { color: var(--muted); }

/* Numbered cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; min-width: 0; transition: box-shadow 0.18s, transform 0.18s; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid > .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; }
.card-head .spacer { flex: 1; }
.badge {
  display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 8px;
  border-radius: 8px; background: var(--badge); color: var(--badge-text);
  font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.card p.muted, .muted { color: var(--muted); }
.feature ul { margin: 0; padding-left: 18px; color: var(--muted); }
.feature li { margin: 2px 0; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* Segmented selector (billing period, enterprise seats) */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.segmented button {
  border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 600;
  padding: 7px 16px; border-radius: 9px; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--heading); }
.segmented button[aria-pressed="true"] { background: var(--badge); color: var(--badge-text); box-shadow: var(--shadow); }
.segmented.small button { padding: 5px 12px; font-size: 0.88rem; }
.center { text-align: center; }
.period { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px 0 28px; }
.pay-note { max-width: 560px; margin: 0; text-align: center; font-size: 0.92rem; }

/* Pricing */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 860px; margin: 0 auto; }
.plan { display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg); }
.price { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; color: var(--heading); font-variant-numeric: tabular-nums; }
.price small { font-size: 0.95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 22px; flex: 1; }
.plan li { padding: 6px 0 6px 26px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.seat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.status-gap { margin-top: 16px; }

/* Forms */
.form-page { padding: 48px 16px 0; }
.form-page h1 { font-size: 1.8rem; }
form .field { margin-bottom: 16px; }
label { display: block; font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; }
input[type="email"], input[type="password"], input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 0.92rem; font-weight: 500; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.form-grid .full { grid-column: 1 / -1; }
.notes { white-space: pre-line; font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
input[aria-invalid="true"] { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: 0.85rem; margin-top: 4px; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
/* Continue with Google (Google's own look: white, grey border, the four-colour G) */
.btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; gap: 10px; }
.btn.google:hover { background: #f8f9fa; color: #1f1f1f; }
.btn.google img { flex: none; }
.google-wrap { margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 0.85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 0.9rem; }
.links a { font-weight: 600; text-decoration: none; }
.links a:hover { text-decoration: underline; }
.notice { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 0.93rem; background: var(--surface-3); border: 1px solid var(--border); border-left: 4px solid var(--accent); }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; border-left-color: var(--ok); }
.notice.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; border-left-color: var(--bad); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; border-left-color: var(--warn); }
.notice p:last-child { margin: 0; }

/* Sign-in, sign-up and e-mail-link pages: the Site Desk sign-in screen (a card on the charcoal backdrop). */
body.auth main { background: var(--hero-bg); padding-bottom: 64px; }
body.auth .site-footer { margin-top: 0; }
body.auth .form-page > h1 { color: #fff; }
body.auth .form-page > p, body.auth .form-page > .muted { color: var(--hero-muted); }
body.auth .form-page > p a { color: var(--gold-2); }
body.auth .form-page .card { border-radius: 20px; border-color: transparent; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); padding: 30px; animation: card-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { body.auth .form-page .card { animation: none; } }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 18px 64px; position: relative; box-shadow: var(--shadow); }
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 18px; top: 18px; min-width: 32px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; background: var(--badge); color: var(--badge-text); font-size: 0.78rem; font-weight: 700;
}
.steps strong { display: block; margin-bottom: 2px; color: var(--heading); }
.steps span { color: var(--muted); font-size: 0.93rem; }

/* Account */
.account-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 40px 0 20px; }
.account-head h1 { font-size: 1.8rem; margin: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kv.spaced { margin: 16px 0 20px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.rows li:first-child { border-top: 0; }
.rows .grow { flex: 1; min-width: 180px; }
.rows .sub { color: var(--muted); font-size: 0.87rem; }
.licence + .licence { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.licence-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.licence-title h3 { margin: 0; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.inline-form input { flex: 1; min-width: 200px; }
.empty { color: var(--muted); padding: 8px 0; margin: 0; }
.subhead { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 20px 0 4px; font-weight: 700; }
.gap-top { margin-top: 16px; }
.gap-top-sm { margin-top: 12px; }
.note { margin: 12px 0 0; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* Admin dashboard */
.admin-head { padding: 36px 0 18px; }
.admin-head h1 { font-size: 1.7rem; margin: 0; }
.admin-head p { margin: 4px 0 0; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kpi, var(--accent)); }
.kpi .label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.kpi .metric { font-size: 1.6rem; font-weight: 800; margin-top: 4px; color: var(--heading); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .note { margin: 2px 0 0; font-size: 0.75rem; color: var(--muted); }
.kpi.good { --kpi: var(--ok); }
.kpi.warn { --kpi: var(--warn); }
.kpi.bad { --kpi: var(--bad); }
.kpi.gold { --kpi: var(--gold); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: end; }
.form-grid .field { margin: 0; }
.form-grid .wide { grid-column: span 2; }
@media (max-width: 560px) { .form-grid .wide { grid-column: auto; } }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input[type="search"] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; flex: 0 1 auto; }
/* Customers: a dense data table, one line per customer; it scrolls sideways on small screens. */
.data-table { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.data-table table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 0.87rem; }
.data-table th { background: var(--surface-2); text-align: left; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; padding: 9px 12px; white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table td { padding: 7px 12px; border-top: 1px solid var(--border-soft); white-space: nowrap; vertical-align: middle; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:not(.static) { cursor: pointer; transition: background-color 0.12s; }
.data-table tbody tr:nth-child(even) { background: var(--surface-3); }
.data-table tbody tr:hover, .data-table tbody tr:focus-visible { background: var(--accent-soft); outline: none; box-shadow: none; }
.data-table.compact table { min-width: 560px; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.trunc { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.data-table td.name strong { color: var(--heading); font-weight: 600; }
.data-table td.end { text-align: right; padding-top: 4px; padding-bottom: 4px; }
.data-table .pill { font-size: 0.68rem; padding: 2px 8px; }
.data-table .more { color: var(--muted); font-size: 0.8rem; }
.data-table .btn.small { padding: 4px 10px; font-size: 0.8rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 0.88rem; }
button.kpi { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
button.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
button.kpi[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
/* Manage: a side panel over the page, so the table keeps its place. */
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(580px, 100%); height: 100%; max-height: 100%; max-width: 100%; border: 0; border-left: 1px solid var(--border); padding: 0; background: var(--bg); color: var(--text); box-shadow: -20px 0 60px rgba(0, 0, 0, 0.25); overflow-y: auto; }
dialog.drawer[open] { animation: drawer-in 0.22s ease-out both; }
dialog.drawer::backdrop { background: rgba(12, 14, 20, 0.45); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.drawer[open] { animation: none; } }
.drawer-head { position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 1.1rem; }
.drawer-head .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.drawer-head .sub { color: var(--muted); font-size: 0.85rem; }
.drawer-body { padding: 4px 20px 24px; }
.drawer-body .admin-licence { background: var(--surface); }
.drawer-body .kv { grid-template-columns: max-content minmax(0, 1fr); }
.drawer-body .rows .grow { min-width: 0; flex-basis: 160px; }
@media (max-width: 560px) { .card { padding: 16px; } .drawer-head, .drawer-body { padding-left: 14px; padding-right: 14px; } }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 0.75rem; font-weight: 700; background: linear-gradient(135deg, #3a63c9, #6d3fd1); }
.admin-licence { margin: 12px 0 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-3); }
.admin-licence .licence-title { margin-bottom: 8px; }
.admin-licence .kv { font-size: 0.92rem; }
.admin-licence .rows li { padding: 8px 0; }
.edit-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.edit-row input, .edit-row select { width: auto; flex: 0 1 170px; padding: 6px 10px; font-size: 0.88rem; }
.edit-row input[type="number"] { flex-basis: 76px; }
.edit-row label { margin: 0; }
.danger-text { color: var(--bad); }

/* Legal pages */
.legal { padding-top: 40px; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 4px; }
.legal h2 { font-size: 1.15rem; margin: 32px 0 10px; }
.legal p, .legal li { max-width: 72ch; }
.legal ul { padding-left: 20px; margin: 0 0 1em; }
.legal li { margin: 6px 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.93rem; }
.table-wrap th, .table-wrap td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid var(--border-soft); }
.table-wrap thead th { border-top: 0; background: var(--surface-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
/* Values still to be filled in before going live */
mark.todo { background: var(--warn-soft); color: var(--warn); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.agree { font-size: 0.85rem; color: var(--muted); margin: 12px 0 0; text-align: center; }

/* Company/product presentation. Existing form, pricing and account hooks are unchanged. */
:root {
  --media-bg: #102139;
  --media-grid: #24364e;
  --media-text: #f4f4f5;
  --media-muted: #bdc9da;
  --media-accent: #e2b24c;
  --action-text: #ffffff;
  --eyebrow-text: #8c6417;
}
@media (prefers-color-scheme: dark) {
  :root {
    --media-bg: #101c2d;
    --media-grid: #26364c;
    --media-text: #f4f4f5;
    --media-muted: #bdc9da;
    --media-accent: #e2b24c;
    --action-text: #081225;
    --eyebrow-text: #e2b24c;
  }
}
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; background: var(--surface); color: var(--text); padding: 12px 18px; border-radius: 8px; }
.btn:not(.secondary):not(.danger):not(.light):not(.ghost-light):not(.google), .btn:not(.secondary):not(.danger):not(.light):not(.ghost-light):not(.google):hover { color: var(--action-text); }
.eyebrow { color: var(--eyebrow-text); }
.actions > a { min-height: 44px; display: inline-flex; align-items: center; }
.skip-link:focus { top: 12px; }
.brand > span { display: flex; flex-direction: column; line-height: 1.4; }
.brand small { font-size: .68rem; margin-top: 2px; }
.site-header .wrap, .marketing .wrap { max-width: 1200px; padding-left: 24px; padding-right: 24px; }
.site-header .nav a, .site-header .nav .btn { min-height: 44px; display: inline-flex; align-items: center; }
.marketing .section { padding-top: 76px; scroll-margin-top: 110px; }
.marketing h1 { font-size: clamp(2.5rem, 5.1vw, 4rem); letter-spacing: -.055em; line-height: 1.04; }
.marketing h2 { font-size: clamp(1.65rem, 3vw, 2.4rem); letter-spacing: -.04em; }
.marketing h3 { font-size: 1.5rem; letter-spacing: -.035em; }
.marketing p { max-width: 64ch; }
.hero-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
.company-hero { padding: 88px 0; }
.hero-layout > * { min-width: 0; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; color: var(--hero-muted); font-size: .8rem; }
.hero-facts span::before { content: "—"; color: var(--gold-2); margin-right: 8px; }
.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading-row p { max-width: 28ch; }
.product-grid, .media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.product-grid > .card + .card { margin-top: 0; }
.product-card { padding: 32px; display: flex; flex-direction: column; }
.product-card .card-head { margin-bottom: 28px; }
.product-card > p { color: var(--muted); }
.product-card .actions { margin-top: auto; padding-top: 28px; }
.clean-list { margin: 0 0 16px; padding: 0; list-style: none; color: var(--muted); }
.clean-list li { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.clean-list li:last-child { border: 0; }
.small-note { font-size: .82rem; }
.feature-split { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: 48px; }
.feature-split > * { min-width: 0; }
.text-link { font-weight: 650; text-decoration: none; display: inline-flex; align-items: center; gap: 20px; min-height: 44px; }
.media-frame { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); min-width: 0; }
.media-frame picture, .media-frame img, .media-frame video { display: block; width: 100%; }
.media-frame img { height: auto; }
.media-frame figcaption { padding: 12px 16px; font-size: .77rem; color: var(--muted); line-height: 1.55; border-top: 1px solid var(--border); }
.hero-media { border-color: var(--media-grid); background: var(--media-bg); }
.hero-media figcaption { color: var(--media-muted); border-color: var(--media-grid); }
.ratio-wide { aspect-ratio: 16 / 10; }
.media-placeholder { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; padding: 32px; color: var(--media-text); background-color: var(--media-bg); background-image: linear-gradient(var(--media-grid) 1px, transparent 1px), linear-gradient(90deg, var(--media-grid) 1px, transparent 1px); background-size: 32px 32px; }
.media-placeholder strong { font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.2; letter-spacing: -.03em; max-width: 16ch; }
.media-placeholder > span:not(.placeholder-symbol), .media-placeholder small { color: var(--media-muted); font-size: .8rem; }
.media-placeholder .media-label { font-size: .65rem; letter-spacing: .13em; color: var(--media-accent); font-weight: 700; }
.placeholder-symbol { font-size: 2.5rem; line-height: 1; color: var(--media-accent); }
.callout { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 40px !important; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.callout p { margin-bottom: 0; color: var(--muted); }
.access-status .card-head { flex-wrap: wrap; }
.unavailable { display: block; padding: 14px 16px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); }
.footer-brand { max-width: 350px; }
.footer-brand strong { color: var(--heading); letter-spacing: .14em; }
.footer-brand p { margin: 8px 0 12px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; min-width: 100px; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.app-gallery { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; margin-top: 24px; }
.app-gallery .media-frame:first-child { grid-column: 1 / -1; }
.auth .form-page { padding-top: 64px; }
.auth .card .btn { min-height: 46px; }
.legal { padding-bottom: 16px; }
.legal h1 { margin-top: 16px; }
.legal h2 { padding-top: 16px; border-top: 1px solid var(--border-soft); }
@media (max-width: 980px) {
  .brand small { display: none; }
  .hero-layout { gap: 28px; }
  .feature-split { gap: 28px; }
  .marketing .hero { padding: 64px 0; }
}
@media (max-width: 760px) {
  .site-header .wrap { flex-wrap: wrap; gap: 0; padding-top: 12px; padding-bottom: 8px; }
  .nav { width: 100%; margin-left: 0; justify-content: flex-start; margin-top: 8px; gap: 2px; }
  .nav a:not(.btn) { padding-left: 10px; padding-right: 10px; }
  .hero-layout, .feature-split { grid-template-columns: minmax(0,1fr); }
  .hero-media { max-width: 600px; }
  .section-heading-row { align-items: start; flex-direction: column; gap: 4px; }
  .section-heading-row p { max-width: none; }
  .product-grid, .media-grid { grid-template-columns: minmax(0,1fr); }
  .product-card { padding: 24px; }
  .callout { align-items: start; flex-direction: column; padding: 28px !important; }
  .marketing .section { padding-top: 48px; }
  .site-footer { margin-top: 48px; }
}
@media (max-width: 420px) {
  .site-header .wrap, .marketing .wrap { padding-left: 16px; padding-right: 16px; }
  .marketing .hero { padding: 48px 0; }
  .hero .actions .btn { width: 100%; }
  .media-placeholder { padding: 24px; }
  .media-placeholder strong { font-size: 1.5rem; }
  .app-gallery { grid-template-columns: minmax(0,1fr); }
  .kv { grid-template-columns: minmax(0,1fr); gap: 2px; }
  .kv dd { margin-bottom: 12px; }
  .inline-form input { min-width: 0; flex-basis: 100%; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
