/* Hallmark · shape: app screen · genre: modern-minimal · theme: brand · redesign: full · scope: app
 * paper: oklch(100% 0 0) · accent: oklch(63% 0.14 160) · display: Inter · body: Inter (a trial, 2026-11-20)
 * nav: the sidebar with icons and labels, the current page tinted green · footer: a quiet line under the page
 * signature: the package ledger, one row per package with its seats and who is using one now
 * states: empty (a dashed panel), error and status notices, busy forms, the inline confirm
 * axes: light/geometric-sans/chromatic-green · posture: restrained, the navy next-step block once a page · surface: absolute · contrast: pass · copy: verbatim · v2.0.0 */
/* Hallmark · pre-emit critique: P3 H4 E4 S4 R4 V3 · weakest: P, a familiar portal on purpose (the owner's call after review); the character is in the ledger and the sign-in page */
/* Hallmark · waive 7b · white paper, surface: absolute · the owner found the grey page hard to read in the portal */
/* Hallmark · answered F4 · the red fill is the second click of an inline confirm, never on screen beside the green */
/* Hallmark · answered F24 · the menus float over tables, so they keep the hairline edge and a soft shadow both */
/* Hallmark · answered F1 · the straight quotes are the page text as found, kept by request */
/* Hallmark · answered F7 · fields share one recipe on purpose: one field look across every form; the pills on the seat bar and the avatar are the brand's round shapes */
/* Hallmark · answered F23 · no meta description: the portal sits behind a sign-in and is never previewed */

/* Inter, on trial in the portal instead of Urbanist (2026-11-20): a widely used face drawn for
   screens. Served from this app (wwwroot/fonts), never Google Fonts. Two variable files, Latin
   and Latin Extended, from @fontsource-variable/inter 5.2.5; licence: wwwroot/fonts/Inter-OFL.txt
   (SIL OFL 1.1). To go back to Urbanist, point --font-portal at var(--font-brand). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  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;
}

/*
 * The Company Portal and the Account pages. A familiar portal layout (decided 2026-11-20,
 * after a review of a website-style version): the sidebar with icons, a white page, white
 * panels with a light edge, status as tinted chips, buttons and links that look clickable.
 * The sign-in pages keep the navy panel with the large mark.
 *
 * Loaded after klepon-theme.css by _PortalLayout and _SignInLayout only, so Admin keeps
 * klepon-theme.css alone; Admin's sign-in page doesn't load it either (Admin is a later round).
 *
 * Two parts: the tokens (role names, then this app's older names pointed at them, so pages
 * not yet redesigned follow), then the components.
 */
:root {
  /* Roles, from the brand values at the top of klepon-theme.css. */
  --color-paper: #ffffff;
  --color-paper-2: color-mix(in oklab, var(--color-brand-navy) 4%, var(--color-paper));
  --color-paper-3: color-mix(in oklab, var(--color-brand-navy) 8%, var(--color-paper));
  /* The sidebar is the navy field (decided 2026-11-20: the white portal was too dull). Text on it
     is the light field colours; the current page is a green tint. Contrast on the navy: links
     7.3:1, the current page's green-300 6.7:1, the focus ring 9.3:1. */
  --color-sidebar: var(--color-field);
  --color-sidebar-hover: var(--color-field-2);
  --color-sidebar-active: color-mix(in oklab, var(--color-brand-green) 22%, var(--color-brand-navy));
  --color-ink: var(--color-brand-navy);
  --color-ink-2: var(--color-brand-navy-700);
  --color-muted: var(--color-brand-teal);
  --color-rule: color-mix(in oklab, var(--color-brand-navy) 14%, var(--color-paper));
  --color-rule-control: color-mix(in oklab, var(--color-brand-navy) 55%, var(--color-paper));
  --color-accent: var(--color-brand-green);
  /* The green fill: white text on green-700 (5.2:1), darker on hover and press. Not navy on the
     bright green: it passes on paper but is hard to read (decided 2026-11-20). */
  --color-accent-fill: var(--color-brand-green-700);
  --color-accent-ink: #ffffff;
  --color-accent-hover: var(--color-brand-green-800);
  --color-accent-press: var(--color-brand-green-900);
  --color-accent-text: var(--color-brand-green-800);
  --color-accent-strong: var(--color-brand-green-700);
  --color-accent-wash: var(--color-brand-green-100);
  --color-focus: var(--color-brand-green-700);
  --color-field: var(--color-brand-navy);
  --color-field-2: var(--color-brand-navy-700);
  --color-on-field: var(--color-brand-bg);
  --color-on-field-muted: color-mix(in oklab, var(--color-brand-bg) 72%, var(--color-brand-navy));
  --color-accent-on-field: var(--color-brand-green-300);
  --color-rule-on-field: color-mix(in oklab, var(--color-brand-bg) 20%, var(--color-brand-navy));
  /* The light that follows the cursor on the signed-out pages (wwwroot/js/signin-light.js). */
  --color-light-core: color-mix(in oklab, var(--color-brand-green) 55%, transparent);
  --color-light-edge: color-mix(in oklab, var(--color-brand-green-700) 28%, transparent);
  --shadow-signin-card: 0 24px 64px color-mix(in oklab, var(--color-brand-navy) 55%, transparent);
  --color-mark: var(--color-brand-green);

  /* Status: text 6:1 or more on white and on its own wash. */
  --color-ok-text: var(--color-brand-green-800);
  --color-ok-wash: var(--color-brand-green-100);
  --color-warn-text: #8a4b00;
  --color-warn-wash: #fbefd9;
  --color-warn-fill: #b36200;
  --color-danger-text: #a8201a;
  --color-danger-wash: #fbe7e5;
  --color-danger-fill: #a8201a;
  --color-danger-fill-hover: #8a1712;

  --font-portal: "Inter", system-ui, sans-serif;
  --font-display: var(--font-portal);
  --font-body: var(--font-portal);
  --display-weight: 700;

  /* Type. Body 16, labels 14, item titles 20 to 25, figures 36. */
  --text-label: 0.875rem;
  --text-body: 1rem;
  --text-lead: 1.125rem;
  --text-h2: 1.375rem;
  --text-figure: 2.25rem;
  --text-page: clamp(1.75rem, 0.8vw + 1.4rem, 2.25rem);
  --tracking-display: -0.02em;

  /* Space. */
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  --page-gap: var(--space-xl);
  --gap-columns: var(--space-lg);
  --control: 44px;
  --control-sm: 36px;
  --control-lg: 52px;
  --topbar-height: 64px;
  --radius-panel: 12px;
  --radius-field: 8px;
  --rule-hair: 1px;
  --dur-micro: 120ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --z-dropdown: 100;
  --shadow-overlay-soft: 0 12px 32px color-mix(in oklab, var(--color-brand-navy) 16%, transparent);
  --color-scrim: color-mix(in oklab, var(--color-brand-navy) 45%, transparent);
  /* The select's chevron, drawn like the arrows on the home's figures, in the muted teal. */
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2340626c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");

  /* This app's older names, pointed at the roles above, for the pages not yet redesigned. */
  --font-sans: var(--font-portal);
  --font-heading: var(--font-portal);
  --color-bg: var(--color-paper);
  --color-surface-raised: var(--color-paper);
  --color-text: var(--color-ink);
  --color-text-muted: var(--color-muted);
  --color-border: var(--color-rule);
  --color-border-control: var(--color-rule-control);
  --color-on-accent: var(--color-on-field);
  --color-success-fg: var(--color-ok-text);
  --color-success-bg: var(--color-ok-wash);
  --color-warning: var(--color-warn-fill);
  --color-warning-fg: var(--color-warn-text);
  --color-warning-bg: var(--color-warn-wash);
  --color-danger: var(--color-danger-fill);
  --color-danger-fg: var(--color-danger-text);
  --color-danger-bg: var(--color-danger-wash);
  --color-neutral-fg: var(--color-ink);
  --color-neutral-bg: var(--color-paper-3);
  --text-2xs: 0.8125rem;
  --text-xs: 0.8125rem;
  --text-sm: var(--text-label);
  --text-md: var(--text-body);
  --text-base: var(--text-body);
  --text-lg: var(--text-body);
  --text-xl: 1.25rem;
  --text-2xl: var(--text-h2);
  --text-3xl: 1.75rem;
  --text-4xl: var(--text-figure);
  --radius-card: var(--radius-panel);
  --radius-control: var(--radius-field);
  --shadow-card: none;
  --shadow-overlay: var(--shadow-overlay-soft);
  --control-h-sm: var(--control-sm);
  --control-h-md: var(--control);
}

