/* Labryva enterprise interface layer
   Visual-only overrides. Core calculation and storage behavior remains in app.js. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #061016;
  --bg-soft: #09171e;
  --sidebar: #07151b;
  --panel: #0b1b22;
  --panel2: #10232b;
  --panel-strong: #132a32;
  --line: rgba(176, 218, 221, 0.12);
  --line-strong: rgba(176, 218, 221, 0.21);
  --text: #f1f8f7;
  --text-soft: #c4d4d5;
  --muted: #839ca0;
  --muted-2: #789095;
  --accent: #50d6b8;
  --accent2: #9ae7d5;
  --accent-rgb: 80, 214, 184;
  --danger: #ff8d95;
  --warning: #e8bd69;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.23);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.14);
  --radius-xs: 8px;
  --radius-sm: 11px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --sidebar-width: 276px;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(var(--accent-rgb), 0.22) transparent;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 88% -8%, rgba(var(--accent-rgb), 0.07), transparent 30rem),
    var(--bg);
  font-size: 15px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

::selection { background: rgba(var(--accent-rgb), .24); color: var(--text); }
.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.mobile-header,
.sidebar-scrim,
.sidebar-close { display: none; }

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  isolation: isolate;
}

.sidebar {
  width: var(--sidebar-width);
  padding: 22px 16px 18px;
  background:
    radial-gradient(circle at 25% 0%, rgba(var(--accent-rgb), .075), transparent 16rem),
    linear-gradient(180deg, #08171d 0%, var(--sidebar) 100%);
  border-right: 1px solid var(--line);
  box-shadow: 14px 0 40px rgba(0,0,0,.09);
  z-index: 30;
}

.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.brand { gap: 12px; padding: 2px 7px 15px; }
.brand strong { font-size: 1.28rem; letter-spacing: -.045em; }
.brand small { margin-top: 1px; color: var(--muted-2); font-size: .6rem; letter-spacing: .04em; }
.brand-mark-framed {
  width: 36px;
  height: 36px;
  grid-template-columns: repeat(3, 4px);
  justify-content: center;
  align-content: center;
  gap: 3px;
  border: 1px solid rgba(var(--accent-rgb), .22);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), .13), rgba(var(--accent-rgb), .03));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 24px rgba(0,0,0,.16);
}
.brand-mark-framed span:nth-child(1) { height: 8px; }
.brand-mark-framed span:nth-child(2) { height: 17px; }
.brand-mark-framed span:nth-child(3) { height: 12px; }

.workspace-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1px 7px 17px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.018);
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .09), 0 0 14px rgba(var(--accent-rgb), .45);
}

.nav {
  display: block;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px 18px;
}
.nav-section-label {
  display: block;
  margin: 15px 10px 6px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-section-label:first-child { margin-top: 0; }
.nav-item {
  position: relative;
  min-height: 41px;
  margin: 2px 0;
  padding: 9px 11px;
  gap: 11px;
  color: #789196;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover {
  color: var(--text-soft);
  background: rgba(255,255,255,.026);
  border-color: rgba(255,255,255,.025);
  transform: translateX(1px);
}
.nav-item.active {
  color: #e9f8f4;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .13), rgba(var(--accent-rgb), .045));
  border-color: rgba(var(--accent-rgb), .13);
  box-shadow: inset 2px 0 0 var(--accent), 0 8px 24px rgba(0,0,0,.08);
}
.nav-icon {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  color: #719b96;
}
.nav-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-icon { color: var(--accent); }

.sidebar-footer {
  position: relative;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.theme-toggle {
  justify-content: flex-start;
  min-height: 37px;
  padding: 8px 10px;
  background: rgba(255,255,255,.02);
  border-radius: 9px;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}
.theme-toggle:hover { background: rgba(var(--accent-rgb), .045); }
.privacy-note {
  position: relative;
  padding: 11px 11px 11px 29px;
  background: rgba(255,255,255,.016);
  border-radius: 10px;
}
.privacy-note::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 13px;
  width: 8px;
  height: 10px;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
  opacity: .75;
}
.privacy-note::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 9px;
  width: 4px;
  height: 5px;
  border: 1.5px solid var(--accent);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  opacity: .75;
}
.privacy-note strong { color: var(--text-soft); font-size: 11px; }
.privacy-note span { margin-top: 2px; font-size: 10px; }
.sidebar-footer > small { display: none; }
.ownership-footer { gap: 2px; }

.main {
  position: relative;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 0 clamp(22px, 3vw, 50px) 72px;
}

.topbar {
  min-height: 88px;
  background: linear-gradient(180deg, rgba(6,16,22,.96), rgba(6,16,22,.88));
  border-bottom-color: var(--line);
  z-index: 20;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .35), transparent 24%);
}
.topbar-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
}
.topbar h1 { font-size: 1.38rem; }
.topbar p { color: var(--muted); font-size: 12px; }
.top-actions { align-items: center; }

.button {
  position: relative;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 12px;
  letter-spacing: .005em;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary {
  background: linear-gradient(135deg, #90e5d1, #4fd3b5 58%, #38b99e);
  color: #05221b;
  box-shadow: 0 8px 22px rgba(25, 160, 130, .18), inset 0 1px 0 rgba(255,255,255,.45);
}
.button.primary:hover { box-shadow: 0 11px 27px rgba(25, 160, 130, .25), inset 0 1px 0 rgba(255,255,255,.45); }
.button.secondary {
  color: var(--text-soft);
  background: rgba(255,255,255,.025);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.button.secondary:hover { border-color: rgba(var(--accent-rgb), .33); background: rgba(var(--accent-rgb), .045); }
.button.danger { color: var(--danger); background: rgba(255,141,149,.055); border: 1px solid rgba(255,141,149,.22); }
.button.small { min-height: 36px; }
.text-button { font-size: .7rem; }

.view { padding-top: 28px; animation: view-enter .25s ease both; }
@keyframes view-enter { from { opacity: .45; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.command-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr);
  min-height: 282px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), .16);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 78% 28%, rgba(var(--accent-rgb), .15), transparent 20rem),
    linear-gradient(135deg, rgba(16,40,47,.96), rgba(7,22,29,.98) 60%);
  box-shadow: var(--shadow);
}
.command-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.035), transparent 34%);
}
.command-hero-content {
  position: relative;
  z-index: 3;
  align-self: center;
  padding: clamp(30px, 4vw, 52px);
}
.command-hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8fb0af;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.command-hero h2 {
  max-width: 690px;
  margin: 15px 0 14px;
  color: #f3fbf9;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(2rem, 3.4vw, 3.65rem);
  line-height: 1.03;
  letter-spacing: -.052em;
}
.command-hero h2 em { color: var(--accent2); font-style: normal; }
.command-hero-content > p {
  max-width: 610px;
  margin: 0;
  color: #90a8ab;
  font-size: .88rem;
  line-height: 1.65;
}
.command-hero-actions { display: flex; gap: 10px; margin-top: 24px; }
.hero-primary { min-width: 178px; }
.command-trust-row { display: flex; flex-wrap: wrap; gap: 17px; margin-top: 27px; }
.command-trust-row span { display: inline-flex; align-items: center; gap: 7px; color: #789498; font-size: 11px; font-weight: 600; }
.command-trust-row i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb), .6); }

.command-visual { position: relative; min-height: 282px; overflow: hidden; }
#labryva-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.command-visual.scene-ready .visual-core { opacity: 0; transform: translate(-50%,-50%) scale(.86); }
.visual-core { transition: opacity .2s ease, transform .2s ease; }
.visual-grid {
  position: absolute;
  inset: 14% 5% 8%;
  opacity: .24;
  border-radius: 50%;
  background-image:
    linear-gradient(rgba(150,231,213,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150,231,213,.12) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle, black, transparent 70%);
}
.visual-core {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 49%;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  transform: translate(-50%,-50%);
  border: 1px solid rgba(var(--accent-rgb), .32);
  border-radius: 50%;
  background: rgba(8,29,35,.68);
  box-shadow: 0 0 0 14px rgba(var(--accent-rgb),.035), 0 0 60px rgba(var(--accent-rgb), .17), inset 0 0 22px rgba(var(--accent-rgb), .08);
  backdrop-filter: blur(8px);
}
.visual-core .brand-mark { transform: scale(1.15); }
.visual-label {
  position: absolute;
  z-index: 3;
  min-width: 124px;
  padding: 9px 11px;
  border: 1px solid rgba(var(--accent-rgb), .16);
  border-radius: 9px;
  background: rgba(6,21,27,.66);
  box-shadow: 0 10px 25px rgba(0,0,0,.14);
  backdrop-filter: blur(8px);
}
.visual-label small { display: block; color: #638a88; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.visual-label strong { display: block; margin-top: 2px; color: #c8dcd9; font-size: 11px; }
.visual-label-a { left: 4%; top: 21%; }
.visual-label-b { right: 3%; top: 36%; }
.visual-label-c { left: 13%; bottom: 14%; }

.pilot-notice {
  margin-bottom: 16px;
  padding: 13px 15px;
  border-color: rgba(232,189,105,.25);
  border-radius: 12px;
  background: rgba(232,189,105,.055);
  box-shadow: none;
}
.pilot-notice-copy { gap: 3px; }
.pilot-notice-copy strong { color: #e7d3a5; font-size: 12px; }
.pilot-notice-copy span { color: #8fa4a7; font-size: 11px; }

.kpi-grid { gap: 12px; }
.kpi-card,
.panel,
.result-hero {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: rgba(11,27,34,.96);
  box-shadow: none;
}
.result-hero { box-shadow: var(--shadow-soft); }
.kpi-card {
  position: relative;
  min-height: 137px;
  padding: 19px 18px;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  opacity: .72;
  background: linear-gradient(90deg, var(--accent), transparent 72%);
}
.kpi-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -30px;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(var(--accent-rgb), .055);
  border-radius: 50%;
}
.kpi-card span { max-width: 95%; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.35; }
.kpi-card strong { margin: 13px 0 3px; color: var(--text); font-size: 1.58rem; letter-spacing: -.035em; }
.kpi-card small { color: var(--muted-2); font-size: 12px; }

.dashboard-grid { gap: 14px; margin-top: 14px; }
.panel { padding: 22px; }
.panel-header { margin-bottom: 18px; }
.panel-header h2,
.result-hero h2,
.module-head h2 { color: var(--text); font-size: 1.08rem; letter-spacing: -.025em; }
.panel-header p,
.module-head p { color: var(--muted); line-height: 1.5; }
.eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .14em; }

.workflow-list { gap: 0; margin-top: 15px; }
.workflow-list div { position: relative; min-height: 51px; padding: 8px 0; color: var(--text-soft); }
.workflow-list div:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 38px; bottom: -4px; width: 1px; background: linear-gradient(var(--line-strong), transparent); }
.workflow-list b { position: relative; z-index: 1; border: 1px solid rgba(var(--accent-rgb), .13); }
.quick-actions { gap: 9px; }
.quick-card {
  position: relative;
  min-height: 92px;
  padding: 15px;
  overflow: hidden;
  color: var(--text);
  background: rgba(255,255,255,.017);
  border-color: var(--line);
  transition: transform .17s ease, border-color .17s ease, background-color .17s ease;
}
.quick-card::after { content: "→"; position: absolute; right: 13px; top: 12px; color: var(--muted-2); font-size: .8rem; }
.quick-card:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb), .27); background: rgba(var(--accent-rgb), .035); }
.quick-card b { font-size: 12px; }
.quick-card span { max-width: 80%; color: var(--muted); line-height: 1.45; }

.department-cost-head > strong { color: var(--text-soft); }
.department-cost-head b,
.department-cost-total strong { color: var(--text); }
.department-cost-track,
.score-track,
.compact-bar { background: rgba(114,153,157,.13); }

.analysis-layout { gap: 18px; grid-template-columns: minmax(0, 1.16fr) minmax(360px, .84fr); }
.form-panel { padding: 25px 26px; }
.assumption-guidance { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: -2px 0 2px; padding: 12px 13px; border: 1px solid rgba(var(--accent-rgb),.14); border-radius: 10px; background: rgba(var(--accent-rgb),.035); }
.assumption-guidance > div { display: grid; gap: 3px; }
.assumption-guidance strong { color: var(--text-soft); font-size: 12px; }
.assumption-guidance > div span { max-width: 590px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.local-model-badge { flex: 0 0 auto; padding: 4px 7px; color: var(--accent2); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; border: 1px solid rgba(var(--accent-rgb),.16); border-radius: 999px; }
.form-section { padding: 20px 0; }
.form-section h3,
.compare-form h3 { color: var(--text-soft); font-size: .82rem; letter-spacing: -.01em; }
.form-grid { gap: 13px; }
label span { color: var(--muted); font-size: 12px; font-weight: 650; }
input,
select {
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(4,17,23,.58);
  border-color: var(--line-strong);
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
input::placeholder { color: #4f6c71; }
input:hover,
select:hover { border-color: rgba(176,218,221,.28); }
input:focus,
select:focus {
  border-color: rgba(var(--accent-rgb), .7);
  background: rgba(4,17,23,.78);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .095);
}
.field-note { color: var(--muted-2); font-size: 10.5px; }
.form-actions { gap: 8px; }

.results-stack { gap: 13px; top: 112px; }
.result-hero {
  position: relative;
  padding: 23px;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 8%, rgba(var(--accent-rgb), .15), transparent 14rem),
    linear-gradient(150deg, rgba(17,54,55,.9), rgba(8,29,37,.98));
  border-color: rgba(var(--accent-rgb), .18);
}
.result-hero::after { content: ""; position: absolute; right: -35px; top: -35px; width: 140px; height: 140px; border: 1px solid rgba(var(--accent-rgb), .08); border-radius: 50%; box-shadow: 0 0 0 24px rgba(var(--accent-rgb), .025); }
.analysis-mode { color: var(--accent2); background: rgba(var(--accent-rgb), .07); }
.result-main { position: relative; z-index: 1; margin: 19px 0 15px; padding: 17px; background: rgba(var(--accent-rgb), .055); border-color: rgba(var(--accent-rgb), .17); }
.result-main strong { color: var(--accent2); font-size: clamp(2.35rem, 3.4vw, 3.05rem); letter-spacing: -.055em; }
.result-secondary div,
.margin-grid div,
.comparison-kpis div,
.util-summary-grid div,
.util-menu-summary div { background: rgba(255,255,255,.018); }
.result-secondary span,
.margin-grid span,
.comparison-kpis span { color: var(--muted); }
.result-secondary b,
.margin-grid b,
.comparison-kpis b { color: var(--text-soft); }

.check-item { padding: 5px 6px; border-radius: 7px; background: rgba(255,255,255,.014); }
.compact-breakdown-head { color: var(--muted-2); }
.compact-component > span { color: var(--text-soft); }
.compact-breakdown-row > b { color: var(--text); }
.compact-breakdown-row > strong { color: var(--muted); }
.reimbursement-grid > div:nth-child(4) { border-color: rgba(var(--accent-rgb), .22); background: rgba(var(--accent-rgb), .035); }
.reimbursement-summary,
.optional-cost-note { color: var(--muted); }

.module-head {
  margin-bottom: 18px;
  padding: 3px 0 17px;
  border-bottom: 1px solid var(--line);
}
.view > .module-head h2 { font-size: 1.1rem; }
.module-head h2 { font-size: 1.45rem; }
.analyzer-support-head { padding: 3px 0 16px; border-top: 0; }
.shared-volume-panel { border-color: rgba(var(--accent-rgb), .14); background: linear-gradient(120deg, rgba(var(--accent-rgb), .035), rgba(255,255,255,.012)); }
.compare-grid { gap: 14px; }
.compare-form { box-shadow: var(--shadow-soft); }
.analyzer-form-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.comparison-kpis { gap: 9px; }
.comparison-kpis div { min-height: 76px; padding: 13px; }
.comparison-kpis b { margin-top: 7px; font-family: "Manrope", system-ui, sans-serif; font-size: 1rem; }
.winner-card { padding: 14px 15px; color: #b7d9d1; background: rgba(var(--accent-rgb), .045); border-color: rgba(var(--accent-rgb), .17); }
.chart-canvas { background: linear-gradient(180deg, rgba(0,0,0,.045), transparent); border: 1px solid rgba(255,255,255,.025); }

.util-tabs { gap: 5px; padding: 4px; width: max-content; max-width: 100%; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.015); }
.util-tab { border: 0; background: transparent; border-radius: 8px; }
.util-tab.active { color: var(--text); background: rgba(var(--accent-rgb), .095); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .12); }
.utilization-caution { background: rgba(232,189,105,.035); border-color: rgba(232,189,105,.16); }
.util-table th { position: sticky; top: 0; z-index: 1; padding: 11px 9px; background: var(--panel); }
.util-table td { padding: 9px; }

.saved-list { gap: 9px; }
.saved-work-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) minmax(180px,240px) auto; gap: 10px; align-items: center; margin: -3px 0 17px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.012); }
.saved-work-toolbar input,
.saved-work-toolbar select { min-height: 40px; }
.saved-count { padding: 0 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.saved-card {
  padding: 16px;
  background: rgba(255,255,255,.015);
  border-color: var(--line);
  transition: border-color .16s ease, background-color .16s ease;
}
.saved-card:hover { border-color: rgba(var(--accent-rgb), .2); background: rgba(var(--accent-rgb), .022); }
.saved-card h3 { color: var(--text-soft); }
.saved-card-heading { display: flex; align-items: center; gap: 9px; }
.record-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; }
.record-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.saved-card-actions { display: flex; align-items: center; gap: 7px; }
.action-menu { position: relative; }
.action-menu > summary { width: 38px; height: 38px; display: grid; place-items: center; color: var(--text-soft); list-style: none; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255,255,255,.02); }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-popover { position: absolute; z-index: 12; top: calc(100% + 7px); right: 0; width: 174px; display: grid; padding: 6px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-strong); box-shadow: var(--shadow-soft); }
.action-menu-popover button { min-height: 36px; padding: 0 10px; color: var(--text-soft); text-align: left; border: 0; border-radius: 7px; background: transparent; }
.action-menu-popover button:hover { background: rgba(var(--accent-rgb),.07); }
.action-menu-popover button.danger { color: var(--danger); }
.saved-meta,
.saved-values div span { color: var(--muted); font-size: 12px; }
.saved-values div b { color: var(--text-soft); }
.tool-saved-main > strong { font-size: 13px; }
.tool-saved-main > span,
.tool-saved-metrics small { font-size: 12px; }
.tool-saved-metrics b { font-size: 12px; }
.icon-button {
  min-height: 35px;
  color: var(--text-soft);
  background: rgba(255,255,255,.02);
  border-color: var(--line-strong);
  border-radius: 8px;
  transition: border-color .16s ease, background-color .16s ease;
}
.icon-button:hover { border-color: rgba(var(--accent-rgb), .3); background: rgba(var(--accent-rgb), .04); }
.icon-button.danger:hover { border-color: rgba(255,141,149,.3); background: rgba(255,141,149,.05); }
.tool-saved-row { padding: 16px 0; }
.tool-saved-main > strong { color: var(--text-soft); }
.tool-saved-metrics small,
.tool-saved-main > span { color: var(--muted); }

.empty-state { color: var(--muted); }
.empty-state h3 { color: var(--text-soft); }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 2px; border: 1px solid rgba(var(--accent-rgb), .16); border-radius: 12px; background: rgba(var(--accent-rgb), .045); }

.drawer-backdrop { background: rgba(2,8,11,.74); backdrop-filter: blur(5px); }
.drawer { background: var(--bg-soft); border-left-color: var(--line-strong); }
.toast { right: 26px; bottom: 26px; min-width: 210px; padding: 13px 16px; color: var(--text); background: rgba(12,39,46,.94); border-color: rgba(var(--accent-rgb), .25); backdrop-filter: blur(14px); }

.help-steps > div > b { border-radius: 50%; }
.definition-list strong,
.faq-list summary { color: var(--text-soft); }
.definition-list span,
.faq-list p,
.help-steps p,
.help-contact p { color: var(--muted); }
.faq-list details { background: rgba(255,255,255,.012); }
.help-contact { background: linear-gradient(145deg, rgba(var(--accent-rgb),.07), rgba(9,29,37,.92)); }
.pilot-data-note,
.reset-data-warning { background: rgba(255,255,255,.014); }

.report-preview {
  padding: clamp(24px, 4vw, 46px);
  color: #1a2b30;
  border: 1px solid rgba(15,47,53,.1);
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(0,0,0,.18);
  overflow-x: auto;
}
.report-preview .report-document { max-width: 980px; margin: 0 auto; }
.report-preview .report-brand { align-items: flex-start; }
.report-heading-meta { max-width: 55%; text-align: right; }
.report-title-block { margin: 28px 0 18px; }
.report-title-block > span { color: #168d78; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.report-title-block h2 { margin: 5px 0 2px; font-size: 1.45rem; }
.report-title-block p { margin: 0; color: #647d82; }
.report-callout { display: grid; gap: 5px; margin: 0 0 18px; padding: 16px 18px; border-left: 3px solid #168d78; border-radius: 8px; background: #f3faf8; }
.report-callout small { color: #168d78; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.report-callout strong { color: #17353a; font-size: 14px; }
.report-callout span { color: #5e767b; font-size: 12px; }
.report-preview .report-kpis { margin: 14px 0; }
.report-preview .report-kpis div { border: 1px solid #dce9e8; }
.report-kpis-secondary div:nth-child(2) { background: #e8f7f3; }
.report-section { margin-top: 29px; }
.report-section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-bottom: 8px; border-bottom: 1px solid #dbe6e7; }
.report-section-head h2 { margin: 0; font-size: 1rem; }
.report-section-head span { color: #6c8185; font-size: 11px; }
.report-preview .report-section table { margin-top: 4px; }
.report-preview .report-section th { color: #536b70; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.report-preview .report-section td:nth-child(n+2),
.report-preview .report-section th:nth-child(n+2) { text-align: right; }
.report-preview .report-assumptions td:first-child { color: #5e7479; }
.report-preview .report-provenance { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 25px; }
.report-preview .report-provenance div { padding: 12px; border: 1px solid #dbe6e7; border-radius: 8px; background: #fafcfc; }
.report-preview .report-provenance small,
.report-preview .report-provenance b { display: block; }
.report-preview .report-provenance b { margin-top: 5px; color: #29464b; font-size: 11px; }
.report-preview .report-validation-alert { display: grid; gap: 4px; margin: 0 0 18px; padding: 13px 15px; color: #5c4616; border: 1px solid #ead9ad; border-radius: 8px; background: #fff9eb; }
.report-preview .report-validation-alert b { font-size: 12px; }
.report-preview .report-validation-alert span { font-size: 11px; line-height: 1.5; }
.report-methodology { padding: 17px 18px; border: 1px solid #dce7e8; border-radius: 9px; background: #fafcfc; }
.report-methodology h2 { margin: 0 0 8px; font-size: 1rem; }
.report-methodology p { margin: 7px 0 0; color: #5f767b; font-size: 12px; line-height: 1.6; }
.report-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 12px; border-top: 1px solid #dce7e8; color: #718589; font-size: 10px; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.multi-select-trigger,
.multi-select-menu,
.multi-select-actions { background: var(--panel2); border-color: var(--line-strong); }

html[data-theme="light"] {
  --bg: #f2f6f7;
  --bg-soft: #f7fafb;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel2: #f7fafb;
  --panel-strong: #eef5f5;
  --line: rgba(20,65,72,.115);
  --line-strong: rgba(20,65,72,.19);
  --text: #10282d;
  --text-soft: #29464b;
  --muted: #50696e;
  --muted-2: #50696e;
  --accent: #168d78;
  --accent2: #2cad93;
  --accent-rgb: 22, 141, 120;
  --shadow: 0 20px 55px rgba(37,67,72,.10);
  --shadow-soft: 0 9px 25px rgba(37,67,72,.075);
}
html[data-theme="light"] body {
  background: radial-gradient(circle at 88% -8%, rgba(var(--accent-rgb), .065), transparent 30rem), var(--bg);
}
html[data-theme="light"] body::before { opacity: .28; background-image: linear-gradient(rgba(20,65,72,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(20,65,72,.03) 1px,transparent 1px); }
html[data-theme="light"] .sidebar { background: radial-gradient(circle at 20% 0%,rgba(var(--accent-rgb),.055),transparent 16rem),linear-gradient(180deg,#fff,#f9fbfb); }
html[data-theme="light"] .nav-section-label { color: #8ca0a4; }
html[data-theme="light"] .nav-item { color: #607a7f; }
html[data-theme="light"] .nav-item:hover { color: #24474d; background: rgba(20,65,72,.035); }
html[data-theme="light"] .nav-item.active { color: #123f3d; background: linear-gradient(90deg,rgba(var(--accent-rgb),.105),rgba(var(--accent-rgb),.035)); }
html[data-theme="light"] .workspace-chip,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .privacy-note { background: rgba(20,65,72,.02); }
html[data-theme="light"] .topbar { background: linear-gradient(180deg,rgba(242,246,247,.97),rgba(242,246,247,.9)); }
html[data-theme="light"] .command-hero { background: radial-gradient(circle at 78% 28%,rgba(68,214,184,.18),transparent 20rem),linear-gradient(135deg,#10333a,#09242c 64%); }
html[data-theme="light"] .panel,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .saved-card,
html[data-theme="light"] .result-card { background: #fff; }
html[data-theme="light"] .result-hero { background: radial-gradient(circle at 90% 8%,rgba(var(--accent-rgb),.13),transparent 14rem),linear-gradient(150deg,#f4fbf9,#eaf6f4); }
html[data-theme="light"] .result-hero h2,
html[data-theme="light"] .result-secondary b { color: var(--text); }
html[data-theme="light"] .result-main { background: rgba(var(--accent-rgb),.055); }
html[data-theme="light"] .result-main span { color: #537d78; }
html[data-theme="light"] .result-main strong,
html[data-theme="light"] #margin-annual-profit { color: #087b67; }
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea { color: var(--text); background: #fbfdfd; border-color: var(--line-strong); }
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus { background: #fff; }
html[data-theme="light"] input::placeholder { color: #9aacaf; }
html[data-theme="light"] .button.secondary,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .util-tab { color: #35555b; background: #f8fbfb; }
html[data-theme="light"] .quick-card,
html[data-theme="light"] .saved-card,
html[data-theme="light"] .faq-list details,
html[data-theme="light"] .check-item,
html[data-theme="light"] .margin-grid div,
html[data-theme="light"] .comparison-kpis div,
html[data-theme="light"] .util-summary-grid div,
html[data-theme="light"] .util-menu-summary div { background: #f9fbfb; }
html[data-theme="light"] .chart-canvas { background: linear-gradient(180deg,rgba(20,65,72,.018),transparent); border-color: rgba(20,65,72,.06); }
html[data-theme="light"] .util-table th { background: #fff; }
html[data-theme="light"] .pilot-notice { background: #fff9eb; }
html[data-theme="light"] .pilot-notice-copy strong { color: #805e17; }
html[data-theme="light"] .help-contact { background: linear-gradient(145deg,rgba(var(--accent-rgb),.055),#fff); }
html[data-theme="light"] .multi-select-trigger,
html[data-theme="light"] .multi-select-menu,
html[data-theme="light"] .multi-select-actions { background: #fff; }
html[data-theme="light"] .saved-work-toolbar { background: #f9fbfb; }
html[data-theme="light"] .action-menu-popover { background: #fff; }

body:has(#compare-view.active) #global-topbar,
body:has(#sendout-view.active) #global-topbar,
body:has(#scenarios-view.active) #global-topbar,
body:has(#utilization-view.active) #global-topbar {
  display: flex !important;
}

#compare-view > .analyzer-main-head,
#sendout-view > .module-head,
#scenarios-view > .module-head,
#utilization-view > .module-head { display: none; }

@media (max-width: 1380px) {
  :root { --sidebar-width: 250px; }
  .kpi-grid.five { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .command-hero { grid-template-columns: 1.08fr .92fr; }
  .visual-label { min-width: 108px; }
}

@media (max-width: 1100px) {
  .analysis-layout { grid-template-columns: 1fr; }
  .results-stack { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
  .results-stack > :first-child,
  .results-stack > :last-child { grid-column: 1 / -1; }
  .command-hero { grid-template-columns: 1fr .78fr; }
  .command-hero-content { padding: 34px; }
  .visual-label { display: none; }
}

@media (max-width: 900px) {
  .command-hero { display: block; min-height: 0; }
  .command-hero-content { padding: 34px; }
  .command-visual { display: none; }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
  .form-grid.three > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { padding-top: 62px; }
  body.nav-open { overflow: hidden; }
  .mobile-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 60;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: rgba(7,21,27,.95);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
  }
  .mobile-brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
  .mobile-brand .brand-mark { width: 22px; height: 22px; }
  .mobile-brand > span:last-child { display: flex; flex-direction: column; }
  .mobile-brand strong { font-family: "Manrope",system-ui,sans-serif; font-size: .94rem; line-height: 1.05; }
  .mobile-brand small { color: var(--muted); font-size: .52rem; }
  .mobile-menu-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-content: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
  }
  .mobile-menu-button span { width: 16px; height: 1.5px; background: var(--text-soft); border-radius: 2px; }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 64;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0,7,10,.64);
    backdrop-filter: blur(3px);
  }
  body.nav-open .sidebar-scrim { display: block; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 65;
    width: min(310px, 88vw);
    height: 100dvh;
    padding-top: 18px;
    border-right: 1px solid var(--line-strong);
    border-bottom: 0;
    transform: translateX(-104%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .24s ease, visibility 0s linear .24s;
  }
  body.nav-open .sidebar { transform: translateX(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .sidebar-close { display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; font-size: 1.1rem; }
  .nav { display: block; }
  .sidebar-footer { display: grid; }
  .main { padding: 0 14px 44px; }
  .topbar { position: static; min-height: 76px; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 15px 0; }
  .top-actions { display: flex; width: 100%; }
  .top-actions .button { flex: 1; min-height: 44px; }
  .topbar-kicker { display: none; }
  .topbar h1 { font-size: 1.18rem; }
  .view { padding-top: 17px; }
  .command-hero { min-height: 0; border-radius: 17px; }
  .command-hero-content { padding: 21px 22px; }
  .command-hero h2 { margin: 10px 0 0; font-size: clamp(1.75rem,9vw,2.35rem); }
  #dashboard-view .command-hero-content > p,
  #dashboard-view .command-hero-actions,
  #dashboard-view .command-trust-row { display: none; }
  .command-hero-actions { flex-direction: column; }
  .command-hero-actions .button { width: 100%; }
  .command-trust-row { gap: 9px 14px; margin-top: 20px; }
  .command-visual { display: none; }
  .pilot-notice { margin-top: 12px; }
  .pilot-notice-copy span { display: none; }
  .kpi-grid,
  .kpi-grid.five { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 118px; padding: 16px; }
  .kpi-card strong { font-size: 1.28rem; }
  .panel { padding: 18px; }
  .panel-header { flex-direction: column; gap: 12px; }
  .panel-header > .button,
  .panel-header .module-actions { width: 100%; }
  .form-panel { padding: 19px; }
  .assumption-guidance { display: grid; }
  .local-model-badge { width: max-content; }
  .results-stack { display: grid; grid-template-columns: 1fr; }
  .results-stack > * { grid-column: auto!important; }
  .result-main strong { font-size: 2.45rem; }
  .module-head { gap: 14px; }
  .module-head .module-actions { width: 100%; }
  .module-head .module-actions .button { flex: 1; }
  .comparison-kpis { grid-template-columns: 1fr 1fr; }
  .form-grid.three { grid-template-columns: 1fr; }
  .form-grid.three > :first-child { grid-column: auto; }
  .util-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .util-tab { white-space: nowrap; }
  .tool-saved-actions { width: 100%; }
  .saved-work-toolbar { grid-template-columns: 1fr; }
  .saved-count { padding: 2px 1px; }
  .saved-work-card { grid-template-columns: 1fr; }
  .saved-card-actions { justify-content: flex-end; }
  .toast { left: 14px; right: 14px; bottom: 14px; text-align: center; }
}

html[data-theme="light"] .mobile-header { background: rgba(248,251,251,.96); }

@media (max-width: 700px) {
  .util-table { min-width: 0; }
  .util-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .util-table,
  .util-table tbody,
  .util-table tr,
  .util-table td { display: block; width: 100%; }
  .util-table tr { margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.012); }
  .util-table td { padding: 6px 0; border: 0; }
  .util-table td::before { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
  .util-table td:nth-child(1)::before { content: "Test / Panel"; }
  .util-table td:nth-child(2)::before { content: "Monthly Orders"; }
  .util-table td:nth-child(3)::before { content: "Avoidable Cost / Test"; }
  .util-table td:nth-child(4)::before { content: "Estimated Reviewable %"; }
  .util-table td:nth-child(5)::before { content: "Annual Cost"; }
  .util-table td:nth-child(6)::before { content: "Potential Opportunity"; }
  .util-table td:last-child { padding-top: 10px; }
  .util-table td:last-child .icon-button { width: 100%; min-height: 44px; }
  html[data-theme="light"] .util-table tr { background: #f9fbfb; }
}

@media (max-width: 520px) {
  .kpi-grid,
  .kpi-grid.five,
  .comparison-kpis { grid-template-columns: 1fr; }
  .kpi-card { min-height: 105px; }
  .command-trust-row { display: grid; grid-template-columns: 1fr; }
  .report-preview .report-provenance { grid-template-columns: 1fr; }
  .command-visual { min-height: 160px; }
  .visual-core { width: 62px; height: 62px; }
  .quick-actions { grid-template-columns: 1fr; }
  .form-actions,
  .report-actions { flex-direction: column-reverse; }
  .form-actions .button,
  .report-actions .button { width: 100%; }
  .tool-saved-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .tool-saved-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tool-saved-actions .danger { grid-column: 1 / -1; }
}

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

@media print {
  body { padding-top: 0; background: #fff!important; }
  body::before,
  .mobile-header,
  .sidebar-scrim { display: none!important; }
  .report-preview { box-shadow: none; }
}


/* Beta environment indicator — beta copy only */
.labryva-beta-banner{
  position:relative;z-index:1000;min-height:34px;display:flex;
  align-items:center;justify-content:center;gap:10px;padding:7px 16px;
  background:#5be0c1;color:#071218;border-bottom:1px solid rgba(7,18,24,.22);
  font-size:.72rem;line-height:1.3;text-align:center
}
.labryva-beta-banner strong{font-size:.68rem;letter-spacing:.14em}
.labryva-beta-banner span{opacity:.82}
@media(max-width:640px){.labryva-beta-banner{align-items:flex-start;gap:6px;flex-direction:column;text-align:left}}


