/* Mitvaris License Portal — design system.
 *
 * One stylesheet for the admin console and the customer portal. No framework,
 * no CDN: everything the UI needs ships inside the image, which is what lets
 * the Content-Security-Policy forbid every external and inline source.
 *
 * Fonts: Inter and JetBrains Mono, SIL Open Font License (see /static/fonts).
 */

@font-face { font-family: "Inter"; src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  /* Neutrals */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f2f4f7;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #132441;     /* Mitvaris navy (the light wordmark) */
  --text-2: #344054;
  --text-3: #5b6476;   /* 5.9:1 on white, >=4.5:1 on every panel tint (WCAG AA) */
  --text-4: #6b7385;   /* 4.8:1 on white */

  /* Brand — from the MITVARIS logo kit. The pure brand blue #0E7BE8 is 4.2:1
     on white, under WCAG AA for text, so interactive text and buttons use a
     deeper shade of it; the full gradient is for decorative brand elements. */
  --brand-blue: #0E7BE8;
  --brand-cyan: #19C1E8;
  --brand-gradient: linear-gradient(135deg, #0E7BE8 0%, #19C1E8 100%);
  --brand-navy: #132441;
  --brand-ink: #0B1220;
  --accent: #0B6BCB;          /* 5.3:1 with white */
  --accent-hover: #0959AB;
  --accent-soft: #E8F2FD;
  --accent-border: #B9D9FA;
  --focus: 0 0 0 3px rgba(14, 123, 232, 0.28);

  /* Status */
  --ok: #067647;      --ok-bg: #ecfdf3;      --ok-border: #abefc6;
  --warn: #b54708;    --warn-bg: #fffaeb;    --warn-border: #fedf89;
  --bad: #b42318;     --bad-bg: #fef3f2;     --bad-border: #fecdca;
  --info: #175cd3;    --info-bg: #eff8ff;    --info-border: #b2ddff;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, 0.14), 0 4px 8px -4px rgba(16, 24, 40, 0.06);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; color: var(--text); letter-spacing: -0.011em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
/* Links inside running text must not rely on colour alone (WCAG 1.4.1). */
p a, li a, .alert a, .hint a, .file-desc a, .lead a { text-decoration: underline; text-underline-offset: 2px; }
a.btn, a.btn:hover, li a.primary, .worklist a, .nav a, .tabs a, .usermenu a, .crumbs a { text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
svg.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 12px;
  background: var(--text); color: #fff; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; color: #fff; text-decoration: none; }

/* ── App shell (console) ─────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px 16px;
  background: var(--brand-ink); color: #AFC0DD; border-right: 1px solid #16213A;
  background-image: linear-gradient(180deg, rgba(14,123,232,.10) 0%, rgba(11,18,32,0) 38%);
}
.sidebar-brand { padding: 4px 8px 20px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 132px; height: auto; margin-left: -4px; }
.brand-product { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3);
  padding-left: 1px; }
.brand.on-dark .brand-product { color: #8FA3C7; }
.sidebar-cta { margin: 0 2px 10px; }
.nav-section { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #8193B5; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 2px 0;
  border-radius: var(--radius-sm); color: #C2D0E6; font-weight: 500; font-size: 13.5px; }
.nav a .icon { color: #8FA3C7; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a:hover .icon { color: #C2D0E6; }
.nav a[aria-current="page"] { background: rgba(14,123,232,.22); color: #fff; }
.nav a[aria-current="page"] .icon { color: #3BE0FF; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand-gradient); }
.nav a:focus-visible { box-shadow: 0 0 0 2px #3BE0FF; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.sidebar-status { display: flex; align-items: center; gap: 8px; color: #C2D0E6; }
.sidebar-version { margin-top: 4px; color: #8193B5; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 99px; background: var(--text-4); }
.status-dot.ok { background: #17B26A; }
.status-dot.warn { background: #F79009; }
.status-dot.bad { background: #F04438; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 20px;
  padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); min-width: 0; flex: 1; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--text-4); }
.topbar-right { display: flex; align-items: center; gap: 14px; flex: 1; justify-content: flex-end; }
.env { font: 600 11px/1 var(--font); letter-spacing: 0.05em; text-transform: uppercase;
  padding: 6px 9px; border-radius: 5px; border: 1px solid var(--warn-border); color: var(--warn); background: var(--warn-bg); }
.env.prod { border-color: var(--ok-border); color: var(--ok); background: var(--ok-bg); }
.search { position: relative; width: min(440px, 40vw); }
.search > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-4); }
.search input { width: 100%; height: 38px; padding: 0 40px 0 38px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); font: inherit; font-size: 13.5px; color: var(--text); }
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: var(--focus); }
.search-kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }

/* User menu: native <details>, no script needed */
.usermenu { position: relative; }
.usermenu > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 4px 12px 4px 4px; border-radius: 99px;
  cursor: pointer; border: 1px solid transparent; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover, .usermenu[open] > summary { background: var(--surface-2); border-color: var(--border); }
.usermenu-name { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; }
.usermenu-name b { font-size: 13px; font-weight: 600; color: var(--text); }
.usermenu-name small { font-size: 11.5px; color: var(--text-3); }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 30; }
.usermenu-head { padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.usermenu-head b { font-size: 13.5px; }
.usermenu-head span { font-size: 12px; color: var(--text-3); }
.usermenu-panel a, .usermenu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0;
  background: none; border-radius: var(--radius-sm); font: 500 13.5px var(--font); color: var(--text-2); cursor: pointer; text-align: left; }
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.usermenu-panel form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }
.avatar { width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--text-2); font-weight: 600; font-size: 12px; border: 1px solid var(--border); }
.avatar-brand { background: var(--brand-gradient); color: #fff; border: 0; }

.content { padding: 0 32px 64px; width: 100%; }
.content.narrow > :not(.page-head) { max-width: 980px; }
/* The client portal keeps a gradient hairline across its top bar. */
.portal-top { position: relative; }
.portal-top::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-gradient); }

