/* =============================================================================
   QuantLite design system: "Dark-field fluorescence"
   Blue light in (excitation, 470 nm) → orange light out (Nile Red emission).
   Ink neutrals for instrument-grade surfaces, emission orange as the signature
   accent, excitation blue for links, focus and information.
   ============================================================================= */

:root {
  /* Typography */
  --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Ink neutrals (cool, slightly teal-shifted) */
  --ink-950: #060e13;
  --ink-900: #0b161d;
  --ink-850: #0f1d26;
  --ink-800: #142530;
  --ink-700: #213846;
  --ink-600: #3a5261;
  --ink-500: #5a6f7c;
  --ink-400: #8698a3;
  --ink-300: #b6c3cb;
  --ink-200: #dbe2e7;
  --ink-150: #e6ebef;
  --ink-100: #eff3f5;
  --ink-50:  #f7f9fa;

  /* Emission (Nile Red fluorescence) */
  --em-700: #b84706;
  --em-600: #e2600c;
  --em-500: #ff7a1a;
  --em-400: #ff9b4f;
  --em-300: #ffc28f;
  --em-100: #fff0e3;
  --em-glow: rgba(255, 122, 26, .45);

  /* Excitation (470 nm blue) */
  --ex-700: #1f3fb8;
  --ex-600: #2c55e0;
  --ex-500: #3d6bff;
  --ex-300: #9db4ff;
  --ex-100: #e9efff;

  /* Status */
  --ok-700: #0d6e50;  --ok-500: #12a174;  --ok-100: #e3f6ee;
  --warn-700: #8a5a00; --warn-500: #d99a00; --warn-100: #fdf3dc;
  --bad-700: #a32a2e;  --bad-500: #e5484d;  --bad-100: #fdecec;

  /* Semantic */
  --bg: var(--ink-50);
  --surface: #ffffff;
  --surface-2: var(--ink-50);
  --surface-3: var(--ink-100);
  --border: var(--ink-150);
  --border-strong: var(--ink-200);
  --text: var(--ink-900);
  --text-2: var(--ink-600);
  --text-3: var(--ink-500);
  --link: var(--ex-600);
  --focus: var(--ex-500);
  --primary: var(--ink-900);
  --primary-hover: var(--ink-700);
  --accent: var(--em-500);
  --accent-hover: var(--em-600);

  /* Shape, depth, motion */
  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(6, 14, 19, .06);
  --shadow-sm: 0 1px 2px rgba(6, 14, 19, .05), 0 2px 6px -2px rgba(6, 14, 19, .06);
  --shadow-md: 0 2px 4px rgba(6, 14, 19, .04), 0 10px 24px -8px rgba(6, 14, 19, .14);
  --shadow-lg: 0 30px 70px -24px rgba(6, 14, 19, .38);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 120ms; --t: 200ms; --t-slow: 420ms;
  --sidebar: 252px;
  --page-x: clamp(20px, 5vw, 80px);

  /* Legacy aliases (kept so any older rule or inline style still resolves) */
  --navy: var(--ink-900); --teal: var(--ink-800); --aqua: var(--em-500); --seafoam: var(--em-300);
  --line: var(--border); --slate: var(--text-2); --ink: var(--text); --white: #fff;
  --sans: var(--font-sans); --display: var(--font-sans);
}

/* ----------------------------------------------------------------------------
   Base
   ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, select:disabled, fieldset:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img, svg, video, canvas { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: var(--em-300); color: var(--ink-950); }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
b, strong { font-weight: 600; }
.mono, code { font-family: var(--font-mono); }

.skip-link {
  position: fixed; top: -80px; left: 12px; z-index: 100;
  background: var(--surface); padding: 10px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--border); box-shadow: var(--shadow-md); font-weight: 600;
}
.skip-link:focus { top: 12px; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ----------------------------------------------------------------------------
   Brand
   ---------------------------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 11px; color: #fff; font: 700 14px/1 var(--font-sans); letter-spacing: .14em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 9px; background: linear-gradient(145deg, #15262f, #0a141a);
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand small { display: block; font: 500 9px/1 var(--font-mono); letter-spacing: .16em; color: var(--ink-400); margin-top: 5px; }

/* ----------------------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------------------- */
.button {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  border-radius: var(--r-sm); font: 600 13.5px/1 var(--font-sans); letter-spacing: -.005em; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.button > span[aria-hidden], .button > span:last-child:not(:first-child) { transition: transform var(--t) var(--ease); }
.button:hover:not(:disabled) > span:last-child:not(:first-child) { transform: translateX(2px); }
.button:not(:disabled):active { transform: translateY(1px); }
.button:disabled { opacity: .45; }
.button.full-width { width: 100%; }
.button-primary { --btn-bg: var(--primary); --btn-fg: #fff; --btn-bd: var(--primary); box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .08); }
.button-primary:hover:not(:disabled) { --btn-bg: var(--primary-hover); --btn-bd: var(--primary-hover); }
.button-accent { --btn-bg: var(--accent); --btn-fg: #1b0a00; --btn-bd: var(--accent); box-shadow: 0 6px 20px -6px var(--em-glow), inset 0 1px 0 rgba(255, 255, 255, .35); }
.button-accent:hover:not(:disabled) { --btn-bg: var(--em-400); --btn-bd: var(--em-400); }
.button-outline { --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong); box-shadow: var(--shadow-xs); }
.button-outline:hover:not(:disabled) { --btn-bg: var(--surface-2); --btn-bd: var(--ink-300); }
.button-light { --btn-bg: #fff; --btn-fg: var(--ink-950); --btn-bd: #fff; }
.button-light:hover:not(:disabled) { --btn-bg: var(--ink-100); }
.button-ghost-light { --btn-bg: rgba(255, 255, 255, .04); --btn-fg: #e9f0f3; --btn-bd: rgba(255, 255, 255, .16); }
.button-ghost-light:hover:not(:disabled) { --btn-bg: rgba(255, 255, 255, .09); --btn-bd: rgba(255, 255, 255, .28); }
.button-disabled { --btn-bg: var(--surface-3); --btn-fg: var(--text-3); }
.button-sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.button-lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }

.link-button, .back-link, .table-link, .text-link {
  border: 0; background: none; padding: 0; color: var(--link); font-size: 13px; font-weight: 600;
  text-underline-offset: 3px; transition: color var(--t-fast);
}
.link-button:hover, .back-link:hover, .table-link:hover, .text-link:hover { color: var(--ex-700); text-decoration: underline; }
.text-button { border: 0; background: transparent; color: var(--bad-700); padding: 4px 8px; font-size: 12px; font-weight: 600; border-radius: var(--r-xs); }
.text-button:hover { background: var(--bad-100); }

/* ----------------------------------------------------------------------------
   Labels, eyebrows, status
   ---------------------------------------------------------------------------- */
.eyebrow, .panel-kicker, .quiet-label, .feature-kicker, .org-switcher-label, .workspace-label {
  font: 500 11px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--em-300); }
.eyebrow.muted { color: var(--text-3); }
.eyebrow-line { width: 18px; height: 1px; background: currentColor; opacity: .6; display: inline-block; }
.panel-kicker { color: var(--text-3); }
.quiet-label { color: var(--text-3); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn-500); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }

.status-label {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px;
  border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-600);
  font: 500 11px/1.5 var(--font-mono); letter-spacing: .02em; white-space: nowrap; text-transform: uppercase;
}
.status-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.status-label.completed, .status-label.active, .status-label.approved, .status-label.accepted, .status-label.passed,
.status-label.captured, .status-label.delivered, .status-label.ready, .status-label.verified, .status-label.online, .status-label.synced { background: var(--ok-100); color: var(--ok-700); }
.status-label.failed, .status-label.suspended, .status-label.rejected, .status-label.revoked, .status-label.processing_failed,
.status-label.reanalysis_required, .status-label.cancelled, .status-label.expired, .status-label.dead_letter { background: var(--bad-100); color: var(--bad-700); }
.status-label.pending, .status-label.processing, .status-label.submitted, .status-label.review, .status-label.quality_check,
.status-label.review_pending, .status-label.queued, .status-label.warning, .status-label.trial, .status-label.unsynced,
.status-label.open, .status-label.in_progress, .status-label.past_due { background: var(--warn-100); color: var(--warn-700); }
.status-label.draft, .status-label.archived, .status-label.not_applicable { background: var(--surface-3); color: var(--ink-500); }

