/* CloudFlix base theme — a minimal reset, a neutral palette, and the structural
   styles for the client shell, plus an admin-scoped design system (everything
   under `body.admin`) ported from the CloudFlix admin design system. Structure
   over polish for the client; child themes override via the file cascade.

   RTL-safe: logical properties only (margin-inline, inset-inline-*, border-inline-*,
   text-align: start/end). No physical left/right. */

:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --accent: #2563eb;
  --topbar-bg: #18181b;
  --topbar-text: #fafafa;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --ok: #16a34a;
  --ok-bg: #f0fdf4;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --info: #2563eb;
  --info-bg: #eff6ff;
}

/* Dark overrides for the shared/client palette. The admin surface keys its own
   --c-* tokens off `html.dark body.admin` below; these cover the client shell
   and the shared components (.flash, .badge, .account-notice) so the theme
   toggle finally carries across surfaces (the client was permanently light).
   Palette matches the admin dark family (slate-tinted). */
html.dark {
  --bg: #0b0f17;
  --surface: #11161f;
  --text: #e6e9f0;
  --muted: #9aa3b6;
  --border: #232a37;
  --accent: #7c9aff;
  --topbar-bg: #11161f;
  --topbar-text: #e6e9f0;
  --error: #f87171;
  --error-bg: #2a1518;
  --ok: #4ade80;
  --ok-bg: #10231a;
  --warn: #fbbf24;
  --warn-bg: #2a2310;
  --info: #7c9aff;
  --info-bg: #141d31;
}
html.dark body:not(.admin) {
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

/* ---------- Self-hosted Geist (served at /_assets/themes/base/base.css, so
   `fonts/…` resolves to /_assets/themes/base/fonts/…) ---------- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Geist-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/Geist-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/Geist-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Geist-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/GeistMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/GeistMono-Medium.woff2") format("woff2");
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Client site header */
.site {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 8px 20px;
  min-height: 56px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site .brand {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

/* Primary client nav: inline links with an active underline. */
.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
}
.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--bg);
}
.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: var(--bg);
}

/* Hamburger (client): hidden on wide screens; on small screens it replaces the
   inline nav, which becomes a dropdown panel under the header bar (toggled by
   mobile-nav.js via body.nav-open). Without JS the panel stays closed — the
   footer zone and in-page links remain as the fallback paths. */
body.client .nav-toggle {
  display: none;
  inline-size: 40px;
  block-size: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 720px) {
  body.client .site {
    position: sticky; /* anchor for the dropdown; matches studio/cinema headers */
    inset-block-start: 0;
    z-index: 20;
  }
  body.client .nav-toggle {
    display: inline-flex;
  }
  body.client .site-nav {
    display: none;
    position: absolute;
    inset-block-start: 100%;
    inset-inline: 0;
    z-index: 30;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 12px 14px;
    background: var(--surface);
    border-block-end: 1px solid var(--border);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.25);
  }
  body.client.nav-open .site-nav {
    display: flex;
  }
  body.client .site-nav a {
    min-height: 44px;
    padding-inline: 12px;
  }
}

/* Right-side actions cluster (purchase CTA + theme toggle + sign in/out). */
.site-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

/* The always-visible purchase CTA: never inside the collapsible nav. */
.site-cta {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.site-actions a.site-cta {
  min-height: 36px;
}
.site-cta:hover {
  text-decoration: none;
  opacity: 0.9;
}
@media (max-width: 420px) {
  /* Very narrow screens: keep it visible, just tighter. */
  .site-cta {
    padding: 0 10px;
    font-size: 12px;
  }
}
/* A POST-only action presented as a link (e.g. Sign out — logout is POST+CSRF). */
.logout-form {
  display: inline-flex;
}
button.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}
button.linklike:hover {
  text-decoration: underline;
}

body.client .theme-toggle {
  inline-size: 36px;
  block-size: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
body.client .theme-toggle:hover {
  color: var(--text);
  border-color: var(--muted);
}
/* The toggle shows sun in dark mode, moon in light (the icon you can switch TO). */
body.client .theme-toggle .icon-sun {
  display: none;
}
html.dark body.client .theme-toggle .icon-sun {
  display: inline;
}
html.dark body.client .theme-toggle .icon-moon {
  display: none;
}

/* Keyboard focus visibility for the client surface (was admin-only). */
body.client :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link (shared style exists for admin; ensure it works on client too). */
body.client .skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  z-index: 100;
}
body.client .skip-link:focus {
  inset-inline-start: 8px;
  inset-block-start: 8px;
}

/* Client centered content column */
.centered {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* Footer */
footer {
  padding: 24px 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Error / flash message */
.error {
  padding: 12px 16px;
  margin: 0 0 16px 0;
  border: 1px solid var(--error);
  border-radius: 6px;
  background-color: var(--error-bg);
  color: var(--error);
}

/* --- Shared component base rules (client may use these; admin overrides them
   in the scoped layer below) --- */

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--border);
  color: var(--text);
}
.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge-danger {
  background: var(--error-bg);
  color: var(--error);
}
.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