@media (max-width: 40rem) { :root { --page-gap: var(--space-lg); --gap-columns: var(--space-md); } }

/* ------------------------------------------------------------ Base */

html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-rule-control) var(--color-paper); }

body {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--color-accent-strong);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-synthesis: none;
  letter-spacing: var(--tracking-display);
  overflow-wrap: break-word;
  min-width: 0;
  text-wrap: balance;
  color: inherit;
}

h1 { font-size: var(--text-page); line-height: 1.1; }
h2 { font-size: var(--text-h2); line-height: 1.2; }
h3 { font-size: var(--text-xl); line-height: 1.25; }

p { text-wrap: pretty; }

/* Links. A standalone link (a section's "Edit", "Who's using a seat", the footer, the links
   under a form) has no underline: its place and its weight say it's a link. A link inside a
   sentence keeps the underline, because the green is too close to the navy text (1.9:1) to tell
   them apart by colour alone. Text links are underlined on hover. (decided 2026-11-20)
   klepon-theme.css underlines every link with a long :not() chain (specificity 0,6,1) that a
   plain rule can't outrank, so the three underline rules here use !important. */
a { color: var(--color-accent-text); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--color-ink); }
a:not(.btn) { text-decoration-line: none !important; }
a:where(:not(.btn, .tile, .app-notification-item)) { font-weight: 600; }
/* The hover underline is for text links only. Navigation, menus, tiles and the logo show
   their hover with a background or a colour instead. */
a:not(.btn, .app-nav-item, .tile, .app-notification-item, .app-brand, .portal-topbar-brand, .signin-logo, .app-identity-dropdown > a):hover { text-decoration-line: underline !important; }
:is(p, li, dd, .notice) a:not(.btn) { text-decoration-line: underline !important; font-weight: inherit; }

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

::selection { background: color-mix(in oklab, var(--color-accent) 24%, transparent); color: var(--color-ink); }

.muted { color: var(--color-muted); }

/* Three weights: 400 body, 600 labels and emphasis, 700 headings and figures. */
strong, b { font-weight: 600; }

.tile-value, .package-numbers, td { font-variant-numeric: tabular-nums; }

.skip-link {
  left: var(--space-md);
  top: calc(-1 * var(--space-2xl));
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule);
  color: var(--color-ink);
  box-shadow: none;
}
.skip-link:focus { left: var(--space-md); top: var(--space-xs); }

/* The logo: the mark in green, the name in the text colour, as in the agency's full-colour logo. */
.klepon-logo path:first-child { fill: var(--color-mark); }

/* ------------------------------------------------------------ Buttons. The primary is the one
   green fill; the others are white with a firm edge, so they still read as buttons. */

.btn {
  gap: var(--space-xs);
  min-height: var(--control);
  padding: 0 var(--space-md);
  border: var(--rule-hair) solid var(--color-rule-control);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-body);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}

.btn:hover { background: var(--color-paper-2); border-color: var(--color-ink); color: var(--color-ink); }
.btn:active { background: var(--color-paper-3); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.btn-sm { min-height: var(--control-sm); padding: 0 var(--space-sm); font-size: var(--text-label); }

/* The one filled control: white on the dark brand green (5.2:1). */
.btn-primary { background: var(--color-accent-fill); border-color: var(--color-accent-fill); color: var(--color-accent-ink); }
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: var(--color-accent-ink); }
.btn-primary:active { background: var(--color-accent-press); border-color: var(--color-accent-press); color: var(--color-accent-ink); }

.btn-danger { background: var(--color-danger-fill); border-color: var(--color-danger-fill); color: var(--color-on-field); }
.btn-danger:hover { background: var(--color-danger-fill-hover); border-color: var(--color-danger-fill-hover); color: var(--color-on-field); }
.btn-danger:active { background: var(--color-danger-fill-hover); }

/* On the navy block: an outline in its own colours. */
.btn-on-dark { background: transparent; border-color: var(--color-on-field-muted); color: var(--color-on-field); }
.btn-on-dark:hover { background: var(--color-field-2); border-color: var(--color-on-field); color: var(--color-on-field); }
.btn-on-dark:active { background: var(--color-field-2); }

/* ------------------------------------------------------------ Fields */