/* ----------------------------------------------------------------------------
   Global loading bar (toggled by app.js while API requests are in flight)
   ---------------------------------------------------------------------------- */
.load-bar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity var(--t); }
.load-bar::before { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: load-slide 1.1s var(--ease) infinite; }
body.is-loading .load-bar { opacity: 1; }
@keyframes load-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* =============================================================================
   PUBLIC LANDING PAGE
   ============================================================================= */
.landing-shell { min-height: 100vh; background: #fff; color: var(--text); }
.lp-container { width: min(1200px, 100%); margin: 0 auto; }

.landing-nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px var(--page-x);
  background: rgba(6, 14, 19, .94); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.landing-links { display: flex; gap: 4px; }
.landing-links a { color: var(--ink-300); font-size: 13.5px; font-weight: 500; padding: 8px 12px; border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast); }
.landing-links a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.landing-actions { display: flex; align-items: center; gap: 10px; }
.landing-status { display: inline-flex; align-items: center; gap: 7px; font: 500 11px var(--font-mono); letter-spacing: .04em; color: var(--ink-400); margin-right: 4px; }
.landing-nav .button-outline { --btn-bg: transparent; --btn-fg: #e9f0f3; --btn-bd: rgba(255, 255, 255, .18); box-shadow: none; }
.landing-nav .button-outline:hover { --btn-bg: rgba(255, 255, 255, .07); --btn-bd: rgba(255, 255, 255, .3); }
.lp-menu-toggle { display: none; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid rgba(255, 255, 255, .16); background: transparent; color: #fff; place-items: center; }
.lp-mobile-menu { display: none; }

/* Hero: a dark field where particles fluoresce */
.lp-hero { position: relative; overflow: hidden; background: var(--ink-950); color: #fff; isolation: isolate; }
.lp-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(800px 480px at 78% 30%, rgba(255, 122, 26, .16), transparent 62%),
    radial-gradient(700px 420px at 12% 0%, rgba(61, 107, 255, .14), transparent 60%),
    linear-gradient(180deg, #08131a 0%, var(--ink-950) 100%);
}
.lp-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.lp-particles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lp-particles i { position: absolute; border-radius: 50%; background: radial-gradient(circle, #ffe2b8 0%, var(--em-500) 45%, transparent 72%); opacity: .55; animation: lp-drift 14s ease-in-out infinite; }
.lp-particles i:nth-child(1) { width: 10px; height: 8px; left: 58%; top: 9%; }
.lp-particles i:nth-child(2) { width: 6px; height: 6px; left: 76%; top: 4%; animation-delay: -3s; }
.lp-particles i:nth-child(3) { width: 12px; height: 9px; left: 96%; top: 30%; animation-delay: -6s; }
.lp-particles i:nth-child(4) { width: 5px; height: 5px; left: 3%; top: 8%; animation-delay: -9s; }
.lp-particles i:nth-child(5) { width: 8px; height: 6px; left: 92%; top: 72%; animation-delay: -2s; }
.lp-particles i:nth-child(6) { width: 6px; height: 7px; left: 58%; top: 88%; animation-delay: -11s; }
@keyframes lp-drift { 0%, 100% { transform: translate(0, 0); opacity: .45; } 50% { transform: translate(10px, -14px); opacity: .8; } }

.lp-hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(36px, 5vw, 72px); align-items: center;
  padding: clamp(56px, 7vw, 100px) var(--page-x) clamp(48px, 6vw, 80px);
  width: min(1360px, 100%); margin: 0 auto;
}
.lp-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--r-pill); background: rgba(255, 255, 255, .04);
  font-size: 12.5px; color: var(--ink-200);
}
.lp-badge b { font: 600 10.5px/1 var(--font-mono); letter-spacing: .06em; color: var(--ink-950); background: var(--em-400); padding: 4px 7px; border-radius: var(--r-pill); }
.lp-hero h1 { font: 600 clamp(38px, 4.6vw, 64px)/1.02 var(--font-sans); letter-spacing: -.045em; margin: 26px 0 22px; color: #fff; }
.lp-hero h1 em { font-style: normal; color: transparent; background: linear-gradient(92deg, var(--em-300), var(--em-500) 55%, #ff5d3a); -webkit-background-clip: text; background-clip: text; }
.lp-lead { font-size: clamp(16px, 1.35vw, 18.5px); line-height: 1.6; color: var(--ink-300); max-width: 580px; margin: 0; }
.landing-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.lp-hero-note { margin-top: 18px; font-size: 13px; color: var(--ink-400); }
.lp-hero-note a { color: var(--ink-200); text-decoration: underline; text-underline-offset: 3px; }

/* Hero product composition: device photo + live detection window */
.lp-hero-visual { position: relative; padding-bottom: 96px; }
.lp-device-card {
  position: relative; margin: 0 0 0 auto; width: min(440px, 80%);
  background: linear-gradient(180deg, #fff, #eef2f4); border-radius: var(--r-xl); padding: 26px 26px 16px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .06);
}
.lp-device-card img { display: block; width: 100%; height: auto; aspect-ratio: 735 / 798; object-fit: contain; }
.lp-device-card figcaption { display: flex; justify-content: space-between; gap: 10px; font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .06em; color: var(--ink-500); text-transform: uppercase; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 6px; }
.lp-live-window {
  position: absolute; left: 0; bottom: 0; width: min(330px, 58%);
  background: var(--ink-900); border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .4);
}
.lp-live-window .lp-field { display: block; width: 100%; height: auto; }
.lp-window-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--ink-850); border-bottom: 1px solid rgba(255, 255, 255, .06); font: 500 10.5px var(--font-mono); letter-spacing: .05em; color: var(--ink-300); }
.lp-window-bar b { margin-left: auto; color: #ffd1d1; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.lp-window-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--ink-850); border-top: 1px solid rgba(255, 255, 255, .06); }
.lp-window-stats div { padding: 9px 12px; border-right: 1px solid rgba(255, 255, 255, .06); }
.lp-window-stats div:last-child { border-right: 0; }
.lp-window-stats small { display: block; font: 500 9px/1.2 var(--font-mono); letter-spacing: .08em; color: var(--ink-400); text-transform: uppercase; }
.lp-window-stats b { font: 600 15px/1.4 var(--font-sans); color: #fff; font-variant-numeric: tabular-nums; }
.lp-illustration-tag { position: absolute; right: 10px; top: 40px; font: 500 9px var(--font-mono); letter-spacing: .1em; color: rgba(255, 255, 255, .4); text-transform: uppercase; }
.lp-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad-500); display: inline-block; flex: none; box-shadow: 0 0 0 0 rgba(229, 72, 77, .6); animation: live-ring 1.6s infinite; }
@keyframes live-ring { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 80%, 100% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } }

/* Spec strip: real device / platform facts */
.lp-specs { border-top: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .015); }
.lp-specs ul { list-style: none; margin: 0 auto; padding: 0 var(--page-x); width: min(1360px, 100%); display: grid; grid-template-columns: repeat(5, 1fr); }
.lp-specs li { padding: 22px 18px 22px 0; display: grid; gap: 4px; }
.lp-specs li + li { padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, .07); }
.lp-specs b { font: 600 clamp(20px, 2vw, 26px)/1.1 var(--font-sans); letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.lp-specs b small { font-size: .6em; font-weight: 500; color: var(--ink-300); margin-left: 2px; }
.lp-specs span { font-size: 12.5px; color: var(--ink-400); }

/* Section scaffolding */
.lp-section { padding: clamp(64px, 8.5vw, 112px) var(--page-x); }
.lp-section > .lp-inner { width: min(1200px, 100%); margin: 0 auto; }
.lp-tint { background: var(--ink-50); border-block: 1px solid var(--border); }
.lp-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.lp-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.lp-head.center .eyebrow { justify-content: center; }
.lp-section h2, .lp-cta h2 { font: 600 clamp(30px, 3.6vw, 48px)/1.08 var(--font-sans); letter-spacing: -.035em; color: var(--ink-950); margin: 16px 0 16px; }
.lp-head p, .lp-split-copy > p { color: var(--text-2); font-size: 16.5px; line-height: 1.65; margin: 0; }
.lp-section .eyebrow { color: var(--em-600); }
.lp-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }

