/*
 * Dealertrack bridge admin panel — design system (light theme).
 *
 * Served by the panel itself from /admin/public/panel.css: no external fonts, CDNs or images (the only
 * images are inline SVG / data: URIs). Tokens first, then the app shell, then components, then the
 * page-specific parts (Jobs, Dashboard, Session, Contracts). Class names used by the server-side
 * renderers live in src/admin/html.ts and src/admin/ui.ts.
 */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Neutral scale */
  --n-0: #ffffff;
  --n-25: #fbfcfd;
  --n-50: #f6f8fa;
  --n-100: #eef1f5;
  --n-200: #e1e6ed;
  --n-300: #cdd5df;
  --n-400: #98a2b3;
  --n-500: #667085;
  --n-600: #475467;
  --n-700: #344054;
  --n-800: #1d2939;
  --n-900: #101828;

  /* Primary (blue) */
  --p-50: #eff5ff;
  --p-100: #dbe8fe;
  --p-200: #bcd4fd;
  --p-500: #3b7cf6;
  --p-600: #2563eb;
  --p-700: #1d4fd8;
  --p-800: #1e40af;

  /* Status */
  --ok-50: #ecfdf3;
  --ok-200: #abefc6;
  --ok-600: #079455;
  --ok-700: #067647;
  --warn-50: #fffaeb;
  --warn-200: #fedf89;
  --warn-600: #dc6803;
  --warn-700: #b54708;
  --bad-50: #fef3f2;
  --bad-200: #fecdca;
  --bad-600: #d92d20;
  --bad-700: #b42318;
  --info-50: #f0f9ff;
  --info-200: #b9e6fe;
  --info-600: #0086c9;
  --info-700: #026aa2;

  /* Surfaces, borders, text */
  --bg: var(--n-50);
  --surface: var(--n-0);
  --surface-muted: var(--n-25);
  --surface-sunken: var(--n-100);
  --border: var(--n-200);
  --border-strong: var(--n-300);
  --text: var(--n-900);
  --text-2: var(--n-600);
  --text-3: var(--n-500);
  --primary: var(--p-600);
  --primary-hover: var(--p-700);
  --primary-soft: var(--p-50);
  --on-primary: #ffffff;

  /* Spacing (4px scale) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Shape and depth */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.24), 0 8px 16px -6px rgba(16, 24, 40, 0.08);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.28);

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 400 var(--text-base) / 1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
h1,
h2,
h3,
h4 {
  line-height: 1.3;
}
p {
  margin: 0 0 var(--space-3);
}
p:last-child {
  margin-bottom: 0;
}
b,
strong {
  font-weight: 600;
}
code,
kbd,
pre,
.mono {
  font-family: var(--mono);
}
.mono {
  font-size: 12.5px;
}
code {
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--n-100);
  color: var(--n-800);
  overflow-wrap: anywhere;
}
.num,
.tabular {
  font-variant-numeric: tabular-nums;
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.sr-only,
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -60px;
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.skip-link:focus {
  top: var(--space-2);
}
.muted,
.note {
  color: var(--text-3);
}
.note {
  font-size: var(--text-sm);
}
.sub {
  color: var(--text-3);
  font-size: var(--text-xs);
  margin-top: 2px;
}
.err {
  color: var(--bad-700);
}
.nowrap {
  white-space: nowrap;
}

/* ── App shell ───────────────────────────────────────────────────────────── */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--topbar-h);
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, var(--p-600), var(--p-800));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}
.brand-text {
  min-width: 0;
  flex: 1;
}
.brand-name {
  display: block;
  font-weight: 650;
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-3);
  white-space: nowrap;
}
.nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
}
.nav-group + .nav-group {
  margin-top: var(--space-5);
}
.nav-heading {
  margin: 0 0 var(--space-2);
  padding: 0 var(--space-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
}
.nav-link:hover {
  background: var(--n-100);
  color: var(--text);
  text-decoration: none;
}
.nav-link[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--p-700);
  font-weight: 600;
}
.nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-3));
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--p-100);
  color: var(--p-800);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}
