/*
 * Home Tunnel v2.0
 * Precision Infrastructure design system
 * Primitive -> semantic -> component tokens live in one source of truth.
 */

/* === Primitive tokens === */
:root {
  --navy-950: #081225;
  --navy-900: #0d1b2e;
  --navy-800: #12233b;
  --navy-700: #193454;
  --slate-950: #101828;
  --slate-800: #1d2939;
  --slate-700: #344054;
  --slate-600: #475467;
  --slate-500: #667085;
  --slate-400: #98a2b3;
  --slate-300: #d0d5dd;
  --slate-200: #eaecf0;
  --slate-100: #f2f4f7;
  --slate-50: #f7f9fc;
  --white: #ffffff;
  --blue-800: #1849a9;
  --blue-700: #175cd3;
  --blue-600: #1570ef;
  --blue-500: #2e90fa;
  --blue-300: #84caff;
  --blue-100: #d1e9ff;
  --blue-50: #eff8ff;
  --green-800: #05603a;
  --green-700: #067647;
  --green-500: #17b26a;
  --green-200: #abefc6;
  --green-50: #ecfdf3;
  --amber-800: #93370d;
  --amber-700: #b54708;
  --amber-500: #f79009;
  --amber-200: #fedf89;
  --amber-50: #fffaeb;
  --red-800: #912018;
  --red-700: #b42318;
  --red-500: #f04438;
  --red-200: #fecdca;
  --red-50: #fef3f2;

  --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;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  --radius-sm: 6px;
  --radius-input: 8px;
  --radius-button: 10px;
  --radius-card: 14px;
  --radius-panel: 18px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-sm: 0 1px 3px rgb(16 24 40 / 0.08), 0 1px 2px rgb(16 24 40 / 0.04);
  --shadow-md: 0 8px 24px rgb(16 24 40 / 0.08), 0 2px 6px rgb(16 24 40 / 0.04);
  --shadow-lg: 0 20px 48px rgb(16 24 40 / 0.14), 0 4px 12px rgb(16 24 40 / 0.06);

  --duration-press: 120ms;
  --duration-ui: 180ms;
  --duration-panel: 240ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --font-sans: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

/* === Semantic tokens === */
:root {
  --color-canvas: #f6f8fb;
  --color-surface: var(--white);
  --color-surface-subtle: var(--slate-50);
  --color-surface-muted: var(--slate-100);
  --color-text: var(--slate-950);
  --color-text-body: var(--slate-700);
  --color-text-muted: var(--slate-500);
  --color-text-faint: var(--slate-400);
  --color-border: var(--slate-200);
  --color-border-strong: var(--slate-300);
  --color-primary: var(--blue-700);
  --color-primary-hover: var(--blue-800);
  --color-primary-active: #143f91;
  --color-primary-soft: var(--blue-50);
  --color-primary-border: var(--blue-100);
  --color-focus: var(--blue-500);
  --color-success: var(--green-700);
  --color-success-soft: var(--green-50);
  --color-warning: var(--amber-700);
  --color-warning-soft: var(--amber-50);
  --color-danger: var(--red-700);
  --color-danger-soft: var(--red-50);
  --content-width: 1200px;
  --admin-sidebar-width: 248px;
  --admin-topbar-height: 76px;
}

/* === Base === */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--color-canvas);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body, button, input, select { font-family: var(--font-sans); }
button, input, select { font-size: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
h1, h2, h3, p { margin-top: 0; }
::selection { background: var(--blue-100); color: var(--slate-950); }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  z-index: 2000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-input);
  background: var(--navy-950);
  color: white;
  font-weight: 650;
  transform: translateY(-150%);
  transition: transform var(--duration-ui) var(--ease-standard);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible {
  outline: 3px solid rgb(46 144 250 / 0.38);
  outline-offset: 2px;
}

