/* MWipe console — design system.
   Dark operations surface: ink layers, fine cyan grid, glass panels, one
   electric→teal brand gradient. Glow is reserved for primary, active and
   focused elements. Type: Chakra Petch (display, headings, KPI numbers),
   Instrument Sans (body, UI), JetBrains Mono (serials, hashes, ids only).
   Scale 12/13/14/16/20/24/32/48/64 px, sentence case, no all-caps labels.
   Fonts are self-hosted (SIL OFL) under /app/fonts/. */

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/app/fonts/chakra-petch-500.woff2") format("woff2");
}

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/app/fonts/chakra-petch-600.woff2") format("woff2");
}

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/app/fonts/chakra-petch-700.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/app/fonts/instrument-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/app/fonts/instrument-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/app/fonts/instrument-sans-600.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/app/fonts/jetbrains-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/app/fonts/jetbrains-mono-500.woff2") format("woff2");
}

:root {
  /* Brand tokens — the single source for every surface (app, site, admin). */
  --ink-0: #0d1117;
  --ink-1: #0e1420;
  --ink-2: #131c28;
  --ink-3: #1a2533;
  --line: #223044;
  --line-strong: #2e4058;
  --electric: #1e8fff;
  --teal: #2ee6c9;
  --cyan: #3fd8f5;
  --white: #f3f8fc;
  --text: #dce6ef;
  --muted: #8ea3b5;
  --ok: #5be38c;
  --warn: #ffb648;
  --danger: #ff5c7a;

  --grad-brand: linear-gradient(110deg, var(--electric), var(--teal));
  --glow: 0 0 0 1px rgba(63, 216, 245, 0.35), 0 0 24px rgba(30, 143, 255, 0.25);
  --glass-bg: rgba(19, 28, 40, 0.72);
  --glass-blur: blur(10px);
  --grid-line: rgba(63, 216, 245, 0.04);
  --grid-size: 40px;

  --ok-soft: rgba(91, 227, 140, 0.12);
  --ok-line: rgba(91, 227, 140, 0.32);
  --warn-soft: rgba(255, 182, 72, 0.12);
  --warn-line: rgba(255, 182, 72, 0.32);
  --danger-soft: rgba(255, 92, 122, 0.12);
  --danger-line: rgba(255, 92, 122, 0.34);
  --electric-soft: rgba(30, 143, 255, 0.14);
  --electric-line: rgba(30, 143, 255, 0.38);

  /* Type */
  --font-display: "Chakra Petch", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fs-48: 48px;
  --fs-64: 64px;

  /* Radii: controls / cards / badges */
  --radius-control: 6px;
  --radius-card: 10px;
  --radius-pill: 999px;
  --radius-sm: 4px;
  --radius-md: var(--radius-control);
  --radius-lg: var(--radius-card);

  /* Semantic roles used by the component rules below. */
  --background: var(--ink-0);
  --foreground: var(--text);
  --card: var(--glass-bg);
  --card-foreground: var(--text);
  --popover: var(--ink-2);
  --popover-foreground: var(--text);
  --primary: var(--electric);
  --primary-hover: color-mix(in srgb, var(--electric) 82%, var(--white));
  --primary-foreground: var(--ink-0);
  --primary-soft: var(--electric-soft);
  --secondary: var(--ink-3);
  --secondary-foreground: var(--text);
  --muted-half: rgba(26, 37, 51, 0.55);
  --muted-foreground: var(--muted);
  --accent: var(--electric-soft);
  --accent-foreground: var(--cyan);
  --accent-line: var(--electric-line);
  --destructive: var(--danger);
  --destructive-foreground: var(--ink-0);
  --destructive-soft: var(--danger-soft);
  --success: var(--ok);
  --success-soft: var(--ok-soft);
  --warning: var(--warn);
  --warning-soft: var(--warn-soft);
  --border: var(--line);
  --input: var(--line-strong);
  --ring: var(--cyan);
  --ring-offset: var(--ink-0);
  --focus-ring: 0 0 0 2px var(--ring-offset), 0 0 0 4px var(--ring), 0 0 18px rgba(30, 143, 255, 0.35);

  --sidebar: var(--ink-1);
  --sidebar-foreground: var(--text);
  --sidebar-accent: var(--electric-soft);
  --sidebar-accent-foreground: var(--white);
  --sidebar-border: var(--line);

  /* One shadow, for floating layers only (dialog, toast). */
  --shadow-float: 0 24px 70px rgba(0, 0, 0, 0.45);

  --rail-w: 248px;
}

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

html {
  color-scheme: dark;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.dialog-open {
  overflow: hidden;
}

::selection {
  background: rgba(63, 216, 245, 0.3);
  color: var(--white);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
dt {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

/* Focus: 2px ring with a 2px white offset on every interactive element. */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.nowrap {
  white-space: nowrap;
}

.icon {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  transition: top 0.12s ease;
}

.skip-link:focus {
  top: 12px;
}

/* Scrollbars ------------------------------------------------------------ */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* Boot splash / generic root ------------------------------------------- */

.app-root {
  min-height: 100vh;
}

.boot-splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.splash-note {
  font-size: 13px;
  color: var(--muted-foreground);
}

.noscript {
  padding: 24px;
  color: var(--foreground);
  font-size: 14px;
}

/* Logo (components.js Logo) --------------------------------------------- */

.logo {
  display: block;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  user-select: none;
}

/* Glass: the card recipe over the background grid. */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.glow {
  box-shadow: var(--glow);
}

/* Platter (platter.js): scales down with its container, never up. */
.platter {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
}

/* Shell ---------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

/* Horizontal logo in the full rail, icon once the rail collapses (< 860 px). */
.rail-brand .logo-icon {
  display: none;
}

@media (max-width: 859px) {
  .rail-brand .logo-horizontal {
    display: none;
  }

  .rail-brand .logo-icon {
    display: block;
  }
}

.rail-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 16px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
}

.nav-group + .nav-group {
  margin-top: 12px;
}

.nav-group-label {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-foreground);
  transition: color 0.12s ease, background 0.12s ease;
}

.nav-item .nav-icon {
  display: inline-flex;
  color: var(--muted-foreground);
}

.nav-item .nav-icon .icon {
  width: 16px;
  height: 16px;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--foreground);
  background: var(--secondary);
}

