/* =============================================================================
   OVAE DASHBOARD V2 , SHELL CSS
   Chrome only: layout grid, sidebar nav, appbar, ask bar, industry switcher,
   theme toggle, sync pill, quiet placeholder. References ONLY the semantic
   tokens defined in themes/night.css and themes/day.css. Page-specific styles
   belong to each page module, not here.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-width: 375px;
  background: var(--surface-1);
  color: var(--ink-1);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  font-feature-settings: var(--feature-settings);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  overflow-x: hidden;
}

::selection { background: var(--accent-dim); color: var(--ink-1); }

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

a { color: inherit; text-decoration: none; }

button, select, input {
  font-family: inherit;
  color: inherit;
}

* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 999px; }

/* ---- Shell frame ---- */
.ds-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .ds-shell { grid-template-columns: 1fr; } }

/* ---- Sidebar ---- */
.ds-sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface-2); border-right: 1px solid var(--rule);
  padding: 16px 12px;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .ds-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 90;
    width: min(84vw, 300px); height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
    box-shadow: var(--shadow-lift);
  }
  .ds-sidebar.is-open { transform: translateX(0); }
}

.ds-brand { display: inline-flex; align-items: center; gap: 9px; padding: 6px 8px 16px; }
.ds-brand__mark { width: 22px; height: 22px; flex: none; display: block; }
.ds-brand__name { font-family: var(--font-display); font-weight: 500; font-size: 17px; letter-spacing: -0.015em; color: var(--ink-1); }

.ds-nav { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.ds-nav__label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); padding: 0 8px 7px; }
.ds-nav__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  border: 0; background: transparent; text-align: left;
  position: relative;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.ds-nav__item:hover { background: var(--surface-3); color: var(--ink-1); }
.ds-nav__item svg { width: 15px; height: 15px; flex: none; opacity: 0.85; }
.ds-nav__item--active { background: var(--accent-soft); color: var(--ink-1); }
.ds-nav__item--active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }
.ds-nav__item--active svg { opacity: 1; color: var(--accent); }

.ds-nav__pinned { padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--rule); }

/* ---- Mobile scrim: dim backdrop behind the open drawer, click to close ---- */
.ds-scrim {
  display: none;
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
@media (max-width: 900px) {
  .ds-scrim.is-open { display: block; opacity: 1; }
}

/* ---- Main column ---- */
.ds-main { min-width: 0; display: flex; flex-direction: column; }

.ds-appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px clamp(16px, 2.6vw, 30px);
  background: color-mix(in srgb, var(--surface-1) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.ds-menu-btn {
  display: none; width: 34px; height: 34px; flex: none;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--rule);
  background: transparent; color: var(--ink-2); cursor: pointer;
}
@media (max-width: 900px) { .ds-menu-btn { display: inline-flex; } }

/* ---- Ask bar ---- */
.ds-ask { position: relative; flex: 1 1 260px; min-width: 0; max-width: 440px; }
.ds-ask__open {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 12px; border-radius: var(--radius-pill);
  background: var(--surface-3); border: 1px solid var(--rule);
  color: var(--ink-3); font-size: 13px; cursor: text;
  transition: border-color var(--dur) var(--ease);
}
.ds-ask__open:hover, .ds-ask__open[aria-expanded="true"] { border-color: var(--rule-strong); }
.ds-ask__open svg { flex: none; }
.ds-ask__ph { flex: 1; text-align: left; }
.ds-kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  border: 1px solid var(--rule-strong); border-radius: 5px; padding: 1px 6px;
}
.ds-ask__panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: var(--surface-2); border: 1px solid var(--rule-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
  padding: 10px;
}
.ds-ask__row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; }
.ds-ask__row svg { flex: none; color: var(--ink-3); }
.ds-ask__input {
  flex: 1; border: 0; background: transparent; color: var(--ink-1);
  font-size: 14px; outline: none;
}
.ds-ask__input::placeholder { color: var(--ink-3); }
.ds-ask__close {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 999px;
}
.ds-ask__close:hover { color: var(--ink-1); background: var(--surface-3); }
.ds-ask__answer { padding: 10px 10px 6px; border-top: 1px solid var(--rule); margin-top: 6px; }
.ds-ask__answer p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.6; color: var(--ink-1); }
.ds-ask__chips { display: flex; gap: 7px; flex-wrap: wrap; }
.ds-chip {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--rule);
  border-radius: 999px; padding: 3px 9px;
}

.ds-spacer { flex: 1 1 auto; }

/* ---- Industry switcher ---- */
.ds-industry {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 10px; border-radius: var(--radius-pill);
  background: var(--surface-3); border: 1px solid var(--rule);
  color: var(--ink-3);
}
.ds-industry select {
  border: 0; background: transparent; color: var(--ink-1);
  font-size: 12.5px; outline: none; cursor: pointer;
}
.ds-industry select option { background: var(--surface-2); color: var(--ink-1); }

/* ---- Day / Night toggle ---- */
.ds-theme { display: inline-flex; gap: 4px; padding: 3px; background: var(--surface-3); border: 1px solid var(--rule); border-radius: var(--radius-pill); }
.ds-theme button {
  font-size: 11.5px; font-weight: 500; color: var(--ink-3);
  background: transparent; border: 0; padding: 6px 13px;
  border-radius: var(--radius-pill); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.ds-theme button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* ---- Sync pill: a small calm signal, no glow, no animation ---- */
.ds-sync {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-3);
  padding: 7px 12px; border-radius: var(--radius-pill); border: 1px solid var(--rule);
  white-space: nowrap;
}
.ds-sync__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }

@media (max-width: 560px) {
  .ds-appbar { gap: 8px; }
  .ds-ask { order: 3; flex-basis: 100%; max-width: none; }
  .ds-industry select { max-width: 108px; }
  .ds-sync { display: none; }
}

/* ---- Content region ---- */
#v2root { padding: clamp(18px, 3vw, 34px) clamp(16px, 3vw, 34px) 72px; max-width: 1180px; width: 100%; }

/* ---- Quiet placeholder ---- */
.ds-placeholder {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface-2); padding: clamp(28px, 5vw, 48px);
  max-width: 60ch;
}
.ds-placeholder p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