/* Problem */
.lp-problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.lp-problem-grid article { background: #fff; padding: clamp(24px, 3vw, 36px); display: grid; gap: 10px; align-content: start; }
.lp-problem-grid .lp-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--em-100); color: var(--em-700); }
.lp-problem-grid h3 { font: 600 19px/1.3 var(--font-sans); letter-spacing: -.015em; margin: 8px 0 0; }
.lp-problem-grid p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }

/* Device + optical path */
.lp-dark { background: var(--ink-950); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.lp-dark::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(700px 400px at 85% 10%, rgba(61, 107, 255, .12), transparent 60%), radial-gradient(600px 400px at 10% 100%, rgba(255, 122, 26, .10), transparent 60%); }
.lp-dark h2 { color: #fff; }
.lp-dark .lp-split-copy > p, .lp-dark .lp-head p { color: var(--ink-300); }
.lp-dark .eyebrow { color: var(--em-300); }
.lp-optics { margin-top: clamp(40px, 5vw, 64px); background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--r-xl); padding: clamp(18px, 3vw, 32px); }
.lp-optics svg { display: block; width: 100%; height: auto; }
.lp-optics-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.lp-optics-legend div { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
.lp-optics-legend b { font-size: 14px; color: #fff; }
.lp-optics-legend span { font-size: 13px; color: var(--ink-400); line-height: 1.5; }
.lp-spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--r-lg); overflow: hidden; margin-top: 30px; }
.lp-spec-grid > div { background: var(--ink-900); padding: 16px 18px; display: grid; gap: 5px; }
.lp-spec-grid small { font: 500 10.5px var(--font-mono); letter-spacing: .08em; color: var(--em-300); }
.lp-spec-grid b { font-size: 14px; font-weight: 500; color: var(--ink-100); line-height: 1.45; }
.lp-photo-card { margin: 0; background: linear-gradient(180deg, #fff, #eef2f4); border-radius: var(--r-xl); padding: 28px 28px 14px; box-shadow: var(--shadow-lg); }
.lp-photo-card img { display: block; width: 100%; height: auto; aspect-ratio: 735 / 798; object-fit: contain; max-height: 520px; }
.lp-photo-card figcaption { font: 500 10.5px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); padding-top: 10px; border-top: 1px solid var(--border); }

/* Emission view (device section) */
.lp-emission { margin: 0; background: #050607; border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow-lg); }
.lp-emission-head { display: flex; justify-content: space-between; gap: 10px; font: 500 10.5px var(--font-mono); letter-spacing: .08em; color: var(--ink-400); margin-bottom: 16px; }
.lp-emission-head b { color: var(--em-300); font-weight: 500; letter-spacing: .02em; }
.lp-emission-field { position: relative; aspect-ratio: 1; max-width: 400px; margin: 0 auto; border-radius: 50%; overflow: hidden; background: radial-gradient(circle, #15100c 0%, #080605 70%); border: 1px solid #2a2118; box-shadow: inset 0 0 60px rgba(0, 0, 0, .8); }
.lp-emission-field i { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: calc(var(--s) * .8); transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, #ffe6b0 0%, #ff9a3c 40%, rgba(255, 122, 26, 0) 72%); animation: lp-twinkle 3.4s ease-in-out infinite; }
.lp-emission-field i:nth-child(2n) { animation-delay: -1.2s; } .lp-emission-field i:nth-child(3n) { animation-delay: -2.3s; }
@keyframes lp-twinkle { 50% { opacity: .6; } }
.lp-emission-box { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: calc(var(--s) * .82); transform: translate(-50%, -50%); border: 1.5px solid #2ec4b6; border-radius: 3px; }
.lp-emission-box em { position: absolute; left: -1.5px; bottom: 100%; margin-bottom: 3px; font: 600 9.5px var(--font-mono); font-style: normal; color: #2ec4b6; background: rgba(6, 14, 19, .85); padding: 2px 5px; border-radius: 2px; white-space: nowrap; }
.lp-reticle { position: absolute; inset: 0; background: linear-gradient(rgba(255, 255, 255, .06), rgba(255, 255, 255, .06)) center / 1px 100% no-repeat, linear-gradient(rgba(255, 255, 255, .06), rgba(255, 255, 255, .06)) center / 100% 1px no-repeat; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), inset 0 0 0 40px transparent; pointer-events: none; }
.lp-emission figcaption { font-size: 13px; color: var(--ink-400); line-height: 1.55; margin-top: 16px; text-align: center; }
.lp-emission figcaption span { display: inline-block; margin-left: 6px; font: 500 9.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500); }

/* Sample record mock (platform section) */
.lp-record { position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.lp-record-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.lp-record-head small, .lp-record-foot small { display: block; font: 500 10.5px var(--font-mono); letter-spacing: .08em; color: var(--text-3); }
.lp-record-head b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-top: 4px; }
.lp-record-qc { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px; background: var(--ink-50); border-bottom: 1px solid var(--border); }
.lp-record-qc span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--border); font-size: 12.5px; color: var(--ink-700); }
.lp-record-qc svg { width: 14px; height: 14px; fill: none; stroke: var(--ok-500); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lp-record-table th { background: #fff; position: static; }
.lp-record-table th, .lp-record-table td { padding: 11px 12px; }
.lp-record-table th:first-child, .lp-record-table td:first-child { padding-left: 22px; }
.lp-record-table th:last-child, .lp-record-table td:last-child { padding-right: 22px; }
.lp-record-table td { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lp-record-table td:first-child { font-family: var(--font-mono); color: var(--text-3); font-size: 12px; }
.lp-record-table td i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); margin-right: 8px; vertical-align: 1px; }
.lp-record-table tr:last-child td { color: var(--text-3); }
.lp-record-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; background: var(--ink-950); color: #fff; }
.lp-record-foot small { color: var(--ink-400); }
.lp-record-foot b { display: block; margin-top: 4px; font-size: 15px; letter-spacing: .06em; color: var(--em-300); }
.lp-record-files { display: flex; gap: 6px; }
.lp-record-files span { font: 500 11px var(--font-mono); padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid rgba(255, 255, 255, .16); color: var(--ink-200); }

/* Platform */
.lp-screen { background: var(--ink-900); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--ink-800); position: relative; }
.lp-feature-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 4px; }
.lp-feature-list li { display: grid; grid-template-columns: 36px 1fr; gap: 2px 14px; padding: 14px; border-radius: var(--r-md); transition: background var(--t) var(--ease); }
.lp-feature-list li:hover { background: var(--ink-50); }
.lp-feature-list .lp-icon { grid-row: span 2; width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--ink-100); color: var(--ink-800); }
.lp-feature-list li:first-child .lp-icon { background: var(--em-100); color: var(--em-700); }
.lp-feature-list b { font-size: 15px; font-weight: 600; color: var(--ink-950); }
.lp-feature-list span { font-size: 14px; color: var(--text-2); line-height: 1.55; }

/* Steps */
.lp-steps { list-style: none; padding: 0; margin: 0 auto; width: min(1200px, 100%); display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; position: relative; counter-reset: step; }
.lp-steps::before { content: ""; position: absolute; top: 20px; left: 20px; right: 8%; height: 1px; background: linear-gradient(90deg, var(--ink-300), var(--em-400)); }
.lp-steps li { position: relative; padding: 0 18px 0 0; display: grid; gap: 8px; align-content: start; }
.lp-steps span { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--border-strong); color: var(--ink-900); font: 500 13px var(--font-mono); box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.lp-steps li:nth-child(5) span { background: var(--ink-950); color: var(--em-300); border-color: var(--ink-950); }
.lp-steps b { font-size: 16px; font-weight: 600; color: var(--ink-950); }
.lp-steps small { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }

/* Comparison */
.lp-compare { width: min(1000px, 100%); margin: 0 auto; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.lp-compare-row { display: grid; grid-template-columns: .72fr 1fr 1fr; }
.lp-compare-row > * { padding: 16px 22px; border-top: 1px solid var(--border); font-size: 14.5px; line-height: 1.5; }
.lp-compare-row.head > * { border-top: 0; font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); background: var(--ink-50); padding-block: 14px; }
.lp-compare-row.head > :last-child { background: var(--ink-950); color: var(--em-300); }
.lp-compare-row b { color: var(--ink-950); font-weight: 600; }
.lp-compare-row > :nth-child(2) { color: var(--text-3); }
.lp-compare-row > :last-child { background: linear-gradient(90deg, var(--em-100), #fff7f0); color: var(--ink-900); font-weight: 500; }
.lp-compare-row:not(.head):hover > * { background-color: var(--ink-50); }
.lp-compare-row:not(.head):hover > :last-child { background: var(--em-100); }

/* Users */
.lp-users { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: min(1200px, 100%); margin: 0 auto; }
.lp-users article { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; display: grid; gap: 8px; align-content: start; transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease); }
.lp-users article:hover { border-color: var(--ink-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.lp-users .lp-icon { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--ink-100); color: var(--ink-800); margin-bottom: 8px; }
.lp-users h3 { font: 600 16.5px/1.3 var(--font-sans); color: var(--ink-950); margin: 0; letter-spacing: -.01em; }
.lp-users p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.55; }

/* Responsible science */
.lp-limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lp-limits li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 16px 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); font-size: 14.5px; color: var(--ink-700); line-height: 1.55; }
.lp-limits li svg { color: var(--ex-600); margin-top: 1px; }