label { font-family: var(--font-body); font-weight: 600; font-size: var(--text-label); color: var(--color-ink); margin-bottom: var(--space-xs); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="search"], input[type="number"], select, textarea {
  min-height: var(--control);
  padding: 0 var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule-control);
  border-radius: var(--radius-field);
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
}

textarea { padding: var(--space-xs) var(--space-sm); }
/* Selects: our own chevron, with room on the right, instead of the browser's. */
select {
  appearance: none;
  padding-right: calc(var(--space-sm) + 20px + var(--space-xs));
  background: var(--color-paper) var(--select-arrow) no-repeat right var(--space-sm) center / 20px 20px;
  cursor: pointer;
}
input::placeholder, textarea::placeholder { color: var(--color-muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--color-ink); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; background: var(--color-paper-2); cursor: not-allowed; }
input[type="checkbox"] { accent-color: var(--color-accent-strong); }
.input-readonly { background: var(--color-paper-2) !important; }

.error { color: var(--color-danger-text); font-size: var(--text-label); }
.field-hint { color: var(--color-muted); font-size: var(--text-label); }

.form-stack { gap: var(--space-md); }
/* A form's button keeps its own width; only .btn-block (the sign-in pages, the pay button) spans the form. */
.form-stack > .btn:not(.btn-block) { align-self: flex-start; }
.button-row { gap: var(--space-sm); align-items: center; }

/* ------------------------------------------------------------ Notices: a tint in the status
   colour. */

.notice { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-panel); font-size: var(--text-body); line-height: 1.5; }
.notice-ok { background: var(--color-ok-wash); color: var(--color-ok-text); }
.notice-error { background: var(--color-danger-wash); color: var(--color-danger-text); }
.notice-warning, .notice-test { background: var(--color-warn-wash); color: var(--color-warn-text); }
.notice a { color: inherit; }
.notice .muted { color: inherit; }
.notice > * + * { margin-top: var(--space-sm); }
.notice p + p { margin-top: var(--space-sm); }

/* ------------------------------------------------------------ Status: a tinted chip, so it
   never looks like a link. */

.badge { padding: var(--space-3xs) var(--space-sm); border-radius: var(--radius-pill); font-family: var(--font-body); font-weight: 600; font-size: var(--text-xs); line-height: 1.5; white-space: nowrap; }
.badge-success { background: var(--color-ok-wash); color: var(--color-ok-text); }
.badge-warning { background: var(--color-warn-wash); color: var(--color-warn-text); }
.badge-danger { background: var(--color-danger-wash); color: var(--color-danger-text); }
.badge-neutral { background: var(--color-paper-3); color: var(--color-ink); }

/* ------------------------------------------------------------ Panels: white, a light edge. */

.card { background: var(--color-paper); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-panel); box-shadow: none; padding: var(--space-lg); }
.card > * + * { margin-top: var(--space-sm); }
.card.empty-state { border-style: dashed; border-color: var(--color-rule-control); color: var(--color-muted); }

/* Tables: in a panel, a tinted header row. */
table { background: none; border: 0; border-radius: 0; box-shadow: none; }
th, td { padding: var(--space-sm) var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); font-size: var(--text-body); line-height: 1.45; }
th { background: var(--color-paper-2); color: var(--color-muted); font-family: var(--font-body); font-weight: 600; font-size: var(--text-label); }
tbody tr:hover td { background: none; }

.table-wrap { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-panel); box-shadow: none; background: var(--color-paper); }
.cell-note { margin-top: var(--space-2xs); color: var(--color-muted); font-size: var(--text-label); }
.row-actions { gap: var(--space-xs); }

@media (max-width: 600px) {
  .stack-table tr { padding: var(--space-sm) var(--space-md); }
  .stack-table td[data-label]::before { font-weight: 600; font-size: var(--text-label); color: var(--color-muted); }
  .stack-table td.cell-action { padding-top: var(--space-sm); }
}

/* The confirm dialog for removing a row (Members): a popover in the middle of the screen, the
   page dimmed behind it. */
.confirm-dialog {
  width: min(28rem, calc(100% - 2 * var(--space-md)));
  padding: var(--space-lg);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-panel);
  background: var(--color-paper);
  color: var(--color-ink);
  box-shadow: var(--shadow-overlay-soft);
  text-align: left;
  white-space: normal;
}
.confirm-dialog::backdrop { background: var(--color-scrim); }
.confirm-dialog p { margin: 0; line-height: 1.5; }
.confirm-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-lg); }

/* The inline confirm for a destructive action. */
.confirm-body { padding: var(--space-md); border-radius: var(--radius-panel); background: var(--color-danger-wash); color: var(--color-ink); gap: var(--space-sm); }
.confirm[open] > summary { margin-bottom: var(--space-sm); }

/* ------------------------------------------------------------ The shell: the sidebar, the
   top bar. Laptop: the sidebar. Phone (860px and under, klepon-theme.css): the top bar with
   the logo and a Menu button. */

.portal .app-shell { background: var(--color-paper); }
/* The sidebar's tint runs the full height of a long page, not only the first screen. */
@media (min-width: 861px) {
  .portal .app-shell { background: linear-gradient(to right, var(--color-sidebar) 248px, var(--color-paper) 248px); }
}

.portal .app-sidebar {
  width: 248px;
  padding: var(--space-lg) var(--space-sm);
  background: var(--color-sidebar);
  border-right: 0;
  color: var(--color-on-field);
  scrollbar-color: var(--color-on-field-muted) var(--color-sidebar);
}
.portal .app-sidebar :focus-visible { outline-color: var(--color-accent-on-field); }

/* On the navy: the brand's light full-colour logo, the green mark and a light name. */
.portal .app-brand { gap: var(--space-sm); padding: 0 var(--space-sm); margin-bottom: var(--space-lg); color: var(--color-on-field); }
.portal .app-brand:hover { color: var(--color-on-field); }
.portal-brand .klepon-logo { height: 22px; }
.wordmark-tag {
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--color-sidebar-active);
  color: var(--color-accent-on-field);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.portal .app-nav { gap: var(--space-3xs); }
