/* Color custom properties live in colors.css — loaded as a separate <link> tag */

:root {
  /* Shared by .tab-btn/.tab-bar and the panel classes they sit on top of (.system-panel,
     .nest-file-info-card) so a tab strip's border always matches the card it overhangs. */
  --panel-border-width: 2px;

  /* Spacing scale — not yet migrated codebase-wide; use for new/touched spacing so it
     converges over time instead of each file picking its own rem values. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 1.75rem; /* between 5 and 6 — kept to match .drill-header's pre-scale value exactly rather than nudging existing layouts */

  /* Border-radius scale, by role (buttons/inputs vs panels/cards vs pills) */
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-pill: 999px;

  /* Page layout · the nav bar's height is what every full-height tab measures the viewport against,
     and it was hand-copied as a bare 52px into seven files before this token existed. Anything
     sizing to "the rest of the screen", or pinning itself under the bar, reads it from here. */
  --navbar-h: 52px;

  /* The inset every tab holds off the viewport edge — see .tab-panel below. One pair for the whole
     app: these are working surfaces, not documents, and every rem comes off a rail or a table. */
  --page-inset-x: 1.25rem;
  --page-inset-y: 0.75rem;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

/* .content carries no padding on purpose — it wraps only the four tabs that happen to be included
   inside it, so an inset there would make a tab's margins depend on where its partial sits. */

/* Every tab holds the same inset off the viewport edge, full-bleed or not, from the one pair of
   tokens — so the gap around Account reads the same as the gap around BOM. No centred column
   here: content that wants one owns it (.card-habitat, .account-layout), which keeps a chooser
   looking identical whether its tab scrolls in flow or fills the viewport. */
.tab-panel {
  display: none;
  padding: var(--page-inset-y) var(--page-inset-x);
}

.tab-panel.active {
  display: block;
}

/* Card-style wrapper used by nearly every tab's content panels (System, Engineering, etc.) —
   gives panels a background distinct from the page (--bg) so they read as a contained section
   instead of blending into it. Was defined in markup everywhere but never actually styled. */
.system-panel {
  background: var(--surface);
  border: var(--panel-border-width) solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}


#app-version-label {
  position: fixed;
  bottom: 0.5rem;
  right: 0.75rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.35;
  pointer-events: none;
  z-index: var(--z-raise-1);
  user-select: none;
}

/* Base input/select styling — overridden per-tab as needed */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
textarea {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  box-sizing: border-box;
}
select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  box-sizing: border-box;
}
select:hover { background: var(--surface-deep); }
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus { outline: none; border-color: var(--primary); }

.hidden {
  display: none !important;
}