.nav-item.is-active {
  color: var(--sidebar-accent-foreground);
  background: linear-gradient(90deg, rgba(30, 143, 255, 0.2), rgba(46, 230, 201, 0.04));
  box-shadow: inset 2px 0 0 var(--teal);
}

.nav-item.is-active .nav-icon {
  color: var(--sidebar-accent-foreground);
}

.nav-rule {
  display: none;
}

.rail-foot {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-foreground);
  flex: 0 0 6px;
}

.dot.is-ok {
  background: var(--success);
}

.dot.is-bad {
  background: var(--destructive);
}

.rail-facts {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted-foreground);
}

.main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 56px;
  padding: 0 24px;
  background: rgba(13, 17, 23, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
}

.crumb-root,
.crumb-link {
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  transition: color 0.12s ease;
}

.crumb-root:hover,
.crumb-link:hover {
  color: var(--foreground);
}

.crumb-sep {
  color: var(--border);
}

.crumb-current {
  color: var(--foreground);
  font-weight: 500;
}

.crumb-id {
  font-size: 13px;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.operator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.2;
}

.operator-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.operator-role {
  font-size: 12px;
  color: var(--muted-foreground);
}

.org-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.org-switch-label {
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.org-switch .select {
  min-width: 160px;
  max-width: 240px;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  text-align: left;
}

.user-menu-trigger:hover {
  background: var(--secondary);
}

.user-menu-trigger:focus-visible {
  box-shadow: var(--focus-ring);
}

.user-menu-trigger .operator {
  align-items: flex-start;
  text-align: left;
}

.user-menu-caret {
  display: inline-flex;
  color: var(--muted-foreground);
}

.user-menu-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 140;
  min-width: 180px;
  padding: 6px;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.user-menu-item:hover {
  background: var(--secondary);
}

.user-menu-signout {
  color: var(--destructive);
}

.view {
  flex: 1;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  min-width: 0;
}

.view:focus {
  outline: none;
}

/* Page furniture ------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-head-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.page-head-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
}

.page-head-icon .icon {
  width: 20px;
  height: 20px;
}

.page-head-text {
  min-width: 0;
}

/* Kicker / eyebrow: quiet muted text, no dash, no caps. */
.kicker {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-foreground);
}

.page-title {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.page-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.page-body {
  min-width: 0;
}

.page-footnote {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted-foreground);
  max-width: 860px;
}

.route-missing {
  padding: 40px 0;
}

.route-missing .state-body {
  margin: 10px 0 18px;
}

/* Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--grad-brand);
  border-color: transparent;
  color: var(--primary-foreground);
  font-weight: 600;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  background: var(--grad-brand);
  border-color: transparent;
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-secondary:hover {
  background: var(--line);
  border-color: var(--line);
}

.btn-outline {
  background: transparent;
  border-color: var(--input);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--accent);
  border-color: var(--input);
  color: var(--accent-foreground);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

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

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 82%, var(--white));
  border-color: color-mix(in srgb, var(--danger) 82%, var(--white));
}

.btn-danger.is-armed {
  background: color-mix(in srgb, var(--danger) 78%, #000);
  border-color: color-mix(in srgb, var(--danger) 78%, #000);
  color: var(--destructive-foreground);
}

.btn-link {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
  text-decoration: none;
  height: auto;
  padding: 0;
}

.btn-link:hover {
  color: var(--primary-hover);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-sm,
.btn-xs {
  height: 32px;
  padding: 0 12px;
  gap: 6px;
  font-size: 13px;
}

.btn-lg {
  height: 40px;
  padding: 0 24px;
}

.btn-icon {
  display: inline-flex;
}

.btn-icon .icon {
  width: 16px;
  height: 16px;
}

.btn-glyph {
  display: inline-flex;
  margin-left: 4px;
}

.btn.is-busy {
  opacity: 0.75;
}

/* Forms ---------------------------------------------------------------- */

.input,
.select {
  height: 36px;
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--ink-3);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.input::placeholder {
  color: var(--muted-foreground);
}

.input:focus,
.select:focus,
.input:focus-visible,
.select:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: var(--focus-ring);
}

.input:disabled,
.select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--secondary);
}

.input.mono,
.select.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* lucide chevron-down */
.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238ea3b5' 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 16px;
  cursor: pointer;
}

.input-seat {
  width: 64px;
  height: 32px;
  font-size: 13px;
  text-align: right;
}

.input[type="number"] {
  font-variant-numeric: tabular-nums;
}

input[type="search"]::-webkit-search-cancel-button {
  filter: invert(0.4);
}

.check {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
  flex: 0 0 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--foreground);
}

.field-hint {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.field.wide,
.wide {
  grid-column: 1 / -1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.form-grid > .field {
  align-self: start;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.form-actions-note {
  margin-right: auto;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* Alert (destructive) */
.form-error {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  background: var(--destructive-soft);
  color: var(--destructive);
  font-size: 14px;
  line-height: 1.5;
  border-radius: var(--radius-md);
}

.form-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 12px;
}

.form-context {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.form-context-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.form-context-value {
  font-size: 14px;
  color: var(--foreground);
}

.form-context-note {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted-foreground);
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.choice:hover {
  background: var(--muted-half);
}

.choice input {
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--accent);
}

.choice:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}

.choice input:focus-visible {
  outline: none;
}

.choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.choice-hint {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.45;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--foreground);
  grid-column: 1 / -1;
  cursor: pointer;
}

/* Filters -------------------------------------------------------------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 16px;
}

.filter-search {
  flex: 1;
  max-width: 400px;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-controls .select {
  width: auto;
  min-width: 160px;
}

.filter-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.filter-note {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* Panels / cards ------------------------------------------------------- */

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  margin-bottom: 24px;
  min-width: 0;
}

