/* AI Inventory Vision — ThirdEye Data | VISUS
   All assets are served locally (offline-safe). */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('../assets/fonts/inter-latin-800-normal.woff2') format('woff2'); }

:root {
  --brand: #3AAA4B;          /* VISUS green */
  --brand-600: #2E9442;
  --brand-700: #227A38;
  --brand-50: #EEF8EF;
  --brand-100: #D8F0DB;
  --teal: #12554C;           /* ThirdEye teal */
  --teal-600: #0E463F;
  --teal-50: #E7F1EF;
  --charcoal: #15191C;
  --charcoal-2: #1E2428;
  --charcoal-3: #2A3136;
  --ink: #16202A;
  --ink-2: #3B4752;
  --muted: #66727D;
  --muted-2: #8C969F;
  --line: #E3E8EB;
  --line-2: #D3DADF;
  --silver: #C7CED3;
  --bg: #F3F5F4;
  --surface: #FFFFFF;
  --surface-2: #F8FAF9;
  --amber: #D98A00;
  --amber-50: #FFF6E3;
  --red: #C8413B;
  --red-50: #FDEDEC;
  --blue: #2F6FB3;           /* manual additions only */
  --blue-50: #EAF2FB;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 32, .06), 0 1px 1px rgba(16, 24, 32, .04);
  --shadow: 0 1px 3px rgba(16, 24, 32, .06), 0 8px 24px -8px rgba(16, 24, 32, .12);
  --shadow-lg: 0 24px 60px -20px rgba(10, 20, 25, .35);
  --sidebar-w: 268px;
  --topbar-h: 68px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, color .15s; }