.portal .app-nav-item {
  min-height: var(--control);
  gap: var(--space-sm);
  padding: 0 var(--space-sm);
  border-radius: var(--radius-field);
  color: var(--color-on-field-muted);
  font-size: var(--text-body);
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.portal .app-nav-item svg { width: 20px; height: 20px; color: var(--color-on-field-muted); }
.portal .app-nav-item:hover { background: var(--color-sidebar-hover); color: var(--color-on-field); }
.portal .app-nav-item:hover svg { color: var(--color-on-field); }
.portal .app-nav-item.active { background: var(--color-sidebar-active); color: var(--color-accent-on-field); }
.portal .app-nav-item.active svg { color: var(--color-accent-on-field); }
/* The phone's Menu dropdown is a white panel: it keeps the page colours. */
.portal .portal-menu-dropdown .app-nav-item { color: var(--color-ink); }
.portal .portal-menu-dropdown .app-nav-item svg { color: var(--color-muted); }
.portal .portal-menu-dropdown .app-nav-item:hover { background: var(--color-paper-3); color: var(--color-ink); }
.portal .portal-menu-dropdown .app-nav-item.active { background: var(--color-accent-wash); color: var(--color-ok-text); }
.portal .portal-menu-dropdown .app-nav-item.active svg { color: var(--color-ok-text); }
.portal .app-nav-item:focus-visible { outline-offset: -2px; }

.portal .app-topbar {
  min-height: var(--topbar-height);
  padding: var(--space-sm) var(--space-xl);
  gap: var(--space-xs);
  background: var(--color-paper);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  box-shadow: none;
}

.app-notification-bell,
.app-identity {
  width: var(--control);
  height: var(--control);
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--color-ink);
}
.app-notification-bell:hover,
.app-identity:hover,
.app-identity-menu[open] > summary.app-notification-bell,
.app-identity-menu[open] > summary.app-identity { background: var(--color-paper-3); }
.app-notification-dot { background: var(--color-danger-fill); border-color: var(--color-paper); top: 9px; right: 10px; }
.app-identity-avatar { width: 34px; height: 34px; background: var(--color-accent-fill); color: var(--color-accent-ink); font-size: var(--text-label); }

.app-identity-dropdown {
  top: calc(100% + var(--space-xs));
  z-index: var(--z-dropdown);
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-overlay-soft);
}
.app-identity-dropdown-email { font-size: var(--text-body); font-weight: 600; }
.app-identity-dropdown-role { font-size: var(--text-label); color: var(--color-muted); }
.app-identity-dropdown a { font-size: var(--text-body); font-weight: 600; white-space: nowrap; }
.app-identity-dropdown > a { margin: 0 calc(-1 * var(--space-xs)); padding: var(--space-xs); border-radius: var(--radius-field); }
.app-identity-dropdown > a:hover { background: var(--color-paper-3); color: var(--color-ink); }
.app-logout { min-height: var(--control-sm); white-space: nowrap; padding: 0 var(--space-md); border: var(--rule-hair) solid var(--color-rule-control); font-family: var(--font-body); font-weight: 600; font-size: var(--text-label); color: var(--color-ink); }
.app-logout:hover { background: var(--color-paper-2); border-color: var(--color-ink); }
.app-logout:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* The bell's panel: a header, the list (a fixed maximum height, scrolling down only), "See all"
   at the foot. Each row has its own padding; an unread row has a thin green edge and a small
   "New" marker, not a green fill. The Notifications page uses the same rows. */
.app-notification-dropdown { display: flex; flex-direction: column; padding: 0; gap: 0; width: 24rem; max-width: calc(100vw - 2 * var(--space-md)); max-height: none; overflow: hidden; }
.app-notification-header { flex-shrink: 0; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.app-notification-header-title { color: var(--color-ink); font-size: var(--text-label); font-weight: 600; text-transform: none; letter-spacing: 0; }
.app-notification-mark-read button { min-height: var(--control-sm); color: var(--color-accent-text); font-size: var(--text-label); text-decoration: underline; text-underline-offset: 0.18em; }
.app-notification-mark-read button:hover { color: var(--color-ink); }
.app-notification-mark-read button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.app-notification-empty { margin: 0; padding: var(--space-md); color: var(--color-muted); font-size: var(--text-label); }
.app-notification-list { max-height: min(24rem, calc(100dvh - var(--topbar-height) - 8rem)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.app-notification-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
  padding: var(--space-sm) var(--space-md) var(--space-sm) calc(var(--space-md) + 3px);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  border-left: 3px solid transparent;
  color: var(--color-ink);
  text-decoration: none;
}
/* The account menu's links (.app-identity-dropdown a) are bold and don't wrap; a notification
   row is neither. */
.app-identity-dropdown a.app-notification-item { font-weight: 400; white-space: normal; }
.app-notification-item:last-child { border-bottom: 0; }
.app-notification-item:is(a):hover { background: var(--color-paper-2); color: var(--color-ink); }
.app-notification-item:focus-visible { outline-offset: -2px; }
.app-notification-item.unread { background: none; border-left-color: var(--color-accent-strong); }
.app-notification-message { margin: 0; color: var(--color-ink); font-size: var(--text-label); font-weight: 400; line-height: 1.45; overflow-wrap: anywhere; }
.app-notification-item.unread .app-notification-message { font-weight: 600; }
.app-notification-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.app-notification-new { padding: 0 var(--space-xs); border-radius: var(--radius-pill); background: var(--color-accent-wash); color: var(--color-ok-text); font-size: var(--text-xs); font-weight: 600; line-height: 1.6; }
.app-notification-item:not(.unread) .app-notification-new { display: none; }
.app-notification-time { display: inline; font-size: var(--text-xs); color: var(--color-muted); }
.app-notification-all { flex-shrink: 0; display: flex; align-items: center; justify-content: center; min-height: var(--control); border-top: var(--rule-hair) solid var(--color-rule); font-size: var(--text-label); }
.app-notification-all:hover { background: var(--color-paper-2); }
.app-notification-dropdown > a.app-notification-all { margin: 0; padding: 0 var(--space-md); border-radius: 0; }

/* The Notifications page: the same rows in a panel. */
.notification-page-list { max-width: 48rem; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-panel); overflow: clip; }
.notification-page-list .app-notification-message { font-size: var(--text-body); }
.notifications-head { justify-content: flex-end; max-width: 48rem; }

.portal-menu-button {
  min-height: var(--control);
  padding: 0 var(--space-md);
  border: var(--rule-hair) solid var(--color-rule-control);
  color: var(--color-ink);
  font-weight: 600;
  font-size: var(--text-label);
}
.portal-menu-button:hover, .portal-menu[open] > .portal-menu-button { background: var(--color-paper-2); border-color: var(--color-ink); }
.portal-menu-dropdown { gap: var(--space-3xs); padding: var(--space-xs); }
.portal-menu-dropdown .app-nav-item { white-space: nowrap; }

@media (max-width: 860px) {
  .portal .app-topbar { padding: var(--space-xs) var(--space-md); }
  .app-identity-dropdown { top: calc(var(--topbar-height) + var(--space-xs)); }
}

/* ------------------------------------------------------------ The page */

.portal .app-main { max-width: 1200px; padding: var(--space-xl) var(--space-xl) var(--space-2xl); }
@media (max-width: 860px) { .portal .app-main { padding: var(--space-lg) var(--space-md) var(--space-xl); } }

.page-stack { gap: var(--page-gap); }
.page-header { display: flex; flex-direction: column; gap: var(--space-xs); }
.page-header h1 { max-width: 30ch; }
.page-lede { margin: 0; max-width: 64ch; color: var(--color-muted); font-size: var(--text-lead); line-height: 1.5; }

.section-head { align-items: baseline; gap: var(--space-md); margin-bottom: var(--space-md); }
.section-head h2 { margin: 0; }
.section-head > a { flex-shrink: 0; font-weight: 600; }

/* The home's lead: a light line when something needs the Owner, Getting started, the two figures. */
.home-lead { display: flex; flex-direction: column; gap: var(--space-md); }
.home-lead:not(:has(*)) { display: none; }

.next-step {
  --color-ink: var(--color-on-field);
  --color-muted: var(--color-on-field-muted);
  --color-accent-text: var(--color-accent-on-field);
  --color-focus: var(--color-accent-on-field);
  gap: var(--space-xs);
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius-panel);
  background: var(--color-field);
  color: var(--color-on-field);
}
.next-step h2 { margin: 0; color: var(--color-on-field); font-size: var(--text-3xl); line-height: 1.15; max-width: 30ch; }
.next-step p { max-width: 64ch; color: var(--color-on-field-muted); }
.next-step .button-row { margin-top: var(--space-sm); }
.next-step-kicker { order: -1; color: var(--color-accent-on-field); font-size: var(--text-label); font-weight: 600; letter-spacing: 0; text-transform: none; }
.next-step :focus-visible { outline-color: var(--color-accent-on-field); }