.user-meta {
  min-width: 0;
  flex: 1;
}
.user-name {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-3);
}
/* Menu / close buttons and the scrim exist only under the mobile breakpoint (higher specificity than .btn). */
.brand .sidebar-close,
.topbar .menu-btn,
.scrim {
  display: none;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--topbar-h);
  padding: var(--space-3) var(--space-8);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
}
@supports (backdrop-filter: blur(8px)) {
  .topbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(8px);
  }
}
.crumbs {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
}
.crumb-sep {
  color: var(--n-300);
}
.crumb-cur {
  color: var(--text);
  font-weight: 600;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  margin-bottom: var(--space-6);
}
.page-head-text {
  min-width: 0;
  flex: 1 1 320px;
}
.page-title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.page-sub {
  margin: 4px 0 0;
  max-width: 72ch;
  font-size: var(--text-base);
  color: var(--text-3);
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.status-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}
.spill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 2px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-3);
  font-size: var(--text-xs);
  white-space: nowrap;
}
a.spill:hover {
  border-color: var(--border-strong);
  background: var(--n-50);
  text-decoration: none;
}
.spill b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--n-400);
}
.dot.ok {
  background: var(--ok-600);
}
.dot.warn {
  background: var(--warn-600);
}
.dot.bad {
  background: var(--bad-600);
}
.dot.info {
  background: var(--info-600);
}
.dot.muted {
  background: var(--n-400);
}
.content {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-8) var(--space-12);
}
.content:focus {
  outline: none;
}

@media (max-width: 899px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(84vw, 280px);
    height: 100%;
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    visibility: hidden;
    /* Hidden only once the slide-out ends; visible at once on open, so focus can move into it. */
    transition: transform 0.2s var(--ease), visibility 0s linear 0.2s;
  }
  .sidebar.is-open,
  html:not(.js) .sidebar:target {
    transform: none;
    visibility: visible;
    transition: transform 0.2s var(--ease), visibility 0s;
  }
  .sidebar.is-open + .scrim,
  html:not(.js) .sidebar:target + .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(16, 24, 40, 0.42);
  }
  .brand .sidebar-close,
  .topbar .menu-btn {
    display: inline-flex;
  }
  .topbar {
    position: static;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
  }
  .status-pills {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .content {
    padding: var(--space-5) var(--space-4) var(--space-10);
  }
  .page-head {
    margin-bottom: var(--space-5);
  }
}
@media (max-width: 480px) {
  .spill {
    padding: 2px 10px;
  }
  .page-title {
    font-size: var(--text-lg);
  }
  .page-sub {
    font-size: var(--text-sm);
  }
}