/* Roadmap */
.lp-roadmap { list-style: none; padding: 0; margin: 0 auto; width: min(1200px, 100%); display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.lp-roadmap::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--ink-150); border-radius: 2px; }
.lp-roadmap li { position: relative; padding: 34px 18px 0 0; display: grid; gap: 6px; align-content: start; }
.lp-roadmap li::before { content: ""; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ink-300); box-sizing: border-box; }
.lp-roadmap li.done::before { background: var(--ok-500); border-color: var(--ok-500); box-shadow: 0 0 0 4px var(--ok-100); }
.lp-roadmap li.active::before { border-color: var(--em-500); background: radial-gradient(circle, var(--em-500) 0 3px, #fff 4px); box-shadow: 0 0 0 4px var(--em-100); }
.lp-roadmap small { font: 500 10.5px var(--font-mono); letter-spacing: .08em; color: var(--text-3); }
.lp-roadmap b { font-size: 15.5px; font-weight: 600; color: var(--ink-950); }
.lp-roadmap span { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.lp-roadmap em { font: 500 10.5px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; justify-self: start; margin-top: 6px; padding: 5px 8px; border-radius: var(--r-pill); background: var(--ink-100); color: var(--ink-600); font-style: normal; }
.lp-roadmap li.done em { background: var(--ok-100); color: var(--ok-700); }
.lp-roadmap li.active em { background: var(--em-100); color: var(--em-700); }

/* Final CTA */
.lp-cta { position: relative; overflow: hidden; isolation: isolate; background: var(--ink-950); color: #fff; padding: clamp(80px, 11vw, 140px) var(--page-x); text-align: center; }
.lp-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(600px 300px at 50% 0%, rgba(255, 122, 26, .22), transparent 70%), radial-gradient(500px 300px at 50% 100%, rgba(61, 107, 255, .14), transparent 70%); }
.lp-cta > div { width: min(760px, 100%); margin: 0 auto; }
.lp-cta .eyebrow { justify-content: center; color: var(--em-300); }
.lp-cta h2 { color: #fff; font-size: clamp(32px, 4.2vw, 56px); }
.lp-cta p { color: var(--ink-300); font-size: 17px; line-height: 1.65; margin: 0; }
.lp-cta .landing-hero-cta { justify-content: center; }
.lp-cta-mail { font-size: 14px !important; margin-top: 24px !important; color: var(--ink-400) !important; }
.lp-cta-mail a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* Footer */
.landing-footer { background: var(--ink-950); color: var(--ink-400); border-top: 1px solid rgba(255, 255, 255, .07); padding: 56px var(--page-x) 28px; font-size: 13.5px; }
.lp-footer-grid { width: min(1200px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.lp-footer-grid p { margin: 14px 0 0; max-width: 320px; line-height: 1.6; }
.lp-footer-grid h4 { font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-300); margin: 4px 0 14px; }
.lp-footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lp-footer-grid .brand { color: #fff; }
.lp-footer-grid ul a, .landing-footer .link-button { color: var(--ink-400); font-size: 13.5px; font-weight: 400; }
.lp-footer-grid ul a:hover, .landing-footer .link-button:hover { color: #fff; text-decoration: none; }
.lp-footer-base { width: min(1200px, 100%); margin: 40px auto 0; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-500); }

.lp-icon svg, .lp-limits svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Scroll reveal (only when JS has opted in; content is visible without JS) */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js-reveal [data-reveal].revealed { opacity: 1; transform: none; }
.js-reveal [data-reveal-delay="1"] { transition-delay: .08s; }
.js-reveal [data-reveal-delay="2"] { transition-delay: .16s; }
.js-reveal [data-reveal-delay="3"] { transition-delay: .24s; }

/* =============================================================================
   AUTH
   ============================================================================= */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.1fr); background: var(--surface); }
.auth-aside { position: relative; overflow: hidden; isolation: isolate; background: var(--ink-950); color: #fff; padding: clamp(28px, 4vh, 48px) clamp(28px, 4vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-aside::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(520px 380px at 80% 80%, rgba(255, 122, 26, .2), transparent 65%), radial-gradient(480px 340px at 0% 0%, rgba(61, 107, 255, .14), transparent 60%); }
.auth-aside::after { content: ""; position: absolute; width: 520px; height: 520px; right: -200px; bottom: -160px; z-index: -1; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 60px rgba(255, 255, 255, .012), inset 0 0 0 61px rgba(255, 255, 255, .05); }
.auth-message { max-width: 460px; }
.auth-message h1 { font: 600 clamp(34px, 3.6vw, 52px)/1.04 var(--font-sans); letter-spacing: -.04em; margin: 22px 0 16px; }
.auth-message h1 em { font-style: normal; color: var(--em-400); }
.auth-message p { color: var(--ink-300); font-size: 15.5px; line-height: 1.65; margin: 0; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-200); }
.auth-points svg { width: 18px; height: 18px; flex: none; color: var(--em-400); margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-aside-foot { font: 500 10.5px var(--font-mono); letter-spacing: .1em; color: var(--ink-500); text-transform: uppercase; }
.auth-aside-foot span { color: var(--em-400); padding: 0 6px; }

.auth-content { padding: 22px clamp(24px, 5vw, 72px); display: grid; grid-template-rows: auto 1fr auto; gap: 16px; background: var(--surface); }
.auth-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-3); }
.auth-service { display: inline-flex; align-items: center; gap: 8px; font: 500 11px var(--font-mono); letter-spacing: .04em; }
.auth-card { width: min(100%, 420px); margin: auto; padding: 16px 0; animation: view-in var(--t-slow) var(--ease); }
.auth-card:has(.register-form) { width: min(100%, 620px); }
.auth-card > h2 { font: 600 30px/1.15 var(--font-sans); letter-spacing: -.03em; color: var(--ink-950); margin: 10px 0 8px; }
.auth-card > p { font-size: 14.5px; color: var(--text-2); margin: 0 0 22px; line-height: 1.6; }
.portal-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: var(--r-md); margin: 0 0 20px; }
.portal-switch button { border: 0; background: transparent; color: var(--text-2); padding: 9px 10px; font-size: 13px; font-weight: 500; border-radius: var(--r-sm); transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.portal-switch button:hover { color: var(--text); }
.portal-switch button.selected { background: #fff; color: var(--ink-950); font-weight: 600; box-shadow: var(--shadow-sm); }

/* Form controls (shared) */
.auth-card form:not(.register-form) { display: grid; gap: 14px; }
.auth-card form > label, .register-form > label, .inline-form > label, .profile-form > label, .admin-filters > label, .field-row label, .map-controls label {
  display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-700);
}
.auth-card input:not([type=checkbox]):not([type=radio]), .auth-card select, .auth-card textarea,
.inline-form input:not([type=checkbox]), .inline-form select, .inline-form textarea, .profile-form input, .profile-form textarea, .profile-form select,
.admin-filters input, .admin-filters select, .field-row input:not([type=range]), .field-row select, .map-controls input, .map-controls select,
.dialog-body input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .dialog-body select, .dialog-body textarea {
  width: 100%; min-height: 40px; padding: 0 12px;
  background: #fff; color: var(--text); font-size: 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs); outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.auth-card textarea, .profile-form textarea, .inline-form textarea, .dialog-body textarea { min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6f7c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; padding-right: 34px !important; }
.auth-card input:hover, .inline-form input:hover, .profile-form input:hover, .field-row select:hover, .auth-card select:hover, .inline-form select:hover { border-color: var(--ink-300); }
.auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus,
.inline-form input:focus, .inline-form select:focus, .inline-form textarea:focus, .profile-form input:focus, .profile-form textarea:focus, .profile-form select:focus,
.admin-filters input:focus, .admin-filters select:focus, .field-row input:focus, .field-row select:focus, .map-controls input:focus, .map-controls select:focus,
.dialog-body input:focus, .dialog-body select:focus, .dialog-body textarea:focus {
  border-color: var(--ex-500); box-shadow: 0 0 0 3px rgba(61, 107, 255, .16);
}
.auth-card input:disabled, .profile-form input:disabled { background: var(--surface-2); color: var(--text-3); }
input::placeholder, textarea::placeholder { color: var(--ink-400); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink-900); width: 16px; height: 16px; }
input[type=range] { accent-color: var(--em-500); width: 100%; height: 20px; }
label small, .register-form small { font-size: 12px; font-weight: 400; color: var(--text-3); }

.form-aux { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-3); }
.back-link { display: flex; width: fit-content; margin-bottom: 18px; color: var(--text-2); font-weight: 500; }
.back-link:hover { color: var(--text); }
.inline-back { margin-bottom: 0; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font: 500 10.5px var(--font-mono); letter-spacing: .1em; margin: 22px 0 14px; }
.auth-divider span { height: 1px; background: var(--border); flex: 1; }
.admin-note { margin: 18px 0 0 !important; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2) !important; font-size: 12.5px !important; line-height: 1.55; border-radius: var(--r-sm); }
.auth-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-3); font-size: 12px; width: min(100%, 620px); margin: 0 auto; }
.form-message { min-height: 18px; margin: 0; color: var(--bad-700); font-size: 13px; line-height: 1.5; }
.form-message.success { color: var(--ok-700); }
.register-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.form-span { grid-column: 1 / -1; }
.optional { font-size: 12px; font-weight: 400; color: var(--text-3); }
.offline-api { display: block; text-align: center; color: var(--text-3); font-size: 12px; margin-top: 12px; }
.consent-row { display: flex !important; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 400 !important; color: var(--text-2) !important; }
.consent-row input { width: 16px !important; margin: 0; flex: none; }
.consent-row a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