/* === Component tokens and primitives === */
.button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font-weight: 650;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), border-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard), opacity var(--duration-press) var(--ease-standard);
}
.button svg { width: 18px; height: 18px; }
.button:hover { text-decoration: none; }
.button:active { opacity: 0.82; }
.button.is-loading { position: relative; }
.button.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.78;
  animation: button-spin 0.7s linear infinite;
}
@keyframes button-spin { to { transform: rotate(360deg); } }
.button:disabled, .button[aria-disabled="true"], .button.is-disabled {
  opacity: 0.52;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
.button-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.08), 0 4px 10px rgb(23 92 211 / 0.16);
}
.button-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.button-primary:active { background: var(--color-primary-active); border-color: var(--color-primary-active); }
.button-secondary {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  color: var(--color-text-body);
  box-shadow: var(--shadow-xs);
}
.button-secondary:hover { background: var(--color-surface-subtle); border-color: var(--slate-400); color: var(--color-text); }
.button-ghost, .button-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-body);
  box-shadow: none;
}
.button-ghost:hover, .button-quiet:hover { background: var(--color-surface-muted); color: var(--color-text); }
.button-danger {
  background: var(--color-danger-soft);
  border-color: var(--red-200);
  color: var(--color-danger);
}
.button-danger:hover { background: #fee4e2; border-color: #fda29b; color: var(--red-800); }
.button-large { min-height: 48px; padding: 12px 19px; font-size: 15px; }
.button-small { min-height: 34px; min-width: 34px; padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.button-block { width: 100%; }

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), border-color var(--duration-ui) var(--ease-standard), opacity var(--duration-press) var(--ease-standard);
}
.icon-button:hover { background: var(--color-surface-muted); border-color: var(--color-border-strong); color: var(--color-text); }
.icon-button:active { opacity: 0.74; }
.icon-button svg { width: 19px; height: 19px; }
.icon-button-inverse { background: rgb(255 255 255 / 0.04); border-color: rgb(255 255 255 / 0.12); color: #cbd5e1; }
.icon-button-inverse:hover { background: rgb(255 255 255 / 0.09); border-color: rgb(255 255 255 / 0.2); color: white; }

.field { display: grid; gap: 7px; min-width: 0; }
.field label {
  color: var(--color-text-body);
  font-size: 14px;
  font-weight: 650;
}
.field input:not([type="checkbox"]), .field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-input);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: inset 0 1px 2px rgb(16 24 40 / 0.03);
  transition: border-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard);
}
.field input::placeholder { color: var(--color-text-faint); }
.field input:not([type="checkbox"]):hover, .field select:hover { border-color: var(--slate-400); }
.field input:not([type="checkbox"]):focus, .field select:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px rgb(46 144 250 / 0.16), inset 0 1px 2px rgb(16 24 40 / 0.03);
}
.field input[aria-invalid="true"] { border-color: var(--red-500); box-shadow: 0 0 0 3px rgb(240 68 56 / 0.12); }
.field input:disabled, .field select:disabled { background: var(--color-surface-muted); color: var(--color-text-muted); cursor: not-allowed; }
.field input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); }
.field label:has(input[type="checkbox"]) { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.field-error { min-height: 20px; margin: 0; color: var(--color-danger); font-size: 13px; line-height: 1.5; }
.helper { margin: 0; color: var(--color-text-muted); font-size: 13px; line-height: 1.5; }
.password-field { position: relative; }
.password-field input { padding-right: 52px !important; }
.password-field .icon-button { position: absolute; top: 0; right: 0; border: 0; background: transparent; }
.form-stack { display: grid; gap: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 18px; }
.form-grid .full { grid-column: 1 / -1; }

.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--slate-400);
  box-shadow: 0 0 0 3px rgb(152 162 179 / 0.16);
}
.status-dot.status-ok { background: var(--green-500); box-shadow: 0 0 0 3px rgb(23 178 106 / 0.14); }
.status-dot.status-warn { background: var(--amber-500); box-shadow: 0 0 0 3px rgb(247 144 9 / 0.14); }
.status-dot.status-error { background: var(--red-500); box-shadow: 0 0 0 3px rgb(240 68 56 / 0.14); }
.status-pill, .status-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface-subtle);
  color: var(--color-text-body);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.status-pill > span, .status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--slate-400); }
.status-pill-success, .status-badge.ok { background: var(--color-success-soft); border-color: var(--green-200); color: var(--color-success); }
.status-pill-success > span, .status-badge.ok::before { background: var(--green-500); }
.status-badge.warn { background: var(--color-warning-soft); border-color: var(--amber-200); color: var(--color-warning); }
.status-badge.warn::before { background: var(--amber-500); }
.status-badge.error { background: var(--color-danger-soft); border-color: var(--red-200); color: var(--color-danger); }
.status-badge.error::before { background: var(--red-500); }
.status-badge.neutral { background: var(--color-surface-muted); border-color: var(--color-border-strong); color: var(--color-text-body); }

.eyebrow {
  margin-bottom: 8px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.eyebrow-inverse { color: var(--blue-300); }
.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 650;
}
.text-link:hover { color: var(--color-primary-hover); text-decoration: underline; text-underline-offset: 4px; }
.text-link svg { width: 17px; height: 17px; transition: transform var(--duration-ui) var(--ease-standard); }
.text-link:hover svg { transform: translateX(2px); }

/* === Brand === */
.brand-lockup { min-height: 44px; display: inline-flex; align-items: center; gap: 11px; }
.brand-symbol {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-primary-border);
  border-radius: 11px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.brand-symbol svg { width: 23px; height: 23px; stroke-width: 1.9; }
.brand-symbol-tiny { width: 24px; height: 24px; border-radius: 7px; }
.brand-symbol-tiny svg { width: 15px; height: 15px; }
.brand-symbol-inverse { background: rgb(46 144 250 / 0.13); border-color: rgb(132 202 255 / 0.22); color: #b9e6fe; }
.brand-copy { display: grid; gap: 1px; line-height: 1.2; }
.brand-copy strong { color: var(--color-text); font-size: 16px; font-weight: 700; }
.brand-copy small { color: var(--color-text-muted); font-size: 11px; }

/* === Marketing === */
.landing-screen { min-height: 100dvh; overflow: hidden; background: var(--color-surface); }
.marketing-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: 72px;
  border-bottom: 1px solid rgb(234 236 240 / 0.92);
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: blur(14px) saturate(135%);
}
.marketing-nav {
  width: min(100%, calc(var(--content-width) + 64px));
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin: 0 auto;
  padding: 0 var(--space-8);
}
.brand-lockup-marketing:hover .brand-copy strong { color: var(--color-primary); }
.marketing-links { display: flex; align-items: center; gap: 8px; }
.marketing-section-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--color-text-body);
  font-size: 14px;
  font-weight: 600;
  transition: color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard);
}
.marketing-section-link:hover { background: var(--color-surface-muted); color: var(--color-text); }
.marketing-login { margin-left: 4px; }