/* ── Page header: a white band under the top bar ────────────────────────── */
.page-head { display: flex; align-items: flex-start; gap: 24px; margin: 0 -32px 24px; padding: 24px 32px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-main .page-head { margin: 0 0 24px; padding: 0; background: none; border: 0; }
.page-head h1 { font-size: 22px; font-weight: 650; line-height: 1.25; letter-spacing: -0.015em; }
.page-head .lead { margin-top: 4px; color: var(--text-3); font-size: 14px; max-width: 760px; }
.page-head .meta { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  color: var(--text-3); font-size: 13px; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.page-head.with-tabs { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 0; }
.page-head-row { display: flex; align-items: flex-start; gap: 16px; }
.page-head .tabs { margin: 20px 0 0; border-bottom: 0; }
.head-avatar { width: 48px; height: 48px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 650;
  font-size: 17px; color: #fff; background: var(--brand-gradient); box-shadow: 0 6px 16px -8px rgba(14,123,232,.8); }

/* ── Toasts (flash messages) ─────────────────────────────────────────────── */
.toasts { position: fixed; top: 72px; right: 24px; z-index: 60; display: grid; gap: 10px; width: min(420px, calc(100vw - 48px)); }
.toasts .alert { box-shadow: var(--shadow-lg); align-items: flex-start; background-color: var(--surface); }
.toasts .alert.ok { border-left: 4px solid #17B26A; }
.toasts .alert.bad { border-left: 4px solid #F04438; }
.toasts .alert.warn { border-left: 4px solid #F79009; }
.toasts .alert.info { border-left: 4px solid var(--brand-blue); }
.toast-close { margin-left: auto; flex: none; border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 2px; border-radius: 4px; }
.toast-close:hover { color: var(--text); background: var(--surface-3); }
.toasts .alert.leaving { opacity: 0; transform: translateX(16px); transition: opacity .2s, transform .2s; }

/* ── Panels ──────────────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); }
.panel + .panel, .panel + .grid, .grid + .panel, .stack > * + * { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-head .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 20px; }
.panel-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; gap: 8px; align-items: center; }
.panel.danger { border-color: var(--bad-border); }
.panel-foot > :last-child:not(:first-child) { margin-left: auto; }
.stack > .panel + .panel { margin-top: 16px; }
.grow { flex: 1; min-width: 200px; }
details > summary { list-style: none; cursor: pointer; display: inline-block; }
details > summary::-webkit-details-marker { display: none; }
.auth-card.panel { padding: 8px; max-width: 460px; }
.panel.danger .panel-head h2 { color: var(--bad); }

.grid { display: grid; 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 { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid > .panel + .panel { margin-top: 0; }

/* ── Stats ───────────────────────────────────────────────────────────────── */
.stat { padding: 18px 20px; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.stat-value { margin-top: 6px; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-note { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
a.stat { display: block; color: inherit; }
a.stat:hover { text-decoration: none; background: var(--surface-2); }

/* ── KPI cards ───────────────────────────────────────────────────────────── */
.kpi { position: relative; display: block; padding: 20px 20px 0; color: inherit; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.kpi:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.kpi-icon { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.kpi-icon .icon { width: 18px; height: 18px; }
.kpi-icon.blue { background: #E8F2FD; color: #0B6BCB; }
.kpi-icon.green { background: #E7F8EF; color: #067647; }
.kpi-icon.amber { background: #FEF4E6; color: #B54708; }
.kpi-icon.violet { background: #F1EEFD; color: #5B3FD0; }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--text-3); }
.kpi-value { margin-top: 8px; font-size: 32px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-foot { display: flex; justify-content: space-between; align-items: center; margin: 16px -20px 0; padding: 11px 20px;
  border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; color: var(--text-3); }
.kpi-foot span { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; }
.kpi-foot .icon { width: 13px; height: 13px; }

/* ── Progress bars (native <progress>: accessible, no inline style) ─────── */
progress.bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 99px;
  background: var(--surface-3); overflow: hidden; }
progress.bar::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; }
progress.bar::-webkit-progress-value { background: var(--brand-gradient); border-radius: 99px; }
progress.bar::-moz-progress-bar { background: var(--brand-gradient); border-radius: 99px; }

/* ── Get started ─────────────────────────────────────────────────────────── */
.setup-progress { width: 200px; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.setup-steps li { display: flex; gap: 12px; padding: 20px; }
.setup-steps li + li { border-left: 1px solid var(--border); }
.setup-check { width: 28px; height: 28px; flex: none; border-radius: 99px; display: grid; place-items: center; font-size: 13px; font-weight: 650;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); }
.setup-steps li.done .setup-check { color: #fff; background: #17B26A; border-color: #17B26A; }
.setup-check .icon { width: 15px; height: 15px; stroke-width: 2.5; }
.setup-title { font-weight: 600; font-size: 14px; }
.setup-body p { margin: 4px 0 12px; font-size: 13px; color: var(--text-3); line-height: 1.45; }
.setup-steps li.done .setup-title { color: var(--text-3); }

/* ── Work list (needs attention) ─────────────────────────────────────────── */
.worklist { list-style: none; margin: 0; padding: 0; }
.worklist li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 110px auto; gap: 14px; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--border); }
.worklist li:first-child { border-top: 0; }
.worklist-main { min-width: 0; }
.worklist-main .primary { font-weight: 600; color: var(--text); }
.worklist-main .primary:hover { color: var(--accent); }
.worklist-main .secondary { display: block; font-size: 12.5px; color: var(--text-3); }
.worklist-when { font-size: 12.5px; color: var(--text-3); text-align: right; }

/* ── Bar list (licences by application) ──────────────────────────────────── */
.barlist { list-style: none; margin: 0; padding: 8px 20px 16px; }
.barlist li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center; padding: 10px 0; }
.barlist-main .row-between { margin-bottom: 7px; font-size: 13.5px; }
.barlist-count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ── Status list + sign-in numbers ───────────────────────────────────────── */
.statuslist { list-style: none; margin: 0; padding: 6px 20px; }
.statuslist li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; font-size: 13.5px;
  border-top: 1px solid var(--border); }
.statuslist li:first-child { border-top: 0; }
.statuslist b { font-weight: 600; color: var(--text); }
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; }
.sec-grid > div { padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.sec-grid > div:nth-child(odd) { border-right: 1px solid var(--border); }
.sec-grid > div:nth-child(n+3) { border-top: 1px solid var(--border); }
.sec-num { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sec-lbl { font-size: 12.5px; color: var(--text-3); }
.sec-bad .sec-num { color: var(--bad); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { position: relative; overflow-x: auto; }  /* sr-only labels must not escape it */
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--text-3); background: var(--surface-2);
  padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfd; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .row { flex-wrap: nowrap; }
.table .primary { font-weight: 600; color: var(--text); }
.table .primary:hover { color: var(--accent); }
.table .secondary { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 1px; }
.panel > .table-wrap:first-child table th:first-child { border-top-left-radius: var(--radius-lg); }
.panel > .table-wrap:first-child table th:last-child { border-top-right-radius: var(--radius-lg); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font: 600 13.5px/1 var(--font); cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.btn:focus-visible { box-shadow: var(--focus); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff;
  background-image: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0)); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-brand { color: #fff; border: 0; background: var(--brand-gradient); box-shadow: 0 6px 16px -8px rgba(14,123,232,.9); }
.btn-brand:hover { color: #fff; background: var(--brand-gradient); filter: brightness(1.08); }
.btn-danger { background: var(--surface); border-color: var(--bad-border); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-danger-solid { background: #d92d20; border-color: #d92d20; color: #fff; }
.btn-danger-solid:hover { background: #b42318; border-color: #b42318; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; height: auto; color: var(--accent); font: 500 13.5px var(--font);
  cursor: pointer; box-shadow: none; }
.btn-link:hover { text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 18px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.span-all { grid-column: 1 / -1; }
.field > .btn { align-self: flex-start; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.optional { font-weight: 400; color: var(--text-4); }
.hint { font-size: 12.5px; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 400 14px var(--font); box-shadow: var(--shadow-xs);
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 34px; background-repeat: no-repeat; background-position: right 10px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); }
.input::placeholder { color: var(--text-4); opacity: 1; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: #f97066; }
.input:disabled { background: var(--surface-3); color: var(--text-3); }
.input.mono { font-family: var(--mono); font-size: 13px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border-strong);
  border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text-3); font-size: 13px; }
.field-error { font-size: 12.5px; color: var(--bad); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check .desc { display: block; color: var(--text-3); font-size: 12.5px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }

/* Selectable cards (plans, applications) */
.choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s, background .12s; }
.choice:hover .choice-card { border-color: var(--text-4); }
.choice input:checked + .choice-card { border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset; }
.choice input:focus-visible + .choice-card { box-shadow: var(--focus); }
.choice-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.choice-title .tick { margin-left: auto; width: 18px; height: 18px; border-radius: 99px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; background: var(--surface); }
.choice input[type="checkbox"] + .choice-card .tick { border-radius: 5px; }
.choice input:checked + .choice-card .tick { background: var(--accent); border-color: var(--accent); }
.choice input:checked + .choice-card .tick::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff;
  border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.choice-body { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.choice-body ul { margin: 0; padding-left: 16px; }
.choice-line { display: block; position: relative; padding-left: 12px; }
.choice-line::before { content: ""; position: absolute; left: 2px; top: .62em; width: 4px; height: 4px; border-radius: 99px; background: var(--text-4); }

.app-option { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.app-option + .app-option { margin-top: 10px; }
.app-option-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.app-option-head .check { font-weight: 600; }
.app-option-body { border-top: 1px solid var(--border); padding: 14px 16px 16px 42px; background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius); display: grid; gap: 14px; }
.app-option.is-off .app-option-body { display: none; }
.pack-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* ── Application cards (build-your-own) ──────────────────────────────────── */
.appcard-title { display: flex; flex-direction: column; min-width: 0; }
.appcard-sub { font-size: 12.5px; color: var(--text-3); }
.appcard-body { border-top: 1px solid var(--border); padding: 16px 18px 18px; background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: grid; gap: 16px; }
.access li.is-included .name { color: var(--text-2); }
.appcard-packs { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.appcard-pages { min-width: 0; }
.appcard-pages .appcard-hint { margin-top: 10px; }
.tree { display: grid; gap: 10px; }
.tree-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.tree-count { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.tree-search { display: flex; align-items: center; gap: 8px; }
.tree-search .input { width: 220px; height: 32px; }
.tree-note { margin: 0; font-size: 13px; color: var(--text-2); }
.tree-note.is-warn { color: var(--warn); font-weight: 600; }
.tree-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tree-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; }
.tree-head-label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.tree-head-label input { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.tree-desc { flex-basis: 100%; margin: 0 0 0 26px; font-size: 12.5px; color: var(--text-3); }
.tree-group-count { margin-left: auto; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.tree-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: pointer; }
.tree-toggle:hover { background: var(--surface-2); }
.tree-toggle .icon { transition: transform .15s; }
.tree-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.tree-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 18px;
  padding: 10px 12px 12px 38px; border-top: 1px solid var(--border); }
.catalog-menus { display: grid; gap: 8px; }
.catalog-menu > summary { cursor: pointer; padding: 6px 0; }
.appcard-packs legend { width: 100%; }
.appcard-hint { width: 100%; margin: 0; }
.pack-base { color: var(--text-3); }
.appcard-whole { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.appcard-whole .icon { color: var(--ok); }
.appcard-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.appcard-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 4px; }

/* On/off switch for an application */
input.switch { -webkit-appearance: none; appearance: none; flex: none; width: 38px; height: 22px; margin: 0; border-radius: 99px;
  background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 99px; background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.2); transition: transform .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(16px); }
input.switch:focus-visible { box-shadow: var(--focus); outline: none; }

/* Template bar on the licence form, template cards */
.template-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; }
.template-bar-icon { width: 36px; height: 36px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.template-bar-text { display: flex; flex-direction: column; margin-right: auto; }
.template-bar select { width: 240px; }
.tpl-card { display: flex; flex-direction: column; }
.tpl-card .panel-body { flex: 1; }
.tpl-apps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.tpl-apps li { display: flex; gap: 8px; align-items: flex-start; }
.tpl-apps .icon { color: var(--ok); margin-top: 2px; }
.tag-core { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.unsupported { padding: 0 20px 20px; display: grid; gap: 10px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 99px;
  font: 500 12px/1 var(--font); white-space: nowrap; border: 1px solid var(--border); background: var(--surface-3); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.badge.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.badge.bad { background: var(--bad-bg); border-color: var(--bad-border); color: var(--bad); }
.badge.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }
.badge.muted { color: var(--text-3); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 5px; font-size: 12px;
  font-weight: 500; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Alerts / callouts ───────────────────────────────────────────────────── */
.alert { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); font-size: 13.5px; color: var(--text-2); }
.alert + .alert, .alert + .panel, .alert + .grid, .alert + .stack { margin-top: 16px; }
.alert .icon { margin-top: 2px; }
.alert strong { color: var(--text); font-weight: 600; }
.alert-title { font-weight: 600; color: var(--text); }
.alert .alert-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.alert.info { background: var(--info-bg); border-color: var(--info-border); }
.alert.info .icon { color: var(--info); }
.alert.ok { background: var(--ok-bg); border-color: var(--ok-border); }
.alert.ok .icon { color: var(--ok); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.alert.warn .icon { color: var(--warn); }
.alert.bad { background: var(--bad-bg); border-color: var(--bad-border); }
.alert.bad .icon { color: var(--bad); }
.flashes { margin-bottom: 20px; }

/* ── Key/value lists ─────────────────────────────────────────────────────── */
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 0; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--text-3); padding: 9px 0; }
.dl.compact { grid-template-columns: 112px 1fr; }
.dl dd { margin: 0; padding: 9px 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.dl dt:not(:first-of-type), .dl dt:not(:first-of-type) + dd { border-top: 1px solid var(--border); }

/* ── Access list (what a client can use) ─────────────────────────────────── */
.access { list-style: none; margin: 0; padding: 0; }
.access li { display: grid; grid-template-columns: 36px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr) auto;
  gap: 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.access li:last-child { border-bottom: 0; }
.app-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.app-icon svg { width: 18px; height: 18px; }
.access .name { font-weight: 600; }
.access .sub { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.access .label-sm { display: block; font-size: 12px; color: var(--text-4); }

/* ── Stepper ─────────────────────────────────────────────────────────────── */
.steps { display: flex; gap: 0; list-style: none; margin: 0 0 24px; padding: 0; counter-reset: step;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.steps li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 13px;
  color: var(--text-3); font-weight: 500; counter-increment: step; position: relative; }
.steps li + li { border-left: 1px solid var(--border); }
.steps li::before { content: counter(step); width: 24px; height: 24px; flex: none; border-radius: 99px; display: grid;
  place-items: center; font-size: 12px; font-weight: 600; border: 1px solid var(--border-strong); background: var(--surface); }
.steps li.done { color: var(--text-2); }
.steps li.done::before { content: "✓"; background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.steps li[aria-current="step"] { color: var(--text); background: var(--accent-soft); }
.steps li[aria-current="step"]::before { background: var(--brand-gradient); border-color: transparent; color: #fff; }

.section { padding: 22px 24px; }
.section + .section { border-top: 1px solid var(--border); }
.section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.section-title h2, .section-title h3 { font-size: 15px; font-weight: 600; }
.section-title .num { width: 22px; height: 22px; border-radius: 99px; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.section-title p { color: var(--text-3); font-size: 13px; }

/* ── Review / diff ───────────────────────────────────────────────────────── */
.diff { list-style: none; margin: 0; padding: 0; }
.diff li { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--border); }
.diff li:first-child { border-top: 0; }
.diff .what { font-weight: 600; }
.row-top { display: flex; gap: 12px; align-items: flex-start; }
.row-top > div:last-child { flex: 1; min-width: 0; }
.diff .details { margin: 3px 0 0; padding: 0; list-style: none; color: var(--text-3); font-size: 13px; }

/* ── Secrets & files ─────────────────────────────────────────────────────── */
.secret { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); font: 500 13px/1.4 var(--mono); color: var(--text);
  overflow-wrap: anywhere; }
.secret code { flex: 1; font-size: 13px; }
textarea.secret { width: 100%; resize: none; min-height: 96px; }
.file-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 16px 20px; }
.file-row + .file-row { border-top: 1px solid var(--border); }
.file-icon { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3);
  color: var(--text-2); border: 1px solid var(--border); }
.file-icon svg { width: 19px; height: 19px; }
.file-title { font-weight: 600; }
.file-desc { color: var(--text-3); font-size: 13px; margin-top: 2px; max-width: 640px; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 24px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 7px;
   padding: 10px 12px; margin-bottom: -1px; color: var(--text-3); font-weight: 500; font-size: 13.5px;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Toolbar / filters / pagination ──────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.toolbar .input { height: 34px; font-size: 13.5px; }
.toolbar .grow { flex: 1; min-width: 220px; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented a { padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--text-2); background: var(--surface); }
.segmented a + a { border-left: 1px solid var(--border-strong); }
.segmented a:hover { background: var(--surface-2); text-decoration: none; }
.segmented a[aria-current="true"] { background: var(--surface-3); color: var(--text); }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-3); }
.pager .btn { margin-left: auto; }
.pager .btn + .btn { margin-left: 0; }

/* ── Empty states ────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 40px 24px; }
.stack .panel .empty, aside .panel .empty { padding: 28px 20px; }
.empty-icon { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-3); }
.empty-icon svg { width: 20px; height: 20px; }
.empty .empty-title { font-size: 15px; font-weight: 600; }
.empty p { color: var(--text-3); margin: 4px auto 16px; max-width: 420px; font-size: 13.5px; }

/* ── Timeline (activity) ─────────────────────────────────────────────────── */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; background: var(--surface-3);
  color: var(--text-3); border: 1px solid var(--border); }
.feed .dot svg { width: 15px; height: 15px; }
.feed .what { font-size: 13.5px; }
.feed .who { color: var(--text-3); font-size: 12.5px; margin-top: 1px; }
.feed .when { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }

/* ── Auth pages (sign-in) ────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside { background: var(--brand-ink); color: #C5D3EA; padding: 48px; display: flex; flex-direction: column;
  background-image: radial-gradient(900px 480px at -10% -15%, rgba(14, 123, 232, .38), transparent 60%),
                    radial-gradient(700px 380px at 115% 115%, rgba(25, 193, 232, .22), transparent 60%); }
.auth-aside .brand { padding: 0; }
.auth-aside .brand-logo { width: 168px; }
.auth-aside { min-height: 100vh; position: relative; overflow: hidden; padding: 40px 56px; }
/* A faint engineering grid, fading out from the top-left glow. */
.auth-aside::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 20% 10%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 70% at 20% 10%, #000 30%, transparent 75%); }
.auth-aside > * { position: relative; }
.auth-aside-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 540px; padding: 48px 0; }
.auth-aside-body h2 { margin-top: 0; color: #fff; font-size: 36px; font-weight: 650; line-height: 1.15; letter-spacing: -0.025em; }
.auth-lead { margin-top: 16px; font-size: 16px; line-height: 1.6; color: #B8C7E0; }
.auth-points { margin: 40px 0 0; }
.auth-point { padding: 18px 0; border-top: 1px solid rgba(255,255,255,.09); }
.auth-point:last-child { border-bottom: 1px solid rgba(255,255,255,.09); }
.auth-point dt { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 15px; font-weight: 600; }
.auth-point dd { margin: 6px 0 0 44px; color: #9FB4D6; font-size: 14px; line-height: 1.55; }
.auth-point-icon { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; color: #3BE0FF;
  background: rgba(14,123,232,.14); border: 1px solid rgba(59,224,255,.22); }
.auth-point-icon .icon { width: 16px; height: 16px; }
.auth-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.09); max-width: 540px; }
.auth-facts dt { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #8FA3C7; }
.auth-facts dd { margin: 4px 0 0; font-size: 13.5px; color: #E2EAF6; }

/* Form side */
.auth-main { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center;
  min-height: 100vh; padding: 24px 32px; background: var(--bg); }
.auth-top { justify-self: end; font-size: 13.5px; min-height: 20px; }
.auth-top a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.auth-top a:hover { color: var(--accent); }
.auth-card { width: 100%; max-width: 440px; padding: 40px; background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid transparent; border-image: none; border-radius: 12px; box-shadow: var(--shadow-sm);
  background-image: linear-gradient(var(--surface), var(--surface)), var(--brand-gradient);
  background-origin: border-box; background-clip: padding-box, border-box; }
.auth-card-head { margin-bottom: 28px; }
.auth-card h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.auth-card .lead { color: var(--text-3); margin: 4px 0 0; font-size: 14px; }
.auth-help { display: flex; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-3); line-height: 1.5; }
.auth-help .icon { margin-top: 2px; color: var(--text-4); }
.auth-help strong { color: var(--text-2); font-weight: 600; }
.auth-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; width: 100%; max-width: 640px;
  font-size: 12.5px; color: var(--text-3); }
.auth-foot span { display: inline-flex; align-items: center; gap: 6px; }
.auth-foot .icon { width: 14px; height: 14px; }
.btn-lg { height: 44px; font-size: 14.5px; padding: 0 18px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-4); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ── Customer portal shell ───────────────────────────────────────────────── */
.portal-top { background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-top .inner { max-width: 1080px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.portal-top .brand { padding: 0; flex-direction: row; align-items: center; gap: 12px; }
.portal-top .brand-logo { width: 120px; }
.portal-top .brand-product { padding-left: 12px; border-left: 1px solid var(--border); line-height: 20px; }
.portal-top .who { margin-left: auto; text-align: right; font-size: 13px; line-height: 1.3; }
.portal-top .who span { display: block; color: var(--text-3); font-size: 12px; }
.portal-main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 13.5px;
  font-weight: 500; box-shadow: var(--shadow-lg); transition: opacity .16s, transform .16s; z-index: 200; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-0 { margin-top: 0 !important; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.list-plain { margin: 0; padding-left: 18px; color: var(--text-2); }
.list-plain li + li { margin-top: 4px; }
.kbd { font: 500 12px var(--mono); padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-steps li:nth-child(3) { border-left: 0; }
  .setup-steps li:nth-child(n+3) { border-top: 1px solid var(--border); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .access li { grid-template-columns: 36px 1fr auto; }
  .access li > :nth-child(3), .access li > :nth-child(4) { grid-column: 2 / 3; }
}
@media (max-width: 860px) {
  .appcard-fields, .appcard-dates { grid-template-columns: 1fr; }
  .template-bar { flex-wrap: wrap; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 10px; }
  .topbar .search { order: 3; width: 100%; }
  .setup-steps { grid-template-columns: minmax(0, 1fr); }
  .setup-steps li + li { border-left: 0; border-top: 1px solid var(--border); }
  .worklist li { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .worklist-main { grid-column: 2 / -1; }
  .worklist li > .badge { grid-column: 2; justify-self: start; }
  .worklist li > .btn { grid-column: 2 / -1; justify-self: start; }
  .panel-head { flex-wrap: wrap; }
  .tree-search { flex-wrap: wrap; width: 100%; }
  .tree-search .input { width: 100%; }
  .pkg-pages { padding-left: 12px; }
  .app-tabs { grid-template-columns: minmax(0, 1fr); }
  .page-head, .page-head.with-tabs { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .page-head-row { flex-wrap: wrap; }
  .page-head-row > div:not(.page-actions) { flex: 1; min-width: 0; }
  .page-actions { flex: 1 1 100%; flex-wrap: wrap; }
  .grid-2, .grid-3, .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .page-head { flex-direction: column; }
  .page-actions { margin-left: 0; }
  .dl { grid-template-columns: 1fr; }
  .dl dd { padding-top: 0; border-top: 0 !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .sidebar, .topbar, .page-actions, .btn { display: none !important; } .shell { display: block; } }

/* Application workspace: licence form, template editor, vendor form */
.app-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.app-tab { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
.app-tab:hover { background: var(--surface-2); }
.app-tab:focus-visible { box-shadow: var(--focus); outline: none; }
.app-tab[aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.app-tab-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.app-tab-state { font-size: 12.5px; color: var(--text-3); }
.app-tab-add { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.app-tab-add:empty { display: none; }
.app-panel + .app-panel { margin-top: 24px; }
.app-legend { margin-bottom: 12px; font-size: 14px; font-weight: 600; }
/* The selected card already names the application; the heading stays for screen readers. */
.app-tabs:not(.hidden) ~ .app-panel > .app-legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-tabs:not(.hidden) ~ .app-panel + .app-panel { margin-top: 0; }
.app-choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.app-panel .appcard-body { border: 0; padding: 0; background: none; }
.app-included { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.pkg-pages { padding: 4px 12px 14px 38px; }
.pkg-section + .pkg-section { margin-top: 14px; }
.pkg-section-label { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 18px; }
.sum-panel { position: sticky; top: 76px; }
[data-sum-period] { margin: 0 0 10px; }
[data-sum-empty] { margin: 0 0 10px; }
.sum > p { margin: 0 0 4px; font-size: 13.5px; }
.sum > ul { margin: 0 0 12px; padding-left: 18px; }
.sum-panel .btn { width: 100%; justify-content: center; margin-top: 4px; }
.sum-panel .hint { margin: 8px 0 0; }
.app-how { margin-top: 14px; font-size: 13px; color: var(--text-2); }
.app-how summary { cursor: pointer; font-weight: 600; }
.app-how ol, .app-how p { margin: 8px 0 0; }
@media (max-width: 1100px) { .sum-panel { position: static; } }
.sum > p.sum-warn { margin: 0 0 12px; font-weight: 600; color: var(--warn); }

/* ── Profile & two-factor sign-in (2.6.0) ─────────────────────────────── */
img.avatar { object-fit: cover; padding: 0; background: var(--surface-3); }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }
.picture-row { display: flex; align-items: flex-start; gap: 20px; }
.picture-body { flex: 1; min-width: 0; display: grid; gap: 12px; padding-top: 4px; }
.picture-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picture-form .input-file { flex: 1; min-width: 220px; }
.picture-form .btn { height: 38px; }
.picture-remove { margin: 12px 0 0 84px; }
input.input-file { height: 38px; padding: 4px 12px 4px 4px; line-height: 28px; color: var(--text-3); font-size: 13.5px; cursor: pointer; }
input.input-file::file-selector-button { height: 28px; margin-right: 12px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: var(--surface-2); color: var(--text-2); font: 600 13px var(--font); cursor: pointer;
  transition: background .12s, color .12s; }
input.input-file:hover::file-selector-button { background: var(--surface-3); color: var(--text); }
input.input-file:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
@media (max-width: 560px) { .picture-row { flex-direction: column; } .picture-remove { margin-left: 0; } }
.head-avatar-img { object-fit: cover; border: 1px solid var(--border); }
.qr-box { display: flex; justify-content: center; padding: 12px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); }
.qr { width: 200px; height: 200px; image-rendering: pixelated; }
.input-code { max-width: 180px; font-size: 18px; letter-spacing: 0.2em; text-align: center; }
.input-code-wide { max-width: none; width: 100%; height: 52px; font-size: 24px; letter-spacing: 0.4em; }
.input-code-wide::placeholder { color: var(--text-4); letter-spacing: 0.4em; }
.totp-manual > summary { display: block; font-size: 13.5px; color: var(--accent); font-weight: 500; }
.totp-manual[open] > summary { margin-bottom: 8px; }
.steps-list { margin: 0 0 0 20px; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.mb-8 { margin-bottom: 8px; }
.chain-ok { color: var(--ok); } .chain-bad { color: var(--bad); }