/* Flash banners */
.flash {
  padding: 12px 16px;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.flash-success {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}
.flash-error {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
}
.flash-info {
  border-color: var(--info);
  background: var(--info-bg);
  color: var(--info);
}
.flash-warning {
  border-color: var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
}

/* Account-status banner: reuses the .flash component (one alert system); the
   .account-notice class only customises its links. */
.account-notice a {
  color: inherit;
  font-weight: 600;
}

/* Dismissible notices: message + the dismiss/restore form side by side. */
.account-notice {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.account-notice .notice-action {
  margin: 0;
  flex-shrink: 0;
}
.account-notice .notice-action .linklike {
  color: inherit;
  opacity: 0.8;
}
.account-notice .notice-action .linklike:hover {
  opacity: 1;
}

/* /notices review page */
.notice-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.notice-dismissed {
  opacity: 0.7;
}

/* Client dashboard (authenticated "/" — service cards, amount due, quick links) */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.dash-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}
.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.dash-card-title {
  font-weight: 600;
}
.dash-card-row {
  margin: 4px 0;
}
.dash-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.dash-due-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dash-due-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--warn);
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.dash-due-amount {
  font-weight: 700;
  font-size: 18px;
}
.dash-due-meta {
  color: var(--muted);
  flex: 1;
}
.dash-due-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-due-actions form {
  margin: 0;
}
.dash-empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
}
.dash-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Order progress (post-checkout Order → Payment → Setup → Ready) */
.order-steps {
  list-style: none;
  margin: 24px 0;
  padding: 0;
  max-width: 560px;
}
.order-step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.order-step:last-child {
  border-bottom: none;
}
.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  line-height: 24px;
  text-align: center;
}
.step--done .step-num {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}
.step--current .step-num {
  border-color: var(--accent, var(--info));
  color: var(--accent, var(--info));
}
.step--error .step-num {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
}
.step--pending {
  opacity: 0.6;
}
.step-body {
  flex: 1;
}
.step-title {
  font-weight: 600;
}
.step-detail {
  margin: 4px 0 0;
}
.step-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
  flex-wrap: wrap;
}
.order-ready-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
/* Each ready service stacks its credentials on their own lines. */
.order-ready-item {
  display: grid;
  gap: 4px;
  justify-items: start;
}
.order-ready-actions {
  margin-top: 4px;
}
[data-order-spinner]::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-inline-start: 8px;
  border: 2px solid var(--border);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: order-spin 0.9s linear infinite;
  vertical-align: -1px;
}
@keyframes order-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-order-spinner]::after {
    animation: none;
  }
}

/* Service getting-started page */
.service-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.service-head h1 {
  margin: 0;
}
.service-credentials {
  margin: 16px 0 24px;
}
.service-credentials dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0 0 12px;
}
.service-credentials dt {
  color: var(--muted);
}
.service-credentials dd {
  margin: 0;
  /* Long server URLs / generated passwords must wrap, never overflow. */
  min-width: 0;
  overflow-wrap: anywhere;
}
.service-credentials code,
.service-steps code {
  overflow-wrap: anywhere;
  word-break: break-all;
}
/* The "(generated for you…)" note reads better on its own line. */
.credential-note {
  display: block;
  margin-top: 2px;
}
.service-steps {
  margin: 0 0 24px;
  padding-inline-start: 20px;
  display: grid;
  gap: 8px;
}
/* Narrow screens: stack each label above its value instead of two columns. */
@media (max-width: 560px) {
  .service-credentials dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .service-credentials dt {
    margin-top: 12px;
    font-size: 13px;
  }
  .service-credentials dt:first-of-type {
    margin-top: 0;
  }
}

/* Unread-notice count in the client nav */
.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--error);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  vertical-align: text-top;
}

/* Branded error page (404/403/500 — rendered by the root error handler) */
.error-page {
  text-align: center;
  padding: 48px 0;
}
.error-page-status {
  font-size: 64px;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
  line-height: 1;
}
.error-page h1 {
  margin: 12px 0 8px;
}
.error-page .button {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
}
.error-page .button:hover {
  text-decoration: none;
  opacity: 0.9;
}
.error-page-reqid {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}

/* Forms */
.field {
  margin: 0 0 14px;
}
.field-error {
  display: block;
  color: var(--error);
  font-size: 12px;
  margin-top: 4px;
}

/* Money input adornment */
.money-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.money-currency {
  color: var(--muted);
  font-size: 13px;
}

/* Pager */
.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}
.pager-status {
  color: var(--muted);
  font-size: 13px;
}

/* List search box */
.list-search {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}
.list-search input[type="text"] {
  flex: 1;
  max-width: 360px;
}

/* Recent activity feed */
.activity-feed {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.activity-feed li {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.activity-when {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 13px;
}

/* Sortable column headers */
.sort-th a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.sort-th a:hover {
  text-decoration: underline;
}

/* Public catalog cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 0 0 20px;
}
.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}
.catalog-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}
.catalog-card h2 a {
  color: var(--text);
}
.catalog-price {
  color: var(--muted);
}
.catalog-price strong {
  color: var(--text);
  font-size: 18px;
}

/* Client table scroll container — mirrors the admin .table-wrap scroll
   semantics but scoped to body.client; does NOT add admin border/shadow so
   client tables keep their plain background styling. */
body.client .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-inline-size: 100%;
}

/* ===========================================================================
   Client element styling — scoped to `body.client` so it can't reach admin.
   Restores the tables / form controls / buttons / labels that client pages
   render as bare <table>/<input>/<button>/<label> inside <main class="centered">.
   (These were the old global `main …` rules; re-added scoped + with logical
   properties.) Logical properties only — keep rtl-css.test green.
   =========================================================================== */

/* Tables */
body.client main table {
  inline-size: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  background: var(--surface);
}
body.client main th,
body.client main td {
  text-align: start;
  padding: 8px 12px;
  border-block-end: 1px solid var(--border);
  vertical-align: top;
}
body.client main th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* Form labels */
body.client main form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-block-end: 4px;
}

