/* RWS Jarvis — design tokens and base components, taken from rws-jarvis/template/. */

:root {
  --bg: #050607;
  --bg-deep: #08090B;
  --surface-1: #0A0B0D;
  --surface-2: #111317;
  --surface-glass: rgba(17, 19, 23, .82);
  --surface-3: #1C2026;
  --ask-bg: rgba(20, 23, 28, .92);

  --text: #ECEBE7;
  --text-2: #A3A6AC;
  --text-3: #8A8D93;
  --muted: #6E7278;

  --accent: #9ED3E6;
  --accent-soft: rgba(158, 211, 230, .5);
  --accent-ring: rgba(158, 211, 230, .12);
  --positive: #5FCB8E;
  --warning: #E3B866;
  --negative: #E98A7A;
  --data: #82E2C8;

  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .08);
  --line-3: rgba(255, 255, 255, .1);

  --font: Geist, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 16px;

  color-scheme: dark;
}

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

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  color: var(--muted);
}

.meta {
  font: 400 11px/1.4 var(--mono);
  color: var(--muted);
}

.kbd {
  flex: none;
  padding: 5px 7px;
  border: 1px solid var(--line-3);
  border-radius: 5px;
  font: 400 10px/1 var(--mono);
  color: var(--muted);
}

/* Buttons & fields ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-sm);
  font: 600 14px/1 var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, opacity .15s ease;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn--primary { background: var(--text); color: var(--surface-1); }
.btn--primary:hover:not(:disabled) { background: #fff; color: var(--surface-1); }
.btn--ghost {
  height: 36px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-3);
  font-weight: 500;
  font-size: 13px;
}
.btn--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .04); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font: 500 12px/1 var(--font); color: var(--text-2); }
.field__input {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, .09);
  color: var(--text);
  font: 400 14px/1 var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field__input:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.field__input[type="password"] { letter-spacing: .2em; }

.form-error {
  margin: 0;
  font: 400 13px/1.45 var(--font);
  color: var(--warning);
}

.notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(227, 184, 102, .08);
  border: 1px solid rgba(227, 184, 102, .2);
  font: 400 13px/1.45 var(--font);
  color: var(--text-2);
}

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

.page-login { background: var(--bg-deep); }

.login {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 80px;
}

.login__orb {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -58%);
  opacity: .55;
  pointer-events: none;
  transition: opacity .6s ease, transform .6s ease;
}
.login__orb canvas { display: block; }

.login__veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(8, 9, 11, .2) 0%, rgba(8, 9, 11, .75) 38%, rgba(8, 9, 11, .2) 70%);
  pointer-events: none;
}

.login__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  transition: opacity .5s ease, transform .5s ease;
}

.login__logo { display: block; height: 44px; width: auto; }

.login__wordmark {
  margin-top: 18px;
  padding-left: .5em;
  font: 400 12px/1 var(--font);
  letter-spacing: .5em;
  color: var(--text-2);
}

.login__tagline {
  margin-top: 14px;
  font: 400 10.5px/1 var(--mono);
  letter-spacing: .14em;
  color: var(--muted);
}

.login__card {
  width: 340px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 44px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: rgba(17, 19, 23, .82);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(6px);
}
.login__card .btn { margin-top: 4px; }

.login__footer {
  position: absolute;
  left: 0; right: 0; bottom: 30px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0 16px;
  font: 400 10.5px/1 var(--mono);
  letter-spacing: .06em;
  color: var(--muted);
}

/* Successful login: the orb wakes and comes forward while the form recedes. */
.is-authenticated .login__orb { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
.is-authenticated .login__content { opacity: 0; transform: translateY(-8px); }
.is-authenticated .login__footer { opacity: 0; transition: opacity .4s ease; }

/* Top bar -------------------------------------------------------------------- */

.topbar {
  position: relative;
  z-index: 5; /* above the resting orb (3) so the account menu covers it */
  height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.topbar__left, .topbar__right { display: flex; align-items: center; }
.topbar__left { gap: 36px; min-width: 0; }
.topbar__right { gap: 18px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__logo { display: block; height: 15px; width: auto; }
.brand__divider { width: 1px; height: 14px; background: rgba(255, 255, 255, .18); }
.brand__name { font: 400 11px/1 var(--font); letter-spacing: .34em; color: var(--text-2); }

.topbar__nav { display: flex; gap: 22px; }
.topbar__link {
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  font: 500 13px/1 var(--font);
  color: var(--muted);
  text-decoration: none;
}
.topbar__link:hover { color: var(--text); }
.topbar__link.is-active { color: var(--text); border-bottom-color: var(--accent); }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 11px/1 var(--mono);
  color: var(--muted);
}
.status__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.status__dot.is-live { background: var(--positive); }
.status__dot.is-warn { background: var(--warning); }


.user-menu { position: relative; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 11px/1 var(--font);
  color: var(--text-2);
  cursor: pointer;
}

.user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
  width: 264px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}
.user-menu__identity { display: flex; align-items: center; gap: 12px; padding: 12px 10px 14px; }
.user-menu__avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  font: 600 13px/1 var(--font);
  color: var(--text);
}
.user-menu__who { min-width: 0; }
.user-menu__name { font: 500 14px/1.3 var(--font); }
.user-menu__email { font: 400 11.5px/1.4 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__list { display: flex; flex-direction: column; padding: 4px 0; border-top: 1px solid var(--line); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: 400 13.5px/1.2 var(--font);
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
}
.menu-item svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, .05); color: var(--text); outline: none; }
.menu-item--danger:hover, .menu-item--danger:focus-visible { background: rgba(233, 138, 122, .08); color: var(--negative); }
.menu-item:disabled { opacity: .6; cursor: default; }