/* Getting started (Pages/Portal/_GettingStarted.cshtml): a white panel with the steps, done ones
   ticked and crossed out, only the current one with a line and a button. It folds to its heading
   and bar (<details>). */
.getting-started { max-width: 44rem; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-panel); background: var(--color-paper); }
.getting-started summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: var(--space-xs) var(--space-sm); padding: var(--space-sm) var(--space-md); cursor: pointer; list-style: none; }
.getting-started summary::-webkit-details-marker { display: none; }
.getting-started h2 { margin: 0; font-size: var(--text-body); }
.gs-count { color: var(--color-muted); font-size: var(--text-label); font-weight: 600; }
.gs-fold { width: 18px; height: 18px; color: var(--color-muted); transition: transform var(--dur-micro) var(--ease-out); }
.getting-started details[open] .gs-fold { transform: rotate(180deg); }
.gs-bar { grid-column: 1 / -1; height: 6px; border-radius: var(--radius-pill); background: var(--color-paper-3); overflow: hidden; }
.gs-bar > span { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--color-accent-strong); }
.gs-list { margin: 0; padding: 0 var(--space-md) var(--space-sm); list-style: none; display: flex; flex-direction: column; }
.gs-list > li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--space-xs) var(--space-sm); padding: var(--space-xs) 0; align-items: start; }
.gs-list > li::before { content: ""; box-sizing: border-box; width: 18px; height: 18px; margin-top: 2px; border-radius: var(--radius-pill); border: 1.5px solid var(--color-rule); }
.gs-list > li.done::before { border: 0; background: var(--color-accent-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.5l3 3 6-7'/%3E%3C/svg%3E") center / 14px no-repeat; }
.gs-list > li.done .gs-title { color: var(--color-muted); text-decoration: line-through; }
.gs-list > li.current::before { border: 2px solid var(--color-accent-strong); }
.gs-list > li.current .gs-title { font-weight: 600; }
.gs-detail, .gs-actions { grid-column: 2; }
.gs-detail { margin: 0; max-width: 64ch; color: var(--color-muted); font-size: var(--text-label); }
.gs-status { color: var(--color-ink); }
.gs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); }
.gs-actions form { margin: 0; }
.gs-skip { min-height: var(--control-sm); padding: 0; border: 0; background: none; color: var(--color-muted); font: inherit; font-size: var(--text-label); cursor: pointer; }
.gs-skip:hover { color: var(--color-ink); text-decoration: underline; }

/* One line on the home when something needs the Owner: the text, then its link. */
.notice-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-sm); width: fit-content; max-width: 100%; }
.notice-line > * + * { margin-top: 0; }
.notice-line a { font-weight: 600; }
.notice-quiet { background: var(--color-paper-2); color: var(--color-ink); }

/* The two figures: panels that open a page, with a chevron and a hover. */
.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); max-width: 44rem; }
.tile {
  position: relative;
  gap: var(--space-2xs);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-panel);
  box-shadow: none;
  color: var(--color-ink);
  text-decoration: none;
}
a.tile { transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
a.tile:hover { background: var(--color-paper-2); border-color: var(--color-ink); box-shadow: none; color: var(--color-ink); }
a.tile:focus-visible { outline-offset: 2px; }
.tile-go { position: absolute; top: var(--space-md); right: var(--space-md); width: 20px; height: 20px; color: var(--color-muted); }
a.tile:hover .tile-go { color: var(--color-ink); }
.tile-label { color: var(--color-muted); font-size: var(--text-label); font-weight: 600; }
.tile-value { font-size: var(--text-figure); font-weight: var(--display-weight); line-height: 1.1; letter-spacing: var(--tracking-display); }
.tile-of { color: var(--color-muted); font-size: var(--text-body); font-weight: 600; letter-spacing: 0; }
.tile-note { color: var(--color-muted); font-size: var(--text-label); }

/* The package ledger, in one panel: one row per package with its name, its seats and its
   next end date set large. */
.ledger { margin: 0; padding: 0; list-style: none; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-panel); background: var(--color-paper); }
.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 4fr);
  align-items: center;
  gap: var(--space-sm) var(--gap-columns);
  padding: var(--space-md) var(--space-lg);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row h3 { margin: 0; font-size: var(--text-xl); }
.ledger-seats { display: flex; flex-direction: column; gap: var(--space-xs); }
.ledger-seats .util-bar { margin: 0; height: 8px; max-width: 26rem; background: var(--color-paper-3); }
.ledger-seats .util-bar-fill-ok { background: var(--color-accent-strong); }
.package-numbers { margin: 0; color: var(--color-ink); }