.marketing-hero {
  position: relative;
  width: min(100%, calc(var(--content-width) + 64px));
  min-height: 630px;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(500px, 1.06fr);
  align-items: center;
  gap: clamp(44px, 5vw, 76px);
  margin: 0 auto;
  padding: 84px var(--space-8) 76px;
}
.marketing-hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0 -100vw;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  border-bottom: 1px solid var(--color-border);
}
.marketing-hero > * { position: relative; z-index: 1; }
.hero-copy { max-width: 600px; }
.product-chip {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  padding: 7px 11px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-full);
  background: var(--color-primary-soft);
  color: var(--blue-800);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.hero-copy h1 {
  max-width: 660px;
  margin-bottom: 22px;
  color: var(--slate-950);
  font-size: clamp(40px, 4.4vw, 56px);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.hero-lead {
  max-width: 590px;
  margin-bottom: 29px;
  color: var(--color-text-body);
  font-size: 17px;
  line-height: 1.72;
}
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.release-note { min-height: 21px; margin: 10px 0 0; color: var(--color-text-muted); font-size: 13px; }
.hero-assurance {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin: 23px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--color-border);
  list-style: none;
}
.hero-assurance li { display: inline-flex; align-items: center; gap: 7px; color: var(--color-text-body); font-size: 13px; }
.hero-assurance svg { width: 16px; height: 16px; color: var(--color-success); stroke-width: 2.2; }