/* Form controls */
body.client
  main
  :is(
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    input[type="date"],
    input:not([type]),
    select,
    textarea
  ) {
  inline-size: 100%;
  max-inline-size: 420px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* Buttons */
body.client main button,
body.client main .button {
  font: inherit;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
body.client main a.button {
  display: inline-block;
  text-decoration: none;
}
body.client main a.button:hover {
  border-color: var(--accent);
}
body.client main button:hover {
  border-color: var(--accent);
}
body.client main button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
body.client main button.danger {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

/* ===========================================================================
   Admin design system — every rule scoped under `body.admin`
   (ported from the CloudFlix admin design system; light + dark themes,
   logical properties only). Dark mode keys off `html.dark body.admin`.
   =========================================================================== */

/* ---------- Tokens: Light ---------- */
body.admin {
  /* Neutral scale (slate-tinted) */
  --c-bg: #f7f8fa;
  --c-surface: #ffffff;
  --c-surface-2: #f1f3f7;
  --c-surface-3: #e7eaf0;
  --c-border: #e3e6ec;
  --c-border-strong: #cfd4dd;
  --c-text: #0b1220;
  --c-text-muted: #5b6472;
  --c-text-subtle: #808996;

  /* Brand */
  --c-primary: #4f46e5;
  --c-primary-hover: #4338ca;
  --c-primary-fg: #ffffff;
  --c-primary-soft: #eef0ff;
  --c-focus-ring: #6366f1;

  /* Status */
  --c-ok-bg: #e7f7ed;
  --c-ok-fg: #096b3a;
  --c-warn-bg: #fdf2d7;
  --c-warn-fg: #7a4d00;
  --c-danger: #d4341a;
  --c-danger-hover: #b62a13;
  --c-danger-bg: #fce8e4;
  --c-danger-fg: #8a1c0a;
  --c-muted-bg: #eef0f4;
  --c-muted-fg: #4a5160;
  --c-info-bg: #e3efff;
  --c-info-fg: #0b4a99;

  /* Sidebar */
  --c-sidebar-bg: #0b1220;
  --c-sidebar-fg: #c8cfdd;
  --c-sidebar-fg-muted: #7a8499;
  --c-sidebar-active-bg: #1a2335;
  --c-sidebar-active-fg: #ffffff;
  --c-sidebar-border: #1a2335;

  /* Type */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;

  --lh-tight: 1.2;
  --lh-base: 1.5;

  /* Space */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;

  /* Radius */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 14px;

  /* Shadow */
  --sh-sm: 0 1px 2px rgba(13, 18, 32, 0.06);
  --sh-md: 0 4px 12px rgba(13, 18, 32, 0.08);
  --sh-lg: 0 12px 32px rgba(13, 18, 32, 0.12);

  --sidebar-w: 248px;
  --topbar-h: 56px;
}

/* ---------- Tokens: Dark ---------- */
html.dark body.admin {
  --c-bg: #0b0f17;
  --c-surface: #11161f;
  --c-surface-2: #161c28;
  --c-surface-3: #1d2532;
  --c-border: #232b3a;
  --c-border-strong: #2f3a4d;
  --c-text: #e8ecf4;
  --c-text-muted: #9aa3b6;
  /* ≥4.5:1 on --c-bg/#0b0f17 (was #6b7488 ≈ 3.8:1, below WCAG AA). */
  --c-text-subtle: #7e89a3;

  --c-primary: #818cf8;
  --c-primary-hover: #a5b0ff;
  --c-primary-fg: #0b0f17;
  --c-primary-soft: #1e2440;
  --c-focus-ring: #a5b0ff;

  --c-ok-bg: #0f3d27;
  --c-ok-fg: #7ee0a8;
  --c-warn-bg: #3d2f0c;
  --c-warn-fg: #f4c875;
  --c-danger: #ff6a55;
  --c-danger-hover: #ff8674;
  --c-danger-bg: #3d1812;
  --c-danger-fg: #ffb3a6;
  --c-muted-bg: #1d2532;
  --c-muted-fg: #a4adc1;
  --c-info-bg: #102744;
  --c-info-fg: #8cb6ff;

  --c-sidebar-bg: #0a0d14;
  --c-sidebar-fg: #b6bdcd;
  --c-sidebar-fg-muted: #6b7488;
  --c-sidebar-active-bg: #1a2335;
  --c-sidebar-active-fg: #ffffff;
  --c-sidebar-border: #161c28;

  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --sh-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* ---------- Base / elements ---------- */
html.dark body.admin {
  color-scheme: dark;
}

body.admin {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.admin h1,
body.admin h2,
body.admin h3,
body.admin h4,
body.admin h5,
body.admin h6 {
  margin: 0;
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}
body.admin h1 {
  font-size: var(--fs-2xl);
}
body.admin h2 {
  font-size: var(--fs-xl);
}
body.admin h3 {
  font-size: var(--fs-lg);
}
body.admin h4 {
  font-size: var(--fs-md);
}
body.admin p {
  margin: 0;
}

body.admin a {
  color: var(--c-primary);
  text-decoration: none;
}
body.admin a:hover {
  text-decoration: underline;
}

body.admin code,
body.admin kbd,
body.admin .mono,
body.admin .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

body.admin hr {
  border: 0;
  border-block-start: 1px solid var(--c-border);
  margin-block: var(--sp-5);
}

body.admin ::selection {
  background: var(--c-primary-soft);
  color: var(--c-text);
}

/* Focus ring (visible keyboard focus) */
body.admin :focus {
  outline: none;
}
body.admin :focus-visible {
  outline: 2px solid var(--c-focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Skip link */
body.admin .skip-link {
  position: absolute;
  inset-block-start: -40px;
  inset-inline-start: var(--sp-3);
  background: var(--c-primary);
  color: var(--c-primary-fg);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  z-index: 100;
}
body.admin .skip-link:focus {
  inset-block-start: var(--sp-3);
}

/* ===========================================================================
   App shell
   =========================================================================== */
body.admin .app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-block-size: 100dvh;
}

/* Sidebar */
body.admin .sidebar {
  background: var(--c-sidebar-bg);
  color: var(--c-sidebar-fg);
  border-inline-end: 1px solid var(--c-sidebar-border);
  padding: var(--sp-5) var(--sp-3);
  position: sticky;
  inset-block-start: 0;
  block-size: 100dvh;
  overflow-y: auto;
}
body.admin .sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  margin-block-end: var(--sp-6);
  color: var(--c-sidebar-active-fg);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
}
body.admin .sidebar-brand-mark {
  inline-size: 28px;
  block-size: 28px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
}
body.admin .sidebar-section {
  margin-block-end: var(--sp-5);
}
body.admin .sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-sidebar-fg-muted);
  padding: 0 var(--sp-3);
  margin-block-end: var(--sp-2);
}
/* Collapsible sections (nav-collapse.js, progressive enhancement). The script
   adds .is-collapsible + role/aria to titles that own a nav list; without JS
   these rules are inert and every section stays open. */
body.admin .sidebar-section-title.is-collapsible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  cursor: pointer;
  user-select: none;
  border-radius: var(--r-md);
  padding-block: var(--sp-1);
}
body.admin .sidebar-section-title.is-collapsible:hover {
  color: var(--c-sidebar-fg);
}
body.admin .sidebar-section-title.is-collapsible:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
/* Caret: points down when open, right when collapsed. */
body.admin .sidebar-section-title.is-collapsible::after {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 120ms ease;
  opacity: 0.7;
  margin-inline-end: 2px;
}
body.admin .sidebar-section.is-collapsed .sidebar-section-title.is-collapsible::after {
  transform: rotate(-45deg);
}
body.admin .sidebar-section.is-collapsed .sidebar-nav {
  display: none;
}
body.admin .sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.admin .sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--c-sidebar-fg);
  font-size: var(--fs-sm);
  text-decoration: none;
}
body.admin .sidebar-nav a:hover {
  background: var(--c-sidebar-active-bg);
  color: var(--c-sidebar-active-fg);
  text-decoration: none;
}
body.admin .sidebar-nav a[aria-current="page"] {
  background: var(--c-sidebar-active-bg);
  color: var(--c-sidebar-active-fg);
  font-weight: 500;
  box-shadow: inset 2px 0 0 var(--c-primary);
}