/* =============================================================================
   WORKSPACE SHELL
   ============================================================================= */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  display: flex; flex-direction: column; padding: 18px 12px 14px;
  background: var(--ink-950); color: var(--ink-300); border-right: 1px solid rgba(255, 255, 255, .06);
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink-700) transparent;
}
.sidebar > .brand { padding: 2px 8px 0; }
[data-role="ADMIN"] .sidebar { background: linear-gradient(180deg, #0a1022 0%, var(--ink-950) 60%); }

.org-switcher-wrap { margin: 18px 4px 0; padding: 10px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .07); border-radius: var(--r-md); }
.org-switcher-label { display: block; color: var(--ink-500); margin-bottom: 8px; font-size: 10px; }
.org-switcher-row { display: flex; gap: 6px; }
.org-switcher-row select { flex: 1; min-width: 0; height: 34px; background-color: var(--ink-900); color: var(--ink-100); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r-sm); padding: 0 10px; font-size: 13px; font-weight: 500; }
.org-add-btn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, .06); color: var(--ink-100); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r-sm); font-size: 16px; transition: background var(--t-fast); }
.org-add-btn:hover { background: rgba(255, 255, 255, .12); }
.org-role-pill { display: inline-block; margin-top: 8px; font: 500 10px var(--font-mono); letter-spacing: .06em; color: var(--em-300); }

.workspace-label { margin: 22px 12px 8px; color: var(--ink-500); font-size: 10px; }
.nav-list { display: grid; gap: 1px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-300); font-size: 13.5px; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-link.active { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--em-500); box-shadow: 0 0 12px var(--em-glow); }
[data-role="ADMIN"] .nav-link.active::before { background: var(--ex-500); box-shadow: 0 0 12px rgba(61, 107, 255, .5); }
.nav-icon { display: grid; place-items: center; width: 18px; height: 18px; color: var(--ink-400); flex: none; font-size: 14px; transition: color var(--t-fast); }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover .nav-icon { color: var(--ink-200); }
.nav-link.active .nav-icon { color: var(--em-400); }
[data-role="ADMIN"] .nav-link.active .nav-icon { color: var(--ex-300); }
.nav-badge { margin-left: auto; font: 500 9.5px/1 var(--font-mono); letter-spacing: .06em; padding: 4px 6px; border-radius: var(--r-pill); background: rgba(255, 122, 26, .16); color: var(--em-300); }

.sidebar-bottom { margin-top: auto; padding-top: 16px; }
.service-mini { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-radius: var(--r-md); background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06); }
.service-mini b { display: block; font-size: 13px; color: var(--ink-100); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.service-mini small { display: block; font-size: 11.5px; color: var(--ink-500); }
.sidebar-logout { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink-400); padding: 10px; font-size: 13px; text-align: left; width: 100%; border-radius: var(--r-sm); margin-top: 6px; transition: background var(--t-fast), color var(--t-fast); }
.sidebar-logout:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar-logout span { color: var(--ink-500); }
.version { display: block; color: var(--ink-600); font: 500 9.5px var(--font-mono); letter-spacing: .1em; padding: 4px 10px 0; }
.sidebar-scrim { display: none; }