/* ── Layout helpers ──────────────────────────────────────────────────────── */
.stack {
  display: grid;
  gap: var(--space-6);
  align-content: start;
  min-width: 0;
}
.stack-sm {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}
.cols-even {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
  align-items: stretch;
}
@media (max-width: 1100px) {
  .cols,
  .cols-even {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Side-by-side cards share a height; the body grows so a footer sits at the bottom. */
.cols-even > .card {
  display: flex;
  flex-direction: column;
}
.cols-even > .card > .card-body {
  flex: 1;
}
/* Grid children may shrink below their content (a wide table scrolls inside its card, never the page). */
.stack > *,
.stack-sm > *,
.cols > *,
.cols-even > * {
  min-width: 0;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.card-head-text {
  min-width: 0;
  flex: 1 1 240px;
}
.card-title {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--text-md);
  font-weight: 650;
}
.card-desc {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.card-body {
  padding: var(--space-5);
}
.card-body.flush {
  padding: 0;
}
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 0 0 var(--radius) var(--radius);
}
.card-section + .card-section {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.section-label {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── KPI tile ────────────────────────────────────────────────────────────── */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}
@media (max-width: 700px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }
  .kpi {
    padding: var(--space-3) var(--space-4);
  }
  .kpi-value {
    font-size: var(--text-xl);
    min-height: 30px;
  }
}
.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  color: inherit;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}
/* One rule: only a tile that needs attention gets a colored accent. */
.kpi[data-tone="warn"]::before {
  background: var(--warn-600);
}
.kpi[data-tone="bad"]::before {
  background: var(--bad-600);
}
a.kpi:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}
.kpi-label .icon {
  width: 16px;
  height: 16px;
}
.kpi-value {
  min-height: 34px;
  display: flex;
  align-items: center;
  font-size: var(--text-2xl);
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kpi-value .badge {
  height: 26px;
  font-size: var(--text-sm);
  padding: 0 10px;
}
.kpi-meta {
  min-height: 18px;
  font-size: var(--text-xs);
  color: var(--text-3);
  overflow-wrap: anywhere;
}

/* ── Badge / tag ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--n-50);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok {
  background: var(--ok-50);
  border-color: var(--ok-200);
  color: var(--ok-700);
}
.badge.warn {
  background: var(--warn-50);
  border-color: var(--warn-200);
  color: var(--warn-700);
}
.badge.bad {
  background: var(--bad-50);
  border-color: var(--bad-200);
  color: var(--bad-700);
}
.badge.info {
  background: var(--info-50);
  border-color: var(--info-200);
  color: var(--info-700);
}
.badge.muted {
  background: var(--n-100);
  border-color: var(--n-200);
  color: var(--n-600);
}
.pill,
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

/* ── Alert / banner ──────────────────────────────────────────────────────── */
.flash-stack {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
}
.alert > .icon {
  margin-top: 1px;
}
.alert-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.alert-title {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}
.alert ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.alert.success {
  background: var(--ok-50);
  border-color: var(--ok-200);
}
.alert.success > .icon,
.alert.success .alert-title {
  color: var(--ok-700);
}
.alert.info {
  background: var(--info-50);
  border-color: var(--info-200);
}
.alert.info > .icon,
.alert.info .alert-title {
  color: var(--info-700);
}
.alert.warn {
  background: var(--warn-50);
  border-color: var(--warn-200);
}
.alert.warn > .icon,
.alert.warn .alert-title {
  color: var(--warn-700);
}
.alert.error {
  background: var(--bad-50);
  border-color: var(--bad-200);
}
.alert.error > .icon,
.alert.error .alert-title {
  color: var(--bad-700);
}
.alert.neutral {
  background: var(--surface-muted);
}
.alert-close {
  flex: none;
  margin: -4px -6px -4px 0;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.alert-close:hover {
  background: rgba(16, 24, 40, 0.06);
  color: var(--text);
}
.alert-close[hidden] {
  display: none;
}
.alert-close .icon {
  width: 16px;
  height: 16px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: 600 var(--text-sm) / 1.2 var(--font);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn:hover {
  text-decoration: none;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn .icon {
  width: 16px;
  height: 16px;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--n-50);
  border-color: var(--n-400);
}
.btn-danger {
  background: var(--bad-600);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-danger:hover:not(:disabled) {
  background: var(--bad-700);
}
.btn-danger-soft {
  background: var(--surface);
  border-color: var(--bad-200);
  color: var(--bad-700);
}
.btn-danger-soft:hover:not(:disabled) {
  background: var(--bad-50);
  border-color: var(--bad-600);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--n-100);
  color: var(--text);
}
.btn-ghost-danger {
  background: transparent;
  color: var(--bad-700);
}
.btn-ghost-danger:hover:not(:disabled) {
  background: var(--bad-50);
  color: var(--bad-700);
}
.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: var(--text-xs);
}
.btn-icon {
  min-height: 36px;
  width: 36px;
  padding: 0;
}
.btn-icon.btn-sm {
  width: 30px;
}
.btn-block {
  width: 100%;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.btn-row.nowrap {
  flex-wrap: nowrap;
  justify-content: flex-end;
}
form.inline {
  display: inline;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4) var(--space-5);
}
.form-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.form-grid > .span-all {
  grid-column: 1 / -1;
}
@media (max-width: 1100px) {
  .form-grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .form-grid.cols-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > label,
.label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.field .opt {
  font-weight: 400;
  color: var(--text-3);
}
.help {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-3);
}
input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow-xs);
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
textarea {
  min-height: 240px;
  padding: 10px 12px;
  font: 12.5px / 1.55 var(--mono);
  resize: vertical;
}
textarea.code-editor {
  min-height: 300px;
  background: var(--n-25);
  color: var(--n-800);
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
textarea.code-editor:focus {
  background: var(--surface);
}
input::placeholder,
textarea::placeholder {
  color: var(--n-400);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--p-500);
  box-shadow: var(--ring);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
}
.check input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--primary);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* ── Switch (record-only setting) ────────────────────────────────────────── */
.setting {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.setting-text {
  flex: 1;
  min-width: 0;
}
.setting-title {
  font-weight: 600;
  margin: 1px 0 2px;
}
.setting-state {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--n-300);
  transition: background-color 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease);
}
.switch.on {
  background: var(--ok-600);
}
.switch.on::after {
  transform: translateX(18px);
}