/* Topbar */
body.admin .main {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
}
body.admin .topbar {
  block-size: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-inline: var(--sp-6);
  border-block-end: 1px solid var(--c-border);
  background: var(--c-surface);
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
}
body.admin .topbar-title {
  font-size: var(--fs-md);
  font-weight: 600;
}
body.admin .topbar-spacer {
  flex: 1;
}
body.admin .topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* Mobile nav drawer — the hamburger is a mobile-only control (revealed in the
   860px breakpoint). The backdrop ships with the [hidden] attribute and is
   toggled by mobile-nav.js (hidden=false on open); the :not(.nav-open) rule is
   belt-and-suspenders for the no-JS :target fallback path. */
body.admin .nav-toggle {
  display: none;
}
body.admin .nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  border: 0;
}
body.admin:not(.nav-open) .nav-backdrop {
  display: none;
}
body.admin .user-menu {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-surface);
  font-size: var(--fs-sm);
  color: var(--c-text);
  cursor: pointer;
}
body.admin .user-avatar {
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 11px;
}
body.admin .theme-toggle {
  inline-size: 32px;
  block-size: 32px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
body.admin .theme-toggle:hover {
  color: var(--c-text);
  border-color: var(--c-border-strong);
}

/* Flash region */
body.admin .flash-region {
  padding: var(--sp-3) var(--sp-6) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
body.admin .flash {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin: 0;
  background: var(--c-surface);
  color: var(--c-text);
}
body.admin .flash.flash-success {
  background: var(--c-ok-bg);
  color: var(--c-ok-fg);
  border-color: color-mix(in srgb, var(--c-ok-fg) 20%, transparent);
}
body.admin .flash.flash-error {
  background: var(--c-danger-bg);
  color: var(--c-danger-fg);
  border-color: color-mix(in srgb, var(--c-danger-fg) 20%, transparent);
}
body.admin .flash.flash-info {
  background: var(--c-info-bg);
  color: var(--c-info-fg);
  border-color: color-mix(in srgb, var(--c-info-fg) 20%, transparent);
}
body.admin .flash.flash-warning {
  background: var(--c-warn-bg);
  color: var(--c-warn-fg);
  border-color: color-mix(in srgb, var(--c-warn-fg) 20%, transparent);
}

/* Content */
body.admin .content {
  padding: var(--sp-6);
  flex: 1;
  max-inline-size: 1400px;
  inline-size: 100%;
}
body.admin .page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-block-end: var(--sp-6);
  flex-wrap: wrap;
}
body.admin .page-header h1 {
  font-size: var(--fs-2xl);
}
body.admin .page-header .sub {
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
  margin-block-start: var(--sp-1);
}
body.admin .page-header-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* Cards */
body.admin .card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
body.admin .card-header {
  padding: var(--sp-4) var(--sp-5);
  border-block-end: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
body.admin .card-title {
  font-size: var(--fs-md);
  font-weight: 600;
}
body.admin .card-body {
  padding: var(--sp-5);
}
body.admin .card-body--flush {
  padding: 0;
}

/* ===========================================================================
   Components
   =========================================================================== */

/* Buttons */
body.admin .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  block-size: 34px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
body.admin .btn:hover {
  text-decoration: none;
}
body.admin .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body.admin .btn--primary,
body.admin button.primary {
  background: var(--c-primary);
  color: var(--c-primary-fg);
  border-color: var(--c-primary);
}
body.admin .btn--primary:hover,
body.admin button.primary:hover {
  background: var(--c-primary-hover);
  border-color: var(--c-primary-hover);
}

body.admin .btn--secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border-strong);
}
body.admin .btn--secondary:hover {
  background: var(--c-surface-2);
}

body.admin .btn--danger,
body.admin button.danger {
  background: var(--c-danger);
  color: #fff;
  border-color: var(--c-danger);
}
body.admin .btn--danger:hover,
body.admin button.danger:hover {
  background: var(--c-danger-hover);
  border-color: var(--c-danger-hover);
}

body.admin .btn--ghost {
  background: transparent;
  color: var(--c-text-muted);
  border-color: transparent;
}
body.admin .btn--ghost:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}

body.admin .btn--sm {
  block-size: 28px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-xs);
}

