/* App shell & page regions — handoff §4, §6 */
* { box-sizing: border-box; }

html, body, #react-entry-point {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  color: var(--ink-900);
  background: var(--surface-app);
}

button, input, select, textarea { font: inherit; }

/* ---- top navigation ---- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr auto;
  align-items: center;
  padding: 0 var(--space-5);
  background: var(--brand-700);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---- dashboard workspace: sidebar / main / details ---- */
#layout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  min-height: calc(100vh - var(--topbar-height));
}

#sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-4));
  max-height: calc(100vh - var(--topbar-height) - 2 * var(--space-4));
  overflow-y: auto;
  width: var(--sidebar-width);
  flex: none;
  padding: var(--space-4);
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
}

#main {
  flex: 1;
  min-width: 0;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  /* graph fills the visual viewport under the top bar */
  height: calc(100vh - var(--topbar-height) - 2 * var(--space-4));
  min-height: 420px;
}
#ts-graph, #main .dash-graph { height: 100%; }

#framepanel {
  width: var(--details-width);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
#framepanel.wide { width: 33vw; }
#framepanel.hidden { display: none; }

/* ---- secondary pages share the warm background; cards do the framing.
       Content is centered in the viewport. ---- */
#al-wrap, #sv-wrap {
  display: flex; gap: var(--space-4); align-items: flex-start;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
}
#tr-wrap {
  display: flex; justify-content: center;
  padding: var(--space-6) var(--space-4);
}