/* ── Data table ──────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
}
table.data {
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}
table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data tbody tr:hover {
  background: var(--n-50);
}
table.data tbody tr:last-child td {
  border-bottom: 0;
}
th.num,
td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
td.act {
  text-align: right;
  white-space: nowrap;
}
.trunc-note {
  display: inline-block;
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--text-2);
}
.trunc {
  display: inline-block;
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-10) var(--space-6);
  text-align: center;
}
.empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--n-100);
  color: var(--text-3);
}
.empty-icon.ok {
  background: var(--ok-50);
  color: var(--ok-600);
}
.empty-title {
  font-size: var(--text-md);
  font-weight: 650;
}
.empty-text {
  max-width: 52ch;
  margin: 0;
  color: var(--text-3);
  font-size: var(--text-sm);
}
.empty.compact {
  padding: var(--space-6) var(--space-4);
}

/* ── Description list ────────────────────────────────────────────────────── */
dl.kv {
  display: grid;
  grid-template-columns: minmax(110px, max-content) minmax(0, 1fr);
  gap: 8px 20px;
  margin: 0;
  font-size: var(--text-sm);
}
dl.kv dt {
  color: var(--text-3);
}
dl.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  dl.kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  dl.kv dd {
    margin-bottom: 8px;
  }
}

/* ── Timeline ────────────────────────────────────────────────────────────── */
ol.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tl-item {
  position: relative;
  padding: 0 0 var(--space-4) 26px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-item:last-child {
  padding-bottom: 0;
}
.tl-item:last-child::before {
  display: none;
}
.tl-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--n-400);
  background: var(--surface);
}
.tl-dot.ok {
  border-color: var(--ok-600);
}
.tl-dot.warn {
  border-color: var(--warn-600);
}
.tl-dot.bad {
  border-color: var(--bad-600);
}
.tl-dot.info {
  border-color: var(--info-600);
}
.tl-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
}
.tl-title {
  font-weight: 600;
  font-size: var(--text-sm);
}
.tl-time {
  font-size: var(--text-xs);
  color: var(--text-3);
  white-space: nowrap;
}
.tl-detail {
  margin-top: 2px;
  font-size: var(--text-sm);
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* ── Dialog (confirmation) ───────────────────────────────────────────────── */
dialog {
  color: var(--text);
}
dialog.modal {
  width: min(500px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop {
  background: rgba(16, 24, 40, 0.48);
}
.modal-body {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-6);
}
.modal-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--info-50);
  color: var(--info-600);
}
.modal-icon.bad {
  background: var(--bad-50);
  color: var(--bad-600);
}
.modal-icon.warn {
  background: var(--warn-50);
  color: var(--warn-600);
}
.modal-icon .icon {
  width: 20px;
  height: 20px;
}
.modal-text {
  min-width: 0;
}
.modal-title {
  margin: 4px 0 8px;
  font-size: var(--text-md);
  font-weight: 650;
}
.modal-desc {
  font-size: var(--text-sm);
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.modal-desc p {
  margin: 0 0 var(--space-2);
}
.modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Drawer (side panel) ─────────────────────────────────────────────────── */
dialog.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(560px, 100vw);
  max-width: 100vw;
  height: 100%;
  max-height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
}
dialog.drawer[open],
html:not(.js) dialog.drawer:target {
  display: flex;
}
html:not(.js) dialog.drawer:target {
  z-index: 60;
  box-shadow: var(--shadow-lg), 0 0 0 100vmax rgba(16, 24, 40, 0.35);
}
dialog.drawer::backdrop {
  background: rgba(16, 24, 40, 0.35);
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.drawer-head-text {
  flex: 1;
  min-width: 0;
}
.eyebrow {
  margin: 0 0 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}
.drawer-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-2);
}
.drawer-body {
  flex: 1;
  display: grid;
  align-content: start;
  gap: var(--space-6);
  padding: var(--space-5) var(--space-6);
  overflow-y: auto;
}
.drawer-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