/* Base styling for the macro buttons (submitButton/dangerButton emit
   `<button class="primary">` / `<button class="danger">`). */
body.admin button.primary,
body.admin button.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  block-size: 34px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

/* Fallback for BARE admin <button>s (many list-search "Search" submits and a
   few create/action forms emit a class-less <button type="submit">). The old
   global `main button` rule was removed, so without this they render unstyled.
   Style them like a secondary button. The `.theme-toggle`, `.btn*`, and
   `button.primary`/`button.danger` keep their own (more specific) styling. */
body.admin button:not([class]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  block-size: 34px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
body.admin button:not([class]):hover {
  background: var(--c-surface-2);
}

/* Badges */
body.admin .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  background: var(--c-muted-bg);
  color: var(--c-muted-fg);
}
body.admin .badge::before {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
body.admin .badge.badge-ok {
  background: var(--c-ok-bg);
  color: var(--c-ok-fg);
}
body.admin .badge.badge-warn {
  background: var(--c-warn-bg);
  color: var(--c-warn-fg);
}
body.admin .badge.badge-danger {
  background: var(--c-danger-bg);
  color: var(--c-danger-fg);
}

/* Forms */
body.admin .field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-block-end: var(--sp-4);
}
body.admin .field-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text);
}
body.admin .field-label .req {
  color: var(--c-danger);
  margin-inline-start: 2px;
}
body.admin .field-hint {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}
body.admin .field-error {
  font-size: var(--fs-xs);
  color: var(--c-danger-fg);
}
body.admin .field--invalid .input,
body.admin .field--invalid .select {
  border-color: var(--c-danger);
}

/* The _macros.njk field/selectField/pickerField macros emit plain <input> and
   <select> elements (no .input/.select class). Scope element selectors inside
   .field so they pick up the same design as .input/.select without touching
   the macros or their tests. */
body.admin .field input,
body.admin .field select {
  inline-size: 100%;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  padding: 0 var(--sp-3);
  block-size: 36px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
body.admin .field input::placeholder {
  color: var(--c-text-subtle);
}
body.admin .field input:hover,
body.admin .field select:hover {
  border-color: var(--c-text-subtle);
}
body.admin .field input:focus,
body.admin .field select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 20%, transparent);
  outline: none;
}
body.admin .field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-text-muted) 50%),
    linear-gradient(135deg, var(--c-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: var(--sp-7);
}

/* Checkboxes/radios inside a `.field` (e.g. the server + library pick lists) must
   NOT inherit the full-width 36px text-input sizing above — keep them native-sized.
   `.check` lays the box out inline with its label text. */
body.admin .field input[type="checkbox"],
body.admin .field input[type="radio"] {
  inline-size: auto;
  block-size: auto;
  padding: 0;
  border: none;
  accent-color: var(--c-primary);
}
body.admin .check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}
body.admin .check input {
  flex: none;
}

body.admin .input,
body.admin .select,
body.admin .textarea {
  inline-size: 100%;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  padding: 0 var(--sp-3);
  block-size: 36px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
body.admin .textarea {
  padding: var(--sp-3);
  block-size: auto;
  min-block-size: 96px;
  line-height: 1.5;
  resize: vertical;
}
body.admin .input::placeholder {
  color: var(--c-text-subtle);
}
body.admin .input:hover,
body.admin .select:hover,
body.admin .textarea:hover {
  border-color: var(--c-text-subtle);
}
body.admin .input:focus,
body.admin .select:focus,
body.admin .textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 20%, transparent);
  outline: none;
}
body.admin .select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-text-muted) 50%),
    linear-gradient(135deg, var(--c-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: var(--sp-7);
}

/* Fallback for BARE admin form controls OUTSIDE a `.field` (the .list-search
   box, plus inputs/selects/textareas wrapped directly in <label> on
   catalog/tax/i18n/users-new/provisioning/role pages). The old global
   `main input/select/textarea` rule was removed; without this they render
   unstyled. Mirror the `.input` design. Scoped to controls NOT inside a `.field`
   and NOT carrying the `.input/.select/.textarea` class, so the dedicated rules
   above keep ownership of those. */
body.admin
  main
  :is(
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    input[type="date"],
    input:not([type]),
    select,
    textarea
  ):not(.input):not(.select):not(.textarea):not(.field *) {
  inline-size: 100%;
  max-inline-size: 420px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  padding: 0 var(--sp-3);
  block-size: 36px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
body.admin main textarea:not(.textarea):not(.field *) {
  padding: var(--sp-3);
  block-size: auto;
  min-block-size: 96px;
  line-height: 1.5;
  resize: vertical;
}
body.admin
  main
  :is(input, select, textarea):not(.input):not(.select):not(.textarea):not(
    .field *
  ):focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 20%, transparent);
  outline: none;
}

/* Money input — the moneyField macro emits `.money-input` (an inline-flex
   wrapper) with a `.money-currency` suffix. */
body.admin .money-input {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  inline-size: 100%;
  max-inline-size: 280px;
}
body.admin .money-input .input {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}
body.admin .money-currency {
  display: inline-flex;
  align-items: center;
  padding-inline: var(--sp-3);
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  border: 1px solid var(--c-border-strong);
  border-inline-start: 0;
  background: var(--c-surface-2);
  border-start-end-radius: var(--r-md);
  border-end-end-radius: var(--r-md);
}

body.admin .form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}
body.admin .form-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.admin .form-actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-block-start: var(--sp-4);
  border-block-start: 1px solid var(--c-border);
  margin-block-start: var(--sp-4);
}

/* Search box (above tables) */
body.admin .list-search {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-block-end: var(--sp-4);
}
body.admin .list-search .input {
  max-inline-size: 320px;
}
/* The bare search input (q) must be allowed to shrink below its content so the
   row fits at 375px before wrapping. */
body.admin .list-search input {
  min-inline-size: 0;
}

