/*
  Myscotek: hand-written styles, no framework. Mobile first; breakpoints at 40em, 48em and 64em.

  Colour pairs used for text are WCAG AA (4.5:1, or 3:1 for large text); the ratios are noted beside the tokens.
  #5ab5ee (header gradient bottom) is decorative on light backgrounds and never used for text on them.
*/

/* ================================================================== tokens */

:root {
  color-scheme: light;

  /* Brand palette (brand/README.md) */
  --brand: #0072b9;            /* base colour: 5.11:1 on white; white text on it 5.11:1 */
  --brand-link: #027ac6;       /* link colour: 4.56:1 on white, so white surfaces only */
  --brand-mark: #2868b0;       /* the logo mark */
  --brand-sky: #2385c2;        /* header gradient top (decorative) */
  --brand-sky-light: #5ab5ee;  /* header gradient bottom (decorative) */
  --brand-text: #494949;       /* text colour: 9.00:1 on white */

  /* Derived */
  --brand-strong: #005a92;     /* hover / pressed, links on tinted surfaces: 7.30:1 on white, 6.73:1 on --tint */
  --brand-deep: #003a5f;       /* footer background */
  --ink: #1d2833;              /* headings, labels: 14.96:1 on white */
  --text: var(--brand-text);
  --muted: #5b6672;            /* secondary text: 5.85:1 on white, 5.40:1 on --tint */
  --bg: #fff;
  --surface: #fff;
  --tint: #f3f6f9;             /* alternate bands, table headers */
  --wash: #eaf4fb;             /* light brand wash */
  --border: #dbe2e8;           /* dividers (decorative) */
  --border-strong: #7c8895;    /* form control borders: 3.61:1 on white, 3.33:1 on --tint */

  --link: var(--brand-link);
  --focus: var(--brand);

  /* Status colours: text on its tint is 5.6:1 or better */
  --info: var(--brand-strong);  --info-tint: var(--wash);  --info-border: #b6d8ef;
  --success: #1b6a3a;  --success-tint: #e6f4eb;  --success-border: #a9d7b9;
  --danger: #b3261e;   --danger-tint: #fcebea;   --danger-border: #f0b4af;
  --warning: #8a4b00;  --warning-tint: #fcf0db;  --warning-border: #ecc986;
  --neutral: #4b5560;  --neutral-strong: #3b4856;  --neutral-tint: #eceff2;  --neutral-border: #d2d8de;

  /* "Coming soon" badge: --brand-deep text on a --brand-sky-light fill, 5.24:1 (the sky blue is a fill, never text) */
  --soon: var(--brand-deep);  --soon-tint: var(--brand-sky-light);  --soon-border: var(--brand-sky);

  /* Placeholder copy (TODO:), easy to spot */
  --todo-text: #6b4f0e;        /* 7.21:1 on --todo-bg */
  --todo-bg: #fff8e6;
  --todo-border: #c79a2e;

  /* Type */
  --font-display: "Quicksand", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --fs-small: 0.875rem;
  --fs-body: 1rem;
  --fs-lead: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --fs-h3: 1.1875rem;
  --fs-h2: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --fs-h1: clamp(1.875rem, 1.55rem + 1.5vw, 2.625rem);
  --fs-hero: clamp(2.125rem, 1.45rem + 3vw, 3.5rem);

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --section-space: clamp(3.5rem, 2.5rem + 4vw, 5.5rem);
  --gutter: 1rem;
  --content: 72rem;
  --measure: 68ch;

  /* Shape */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(16 42 67 / 0.06);
}

@media (min-width: 48em) {
  :root { --gutter: 2rem; }
}

/* Admin pages (they carry the admin sub-navigation) get a wider canvas for their data tables. */
body:has(.admin-nav) { --content: 84rem; }

/* =================================================================== base */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.3; }

p, ul, ol, dl, address, figure, table { margin: 0 0 var(--space-4); }
ul, ol { padding-left: 1.25rem; }
address { font-style: normal; }
strong { font-weight: 600; color: var(--ink); }
small { font-size: var(--fs-small); }

code {
  padding: 0.05em 0.35em;
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-wrap: anywhere;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--brand-strong);
  text-decoration-thickness: 2px;
}

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