.product-preview {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: 0 28px 64px rgb(16 24 40 / 0.12), 0 4px 16px rgb(16 24 40 / 0.06);
}
.preview-titlebar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}
.preview-title-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--color-text-body); font-size: 12px; font-weight: 650; }
.preview-window-actions { display: flex; align-items: center; gap: 17px; }
.preview-window-actions i { width: 11px; height: 1px; background: var(--slate-500); }
.preview-window-actions i:nth-child(2) { width: 10px; height: 9px; border: 1px solid var(--slate-500); background: transparent; }
.preview-window-actions i:nth-child(3) { position: relative; width: 10px; background: transparent; }
.preview-window-actions i:nth-child(3)::before, .preview-window-actions i:nth-child(3)::after { content: ""; position: absolute; top: 0; left: 0; width: 11px; height: 1px; background: var(--slate-500); transform: rotate(45deg); }
.preview-window-actions i:nth-child(3)::after { transform: rotate(-45deg); }
.preview-shell { min-height: 405px; display: grid; grid-template-columns: 58px minmax(0, 1fr); }
.preview-sidebar { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 20px; border-right: 1px solid var(--color-border); background: var(--navy-900); }
.preview-sidebar > span { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: #8da2bf; }
.preview-sidebar > span.active { background: rgb(46 144 250 / 0.17); color: #b9e6fe; }
.preview-sidebar svg { width: 17px; height: 17px; }
.preview-workspace { min-width: 0; padding: 22px; background: var(--color-canvas); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.preview-heading > div { display: grid; gap: 2px; }
.preview-heading small { color: var(--color-text-muted); font-size: 11px; }
.preview-heading strong { font-size: 20px; font-weight: 680; }
.endpoint-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}
.endpoint-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--color-primary-border); border-radius: 10px; background: var(--color-primary-soft); color: var(--color-primary); }
.endpoint-icon svg { width: 19px; height: 19px; }
.endpoint-copy { min-width: 0; display: grid; gap: 2px; }
.endpoint-copy strong { font-size: 14px; }
.endpoint-copy span { overflow: hidden; color: var(--color-text-muted); font-family: var(--font-mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.endpoint-state { display: inline-flex; align-items: center; gap: 6px; color: var(--color-success); font-size: 11px; font-weight: 650; }
.endpoint-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }
.route-card { margin-top: 14px; padding: 18px 15px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.route-labels, .route-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; text-align: center; }
.route-labels { color: var(--color-text-muted); font-size: 10px; }
.route-values { color: var(--color-text-body); font-size: 10px; }
.route-values strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.route-line { display: grid; grid-template-columns: 12px 1fr 12px 1fr 12px; align-items: center; margin: 12px 10%; }
.route-line i { width: 12px; height: 12px; border: 3px solid var(--blue-100); border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 2px white; }
.route-line i:nth-of-type(2) { background: var(--green-500); border-color: var(--green-200); }
.route-line b { height: 2px; background: var(--blue-100); }
.preview-footer-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; overflow: hidden; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.preview-footer-stats div { min-width: 0; display: grid; gap: 3px; padding: 12px; border-right: 1px solid var(--color-border); }
.preview-footer-stats div:last-child { border-right: 0; }
.preview-footer-stats span { color: var(--color-text-muted); font-size: 9px; }
.preview-footer-stats strong { overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

.trust-bar {
  width: min(100%, calc(var(--content-width) + 64px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 auto;
  padding: 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
}
.trust-bar > div { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 25px 19px; border-right: 1px solid var(--color-border); }
.trust-bar > div:first-child { padding-left: 0; }
.trust-bar > div:last-child { padding-right: 0; border-right: 0; }
.trust-bar > div > svg { width: 22px; height: 22px; color: var(--color-primary); }
.trust-bar span { min-width: 0; display: grid; gap: 2px; }
.trust-bar strong { font-size: 13px; }
.trust-bar small { overflow: hidden; color: var(--color-text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.marketing-section { width: min(100%, calc(var(--content-width) + 64px)); margin: 0 auto; padding: 104px var(--space-8); }
.section-intro { max-width: 720px; margin-bottom: 42px; }
.section-intro h2, .workflow-intro h2, .control-copy h2, .download-copy h2 {
  margin-bottom: 15px;
  color: var(--slate-950);
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.section-intro > p:last-child, .workflow-intro > p, .control-copy > p, .download-copy > p { margin-bottom: 0; color: var(--color-text-body); font-size: 16px; line-height: 1.7; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature-card {
  position: relative;
  min-height: 314px;
  display: flex;
  flex-direction: column;
  padding: 27px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard);
}
.feature-card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); }
.feature-card-primary { background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%); border-color: var(--color-primary-border); }
.feature-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 30px; border: 1px solid var(--color-primary-border); border-radius: 12px; background: var(--color-primary-soft); color: var(--color-primary); }
.feature-icon svg { width: 21px; height: 21px; }
.feature-number { position: absolute; top: 29px; right: 27px; color: var(--color-text-faint); font-family: var(--font-mono); font-size: 12px; font-weight: 650; }
.feature-card h3 { margin-bottom: 10px; font-size: 20px; font-weight: 680; letter-spacing: -0.012em; }
.feature-card p { margin-bottom: 24px; color: var(--color-text-body); font-size: 14px; line-height: 1.7; }
.feature-detail { margin-top: auto; padding-top: 17px; border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 12px; }

.workflow-section { display: grid; grid-template-columns: minmax(280px, 0.76fr) minmax(0, 1.24fr); gap: 76px; border-top: 1px solid var(--color-border); }
.workflow-intro { position: sticky; top: 112px; align-self: start; }
.workflow-intro .text-link { margin-top: 18px; }
.workflow-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.workflow-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 132px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}
.step-number { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--color-primary-border); border-radius: var(--radius-button); background: var(--color-primary-soft); color: var(--color-primary); font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.workflow-list h3 { margin-bottom: 6px; font-size: 17px; font-weight: 680; }
.workflow-list p { margin-bottom: 0; color: var(--color-text-body); font-size: 14px; line-height: 1.65; }
.workflow-list > li > svg { width: 24px; height: 24px; color: var(--color-text-faint); }

.control-section {
  width: min(calc(100% - 64px), var(--content-width));
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 62px;
  margin: 0 auto 104px;
  padding: 64px;
  overflow: hidden;
  border: 1px solid var(--navy-700);
  border-radius: 24px;
  background: var(--navy-900);
  color: white;
  box-shadow: 0 24px 54px rgb(8 18 37 / 0.18);
}
.control-visual { position: relative; min-height: 340px; }
.control-ring { position: absolute; border: 1px solid rgb(132 202 255 / 0.2); border-radius: 50%; }
.control-ring-one { inset: 34px; }
.control-ring-two { inset: 88px; border-color: rgb(171 239 198 / 0.18); }
.control-node { position: absolute; width: 58px; height: 58px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgb(132 202 255 / 0.25); border-radius: 16px; background: var(--navy-800); color: #b9e6fe; box-shadow: 0 12px 30px rgb(0 0 0 / 0.16); }
.control-node svg { width: 26px; height: 26px; }
.control-node-home { top: 18px; left: calc(50% - 29px); }
.control-node-cloud { top: calc(50% - 29px); right: 5px; color: #abefc6; border-color: rgb(171 239 198 / 0.25); }
.control-node-device { bottom: 17px; left: 15%; }
.control-copy h2 { color: white; }
.control-copy > p { color: #b8c7da; }
.control-points { display: grid; gap: 15px; margin: 28px 0 0; padding: 0; list-style: none; }
.control-points li { display: flex; align-items: flex-start; gap: 12px; }
.control-points li > svg { width: 18px; height: 18px; margin-top: 2px; color: #75e0a7; stroke-width: 2.2; }
.control-points span { display: grid; gap: 2px; }
.control-points strong { font-size: 14px; }
.control-points small { color: #9eb0c6; font-size: 12px; }

.download-panel {
  width: min(calc(100% - 64px), var(--content-width));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  align-items: center;
  gap: 64px;
  margin: 0 auto 104px;
  padding: 48px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-panel);
  background: linear-gradient(135deg, #f4f9ff 0%, #ffffff 70%);
  box-shadow: var(--shadow-sm);
}
.download-copy h2 { max-width: 660px; }
.download-copy > p { max-width: 660px; }
.download-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 25px; }
.download-actions > span { color: var(--color-text-muted); font-size: 12px; }
.release-metadata { margin: 0; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); box-shadow: var(--shadow-xs); }
.release-metadata > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--color-border); }
.release-metadata > div:last-child { border-bottom: 0; }
.release-metadata dt { color: var(--color-text-muted); font-size: 12px; }
.release-metadata dd { min-width: 0; margin: 0; color: var(--color-text); font-family: var(--font-mono); font-size: 12px; font-weight: 650; }
.release-hash dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: help; }

.marketing-footer { border-top: 1px solid var(--color-border); background: var(--color-surface-subtle); }
.marketing-footer-inner { width: min(100%, calc(var(--content-width) + 64px)); min-height: 116px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 auto; padding: 24px var(--space-8); }
.marketing-footer-inner > p { margin: 0; color: var(--color-text-muted); font-size: 12px; }

/* === Authentication === */
.auth-screen { min-height: 100dvh; padding: 24px; background: var(--color-canvas); }
.auth-layout {
  width: min(1180px, 100%);
  min-height: calc(100dvh - 48px);
  display: grid;
  grid-template-columns: minmax(410px, 0.88fr) minmax(480px, 1.12fr);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 22px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}
.auth-context { display: flex; flex-direction: column; padding: clamp(36px, 5vw, 64px); background: var(--navy-900); color: white; }
.brand-lockup-auth .brand-copy strong { color: white; }
.brand-lockup-auth .brand-copy small { color: #9eb0c6; }
.auth-context-copy { max-width: 500px; margin: auto 0 42px; padding-top: 80px; }
.auth-context-copy h2 { margin-bottom: 18px; color: white; font-size: clamp(30px, 3.5vw, 42px); font-weight: 700; letter-spacing: -0.028em; line-height: 1.22; }
.auth-context-copy > p:last-child { margin-bottom: 0; color: #b8c7da; font-size: 15px; line-height: 1.72; }
.auth-trust-list { display: grid; gap: 18px; margin: 0 0 38px; padding: 0; list-style: none; }
.auth-trust-list li { display: flex; align-items: center; gap: 13px; }
.auth-trust-list li > span { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgb(132 202 255 / 0.18); border-radius: 10px; background: rgb(46 144 250 / 0.1); color: #b9e6fe; }
.auth-trust-list svg { width: 19px; height: 19px; }
.auth-trust-list div { display: grid; gap: 2px; }
.auth-trust-list strong { font-size: 13px; }
.auth-trust-list small { color: #9eb0c6; font-size: 11px; }
.auth-home-link { width: fit-content; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: #b8c7da; font-size: 13px; font-weight: 600; }
.auth-home-link:hover { color: white; }
.auth-home-link svg { width: 17px; height: 17px; }
.auth-card-wrap { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--color-surface-subtle); }
.auth-card { width: min(430px, 100%); padding: 34px; border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); box-shadow: var(--shadow-md); }
.auth-card-status { width: fit-content; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px; color: var(--color-success); font-size: 12px; font-weight: 650; }
.auth-card-heading { margin-bottom: 28px; }
.auth-card-heading h1 { margin-bottom: 8px; color: var(--color-text); font-size: 29px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; }
.auth-card-heading > p:last-child { margin-bottom: 0; color: var(--color-text-muted); font-size: 14px; }
.auth-footnote { display: flex; align-items: flex-start; gap: 8px; margin: 25px 0 0; padding-top: 20px; border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 11px; line-height: 1.55; }
.auth-footnote svg { width: 16px; height: 16px; margin-top: 1px; color: var(--color-primary); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-button);
  background: var(--color-primary-soft);
  color: var(--color-text-body);
}
.notice > span:not(.notice-icon) { display: grid; gap: 3px; }
.notice > strong { display: block; }
.notice strong { color: var(--color-text); font-size: 13px; }
.notice small, .notice > span:not(.notice-icon):not(:has(strong)) { color: var(--color-text-body); font-size: 12px; line-height: 1.55; }
.notice-icon { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--color-warning); }
.notice-icon svg { width: 18px; height: 18px; }
.notice-warning { border-color: var(--amber-200); background: var(--color-warning-soft); }

/* === Admin shell === */
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr); background: var(--color-canvas); }
.sidebar {
  position: fixed;
  z-index: 300;
  inset: 0 auto 0 0;
  width: var(--admin-sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: var(--navy-900);
  color: white;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 25px; border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.sidebar-brand .brand-copy strong { color: white; }
.sidebar-brand .brand-copy small { color: #8da2bf; }
.sidebar-label { margin: 23px 10px 8px; color: #7188a6; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-list { display: grid; gap: 4px; }
.nav-item {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: transparent;
  color: #9eb0c6;
  font-size: 14px;
  font-weight: 590;
  text-align: left;
  cursor: pointer;
  transition: color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard);
}
.nav-item::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: -5px; width: 3px; border-radius: 2px; background: transparent; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: rgb(255 255 255 / 0.055); color: #e4edf7; }
.nav-item.active { background: rgb(46 144 250 / 0.14); color: white; }
.nav-item.active::before { background: #53b1fd; }
.sidebar-session { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 11px; border: 1px solid rgb(255 255 255 / 0.08); border-radius: 10px; background: rgb(255 255 255 / 0.035); }
.sidebar-session > div { min-width: 0; display: grid; gap: 1px; }
.sidebar-session strong { font-size: 11px; }
.sidebar-session small { overflow: hidden; color: #8297b3; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 14px 4px 0; border-top: 1px solid rgb(255 255 255 / 0.08); }
.user-chip { min-width: 0; display: flex; align-items: center; gap: 10px; }
.user-chip > span { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgb(132 202 255 / 0.2); border-radius: 9px; background: rgb(46 144 250 / 0.12); color: #b9e6fe; font-size: 13px; font-weight: 700; }
.user-chip > div { min-width: 0; display: grid; gap: 1px; }
.user-chip strong, .user-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { max-width: 105px; color: white; font-size: 11px; }
.user-chip small { max-width: 105px; color: #8297b3; font-size: 9px; }
.sidebar-footer .icon-button { width: 44px; height: 44px; }

.workspace { grid-column: 2; min-width: 0; min-height: 100dvh; }
.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  min-height: var(--admin-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 30px;
  border-bottom: 1px solid var(--color-border);
  background: rgb(255 255 255 / 0.95);
  backdrop-filter: blur(12px) saturate(130%);
}
.topbar-context { min-width: 0; display: flex; align-items: center; gap: 12px; }
.topbar-context .eyebrow { margin-bottom: 3px; color: var(--color-text-muted); font-size: 9px; }
.topbar-context h1 { margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -0.015em; line-height: 1.25; }
.topbar-status { display: flex; align-items: center; gap: 9px; color: var(--color-text-muted); font-size: 12px; white-space: nowrap; }
.topbar-divider { width: 1px; height: 18px; margin: 0 3px; background: var(--color-border); }
.topbar-status time { min-width: 62px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.content { min-width: 0; padding: 28px 30px 44px; outline: none; }
#view-content { max-width: 1520px; margin: 0 auto; }
.mobile-only { display: none; }
.sidebar-scrim { display: none; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h2 { margin-bottom: 5px; font-size: 23px; font-weight: 680; letter-spacing: -0.018em; line-height: 1.3; }
.page-heading p { max-width: 760px; margin-bottom: 0; color: var(--color-text-muted); font-size: 13px; line-height: 1.6; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.metric-card {
  min-width: 0;
  min-height: 132px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: space-between;
  gap: 10px;
  padding: 19px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}
.metric-label { color: var(--color-text-muted); font-size: 12px; font-weight: 600; }
.metric-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; grid-column: 2; grid-row: 1 / span 2; border: 1px solid var(--color-primary-border); border-radius: 9px; background: var(--color-primary-soft); color: var(--color-primary); }
.metric-icon svg { width: 17px; height: 17px; }
.metric-value { align-self: end; color: var(--color-text); font-size: clamp(27px, 2.2vw, 34px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-meta { grid-column: 1 / -1; overflow: hidden; color: var(--color-text-muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); gap: 14px; }
.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}
.dashboard-grid > .panel { padding: 19px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-header h3 { margin: 0; font-size: 15px; font-weight: 680; }
.panel-subtle { color: var(--color-text-muted); font-size: 11px; line-height: 1.55; }
.panel > .panel-subtle { margin-bottom: 0; }
.flow-line { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; overflow-x: auto; scrollbar-width: thin; }
.flow-node { min-height: 34px; display: inline-flex; align-items: center; padding: 7px 10px; border: 1px solid var(--color-primary-border); border-radius: 8px; background: var(--color-primary-soft); color: var(--blue-800); font-family: var(--font-mono); font-size: 10px; font-weight: 650; white-space: nowrap; }
.flow-arrow { color: var(--color-text-faint); font-size: 13px; }
.health-list { display: grid; gap: 1px; }
.health-list-spaced { margin-top: 14px; }
.health-row { min-height: 40px; display: grid; grid-template-columns: auto minmax(100px, 0.65fr) minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.health-row:last-child { border-bottom: 0; }
.health-row strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.health-row > span:last-child { overflow: hidden; color: var(--color-text-muted); font-family: var(--font-mono); font-size: 10px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.table-panel { overflow-x: auto; }
.table-section { margin-top: 14px; }
.table-section .panel-header { margin: 0; padding: 17px 18px 10px; }
.data-table { width: 100%; border-collapse: collapse; color: var(--color-text-body); font-size: 12px; }
.data-table th {
  height: 42px;
  padding: 9px 14px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}
.data-table td { height: 56px; padding: 10px 14px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background-color var(--duration-ui) var(--ease-standard); }
.data-table tbody tr:hover { background: #fafbfc; }
.cell-primary { display: block; color: var(--color-text); font-weight: 650; line-height: 1.45; }
.cell-secondary { display: block; max-width: 290px; margin-top: 2px; overflow: hidden; color: var(--color-text-muted); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
a.cell-secondary:hover { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.mono { font-family: var(--font-mono); font-size: 10px; font-variant-numeric: tabular-nums; }
.actions-cell { text-align: right; }
.actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }

.empty-state { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; color: var(--color-text-muted); text-align: center; }
.empty-state-icon { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; border: 1px solid var(--color-border); border-radius: 13px; background: var(--color-surface-subtle); color: var(--color-text-faint); }
.empty-state > svg { width: 32px; height: 32px; margin-bottom: 14px; color: var(--color-text-faint); }
.empty-state-icon svg { width: 23px; height: 23px; }
.empty-state strong { margin-bottom: 4px; color: var(--color-text); font-size: 14px; }
.empty-state > span { max-width: 520px; font-size: 12px; line-height: 1.6; }
.empty-state .button { margin-top: 17px; }

.skeleton { position: relative; min-height: 132px; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(242 244 247 / 0.92), transparent); transform: translateX(-100%); animation: skeleton-sweep 1.25s ease-in-out infinite; }
.skeleton-panel { min-height: 320px; }
.skeleton-table { min-height: 430px; }
.loading-heading { min-height: 69px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.loading-heading > div { width: min(520px, 72%); display: grid; gap: 10px; }
.skeleton-line, .skeleton-action { display: block; overflow: hidden; border-radius: 6px; background: var(--slate-200); }
.skeleton-line { width: 68%; height: 12px; }
.skeleton-line-title { width: 44%; height: 25px; }
.skeleton-action { width: 92px; height: 44px; }
@keyframes skeleton-sweep { to { transform: translateX(100%); } }

/* === Dialogs and feedback === */
.modal { width: min(660px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: visible; border: 0; border-radius: var(--radius-panel); background: transparent; color: var(--color-text); }
.modal::backdrop { background: rgb(8 18 37 / 0.54); backdrop-filter: blur(3px); }
.modal-frame { max-height: calc(100dvh - 32px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-panel); background: var(--color-surface); box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--color-border); }
.modal-header .eyebrow { margin-bottom: 4px; font-size: 9px; }
.modal-header h2 { margin: 0; font-size: 19px; font-weight: 680; letter-spacing: -0.012em; }
.modal-body { overflow-y: auto; padding: 22px; }
.modal-error { min-height: 0; margin: 0; padding: 0 22px; color: var(--color-danger); font-size: 12px; }
.modal-error:not(:empty) { padding-top: 11px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 15px 22px; border-top: 1px solid var(--color-border); background: var(--color-surface-subtle); }
.secret-box { padding: 17px; border: 1px solid var(--green-200); border-radius: var(--radius-button); background: var(--color-success-soft); }
.secret-box > strong { color: var(--color-success); font-size: 13px; }
.secret-value { display: block; margin: 11px 0; padding: 12px; overflow-wrap: anywhere; border: 1px dashed var(--green-200); border-radius: 8px; background: white; color: var(--green-800); font-family: var(--font-mono); font-size: 13px; font-weight: 650; line-height: 1.6; }
.secret-box .button { margin-top: 13px; }
.toast-region { position: fixed; z-index: 1600; right: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px)); display: grid; gap: 10px; pointer-events: none; }
.toast { position: relative; padding: 14px 16px 14px 45px; border: 1px solid var(--green-200); border-radius: var(--radius-button); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.5; animation: toast-in var(--duration-panel) var(--ease-standard); }
.toast::before { content: ""; position: absolute; top: 18px; left: 18px; width: 10px; height: 6px; border-bottom: 2px solid var(--color-success); border-left: 2px solid var(--color-success); transform: rotate(-45deg); }
.toast.error { border-color: var(--red-200); background: var(--color-danger-soft); color: var(--red-800); }
.toast.error::before { width: 11px; height: 2px; border: 0; background: var(--color-danger); transform: rotate(45deg); }
.toast.error::after { content: ""; position: absolute; top: 22px; left: 18px; width: 11px; height: 2px; background: var(--color-danger); transform: rotate(-45deg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* === Responsive === */
@media (max-width: 1120px) {
  .marketing-hero { grid-template-columns: minmax(0, 0.9fr) minmax(440px, 1.1fr); gap: 38px; }
  .hero-copy h1 { font-size: clamp(38px, 4.5vw, 48px); }
  .trust-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-bar > div:nth-child(2) { border-right: 0; }
  .trust-bar > div:nth-child(-n+2) { border-bottom: 1px solid var(--color-border); }
  .trust-bar > div:nth-child(3) { padding-left: 0; }
  .auth-layout { grid-template-columns: minmax(360px, 0.8fr) minmax(450px, 1.2fr); }
  .auth-context { padding: 42px; }
  .auth-card-wrap { padding: 36px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .marketing-hero { grid-template-columns: 1fr; padding-top: 66px; }
  .hero-copy { max-width: 720px; }
  .hero-copy h1 { max-width: 720px; }
  .product-preview { width: min(700px, 100%); }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 0; }
  .workflow-section { grid-template-columns: 1fr; gap: 38px; }
  .workflow-intro { position: static; }
  .control-section { grid-template-columns: minmax(270px, 0.75fr) minmax(0, 1.25fr); gap: 40px; padding: 48px; }
  .download-panel { grid-template-columns: 1fr; gap: 36px; }
  .auth-screen { padding: 0; }
  .auth-layout { min-height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-context { min-height: auto; padding: 28px 32px; }
  .auth-context-copy { margin: 48px 0 28px; padding-top: 0; }
  .auth-context-copy h2 { max-width: 660px; font-size: 32px; }
  .auth-context-copy > p:last-child { max-width: 700px; }
  .auth-trust-list { display: none; }
  .auth-home-link { display: none; }
  .auth-card-wrap { min-height: 590px; padding: 48px 24px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-102%); box-shadow: 18px 0 42px rgb(8 18 37 / 0.2); transition: transform var(--duration-panel) var(--ease-standard); }
  .sidebar.open { transform: translateX(0); }
  .workspace { grid-column: 1; }
  .mobile-only { display: inline-flex; }
  .sidebar-scrim { position: fixed; z-index: 250; inset: 0; width: 100%; height: 100%; border: 0; background: rgb(8 18 37 / 0.42); opacity: 0; pointer-events: none; transition: opacity var(--duration-panel) var(--ease-standard); }
  .sidebar.open ~ .sidebar-scrim { display: block; opacity: 1; pointer-events: auto; }
}

@media (max-width: 760px) {
  .marketing-nav, .marketing-hero, .trust-bar, .marketing-section, .marketing-footer-inner { padding-right: 20px; padding-left: 20px; }
  .marketing-section-link { display: none; }
  .marketing-login { margin-left: 0; }
  .brand-copy small { display: none; }
  .marketing-hero { min-height: auto; padding-top: 54px; padding-bottom: 58px; }
  .hero-copy h1 { font-size: clamp(36px, 9vw, 46px); }
  .hero-lead { font-size: 16px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .product-preview { border-radius: var(--radius-card); }
  .preview-shell { grid-template-columns: 48px minmax(0, 1fr); }
  .preview-workspace { padding: 16px; }
  .preview-footer-stats { grid-template-columns: 1fr; }
  .preview-footer-stats div { grid-template-columns: 1fr auto; align-items: center; border-right: 0; border-bottom: 1px solid var(--color-border); }
  .preview-footer-stats div:last-child { border-bottom: 0; }
  .route-values strong { font-size: 9px; }
  .trust-bar { grid-template-columns: 1fr; }
  .trust-bar > div { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--color-border); }
  .trust-bar > div:last-child { border-bottom: 0; }
  .marketing-section { padding-top: 76px; padding-bottom: 76px; }
  .feature-grid { gap: 12px; }
  .workflow-list li { grid-template-columns: auto minmax(0, 1fr); padding: 20px; }
  .workflow-list > li > svg { display: none; }
  .control-section, .download-panel { width: calc(100% - 40px); }
  .control-section { grid-template-columns: 1fr; gap: 22px; margin-bottom: 76px; padding: 30px; }
  .control-visual { min-height: 250px; }
  .download-panel { margin-bottom: 76px; padding: 30px; }
  .release-metadata > div { grid-template-columns: 1fr; gap: 3px; }
  .marketing-footer-inner { align-items: flex-start; flex-direction: column; min-height: auto; padding-top: 30px; padding-bottom: 30px; }
  .auth-context { padding: 24px 20px; }
  .auth-context-copy { margin: 38px 0 14px; }
  .auth-context-copy h2 { font-size: 28px; }
  .auth-card-wrap { align-items: flex-start; min-height: 0; padding: 34px 16px 50px; }
  .auth-card { padding: 25px 21px; }
  .topbar { min-height: 70px; padding: 11px 16px; }
  .topbar-status > span:not(.status-dot) { display: none; }
  .topbar-divider { display: none; }
  .content { padding: 22px 16px 36px; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 14px; }
  .page-heading > .button, .page-heading > .toolbar { align-self: flex-start; }
  .metrics-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .table-panel { overflow: visible; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tbody { display: grid; gap: 11px; padding: 11px; background: var(--color-canvas); }
  .data-table tr { overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-button); background: var(--color-surface); box-shadow: var(--shadow-xs); }
  .data-table td { min-height: 44px; height: auto; display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px; text-align: left; }
  .data-table td::before { content: attr(data-label); color: var(--color-text-muted); font-size: 11px; font-weight: 600; }
  .data-table td > .status-badge { justify-self: start; }
  .data-table .button-small { min-height: 44px; min-width: 44px; padding: 9px 11px; }
  .data-table td:empty, .data-table td.actions-cell:has(.actions:empty) { display: none; }
  .actions-cell { text-align: left; }
  .actions { justify-content: flex-start; }
  .cell-secondary { max-width: 100%; }
  .hide-tablet { display: none !important; }
  .modal { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .modal-frame { max-height: calc(100dvh - 20px); }
  .modal-header, .modal-body { padding: 18px; }
  .modal-footer { padding: 13px 18px; }
  .modal-footer .button { flex: 1; }
}

@media (max-width: 430px) {
  .marketing-header { height: 66px; }
  .marketing-nav { padding-right: 14px; padding-left: 14px; }
  .brand-symbol { width: 36px; height: 36px; }
  .marketing-login { min-height: 44px; padding: 8px 11px; }
  .marketing-login svg { display: none; }
  .marketing-hero { padding-right: 16px; padding-left: 16px; }
  .hero-copy h1 { font-size: 34px; }
  .product-chip { font-size: 11px; }
  .product-preview { display: none; }
  .hero-assurance { display: grid; grid-template-columns: 1fr; }
  .trust-bar, .marketing-section, .marketing-footer-inner { padding-right: 16px; padding-left: 16px; }
  .control-section, .download-panel { width: calc(100% - 32px); }
  .control-visual { display: none; }
  .control-section, .download-panel { padding: 24px; }
  .download-actions .button { width: 100%; }
  .auth-context-copy h2 { font-size: 25px; }
  .auth-context-copy > p:last-child { font-size: 14px; }
  .auth-card { border-radius: var(--radius-card); }
  .topbar-context h1 { font-size: 19px; }
  .metric-card { min-height: 122px; }
  .data-table td { grid-template-columns: 92px minmax(0, 1fr); }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .button { width: 100%; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .auth-screen { padding: 0; }
  .auth-layout { min-height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-context { display: none; }
  .auth-card-wrap { min-height: 100dvh; align-items: flex-start; padding: 12px 24px; }
  .auth-card { width: min(560px, 100%); padding: 18px 24px; }
  .auth-card-status { margin-bottom: 10px; }
  .auth-card-heading { margin-bottom: 12px; }
  .auth-card-heading .eyebrow, .auth-card-heading > p:last-child { display: none; }
  .auth-card-heading h1 { margin: 0; font-size: 24px; }
  .auth-footnote { display: none; }
}

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

@media (forced-colors: active) {
  .status-dot, .status-badge::before, .status-pill > span { forced-color-adjust: none; }
  .nav-item.active { outline: 1px solid ButtonText; }
}