/* Tables */
body.admin .table-wrap {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--sh-sm);
}
/* Broadened from `.table` to `table` so EVERY admin table is styled: the
   dataTable macro emits a bare <table> (inside .table-wrap), 8 list pages use a
   bare <table>, and detail pages use <table class="table">. The .table-wrap
   container styling above is a div and is unaffected. */
body.admin table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  text-align: start;
}
body.admin table thead th {
  text-align: start;
  font-weight: 500;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  background: var(--c-surface-2);
  padding: var(--sp-3) var(--sp-4);
  border-block-end: 1px solid var(--c-border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
body.admin table tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-block-end: 1px solid var(--c-border);
  vertical-align: middle;
  color: var(--c-text);
}
body.admin table tbody tr:last-child td {
  border-block-end: none;
}
body.admin table tbody tr:hover {
  background: var(--c-surface-2);
}
body.admin table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--c-surface-2) 50%, transparent);
}
body.admin table tbody tr:nth-child(even):hover {
  background: var(--c-surface-2);
}

body.admin table .col-actions {
  text-align: end;
  white-space: nowrap;
}
body.admin table .col-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

body.admin .table-empty {
  text-align: center !important;
  padding: var(--sp-8) var(--sp-4) !important;
  color: var(--c-text-muted);
}
body.admin .table-empty-title {
  font-weight: 600;
  color: var(--c-text);
  margin-block-end: var(--sp-1);
}

/* Sortable headers — the sortHeader macro emits `<th class="sort-th"><a>…▲/▼</a>`. */
body.admin .sort-th a {
  color: var(--c-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.admin .sort-th a:hover {
  color: var(--c-text);
  text-decoration: none;
}
body.admin .sort-th a[aria-sort="ascending"],
body.admin .sort-th a[aria-sort="descending"] {
  color: var(--c-text);
}
body.admin .sort-th .th-sort-indicator {
  font-size: 10px;
  line-height: 1;
}

/* Pagination — the pager macro emits `.pager` > `.pager-status` + Prev/Next anchors. */
body.admin .pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-block-start: var(--sp-4);
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}
body.admin .pager-status {
  color: var(--c-text-muted);
}
body.admin .pager a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-3);
  block-size: 28px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-decoration: none;
}
body.admin .pager a:hover {
  background: var(--c-surface-2);
  text-decoration: none;
}

/* Stat cards */
body.admin .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-block-end: var(--sp-6);
}
body.admin .stat-card {
  display: block;
  padding: var(--sp-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  box-shadow: var(--sh-sm);
}
body.admin .stat-card:hover {
  text-decoration: none;
  border-color: var(--c-border-strong);
  box-shadow: var(--sh-md);
}
body.admin .stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-block-end: var(--sp-3);
}
body.admin .stat-card-value {
  font-size: var(--fs-3xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
body.admin .stat-card-sub {
  margin-block-start: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-text-subtle);
}
body.admin .stat-icon {
  inline-size: 28px;
  block-size: 28px;
  border-radius: var(--r-md);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  display: grid;
  place-items: center;
  font-size: 14px;
}

/* Activity feed — the dashboard recent-activity list. */
body.admin .activity-feed {
  list-style: none;
  padding: 0;
  margin: 0;
}
body.admin .activity-feed li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-block-end: 1px solid var(--c-border);
  font-size: var(--fs-sm);
}
body.admin .activity-feed li:last-child {
  border-block-end: none;
}
body.admin .activity-dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--c-primary);
  flex: none;
}
body.admin .activity-dot--ok {
  background: #2bb673;
}
body.admin .activity-dot--warn {
  background: #d99a14;
}
body.admin .activity-dot--danger {
  background: var(--c-danger);
}
body.admin .activity-kind {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-text);
}
body.admin .activity-meta {
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
}
body.admin .activity-time,
body.admin .activity-when {
  margin-inline-start: auto;
  color: var(--c-text-subtle);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

/* Detail layout */
body.admin .detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-5);
}

body.admin .kv-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
}
body.admin .kv-list dt {
  color: var(--c-text-muted);
}
body.admin .kv-list dd {
  margin: 0;
  color: var(--c-text);
}

/* Section header inside cards */
body.admin .section-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  margin-block-end: var(--sp-3);
}

/* Permission editor (grouped checkboxes) */
body.admin .perm-group {
  padding: var(--sp-5);
  border-block-end: 1px solid var(--c-border);
}
/* The group is a real <fieldset>/<legend> now (AT groups the checkboxes);
   neutralize the browser's default fieldset chrome. */
body.admin fieldset.perm-group {
  border-inline: 0;
  border-block-start: 0;
  margin: 0;
  min-inline-size: 0;
}
body.admin .perm-group legend {
  padding: 0;
}
body.admin .perm-group legend h4 {
  margin: 0 0 var(--sp-2);
}
body.admin .perm-group:last-child {
  border-block-end: none;
}
body.admin .perm-group h4 {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  margin-block-end: var(--sp-3);
}
body.admin .perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-2) var(--sp-4);
}
body.admin .perm-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  cursor: pointer;
}
body.admin .perm-item:hover {
  background: var(--c-surface-2);
}
body.admin .perm-item input {
  margin-block-start: 3px;
  accent-color: var(--c-primary);
}
body.admin .perm-item-key {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-text);
}
body.admin .perm-item-desc {
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
  display: block;
}

/* Confirmation interstitial */
body.admin .confirm-page {
  min-block-size: calc(100dvh - var(--topbar-h));
  display: grid;
  place-items: center;
  padding: var(--sp-7) var(--sp-4);
}
body.admin .confirm-card {
  max-inline-size: 520px;
  inline-size: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-7);
  box-shadow: var(--sh-md);
  text-align: start;
}
body.admin .confirm-icon {
  inline-size: 44px;
  block-size: 44px;
  border-radius: 50%;
  background: var(--c-danger-bg);
  color: var(--c-danger-fg);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  margin-block-end: var(--sp-4);
}
body.admin .confirm-card h2 {
  margin-block-end: var(--sp-2);
}
body.admin .confirm-card p {
  color: var(--c-text-muted);
  margin-block-end: var(--sp-2);
  font-size: var(--fs-sm);
}
body.admin .confirm-summary {
  margin-block: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
body.admin .confirm-actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-block-start: var(--sp-5);
}