/* BETA MOBILE NAV FIX
   The desktop app-shell uses isolation:isolate, which creates a stacking context.
   On mobile this caused the full-screen scrim to paint above the slide-out sidebar
   even though the sidebar itself had a higher internal z-index. */
@media (max-width: 760px){
  .app-shell{
    isolation:auto;
  }

  .sidebar-scrim{
    z-index:64;
  }

  .sidebar{
    z-index:65;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }

  .sidebar .nav{
    overflow:visible;
    flex:0 0 auto;
  }

  body.nav-open{
    overflow:hidden;
    touch-action:none;
  }

  body.nav-open .sidebar{
    touch-action:pan-y;
  }
}

.beta-login-button{position:fixed;left:18px;bottom:18px;z-index:72;min-width:86px;height:38px;padding:0 18px;border:1px solid rgba(91,224,193,.34);border-radius:999px;background:rgba(7,18,24,.94);color:#dff9f3;box-shadow:0 12px 30px rgba(0,0,0,.28);font-size:.72rem;font-weight:800;cursor:pointer}
.beta-login-button:hover{border-color:rgba(91,224,193,.68);transform:translateY(-1px)}
.beta-auth-modal[hidden]{display:none!important}.beta-auth-modal{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:18px}.beta-auth-backdrop{position:absolute;inset:0;border:0;background:rgba(0,7,10,.72);backdrop-filter:blur(5px)}
.beta-auth-card{position:relative;z-index:1;width:min(430px,100%);padding:26px;border:1px solid var(--line-strong);border-radius:18px;background:linear-gradient(180deg,#0b1d23,#08171d);box-shadow:0 26px 80px rgba(0,0,0,.45)}
.beta-auth-close{position:absolute;right:14px;top:12px;width:34px;height:34px;border:1px solid var(--line);border-radius:9px;background:transparent;color:var(--muted);font-size:1.15rem}.beta-auth-brand{display:flex;align-items:center;gap:9px;margin-bottom:18px}.beta-auth-brand strong{font-size:1rem}.beta-auth-brand span{padding:4px 7px;border-radius:999px;background:rgba(91,224,193,.1);color:var(--accent);font-size:.58rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.beta-auth-card h2{margin:0 0 6px;font-size:1.4rem}.beta-auth-card>p{margin:0 0 18px;color:var(--muted);font-size:.72rem}.beta-auth-card form{display:grid;gap:13px}.beta-auth-card label{display:grid;gap:6px;font-size:.66rem;font-weight:700;color:var(--muted)}.beta-auth-card input{width:100%;min-height:44px}
.beta-auth-email-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:rgba(255,255,255,.02);font-size:.68rem}.beta-auth-email-row button{border:0;background:transparent;color:var(--accent);font-size:.63rem;font-weight:800;cursor:pointer}.beta-auth-status{min-height:18px;margin-top:12px;color:var(--muted);font-size:.66rem}.beta-auth-status.error{color:#ff8b93}.beta-auth-status.success{color:var(--accent)}body.beta-auth-open{overflow:hidden}
@media(max-width:760px){.beta-login-button{left:14px;bottom:14px;z-index:62}body.nav-open .beta-login-button{display:none}.beta-auth-card{padding:22px 18px}}

/* Beta login controls — static in sidebar above Light Mode */
.beta-account-controls{
  display:grid;
  gap:8px;
  margin:0 0 10px;
}
.beta-sidebar-account-button,
.beta-sidebar-signup-button{
  width:100%;
  min-height:40px;
  padding:0 14px;
  border-radius:999px;
  font-size:.72rem;
  font-weight:800;
  cursor:pointer;
}
.beta-sidebar-account-button{
  border:1px solid rgba(91,224,193,.34);
  background:rgba(91,224,193,.09);
  color:#dff9f3;
}
.beta-sidebar-signup-button{
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--text-soft);
}
.beta-sidebar-account-button:hover,
.beta-sidebar-signup-button:hover{
  border-color:rgba(91,224,193,.62);
}
.beta-sidebar-account-button.logged-in{
  background:rgba(91,224,193,.16);
  color:var(--accent);
}
.beta-account-controls.authenticated .beta-sidebar-signup-button{
  display:none;
}

.beta-auth-modal[hidden]{display:none!important}
.beta-auth-modal{
  position:fixed;
  inset:0;
  z-index:2000;
  display:grid;
  place-items:center;
  padding:18px;
}
.beta-auth-backdrop{
  position:absolute;
  inset:0;
  border:0;
  background:rgba(0,7,10,.72);
  backdrop-filter:blur(5px);
}
.beta-auth-card{
  position:relative;
  z-index:1;
  width:min(430px,100%);
  padding:26px;
  border:1px solid var(--line-strong);
  border-radius:18px;
  background:linear-gradient(180deg,#0b1d23,#08171d);
  box-shadow:0 26px 80px rgba(0,0,0,.45);
}
.beta-auth-close{
  position:absolute;
  right:14px;
  top:12px;
  width:34px;
  height:34px;
  border:1px solid var(--line);
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  font-size:1.15rem;
}
.beta-auth-brand{
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:18px;
}
.beta-auth-brand strong{font-size:1rem}
.beta-auth-brand span{
  padding:4px 7px;
  border-radius:999px;
  background:rgba(91,224,193,.1);
  color:var(--accent);
  font-size:.58rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.beta-auth-card h2{margin:0 0 6px;font-size:1.4rem}
.beta-auth-card>p{margin:0 0 18px;color:var(--muted);font-size:.72rem}
.beta-auth-card form{display:grid;gap:13px}
.beta-auth-card label{
  display:grid;
  gap:6px;
  font-size:.66rem;
  font-weight:700;
  color:var(--muted);
}
.beta-auth-card input{width:100%;min-height:44px}
.beta-auth-status{
  min-height:18px;
  margin-top:12px;
  color:var(--muted);
  font-size:.66rem;
}
.beta-auth-status.error{color:#ff8b93}
.beta-auth-status.success{color:var(--accent)}
body.beta-auth-open{overflow:hidden}
@media(max-width:760px){
  .beta-auth-card{padding:22px 18px}
}


/* Beta logged-in account control */
.beta-sidebar-account-button.logged-in{
  min-height:48px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  line-height:1.05;
}
.beta-sidebar-account-button.logged-in span{
  font-size:.72rem;
  font-weight:850;
}
.beta-sidebar-account-button.logged-in small{
  display:block;
  font-size:.54rem;
  font-weight:700;
  color:var(--muted);
  letter-spacing:.02em;
}
.beta-sidebar-account-button.logged-in:hover small{
  color:var(--accent);
}

.beta-forgot-link{justify-self:center;border:0;background:transparent;color:var(--muted);font-size:.64rem;font-weight:700;cursor:pointer}.beta-forgot-link:hover{color:var(--accent)}

.beta-support-reset-button{display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;text-decoration:none;margin-top:8px}
.beta-support-reset-note{margin-top:12px!important;font-size:.64rem!important;line-height:1.5!important}

.beta-change-password-button[hidden]{display:none!important}
.beta-account-controls.authenticated .beta-change-password-button{display:block}

.platform-return-link{display:flex;align-items:center;min-height:34px;padding:0 10px;margin-bottom:8px;border:1px solid var(--line);border-radius:9px;color:var(--muted);text-decoration:none;font-size:.64rem;font-weight:800}
.platform-return-link:hover{border-color:var(--accent);color:var(--accent)}

/* Costyra top UI — aligned with Labryva inspection app */
.cost-inspection-topbar{
  min-height:66px;height:66px;padding:0 18px;
  background:#0f172a!important;border-bottom:1px solid #1e293b!important;
  box-shadow:0 2px 14px rgba(2,6,23,.18);
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  overflow:visible!important;
}
.cost-top-left,.cost-top-right{display:flex;align-items:center;gap:12px;min-width:0}
.cost-top-brand{display:flex;align-items:center;gap:9px;text-decoration:none;color:#fff;flex:0 0 auto}
.cost-top-mark{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:#0b3437;border:1px solid #238f85;color:#5eead4;font-weight:950}
.cost-top-brand-copy strong{display:block;font-size:13px;letter-spacing:.08em;color:#fff}
.cost-top-brand-copy small{display:block;margin-top:2px;color:#2dd4bf;font-size:7.5px;letter-spacing:.09em;font-weight:900;white-space:nowrap}
.cost-lab-chip{display:flex;align-items:center;gap:8px;max-width:380px;min-width:240px;padding:7px 10px;border:1px solid #233149;border-radius:9px;background:#111c2f;color:#cbd5e1}
.cost-lab-chip>span{color:#7dd3fc}.cost-lab-chip>div{min-width:0}
.cost-lab-chip strong{display:block;color:#fff;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cost-lab-chip small{display:block;color:#94a3b8;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1px}
.cost-top-action{min-height:38px;padding:0 13px;border-radius:9px;font-size:10px;font-weight:900;cursor:pointer}
.cost-top-action.secondary{border:1px solid #334155;background:#111c2f;color:#e2e8f0}
.cost-top-action.primary{border:1px solid #0f8b80;background:#0f8b80;color:#fff}
.cost-top-action:hover{filter:brightness(1.08)}
.cost-account-wrap{position:relative;display:flex;align-items:center;gap:7px}
.cost-guest-login,.cost-guest-signup{min-height:38px;padding:0 12px;border-radius:9px;font-size:10px;font-weight:900;cursor:pointer}
.cost-guest-login{border:1px solid #334155;background:#111c2f;color:#fff}
.cost-guest-signup{border:1px solid #0f766e;background:#0b3437;color:#75ead7}
.cost-user-button{min-height:48px;display:flex;align-items:center;gap:8px;border:1px solid #334155;background:#111c2f;color:#fff;border-radius:10px;padding:5px 9px;cursor:pointer}
.cost-user-button[hidden]{display:none!important}
.cost-avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#0f766e;border:1px solid #2dd4bf66;font-size:10px;font-weight:950;color:#fff}
.cost-user-meta{text-align:left;min-width:0}.cost-user-meta strong{display:block;max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px}.cost-user-meta small{display:block;color:#94a3b8;font-size:8px;margin-top:2px}
.cost-user-chevron{font-size:17px;margin-left:3px}
.cost-user-dropdown{position:absolute;right:0;top:55px;width:300px;background:#fff;color:#0f172a;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 18px 50px rgba(15,23,42,.25);overflow:hidden;z-index:100}
.cost-user-dropdown[hidden]{display:none!important}
.cost-user-dropdown-head{padding:15px 16px;background:#f8fafc;border-bottom:1px solid #e2e8f0}
.cost-user-dropdown-head strong{display:block;font-size:13px}.cost-user-dropdown-head span{display:block;margin-top:3px;color:#64748b;font-size:10px}
.cost-dropdown-item{width:100%;min-height:48px;border:0;border-radius:0;background:#fff;text-align:left;padding:0 16px;color:#334155;font-size:12px;cursor:pointer;margin:0}
.cost-dropdown-item:hover{background:#f8fafc}.cost-dropdown-item.danger{color:#be123c;border-top:1px solid #f1f5f9}
.beta-change-password-button[hidden]{display:none!important}
@media(max-width:1100px){.cost-top-brand-copy small{display:none}.cost-lab-chip{min-width:180px;max-width:260px}.cost-user-meta{display:none}}
@media(max-width:760px){
 .cost-inspection-topbar{padding:0 10px;gap:8px}
 .cost-lab-chip{display:none}.cost-top-brand-copy{display:none}
 .cost-top-action{padding:0 9px;font-size:9px}
 .cost-guest-signup{display:none}
 .cost-user-button{padding:4px 7px}
}
@media(max-width:470px){.cost-top-action.secondary{display:none}.cost-top-right{gap:6px}}

/* Cost Analysis top bar aligned with Inspection Readiness */
.cost-inspection-topbar{
  position:fixed !important;
  top:0 !important;
  left:0 !important;
  right:0 !important;
  width:100% !important;
  margin:0 !important;
  z-index:90 !important;
}
.main{padding-top:66px}
.sidebar{top:66px !important}
.platform-return-link{display:none !important}

.cost-guest-user-button[hidden]{display:none!important}
#cost-guest-dropdown[hidden]{display:none!important}

/* Critical top-bar interaction reliability */
.cost-top-brand,.cost-account-wrap,.cost-user-button{pointer-events:auto!important;position:relative;z-index:3}
.cost-top-brand{cursor:pointer}

.cost-home-button{
  appearance:none;
  -webkit-appearance:none;
  border:0!important;
  background:transparent!important;
  padding:0!important;
  margin:0!important;
  font:inherit;
  text-align:left;
  cursor:pointer!important;
  pointer-events:auto!important;
  position:relative!important;
  z-index:120!important;
}
.cost-home-button *{
  pointer-events:none!important;
}
.cost-inspection-topbar{
  pointer-events:auto!important;
}

/* Labryva home control uses the exact Inspection Readiness anchor behavior. */
.cost-top-brand{
  display:flex !important;
  align-items:center !important;
  pointer-events:auto !important;
  cursor:pointer !important;
  position:relative !important;
  z-index:200 !important;
}
.cost-top-brand *{pointer-events:none !important;}


/* 2026-08-09 top-bar alignment with Inspection Readiness */
.cost-top-brand-copy{display:none !important;}
.cost-top-brand{gap:0 !important;min-width:36px;}
.cost-inspection-topbar{
  position:sticky !important;
  top:0 !important;
  left:auto !important;
  right:auto !important;
  width:100% !important;
  min-height:66px !important;
  height:66px !important;
  padding:0 14px !important;
  border-bottom:1px solid #1e293b !important;
  background:#0f172a !important;
  box-shadow:0 2px 14px rgba(2,6,23,.18) !important;
}
.main{padding-top:0 !important;}
.sidebar{
  top:66px !important;
  height:calc(100vh - 66px) !important;
}
.sidebar-head,
.workspace-chip{display:none !important;}
.nav{padding-top:12px !important;}
@media(max-width:760px){
  .cost-inspection-topbar{position:static !important;padding:0 10px !important;}
  .sidebar-head{display:flex !important;}
  .workspace-chip{display:flex !important;}
}


/* === Inspection Readiness topbar parity pass — 2026-08-09 ===
   Desktop shell now follows the same structure: full-width topbar above sidebar + main. */
#global-topbar.cost-inspection-topbar{
  box-sizing:border-box !important;
  position:sticky !important;
  top:0 !important;
  left:auto !important;
  right:auto !important;
  width:100% !important;
  min-width:100% !important;
  height:66px !important;
  min-height:66px !important;
  margin:0 !important;
  padding:0 18px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  color:#fff !important;
  background:#0f172a !important;
  border:0 !important;
  border-bottom:1px solid #1e293b !important;
  box-shadow:0 2px 14px rgba(2,6,23,.18) !important;
  overflow:visible !important;
  z-index:90 !important;
}
#global-topbar .cost-top-left,
#global-topbar .cost-top-right{
  display:flex !important;
  align-items:center !important;
  gap:12px !important;
  min-width:0 !important;
}
#global-topbar .cost-top-right{margin-left:auto !important;}

/* Icon-only home control: removes the duplicate product branding requested by the user. */
#global-topbar .cost-top-brand{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:36px !important;
  min-width:36px !important;
  height:36px !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  color:#fff !important;
  text-decoration:none !important;
  cursor:pointer !important;
  position:relative !important;
  z-index:2 !important;
}
#global-topbar .cost-top-brand-copy{display:none !important;}
#global-topbar .cost-top-mark{
  width:36px !important;
  height:36px !important;
  margin:0 !important;
  border-radius:10px !important;
  display:grid !important;
  place-items:center !important;
  background:rgba(20,184,166,.15) !important;
  border:1px solid rgba(45,212,191,.35) !important;
  color:#5eead4 !important;
  font-size:16px !important;
  font-weight:900 !important;
}

/* Match Inspection's lab/context chip sizing. */
#global-topbar .cost-lab-chip{
  display:flex !important;
  align-items:center !important;
  gap:7px !important;
  min-width:0 !important;
  max-width:370px !important;
  padding:7px 10px !important;
  border:1px solid #233149 !important;
  border-radius:9px !important;
  background:#111c2f !important;
  color:#cbd5e1 !important;
  box-shadow:none !important;
}
#global-topbar .cost-lab-chip>span{color:#7dd3fc !important;font-size:11px !important;}
#global-topbar .cost-lab-chip strong{
  display:block !important;
  color:#fff !important;
  font-size:11px !important;
  line-height:1.15 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
#global-topbar .cost-lab-chip small{
  display:block !important;
  color:#94a3b8 !important;
  font-size:9px !important;
  line-height:1.15 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  margin-top:1px !important;
}

/* Match Inspection's compact top-right button proportions. */
#global-topbar .cost-top-action{
  box-sizing:border-box !important;
  min-height:34px !important;
  height:34px !important;
  padding:0 10px !important;
  border-radius:10px !important;
  font-size:12px !important;
  line-height:1 !important;
  font-weight:800 !important;
  box-shadow:none !important;
}
#global-topbar .cost-top-action.secondary{
  border:1px solid #334155 !important;
  background:#111c2f !important;
  color:#e2e8f0 !important;
}
#global-topbar .cost-top-action.primary{
  border:0 !important;
  background:#0f766e !important;
  color:#fff !important;
}

/* Account button mirrors Inspection's avatar button dimensions. */
#global-topbar .cost-account-wrap{position:relative !important;display:flex !important;align-items:center !important;gap:7px !important;}
#global-topbar .cost-user-button{
  box-sizing:border-box !important;
  min-height:42px !important;
  height:42px !important;
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  padding:5px 9px !important;
  border:1px solid #334155 !important;
  border-radius:10px !important;
  background:#111c2f !important;
  color:#fff !important;
  box-shadow:none !important;
}
#global-topbar .cost-user-button[hidden]{display:none !important;}
#global-topbar .cost-avatar{
  width:32px !important;
  min-width:32px !important;
  height:32px !important;
  border-radius:50% !important;
  display:grid !important;
  place-items:center !important;
  background:#115e59 !important;
  border:1px solid #2dd4bf66 !important;
  color:#fff !important;
  font-size:11px !important;
  font-weight:900 !important;
}
#global-topbar .cost-user-meta{text-align:left !important;min-width:0 !important;}
#global-topbar .cost-user-meta strong{
  display:block !important;
  max-width:150px !important;
  color:#fff !important;
  font-size:11px !important;
  line-height:1.15 !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
#global-topbar .cost-user-meta small{
  display:block !important;
  color:#94a3b8 !important;
  font-size:9px !important;
  line-height:1.15 !important;
  margin-top:2px !important;
}
#global-topbar .cost-user-chevron{font-size:14px !important;margin-left:2px !important;}
#global-topbar .cost-user-dropdown{
  top:46px !important;
  right:0 !important;
  width:250px !important;
  border:1px solid #e2e8f0 !important;
  border-radius:12px !important;
  box-shadow:0 18px 50px rgba(15,23,42,.16) !important;
}

/* Topbar is now outside the grid. Sidebar and main begin directly below it. */
.app-shell{
  min-height:calc(100vh - 66px) !important;
  grid-template-columns:var(--sidebar-width) minmax(0,1fr) !important;
}
.main{
  min-width:0 !important;
  padding-top:0 !important;
}
.sidebar{
  top:66px !important;
  height:calc(100vh - 66px) !important;
}
.sidebar-head,
.workspace-chip{display:none !important;}
.nav{padding-top:12px !important;}

@media(max-width:1100px){
  #global-topbar .cost-lab-chip{min-width:180px !important;max-width:260px !important;}
}

/* Keep the existing dedicated mobile header; don't render two headers on phones. */
@media(max-width:760px){
  #global-topbar.cost-inspection-topbar{display:none !important;}
  .app-shell{min-height:calc(100vh - 62px) !important;}
  .sidebar{
    top:0 !important;
    height:100dvh !important;
  }
  .sidebar-head{display:flex !important;}
  .workspace-chip{display:flex !important;}
}


/* === Inspection-brand parity pass — 2026-08-09 === */
#global-topbar .cost-top-left{
  gap:14px !important;
}
#global-topbar .cost-top-brand.cost-brand-expanded{
  width:auto !important;
  min-width:0 !important;
  height:auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:12px !important;
  padding:0 !important;
}
#global-topbar .cost-top-brand.cost-brand-expanded .cost-top-mark{
  width:36px !important;
  min-width:36px !important;
  height:36px !important;
  border-radius:10px !important;
}
#global-topbar .cost-top-brand.cost-brand-expanded .cost-top-brand-copy{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:center !important;
  line-height:1 !important;
}
#global-topbar .cost-top-brand-title{
  display:block !important;
  color:#ffffff !important;
  font-size:14px !important;
  line-height:1 !important;
  font-weight:900 !important;
  letter-spacing:.08em !important;
}
#global-topbar .cost-top-brand-sub{
  display:block !important;
  margin-top:4px !important;
  color:#2dd4bf !important;
  font-size:10px !important;
  line-height:1 !important;
  font-weight:800 !important;
  letter-spacing:.12em !important;
  white-space:nowrap !important;
}
#global-topbar .cost-lab-chip{display:none !important;}

@media(max-width:900px){
  #global-topbar .cost-top-brand-sub{font-size:9px !important;}
  #global-topbar .cost-top-brand-title{font-size:13px !important;}
}
@media(max-width:760px){
  #global-topbar .cost-top-brand-copy{display:none !important;}
}


/* === Account state must be mutually exclusive === */
#beta-account-controls[data-auth-state="signed-in"] #cost-guest-user-button,
#beta-account-controls[data-auth-state="signed-in"] #cost-guest-dropdown{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

#beta-account-controls[data-auth-state="signed-in"] #cost-user-button{
  display:flex !important;
  visibility:visible !important;
}

#beta-account-controls[data-auth-state="signed-out"] #cost-user-button,
#beta-account-controls[data-auth-state="signed-out"] #cost-user-dropdown{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

#beta-account-controls[data-auth-state="signed-out"] #cost-guest-user-button{
  display:flex !important;
  visibility:visible !important;
}


/* Cost Analysis view-state safety.
   Keeps inactive application modules hidden even if a stale base stylesheet
   is served during an overlay update. */
.view{display:none !important;}
.view.active{display:block !important;}