/* The home's packages list: headings once, then per package its name and end date, the seats,
   who is using one now, and two quiet links (Licences, Seats) at the end of the row. */
.ledger-head, .ledger-row-home { grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 4fr) 9rem; align-items: start; }
.ledger-head { display: grid; gap: var(--space-sm) var(--gap-columns); padding: var(--space-sm) var(--space-lg); border-bottom: var(--rule-hair) solid var(--color-rule); color: var(--color-muted); font-size: var(--text-label); font-weight: 600; }
.ledger-name { display: flex; flex-direction: column; gap: var(--space-3xs); min-width: 0; }
.ledger-end { margin: 0; color: var(--color-muted); font-size: var(--text-label); }
.ledger-end.warning { color: var(--color-warn-text); font-weight: 600; }
.ledger-end.danger { color: var(--color-danger-text); font-weight: 600; }
.ledger-holders { display: flex; flex-direction: column; gap: var(--space-2xs); min-width: 0; }
.holder-more { align-self: flex-start; font-size: var(--text-label); }
.holder-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3xs); }
.holder-list li { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; overflow-wrap: anywhere; }
.holder-list li::before { content: ""; width: 8px; height: 8px; flex-shrink: 0; border-radius: var(--radius-pill); background: var(--color-accent-strong); }
.holder-list li.offline::before { background: var(--color-warn-fill); }
.holder-offline { color: var(--color-warn-text); font-size: var(--text-label); }
.ledger-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2xs) var(--space-md); font-size: var(--text-label); font-weight: 600; }
.ledger .ledger-actions a { text-decoration-line: none !important; }
.ledger .ledger-actions a:hover { text-decoration-line: underline !important; }

@media (max-width: 52rem) {
  .ledger-row, .ledger-row-home { grid-template-columns: minmax(0, 1fr) auto; }
  .ledger-head { display: none; }
  .ledger-row h3, .ledger-name { grid-column: 1; }
  .ledger-seats, .ledger-holders, .ledger-actions { grid-column: 1 / -1; }
  .ledger-actions { justify-content: flex-start; }
}

@media (max-width: 40rem) {
  .tile { padding: var(--space-sm) var(--space-md); }
  .tile-value { font-size: var(--text-3xl); }
  .next-step { padding: var(--space-lg); }
  .next-step h2 { font-size: var(--text-h2); }
  .ledger-row { padding: var(--space-md); }
}

/* A table's panel: the search, filters and sort as the top of the table, inside the same edge
   (Pages/Shared/_TableToolbar.cshtml). With the script (wwwroot/js/table-tools.js, which adds
   .tt-on), each change applies at once and Apply is hidden. "Sort by" shows on a phone only: on a
   wider screen the column headers sort. */
.table-panel { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-panel); background: var(--color-paper); overflow: clip; }
.table-panel .table-wrap { border: 0; border-radius: 0; }
.table-panel [hidden] { display: none !important; }
.table-panel tbody:last-of-type tr:last-child > td { border-bottom: 0; }

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-sm) var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.tt-field { display: flex; flex-direction: column; flex: 0 1 13rem; min-width: 0; }
.tt-field label { margin-bottom: var(--space-2xs); }
.tt-search { flex: 1 1 16rem; max-width: 26rem; }
/* A magnifier inside the search field, drawn like the select's chevron. */
.tt-search input {
  padding-left: calc(var(--space-sm) + 18px + var(--space-xs));
  background: var(--color-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2340626c' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cpath d='M13 13l4 4'/%3E%3C/svg%3E") no-repeat left var(--space-sm) center / 18px 18px;
}
.tt-sort-field { display: none; }
.tt-actions { display: flex; align-items: center; gap: var(--space-md); min-height: var(--control); }
.tt-actions .btn { min-height: var(--control); }
.tt-on [data-tt-apply] { display: none; }
.tt-on .tt-actions:not(:has(a:not([hidden]))) { display: none; }
.tt-count { display: flex; align-items: center; min-height: var(--control); margin: 0 0 0 auto; color: var(--color-muted); font-size: var(--text-label); }
.tt-empty { margin: 0; padding: var(--space-md) var(--space-lg); color: var(--color-muted); }

/* Sortable column headers: the header is the control; the arrows show the direction. */
th .sort-link { display: inline-flex; align-items: center; gap: var(--space-2xs); color: inherit; font-weight: 600; white-space: nowrap; }
th .sort-link:hover { color: var(--color-ink); }
.sort-mark { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.45; }
th[aria-sort] { color: var(--color-ink); }
th[aria-sort] .sort-mark { opacity: 1; }
th[aria-sort="ascending"] .sort-down, th[aria-sort="descending"] .sort-up { opacity: 0; }

@media (max-width: 600px) {
  .table-toolbar { padding: var(--space-md); }
  .tt-field, .tt-search { flex: 1 1 100%; max-width: none; }
  .tt-sort-field { display: flex; }
  .tt-count { margin-left: 0; min-height: 0; }
  .tt-empty { padding: var(--space-md); }
}

/* Licences: one row per licence, a tick box first; "Renew selected" under the table with what
   a renewal does. The title row has Add seats at its end. */
.page-header-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-md); }
.cell-select { width: 3rem; }
.cell-select input[type="checkbox"] { width: 20px; height: 20px; margin: 0; vertical-align: middle; cursor: pointer; }
.cell-select input[type="checkbox"]:disabled { cursor: not-allowed; }
.renew-bar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-sm) var(--space-lg); margin-top: var(--space-md); padding: var(--space-md) var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-panel); background: var(--color-paper-2); }
.renew-bar-text { flex: 1 1 20rem; display: flex; flex-direction: column; gap: var(--space-2xs); }
.renew-bar-text p { margin: 0; max-width: 70ch; }
.renew-bar-text .muted { font-size: var(--text-label); }

@media (max-width: 600px) {
  .stack-table .cell-select { width: 100%; }
  .renew-bar { padding: var(--space-md); }
  .renew-bar .btn { width: 100%; }
}

/* Seats: the groups under each package's seats. */
.group-lines { margin: 0; padding: 0; list-style: none; color: var(--color-muted); font-size: var(--text-label); }

/* The lower row: the company, the plugin, where you're signed in, each a panel. */
.home-more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--gap-columns);
  align-items: start;
}
.home-more .facts { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); }
.home-more h2 { font-size: var(--text-xl); }
.home-more .section-head { margin-bottom: 0; }