.btn:hover { border-color: var(--silver); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(180deg, #3FB451, var(--brand-600)); border-color: var(--brand-700); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 14px -6px rgba(46,148,66,.6); }
.btn.primary:hover { background: linear-gradient(180deg, #38A849, var(--brand-700)); }
.btn.dark { background: var(--charcoal-2); color: #fff; border-color: var(--charcoal); }
.btn.dark:hover { background: var(--charcoal-3); }
.btn.teal { background: var(--teal); color: #fff; border-color: var(--teal-600); }
.btn.teal:hover { background: var(--teal-600); }
.btn.danger { color: var(--red); border-color: #EFC8C6; background: #fff; }
.btn.danger:hover { background: var(--red-50); }
.btn.warn { color: #9A6100; border-color: #F0D9A8; background: #fff; }
.btn.warn:hover { background: var(--amber-50); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Chips / badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; background: #EEF1F3; color: var(--ink-2); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--brand-50); color: var(--brand-700); }
.badge.teal { background: var(--teal-50); color: var(--teal); }
.badge.amber { background: var(--amber-50); color: #9A6100; }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.dark { background: var(--charcoal-2); color: #fff; }
.badge.outline { background: transparent; border: 1px solid var(--line-2); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--brand-700); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); background: var(--charcoal); }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.login-hero::before { content: ''; position: absolute; inset: 0; background: url('../assets/img/indoor-warehouse.webp') center / cover no-repeat; opacity: .5; transform: scale(1.04); }
.login-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(12,16,18,.96) 0%, rgba(12,16,18,.78) 45%, rgba(18,85,76,.55) 100%); }
.login-hero > * { position: relative; z-index: 1; }
.login-hero h1 { font-size: 44px; line-height: 1.08; letter-spacing: -.025em; margin: 14px 0 14px; font-weight: 800; max-width: 620px; }
.login-hero p.lead { font-size: 17px; color: #CFD8DC; max-width: 560px; margin: 0; }
.flow-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.flow-strip span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #E6EEF0; backdrop-filter: blur(4px); }
.flow-strip span b { color: var(--brand); font-weight: 800; }
.login-hero .foot { font-size: 12.5px; color: #9FB0B6; display: flex; gap: 18px; flex-wrap: wrap; }
.login-panel { background: var(--surface); display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; }
.brand-pair { display: flex; align-items: center; gap: 18px; }
.brand-pair .te { height: 34px; width: auto; }
.brand-pair .vs { height: 50px; width: auto; }
.brand-pair .sep { width: 1px; height: 34px; background: var(--line-2); }
.login-panel h2 { font-size: 26px; letter-spacing: -.015em; margin: 34px 0 6px; }
.login-panel .sub { color: var(--muted); margin: 0 0 24px; }
.role-cards { display: grid; gap: 12px; margin-bottom: 18px; }
.role-card { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; transition: border-color .15s, box-shadow .15s, background .15s; }
.role-card:hover { border-color: var(--brand); box-shadow: 0 8px 24px -14px rgba(46,148,66,.55); }
.role-card.active { border-color: var(--brand); background: var(--brand-50); }
.role-card .av { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--teal), var(--brand-600)); }
.role-card.rev .av { background: linear-gradient(135deg, var(--charcoal-3), var(--teal)); }
.role-card strong { display: block; font-size: 15px; }
.role-card small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(58,170,75,.16); }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin: -4px 0 10px; }
.cred-hint { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); }
.cred-hint code { font-family: var(--mono); color: var(--ink); background: #fff; border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

/* ---------- App shell ---------- */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: linear-gradient(180deg, var(--charcoal) 0%, #111517 100%); color: #D5DDE1; display: flex; flex-direction: column; z-index: 40; transition: transform .25s var(--ease); }
.sb-brand { padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.product { display: flex; gap: 12px; align-items: center; }
.product .mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand) 0%, var(--teal) 100%); color: #fff; box-shadow: 0 8px 18px -8px rgba(58,170,75,.7); }
.product .mark svg { width: 22px; height: 22px; }
.product strong { display: block; color: #fff; font-size: 15.5px; letter-spacing: -.01em; }
.product small { display: block; font-size: 11.5px; color: #8FA0A7; line-height: 1.35; }
.nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; }
.nav-group { margin-top: 14px; }
.nav-group > span { display: block; padding: 0 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6F8087; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: #C3CDD2; text-decoration: none; font-weight: 500; font-size: 14px; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(58,170,75,.22), rgba(58,170,75,.06)); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.nav a .count.amber { background: var(--amber); }
.sb-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); display: grid; gap: 8px; }
.env-pill { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); font-size: 12.5px; color: #A8B6BC; }
.env-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(58,170,75,.18); }
.sb-foot .btn { background: transparent; color: #D5DDE1; border-color: rgba(255,255,255,.12); }
.sb-foot .btn:hover { background: rgba(255,255,255,.06); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 26px; }
.topbar .brand-pair .te { height: 26px; }
.topbar .brand-pair .vs { height: 38px; }
.topbar .brand-pair .sep { height: 28px; }
.topbar .spacer { flex: 1; }
.topbar .page-crumb { min-width: 0; }
.page-crumb small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.page-crumb strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.user-chip:hover { border-color: var(--line-2); }
.user-chip .av { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--teal), var(--brand-600)); }
.user-chip.rev .av { background: linear-gradient(135deg, var(--charcoal-3), var(--teal)); }
.user-chip b { display: block; font-size: 13px; line-height: 1.2; }
.user-chip small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2; }

.content { padding: 26px 28px 60px; max-width: 1560px; width: 100%; margin: 0 auto; }
.view-enter { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; letter-spacing: -.022em; line-height: 1.15; margin: 6px 0 6px; font-weight: 800; }
.page-head p { margin: 0; color: var(--muted); max-width: 760px; }

/* ---------- Cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 15.5px; letter-spacing: -.005em; }
.card-h .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-b { padding: 18px 20px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.split.wide-r { grid-template-columns: minmax(0, 1fr) 420px; }
.mt { margin-top: 18px; }
.mt-s { margin-top: 10px; }
.stack { display: grid; gap: 18px; }

/* KPI */
.kpi { padding: 18px 18px 16px; position: relative; overflow: hidden; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.kpi .ico.teal { background: var(--teal-50); color: var(--teal); }
.kpi .ico.amber { background: var(--amber-50); color: #9A6100; }
.kpi .ico.red { background: var(--red-50); color: var(--red); }
.kpi .ico.dark { background: #EEF1F3; color: var(--charcoal-3); }
.kpi .val { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 8px; line-height: 1.1; }
.kpi .val small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi .foot { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Overview hero ---------- */
.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; color: #fff; min-height: 360px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); background: var(--charcoal); box-shadow: var(--shadow); }
.hero .copy { padding: 36px 36px 30px; position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; }
.hero h1 { font-size: 36px; line-height: 1.1; letter-spacing: -.028em; margin: 10px 0 12px; font-weight: 800; }
.hero p { color: #C9D3D7; font-size: 15.5px; margin: 0 0 22px; max-width: 560px; }
.hero .visual { position: relative; min-height: 280px; }
.hero .visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .visual::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 48px; z-index: 1; background: linear-gradient(90deg, var(--charcoal), rgba(21,25,28,0)); pointer-events: none; }
.hero .visual .tagbox { position: absolute; z-index: 2; border: 2px solid var(--brand); border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.hero .visual .tagbox span { position: absolute; top: -22px; left: -2px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px 4px 4px 0; white-space: nowrap; }
.hero .eyebrow { color: #7FD58B; }
.pipeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.pipe-step { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; position: relative; box-shadow: var(--shadow-sm); }
.pipe-step .n { font-size: 11.5px; font-weight: 800; color: var(--brand-700); letter-spacing: .08em; }
.pipe-step strong { display: block; font-size: 14.5px; letter-spacing: .04em; margin: 6px 0 4px; }
.pipe-step p { margin: 0; font-size: 12.8px; color: var(--muted); line-height: 1.45; }
.pipe-step .i { color: var(--teal); }
.pipe-step:not(:last-child)::after { content: ''; position: absolute; right: -8px; top: 50%; width: 6px; height: 6px; border-top: 2px solid var(--silver); border-right: 2px solid var(--silver); transform: translateY(-50%) rotate(45deg); }

.scn-card { overflow: hidden; display: flex; flex-direction: column; }
.scn-card .img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #222; }
.scn-card .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.scn-card:hover .img img { transform: scale(1.03); }
.scn-card .img .badge { position: absolute; left: 12px; top: 12px; }
.scn-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.scn-card h3 { margin: 0; font-size: 16px; }
.scn-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .ico { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); }
.feature h4 { margin: 2px 0 4px; font-size: 14.5px; }
.feature p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.8px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .12s; }
table.t tbody tr.clickable { cursor: pointer; }
table.t tbody tr.clickable:hover { background: #F7FAF8; }
.cell-img { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cell-img img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
.cell-img b { display: block; font-size: 13.8px; }
.cell-img small { display: block; color: var(--muted); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.empty { text-align: center; padding: 38px 18px; color: var(--muted); }
.empty .i { width: 34px; height: 34px; color: var(--silver); margin: 0 auto 8px; }

/* ---------- Stepper ---------- */
.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: left; min-width: 0; }
.step .n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; background: #EEF1F3; color: var(--muted); }
.step span { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.done .n { background: var(--brand-100); color: var(--brand-700); }
.step.done span { color: var(--ink-2); }
.step.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(58,170,75,.12); }
.step.active .n { background: var(--brand); color: #fff; }
.step.active span { color: var(--ink); }
.step:disabled { cursor: not-allowed; opacity: .75; }
.wizard-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* Form grid */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .field { margin: 0; }

/* Choice tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { text-align: left; padding: 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); display: flex; gap: 12px; align-items: flex-start; transition: border-color .15s, box-shadow .15s, background .15s; min-width: 0; }
.tile:hover { border-color: var(--silver); }
.tile.active { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(58,170,75,.1); }
.tile .ico { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: #EEF3F1; color: var(--teal); }
.tile.active .ico { background: var(--brand); color: #fff; }
.tile strong { display: block; font-size: 14.5px; }
.tile small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.tile .sim { margin-top: 8px; }
.scn-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.scn-opt { border: 2px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); text-align: left; padding: 0; transition: border-color .15s, box-shadow .15s; }
.scn-opt.active { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(58,170,75,.12); }
.scn-opt img { width: 100%; aspect-ratio: 16/8; object-fit: cover; }
.scn-opt div { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.scn-opt strong { font-size: 14.5px; }
.scn-opt small { color: var(--muted); display: block; font-size: 12.5px; }
.upload-note { margin-top: 12px; }

/* ---------- Quality ---------- */
.q-overall { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 14px; background: linear-gradient(135deg, var(--amber-50), #fff); border: 1px solid #F2E0B8; }
.q-overall.good { background: linear-gradient(135deg, var(--brand-50), #fff); border-color: var(--brand-100); }
.q-overall .ring { width: 56px; height: 56px; flex: none; }
.q-overall strong { font-size: 18px; display: block; letter-spacing: .02em; }
.q-list { display: grid; gap: 10px; margin-top: 14px; }
.q-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 190px; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.q-row b { font-size: 13.8px; }
.q-row small { display: block; font-size: 12.5px; color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: #EDF0F2; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); width: 0; transition: width .9s var(--ease); }
.bar > i.amber { background: var(--amber); }
.bar > i.red { background: var(--red); }
.bar > i.teal { background: var(--teal); }
.qstate { justify-self: end; }
.recap { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: var(--charcoal-2); color: #E5ECEF; }
.recap .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(58,170,75,.18); color: #7FD58B; flex: none; }
.recap strong { display: block; color: #fff; }
.recap p { margin: 4px 0 12px; font-size: 13.5px; color: #B8C5CA; }
.probe { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.probe img { width: 100%; max-height: 300px; object-fit: contain; background: #0D1113; border-radius: 10px; border: 1px solid var(--line); }
.kv { display: grid; gap: 8px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.kv div:last-child { border-bottom: 0; padding-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; }

/* ---------- Analysis ---------- */
.analysis-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.pipe-list { display: grid; gap: 6px; }
.pl { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); transition: all .25s; }
.pl .st { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #EEF1F3; color: var(--muted-2); flex: none; font-size: 12px; font-weight: 800; }
.pl b { font-size: 13.8px; }
.pl small { display: block; color: var(--muted); font-size: 12px; }
.pl.run { border-color: var(--brand); background: var(--brand-50); }
.pl.run .st { background: transparent; border: 2.5px solid var(--brand-100); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.pl.done .st { background: var(--brand); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.rk { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.rk small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.rk b { display: block; font-size: 22px; letter-spacing: -.02em; margin-top: 2px; }
.rk b.amber { color: #9A6100; }
.rk b.green { color: var(--brand-700); }
.info-list { display: grid; gap: 0; }
.info-list div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.info-list div:last-child { border-bottom: 0; }
.info-list span { color: var(--muted); }
.info-list b { text-align: right; font-weight: 600; }

/* ---------- Viewer ---------- */
.viewer { position: relative; background: #0D1113; border-radius: var(--radius); overflow: hidden; user-select: none; -webkit-user-select: none; border: 1px solid #0A0D0F; box-shadow: var(--shadow); }
.viewer .v-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #161C1F; border-bottom: 1px solid #0A0D0F; flex-wrap: wrap; }
.v-toolbar .grp { display: flex; gap: 4px; align-items: center; padding-right: 6px; margin-right: 0; border-right: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.v-toolbar .grp:last-child { border-right: 0; }
.vbtn { height: 32px; min-width: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: #D8E0E3; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 600; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.vbtn:hover { background: rgba(255,255,255,.1); color: #fff; }
.vbtn.on { background: rgba(58,170,75,.2); border-color: rgba(58,170,75,.55); color: #CFF3D4; }
.vbtn.draw.on { background: rgba(47,111,179,.3); border-color: rgba(96,160,230,.7); color: #DDEBFA; }
.vbtn svg.i { width: 16px; height: 16px; }
.zoom-lbl { font-size: 12px; color: #9FB0B6; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.v-stage { position: relative; overflow: hidden; touch-action: none; cursor: grab; background: repeating-conic-gradient(#0F1416 0% 25%, #121819 0% 50%) 50% / 24px 24px; }
.v-stage.panning { cursor: grabbing; }
.v-stage.drawing { cursor: crosshair; }
.v-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.v-canvas img { width: 100%; height: 100%; display: block; pointer-events: none; }
.v-canvas svg.ov { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.v-canvas svg.ov.clip-cmp { }
.ov .d { cursor: pointer; }
.ov .d .shape { fill: rgba(58,170,75,.10); stroke: #43D05A; stroke-width: var(--sw, 2px); vector-effect: non-scaling-stroke; transition: fill .15s, stroke .15s; }
.ov .d.review .shape { fill: rgba(245,166,35,.12); stroke: #F5A623; stroke-dasharray: 6 4; }
.ov .d.uncertain .shape { fill: rgba(245,166,35,.12); stroke: #F5C06A; stroke-dasharray: 2 3; }
.ov .d.rejected .shape { fill: rgba(200,65,59,.12); stroke: #FF6B64; stroke-dasharray: 5 4; }
.ov .d.excluded .shape { fill: rgba(140,150,160,.22); stroke: #A7B1B8; stroke-dasharray: 3 4; }
.ov .d.excluded.person .shape { fill: rgba(30,36,40,.72); stroke: #A7B1B8; }
.ov .d.manual .shape { fill: rgba(47,111,179,.16); stroke: #6FB2FF; }
.ov .d.accepted .shape { stroke: #43D05A; stroke-dasharray: none; }
.ov .d:hover .shape { fill: rgba(255,255,255,.14); }
.ov .d.sel .shape { stroke: #fff; stroke-width: var(--sw3, 3px); fill: rgba(255,255,255,.12); }
.ov .d .lbl-bg { fill: #2EA043; }
.ov .d.review .lbl-bg, .ov .d.uncertain .lbl-bg { fill: #C98200; }
.ov .d.rejected .lbl-bg { fill: #B8352F; }
.ov .d.excluded .lbl-bg { fill: #5C666D; }
.ov .d.manual .lbl-bg { fill: #2F6FB3; }
.ov .d.sel .lbl-bg { fill: #fff; }
.ov .d .lbl-tx { fill: #fff; font-family: var(--font); font-weight: 700; pointer-events: none; }
.ov .d.sel .lbl-tx { fill: #111; }
.ov .d.pop { animation: pop .38s var(--ease) both; }
@keyframes pop { from { opacity: 0; } to { opacity: 1; } }
.ov .draft { fill: rgba(47,111,179,.2); stroke: #8BC2FF; stroke-width: var(--sw, 2px); vector-effect: non-scaling-stroke; stroke-dasharray: 4 3; }
.ov .roi-hint { fill: none; stroke: rgba(111,178,255,.8); stroke-width: var(--sw, 2px); vector-effect: non-scaling-stroke; stroke-dasharray: 2 5; }
.scanline { position: absolute; left: 0; right: 0; height: 90px; top: -90px; background: linear-gradient(180deg, rgba(58,170,75,0), rgba(58,170,75,.28) 80%, rgba(170,255,180,.9) 100%); pointer-events: none; z-index: 3; opacity: 0; }
.scanning .scanline { opacity: 1; animation: scan 1.6s linear infinite; }
@keyframes scan { from { top: -90px; } to { top: 100%; } }
.scan-grid { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0; background-image: linear-gradient(rgba(58,170,75,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(58,170,75,.16) 1px, transparent 1px); background-size: 48px 48px; transition: opacity .4s; }
.scanning .scan-grid { opacity: 1; }
.cmp-handle { position: absolute; top: 0; bottom: 0; width: 0; z-index: 5; pointer-events: none; }
.cmp-handle::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.cmp-handle span { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.4); pointer-events: auto; cursor: ew-resize; }
.cmp-tags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; z-index: 4; pointer-events: none; }
.cmp-tags span { background: rgba(0,0,0,.6); color: #fff; font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 6px; letter-spacing: .04em; }
.v-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 12px; background: #161C1F; border-top: 1px solid #0A0D0F; color: #A8B6BC; font-size: 12px; }
.v-legend span { display: inline-flex; align-items: center; gap: 6px; }
.v-legend i { width: 14px; height: 10px; border-radius: 2px; border: 2px solid; display: inline-block; }
.v-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 6; background: rgba(47,111,179,.92); color: #fff; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.35); white-space: nowrap; }
.viewer:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.viewer:fullscreen .v-stage { flex: 1; height: auto !important; }
.viewer.pseudo-fs { position: fixed; inset: 0; z-index: 200; border-radius: 0; display: flex; flex-direction: column; }
.viewer.pseudo-fs .v-stage { flex: 1; height: auto !important; }

/* Detection side panel */
.det-panel .filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chip { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--charcoal-2); color: #fff; border-color: var(--charcoal-2); }
.chip b { font-weight: 800; }
.det-list { max-height: 460px; overflow-y: auto; }
.det-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.det-item:hover { background: #F7FAF8; }
.det-item.sel { background: var(--brand-50); }
.det-item .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.det-item.review .sw, .det-item.uncertain .sw { background: var(--amber); }
.det-item.rejected .sw { background: var(--red); }
.det-item.excluded .sw { background: var(--muted-2); }
.det-item.manual .sw { background: var(--blue); }
.det-item b { font-size: 13.5px; display: block; }
.det-item small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.det-item .cf { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.det-detail { padding: 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #FBFCFB, #fff); }
.det-detail h4 { margin: 0 0 2px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.det-detail .reason { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--amber-50); color: #7A4F00; font-size: 13px; }
.det-detail .acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.det-detail .acts .btn { padding: 0 8px; }
.conf-bar { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; font-size: 13px; }
.conf-bar .bar { flex: 1; }

/* Count summary */
.count-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.count-sum > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.count-sum > div:last-child { border-right: 0; background: linear-gradient(135deg, var(--brand-50), #fff); }
.count-sum small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.count-sum b { display: block; font-size: 30px; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.count-sum b.adj-pos { color: var(--blue); }
.count-sum b.adj-neg { color: var(--red); }
.count-sum > div:last-child b { color: var(--brand-700); }
.count-sum em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.unit-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* Audit timeline */
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 54px 16px minmax(0, 1fr); gap: 10px; padding: 8px 0; position: relative; font-size: 13.5px; }
.tl time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; padding-top: 1px; text-align: right; }
.tl .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 5px; position: relative; z-index: 1; box-shadow: 0 0 0 3px #fff; }
.tl:not(:last-child)::after { content: ''; position: absolute; left: 68px; top: 20px; bottom: -6px; width: 2px; background: var(--line); }
.tl.amber .dot { background: var(--amber); }
.tl.red .dot { background: var(--red); }
.tl.blue .dot { background: var(--blue); }
.tl.teal .dot { background: var(--teal); }
.tl b { font-weight: 600; }
.tl small { display: block; color: var(--muted); font-size: 12px; }
.checklist { display: grid; gap: 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s; }
.check:hover { border-color: var(--line-2); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand-600); flex: none; }
.check b { font-size: 13.5px; display: block; }
.check small { display: block; color: var(--muted); font-size: 12.5px; }
.check.on { border-color: var(--brand-100); background: var(--brand-50); }
.decision { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.status-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; font-size: 13.8px; }
.status-banner.green { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.status-banner.amber { background: var(--amber-50); color: #7A4F00; border: 1px solid #F2E0B8; }
.status-banner.red { background: var(--red-50); color: var(--red); border: 1px solid #F3CFCD; }
.status-banner.teal { background: var(--teal-50); color: var(--teal); border: 1px solid #CFE3DF; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11.5px; }
.chart .grid-l { stroke: #EDF0F2; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.cam-list { display: grid; gap: 10px; }
.cam { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.cam img { width: 88px; height: 58px; object-fit: cover; border-radius: 8px; }
.cam b { display: block; font-size: 14px; }
.cam small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- Architecture ---------- */
.arch { display: grid; gap: 10px; }
.arch-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.arch-row > .tag { display: flex; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.arch-boxes { display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.abox { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: flex; gap: 10px; align-items: flex-start; transition: border-color .15s, box-shadow .15s, transform .15s; text-align: left; }
.abox:hover { border-color: var(--brand); box-shadow: 0 10px 24px -16px rgba(18,85,76,.6); transform: translateY(-1px); }
.abox .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); flex: none; }
.abox b { display: block; font-size: 13.8px; }
.abox small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.abox.core { background: linear-gradient(135deg, #0F2A26, var(--teal)); border-color: var(--teal-600); color: #fff; }
.abox.core .ico { background: rgba(255,255,255,.12); color: #9FE3A9; }
.abox.core small { color: #BFD6D2; }
.abox.human { background: var(--brand-50); border-color: var(--brand-100); }
.abox.human .ico { background: var(--brand); color: #fff; }
.arch-arrow { display: flex; justify-content: center; color: var(--silver); height: 14px; }
.arch-arrow svg { width: 18px; height: 14px; }
.flow-v { display: grid; gap: 0; justify-items: center; }
.flow-node { width: min(520px, 100%); padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-sm); }
.flow-node .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); flex: none; }
.flow-node b { display: block; font-size: 14.5px; }
.flow-node small { display: block; font-size: 12.8px; color: var(--muted); }
.flow-node.hl { background: linear-gradient(135deg, #0F2A26, var(--teal)); color: #fff; border-color: var(--teal-600); }
.flow-node.hl small { color: #BFD6D2; }
.flow-node.hl .ico { background: rgba(255,255,255,.12); color: #9FE3A9; }
.flow-node.human { background: var(--brand-50); border-color: var(--brand-100); }
.flow-node.sim { border-style: dashed; }
.flow-conn { width: 2px; height: 22px; background: linear-gradient(var(--silver), var(--silver)); position: relative; }
.flow-conn::after { content: ''; position: absolute; bottom: -1px; left: 50%; width: 8px; height: 8px; border-right: 2px solid var(--silver); border-bottom: 2px solid var(--silver); transform: translateX(-50%) rotate(45deg); }
.deploy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.deploy .card { padding: 16px; }
.deploy h4 { margin: 10px 0 4px; font-size: 14.5px; }
.deploy p { margin: 0; color: var(--muted); font-size: 13px; }

/* Roadmap */
.roadmap { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; position: relative; }
.rm { padding: 16px; position: relative; }
.rm .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--teal), var(--brand-600)); }
.rm h4 { margin: 12px 0 8px; font-size: 15px; }
.rm ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }
.rm .out { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.callout { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: var(--teal-50); border: 1px solid #CFE3DF; color: var(--teal-600); font-size: 13.8px; }
.callout .i { color: var(--teal); margin-top: 2px; }
.callout b { color: var(--teal); }
.callout.soft { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
ul.clean { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.8px; color: var(--ink-2); }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 300; background: rgba(10,14,16,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-bg.open { opacity: 1; pointer-events: auto; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .25s var(--ease); }
.modal.wide { width: min(860px, 100%); }
.modal-bg.open .modal { transform: none; }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 12px; }
.modal-h h3 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.01em; }
.modal-b { padding: 4px 22px 18px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 400; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 13px; background: var(--charcoal-2); color: #fff; box-shadow: var(--shadow-lg); animation: toastIn .3s var(--ease); }
.toast .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--brand); flex: none; }
.toast.warn .ico { background: var(--amber); }
.toast.err .ico { background: var(--red); }
.toast.info .ico { background: var(--teal); }
.toast b { display: block; font-size: 13.8px; }
.toast small { display: block; font-size: 12.8px; color: #B8C5CA; }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
.menu { position: absolute; right: 26px; top: calc(var(--topbar-h) - 6px); z-index: 60; width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: transparent; border-radius: 9px; text-align: left; font-size: 13.8px; font-weight: 500; }
.menu button:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .who { padding: 10px 12px 8px; font-size: 12.5px; color: var(--muted); }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(10,14,16,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }

/* ---------- Responsive ---------- */
@media (max-width: 1440px) {
  .split { grid-template-columns: minmax(0, 1fr) 350px; }
  .analysis-grid { grid-template-columns: minmax(0, 1fr) 310px; }
  .pipeline { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .pipe-step p { font-size: 12.3px; }
}
@media (max-width: 1366px) {
  :root { --sidebar-w: 244px; }
  .content { padding: 22px 22px 56px; }
  .hero h1 { font-size: 32px; }
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pipe-step:nth-child(4)::after { display: none; }
  .roadmap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .step span { font-size: 12.5px; }
}
@media (max-width: 1600px) {
  .v-toolbar [data-a="fit"] .t, .v-toolbar [data-a="reset"] .t { display: none; }
}
@media (max-width: 1180px) {
  .split, .split.wide-r, .analysis-grid { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g4.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deploy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .det-list { max-height: 340px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero .visual { min-height: 240px; order: -1; }
  .hero .visual::before { display: none; }
  .arch-boxes { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; gap: 12px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-hero { min-height: auto; padding: 32px 28px; }
  .login-hero h1 { font-size: 34px; }
  .login-panel { padding: 32px 28px 40px; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-row { grid-template-columns: 140px minmax(0, 1fr) auto; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .content { padding: 16px 16px 48px; }
  .topbar { height: 60px; }
  :root { --topbar-h: 60px; }
  .topbar .brand-pair { display: none; }
  .user-chip > div { display: none; }
  .user-chip { padding: 4px; }
  .page-head h1 { font-size: 23px; }
  .hero .copy { padding: 24px 20px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14.5px; }
  .g2, .g3, .g4, .g4.kpis { grid-template-columns: minmax(0, 1fr); }
  .g4.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .val { font-size: 25px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-step::after { display: none; }
  .stepper { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .step { padding: 8px 4px; justify-content: center; }
  .step span { display: none; }
  .form-grid, .tiles, .scn-pick { grid-template-columns: minmax(0, 1fr); }
  .q-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .q-row > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .q-row .qstate { grid-column: 2; grid-row: 1; }
  .q-overall { flex-wrap: wrap; padding: 16px; }
  .q-overall > div:nth-child(2) { flex: 1 1 200px; min-width: 0; }
  .qstate.badge, .q-overall .badge { white-space: normal; height: auto; min-height: 24px; padding: 4px 10px; }
  .probe { grid-template-columns: minmax(0, 1fr); }
  .probe img { width: 100%; max-width: 280px; }
  .result-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .count-sum b { font-size: 24px; }
  .count-sum > div { padding: 12px; }
  .roadmap, .deploy { grid-template-columns: minmax(0, 1fr); }
  .arch-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .arch-boxes { grid-template-columns: minmax(0, 1fr); }
  .decision { grid-template-columns: minmax(0, 1fr); }
  .det-detail .acts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vbtn .t { display: none; }
  .cam { grid-template-columns: 72px minmax(0, 1fr); }
  .cam img { width: 72px; height: 48px; }
  .cam > .btn { grid-column: 1 / -1; }
  /* responsive tables -> cards */
  table.t.resp thead { display: none; }
  table.t.resp, table.t.resp tbody, table.t.resp tr, table.t.resp td { display: block; width: 100%; }
  table.t.resp tr { border-bottom: 1px solid var(--line); padding: 10px 14px; }
  table.t.resp td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  table.t.resp td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  table.t.resp td.cell-first::before { display: none; }
  .cell-img { min-width: 0; }
  .login-hero h1 { font-size: 28px; }
  .login-hero .flow-strip { display: none; }
  .brand-pair .te { height: 28px; }
  .brand-pair .vs { height: 42px; }
  .toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .menu { right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media print {
  .sidebar, .topbar, .toasts { display: none !important; }
  .main { margin: 0; }
}

/* compact count summary inside narrow side columns */
.split > .stack .count-sum b, .split > .stack .count-sum b { font-size: 26px; }
.split > .stack .count-sum small { letter-spacing: .03em; font-size: 11px; }
.split > .stack .count-sum > div { padding: 12px; }
.card-b > .timeline { max-height: 560px; overflow-y: auto; padding-right: 4px; }
.split > *, .analysis-grid > *, .grid > * { min-width: 0; }
pre { max-width: 100%; }
.stack > * { min-width: 0; }

.cam > .btn { grid-column: 1 / -1; justify-self: stretch; }

/* ---------- Piece-level detections ---------- */
.ov .d.piece { fill: rgba(67,208,90,.14); stroke: #4BE063; stroke-width: var(--swp, 1px); vector-effect: non-scaling-stroke; cursor: pointer; }
.ov .d.piece.review, .ov .d.piece.uncertain { stroke: #F5B342; fill: rgba(245,166,35,.14); }
.ov .d.piece.rejected { stroke: #FF6B64; fill: rgba(200,65,59,.22); }
.ov .d.piece.manual { stroke: #7CBBFF; fill: rgba(47,111,179,.3); }
.ov .d.piece.sel { stroke: #fff; fill: rgba(255,255,255,.3); stroke-width: var(--sw, 2px); }
.ov .d.piece:hover { fill: rgba(255,255,255,.28); }
.ov .d.piece.pop { animation: pop .3s ease-out both; }
.ov g.d.bundle .shape { fill: none; stroke: rgba(155,231,166,.75); stroke-dasharray: 6 4; }
.ov g.d.bundle.review .shape, .ov g.d.bundle.uncertain .shape { stroke: #F5A623; fill: rgba(245,166,35,.05); }
.ov g.d.bundle.rejected .shape { stroke: #FF6B64; fill: rgba(200,65,59,.12); }
.ov g.d.bundle.sel .shape { stroke: #fff; stroke-dasharray: none; fill: rgba(255,255,255,.05); }
.pieces-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.big-num { font-variant-numeric: tabular-nums; }
.sub-units { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Guided tour ---------- */
.tour-launch { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--brand-100); background: var(--brand-50); color: var(--brand-700); font-weight: 700; font-size: 13.5px; }
.tour-launch:hover { background: var(--brand-100); }
.tour-spot { position: fixed; z-index: 500; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 4px rgba(58,170,75,.9), 0 0 0 9999px rgba(8,12,14,.58); transition: left .35s var(--ease), top .35s var(--ease), width .35s var(--ease), height .35s var(--ease), opacity .2s; }
.tour-spot.none { box-shadow: 0 0 0 9999px rgba(8,12,14,.58); width: 0 !important; height: 0 !important; left: 50% !important; top: 50% !important; }
.tour-card { position: fixed; z-index: 510; width: min(420px, calc(100vw - 24px)); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden; transition: left .35s var(--ease), top .35s var(--ease); }
.tour-card .tc-top { padding: 14px 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-card .tc-ch { font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--brand-700); }
.tour-card .tc-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tour-card h4 { margin: 6px 18px 6px; font-size: 17px; letter-spacing: -.01em; }
.tour-card p { margin: 0 18px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.tour-card .tc-tip { margin: 10px 18px 0; padding: 9px 12px; border-radius: 10px; background: var(--teal-50); color: var(--teal-600); font-size: 13px; display: flex; gap: 8px; }
.tour-card .tc-bar { height: 4px; background: #EEF1F3; margin-top: 14px; }
.tour-card .tc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--brand)); transition: width .35s var(--ease); }
.tour-card .tc-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px 14px; }
.tour-card .tc-f .btn-row { gap: 8px; }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); }
.tour-card .tc-hero { padding: 22px 22px 6px; }
.tour-card .tc-hero h3 { margin: 8px 0 8px; font-size: 22px; letter-spacing: -.02em; }
.tour-card .tc-hero p { margin: 0; }
.tour-card .tc-chapters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px 22px 4px; }
.tour-card .tc-chapters span { font-size: 12px; padding: 7px 9px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; }
.tour-card .tc-chapters b { color: var(--brand-700); margin-right: 4px; }
.tour-busy { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.tour-busy::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand-100); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@media (max-width: 760px) {
  .tour-card:not(.center) { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; }
  .tour-card .tc-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tour-launch span { display: none; }
}
@media (max-width: 760px) {
  .tour-card .tc-tip { display: none; }
  .tour-card p { font-size: 13.5px; }
  .tour-card .tc-f { flex-wrap: wrap; }
  .tour-card .tc-f .btn-row { margin-left: auto; }
}