.skip-link {
  position: absolute;
  top: 0;
  left: var(--gutter);
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transform: translateY(-120%);
}

.skip-link:focus { transform: none; color: #fff; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ================================================================= layout */

.container {
  width: min(100% - 2 * var(--gutter), var(--content));
  margin-inline: auto;
}

.site-main { flex: 1 0 auto; }

.page { padding-block: var(--space-7) var(--space-8); }

/* ----------------------------------------------------------------- header */

.site-header {
  padding-top: 4px;
  background:
    linear-gradient(90deg, var(--brand-sky), var(--brand-sky-light)) top / 100% 4px no-repeat,
    var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-6);
  padding-block: var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3rem;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover { color: var(--ink); }

.brand__mark { width: 2.75rem; }

.brand__name {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* 12px on phones keeps the three links and "Sign in" on one row at 375px wide. */
  gap: 0 var(--space-3);
  margin: 0 0 var(--space-2);
  padding: 0;
  font-size: 0.9375rem;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.site-nav a[aria-current] {
  color: var(--brand-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.site-nav .site-nav__action {
  min-height: 2.5rem;
  padding: 0 var(--space-4);
  font-weight: 600;
  color: var(--brand-strong);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
}

.site-nav .site-nav__action:hover {
  text-decoration: none;
  background: var(--wash);
}

.signed-in-as {
  display: block;
  max-width: 16rem;
  overflow: hidden;
  font-size: var(--fs-small);
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (min-width: 48em) {
  .site-nav ul {
    gap: 0 var(--space-5);
    margin-bottom: 0;
    font-size: 1rem;
  }
}

/* ----------------------------------------------------------------- footer */

.site-footer {
  --link: #bde0f7;             /* 8.57:1 on --brand-deep */
  --focus: #fff;
  padding-block: var(--space-6);
  font-size: var(--fs-small);
  color: #e3edf5;              /* 10.00:1 on --brand-deep */
  background:
    linear-gradient(90deg, var(--brand-sky), var(--brand-sky-light)) top / 100% 3px no-repeat,
    var(--brand-deep);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
}

.site-footer p { margin: 0; text-wrap: balance; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.site-footer a:hover { color: #fff; }

/* =========================================================== landing page */

.section { padding-block: var(--section-space); }

.section--tint { --link: var(--brand-strong); background: var(--tint); }

.section--wash { --link: var(--brand-strong); background: var(--wash); }

.section-title { margin-bottom: var(--space-6); }

.section-title::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 4px;
  margin-bottom: var(--space-4);
  background: linear-gradient(90deg, var(--brand), var(--brand-sky-light));
  border-radius: 2px;
}

.eyebrow {
  margin-bottom: var(--space-3);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

.lead { font-size: var(--fs-lead); line-height: 1.55; }

/* hero */

.hero {
  --link: var(--brand-strong);
  padding-block: clamp(3rem, 1.5rem + 5vw, 5.5rem);
  background:
    radial-gradient(40rem 26rem at 85% 35%, rgb(90 181 238 / 0.2), rgb(90 181 238 / 0) 70%),
    linear-gradient(180deg, #f5fafd, var(--bg) 90%);
  border-bottom: 1px solid var(--border);
}

.hero__inner {
  display: grid;
  align-items: center;
  gap: var(--space-7);
}

.hero h1 {
  margin-bottom: var(--space-5);
  font-size: var(--fs-hero);
  line-height: 1.12;
}

.hero .lead { max-width: 36rem; margin-bottom: var(--space-6); }

.hero .actions { margin-bottom: 0; }

.hero__mark { display: none; }

@media (min-width: 48em) {
  .hero__inner { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }

  .hero__mark {
    display: block;
    justify-self: end;
    width: min(100%, 25rem);
  }
}

/* services */

.cards {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40em) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.cards > .card {
  margin: 0;
  padding-top: calc(var(--space-5) + 4px);
  background:
    linear-gradient(90deg, var(--brand), var(--brand-sky-light)) top / 100% 4px no-repeat,
    var(--surface);
}

.cards h3 { margin-bottom: var(--space-3); text-wrap: pretty; }

/* why Myscotek */

.proof-points {
  display: grid;
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48em) {
  .proof-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.proof-points li {
  padding: var(--space-5);
  font-size: 1.0625rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.proof-points h3 { margin-bottom: var(--space-2); }

.proof-points p { margin: 0; }

.proof-points li::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--space-4);
  background: var(--wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23005a92' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 1.375rem no-repeat;
  border-radius: 50%;
}

/* contact */

.contact {
  display: grid;
  gap: var(--space-5) var(--space-7);
  align-items: start;
}

@media (min-width: 48em) {
  .contact { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

.contact__intro > :last-child { margin-bottom: 0; }

.contact__details { margin: 0; }

.contact-list {
  display: grid;
  gap: var(--space-3);
}

.contact-list > div {
  display: grid;
  gap: 0 var(--space-5);
}

@media (min-width: 40em) {
  .contact-list > div { grid-template-columns: 6.5rem minmax(0, 1fr); }
}

.contact-list dt { font-weight: 600; color: var(--ink); }

.contact-list dd { margin: 0; overflow-wrap: anywhere; }

.contact__company {
  padding-top: var(--space-4);
  font-size: var(--fs-small);
  color: var(--muted);
  text-wrap: balance;
  border-top: 1px solid var(--border);
}

/* utilities and products showcase (between Services and Why Myscotek; a rule parts it from Services, whose background
   it shares): heading, intro, up to three catalogue cards (.product-grid), then the button to the catalogue */

.section--ruled { border-top: 1px solid var(--border); }

.section--compact { padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem); }

.showcase .section-title { margin-bottom: var(--space-4); }

.showcase__intro { max-width: 40rem; margin-bottom: var(--space-6); }

.showcase .actions { margin: var(--space-6) 0 0; }

/* =============================================================== placeholders */

/* Copy still to be supplied: the "TODO:" text stays visible, boxed in a dashed outline. */
.todo {
  padding: 0.1em 0.45em;
  color: var(--todo-text);
  background: var(--todo-bg);
  border: 1px dashed var(--todo-border);
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

p.todo,
figure.todo {
  width: fit-content;
  max-width: 100%;
  padding: var(--space-2) var(--space-3);
}

/* ============================================================= components */

/* page furniture */

.page > h1 { margin-bottom: var(--space-5); }

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

.empty {
  padding: var(--space-5);
  color: var(--muted);
  text-align: center;
  background: var(--tint);
  border-radius: var(--radius);
}

.prose { max-width: var(--measure); }

.prose h2 {
  margin-top: var(--space-7);
  font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
}

.prose li + li { margin-top: var(--space-3); }

.message { max-width: 42rem; }

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

.message .card { margin-top: var(--space-7); }

/* buttons: .btn (secondary), .btn--primary, .btn--danger, .btn--large */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--brand-strong);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  color: var(--brand-strong);
  text-decoration: none;
  background: var(--wash);
}

.btn--primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.btn--primary:hover {
  color: #fff;
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.btn--danger {
  color: var(--danger);
  border-color: var(--danger);
}

.btn--danger:hover {
  color: var(--danger);
  background: var(--danger-tint);
}

.btn--large {
  min-height: 3rem;
  padding: var(--space-3) var(--space-5);
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

p.actions { margin-block: var(--space-5); }

.actions form { display: flex; margin: 0; }

/* cards */

.card {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 40em) {
  .card { padding: var(--space-5); }
}

.page .card { margin-bottom: var(--space-5); }

.card > :last-child { margin-bottom: 0; }

.card > h2 { font-size: 1.25rem; }

/* alerts (after .card so a "card alert" panel takes the alert colours) */

.alert {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  color: var(--ink);
  background: var(--info-tint);
  border: 1px solid var(--info-border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
}

.alert > :last-child { margin-bottom: 0; }

.alert > h2 { font-size: 1.25rem; }

.alert a { color: inherit; font-weight: 600; }

.alert--success {
  background: var(--success-tint);
  border-color: var(--success-border);
  border-left-color: var(--success);
}

.alert--error {
  background: var(--danger-tint);
  border-color: var(--danger-border);
  border-left-color: var(--danger);
}

/* badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.1rem 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 0.1em;
  border: 1px solid;
  border-radius: var(--radius-pill);
}

.badge::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  background: currentColor;
  border-radius: 50%;
}

.badge--public     { color: var(--info); background: var(--info-tint); border-color: var(--info-border); }
.badge--restricted { color: var(--neutral-strong); background: var(--neutral-tint); border-color: var(--neutral-border); }
.badge--live       { color: var(--success); background: var(--success-tint); border-color: var(--success-border); }
.badge--expired    { color: var(--warning); background: var(--warning-tint); border-color: var(--warning-border); }
.badge--revoked    { color: var(--danger); background: var(--danger-tint); border-color: var(--danger-border); }
.badge--deleted,
.badge--unknown    { color: var(--neutral); background: var(--neutral-tint); border-color: var(--neutral-border); }

/* products: kind, price, availability, catalogue status, latest release (white on --brand: 5.11:1) */
.badge--utility    { color: var(--info); background: var(--info-tint); border-color: var(--info-border); }
.badge--product    { color: var(--neutral-strong); background: var(--neutral-tint); border-color: var(--neutral-border); }
.badge--free       { color: var(--success); background: var(--success-tint); border-color: var(--success-border); }
.badge--paid       { color: var(--warning); background: var(--warning-tint); border-color: var(--warning-border); }
.badge--available  { color: var(--success); background: var(--success-tint); border-color: var(--success-border); }
.badge--coming-soon { color: var(--soon); background: var(--soon-tint); border-color: var(--soon-border); }
.badge--published  { color: var(--success); background: var(--success-tint); border-color: var(--success-border); }
.badge--draft      { color: var(--neutral); background: var(--neutral-tint); border-color: var(--neutral-border); }
.badge--latest     { color: #fff; background: var(--brand); border-color: var(--brand); }

/* tables */

.table-wrap {
  margin: 0 0 var(--space-5);
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card > .table-wrap:last-child { margin-bottom: 0; }

.table {
  width: 100%;
  margin: 0;
  font-size: var(--fs-small);
  border-collapse: collapse;
}

.table form { margin: 0; }

/* Cells keep names, dates and addresses on one line (a narrow screen scrolls the table inside .table-wrap
   instead); only .wrap cells, muted notes and codes wrap, and .text cells (descriptions, user agents) keep
   a readable width. */
.table th,
.table td {
  padding: var(--space-3) 0.625rem;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table th:first-child,
.table td:first-child { padding-left: var(--space-4); }

.table th:last-child,
.table td:last-child { padding-right: var(--space-4); }

.table .wrap,
.table .muted,
.table code { white-space: normal; }

.table .wrap { min-width: 7.5rem; }

.table .text { min-width: 12rem; }

.table thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-transform: uppercase;
  background: var(--tint);
}

.table tbody tr:last-child > * { border-bottom: 0; }

.table .muted { font-size: 0.8125rem; }

.table .btn {
  min-height: 2.25rem;
  padding: var(--space-1) 0.625rem;
  font-size: 0.8125rem;
}

/* row actions: two buttons a row at most, so a long table keeps its Actions column on screen */
.table .actions {
  gap: 0.375rem;
  min-width: 9.75rem;
  max-width: 12rem;
}

/* definition lists */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: var(--space-4);
  margin: 0;
}

.stats > div {
  padding: var(--space-3) var(--space-4);
  background: var(--tint);
  border-radius: var(--radius-sm);
}

.stats dt { font-size: var(--fs-small); color: var(--muted); }

.stats dd {
  margin: var(--space-1) 0 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--ink);
}

.meta { display: grid; gap: 0 var(--space-5); margin: 0; }

.meta dt { font-weight: 600; color: var(--ink); }

.meta dd { margin: 0 0 var(--space-3); overflow-wrap: anywhere; }

@media (min-width: 40em) {
  .meta { grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr); }
  .meta dt, .meta dd { padding-block: var(--space-2); border-bottom: 1px solid var(--border); }
  .meta dd { margin: 0; }
  .meta dt:last-of-type, .meta dd:last-of-type { border-bottom: 0; }
}

/* admin sub-navigation */

.admin-nav {
  margin: 0 0 var(--space-6);
  border-bottom: 1px solid var(--border);
}

.admin-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-bottom: -1px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.admin-nav a:hover {
  color: var(--brand-strong);
  border-bottom-color: var(--border-strong);
}

.admin-nav a[aria-current="page"] {
  color: var(--brand-strong);
  border-bottom-color: var(--brand);
}

/* forms */

form { margin: 0 0 var(--space-5); }

.page > form:not(.search) {
  max-width: 44rem;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 40em) {
  .page > form:not(.search) { padding: var(--space-5); }
}

.field {
  max-width: 40rem;
  margin: 0 0 var(--space-5);
}

fieldset.field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.field > label,
.field > legend,
.search > label,
.share-link > label {
  display: block;
  margin-bottom: var(--space-2);
  padding: 0;
  font-weight: 600;
  color: var(--ink);
}

.field__hint {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-small);
  color: var(--muted);
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="date"],
input[type="url"],
input[type="number"],
textarea,
select {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

textarea { min-height: 5.5rem; line-height: 1.5; resize: vertical; }

input[readonly] { background: var(--tint); }

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline-offset: 0;
  border-color: var(--brand);
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: var(--space-2);
  font: inherit;
  font-size: var(--fs-small);
  color: var(--text);
  background: var(--tint);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

input[type="file"]::file-selector-button {
  margin-right: var(--space-3);
  padding: var(--space-2) var(--space-4);
  font: inherit;
  font-weight: 600;
  color: var(--brand-strong);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
}

input[type="file"]::file-selector-button:hover { background: var(--wash); }

fieldset.field > label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

fieldset.field > label:has(input:checked) {
  background: var(--wash);
  border-color: var(--brand);
}

input[type="radio"],
input[type="checkbox"] {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.2em 0 0;
  accent-color: var(--brand);
}

/* search */

.search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  max-width: 44rem;
  margin-bottom: var(--space-2);
}

.search > label { flex-basis: 100%; margin-bottom: 0; }

.search input[type="search"] { flex: 1 1 14rem; width: auto; }

.search + .field__hint { margin-bottom: var(--space-5); }

/* share link: label, read-only link, copy button */

.share-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-4);
}

.share-link > label { flex-basis: 100%; margin-bottom: 0; }

.share-link input {
  flex: 1 1 18rem;
  width: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
}

/* validation (ASP.NET Core tag helper classes) */

.field .input-validation-error { border-color: var(--danger); }

.field-validation-error {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--danger);
}

.field-validation-valid,
.validation-summary-valid { display: none; }

.validation-summary-errors ul { margin: var(--space-2) 0 0; padding-left: 1.25rem; }

.validation-summary-errors li + li { margin-top: var(--space-1); }

/* ============================================================== products */

/* catalogue (/products) */

.catalogue-lead { max-width: var(--measure); margin-bottom: var(--space-6); }

.product-grid {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48em) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.page .product-grid > .card { margin: 0; }

/* The whole card opens the product: the title link's ::after covers it. */
.product-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding-top: calc(var(--space-4) + 4px);
  background:
    linear-gradient(90deg, var(--brand), var(--brand-sky-light)) top / 100% 4px no-repeat,
    var(--surface);
  transition: border-color 0.15s ease;
}

@media (min-width: 40em) {
  .product-card { padding-top: calc(var(--space-5) + 4px); }
}

.product-card:hover { border-color: var(--brand); }

.product-card__body { flex: 1; min-width: 0; }

.product-card__body > :last-child { margin-bottom: 0; }

.product-card__title {
  margin-bottom: var(--space-2);
  font-size: var(--fs-h3);
}

.product-card__title a {
  color: var(--brand-strong);
  text-decoration: none;
}

.product-card__title a:hover { text-decoration: underline; }

.product-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.product-card__badges,
.product-header__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.product-card__summary { overflow-wrap: break-word; }

.product-card__meta {
  font-size: var(--fs-small);
  color: var(--muted);
}

/* icons: 48 px in lists, 80 px on the product page; a neutral box when there is none */

.product-icon {
  flex: none;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.product-icon--list { width: 48px; height: 48px; }

.product-icon--detail { width: 80px; height: 80px; }

.product-icon--placeholder {
  display: block;
  background: var(--wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23005a92' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 7v10l8 4 8-4V7z'/%3E%3Cpath d='m4 7 8 4 8-4M12 11v10'/%3E%3C/svg%3E") center / 56% no-repeat;
  border: 1px solid var(--info-border);
}

/* product page (/products/{slug}) */

.breadcrumb {
  margin-bottom: var(--space-5);
  font-size: var(--fs-small);
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
}

.product-header {
  display: grid;
  gap: var(--space-4) var(--space-5);
  align-items: start;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 40em) {
  .product-header { grid-template-columns: auto minmax(0, 1fr); }
}

.product-header h1 { margin-bottom: var(--space-3); }

.product-header .lead { max-width: var(--measure); margin-bottom: var(--space-5); }

.product-header__text > :last-child { margin-bottom: 0; }

.product-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}

.product-download__meta {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Coming soon or paid: a line with the contact link where the download button would be. */
.product-contact {
  margin-bottom: var(--space-3);
  color: var(--ink);
}

.product-contact a { font-weight: 600; }

.product-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.product-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 600;
}

.product-section { margin-bottom: var(--space-7); }

.product-section:last-child { margin-bottom: 0; }

.product-section > h2 { font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem); }

.release-notes + .release-notes {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.release-notes > h3 { margin-bottom: var(--space-3); }

.release-notes > h3 .muted {
  margin-left: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 400;
}

/* releases tables (product page and admin): the latest release stands out; digests wrap anywhere */

.releases-table tr.is-latest > * { background: var(--wash); }

.releases-table .hash-cell {
  min-width: 13rem;
  max-width: 22rem;
  white-space: normal;
}

.releases-table .hash { font-size: 0.75rem; }

/* rendered Markdown (descriptions, requirements, instructions, release notes) inside .prose */

.prose h3 { margin-top: var(--space-6); font-size: var(--fs-h3); }

.prose h4,
.prose h5,
.prose h6 {
  margin-top: var(--space-5);
  font-size: 1rem;
}

.prose pre {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  font-size: var(--fs-small);
  line-height: 1.5;
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.prose pre code {
  padding: 0;
  font-size: inherit;
  white-space: pre;
  overflow-wrap: normal;
  background: none;
  border: 0;
  border-radius: 0;
}

.prose blockquote {
  margin: 0 0 var(--space-4);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  color: var(--muted);
  border-left: 4px solid var(--border);
}

.prose blockquote > :last-child { margin-bottom: 0; }

.prose table {
  width: 100%;
  font-size: var(--fs-small);
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
}

/* Header words stay whole: with "anywhere", a column of short cells (L0, L1...) shrank its header to "Le / vel". */
.prose th { overflow-wrap: break-word; }

.prose thead th {
  font-weight: 600;
  color: var(--ink);
  background: var(--tint);
}

.prose li > p { margin-bottom: var(--space-2); }

.prose hr {
  margin: var(--space-6) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose img { border-radius: var(--radius-sm); }

.product-section .prose > :first-child,
.release-notes .prose > :first-child { margin-top: 0; }

.product-section .prose > :last-child,
.release-notes .prose > :last-child { margin-bottom: 0; }

/* product admin form */

textarea.markdown {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
}

.field input[type="number"] { max-width: 12rem; }

.field input.input-short { max-width: 8rem; }

.field > label.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.field > label.check + .field__hint { margin-top: var(--space-1); }

.field > .field__hint + label.check { margin-top: var(--space-3); }

fieldset.field-group {
  padding: var(--space-3) var(--space-4) 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

fieldset.field-group > legend { padding: 0 var(--space-2); }

fieldset.field-group > .field__hint { margin: 0 0 var(--space-4); }

fieldset.field > label:has(input:disabled) {
  color: var(--muted);
  cursor: not-allowed;
  background: var(--tint);
}

.icon-preview { margin: 0 0 var(--space-3); }

/* ================================================================ motion */

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

/* ================================================================= print */

@media print {
  .skip-link, .site-nav, .site-footer__links, .hero__mark { display: none; }
  .site-header, .site-footer, .hero, .section--tint, .section--wash { background: none; color: #000; }
  a { color: #000; }
}
