/* =====================================================================
   bdx_admin — BuildingLogiX brand stylesheet.

   Ported 1:1 from the Next.js app's design tokens
   (BDXpyMCP-admin/src/app/globals.css) with the three-state dark-mode
   guard from the reference sheet (.claude/skills/blx-brand/references/
   blx.css). Values are raw channels ("15 23 42") consumed as
   rgb(var(--x)) / rgb(var(--x) / alpha), exactly like the Tailwind app,
   so the two UIs read as one product side by side.

   The palette is the corporate one, the same five colors the BLX decks
   use: navy #013b71, blue #326fb6, skyline #69a2d4, orange #ed4723,
   green #0f9d6e. Orange is a highlight, never a surface. Semantic
   colors (warn / ok / danger) are reserved for state, never decoration.
   ===================================================================== */

:root {
  color-scheme: light;

  --canvas: 245 246 248;
  --surface: 255 255 255;
  --surface-sunken: 242 247 251;
  --border: 223 227 232;
  --border-strong: 199 208 219;

  --ink: 30 42 54;
  --ink-muted: 77 91 106;
  --ink-subtle: 132 148 167;
  --heading: 1 59 113;

  --brand-navy: 1 59 113;
  --brand-blue: 50 111 182;
  --brand-sky: 105 162 212;
  /* The mark standing on the page background — flips for dark. */
  --brand-mark: 1 59 113;
  /* The mark on its own light tile. NOT overridden in dark: the tile
     stays light in both themes, the way an app icon does. */
  --brand-ink: 1 59 113;

  --accent: 50 111 182;
  --accent-hover: 1 59 113;
  --accent-soft: 234 242 250;
  --accent-ink: 1 59 113;
  --accent-fg: 255 255 255;

  --highlight: 237 71 35;
  --highlight-soft: 253 237 232;
  --highlight-ink: 176 47 15;

  --ok: 10 107 75;
  --ok-soft: 232 247 241;
  --warn: 161 98 7;
  --warn-soft: 254 249 231;
  --danger: 190 18 60;
  --danger-soft: 255 241 242;

  /* Code blocks stay dark in both themes — a terminal does not have a
     light mode. Declared once, never overridden below. */
  --code-bg: 6 24 42;
  --code-fg: 226 237 247;

  --ground: 249 250 252;
  --shadow-sm: 0 1px 2px rgb(1 59 113 / 0.06);
  --shadow: 0 1px 3px rgb(1 59 113 / 0.10), 0 1px 2px rgb(1 59 113 / 0.06);
  --shadow-md: 0 4px 10px -2px rgb(1 59 113 / 0.14), 0 2px 5px -3px rgb(1 59 113 / 0.12);
  --shadow-card: 0 1px 2px rgb(1 59 113 / 0.05), 0 8px 24px -12px rgb(1 59 113 / 0.2);
  --shadow-lifted: 0 1px 2px rgb(1 59 113 / 0.07), 0 24px 48px -24px rgb(1 59 113 / 0.38);

  --font-sans: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-cond: "Barlow Condensed", "Barlow", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

/* Dark is the same palette after hours: the navy stops being an accent
   and becomes the ground, and skyline takes over as the action color.
   System preference applies unless the host pins data-theme="light". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --canvas: 6 20 34;
    --surface: 12 31 50;
    --surface-sunken: 17 40 62;
    --border: 31 57 84;
    --border-strong: 51 82 114;

    --ink: 232 240 248;
    --ink-muted: 166 186 206;
    --ink-subtle: 126 149 173;
    --heading: 232 240 248;

    --brand-navy: 105 162 212;
    --brand-blue: 105 162 212;
    --brand-sky: 148 194 232;
    --brand-mark: 226 237 247;

    --accent: 105 162 212;
    --accent-hover: 148 194 232;
    --accent-soft: 14 45 74;
    --accent-ink: 178 212 241;
    --accent-fg: 6 24 42;

    --highlight: 255 122 86;
    --highlight-soft: 66 27 16;
    --highlight-ink: 255 165 140;

    --ok: 52 199 145;
    --ok-soft: 10 45 34;
    --warn: 234 179 8;
    --warn-soft: 51 38 8;
    --danger: 251 113 133;
    --danger-soft: 60 18 30;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px rgb(0 0 0 / 0.4), 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 10px -2px rgb(0 0 0 / 0.5), 0 2px 5px -3px rgb(0 0 0 / 0.4);
    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
    --shadow-lifted: 0 1px 2px rgb(0 0 0 / 0.5), 0 24px 48px -24px rgb(0 0 0 / 0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;

  --canvas: 6 20 34;
  --surface: 12 31 50;
  --surface-sunken: 17 40 62;
  --border: 31 57 84;
  --border-strong: 51 82 114;

  --ink: 232 240 248;
  --ink-muted: 166 186 206;
  --ink-subtle: 126 149 173;
  --heading: 232 240 248;

  --brand-navy: 105 162 212;
  --brand-blue: 105 162 212;
  --brand-sky: 148 194 232;
  --brand-mark: 226 237 247;

  --accent: 105 162 212;
  --accent-hover: 148 194 232;
  --accent-soft: 14 45 74;
  --accent-ink: 178 212 241;
  --accent-fg: 6 24 42;

  --highlight: 255 122 86;
  --highlight-soft: 66 27 16;
  --highlight-ink: 255 165 140;

  --ok: 52 199 145;
  --ok-soft: 10 45 34;
  --warn: 234 179 8;
  --warn-soft: 51 38 8;
  --danger: 251 113 133;
  --danger-soft: 60 18 30;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow: 0 1px 3px rgb(0 0 0 / 0.4), 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 10px -2px rgb(0 0 0 / 0.5), 0 2px 5px -3px rgb(0 0 0 / 0.4);
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
  --shadow-lifted: 0 1px 2px rgb(0 0 0 / 0.5), 0 24px 48px -24px rgb(0 0 0 / 0.8);
}

/* ------------------------------ base ------------------------------ */

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

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

body {
  background-color: rgb(var(--canvas));
  color: rgb(var(--ink));
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings carry the navy, the way they do on the slides. */
h1,
h2 {
  color: rgb(var(--heading));
}

/* One focus treatment everywhere, in the highlight orange — the one
   color that survives being drawn on a blue button, a white card and a
   navy field alike. */
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid rgb(var(--highlight));
  outline-offset: 2px;
  border-radius: 4px;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-feature-settings: "liga" 0;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

/* The drafting grid from the BLX decks: 56px squares in a whisper of
   brand blue, fixed so it holds still while the page scrolls. */
.bg-grid {
  background-image:
    linear-gradient(rgb(var(--brand-blue) / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--brand-blue) / 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  background-attachment: fixed;
}

/* The deck's progress bar, demoted to a hairline under the app header —
   the one place the two brand colors touch. */
.brand-rule {
  height: 2px;
  background: linear-gradient(90deg, rgb(var(--brand-blue)), rgb(var(--highlight)));
}

/* ------------------------------ brand ------------------------------ */

/* The corporate wordmark: Building in brand blue, LogiX in the highlight
   orange, in the heavy grotesque the printed mark uses. The two spans are
   the whole point — never render "BuildingLogiX" as one flat color. */
.blx-wordmark {
  font-family: "Arial Black", "Arial Bold", Gadget, Arial, Helvetica, sans-serif;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
  white-space: nowrap;
}
.blx-wordmark .b {
  color: rgb(var(--brand-blue));
}
.blx-wordmark .x {
  color: rgb(var(--highlight));
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}
.lockup svg {
  flex-shrink: 0;
  color: rgb(var(--brand-mark));
}
.lockup-div {
  width: 1px;
  align-self: center;
  background: rgb(var(--border-strong));
}
.lockup-prod {
  font-family: var(--font-cond);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgb(var(--ink-muted));
  white-space: nowrap;
}

/* Light tile the mark sits on — light in dark mode too, like an app icon. */
.brand-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(160deg, #ffffff 0%, #e9f0f7 100%);
  box-shadow:
    inset 0 0 0 1px rgb(1 59 113 / 0.1),
    0 6px 16px -8px rgb(1 59 113 / 0.45);
}
.brand-tile svg {
  /* !important: the blx_mark macro carries an inline --brand-mark color for
     its usual on-canvas placement; on the tile the mark must keep the navy
     tile ink even in dark mode (the tile stays light, like an app icon). */
  color: rgb(var(--brand-ink)) !important;
}

/* ------------------------------ app frame ------------------------------ */

.frame {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgb(var(--border));
  background: rgb(var(--surface) / 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.site-header-inner {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
}
.site-header-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 1rem;
}

.container-wide {
  width: 100%;
  max-width: 64rem; /* max-w-5xl */
}
.container-reading {
  width: 100%;
  max-width: 48rem; /* max-w-3xl */
}

.site-main {
  margin: 0 auto;
  width: 100%;
  flex: 1;
  padding: 2rem 1rem;
}

.site-footer {
  border-top: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
}
.site-footer-inner {
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: rgb(var(--ink-subtle));
}
.site-footer-inner nav {
  display: flex;
  gap: 1rem;
}
.site-footer-inner a:hover {
  color: rgb(var(--ink));
}

/* Route links. The one thing on the page wearing orange is the thing you
   are currently looking at. */
.nav {
  display: none;
  align-items: center;
  gap: 0.125rem;
}
@media (min-width: 640px) {
  .nav {
    display: flex;
  }
}
.nav a {
  position: relative;
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgb(var(--ink-muted));
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover {
  background: rgb(var(--surface-sunken));
  color: rgb(var(--ink));
}
.nav a.active {
  font-weight: 600;
  color: rgb(var(--heading));
}
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0.625rem;
  right: 0.625rem;
  bottom: -9px;
  height: 2px;
  border-radius: 9999px;
  background: rgb(var(--highlight));
}

/* Dev-fixtures banner — impossible to mistake a fixture screen for prod. */
.dev-banner {
  background: rgb(var(--highlight-soft));
  color: rgb(var(--highlight-ink));
  border-bottom: 1px solid rgb(var(--highlight) / 0.3);
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.25rem 1rem;
}

/* ------------------------------ auth shell ------------------------------ */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}
.auth-box {
  width: 100%;
  max-width: 32rem; /* max-w-lg */
  animation: fade-up 0.4s ease-out both;
}
.auth-brand {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  box-shadow: var(--shadow-lifted);
}
.card-head {
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}
.card-body {
  border-top: 1px solid rgb(var(--border));
  padding: 1.5rem;
}
@media (min-width: 640px) {
  .card-head {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .card-body {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ------------------------------ panels & stats ------------------------------ */

.panel {
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  box-shadow: var(--shadow-card);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid rgb(var(--border));
  padding: 0.75rem 1rem;
}
.panel-title {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: rgb(var(--heading));
}
.panel-desc {
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgb(var(--ink-muted));
}
.panel-body {
  padding: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.two-col {
  display: grid;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat,
.stat-tile {
  border-radius: 0.75rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.stat.clickable,
.stat-tile.clickable,
a.stat {
  cursor: pointer;
  text-decoration: none;
}
.stat.clickable:hover,
.stat-tile.clickable:hover,
a.stat:hover {
  border-color: rgb(var(--brand-blue));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stat-label {
  font-family: var(--font-cond);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(var(--ink-subtle));
}
.stat-value {
  margin-top: 0.375rem;
  font-size: 1.875rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: rgb(var(--heading));
  font-variant-numeric: tabular-nums;
}
.stat-value .unit {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(var(--ink-muted));
  margin-left: 0.25rem;
  margin-right: 0.375rem;
}
.stat-value.ok {
  color: rgb(var(--ok));
}
.stat-value.warn {
  color: rgb(var(--warn));
}
.stat-value.danger {
  color: rgb(var(--danger));
}
.stat-foot {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
}
.stat-detail {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgb(var(--ink-muted));
  font-variant-numeric: tabular-nums;
}

/* StationCx delta indicators */
.delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.delta.up {
  color: rgb(var(--danger));
}
.delta.down {
  color: rgb(var(--ok));
}
.delta.good-up {
  color: rgb(var(--ok));
}
.delta.bad-up {
  color: rgb(var(--danger));
}
.delta.flat {
  color: rgb(var(--ink-subtle));
}

/* StationCx dev/demo badge */
.dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-cond);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.125rem 0.4375rem;
  border-radius: 0.25rem;
  background: rgb(var(--highlight-soft));
  color: rgb(var(--highlight-ink));
  border: 1px solid rgb(var(--highlight) / 0.3);
}

/* ------------------------------ chips & pills ------------------------------ */

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgb(var(--border));
  background: rgb(var(--surface-sunken));
  color: rgb(var(--ink-muted));
}
.chip-danger {
  background: rgb(var(--danger-soft));
  color: rgb(var(--danger));
  box-shadow: inset 0 0 0 1px rgb(var(--danger) / 0.25);
}
.chip-warn {
  background: rgb(var(--warn-soft));
  color: rgb(var(--warn));
  box-shadow: inset 0 0 0 1px rgb(var(--warn) / 0.25);
}
.chip-ok {
  background: rgb(var(--ok-soft));
  color: rgb(var(--ok));
  box-shadow: inset 0 0 0 1px rgb(var(--ok) / 0.25);
}

/* Status pills (tenants list / detail): active green, trial amber,
   suspended red — same mapping as the Next.js StatusPill. */
.pill {
  display: inline-flex;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  text-transform: capitalize;
  background: rgb(var(--surface-sunken));
  color: rgb(var(--ink-muted));
}
.pill-active {
  background: rgb(var(--ok-soft));
  color: rgb(var(--ok));
}
.pill-trial {
  background: rgb(var(--warn-soft));
  color: rgb(var(--warn));
}
.pill-suspended {
  background: rgb(var(--danger-soft));
  color: rgb(var(--danger));
}

.tag-default {
  border-radius: 0.25rem;
  background: rgb(var(--ok-soft));
  color: rgb(var(--ok));
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
}

/* ------------------------------ buttons & forms ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition: color 0.15s, background-color 0.15s;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.btn-primary {
  background: rgb(var(--accent));
  color: rgb(var(--accent-fg));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}
.btn-primary:hover {
  background: rgb(var(--accent-hover));
}
.btn-secondary {
  border: 1px solid rgb(var(--border-strong));
  background: rgb(var(--surface));
  color: rgb(var(--ink));
}
.btn-secondary:hover {
  background: rgb(var(--surface-sunken));
}
.btn-ghost {
  color: rgb(var(--ink-muted));
}
.btn-ghost:hover {
  background: rgb(var(--surface-sunken));
  color: rgb(var(--ink));
}
.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 0.375rem 0.75rem;
}

.field-label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: rgb(var(--ink));
}
.input {
  margin-top: 0.375rem;
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--border-strong));
  background: rgb(var(--surface));
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgb(var(--ink));
}
.input::placeholder {
  color: rgb(var(--ink-subtle));
}
.input:focus {
  border-color: rgb(var(--accent));
  outline: none;
}

/* ------------------------------ tables & lists ------------------------------ */

.tbl-wrap {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
}
.tbl {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: left;
}
.tbl thead {
  background: rgb(var(--surface-sunken));
  font-size: 0.75rem;
  line-height: 1rem;
  text-transform: uppercase;
  color: rgb(var(--ink-subtle));
}
.tbl thead th {
  padding: 0.75rem 1rem;
  font-weight: 500;
  white-space: nowrap;
}
.tbl tbody td {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgb(var(--border));
  vertical-align: top;
}
.tbl-hover tbody tr:hover {
  background: rgb(var(--surface-sunken));
}
.tbl-tight thead th,
.tbl-tight tbody td {
  padding: 0.5rem 0.75rem;
}

/* Borderless mini-table inside a panel (busiest tools / errors by code). */
.mini-tbl {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.mini-tbl td {
  padding: 0.375rem 0;
}
.mini-tbl td + td {
  padding-left: 0.75rem;
}
.mini-tbl tr + tr td {
  border-top: 1px solid rgb(var(--border));
}

/* ul with hairline dividers (needs-attention, recent onboardings). */
.divlist {
  list-style: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.divlist > li {
  padding: 0.5rem 0;
}
.divlist > li + li {
  border-top: 1px solid rgb(var(--border));
}
.divlist > li:first-child {
  padding-top: 0;
}
.divlist > li:last-child {
  padding-bottom: 0;
}
.row-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.empty {
  padding: 0.5rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: rgb(var(--ink-subtle));
}

/* ------------------------------ notices ------------------------------ */

.notice {
  border-radius: 0.75rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface-sunken));
  padding: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgb(var(--ink-muted));
}
.notice-danger {
  border-color: rgb(var(--danger) / 0.3);
  background: rgb(var(--danger-soft));
  color: rgb(var(--danger));
}
.notice-warn {
  border-color: rgb(var(--warn) / 0.3);
  background: rgb(var(--warn-soft));
  color: rgb(var(--warn));
}
.notice-ok {
  border-color: rgb(var(--ok) / 0.3);
  background: rgb(var(--ok-soft));
  color: rgb(var(--ok));
}

/* Section card on /welcome (rounded-xl border bg-surface p-4). */
.section-card {
  border-radius: 0.75rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  padding: 1rem;
}

/* ------------------------------ code ------------------------------ */

.codeblock {
  overflow-x: auto;
  border-radius: 0.5rem;
  background: rgb(var(--code-bg));
  color: rgb(var(--code-fg));
  padding: 0.625rem 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre;
}
code.inline {
  font-size: 0.85em;
  background: rgb(var(--surface-sunken));
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* ------------------------------ text helpers ------------------------------ */

.link {
  color: rgb(var(--accent));
}
.link:hover {
  text-decoration: underline;
}
.muted {
  color: rgb(var(--ink-muted));
}
.subtle {
  color: rgb(var(--ink-subtle));
}
.small {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.xs {
  font-size: 0.75rem;
  line-height: 1rem;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.text-ok {
  color: rgb(var(--ok));
}
.text-warn {
  color: rgb(var(--warn));
}
.text-danger {
  color: rgb(var(--danger));
}
.right {
  text-align: right;
}
.tabular {
  font-variant-numeric: tabular-nums;
}
.capitalize {
  text-transform: capitalize;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stack > * + * {
  margin-top: 1.5rem;
}
.stack-sm > * + * {
  margin-top: 1rem;
}

.page-title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.page-sub {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgb(var(--ink-muted));
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 500;
}

/* =====================================================================
   Wave 2 additions — legal prose, consent card, forms & console widgets.
   Same token discipline as above; ported from globals.css where a class
   of the same name exists there (.prose-legal is 1:1).
   ===================================================================== */

/* ------------------------------ legal prose ------------------------------ */

.prose-legal {
  color: rgb(var(--ink-muted));
  font-size: 0.9375rem;
  line-height: 1.7;
}
.prose-legal h1 {
  color: rgb(var(--ink));
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.prose-legal h2 {
  color: rgb(var(--ink));
  font-size: 1.0625rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.prose-legal h3 {
  color: rgb(var(--ink));
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.375rem;
}
.prose-legal p,
.prose-legal ul,
.prose-legal ol {
  margin-bottom: 1rem;
}
.prose-legal ul,
.prose-legal ol {
  padding-left: 1.25rem;
}
.prose-legal ul {
  list-style: disc;
}
.prose-legal ol {
  list-style: decimal;
}
.prose-legal li {
  margin-bottom: 0.375rem;
}
.prose-legal strong {
  color: rgb(var(--ink));
  font-weight: 600;
}
.prose-legal a {
  color: rgb(var(--accent));
  text-decoration: underline;
}
.prose-legal code {
  background: rgb(var(--surface-sunken));
  border-radius: 4px;
  font-size: 0.85em;
  padding: 0.1em 0.35em;
}
.prose-legal table {
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  width: 100%;
}
.prose-legal th,
.prose-legal td {
  border: 1px solid rgb(var(--border));
  padding: 0.5rem 0.625rem;
  text-align: left;
  vertical-align: top;
}
.prose-legal th {
  background: rgb(var(--surface-sunken));
  color: rgb(var(--ink));
  font-weight: 600;
}

/* Legal layout: article shell + tabbed doc nav. */
.legal-article {
  border-radius: 1rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  box-shadow: var(--shadow-card);
  padding: 2rem 1.5rem;
}
@media (min-width: 640px) {
  .legal-article {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}
.legal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.legal-tabs a {
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  padding: 0.375rem 0.75rem;
  color: rgb(var(--ink-muted));
  transition: color 0.15s, border-color 0.15s;
}
.legal-tabs a:hover {
  border-color: rgb(var(--border-strong));
  color: rgb(var(--ink));
}

/* ------------------------------ consent card ------------------------------ */

.card-section {
  border-top: 1px solid rgb(var(--border));
  padding: 1.25rem 1.5rem;
}
.card-section.sunken {
  background: rgb(var(--surface-sunken));
}

.section-label {
  font-family: var(--font-cond);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(var(--ink-subtle));
}

.client-tile {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgb(var(--ink));
  color: rgb(var(--canvas));
  font-weight: 600;
}

.connection-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.connection-lockup .arrows {
  color: rgb(var(--ink-subtle));
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 11px;
  font-weight: 500;
}
.badge-accent {
  background: rgb(var(--accent-soft));
  color: rgb(var(--accent-ink));
  box-shadow: inset 0 0 0 1px rgb(var(--accent) / 0.25);
}

.perm {
  display: flex;
  gap: 0.75rem;
}
.perm-icon {
  margin-top: 0.125rem;
  display: inline-flex;
  height: 1.25rem;
  width: 1.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
}
.perm-icon.allowed {
  background: rgb(var(--ok-soft));
  color: rgb(var(--ok));
}
.perm-icon.denied {
  background: rgb(var(--surface-sunken));
  color: rgb(var(--ink-subtle));
}

.site-list {
  list-style: none;
  padding: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgb(var(--border));
}
.site-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgb(var(--surface));
  padding: 0.625rem 0.75rem;
}
.site-list > li + li {
  border-top: 1px solid rgb(var(--border));
}

.icon-tile-danger {
  display: inline-flex;
  height: 3rem;
  width: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgb(var(--danger-soft));
  color: rgb(var(--danger));
}

/* ------------------------------ forms & console ------------------------------ */

.input.input-danger {
  border-color: rgb(var(--danger));
}
.input.input-warn {
  border-color: rgb(var(--warn));
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
}
.btn-danger-soft {
  border: 1px solid rgb(var(--danger) / 0.3);
  background: rgb(var(--danger-soft));
  color: rgb(var(--danger));
}
.btn-ok-soft {
  border: 1px solid rgb(var(--ok) / 0.3);
  background: rgb(var(--ok-soft));
  color: rgb(var(--ok));
}
.btn-danger-outline {
  border: 1px solid rgb(var(--danger) / 0.3);
  background: rgb(var(--surface));
  color: rgb(var(--danger));
}
.btn-danger-outline:hover {
  background: rgb(var(--danger-soft));
}

.select {
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--border-strong));
  background: rgb(var(--surface));
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgb(var(--ink));
}

/* Copy-block row: dark pre + Copy button (onboarding success, invite banner). */
.copy-row {
  margin-top: 0.25rem;
  display: flex;
  gap: 0.5rem;
}
.copy-row pre {
  flex: 1;
  overflow-x: auto;
  border-radius: 0.5rem;
  background: rgb(var(--code-bg));
  color: rgb(var(--code-fg));
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
}
.copy-row pre.oneline {
  white-space: nowrap;
}
.copy-row pre.multiline {
  white-space: pre-wrap;
}

/* Dashed prompt boxes (try-tools idle / no-args). */
.dashed-box {
  border-radius: 0.5rem;
  border: 1px dashed rgb(var(--border-strong));
  background: rgb(var(--surface-sunken));
  padding: 0.75rem;
  font-size: 0.75rem;
  color: rgb(var(--ink-subtle));
}

/* Sunken inline form strip under a panel header (add site / invite). */
.panel-form {
  border-bottom: 1px solid rgb(var(--border));
  background: rgb(var(--surface-sunken));
  padding: 1rem;
  font-size: 0.875rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Prompt list items (example prompts). */
.prompt-item {
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface-sunken));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: rgb(var(--ink));
}

/* Accent-tinted tips box (example prompts footer). */
.tips-box {
  margin-top: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--accent) / 0.25);
  background: rgb(var(--accent-soft));
  padding: 0.75rem 1rem;
}

/* "We fix this" pill (troubleshooting). */
.ours-pill {
  flex-shrink: 0;
  border-radius: 9999px;
  background: rgb(var(--warn-soft));
  padding: 0.125rem 0.5rem;
  font-size: 11px;
  font-weight: 500;
  color: rgb(var(--warn));
  box-shadow: inset 0 0 0 1px rgb(var(--warn) / 0.25);
}

/* ------------------------------ data tables (StationCx traits) ------------------------------ */

.tbl-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  box-shadow: var(--shadow-sm);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  text-align: left;
}

.tbl th {
  text-align: left;
  font-family: var(--font-cond);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgb(var(--ink-subtle));
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid rgb(var(--border));
  background: rgb(var(--surface-sunken));
  white-space: nowrap;
}

.tbl td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid rgb(var(--border));
  vertical-align: middle;
  color: rgb(var(--ink));
}

.tbl tbody tr:last-child td {
  border-bottom: none;
}

.tbl-hover tbody tr:hover {
  background: rgb(var(--surface-sunken) / 0.6);
}

.tbl td.num,
.tbl th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tbl td.right,
.tbl th.right {
  text-align: right;
}

.tbl-tight th,
.tbl-tight td {
  padding: 0.4375rem 0.625rem;
  font-size: 0.75rem;
}

.table-sticky th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* StationCx search bar traits */
.topnav-search {
  flex: 1;
  max-width: 28rem;
  position: relative;
}
.topnav-search input {
  width: 100%;
  height: 2.125rem;
  border: 1px solid rgb(var(--border));
  border-radius: 0.5rem;
  background: rgb(var(--surface-sunken));
  padding: 0 0.75rem 0 2rem;
  font-size: 0.8125rem;
  color: rgb(var(--ink));
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.topnav-search input:focus {
  border-color: rgb(var(--accent));
  background: rgb(var(--surface));
}