/* Catalog tree */
body.admin .catalog-product {
  margin-block-end: var(--sp-5);
}
body.admin .catalog-product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-start-start-radius: var(--r-lg);
  border-start-end-radius: var(--r-lg);
}
body.admin .catalog-product-head h3 {
  font-size: var(--fs-md);
}
body.admin .catalog-product .table-wrap {
  border-start-start-radius: 0;
  border-start-end-radius: 0;
  border-block-start: 0;
  box-shadow: none;
}

/* Icons */
body.admin .icon {
  inline-size: 1em;
  block-size: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Utility */
body.admin .muted {
  color: var(--c-text-muted);
}
body.admin .row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
body.admin .stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
body.admin .stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* ===========================================================================
   Mobile primitives — Task 6 of the mobile-readiness sweep
   =========================================================================== */

/* 1. 16px inputs — prevents iOS auto-zoom on focus; acceptable on desktop.
      Unconditional (no media query needed — 16px is fine everywhere).
      Note: body.admin uses .textarea class (not <textarea> element), and
      .field only wraps <input>/<select>; body.client uses :is() selector. */
body.admin .field input,
body.admin .field select,
body.admin .input,
body.admin .select,
body.admin .textarea,
body.admin .list-search .input,
body.client
  main
  :is(
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    input[type="date"],
    select,
    textarea
  ) {
  font-size: 16px;
}

/* Responsive */
@media (max-width: 960px) {
  body.admin .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body.admin .app {
    grid-template-columns: 1fr;
  }
  body.admin .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    inline-size: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: 50;
  }
  body.admin.nav-open .sidebar {
    transform: translateX(0);
  }
  /* No-JS fallback: the :target pseudo opens the drawer via the hamburger
     anchor (href="#admin-sidebar"). The backdrop is a following sibling of the
     sidebar inside .app, so the sibling combinator reveals it. */
  body.admin .sidebar:target {
    transform: translateX(0);
  }
  body.admin.nav-open {
    overflow: hidden;
  }
  body.admin .sidebar:target ~ .nav-backdrop,
  body.admin.nav-open .nav-backdrop {
    display: block;
  }
  body.admin .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 44px;
    min-inline-size: 44px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }
  body.admin .form-row,
  body.admin .form-row--3 {
    grid-template-columns: 1fr;
  }
  body.admin .kv-list {
    grid-template-columns: 1fr;
    gap: var(--sp-1);
  }
  body.admin .kv-list dt {
    margin-block-start: var(--sp-2);
  }
  /* The permission editor grid is minmax(280px,1fr); below ~320px viewport one
     280px column would overflow. Force a single column on phones so the items
     wrap freely. */
  body.admin .perm-grid {
    grid-template-columns: 1fr;
  }

  /* 2. Tap targets — 44px minimum touch area for key interactive elements. */
  body.admin .sidebar-nav a,
  body.admin .btn,
  body.admin .theme-toggle,
  body.admin .user-menu a,
  body.admin .table .col-actions a {
    min-block-size: 44px;
  }
  /* Inline links need flex to vertically center content in the 44px target. */
  body.admin .user-menu a,
  body.admin .table .col-actions a {
    display: inline-flex;
    align-items: center;
  }

  /* 3. Responsive topbar — keeps hamburger + title + theme-toggle + user-menu
        usable at 360px without overflow. */
  body.admin .topbar {
    gap: var(--sp-2);
    padding-inline: var(--sp-4);
  }
  body.admin .topbar-title {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Tighten user-menu pill gap so it doesn't crowd the topbar on small screens. */
  body.admin .user-menu {
    gap: var(--sp-2);
  }

  /* 4. Content padding — reduce desktop padding (--sp-6 = 24px) to mobile
        comfortable (--sp-4 = 16px) on small screens. */
  body.admin .content {
    padding: var(--sp-4);
  }

  /* 5. Client header — allow brand + nav zone + sign-in link to wrap on narrow
        screens rather than overflow the viewport. Gap is a plain pixel value
        (client surface does not define --sp-* tokens). */
  body.client .site {
    flex-wrap: wrap;
    gap: 8px;
    block-size: auto;
    padding-block: 10px;
  }

  /* 6. Client inputs — override the 420px max-inline-size at narrow widths so a
        padded .centered column (20px each side) never pushes an input off-screen.
        inline-size:100% already set globally; this removes the upper cap. */
  body.client
    main
    :is(
      input[type="text"],
      input[type="number"],
      input[type="email"],
      input[type="password"],
      input[type="url"],
      input[type="date"],
      select,
      textarea
    ) {
    max-inline-size: 100%;
  }
}

/* ====================================================================
   Product detail — "Console" layout (scoped to .pd on the product page)
   ==================================================================== */
body.admin .pd {
  --pd-r: 4px;
  --pd-header: #0e1422;
  --pd-header-fg: #e7ebf2;
  --pd-header-muted: #8b94a3;
  --pd-accent: #3b82f6;
  --pd-live: #19c37d;
  --pd-hair: var(--c-border);
}
html.dark body.admin .pd {
  --pd-accent: #6ea8ff;
  --pd-header: #0a0e16;
}

body.admin .pd-back {
  color: var(--pd-accent);
  font-size: var(--fs-sm);
  text-decoration: none;
}
body.admin .pd-back:hover {
  text-decoration: underline;
}