.facts dt { color: var(--color-muted); font-size: var(--text-label); font-weight: 600; }
.facts dd { margin-top: var(--space-3xs); }

.session-list li { padding: var(--space-sm) 0; border-bottom-color: var(--color-rule); }

/* A Member's home: their seat first. */
.seat-statement { display: flex; flex-direction: column; gap: var(--space-xs); }
.seat-statement > * { margin: 0; }
.seat-statement p:first-of-type { font-size: var(--text-lead); max-width: 56ch; }

/* ------------------------------------------------------------ Members: the invite in a panel
   at the top, the tables under it. */

.members-layout { display: flex; flex-direction: column; gap: var(--page-gap); }
.members-layout > section { min-width: 0; }
.invite-panel > * { margin: 0; }
.invite-panel { display: flex; flex-direction: column; gap: var(--space-xs); }
.invite-panel h2 { font-size: var(--text-xl); }
.invite-panel p { max-width: 70ch; }
.invite-panel .inline-form { margin-top: var(--space-sm); max-width: 40rem; }
.invite-panel .inline-form .field-grow { flex-basis: 16rem; }

.copy-link .inline-form { margin-top: var(--space-sm); }
.copy-link .inline-form label { color: inherit; }
.inline-form { gap: var(--space-sm); }


/* ------------------------------------------------------------ The other portal pages */

/* Seats: the same package rows as the home, without the end date. */
.ledger-seats-only .ledger-row { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
.ledger-row .package-card-title { margin: 0; font-size: var(--text-xl); }
.section-note { max-width: 70ch; color: var(--color-muted); font-size: var(--text-label); }

/* Account: one column, the familiar settings order (password, your data, then leaving and
   deleting last, set apart); the irreversible action's panel has a red edge. */
.settings-grid { grid-template-columns: minmax(0, 1fr); max-width: 48rem; gap: var(--gap-columns); }
.settings-grid form.form-stack { max-width: 28rem; }
.settings-side { gap: var(--gap-columns); }
.settings-side > .danger-card, .settings-side > section:has(#leave-title) { margin-top: var(--space-lg); }
.settings-side > section:has(#leave-title) + .danger-card { margin-top: 0; }
.form-layout { gap: var(--gap-columns); }
.danger-card { border-color: color-mix(in oklab, var(--color-danger-fill) 45%, var(--color-paper)); box-shadow: none; }
.consequences { padding-left: var(--space-lg); gap: var(--space-xs); }

/* Billing and checkout: two fields on one row (postcode and city). */
.field-row { gap: var(--space-md) var(--space-sm); }

/* Request a license. */
.invoiced-to { color: var(--color-muted); }
.checkbox-group legend { margin-bottom: var(--space-xs); font-weight: 600; font-size: var(--text-label); }
label.checkbox { gap: var(--space-xs); margin-right: var(--space-lg); font-weight: 400; font-size: var(--text-body); }
.input-narrow { max-width: 8rem; }

/* New licences: three package cards (a radio each), then a bar with the seats, the duration, a
   summary and the main button. */
.order-form { display: flex; flex-direction: column; gap: var(--space-md); }
.package-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); margin: 0; padding: 0; border: 0; min-width: 0; }
.package-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  margin: 0;
  padding: var(--space-md) var(--space-lg) var(--space-md) calc(var(--space-lg) + 22px + var(--space-sm));
  border: var(--rule-hair) solid var(--color-rule-control);
  border-radius: var(--radius-panel);
  background: var(--color-paper);
  font-weight: 400;
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.package-card:hover { border-color: var(--color-ink); }
.package-card input[type="radio"] { position: absolute; top: calc(var(--space-md) + 2px); left: var(--space-lg); width: 20px; height: 20px; margin: 0; accent-color: var(--color-accent-strong); cursor: pointer; }
.package-card:has(input:checked) { border-color: var(--color-accent-strong); background: var(--color-accent-wash); box-shadow: inset 0 0 0 1px var(--color-accent-strong); }
.package-card:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.package-card input:focus-visible { outline: none; }
.package-card-name { font-size: var(--text-lead); font-weight: var(--display-weight); line-height: 1.3; }
.package-card-line { color: var(--color-muted); font-size: var(--text-label); line-height: 1.45; }
.package-card-price { margin-top: var(--space-2xs); font-weight: 600; }
.package-card-price span { color: var(--color-muted); font-size: var(--text-label); font-weight: 400; }
.package-cards .error { grid-column: 1 / -1; margin: 0; }

.order-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-md) var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-panel);
  background: var(--color-paper-2);
}
.order-seats, .order-term { display: flex; flex-direction: column; }
.order-seats label, .order-label { margin-bottom: var(--space-2xs); color: var(--color-ink); font-size: var(--text-label); font-weight: 600; }
.order-value { display: flex; align-items: center; min-height: var(--control); font-weight: 600; }
.stepper { display: flex; align-items: stretch; }
.stepper input[type="number"] { width: 5rem; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.stepper input[type="number"]::-webkit-inner-spin-button, .stepper input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control);
  min-height: var(--control);
  padding: 0;
  border: var(--rule-hair) solid var(--color-rule-control);
  background: var(--color-paper);
  color: var(--color-ink);
  cursor: pointer;
}
.stepper-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.stepper-button:hover:not(:disabled) { background: var(--color-paper-3); border-color: var(--color-ink); }
.stepper-button:disabled { opacity: 0.45; cursor: not-allowed; }
.stepper-button:focus-visible { position: relative; z-index: 1; }
.stepper-button:first-child { border-radius: var(--radius-field) 0 0 var(--radius-field); border-right: 0; }
.stepper-button:last-child { border-radius: 0 var(--radius-field) var(--radius-field) 0; border-left: 0; }
.stepper-button:not([hidden]) ~ input, .stepper:has(.stepper-button:not([hidden])) input { border-radius: 0; }
.order-summary { display: flex; flex-direction: column; justify-content: center; gap: var(--space-3xs); min-height: var(--control); margin: 0; flex: 1 1 14rem; }
.order-summary strong { font-size: var(--text-lead); }
.order-summary span { color: var(--color-muted); font-size: var(--text-label); }
.order-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-left: auto; }
.order-form > .field-hint { margin: 0; max-width: 70ch; }
.order-form > .error:empty { display: none; }