.app-shell { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.breadcrumb { display: flex; align-items: center; gap: 2px; min-width: 0; color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; }
.breadcrumb span { padding: 0 6px; color: var(--ink-300); }
.breadcrumb #crumb-org { color: var(--text-3); padding: 0; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb strong { color: var(--text); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.notif-button { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border-strong); background: #fff; border-radius: var(--r-sm); color: var(--ink-700); box-shadow: var(--shadow-xs); transition: background var(--t-fast), border-color var(--t-fast); }
.notif-button:hover { background: var(--surface-2); border-color: var(--ink-300); }
.notif-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.notif-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; background: var(--em-500); color: #1b0a00; font: 600 10px/1 var(--font-mono); border-radius: var(--r-pill); border: 2px solid #fff; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font: 500 11.5px var(--font-mono); letter-spacing: .02em; white-space: nowrap; }
.status-pill.large { padding: 8px 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-pill); box-shadow: var(--shadow-xs); }
.top-separator { width: 1px; height: 24px; background: var(--border); }
.workspace-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); font-weight: 500; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--ink-800), var(--ink-950)); color: var(--em-300); font: 600 11px var(--font-mono); letter-spacing: .02em; }
.menu-button { display: none; width: 38px; height: 38px; place-items: center; border: 1px solid var(--border-strong); background: #fff; border-radius: var(--r-sm); color: var(--ink-800); }
.menu-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

main { max-width: 1440px; margin: 0 auto; padding: 32px 36px 56px; }
main:focus { outline: none; }
.view { animation: view-in var(--t-slow) var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-intro > div:first-child { min-width: 0; max-width: 760px; }
.page-intro .eyebrow { color: var(--text-3); }
.page-intro h1 { font: 600 clamp(26px, 2.6vw, 34px)/1.12 var(--font-sans); letter-spacing: -.03em; color: var(--ink-950); margin: 10px 0 8px; }
.page-intro p { color: var(--text-2); font-size: 14.5px; margin: 0; line-height: 1.6; }
.page-intro p i { font-style: normal; color: var(--ink-300); padding: 0 4px; }
.page-intro p b { font-family: var(--font-mono); font-weight: 500; font-size: 13px; color: var(--ink-800); }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Surfaces */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font: 600 17px/1.3 var(--font-sans); letter-spacing: -.015em; margin: 4px 0 0; color: var(--ink-950); }
.panel-head h3, .panel h3 { font: 600 15px/1.35 var(--font-sans); color: var(--ink-950); }

.metric-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.admin-kpis { grid-template-columns: repeat(4, 1fr); }
.metric-card { position: relative; overflow: hidden; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.metric-card:hover { border-color: var(--ink-200); box-shadow: var(--shadow-md); }
.metric-card span { display: block; font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.metric-card b { display: block; font: 600 32px/1.1 var(--font-sans); letter-spacing: -.03em; color: var(--ink-950); margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.metric-card small { font-size: 12.5px; color: var(--text-3); }
.metric-card:first-child::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 122, 26, .16), transparent 70%); }

.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.admin-analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-panel, .settings-panel, .profile-panel { padding: 22px; }
.table-panel { margin-top: 16px; padding: 20px 20px 8px; }
.analytics-grid > .table-panel, .analytics-grid > .panel { margin-top: 0; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 14px -20px 0; padding: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
th { position: sticky; top: 0; z-index: 1; padding: 10px 14px; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td { padding: 13px 14px; font-size: 13.5px; color: var(--ink-800); border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
td code, td .mono { font-size: 12.5px; }
.table-empty { text-align: center; color: var(--text-3); padding: 36px 16px !important; font-size: 13.5px; }
td.table-empty::before, p.table-empty::before {
  content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--em-300) 0 3px, transparent 4px), radial-gradient(circle at 30% 35%, var(--ink-300) 0 2px, transparent 3px), radial-gradient(circle at 68% 66%, var(--ink-300) 0 2px, transparent 3px), var(--surface-3);
  border: 1px dashed var(--ink-200);
}

.project-cards { display: grid; gap: 10px; margin: 16px 0 12px; }
.project-mini-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); transition: border-color var(--t-fast), background var(--t-fast); }
.project-mini-card:hover { border-color: var(--ink-200); background: #fff; }
.project-mini-card b { display: block; font-size: 14px; font-weight: 600; color: var(--ink-950); }
.project-mini-card small { font-size: 12.5px; color: var(--text-3); }

.activity-list { max-height: 300px; overflow: auto; margin-top: 12px; scrollbar-width: thin; }
.activity-row { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--ink-700); }
.activity-row:last-child { border-bottom: 0; }
.activity-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); margin-top: 6px; flex: none; box-shadow: 0 0 0 3px var(--surface-3); }
.activity-row small { display: block; color: var(--text-3); font: 500 11px var(--font-mono); margin-top: 3px; letter-spacing: .02em; }

/* Forms in panels */
.inline-form, .profile-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 18px 0 4px; }
.inline-form.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.new-test-panel { padding: 22px; margin-bottom: 18px; border-color: var(--ink-200); box-shadow: var(--shadow-md); animation: view-in var(--t-slow) var(--ease); }
.admin-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: 16px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.admin-filters > label { min-width: 140px; flex: 1; }

.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); padding: 16px 0; }
.settings-row b { display: block; font-size: 14px; font-weight: 600; color: var(--ink-900); }
.settings-row span { display: block; font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.check-row { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.check-row input { width: 16px !important; min-height: auto !important; box-shadow: none !important; }
.code-box { background: var(--ink-950); color: var(--ink-200); border: 1px solid var(--ink-800); padding: 12px 14px; border-radius: var(--r-sm); font: 12px/1.6 var(--font-mono); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

.profile-identity { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 8px; }
.profile-identity h2 { font: 600 19px var(--font-sans); letter-spacing: -.015em; margin: 0; }
.profile-identity p { font-size: 13px; color: var(--text-2); margin: 2px 0 0; }
.profile-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--ink-800), var(--ink-950)); color: var(--em-300); font: 600 15px var(--font-mono); }
.verified-badge { margin-left: auto; padding: 5px 10px; border-radius: var(--r-pill); background: var(--ok-100); color: var(--ok-700); font: 500 10.5px var(--font-mono); letter-spacing: .06em; }

/* =============================================================================
   ANALYSIS · LIVE · MAP · REVIEW
   ============================================================================= */
.analysis-layout, .regional-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.live-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.upload-panel, .results-panel, .live-panel, .live-info { padding: 22px; }