/* ── Disclosure / code block ─────────────────────────────────────────────── */
details.disclosure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
details.disclosure > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
details.disclosure > summary::-webkit-details-marker {
  display: none;
}
details.disclosure > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
details.disclosure[open] > summary::before {
  transform: rotate(45deg);
}
details.disclosure > summary .summary-meta {
  margin-left: auto;
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--text-3);
}
details.disclosure.inset {
  box-shadow: none;
}
details.disclosure.inset > summary {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}
pre,
pre.code {
  margin: 0;
  padding: var(--space-4);
  max-height: 520px;
  overflow: auto;
  background: var(--n-50);
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--n-800);
}

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--text-3);
  white-space: nowrap;
}
.live .dot {
  background: var(--ok-600);
  box-shadow: 0 0 0 3px var(--ok-50);
}
.live.paused .dot {
  background: var(--n-400);
  box-shadow: none;
}
ul.attention {
  list-style: none;
  margin: 0;
  padding: 0;
}
.att-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.att-item:last-child {
  border-bottom: 0;
}
.att-icon {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--info-50);
  color: var(--info-600);
}
.att-icon.bad {
  background: var(--bad-50);
  color: var(--bad-600);
}
.att-icon.warn {
  background: var(--warn-50);
  color: var(--warn-600);
}
.att-icon .icon {
  width: 16px;
  height: 16px;
}
.att-text {
  flex: 1;
  min-width: 0;
}
.att-title {
  font-weight: 600;
}
.att-detail {
  margin-top: 1px;
  font-size: var(--text-sm);
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.att-action {
  flex: none;
  align-self: center;
}
.readiness-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.readiness-row + .readiness-row {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.missing {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: var(--text-xs);
  color: var(--text-3);
}
.stale-hint[hidden] {
  display: none;
}

/* ── Session ─────────────────────────────────────────────────────────────── */
.state-hero {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.state-hero .badge {
  height: 28px;
  padding: 0 12px;
  font-size: var(--text-sm);
}
ol.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.step {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) 0 var(--space-3) 40px;
  border-bottom: 1px solid var(--border);
  counter-increment: step;
}
.step:last-child {
  border-bottom: 0;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--p-700);
  font-size: var(--text-xs);
  font-weight: 700;
}
.step-text {
  flex: 1 1 260px;
  min-width: 0;
}
.step-title {
  font-weight: 600;
}
.step-help {
  font-size: var(--text-sm);
  color: var(--text-3);
}
.danger-zone {
  border-color: var(--bad-200);
}
.danger-zone .card-head {
  border-bottom-color: var(--bad-200);
}
.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}
.action-row + .action-row {
  border-top: 1px solid var(--border);
}
.vnc-screen {
  width: 100%;
  height: 520px;
  background: #000;
  border-radius: var(--radius-sm);
}