.order-more > summary { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: var(--control-sm); color: var(--color-accent-text); font-weight: 600; cursor: pointer; list-style: none; }
.order-more > summary::-webkit-details-marker { display: none; }
.order-more > summary::before { content: ""; width: 7px; height: 7px; margin: 0 var(--space-2xs) 0 2px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur-micro) var(--ease-out); }
.order-more[open] > summary::before { transform: rotate(45deg); }
.order-more > summary:hover { color: var(--color-ink); }
.order-more > .form-stack { max-width: 36rem; margin-top: var(--space-sm); }

@media (max-width: 52rem) {
  .package-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .order-bar { padding: var(--space-md); gap: var(--space-md); }
  .order-actions { margin-left: 0; width: 100%; }
  .order-actions .btn { flex: 1 1 auto; }
}

/* Checkout: the price lines. */
.price-lines { gap: var(--space-xs); }
.price-lines .price-total { padding-top: var(--space-sm); border-top-color: var(--color-rule); font-weight: var(--display-weight); }
.next-step .next-step-title { color: var(--color-on-field); font-size: var(--text-3xl); line-height: 1.15; }

/* Download: one line with the essentials and the button, the needs under it, the checksum
   folded; then the release notes and the steps. */
.next-steps { padding-left: var(--space-lg); gap: var(--space-xs); }
code { font-size: 0.875em; overflow-wrap: anywhere; }
.download-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md) var(--space-lg); }
.download-essentials { margin: 0; font-size: var(--text-h2); }
.download-essentials span { color: var(--color-muted); font-weight: 600; letter-spacing: 0; }
.download-card .download-needs { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-xl); margin-top: var(--space-md); }
.verify > summary { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: var(--control-sm); color: var(--color-accent-text); font-weight: 600; cursor: pointer; list-style: none; }
.verify > summary::-webkit-details-marker { display: none; }
.verify > summary::before, .earlier-notes > summary::before { content: ""; width: 7px; height: 7px; margin: 0 var(--space-2xs) 0 2px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur-micro) var(--ease-out); }
.verify[open] > summary::before, .earlier-notes[open] > summary::before { transform: rotate(45deg); }
.verify > summary:hover, .earlier-notes > summary:hover { color: var(--color-ink); }
.verify-body { display: flex; flex-direction: column; gap: var(--space-sm); margin-top: var(--space-sm); max-width: 48rem; }
.verify-body p { margin: 0; font-size: var(--text-label); }
.input-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--text-label) !important; }
.release-notes { margin: var(--space-sm) 0 0; padding-left: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-xs); max-width: 72ch; }
.earlier-notes { margin-top: var(--space-md); }
.earlier-notes > summary { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: var(--control-sm); color: var(--color-accent-text); font-weight: 600; cursor: pointer; list-style: none; }
.earlier-notes > summary::-webkit-details-marker { display: none; }
.earlier-notes h3 { margin: var(--space-md) 0 var(--space-xs); font-size: var(--text-lead); }

/* Weights: three only, 400, 600 and 700. */
.app-identity-avatar { font-weight: var(--display-weight); }

/* ------------------------------------------------------------ Footer: a quiet line. */

.portal .site-footer { border-top: var(--rule-hair) solid var(--color-rule); color: var(--color-muted); font-size: var(--text-label); }
.portal .site-footer a { color: var(--color-ink-2); font-weight: 400; }

/* ------------------------------------------------------------ Signed-out pages: a centred
   white card on the navy field, the logo above it, the footer below (decided 2026-11-20, after
   Fikri's sign-in mockup). A soft green light follows the cursor, with a delay
   (wwwroot/js/signin-light.js moves --light-x/--light-y); without the script, on touch screens or
   when less motion is asked, it stays where it starts. */

.signin { display: block; min-height: 100dvh; background: var(--color-field); }

.signin-frame {
  --light-x: 72%;
  --light-y: 38%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 0 var(--space-md);
  background-color: var(--color-field);
  background-image: radial-gradient(980px circle at var(--light-x) var(--light-y), var(--color-light-core) 0%, var(--color-light-edge) 38%, transparent 74%);
}

.signin-header { display: flex; justify-content: center; padding: var(--space-2xl) 0 var(--space-xl); }
.signin-logo { color: var(--color-on-field); }
.signin-logo:hover { color: var(--color-on-field); }
.signin-logo:focus-visible { outline-color: var(--color-accent-on-field); }
.signin-logo .klepon-logo { height: 44px; }
/* On the navy: the brand's one-colour light logo (klepon-brand LIGHT/ONE COLOR), all #f2f2f2, so
   the mark doesn't vanish when the green light passes behind it. */
.signin-logo .klepon-logo path:first-child { fill: currentColor; }

.signin-body { display: flex; flex-direction: column; align-items: center; flex: 1; width: 100%; min-width: 0; }
.signin-main { display: flex; flex: 1; width: 100%; justify-content: center; align-items: flex-start; padding: 0; }

.signin-card {
  width: 100%;
  max-width: 28rem;
  gap: var(--space-md);
  padding: var(--space-xl);
  border: 0;
  border-radius: 16px;
  background: var(--color-paper);
  box-shadow: var(--shadow-signin-card);
}
.signin-card h1 { font-size: 2rem; }
.signin-lede { color: var(--color-muted); font-size: var(--text-lead); line-height: 1.45; }
.signin-small { color: var(--color-muted); font-size: var(--text-label); }
.signin .btn { min-height: var(--control-lg); }
.signin input[type="text"], .signin input[type="email"], .signin input[type="password"] { min-height: var(--control-lg); }
.signin-links { gap: var(--space-sm); font-size: var(--text-body); padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); }

.signin .site-footer {
  width: 100%;
  max-width: 42rem;
  margin-top: var(--space-2xl);
  padding: var(--space-lg) 0 var(--space-xl);
  align-items: center;
  border-top: var(--rule-hair) solid var(--color-rule-on-field);
  color: var(--color-on-field-muted);
  font-size: var(--text-label);
  text-align: center;
}
.signin .site-footer-links { justify-content: center; gap: var(--space-2xs) var(--space-lg); }
.signin .site-footer a { color: var(--color-on-field); font-weight: 400; }
.signin .site-footer :focus-visible { outline-color: var(--color-accent-on-field); }

@media (max-width: 60rem) {
  .signin-header { padding: var(--space-xl) 0 var(--space-lg); }
  .signin-logo .klepon-logo { height: 32px; }
  .signin-card { padding: var(--space-lg); }
}

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