.dropzone {
  position: relative; margin: 18px 0; min-height: 210px; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--ink-200); border-radius: var(--r-lg);
  background: radial-gradient(400px 200px at 50% 0%, rgba(255, 122, 26, .05), transparent 70%), var(--surface-2);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.dropzone:hover { border-color: var(--ink-300); background-color: #fff; }
.dropzone.dragging { border-color: var(--em-500); background: var(--em-100); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone strong { font-size: 15px; color: var(--ink-950); font-weight: 600; margin-top: 8px; }
.dropzone span { font-size: 13.5px; color: var(--text-2); }
.dropzone small { font-size: 12.5px; color: var(--text-3); margin-top: 6px; max-width: 360px; }
.upload-symbol { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--r-md); font-size: 20px; color: var(--em-700); background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.preview-wrap { position: relative; margin: 18px 0; min-height: 190px; display: grid; place-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--ink-950); }
.preview-wrap img { max-width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--r-sm); }
.preview-wrap .text-button { position: absolute; right: 10px; top: 10px; background: rgba(255, 255, 255, .92); color: var(--ink-800); border-radius: var(--r-sm); }
.preview-wrap .text-button:hover { background: #fff; color: var(--bad-700); }
.file-meta { font: 500 11.5px var(--font-mono); color: var(--ink-300); margin-top: 8px; }
.field-row { display: grid; gap: 7px; margin-bottom: 16px; }
.field-row label { display: flex; justify-content: space-between; align-items: baseline; }
.field-row label span { font: 500 12px var(--font-mono); color: var(--em-700); margin-left: 6px; }
.inline-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); margin: 12px 0 0; line-height: 1.5; }
.inline-note a { color: var(--link); font-weight: 600; }
.result-state { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: var(--r-pill); background: var(--surface-3); font: 500 10.5px var(--font-mono); letter-spacing: .06em; color: var(--ink-600); }
.result-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-400); display: inline-block; }
.result-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 4px; color: var(--text-2); }
.result-empty b, .result-empty strong { color: var(--ink-950); font-size: 15px; }
.empty-frame { position: relative; width: 84px; height: 64px; border-radius: var(--r-md); background: var(--ink-950); display: flex; gap: 6px; align-items: flex-end; justify-content: center; padding-bottom: 14px; margin-bottom: 14px; box-shadow: var(--shadow-md); }
.empty-frame span { width: 5px; border-radius: 3px; background: var(--em-500); height: 14px; box-shadow: 0 0 10px var(--em-glow); }
.empty-frame span:nth-child(2) { height: 26px; }
.empty-frame span:nth-child(3) { height: 18px; }
.empty-frame i { position: absolute; right: -10px; top: -10px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--border); font-style: normal; font-size: 13px; color: var(--em-700); }
.result-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-top: 14px; }
.result-details > div { padding: 12px 14px; background: #fff; }
.result-details span { display: block; font: 500 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.result-details b { display: block; font: 600 20px/1.3 var(--font-sans); letter-spacing: -.02em; color: var(--ink-950); margin-top: 4px; font-variant-numeric: tabular-nums; }
#analysis-labels { font-size: 14px; letter-spacing: 0; }
.panel-foot { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px; font-size: 12.5px; color: var(--text-3); }
.info-strip { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--ex-100); background: #f5f8ff; border-radius: var(--r-md); display: flex; gap: 10px; color: var(--ex-700); font-size: 13px; }
.info-strip p { margin: 0; color: var(--ink-700); }

.analysis-overlay { margin: 4px 0 14px; }
.analysis-overlay img { display: block; width: 100%; max-height: 480px; object-fit: contain; background: var(--ink-950); border-radius: var(--r-md); animation: view-in var(--t-slow) var(--ease); }
.analysis-overlay figcaption { font: 500 11.5px/1.5 var(--font-mono); color: var(--text-3); margin-top: 8px; }
.analysis-table { max-height: 280px; overflow: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: var(--r-md); }
.analysis-table th:first-child, .analysis-table td:first-child { padding-left: 14px; }

/* Camera / live */
.camera-stage { position: relative; height: 340px; margin: 18px 0; display: grid; place-items: center; overflow: hidden; border-radius: var(--r-lg); background: radial-gradient(circle at 50% 50%, #141110 0%, #050505 75%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04); }
.camera-stage.live-stage { height: auto; aspect-ratio: 4 / 3; max-height: 72vh; }
.camera-stage video, .camera-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.camera-stage video { object-fit: contain; }
.camera-overlay { pointer-events: none; }
.camera-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-400); text-align: center; padding: 20px; z-index: 1; }
.camera-empty b { color: #fff; font-size: 16px; font-weight: 600; }
.camera-empty span { font-size: 13.5px; }
.camera-glyph { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 50%; font-size: 0; border: 1px solid rgba(255, 255, 255, .12); background: radial-gradient(circle, rgba(255, 122, 26, .5) 0 6px, rgba(255, 122, 26, .12) 7px 18px, transparent 19px); animation: glyph-pulse 3s ease-in-out infinite; }
@keyframes glyph-pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 122, 26, .05); } }
.camera-corner { position: absolute; width: 20px; height: 20px; border-color: var(--em-400); border-style: solid; opacity: .8; z-index: 2; }
.camera-corner.tl { top: 14px; left: 14px; border-width: 2px 0 0 2px; border-top-left-radius: 6px; }
.camera-corner.tr { top: 14px; right: 14px; border-width: 2px 2px 0 0; border-top-right-radius: 6px; }
.camera-corner.bl { bottom: 14px; left: 14px; border-width: 0 0 2px 2px; border-bottom-left-radius: 6px; }
.camera-corner.br { bottom: 14px; right: 14px; border-width: 0 2px 2px 0; border-bottom-right-radius: 6px; }
.camera-tag { position: absolute; left: 44px; top: 18px; z-index: 3; display: flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: var(--r-pill); background: rgba(6, 14, 19, .72); backdrop-filter: blur(6px); font: 500 10.5px var(--font-mono); letter-spacing: .06em; color: #fff; }
.camera-tag[hidden] { display: none; }
.camera-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad-500); display: inline-block; animation: live-ring 1.6s infinite; }
.live-dot.paused { background: var(--warn-500); animation: none; }
@keyframes live-pulse { 50% { opacity: .3; } }
.live-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 4px; }
.live-controls select, .live-capture select { width: 100%; }
.live-big { display: flex; align-items: baseline; gap: 12px; margin: 16px 0 6px; }
.live-big b { font: 600 56px/1 var(--font-sans); letter-spacing: -.04em; color: var(--ink-950); font-variant-numeric: tabular-nums; }
.live-big span { font-size: 13px; color: var(--text-2); max-width: 160px; line-height: 1.4; }
.live-capture { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.live-capture h3 { margin: 6px 0 6px; font-size: 16px; }
.live-capture .muted-text { font-size: 13px; color: var(--text-2); margin: 0 0 14px; line-height: 1.55; }
.metric-list { border-top: 1px solid var(--border); margin-top: 14px; }
.metric-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--border); padding: 12px 0; font-size: 13.5px; }
.metric-list > div > span { font: 500 10.5px var(--font-mono); letter-spacing: .08em; color: var(--text-3); }
.metric-list > div > b { font-weight: 600; color: var(--ink-950); text-align: right; font-variant-numeric: tabular-nums; }
.privacy-note { margin-top: 16px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; line-height: 1.55; border-radius: var(--r-md); }

/* Map */
.map-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.map-toolbar h2, .map-toolbar b { font-size: 15px; font-weight: 600; }
.map-toolbar > div:first-child { display: grid; gap: 2px; }
.map-toolbar #map-record-count { font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.map-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.map-controls label { font: 500 10.5px var(--font-mono); letter-spacing: .06em; color: var(--text-3); gap: 4px; }
.map-controls input, .map-controls select { min-height: 34px !important; font: 400 13px var(--font-sans) !important; letter-spacing: 0; }
.map-surface { position: relative; height: clamp(380px, 58vh, 620px); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); }
#monitor-map { position: absolute; inset: 0; z-index: 1; }
.map-unavailable { position: relative; z-index: 2; text-align: center; max-width: 380px; padding: 24px; color: var(--text-2); }
.map-unavailable b, .map-unavailable strong { display: block; color: var(--ink-950); font-size: 16px; margin-bottom: 6px; }
.map-icon { font-size: 0; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: radial-gradient(circle, var(--em-500) 0 5px, rgba(255, 122, 26, .15) 6px 16px, transparent 17px), var(--surface-3); }
.map-attribution { position: absolute; right: 9px; bottom: 7px; z-index: 2; font-size: 10.5px; color: var(--text-3); background: rgba(255, 255, 255, .9); padding: 2px 6px; border-radius: var(--r-xs); }
.map-legend { display: flex; align-items: center; gap: 18px; padding: 12px 18px; background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: 12.5px; color: var(--text-2); }
.legend-title { font: 500 10.5px var(--font-mono); letter-spacing: .08em; color: var(--text-3); }
.legend-mark { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--em-500); margin-right: 6px; box-shadow: 0 0 0 3px var(--em-100); }
.legend-muted { margin-left: auto; color: var(--text-3); }
.leaflet-container { font-family: var(--font-sans) !important; }
.leaflet-popup-content-wrapper { border-radius: var(--r-md) !important; box-shadow: var(--shadow-md) !important; }

.report-options, .history-panel { padding: 22px; margin-bottom: 16px; }
.history-empty { text-align: center; padding: 18px; color: var(--text-3); font-size: 13.5px; }
.pagination, .pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 0 10px; font-size: 13px; color: var(--text-2); }
.pagination { justify-content: center; }

/* Review */
.review-viewer-stage { position: relative; margin: 16px 0; min-height: 340px; max-height: 520px; overflow: auto; display: grid; place-items: center; padding: 14px; border-radius: var(--r-lg); background: radial-gradient(circle at 50% 50%, #141110 0%, #050505 80%); }
.review-canvas-wrap { position: relative; display: inline-block; transform-origin: top left; transition: transform var(--t) var(--ease); }
.review-canvas-wrap img { display: block; max-width: 100%; height: auto; border-radius: var(--r-xs); }
#review-bbox-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.review-viewer-stage .table-empty { color: var(--ink-400); }
.review-viewer-stage .table-empty::before { background-color: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); }

/* =============================================================================
   DIALOGS · TOAST
   ============================================================================= */
.detail-dialog {
  width: min(800px, calc(100vw - 24px)); max-height: min(86vh, 860px); padding: 0;
  border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); color: var(--text);
  box-shadow: 0 40px 100px -30px rgba(6, 14, 19, .5), 0 0 0 1px rgba(6, 14, 19, .04);
}
.detail-dialog[open] { animation: dialog-in var(--t-slow) var(--ease); }
.detail-dialog::backdrop { background: rgba(6, 14, 19, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.detail-dialog[open]::backdrop { animation: fade-in var(--t) var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.dialog-header h2 { font: 600 19px/1.3 var(--font-sans); letter-spacing: -.02em; margin: 4px 0 0; }
.dialog-close { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 1px solid var(--border-strong); background: #fff; border-radius: var(--r-sm); font-size: 18px; color: var(--ink-600); transition: background var(--t-fast); }
.dialog-close:hover { background: var(--surface-3); color: var(--ink-950); }
.dialog-body { padding: 20px 22px 24px; overflow: auto; }
.dialog-body pre { white-space: pre-wrap; word-break: break-word; background: var(--ink-950); color: var(--ink-200); padding: 14px; border-radius: var(--r-md); font: 12px/1.6 var(--font-mono); }
.dialog-body form { display: grid; gap: 12px; }
.dialog-body label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-700); }
.sample-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.sample-detail-box { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface-2); }
.sample-detail-box span { display: block; font: 500 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.sample-detail-box b { font-size: 14px; color: var(--ink-950); word-break: break-word; }
.sample-actions-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.sample-actions-bar input[type=file] { font-size: 13px; }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; align-items: center; gap: 10px;
  max-width: min(440px, calc(100vw - 40px)); padding: 12px 16px 12px 14px;
  background: var(--ink-950); color: #fff; border-radius: var(--r-md); border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 18px 40px -12px rgba(6, 14, 19, .5); font-size: 13.5px; line-height: 1.45;
  opacity: 0; transform: translateY(10px) scale(.98); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); pointer-events: none;
}
.toast::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ok-500); box-shadow: 0 0 0 4px rgba(18, 161, 116, .2); }
.toast.show { opacity: 1; transform: none; }
.toast-error::before { background: var(--bad-500); box-shadow: 0 0 0 4px rgba(229, 72, 77, .22); }