/* ── Contracts ───────────────────────────────────────────────────────────── */
.trial-result {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}
.trial-result table.data {
  margin-top: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.anchor {
  scroll-margin-top: 80px;
}

/* ── Jobs ────────────────────────────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}
.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;
}
.chip.active {
  background: var(--primary-soft);
  border-color: var(--p-200);
  color: var(--p-700);
}
.chip .n {
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--n-100);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.chip.active .n {
  background: var(--p-100);
  color: var(--p-800);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.toolbar .field > label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
}
.toolbar .field.tb-search {
  flex: 1 1 220px;
}
.toolbar select {
  min-width: 120px;
}
.toolbar .field {
  flex: 0 1 auto;
}
.tb-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.jobs-wrap {
  max-height: none;
}
@media (min-width: 900px) {
  .jobs-wrap {
    max-height: max(360px, calc(100vh - 230px));
    overflow: auto;
  }
}
table.jobs th,
table.jobs td {
  padding-left: 10px;
  padding-right: 10px;
}
table.jobs .trunc {
  max-width: 9ch;
}
table.jobs td[data-label="Order"] > div {
  min-width: 104px;
}
table.jobs td[data-label="Result"] > div {
  min-width: 140px;
  max-width: 280px;
}
table.jobs td[data-label="Updated"] {
  white-space: nowrap;
}
.retry {
  margin-top: 6px;
}
.act-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
/* The actions column stays in view while a narrow table scrolls sideways inside its card. */
table.data th.act,
table.data td.act {
  position: sticky;
  right: 0;
  background: var(--surface);
  box-shadow: inset 1px 0 0 var(--border);
}
table.data th.act {
  z-index: 2;
  background: var(--surface-muted);
}
table.data tbody tr:hover td.act {
  background: var(--n-50);
}
table.jobs tbody tr:target {
  background: var(--p-50);
}
.job-link {
  color: var(--text);
}
.job-link:hover .trunc {
  color: var(--primary);
  text-decoration: underline;
}
.code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bad-700);
}
.msg {
  max-width: 420px;
  font-size: var(--text-xs);
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 0 0 var(--radius) var(--radius);
}
.pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pg {
  min-width: 32px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
a.pg:hover {
  border-color: var(--border-strong);
  background: var(--n-50);
  text-decoration: none;
}
.pg.cur {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.pg.disabled {
  color: var(--n-400);
  background: transparent;
}
.pg.gap {
  border-color: transparent;
  background: transparent;
}
@media (max-width: 760px) {
  .toolbar > .field {
    flex: 1 1 140px;
  }
  .toolbar select {
    min-width: 0;
  }
  .jobs-wrap {
    padding: var(--space-3);
  }
  table.jobs thead {
    display: none;
  }
  table.jobs,
  table.jobs tbody,
  table.jobs tr,
  table.jobs td {
    display: block;
    width: 100%;
  }
  table.jobs tr {
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }
  table.jobs tbody tr:last-child {
    margin-bottom: 0;
  }
  table.jobs td,
  table.jobs tbody tr:last-child td {
    display: flex;
    gap: 10px;
    padding: 5px 0;
    border: 0;
    text-align: left;
  }
  table.jobs td::before {
    content: attr(data-label);
    flex: 0 0 84px;
    padding-top: 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
  }
  table.jobs td > div {
    flex: 1;
    min-width: 0;
  }
  table.jobs td.act {
    position: static;
    justify-content: flex-end;
    gap: var(--space-2);
    padding-top: var(--space-2);
    background: transparent;
    box-shadow: none;
  }
  table.jobs tbody tr:hover td.act {
    background: transparent;
  }
  .act-stack {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  table.jobs td.act::before {
    display: none;
  }
  .msg {
    max-width: none;
  }
  .trunc,
  table.jobs .trunc {
    max-width: 24ch;
  }
  table.jobs td[data-label="Result"] > div {
    max-width: none;
  }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    scrollbar-width: none;
  }
  .chip {
    flex: none;
  }
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6) var(--space-4);
  background: radial-gradient(1100px 520px at 50% -12%, var(--p-100), transparent 62%), var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-6);
}
.auth-title {
  margin: 0 0 4px;
  font-size: var(--text-xl);
  font-weight: 650;
}
.auth-sub {
  margin: 0 0 var(--space-6);
  color: var(--text-3);
}
.auth-card .field + .field {
  margin-top: var(--space-4);
}
.auth-card .alert {
  margin-bottom: var(--space-4);
}
.auth-foot {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  text-align: center;
  color: var(--text-3);
}
@media (max-width: 480px) {
  .auth-card {
    padding: var(--space-6) var(--space-5);
  }
}

/* ── Motion ──────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  dialog.modal[open] {
    animation: dlg-in 0.16s var(--ease);
  }
  dialog.drawer[open] {
    animation: drawer-in 0.2s var(--ease);
  }
}
@keyframes dlg-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}
@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