.panel-host {
  margin-bottom: 24px;
}

.panel-host .panel {
  margin-bottom: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--foreground);
  white-space: nowrap;
}

.panel-subtitle {
  font-size: 13px;
  color: var(--muted-foreground);
  min-width: 0;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.panel-note {
  font-size: 13px;
  color: var(--muted-foreground);
}

.live-idle {
  padding: 20px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.panel-body {
  padding: 20px;
}

.panel-body.flush {
  padding: 0;
}

.panel-loading {
  padding: 20px;
}

.panel-footnote {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

/* KPIs: one bordered band, shadcn dashboard-card layout (label + icon row,
   value, note). ------------------------------------------------------- */

.kpi-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  margin-bottom: 24px;
  overflow: hidden;
}

.kpi {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label icon"
    "value value"
    "note note";
  align-content: start;
  row-gap: 6px;
  column-gap: 8px;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.kpi:last-child {
  border-right: 0;
}

.kpi-band.is-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-icon {
  grid-area: icon;
  display: inline-flex;
  color: var(--muted-foreground);
}

.kpi-icon .icon {
  width: 16px;
  height: 16px;
}

.kpi-label {
  grid-area: label;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  min-width: 0;
}

.kpi-value {
  grid-area: value;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.kpi-note {
  grid-area: note;
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.kpi.is-run .kpi-value {
  color: var(--primary);
}

.kpi.is-bad .kpi-value {
  color: var(--destructive);
}

.kpi.is-warn .kpi-value {
  color: var(--warning);
}

.kpi-band.is-skeleton .kpi {
  min-height: 104px;
}

/* Tables --------------------------------------------------------------- */

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.4;
}

.table th {
  height: 40px;
  padding: 0 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--foreground);
}

.table th:first-child,
.table td:first-child {
  padding-left: 20px;
}

.table th:last-child,
.table td:last-child {
  padding-right: 20px;
}

.table td.mono,
.table td .mono {
  font-size: 12px;
}

.table td.tnum {
  color: var(--muted-foreground);
}

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

.table tbody tr {
  transition: background 0.12s ease;
}

.table tbody tr:hover {
  background: var(--muted-half);
}

.table .th-num,
.table td.th-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table .th-actions,
.table td.th-actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.table-compact {
  font-size: 13px;
}

.table-compact th {
  height: 36px;
  padding: 0 12px;
}

.table-compact td {
  height: 40px;
  padding: 6px 12px;
}

.row-link {
  color: var(--foreground);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color 0.12s ease;
}

.row-link:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.row-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.35;
}

.row-sub.mono {
  font-size: 12px;
  white-space: nowrap;
}

.col-serial {
  font-size: 12px;
  color: var(--foreground);
  white-space: nowrap;
}

.col-code {
  font-size: 12px;
  color: var(--foreground);
}

.col-model {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-media {
  font-size: 13px;
}

.col-location,
.col-scope {
  max-width: 320px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.col-action {
  color: var(--foreground) !important;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.td-progress {
  min-width: 150px;
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-cell .bar {
  flex: 1;
}

.progress-value {
  width: 44px;
  text-align: right;
  font-size: 12px;
  color: var(--muted-foreground);
}

.table-empty {
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted-foreground);
}

.hash-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-foreground);
  font-size: 12px;
}

/* Status badges (.st) + shadcn badges ---------------------------------- */

.st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.st-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.st-ok {
  background: var(--success-soft);
  border-color: var(--ok-line);
  color: var(--ok);
}

.st-run {
  background: var(--accent);
  border-color: var(--accent-line);
  color: var(--accent-foreground);
}

.st-bad {
  background: var(--destructive-soft);
  border-color: var(--danger-line);
  color: var(--destructive);
}

.st-warn {
  background: var(--warning-soft);
  border-color: var(--warn-line);
  color: var(--warn);
}

.st-idle {
  background: var(--secondary);
  border-color: var(--border);
  color: var(--muted-foreground);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-default {
  background: var(--primary);
  color: var(--primary-foreground);
}

.badge-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.badge-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.badge-success {
  background: var(--success-soft);
  border-color: var(--ok-line);
  color: var(--ok);
}

.badge-warning {
  background: var(--warning-soft);
  border-color: var(--warn-line);
  color: var(--warn);
}

/* Progress ------------------------------------------------------------- */

.bar {
  height: 8px;
  width: 100%;
  background: var(--secondary);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--grad-brand);
  border-radius: 999px;
  transition: width 0.3s linear;
}

.bar-fill.is-ok {
  background: var(--success);
}

.bar-fill.is-bad {
  background: var(--destructive);
}

.bar-fill.is-warn {
  background: var(--warning);
}

.bar-fill.is-idle {
  background: var(--line-strong);
}

.seat-track {
  height: 6px;
  width: 96px;
  margin: 6px 0 4px;
  background: var(--secondary);
  border-radius: 999px;
  overflow: hidden;
}

.seat-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.seat-fill.is-warn {
  background: var(--warning);
}

.seat-fill.is-bad {
  background: var(--destructive);
}

.seat-assign {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* States, skeletons, toasts ------------------------------------------- */

.state {
  padding: 48px 24px;
  text-align: center;
}

.state-mark {
  display: block;
  font-size: 20px;
  line-height: 1;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}

.state-error .state-mark {
  color: var(--destructive);
}

.state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.state-code {
  margin-top: 4px;
  font-size: 12px;
  color: var(--destructive);
}

.state-body {
  max-width: 520px;
  margin: 8px auto 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.state-action {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.state-action .btn-ghost {
  border-color: var(--input);
  background: var(--background);
}

.state-slot .state {
  border-top: 0;
}

.skeleton-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.sk {
  display: block;
  height: 12px;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  animation: zt-pulse 1.5s ease-in-out infinite;
}

.skeleton-row td {
  padding: 14px 16px;
}

@keyframes zt-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 360px;
  max-width: calc(100vw - 32px);
}

/* Toast: white, bordered, one shadow; the variant is a small status icon. */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 8px 14px 16px;
  background: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  animation: zt-toast-in 0.16s ease-out;
}

.toast.is-leaving {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.toast-rail {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--success);
}

.toast-rail::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 4px;
  height: 7px;
  border: solid var(--ink-0);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.toast-bad .toast-rail {
  background: var(--destructive);
}

.toast-warn .toast-rail {
  background: var(--warning);
}

.toast-bad .toast-rail::after,
.toast-warn .toast-rail::after {
  left: 7.25px;
  top: 3.5px;
  width: 1.5px;
  height: 5px;
  border: 0;
  background: var(--ink-0);
  transform: none;
  box-shadow: 0 6.5px 0 var(--ink-0);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-message {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--foreground);
}

.toast-detail {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-top: -2px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.toast-close:hover {
  color: var(--foreground);
  background: var(--secondary);
}

.toast-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--electric);
}

.toast-link:hover {
  color: var(--cyan);
}

@keyframes zt-toast-in {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Overview ------------------------------------------------------------- */

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.overview-grid > .panel {
  margin-bottom: 0;
}

.chart-wrap {
  padding: 2px 0 0;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 196;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.chart-area {
  fill: var(--primary-soft);
  stroke: none;
}

.chart-dot {
  fill: var(--primary);
}

/* SVG user units: the 720-wide chart renders at roughly 0.65x. */
.chart-axis {
  fill: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.chart-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-foreground);
}

.mix-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mix-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.mix-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.mix-count {
  font-size: 13px;
  color: var(--foreground);
}

.mix-track {
  height: 6px;
  margin-top: 6px;
  background: var(--secondary);
  border-radius: 999px;
  overflow: hidden;
}

.mix-fill {
  height: 100%;
  background: var(--muted-foreground);
}

.mix-fill.is-ember {
  background: var(--primary);
}

.mix-fill.is-moss {
  background: var(--success);
}

.mix-fill.is-sand {
  background: var(--cyan);
}

.mix-fill.is-muted {
  background: var(--line-strong);
}

/* Job detail ----------------------------------------------------------- */

.job-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.job-summary {
  min-width: 0;
}

.summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.summary-ident {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.summary-status .st {
  font-size: 13px;
}

.summary-standard {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--foreground);
}

.summary-standard-name {
  font-size: 13px;
  color: var(--muted-foreground);
}

.summary-operator {
  font-size: 13px;
  color: var(--muted-foreground);
}

.summary-bytes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
  flex: 0 0 auto;
}

.summary-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.summary-bytes-value {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

.summary-bytes-note {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted-foreground);
}

.summary-progress {
  margin: 18px 0 4px;
}

.summary-progress .bar {
  height: 8px;
}

.summary-progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0;
  min-width: 0;
}

.summary-value {
  font-size: 13px;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.summary-value.mono {
  font-size: 13px;
}

.summary-error {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  background: var(--destructive-soft);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--destructive);
}

.summary-error-tag {
  font-weight: 600;
}

.stream-state {
  font-size: 12px;
  color: var(--muted-foreground);
}

.stream-state.is-ok {
  color: var(--success);
}

.stream-state.is-warn {
  color: var(--warning);
}

.stream-state.is-bad {
  color: var(--destructive);
}

.follow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
}

.log-empty {
  font-family: var(--font-sans);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.log-lines {
  height: 330px;
  overflow: auto;
  padding: 10px 0;
  background: var(--ink-1);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
}

.log-line {
  display: flex;
  gap: 10px;
  padding: 1px 16px;
  line-height: 1.55;
}

.log-line:hover {
  background: var(--secondary);
}

.log-ts {
  flex: 0 0 60px;
  color: var(--muted-foreground);
}

.log-level {
  flex: 0 0 44px;
  font-size: 12px;
  color: var(--muted-foreground);
  padding-top: 1px;
}

.log-dev {
  flex: 0 0 auto;
  color: var(--muted-foreground);
  font-size: 12px;
}

.log-msg {
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.log-line.is-warn .log-level,
.log-line.is-warn .log-msg {
  color: var(--warning);
}

.log-line.is-error .log-level,
.log-line.is-error .log-msg {
  color: var(--destructive);
}

.log-line.is-ok .log-level {
  color: var(--success);
}

/* Certificates --------------------------------------------------------- */

.verify-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 16px 20px;
  background: var(--warning-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.verify-band.is-valid {
  background: var(--success-soft);
  border-color: var(--ok-line);
}

.verify-band.is-invalid {
  background: var(--destructive-soft);
  border-color: var(--danger-line);
}

.verify-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.verify-kicker {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.verify-verdict {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--warn);
}

.is-valid .verify-verdict {
  color: var(--ok);
}

.is-invalid .verify-verdict {
  color: var(--destructive);
}

.verify-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  max-width: 560px;
}

.verify-hash {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  max-width: 46%;
  text-align: right;
}

.verify-hash-value {
  font-size: 13px;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.verify-hash-note {
  font-size: 12px;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.cert-doc {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.cert-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.cert-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.cert-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}

.cert-doc-kind {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.cert-doc-id {
  font-size: 13px;
  color: var(--foreground);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 34px;
  margin: 16px 0 6px;
}

.cert-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.cert-meta-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.cert-meta-value {
  font-size: 14px;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.cert-meta-value.mono {
  font-size: 13px;
}

.cert-section {
  margin-top: 22px;
}

.cert-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.cert-empty {
  font-size: 13px;
  color: var(--muted-foreground);
  padding: 10px 0;
}

.cert-footnote {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.hash-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hash-line {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.hash-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  padding-top: 2px;
}

.hash-value {
  font-size: 13px;
  line-height: 1.55;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.cert-payload,
.review-config {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.cert-payload summary,
.review-config summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.cert-payload summary:hover,
.review-config summary:hover {
  color: var(--foreground);
}

.cert-payload-body,
.review-config-body {
  margin: 10px 0 0;
  padding: 14px;
  max-height: 380px;
  overflow: auto;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--foreground);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cert-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-foreground);
}

.cert-job-link {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  border-radius: var(--radius-sm);
}

.cert-job-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Licences ------------------------------------------------------------- */

.licence-key {
  font-size: 13px;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.col-edition {
  font-size: 13px;
}

.licence-summary {
  margin-bottom: 0;
}

.licence-summary .kpi-band {
  margin-bottom: 20px;
}

/* Users ---------------------------------------------------------------- */

.role-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}

.role-note {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.role-note .st {
  flex: 0 0 76px;
}

/* Settings ------------------------------------------------------------- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.settings-grid .panel {
  margin-bottom: 0;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 46%);
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-key {
  font-size: 13px;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.setting-control {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.setting-control .input,
.setting-control .select {
  height: 32px;
  font-size: 13px;
}

.setting-control .input-wide {
  min-width: 100%;
}

.save-state {
  font-size: 12px;
  color: var(--muted-foreground);
}

.save-state.is-dirty {
  color: var(--primary);
}

/* Wizard --------------------------------------------------------------- */

.wizard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.wizard-main {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}

.wizard-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
  text-align: left;
  color: var(--muted-foreground);
  transition: background 0.12s ease, color 0.12s ease;
}

.wizard-step:focus-visible {
  outline-offset: -2px;
}

.wizard-step:last-child {
  border-right: 0;
}

.wizard-step:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.wizard-step.is-active {
  background: var(--accent);
  color: var(--accent-foreground);
}

.step-num {
  font-size: 12px;
  color: var(--muted-foreground);
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
}

.wizard-step.is-active .step-num {
  color: var(--primary);
}

.wizard-step.is-done .step-num {
  color: var(--success);
}

.step-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.step-label {
  font-size: 14px;
  font-weight: 500;
}

.step-note {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.35;
}

.wizard-stage {
  padding: 24px 24px 4px;
}

.wizard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

.wizard-position {
  font-size: 12px;
  color: var(--muted-foreground);
}

.wizard-foot-actions {
  display: flex;
  gap: 8px;
}

.step-head {
  margin-bottom: 18px;
}

.step-title {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step-copy {
  margin-top: 7px;
  max-width: 640px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.wizard-summary {
  position: sticky;
  top: 76px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}

.summary-head .kicker {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.summary-tag {
  font-size: 12px;
  color: var(--muted-foreground);
}

.summary-body {
  padding: 12px 15px 14px;
}

.summary-list {
  display: flex;
  flex-direction: column;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.summary-row dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.summary-row dd {
  font-size: 13px;
  color: var(--foreground);
  text-align: right;
  max-width: 62%;
  overflow-wrap: anywhere;
}

.summary-row dd.mono {
  font-size: 12px;
  color: var(--foreground);
}

.summary-passes {
  margin-top: 12px;
}

.pass-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pass-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
}

.pass-index {
  color: var(--muted-foreground);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.summary-empty {
  font-size: 13px;
  color: var(--muted-foreground);
}

.summary-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.standard-preview {
  margin: 16px 0;
  padding: 16px;
  background: var(--muted-half);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.preview-code {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.preview-family {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.preview-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.preview-grid dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.preview-grid dd {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.preview-grid dd.mono {
  font-size: 12px;
  color: var(--foreground);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.review-block {
  min-width: 0;
}

.review-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.review-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.review-value {
  font-size: 13px;
  color: var(--foreground);
  text-align: right;
  overflow-wrap: anywhere;
}

.review-value.mono {
  font-size: 13px;
  color: var(--foreground);
}

.saved-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--ok-line);
  background: var(--success-soft);
  border-radius: var(--radius-md);
}

.saved-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.saved-kicker {
  font-size: 13px;
  font-weight: 500;
  color: var(--ok);
}

.saved-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.saved-meta {
  font-size: 12px;
  color: var(--muted-foreground);
}

.saved-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.profile-list .state {
  padding: 34px 20px;
}

/* Jobs planner --------------------------------------------------------- */

.create-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 26px;
}

.create-policy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.create-devices {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.create-devices-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.create-summary {
  font-size: 12px;
  color: var(--foreground);
}

.create-devices-tools {
  margin: 10px 0 8px;
}

.device-picker-list {
  max-height: 342px;
  overflow: auto;
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: var(--radius-md);
}

.device-picker-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.device-picker-row:last-child {
  border-bottom: 0;
}

.device-picker-row:hover {
  background: var(--secondary);
}

.device-picker-row.is-selected {
  background: var(--accent);
}

.picker-ident {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.picker-serial {
  font-size: 13px;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-model {
  font-size: 12px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-media {
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.picker-state {
  min-width: 76px;
  text-align: right;
}

/* Eraser simulator ----------------------------------------------------- */

.eraser-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 282px;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.boot-shell {
  display: flex;
  flex-direction: column;
  min-height: 620px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
}

.boot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
}

.boot-head-left,
.boot-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.boot-brand {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.boot-version {
  font-size: 12px;
  color: var(--muted-foreground);
}

.boot-sim {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-foreground);
  background: var(--accent);
  border: 1px solid var(--accent-line);
  padding: 2px 8px;
  border-radius: var(--radius-md);
}

.boot-host {
  font-size: 12px;
  color: var(--muted-foreground);
}

.boot-steps {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--background);
  overflow-x: auto;
}

.boot-step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 0 auto;
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  color: var(--muted-foreground);
  white-space: nowrap;
}

.boot-step-num {
  font-size: 12px;
  color: var(--muted-foreground);
}

.boot-step-label {
  font-size: 13px;
  font-weight: 500;
}

.boot-step.is-active {
  color: var(--accent-foreground);
  background: var(--accent);
}

.boot-step.is-active .boot-step-num {
  color: var(--primary);
}

.boot-step.is-done {
  color: var(--success);
}

.boot-step.is-done .boot-step-num {
  color: var(--success);
}

.boot-stage {
  flex: 1;
  padding: 24px 24px 16px;
  min-width: 0;
}

.stage-panel {
  min-width: 0;
}

.stage-kicker {
  font-size: 13px;
  color: var(--muted-foreground);
}

.stage-title {
  margin: 2px 0 6px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.stage-copy {
  max-width: 640px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.stage-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.stage-probing {
  margin-top: 16px;
  font-size: 13px;
  color: var(--success);
}

.stage-summary {
  font-size: 12px;
  color: var(--foreground);
  white-space: nowrap;
}

.boot-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin-top: 16px;
  max-width: 760px;
}

.boot-form .form-error {
  grid-column: 1 / -1;
}

.boot-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.boot-log {
  height: 148px;
  overflow: auto;
  padding: 8px 0;
  background: var(--ink-1);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
}

.boot-line {
  display: flex;
  gap: 12px;
  padding: 2px 16px;
  font-size: 12px;
  line-height: 1.55;
}

.boot-line-ts {
  flex: 0 0 58px;
  color: var(--muted-foreground);
}

.boot-line-msg {
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.boot-line.is-ok .boot-line-msg {
  color: var(--success);
}

.boot-line.is-warn .boot-line-msg {
  color: var(--warning);
}

.boot-line.is-bad .boot-line-msg {
  color: var(--destructive);
}

.scan-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.scan-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.scan-list {
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: var(--radius-md);
  max-height: 330px;
  overflow: auto;
}

.scan-row {
  display: grid;
  grid-template-columns: 16px 86px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.scan-row:last-child {
  border-bottom: 0;
}

.scan-row:hover {
  background: var(--secondary);
}

.scan-row.is-selected {
  background: var(--accent);
}

.scan-path {
  font-size: 12px;
  color: var(--foreground);
}

.scan-ident {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.scan-ident .mono {
  font-size: 13px;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-media {
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.scan-health {
  min-width: 70px;
  text-align: right;
}

.scan-empty {
  margin-top: 16px;
}

.stage-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.standard-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  max-height: 430px;
  overflow: auto;
}

.standard-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 190px;
  align-items: start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  cursor: pointer;
}

.standard-option input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.standard-option:hover {
  background: var(--muted-half);
}

.standard-option:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}

.standard-option input:focus-visible {
  outline: none;
}

.standard-option.is-selected {
  border-color: var(--primary);
  background: var(--accent);
}

.option-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.option-code {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.option-name {
  font-size: 14px;
  color: var(--foreground);
}

.option-desc {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.option-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  font-size: 12px;
  color: var(--muted-foreground);
}

.option-family {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.confirm-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--danger-line);
  background: var(--destructive-soft);
  border-radius: var(--radius-md);
}

.confirm-warning-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  background: var(--destructive);
  color: var(--destructive-foreground);
  font-size: 12px;
  font-weight: 600;
}

.confirm-warning-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--destructive);
}

.confirm-warning-copy {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--foreground);
}

.confirm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin-top: 18px;
}

.confirm-block {
  min-width: 0;
}

.confirm-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.confirm-label {
  font-size: 13px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.confirm-value {
  font-size: 13px;
  color: var(--foreground);
  text-align: right;
  overflow-wrap: anywhere;
}

.confirm-value.mono {
  font-size: 12px;
  color: var(--foreground);
}

.confirm-typed {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.confirm-typed .field {
  flex: 1;
  max-width: 320px;
}

.boot-bar {
  height: 8px;
  background: var(--secondary);
  border-radius: 999px;
  overflow: hidden;
}

.boot-bar-lg {
  height: 8px;
}

.boot-bar-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.12s linear;
}

.boot-progress-head {
  margin: 14px 0 16px;
}

.boot-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 12px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.boot-metric-value {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.progress-rows {
  border-top: 1px solid var(--line);
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px minmax(80px, 0.8fr) 82px;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.progress-ident {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.progress-ident .mono {
  font-size: 13px;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-pass {
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.progress-state {
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  color: var(--muted-foreground);
}

.progress-state.is-ok,
.progress-state .is-ok {
  color: var(--ok);
}

.done-band {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--ok-line);
  background: var(--success-soft);
  border-radius: var(--radius-md);
}

.done-mark {
  font-size: 14px;
  font-weight: 600;
  color: var(--ok);
}

.done-copy {
  font-size: 13px;
  color: var(--muted-foreground);
}

.done-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.done-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.done-block:last-child {
  border-right: 0;
}

.done-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.done-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.done-note {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.done-hash {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.done-hash-value {
  font-size: 13px;
  line-height: 1.6;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.eraser-side {
  min-width: 0;
}

.side-panel {
  position: sticky;
  top: 76px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.side-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.side-list {
  padding: 4px 16px;
}

.side-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.side-row dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.side-row dd {
  font-size: 13px;
  color: var(--foreground);
  text-align: right;
  overflow-wrap: anywhere;
}

.side-token {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.side-token-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.side-token-value {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.side-note {
  padding: 12px 16px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

/* Login ---------------------------------------------------------------- */

.login {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  min-height: 100vh;
  background: var(--background);
}

.login-brand {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 40px 48px 32px;
  background: var(--background);
  border-right: 1px solid var(--border);
}

.login-brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-statement {
  margin: auto 0;
  max-width: 520px;
}

.login-eyebrow {
  font-size: 13px;
  color: var(--muted-foreground);
}

.login-headline {
  margin-top: 12px;
  font-family: var(--font-display);
  max-width: 16ch;
  font-size: clamp(36px, 4.2vw, 56px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--foreground);
}

.login-copy {
  margin-top: 12px;
  max-width: 460px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.login-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  max-width: 720px;
}

.login-spec dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
}

.login-spec dd {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.login-brand-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px 32px;
  background: var(--ink-1);
}

.login-panel-inner {
  width: 100%;
  max-width: 384px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.login-panel-mark {
  margin-bottom: 16px;
}

.login-panel-mark .kicker {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.login-submit {
  width: 100%;
  height: 40px;
  margin-top: 4px;
}

.login-alert {
  display: none;
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  background: var(--destructive-soft);
  border-radius: var(--radius-md);
}

.login-alert.is-visible {
  display: block;
}

.login-alert.is-ok {
  border-color: var(--ok-line);
  background: var(--success-soft);
}

.login-alert-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--destructive);
}

.login-alert.is-ok .login-alert-title {
  color: var(--ok);
}

.login-alert-text {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--foreground);
}

.login-alert-text:first-child {
  margin-top: 0;
}

.login-alert-code {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-size: 13px;
}

.login-link {
  color: var(--muted-foreground);
}

.login-link:hover {
  color: var(--foreground);
}

.login-alert .btn {
  margin-top: 10px;
}

.login-foot {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.login-panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Pós-instalação ------------------------------------------------------- */

.post-install-smb {
  margin-top: 16px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
}

.post-install-smb[hidden] {
  display: none;
}

.post-install-warning {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--warn-line);
  background: var(--warning-soft);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  color: var(--warn);
}

.post-install-warning[hidden] {
  display: none;
}

/* shadcn component layer ------------------------------------------------ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--card-foreground);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 24px 0;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.card-description {
  font-size: 14px;
  color: var(--muted-foreground);
}

/* Tabs: muted track, active tab white with a border. */
.tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 3px;
  background: var(--secondary);
  border-radius: var(--radius-lg);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.12s ease, background 0.12s ease;
}

.tab:hover {
  color: var(--foreground);
}

.tab:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.tab.is-active {
  background: var(--background);
  border-color: var(--border);
  color: var(--foreground);
}

.tab-icon {
  display: inline-flex;
}

.tab-icon .icon {
  width: 16px;
  height: 16px;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.72);
}

.dialog {
  position: relative;
  width: 100%;
  max-width: 512px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}

.dialog:focus {
  outline: none;
}

/* Two-column planner content (job creation) needs more room than 512px. */
.dialog:has(.create-grid) {
  max-width: 880px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
}

.dialog-header-text {
  min-width: 0;
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.dialog-description {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted-foreground);
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin: -4px -8px 0 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
}

.dialog-close:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.dialog-close:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.dialog-close .icon {
  width: 16px;
  height: 16px;
}

.dialog-body {
  padding: 20px 24px 24px;
}

.tooltip {
  position: relative;
  display: inline-flex;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--foreground);
  color: var(--background);
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 20;
}

.tooltip[data-side="bottom"]::after {
  bottom: auto;
  top: calc(100% + 6px);
}

.tooltip[data-side="left"]::after {
  bottom: auto;
  left: auto;
  right: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
}

.tooltip[data-side="right"]::after {
  bottom: auto;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
}

.tooltip:hover::after,
.tooltip:focus-visible::after,
.tooltip:focus-within::after {
  opacity: 1;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  color: var(--muted-foreground);
}

/* Responsive ----------------------------------------------------------- */

@media (max-width: 1240px) {
  .overview-grid,
  .wizard-layout,
  .eraser-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .wizard-summary,
  .side-panel {
    position: static;
  }

  .wizard-summary {
    order: 2;
  }

  .create-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .step-note {
    display: none;
  }
}

@media (max-width: 1120px) and (min-width: 981px) {
  /* Five KPIs: 3 + 2 on a six-track grid so both rows fill the band. */
  .kpi-band {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .kpi-band > .kpi {
    grid-column: span 2;
  }

  .kpi-band > .kpi:nth-child(3) {
    border-right: 0;
  }

  .kpi-band > .kpi:nth-child(n + 4) {
    grid-column: span 3;
    border-top: 1px solid var(--border);
  }

  .kpi-band.is-four > .kpi {
    grid-column: span 3;
    border-right: 1px solid var(--border);
  }

  .kpi-band.is-four > .kpi:nth-child(2n) {
    border-right: 0;
  }

  .kpi-band.is-four > .kpi:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    height: auto;
    flex-direction: column;
  }

  .rail-brand {
    height: 56px;
  }

  .rail-nav {
    display: flex;
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding: 8px;
    border-top: 1px solid var(--border);
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    flex-direction: row;
    align-items: center;
    flex: 0 0 auto;
  }

  .nav-group + .nav-group {
    margin-top: 0;
  }

  .nav-group-label {
    display: none;
  }

  .nav-item {
    padding: 0 12px;
    white-space: nowrap;
  }

  .rail-foot {
    display: none;
  }

  .topbar {
    position: static;
    height: auto;
    min-height: 50px;
    padding: 8px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .view {
    padding: 18px 16px 48px;
  }

  .page-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .login {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-brand {
    padding: 28px 24px;
    gap: 22px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .login-statement {
    margin: 0;
  }

  .login-specs {
    display: none;
  }

  .login-brand-foot {
    display: none;
  }

  .login-panel {
    padding: 32px 24px 48px;
  }

  .kpi-band,
  .kpi-band.is-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi:nth-child(2n) {
    border-right: 0;
  }

  .kpi:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-top {
    flex-direction: column;
    gap: 12px;
  }

  .summary-bytes {
    align-items: flex-start;
    text-align: left;
  }

  .confirm-grid,
  .review-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .done-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .done-block:nth-child(2n) {
    border-right: 0;
  }

  .done-block:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .cert-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .verify-band {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .verify-hash {
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
  }

  .wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-step:nth-child(2n) {
    border-right: 0;
  }

  .wizard-step:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .filter-bar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .filter-search {
    max-width: none;
    flex-basis: 100%;
  }

  .filter-count {
    margin-left: 0;
  }

  .filter-note {
    display: none;
  }

  .progress-row {
    grid-template-columns: minmax(0, 1fr) 90px 76px;
  }

  .progress-boot-bar {
    display: none;
  }

  .scan-row {
    grid-template-columns: 16px 74px minmax(0, 1fr) auto;
  }

  .scan-health {
    display: none;
  }

  .standard-option {
    grid-template-columns: 16px minmax(0, 1fr);
  }

  .option-meta {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 10px;
  }

  .confirm-typed {
    flex-direction: column;
    align-items: stretch;
  }

  .confirm-typed .field {
    max-width: none;
  }

  .boot-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .table {
    min-width: 680px;
  }

  .table-compact {
    min-width: 560px;
  }

  .cert-doc {
    padding: 18px 16px;
  }
}

@media (max-width: 640px) {
  .kpi-band,
  .kpi-band.is-four {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpi {
    border-right: 0;
  }

  .kpi + .kpi {
    border-top: 1px solid var(--border);
  }

  .form-grid,
  .choice-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cert-head {
    flex-direction: column;
    gap: 10px;
  }

  .cert-head-right {
    align-items: flex-start;
    text-align: left;
  }

  .hash-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .cert-footer {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .cert-job-link {
    margin-left: 0;
  }

  .setting-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .setting-control {
    justify-content: flex-start;
  }

  .done-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .done-block {
    border-right: 0;
  }

  .done-block + .done-block {
    border-top: 1px solid var(--border);
  }

  .wizard-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .wizard-step {
    border-right: 0;
  }

  .wizard-step + .wizard-step {
    border-top: 1px solid var(--border);
  }

  .wizard-stage,
  .wizard-foot {
    padding-left: 15px;
    padding-right: 15px;
  }

  .saved-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .scan-tools {
    flex-wrap: wrap;
  }

  .boot-stage {
    padding: 16px 14px 10px;
  }

  .toast-host {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* Post-erase pipeline -------------------------------------------------- */

.textarea {
  height: auto;
  min-height: 72px;
  padding: 8px 12px;
  line-height: 1.5;
  resize: vertical;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.dialog:has(.pipeline-form) {
  max-width: 760px;
}

.pipeline-types {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pipeline-error {
  margin-bottom: 16px;
}

.pipeline-off td {
  color: var(--muted-foreground);
}

.pipeline-script-hint p {
  margin: 0 0 8px;
}

.pipeline-env {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
  margin: 0;
}

.pipeline-env dt {
  color: var(--foreground);
  font-size: 12px;
}

.pipeline-env dd {
  margin: 0;
}

@media (max-width: 640px) {
  .pipeline-types {
    grid-template-columns: 1fr;
  }
}

/* Motion --------------------------------------------------------------- */

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

/* Print — certificate document only ------------------------------------ */

@media print {
  @page {
    margin: 16mm;
  }

  html,
  body {
    background: #fff;
    background-image: none;
    color: #111;
  }

  .rail,
  .topbar,
  .page-actions,
  .page-footnote,
  .toast-host,
  .filter-bar,
  .login,
  .dialog-overlay {
    display: none !important;
  }

  .shell {
    display: block;
  }

  .view {
    padding: 0;
    max-width: none;
  }

  .page-head {
    border-bottom: 1px solid #999;
    padding-bottom: 10px;
    margin-bottom: 14px;
  }

  .page-title,
  .page-meta,
  .kicker {
    color: #111 !important;
  }

  .verify-band {
    background: #fff;
    border: 1px solid #999;
  }

  .verify-verdict,
  .verify-note,
  .verify-kicker,
  .verify-hash-value,
  .verify-hash-note {
    color: #111 !important;
  }

  .cert-doc {
    background: #fff;
    border: 1px solid #bbb;
    max-width: none;
    padding: 0;
  }

  .cert-doc * {
    color: #111 !important;
  }

  .cert-head,
  .cert-section-title,
  .cert-footer,
  .cert-meta,
  .hash-line,
  .cert-payload {
    border-color: #ccc !important;
  }

  .table th {
    background: #f2f2f2;
    color: #222 !important;
    border-color: #ccc;
  }

  .table td {
    border-color: #ddd;
  }

  .st {
    color: #111 !important;
    background: transparent;
  }

  .st-dot {
    background: #111 !important;
  }

  .cert-payload {
    display: none;
  }

  .cert-brand .logo {
    filter: brightness(0);
  }

  a {
    color: #111 !important;
    text-decoration: none;
  }
}