/* Misc legacy */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.plan-card { border: 1px solid var(--border); background: #fff; border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; justify-content: space-between; }
.hero-note, .map-caption { font-size: 12.5px; color: var(--text-3); }
.empty-illustration { color: var(--ink-300); }
.remember { font: 500 11px var(--font-mono); letter-spacing: .02em; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 1200px) {
  .lp-specs ul { grid-template-columns: repeat(3, 1fr); }
  .lp-specs li:nth-child(4) { padding-left: 0; border-left: 0; }
  .lp-specs li:nth-child(n+4) { border-top: 1px solid rgba(255, 255, 255, .07); }
  .lp-steps, .lp-roadmap { grid-template-columns: repeat(3, 1fr); row-gap: 36px; }
  .lp-steps::before, .lp-roadmap::before { display: none; }
  .metric-cards, .admin-kpis { grid-template-columns: repeat(2, 1fr); }
  .live-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .landing-links, .landing-status, .landing-actions .button-outline { display: none; }
  .lp-menu-toggle { display: grid; }
  .lp-mobile-menu { display: grid; gap: 2px; position: fixed; top: 64px; left: 12px; right: 12px; z-index: 29; padding: 10px; background: var(--ink-900); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: dialog-in var(--t) var(--ease); }
  .lp-mobile-menu[hidden] { display: none !important; }
  .lp-mobile-menu a, .lp-mobile-menu button { display: block; padding: 12px 14px; border-radius: var(--r-sm); color: var(--ink-100); font-size: 15px; text-align: left; background: none; border: 0; }
  .lp-mobile-menu a:hover, .lp-mobile-menu button:hover { background: rgba(255, 255, 255, .06); }
  .lp-hero-inner, .lp-split { grid-template-columns: 1fr; }
  .lp-hero-visual { min-height: 0; max-width: 560px; margin: 0 auto; width: 100%; padding-bottom: 120px; }
  .lp-device-card { width: 78%; }
  .lp-live-window { width: 70%; }
  .lp-problem-grid, .lp-users { grid-template-columns: 1fr 1fr; }
  .lp-optics-legend { grid-template-columns: 1fr 1fr; }
  .lp-footer-grid { grid-template-columns: 1fr 1fr; }
  .lp-footer-grid > :first-child { grid-column: 1 / -1; }

  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { padding: 22px 24px; }
  .auth-message, .auth-aside-foot, .auth-points { display: none; }

  .sidebar { transform: translateX(-100%); transition: transform var(--t) var(--ease); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar.open ~ .sidebar-scrim, body:has(.sidebar.open) .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(6, 14, 19, .45); backdrop-filter: blur(2px); }
  .app-shell { margin-left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 0 16px; }
  main { padding: 22px 16px 48px; }
  .analytics-grid, .admin-analytics-grid, .analysis-layout, .regional-grid { grid-template-columns: 1fr; }
  .top-separator, .topbar .status-pill, #top-user-name { display: none; }
}
@media (max-width: 600px) {
  .lp-hero h1 { letter-spacing: -.035em; }
  .lp-specs ul { grid-template-columns: 1fr 1fr; }
  .lp-specs li { padding-left: 0 !important; border-left: 0 !important; border-top: 1px solid rgba(255, 255, 255, .07); }
  .lp-specs li:nth-child(-n+2) { border-top: 0; }
  .lp-specs li:nth-child(even) { padding-left: 16px !important; border-left: 1px solid rgba(255, 255, 255, .07) !important; }
  .lp-problem-grid, .lp-users, .lp-steps, .lp-roadmap, .lp-optics-legend, .lp-spec-grid { grid-template-columns: 1fr; }
  .lp-compare-row { grid-template-columns: 1fr; }
  .lp-compare-row.head { display: none; }
  .lp-compare-row > :first-child { background: var(--ink-50); padding-bottom: 8px; font-size: 13px; }
  .lp-compare-row > :nth-child(2) { border-top: 0; padding-top: 4px; }
  .lp-compare-row > :nth-child(2)::before { content: "Conventional lab · "; font-weight: 600; color: var(--text-3); }
  .lp-compare-row > :last-child::before { content: "OptiSense · "; font-weight: 600; }
  .lp-footer-grid { grid-template-columns: 1fr; }
  .lp-hero-visual { padding-bottom: 96px; }
  .lp-live-window { width: 84%; }
  .lp-device-card { width: 82%; padding: 16px 16px 10px; }
  .landing-hero-cta .button { flex: 1 1 100%; }

  .metric-cards, .admin-kpis, .inline-form, .inline-form.compact, .profile-form, .register-form, .sample-detail-grid, .live-controls, .result-details { grid-template-columns: 1fr; }
  .result-details > div { border: 0; }
  .metric-card b { font-size: 28px; }
  .page-intro { align-items: stretch; }
  .quick-actions .button { flex: 1 1 auto; }
  .workspace-chip .avatar { width: 32px; height: 32px; }
  .breadcrumb > :not(strong):not(#crumb) { display: none; }
  .detail-dialog { width: calc(100vw - 16px); max-height: 92vh; border-radius: var(--r-lg); }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .table-scroll { margin-inline: -20px; }
  .map-legend { flex-wrap: wrap; }
  .legend-muted { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
}

/* Grid/flex children must be allowed to shrink so wide tables scroll inside their panel */
:where(#main *) { min-width: 0; }
.panel, .table-panel { max-width: 100%; }
:where(#main) :is(select, input, textarea) { max-width: 100%; }
.quick-actions > select { flex: 1 1 220px; min-width: 0; }
@media (max-width: 600px) {
  .quick-actions { width: 100%; }
  .quick-actions > .button, .quick-actions > button { flex: 1 1 auto; }
  .panel-head { flex-wrap: wrap; }
}
/* Any standalone select in the workspace (e.g. review toolbar) gets the shared control look */
:where(#main) select {
  min-height: 40px; padding-left: 12px; background-color: #fff; color: var(--text); font-size: 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); box-shadow: var(--shadow-xs);
}
:where(#main) select:focus-visible { border-color: var(--ex-500); box-shadow: 0 0 0 3px rgba(61, 107, 255, .18); outline: none; }
.eyebrow { flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 600px) {
  table:has(td.table-empty) thead { display: none; }
}
@media (max-width: 760px) {
  .lp-optics-track { overflow-x: auto; margin: 0 calc(-1 * clamp(18px, 3vw, 32px)); padding: 0 clamp(18px, 3vw, 32px) 8px; scrollbar-width: thin; }
  .lp-optics-track svg { width: 780px; max-width: none; }
  .lp-record-table th:first-child, .lp-record-table td:first-child { display: none; }
  .lp-record-table th:nth-child(2), .lp-record-table td:nth-child(2) { padding-left: 16px; }
  .lp-record-table th:last-child, .lp-record-table td:last-child { padding-right: 16px; }
  .lp-record-table th, .lp-record-table td { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
  .lp-record-head, .lp-record-qc, .lp-record-foot { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 359px) {
  .landing-actions .button-accent { display: none; }
  .landing-nav .brand small { display: none; }
}