/* hero */
body.admin .pd-hero {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-block-start: var(--sp-3);
  padding: 11px 14px;
  border-radius: var(--pd-r);
  background: var(--pd-header);
  color: var(--pd-header-fg);
  border-inline-start: 3px solid var(--pd-accent);
}
body.admin .pd-hero .pd-name {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}
body.admin .pd-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--pd-live);
  font-family: var(--font-mono);
}
body.admin .pd-live .pd-dot {
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: var(--pd-live);
  box-shadow: 0 0 8px var(--pd-live);
}
body.admin .pd-live.is-off {
  color: var(--pd-header-muted);
}
body.admin .pd-live.is-off .pd-dot {
  background: var(--pd-header-muted);
  box-shadow: none;
}
body.admin .pd-price {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
}
body.admin .pd-key {
  margin-inline-start: auto;
  font-size: var(--fs-xs);
  color: var(--pd-header-muted);
  font-family: var(--font-mono);
}

/* segmented tabs */
body.admin .pd-tabs {
  display: inline-flex;
  gap: 2px;
  margin-block: var(--sp-3) var(--sp-3);
  padding: 2px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--pd-r);
}
body.admin .pd-tab {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-muted);
  padding: 5px 12px;
  border-radius: 3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.admin .pd-tab .icon {
  inline-size: 14px;
  block-size: 14px;
}
body.admin .pd-tab.is-active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* panels */
body.admin .pd-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--pd-r);
  overflow: hidden;
  margin-block-end: var(--sp-3);
}
body.admin .pd-phead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  border-block-end: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
body.admin .pd-phead .pd-t {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-subtle);
}

/* stat strip */
body.admin .pd-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
body.admin .pd-cell {
  padding: 8px 14px;
  border-inline-end: 1px solid var(--pd-hair);
  display: flex;
  align-items: baseline;
  gap: 7px;
}
body.admin .pd-cell:last-child {
  border-inline-end: none;
}
body.admin .pd-cell .pd-n {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: 600;
}
body.admin .pd-cell .pd-k {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* grouped rows */
body.admin .pd-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px 14px;
  border-block-start: 1px solid var(--pd-hair);
}
body.admin .pd-row:first-child {
  border-block-start: none;
}
body.admin .pd-row .icon {
  color: var(--pd-accent);
  flex: none;
}
body.admin .pd-row .pd-rt {
  font-weight: 600;
  font-size: var(--fs-sm);
}
body.admin .pd-row .pd-rs {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}
body.admin .pd-row .pd-manage {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pd-accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
body.admin .pd-row .pd-manage .icon {
  color: inherit;
  inline-size: 13px;
  block-size: 13px;
}

/* meta + tags + body */
body.admin .pd-body {
  padding: 11px 14px;
}
body.admin .pd-meta {
  display: flex;
  gap: var(--sp-5);
  margin-block-start: var(--sp-3);
  padding-block-start: var(--sp-3);
  border-block-start: 1px solid var(--pd-hair);
}
body.admin .pd-meta .pd-mk {
  font-size: var(--fs-xs);
  color: var(--c-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
body.admin .pd-meta .pd-mv {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
body.admin .pd-libtag {
  display: inline-block;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  font-size: var(--fs-xs);
  padding: 1px 7px;
  margin-inline-end: 4px;
  font-family: var(--font-mono);
}

/* tab panels: visible by default (no-JS); JS enables switching */
body.admin .pd.pd--js .pd-tabpanel {
  display: none;
}
body.admin .pd.pd--js .pd-tabpanel.is-active {
  display: block;
}

/* Responsive — keep the page within the viewport on narrow screens */
body.admin .pd {
  max-inline-size: 100%;
}
/* The segmented tab bar scrolls horizontally instead of forcing page overflow. */
body.admin .pd-tabs {
  max-inline-size: 100%;
  overflow-x: auto;
}
@media (max-width: 640px) {
  body.admin .pd-tabs {
    display: flex;
  }
  /* Grouped rows stack: the right-aligned actions/forms drop to their own line. */
  body.admin .pd-row {
    flex-wrap: wrap;
  }
  body.admin .pd-row .pd-manage {
    margin-inline-start: 0;
    inline-size: 100%;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  body.admin .pd-row .pd-manage .inline-form {
    flex-wrap: wrap;
    gap: 6px;
  }
  /* The inline price inputs (bare, not .field) share the row and shrink. */
  body.admin .pd-row .pd-manage input {
    flex: 1 1 90px;
    min-inline-size: 0;
  }
  body.admin .pd-meta {
    flex-wrap: wrap;
  }
}

/* Searchable currency multi-select (billing settings) */
body.admin .cur-select {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-2);
  background: var(--c-surface);
}
body.admin .cur-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-block-end: var(--sp-2);
}
body.admin .cur-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  padding: 2px 6px;
  font-family: var(--font-mono);
}
body.admin .cur-chip-x {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: var(--fs-sm);
  line-height: 1;
  padding: 0;
}
body.admin .cur-search {
  inline-size: 100%;
}
body.admin .cur-list {
  max-block-size: 220px;
  overflow-y: auto;
  margin-block-start: var(--sp-2);
  border-block-start: 1px solid var(--c-border);
}
body.admin .cur-opt {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px var(--sp-1);
  font-size: var(--fs-sm);
  cursor: pointer;
}
body.admin .cur-opt:hover {
  background: var(--c-surface-2);
}

/* Billing-cycle composer ("Every [N] [unit]") on the product add-term form */
body.admin [data-term-cycle] .cycle-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
body.admin [data-term-cycle] .cycle-prefix {
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
}
body.admin [data-term-cycle] .cycle-count {
  inline-size: 5rem;
  flex: none;
}
body.admin [data-term-cycle] .cycle-unit {
  inline-size: auto;
  min-inline-size: 11rem;
}

/* Translations editor (/admin/i18n): inline override row forms + filter chips */
body.admin .i18n-row-form {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
body.admin .i18n-row-form input[name="value"] {
  flex: 1;
  min-inline-size: 14rem;
}
body.admin .i18n-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
body.admin .i18n-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}