/* Dashboard ------------------------------------------------------------------ */

.dashboard {
  position: relative;
  z-index: 1;
  padding: 32px 48px 240px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  opacity: 0;
  transition: opacity .3s ease;
}
.is-ready .dashboard { opacity: 1; }

.greeting {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.greeting__title {
  margin: 10px 0 0;
  font: 400 34px/1.15 var(--font);
  letter-spacing: -.02em;
}
.greeting__lead {
  margin: 6px 0 0;
  max-width: 720px;
  font: 400 15px/1.5 var(--font);
  color: var(--text-2);
}

.panel {
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel__title { margin: 0; font: 500 14px/1.3 var(--font); }
.panel__empty { margin: 0; color: var(--text-2); }

/* Ask bar -------------------------------------------------------------------- */

.askdock {
  z-index: 20;
  position: fixed;
  left: 0; right: 0; bottom: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  pointer-events: none;
}

.askbar {
  pointer-events: auto;
  width: 620px;
  max-width: 100%;
  height: 56px;
  padding: 0 8px 0 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ask-bg);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.askbar canvas { flex: none; width: 36px; height: 36px; }
.askbar.is-live { border-color: rgba(158, 211, 230, .45); }

.askbar__form {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.answer {
  pointer-events: auto;
  max-width: 720px;
  margin: 0;
  text-align: center;
  font: 400 16px/1.5 var(--font);
  color: var(--text);
  text-wrap: pretty;
}
.answer.is-pending { color: var(--muted); }
.answer.is-error { color: var(--warning); }

.suggestions {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: transparent;
  font: 400 12px/1.2 var(--font);
  color: var(--text-2);
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--line-3); }
/* Once a conversation starts, the answer replaces the suggestions. */
.answer:not([hidden]) + .suggestions { display: none; }

.mic.is-live { background: var(--accent); }
.mic.is-live .mic__body { border-color: var(--surface-1); }
.mic.is-live .mic__stem { background: var(--surface-1); }

/* Stage: the large orb while Jarvis listens and thinks. The dashboard stays visible but recedes. */
.dashboard, .topbar { transition: opacity .35s ease, filter .35s ease; }
.is-staged .dashboard,
.is-staged .topbar { opacity: .25; filter: blur(1.5px); }
.askdock { transition: opacity .25s ease; }
/* Fade the page out behind the subtitle and ask bar so scrolled content never collides with them. */
.askdock::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 0; right: 0; bottom: -26px;
  height: calc(100% + 80px);
  background: linear-gradient(to bottom, rgba(5, 6, 7, 0), var(--bg) 55%);
  pointer-events: none;
}
.is-staged .askdock { opacity: 0; pointer-events: none; }

.stage {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 0;
  pointer-events: none;
}
.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(10, 11, 13, .3) 0%, rgba(10, 11, 13, .88) 60%);
  transition: opacity .5s ease;
}
.stage > * { position: relative; }
.stage__text {
  position: absolute;
  z-index: 1;
  left: 16px; right: 16px;
  top: calc(44vh + var(--orb-size, 440px) / 2 - 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stage__label {
  margin-top: 16px;
  min-height: 11px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .2em;
  color: var(--accent);
  animation: jv-shimmer 1.6s ease-in-out infinite;
}
.stage.is-listening .stage__label { animation: none; }
.stage__transcript {
  margin-top: 18px;
  max-width: 800px;
  text-align: center;
  font: 300 30px/1.3 var(--font);
  letter-spacing: -.015em;
}
.stage__hints {
  position: absolute;
  left: 0; right: 0; bottom: 30px;
  display: none;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  font: 400 11px/1 var(--mono);
  color: var(--muted);
}
.stage.is-listening .stage__hints { display: flex; }
.stage .listening__wave { visibility: hidden; }
.stage.is-listening .listening__wave { visibility: visible; }

/* The persistent orb: always alive behind the dashboard, forward when listening or thinking,
   and back behind the charts when an answer is on screen. */
.ambient {
  position: fixed;
  z-index: 3;
  left: 0;
  top: 0;
  line-height: 0;
  pointer-events: none;
  transform-origin: 0 0;
  /* Placed by ambient.js onto the active .orb-slot, or the screen center while staged. */
  transform: translate(var(--orb-x, 50vw), var(--orb-y, 44vh)) scale(var(--orb-scale, .3)) translate(-50%, -50%);
  transition: transform .8s cubic-bezier(.2, .75, .15, 1);
}
.ambient.is-tracking { transition: none; }
.is-staged .ambient { z-index: 25; }
.ambient canvas { transition: scale .5s ease; }
body[data-jarvis="listening"] .ambient canvas { scale: 1.08; }
/* Scaled down into its slot the fine synapses get thin; brighten them so Jarvis reads as alive. */
body:not(.is-staged) .ambient canvas { filter: brightness(1.8); }

.orb-slot { width: 132px; height: 132px; flex: none; }
.orb-slot--small { width: 72px; height: 72px; }
.greeting__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.stage { z-index: 20; }
.stage .stage__text, .stage .stage__hints { z-index: 30; }

.listening__wave { display: flex; align-items: center; gap: 4px; height: 26px; margin-top: 6px; }
.listening__wave span {
  width: 3px;
  height: 26px;
  border-radius: 2px;
  background: var(--accent);
  animation: jv-wave 1s ease-in-out infinite;
}
.listening__wave span:nth-child(2) { animation-delay: .15s; }
.listening__wave span:nth-child(3) { animation-delay: .3s; }
.listening__wave span:nth-child(4) { animation-delay: .45s; }
.listening__wave span:nth-child(5) { animation-delay: .6s; }
.listening__wave span:nth-child(6) { animation-delay: .75s; }
.listening__wave span:nth-child(7) { animation-delay: .9s; }

@keyframes jv-shimmer {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

/* Answer view: the dashboard Jarvis composes for a question ---------------- */

.answer-view { display: flex; flex-direction: column; gap: 20px; }
.answer-view__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.answer-view__title { margin: 10px 0 6px; font: 500 30px/1.15 var(--font); letter-spacing: -.02em; }
.answer-view__side { display: flex; align-items: center; gap: 18px; }
.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: 400 12px/1 var(--font);
  color: var(--text-2);
  cursor: pointer;
}
.link-button:hover { color: var(--text); }

.kpi-row { display: grid; grid-template-columns: repeat(var(--kpis, 4), minmax(0, 1fr)); gap: 14px; }
.kpi {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
}
/* Loading placeholders: the same shapes as the dashboard that is coming, with a soft sweep. */
.kpi--skeleton { height: 112px; justify-content: center; }
.sk {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .045) 25%, rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, .045) 75%);
  background-size: 300% 100%;
  animation: jv-sweep 1.8s ease-in-out infinite;
}
.sk--context { width: 280px; max-width: 70%; height: 9px; }
.sk--label { width: 45%; height: 8px; }
.sk--value { width: 62%; height: 26px; border-radius: 6px; }
.sk--foot { width: 35%; height: 8px; }
.sk--title { width: 38%; height: 11px; margin-bottom: 6px; }
.sk-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 14px; }
.sk--row-label { height: 8px; }
.sk-row--1 .sk--row-track { width: 72%; }
.sk-row--2 .sk--row-track { width: 88%; }
.sk-row--3 .sk--row-track { width: 54%; }
.viz-panel--skeleton { min-height: 196px; }
@keyframes jv-sweep {
  from { background-position: 100% 0; }
  to { background-position: -50% 0; }
}
.home-view:not([hidden]) { display: flex; flex-direction: column; gap: 28px; }
.greeting__lead.is-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.greeting__lead.is-loading::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #841B18;
  box-shadow: 0 0 8px rgba(132, 27, 24, .8);
  animation: voice-pulse 1.2s ease-in-out infinite;
}
.pending-companies:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pending-companies__label { margin-right: 4px; letter-spacing: .08em; text-transform: uppercase; }
.pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 999px;
  font: 400 12px/1.2 var(--font);
  color: var(--text-2);
}
.pending-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .6; }
.overview { display: flex; flex-direction: column; gap: 34px; }
.overview__company { display: flex; flex-direction: column; gap: 14px; }
.overview__company[hidden] { display: none; }
.overview__company.is-loading .kpi-row, .overview__company.is-loading .viz-grid { opacity: .4; transition: opacity .2s ease; }
.overview__context { font-size: 12.5px; letter-spacing: .08em; color: var(--text-3); }
.company-tabs { display: flex; flex-wrap: wrap; gap: 4px 26px; margin-bottom: -12px; border-bottom: 1px solid var(--line); }
.company-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: 500 16.5px/1.2 var(--font);
  color: var(--text-2);
  cursor: pointer;
}
.company-tab:hover { color: var(--text); }
.company-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.company-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.company-tiles { display: grid; grid-template-columns: repeat(var(--tiles, 4), minmax(0, 1fr)); gap: 14px; }
.company-tile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
  background: var(--surface-glass);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, opacity .45s ease;
}
.company-tile:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.company-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.company-tile.is-pending { opacity: 0; transform: translateY(10px); }
.company-tile__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.company-tile__name { font: 500 15px/1.2 var(--font); }
.company-tile__figures { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.company-tile__figures div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.company-tile__figures dt { font: 500 11.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-tile__figures dd { margin: 0; font: 500 16.5px/1.2 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.company-tile__delta { margin-left: 8px; font-size: 11.5px; }
.company-tile__delta.is-pos { color: var(--positive); }
.company-tile__delta.is-neg { color: var(--negative); }
.company-tile__delta.is-warn { color: var(--warning); }
.company-tile__system { margin-top: auto; font: 400 11px/1 var(--mono); color: var(--muted); }
.company-tile:hover .company-tile__system { color: var(--accent); }
@media (max-width: 1199px) { .company-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .company-tiles { grid-template-columns: 1fr; } }

.company-tab__health { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.company-tab__health--ok { background: var(--positive); }
.company-tab__health--watch { background: var(--warning); }
.company-tab__health--critical { background: var(--negative); box-shadow: 0 0 8px rgba(233, 138, 122, .6); }
.company-tab__badge {
  min-width: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(233, 138, 122, .14);
  border: 1px solid rgba(233, 138, 122, .35);
  font: 500 10.5px/1.2 var(--mono);
  color: var(--negative);
  text-align: center;
}
.overview__head .overview__context { flex: 1; min-width: 0; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .02); }
.segmented__option {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 500 13.5px/1.2 var(--font);
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
}
.segmented__option:hover { color: var(--text); }
.segmented__option[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.segmented__option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kpi__label { font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.kpi__value { font: 400 36px/1 var(--font); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi__foot { display: flex; align-items: center; gap: 6px; min-height: 16px; font: 500 13.5px/1.2 var(--font); }
.kpi__note { color: var(--muted); font-weight: 400; }
.kpi--pos .kpi__delta { color: var(--positive); }
.kpi--neg .kpi__delta { color: var(--negative); }
.kpi--warn .kpi__delta { color: var(--warning); }
.kpi--neutral .kpi__delta { color: var(--text-2); }

.viz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
/* Home: panels keep their own height instead of stretching to the tallest one (no empty cards). */
.overview .viz-grid { align-items: start; }
.viz-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 22px 24px;
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
}
.viz-panel--wide { grid-column: 1 / -1; }
.viz-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.viz-panel__title { font: 500 16px/1.3 var(--font); }
.viz-legend { display: flex; gap: 16px; font: 400 12.5px/1 var(--font); color: var(--text-2); }
.viz-legend__item { display: flex; align-items: center; gap: 6px; }
.viz-legend__swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.viz-legend__swatch--1 { background: #3A3E45; }
.viz-legend__swatch--2 { background: var(--data); }

/* Reveal: components compose themselves after the orb lands. */
.kpi, .viz-panel { transition: opacity .45s ease, transform .45s ease; }
.kpi.is-pending, .viz-panel.is-pending { opacity: 0; transform: translateY(10px); }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bars__row { display: grid; grid-template-columns: minmax(64px, 110px) minmax(80px, 1fr) auto; align-items: center; gap: 14px; }
.bars__label { font: 500 14.5px/1.3 var(--font); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__tracks { display: flex; flex-direction: column; gap: 4px; }
.bars__track { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .04); overflow: hidden; }
.bars__fill {
  height: 100%;
  width: var(--w);
  border-radius: 5px;
  background: var(--accent);
  transform-origin: left;
  animation: jv-grow .8s cubic-bezier(.2, .75, .15, 1) both;
}
.bars__track + .bars__track { height: 6px; }
.bars__fill--1 { background: #3A3E45; }
.bars__fill--2 { background: var(--data); }
.bars__fill.is-negative { background: var(--negative); }
/* Period comparison: one grid for every row, so names, bars and figures line up in columns. */
.compare { display: grid; grid-template-columns: minmax(120px, max-content) minmax(90px, 1fr) repeat(3, max-content); align-items: center; column-gap: 22px; row-gap: 0; }
.compare > * { padding: 11px 0; border-bottom: 1px solid var(--line); }
.compare > :nth-last-child(-n+5) { border-bottom: 0; }
.compare__head { padding-top: 0; font: 500 11px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.compare__head.is-number, .compare__now, .compare__before, .compare__change { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare__label { font: 500 14.5px/1.3 var(--font); color: var(--text); }
.compare__bars { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.compare__bar { display: block; width: var(--w, 0%); min-width: 3px; height: 8px; border-radius: 4px; background: var(--accent); transition: width .8s cubic-bezier(.2, .75, .15, 1); }
.compare__bar--before { height: 5px; background: #4A4F57; }
.viz-panel.is-pending .compare__bar { width: 0; }
.compare__now { font: 500 16px/1 var(--font); }
.compare__before { font: 400 14.5px/1 var(--font); color: var(--text-3); }
.compare__change { min-width: 70px; font: 500 14px/1 var(--font); color: var(--text-2); }
.compare__change.is-pos { color: var(--positive); }
.compare__change.is-neg { color: var(--negative); }
.compare__change.is-warn { color: var(--warning); }
@media (max-width: 767px) {
  .compare { grid-template-columns: minmax(0, 1fr) repeat(3, max-content); column-gap: 12px; }
  .compare__bars, .compare__head:nth-child(2) { display: none; }
  .compare__label { font-size: 13.5px; }
}
.bars__value { min-width: 64px; font: 500 15.5px/1 var(--font); text-align: right; font-variant-numeric: tabular-nums; }
.viz-panel.is-pending .bars__fill { animation: none; transform: scaleX(0); }

/* Revealed left to right (a dash-offset draw breaks with non-scaling strokes). */
.line-chart { display: block; width: 100%; height: 200px; overflow: visible; animation: jv-reveal 1.1s cubic-bezier(.2, .75, .15, 1) both; }
.viz-panel.is-pending .line-chart { animation: none; clip-path: inset(0 100% 0 0); }
.line-chart__axis { stroke: rgba(255, 255, 255, .1); }
.line-chart__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.line-chart__line--1 { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.line-chart__line--2 { stroke: var(--data); }
.line-chart__dot { stroke: var(--accent); stroke-width: 9; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.line-chart__labels { display: flex; justify-content: space-between; gap: 8px; font: 400 12px/1 var(--mono); color: var(--text-3); }
.line-chart__last { font: 400 13px/1 var(--mono); color: var(--text-2); }

/* Chart palette (donut slices, extra series): restrained, readable on the dark surface. */
:root { --viz-0: var(--accent); --viz-1: #C9574B; --viz-2: var(--warning); --viz-3: #6E8FD8; --viz-4: var(--data); --viz-5: #8A8D93; }

/* Server-laid boards: 12 columns, each panel spans what OverviewBuilder chose. */
.viz-grid--sized { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.viz-grid--sized > * { grid-column: span 12; }
.viz-grid--sized > .viz-span-4 { grid-column: span 4; }
.viz-grid--sized > .viz-span-6 { grid-column: span 6; }
.viz-grid--sized > .viz-span-8 { grid-column: span 8; }
/* Board: wide main column + side column; the last side panel runs down beside the main rows. */
.viz-grid--sized { grid-auto-flow: row dense; align-items: start; }
.viz-grid--sized > .viz-col-main { grid-column: 1 / span 8; }
.viz-grid--sized > .viz-col-side { grid-column: 9 / span 4; grid-row: span var(--rows, 1); }
.viz-panel__note { font: 400 11px/1 var(--mono); color: var(--muted); }

.line-chart__area { fill: rgba(158, 211, 230, .08); stroke: none; }

.columns { display: flex; align-items: stretch; gap: 6px; height: 190px; padding-top: 6px; }
.columns__group { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.columns__bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.columns__bar { flex: 1; max-width: 22px; height: var(--h, 0%); min-height: 2px; border-radius: 3px 3px 0 0; background: var(--accent); transition: height .8s cubic-bezier(.2, .75, .15, 1); }
.columns__bar--1 { background: #3A3E45; }
.columns__bar.is-negative { background: var(--negative); }
.columns__bar.is-partial { background: repeating-linear-gradient(-45deg, var(--accent) 0 4px, rgba(158, 211, 230, .45) 4px 8px); }
.viz-panel.is-pending .columns__bar { height: 0; }
.columns__label { font: 400 12px/1 var(--mono); color: var(--text-3); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut__figure { position: relative; width: 150px; height: 150px; flex: none; }
.donut__ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut__track { fill: none; stroke: rgba(255, 255, 255, .05); stroke-width: 11; }
.donut__slice { fill: none; stroke-width: 11; transition: stroke-dasharray .9s cubic-bezier(.2, .75, .15, 1); }
.viz-panel.is-pending .donut__slice { stroke-dasharray: 0 999; }
.donut__slice--0 { stroke: var(--viz-0); background: var(--viz-0); }
.donut__slice--1 { stroke: var(--viz-1); background: var(--viz-1); }
.donut__slice--2 { stroke: var(--viz-2); background: var(--viz-2); }
.donut__slice--3 { stroke: var(--viz-3); background: var(--viz-3); }
.donut__slice--4 { stroke: var(--viz-4); background: var(--viz-4); }
.donut__slice--5 { stroke: var(--viz-5); background: var(--viz-5); }
.donut__slice--critical { stroke: var(--negative); background: var(--negative); }
.donut__slice--watch { stroke: var(--warning); background: var(--warning); }
.donut__slice--ok { stroke: var(--positive); background: var(--positive); }
.donut__slice--info { stroke: var(--accent); background: var(--accent); }
.donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.donut__total { font: 500 19px/1 var(--font); font-variant-numeric: tabular-nums; }
.donut__caption { font: 400 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.donut__legend { flex: 1; min-width: 140px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.donut__item { display: flex; align-items: center; gap: 10px; font: 400 14.5px/1.2 var(--font); color: var(--text-2); }
.donut__swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.donut__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut__share { color: var(--text); font-variant-numeric: tabular-nums; }

/* Each column is at least as wide as its content (never overlapping); a wide table scrolls sideways. */
.viz-table.viz-table--typed { grid-template-columns: repeat(var(--cols), minmax(max-content, 1fr)); column-gap: 18px; }
.viz-table--typed .viz-table__head.is-number { text-align: right; }
.viz-table--typed .viz-table__head:not(.is-number) { text-align: left; }
.viz-table.viz-table--dense { grid-template-columns: minmax(130px, 2.4fr) repeat(calc(var(--cols) - 1), minmax(min-content, 1fr)); column-gap: 12px; font-size: 13px; }
.viz-table.viz-table--dense .viz-table__head { white-space: normal; font-size: 10px; letter-spacing: .05em; line-height: 1.25; align-self: end; }
.viz-table--dense .viz-table__cell.is-first { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.viz-table--dense .viz-table__cell { padding: 8px 0; }
.viz-table__cell.is-key { font-weight: 500; color: var(--text); }
.viz-table__cell.is-link { cursor: pointer; }
.viz-table__cell.is-hover { background: rgba(255, 255, 255, .035); }
.viz-table__cell.is-ref { text-decoration: underline; text-decoration-color: rgba(158, 211, 230, .35); text-underline-offset: 3px; }
.viz-table__cell.is-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.entity-profile { display: flex; flex-direction: column; gap: 14px; padding: 18px 22px; border: 1px solid rgba(255, 255, 255, .07); border-radius: var(--radius); background: var(--surface-glass); }
.entity-profile[hidden] { display: none; }
.entity-profile__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.entity-profile__subtitle { font: 500 16px/1.2 var(--font); }
.entity-profile__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 24px; margin: 0; }
.entity-profile__fact dt { font: 500 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.entity-profile__fact dd { margin: 4px 0 0; font: 400 14px/1.3 var(--font); color: var(--text); }

.viz-table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.viz-table--typed .viz-table__cell, .viz-table--typed .viz-table__head { white-space: nowrap; }
.viz-table--typed > :nth-child(n) { min-width: 0; }
@media (max-width: 767px) {
  .viz-table--typed { min-width: calc(var(--cols) * 92px); }
}
.viz-table__cell.is-pos { color: var(--positive); }
.viz-table__cell.is-total { border-bottom: 0; border-top: 1px solid var(--line-3); color: var(--text); font-weight: 500; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px/1.2 var(--font); color: var(--text-2); }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-pill--ok::before { background: var(--positive); }
.status-pill--watch::before { background: var(--warning); }
.status-pill--critical::before { background: var(--negative); }

.viz-table { display: grid; grid-template-columns: 1.4fr repeat(calc(var(--cols) - 1), minmax(0, 1fr)); font: 400 14.5px/1.35 var(--font); }
.viz-table__head {
  padding: 0 0 8px;
  font: 500 11.5px/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.viz-table__cell { padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.viz-table__cell.is-number, .viz-table__head:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

.viz-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.viz-alert { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.viz-alert:first-child { border-top: 0; padding-top: 0; }
.viz-alert__dot { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--muted); }
.viz-alert--critical .viz-alert__dot { background: var(--negative); }
.viz-alert--high .viz-alert__dot { background: var(--warning); }
.viz-alert--medium .viz-alert__dot { background: var(--accent); }
.viz-alert__body { display: flex; flex-direction: column; gap: 4px; }
.viz-alert.is-link { cursor: pointer; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; transition: background .15s ease; }
.viz-alert.is-link:hover, .viz-alert.is-link:focus-visible { background: rgba(255, 255, 255, .04); outline: none; }
.viz-alert.is-link:focus-visible { box-shadow: 0 0 0 2px var(--accent-soft); }
.dialog.dialog--wide { width: min(1040px, 94vw); max-width: none; }
.dialog--wide .dialog__form { max-height: 86vh; overflow-y: auto; }
/* Alert center -------------------------------------------------------------------------- */
.page-alerts .dashboard { padding-bottom: 80px; gap: 26px; }
.alert-center__body { display: flex; flex-direction: column; gap: 22px; }
.alert-center__body[hidden] { display: none; }
.alert-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.alert-filters__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.alert-filters .segmented { flex-wrap: wrap; border-radius: 20px; max-width: 100%; }
.alert-filters .chip[aria-pressed="true"] { border-color: var(--accent-soft); color: var(--text); background: rgba(158, 211, 230, .08); }
.alert-filters__owner { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.alert-filters__owner[hidden] { display: none; }
.alert-filters__owner .field__input { height: 36px; width: auto; min-width: 170px; color-scheme: dark; }
.alert-list { display: grid; grid-template-columns: 18px minmax(110px, max-content) minmax(0, 1fr) max-content minmax(0, max-content) max-content; column-gap: 18px; align-items: start; }
.alert-list[hidden] { display: none; }
.alert-list__head { padding: 0 0 10px; font: 500 11px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--line); }
.alert-list__cell { padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; font: 400 14px/1.4 var(--font); color: var(--text-2); min-height: 100%; }
.alert-list__cell.is-hover { background: rgba(255, 255, 255, .03); }
.alert-list__cell .viz-alert__dot { display: block; margin-top: 6px; }
.alert-list__company { font-weight: 500; color: var(--text); }
.alert-list__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.alert-list__body:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.alert-list__age { white-space: nowrap; font-variant-numeric: tabular-nums; }
.alert-list__more { white-space: nowrap; font-size: 12.5px; color: var(--text-3); }
.alert-list__cell.is-hover.alert-list__more { color: var(--accent); }
.alert-center__expirations { display: flex; flex-direction: column; gap: 22px; }
.alert-center__company { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 767px) {
  .alert-list { grid-template-columns: 14px minmax(0, 1fr); column-gap: 12px; }
  .alert-list__head { display: none; }
  .alert-list__company, .alert-list__age, .alert-list__owner, .alert-list__more { grid-column: 2; padding: 0 0 6px; border-bottom: 0; font-size: 12.5px; }
  .alert-list__body { border-bottom: 0; padding-bottom: 6px; }
  .alert-list__more { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .alert-list__cell:nth-child(6n+1) { grid-row: span 5; border-bottom: 0; }
  .alert-filters__owner { margin-left: 0; }
}
.alert-detail__head { display: flex; align-items: baseline; gap: 12px; }
.alert-detail__head .viz-alert__dot { flex: none; transform: translateY(-2px); background: var(--warning); }
.alert-dot--critical { background: var(--negative) !important; }
.alert-dot--high { background: var(--warning) !important; }
.alert-dot--medium, .alert-dot--low { background: var(--accent) !important; }
.alert-detail__text { margin: 0; font: 400 15px/1.55 var(--font); color: var(--text-2); }
.viz-alert__title { font: 500 14.5px/1.4 var(--font); }
.viz-alert__detail { font: 400 14px/1.5 var(--font); color: var(--text-2); }

@keyframes jv-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes jv-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

@keyframes jv-wave {
  0%, 100% { transform: scaleY(.3); }
  50% { transform: scaleY(1); }
}

.askbar__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  font: 400 15px/1.2 var(--font);
}
.askbar__input::placeholder { color: var(--muted); }
.askbar__input:focus { outline: none; }
.askbar.is-disabled .askbar__input { cursor: not-allowed; }

.mic {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}
.mic:disabled { cursor: not-allowed; opacity: .6; }
.speaker {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.speaker[hidden] { display: none; }
.speaker:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.speaker:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.speaker svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.speaker__cone { fill: currentColor; stroke: none; }
.speaker__off { display: none; }
.speaker.is-muted { color: var(--warning); background: rgba(227, 184, 102, .1); }
.speaker.is-muted .speaker__waves { display: none; }
.speaker.is-muted .speaker__off { display: inline; }
.mic__body { width: 8px; height: 13px; border-radius: 5px; border: 1.5px solid var(--text-2); }
.mic__stem { width: 1.5px; height: 4px; background: var(--text-2); }

/* Error page ----------------------------------------------------------------- */

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
  text-align: center;
}
.error-page__message { margin: 0; font: 400 22px/1.3 var(--font); max-width: 520px; }

/* Responsive: tablet 768–1199px, mobile < 768px ------------------------------ */

@media (max-width: 1199px) {
  .dashboard { padding: 30px 32px 230px; }
  .status { display: none; }
}

@media (max-width: 767px) {
  .topbar { padding: 0 16px; }
  .topbar__nav { display: none; }
  .dashboard { padding: 24px 16px 220px; gap: 20px; }
  .stage__transcript { font-size: 22px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viz-grid { grid-template-columns: 1fr; }
  .viz-grid--sized > .viz-span-4, .viz-grid--sized > .viz-span-6, .viz-grid--sized > .viz-span-8,
  .viz-grid--sized > .viz-col-main, .viz-grid--sized > .viz-col-side { grid-column: span 12; grid-row: auto; }
  .viz-grid--sized { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 0; }
  .answer-view__head { flex-direction: column; align-items: flex-start; }
  .bars__row { grid-template-columns: 80px 1fr 90px; gap: 10px; }
  .greeting { flex-direction: column; align-items: flex-start; }
  .greeting__title { font-size: 28px; }
  .askdock { bottom: 16px; }
  .askbar .kbd { display: none; }
  .login__card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Import page ------------------------------------------------------------------ */

.import-form { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.import-form .btn { align-self: flex-start; }
select.field__input { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 20px;
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent-soft); background: rgba(158, 211, 230, .04); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone__title { font: 500 14px/1.4 var(--font); }
.import-review { display: flex; flex-direction: column; gap: 14px; }
.import-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.import-success { color: var(--positive); border-color: rgba(95, 203, 142, .25); background: rgba(95, 203, 142, .06); }
.settings-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.page-import .dashboard { padding-bottom: 80px; }

/* Daily occupancy report ---------------------------------------------------------- */

.page-report .dashboard { padding-bottom: 80px; gap: 30px; }
.report__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.report__head .meta { margin-top: 8px; letter-spacing: .06em; }
.report__nav { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.report__stepper { display: flex; align-items: center; gap: 8px; }
.report__stepper .btn { gap: 6px; height: 40px; }
.report__nav .field__input { width: 170px; height: 40px; color-scheme: dark; }
.report__quick { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.report__quick .chip { padding: 5px 11px; font-size: 11.5px; }
.report__quick .chip[aria-pressed="true"] { border-color: var(--accent-soft); color: var(--text); background: rgba(158, 211, 230, .08); }
.report-stale { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; color: var(--text); }
.report-stale .link-button { color: var(--warning); font-size: 13px; }
.report__body { transition: opacity .2s ease; }
.report__body.is-loading { opacity: .45; pointer-events: none; }
.report-table__hint { margin-bottom: -6px; }
.report-table { --cols: 5; grid-template-columns: 70px minmax(90px, 1fr) 70px 90px minmax(150px, 1.4fr); }
.report-table .viz-table__head:nth-child(2) { text-align: left; }
.report-occ { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.report-occ__track { flex: 1; max-width: 90px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.report-occ__fill { width: var(--w, 0%); height: 100%; border-radius: 3px; background: var(--negative); }
.report-occ__fill.is-warn { background: var(--warning); }
.report-occ__fill.is-pos { background: var(--positive); }
.report-occ__value { min-width: 58px; text-align: right; }
.report-table__more { align-self: flex-start; color: var(--accent); }
.report-grid--alerts { align-items: start; }
.report-count { position: sticky; top: 88px; gap: 14px; padding-block: 28px; }
.report-mix { display: flex; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .05); }
.report-mix span { width: var(--w, 0%); }
.report-mix .is-neg { background: var(--negative); }
.report-mix .is-warn { background: var(--warning); }
.report-mix .is-pos { background: var(--positive); }
.report-mix__legend { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; font: 400 12.5px/1.3 var(--font); color: var(--text-2); }
.report-mix__legend li { display: flex; align-items: center; gap: 8px; }
.report-mix__legend li::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.report-mix__legend li.is-neg::before { background: var(--negative); }
.report-mix__legend li.is-warn::before { background: var(--warning); }
.report-mix__legend li.is-pos::before { background: var(--positive); }
.report-mix__legend li.is-neg, .report-mix__legend li.is-warn, .report-mix__legend li.is-pos { color: var(--text-2); }
.report-mix__legend li span { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.report__body { display: flex; flex-direction: column; gap: 30px; }
.report-section { display: flex; flex-direction: column; gap: 14px; }
.report-section__title { display: flex; align-items: center; gap: 10px; margin: 0; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.report-section__title > span:first-child { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-3); color: var(--text); font-size: 11px; letter-spacing: 0; }
.report-section__title--alert > span:first-child { border-color: rgba(233, 138, 122, .5); color: var(--negative); }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr); gap: 14px; }
.report-summary { gap: 10px; font: 400 15px/1.6 var(--font); color: var(--text-2); }
.report-summary p { margin: 0; }
.report-summary strong { color: var(--text); font-weight: 500; }
.report-summary strong.is-neg, .viz-table__cell.is-neg, .is-neg { color: var(--negative); }
.report-summary strong.is-pos, .is-pos { color: var(--positive); }
.report-summary strong.is-warn { color: var(--warning); }
.is-warn { color: var(--warning); }
.report-gauge { align-items: center; text-align: center; gap: 6px; }
.gauge { width: 100%; max-width: 260px; }
.gauge__arc { fill: none; stroke-width: 14; }
.gauge__arc.is-neg { stroke: var(--negative); }
.gauge__arc.is-warn { stroke: var(--warning); }
.gauge__arc.is-pos { stroke: var(--positive); }
.gauge__arc.is-accent { stroke: var(--accent); }
.gauge__needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.gauge__hub { fill: var(--text); }
.report-gauge__value { font: 400 40px/1 var(--font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.report-gauge__gap { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); width: 100%; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.report-gauge__gap-value { font: 400 34px/1 var(--font); font-variant-numeric: tabular-nums; }
.report-count { align-items: center; justify-content: center; text-align: center; }
.report-count__value { font: 300 64px/1 var(--font); font-variant-numeric: tabular-nums; }
.report-count__text { max-width: 260px; color: var(--text-2); }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font: 500 10.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.badge--neg { color: var(--negative); background: rgba(233, 138, 122, .12); border: 1px solid rgba(233, 138, 122, .35); }
.kpi--value-neg .kpi__value { color: var(--negative); }
.kpi--value-warn .kpi__value { color: var(--warning); }
.kpi--value-pos .kpi__value { color: var(--positive); }
.report-indicators .kpi__value { font-size: 26px; }
.evolution { display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; }
.evolution__cut { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .02); }
.evolution__cut.is-none { border-style: dashed; }
.evolution__name { font: 500 12px/1 var(--mono); letter-spacing: .1em; color: var(--text-3); }
.evolution__value { font: 400 32px/1 var(--font); font-variant-numeric: tabular-nums; }
.evolution__cut.is-neg .evolution__value { color: var(--negative); }
.evolution__cut.is-warn .evolution__value { color: var(--warning); }
.evolution__cut.is-pos .evolution__value { color: var(--positive); }
.evolution__cut.is-none .evolution__value { color: var(--muted); }
.evolution__arrow { align-self: center; font: 400 22px/1 var(--font); color: var(--muted); }
.page-report .bars.has-cuts .bars__row { grid-template-columns: minmax(150px, 220px) 1fr 130px 150px; }
.bars__cuts { font: 400 12px/1 var(--mono); color: var(--text-3); text-align: right; white-space: nowrap; }
@media (max-width: 767px) {
  .evolution__arrow { display: none; }
  .page-report .bars.has-cuts .bars__row { grid-template-columns: 1fr; }
  .bars__cuts { text-align: left; }
}
.report-fill.is-neg { background: var(--negative); }
.report-fill.is-warn { background: var(--warning); }
.report-fill.is-pos { background: var(--positive); }
.page-report .bars__row { grid-template-columns: minmax(150px, 220px) 1fr 130px; }
.overview__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; }
@media (max-width: 1199px) {
  .report-indicators { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: 1fr; }
  .report-count { position: static; }
}
@media (max-width: 767px) {
  .report-indicators { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-report .bars__row { grid-template-columns: 1fr; }
  .report__nav { align-items: stretch; width: 100%; }
  .report__quick { justify-content: flex-start; }
  .report__nav .field__input { flex: 1; width: auto; min-width: 0; }
  .report__step-label { display: none; }
  .report__stepper .btn { padding: 0 16px; }
  .report-table { grid-template-columns: 44px minmax(80px, 1fr) 52px 0 minmax(110px, 1.2fr); }
  .report-table > :nth-child(5n+4) { visibility: hidden; }
}

/* Dialogs (change password) ------------------------------------------------------ */

.dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.dialog::backdrop { background: rgba(5, 6, 7, .72); }
.dialog__form { display: flex; flex-direction: column; gap: 16px; padding: 26px; }
.dialog__title { margin: 0 0 4px; font: 500 18px/1.3 var(--font); }

.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.voice-option { position: relative; }
.voice-option input { position: absolute; opacity: 0; pointer-events: none; }
.voice-option span {
  display: block;
  padding: 9px 10px;
  border: 1px solid var(--line-3);
  border-radius: var(--radius-sm);
  text-align: center;
  font: 500 13px/1.2 var(--font);
  color: var(--text-2);
  cursor: pointer;
}
#voice-options .voice-option span { text-transform: capitalize; }
#depth-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.voice-option input:checked + span { border-color: var(--accent-soft); color: var(--text); background: rgba(158, 211, 230, .06); }
.voice-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dialog__section { display: flex; flex-direction: column; gap: 10px; }
.voice-hint { margin-top: -6px; }
.voice-soft-dot, .voice-option--soft span::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--viz-1, #C9574B); vertical-align: middle; }
.voice-soft-dot { margin: 0 2px; }
.voice-option span { transition: border-color .15s, background .15s, color .15s; }
.voice-option span:hover { border-color: var(--line-2); color: var(--text); }
.voice-option.is-playing span { position: relative; }
.voice-option.is-playing span::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 10px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--accent);
  animation: voice-pulse 1s ease-in-out infinite;
}
@keyframes voice-pulse { 50% { opacity: .25; transform: scale(.7); } }
.voice-player { display: flex; align-items: center; gap: 14px; }
.voice-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: rgba(158, 211, 230, .08);
  font: 500 13px/1 var(--font);
  color: var(--text);
  cursor: pointer;
}
.voice-play:hover { background: rgba(158, 211, 230, .14); }
.voice-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.voice-play__icon { width: 16px; height: 16px; fill: currentColor; }
.voice-play__icon--stop, .voice-play.is-playing .voice-play__icon--play { display: none; }
.voice-play.is-playing .voice-play__icon--stop { display: block; }
.voice-status { min-width: 0; }
