/* ==========================================================================
   CIT StormWatch

   Design brief, synthesised from Vercel's token system and Linear's density:

     1. Near-monochrome. The ink is the brand. Colour appears ONLY to signal
        state (open / storm expected / closed) and never as decoration. No
        tinted table rows, no coloured rails, no gradient headers — those read
        as amateur the moment more than one of them is on screen at once.
     2. Hairlines, not shadows. One 1px #ebebeb border defines every surface.
        Elevation is reserved for things that genuinely float.
     3. Three font weights: 400, 500, 600. Nothing heavier.
     4. Numbers are mono and tabular so columns align and digits don't jitter
        as a countdown ticks.
     5. Density over padding. 40px table rows, tight vertical rhythm.

   CIT green survives as the single accent — primary actions and the "open"
   state. Everything else stays grey until something is wrong.
   ========================================================================== */

:root {
  /* Canvas */
  --canvas:        #ffffff;
  --canvas-soft:   #fafafa;
  --canvas-soft-2: #f5f5f5;

  /* Hairlines */
  --line:          #ebebeb;
  --line-strong:   #d9d9d9;

  /* Ink */
  --ink:           #171717;
  --ink-2:         #525252;
  --ink-3:         #8a8a8a;
  --ink-4:         #a8a8a8;

  /* Accent — Complete I.T. green. Used sparingly. */
  --accent:        #059669;
  --accent-deep:   #047857;
  --accent-soft:   #ecfdf5;
  --accent-line:   #a7f3d0;

  /* State */
  --warn:          #d97706;
  --warn-ink:      #92400e;
  --warn-soft:     #fffbeb;
  --warn-line:     #fde68a;

  --danger:        #dc2626;
  --danger-ink:    #991b1b;
  --danger-soft:   #fef2f2;
  --danger-line:   #fecaca;

  --info-ink:      #3730a3;
  --info-soft:     #eef2ff;
  --info-line:     #c7d2fe;

  /* Sidebar — charcoal, per the Console */
  --sidebar:       #18191b;
  --sidebar-2:     #232427;
  --sidebar-ink:   #ededed;
  --sidebar-ink-2: #8f9296;

  --radius:    8px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
          Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas-soft);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 14px; letter-spacing: -0.01em; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */

.cit-layout { display: flex; min-height: 100vh; }

.cit-sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.cit-sidebar-logo { padding: 20px 20px 18px; }
.logo-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: #fff;
}
.logo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}
.logo-sub {
  display: block; margin-top: 3px; padding-left: 15px;
  font-size: 11px; color: var(--sidebar-ink-2);
}

.cit-nav { list-style: none; margin: 0; padding: 4px 10px; flex: 1; overflow-y: auto; }
.cit-nav-section {
  padding: 16px 10px 6px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: #6b6e73;
}
.cit-nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; margin-bottom: 1px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 400; color: var(--sidebar-ink-2);
  transition: background .12s, color .12s;
}
.cit-nav a:hover { background: var(--sidebar-2); color: var(--sidebar-ink); }
.cit-nav a.active { background: var(--sidebar-2); color: #fff; font-weight: 500; }
.cit-nav a.active .ico { color: var(--accent); }

.cit-sidebar-footer {
  padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: space-between;
}
.cit-user   { font-size: 12px; color: var(--sidebar-ink); }
.cit-logout { font-size: 12px; color: var(--sidebar-ink-2); }
.cit-logout:hover { color: var(--sidebar-ink); }

.cit-main {
  flex: 1; min-width: 0;
  padding: 26px 30px 60px;
  max-width: 1360px;
}

/* ---------- Icons ---------- */

.ico {
  width: 15px; height: 15px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
  color: inherit;
}
.ico-sm { width: 13px; height: 13px; }
.ico-lg { width: 18px; height: 18px; }

/* ---------- Page header (replaces the old gradient hero) ---------- */

.page-head { margin-bottom: 22px; }
.page-head-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.page-head h1 { margin-bottom: 5px; }
.page-head .sub { font-size: 13px; color: var(--ink-2); max-width: 62ch; }
.page-head-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--ink-3); margin-top: 9px;
}
.page-head-meta .sep { color: var(--line-strong); }

/* Old hero selectors kept harmless in case a template still uses them. */
.hero, .hero.solo { background: none; color: inherit; padding: 0; margin-bottom: 22px; }
.hero h1 { color: var(--ink); }
.hero-sub { color: var(--ink-2); font-size: 13px; }
.hero-crumb {
  font-size: 11px; color: var(--ink-3); margin-bottom: 6px;
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500;
}
.hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero-pills { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; }
.hero-stat-value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 500; color: var(--ink); letter-spacing: -0.02em; }
.hero-stat-label { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Stat strip ---------- */

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat {
  background: var(--canvas); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px;
}
.stat-label { font-size: 11px; color: var(--ink-3); margin-bottom: 7px; }
.stat-value {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1;
  color: var(--ink);
}
.stat-delta { font-size: 11px; color: var(--ink-3); margin-top: 5px; }
/* State colour tints the NUMBER only — never the whole card. */
.stat.ok     .stat-value { color: var(--accent-deep); }
.stat.warn   .stat-value { color: var(--warn-ink); }
.stat.bad    .stat-value { color: var(--danger-ink); }
.stat.purple .stat-value { color: var(--info-ink); }

/* ---------- Card ---------- */

.card {
  background: var(--canvas); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 18px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.card-title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.card-meta  { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.card-body  { padding: 16px; }
.card-foot  { padding: 11px 16px; border-top: 1px solid var(--line); background: var(--canvas-soft); }
.card-foot .note, .card-foot p { font-size: 12px; color: var(--ink-3); }

.section-title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-spacer { flex: 1; }
.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field-label { font-size: 11px; color: var(--ink-3); margin-bottom: 4px; }

/* ---------- Table ---------- */

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  padding: 9px 16px; text-align: left;
  font-size: 11px; font-weight: 500; color: var(--ink-3);
  border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--canvas);
}
.data-table td {
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  vertical-align: middle; background: var(--canvas); height: 40px;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--canvas-soft); }
.data-table th.num, .data-table td.num { text-align: right; }

/* Row state is carried by the status cell, not by tinting the whole row.
   A tinted row plus a coloured rail plus a coloured badge is three signals
   for one fact, and it makes a dense table unreadable. */
tr.row-ok > td, tr.row-warn > td, tr.row-bad > td { background: var(--canvas); }
tr.row-muted > td { background: var(--canvas); }
tr.row-muted td:not(.actions-cell) { color: var(--ink-3); }
td.state-cell { position: relative; }

.dev-name { font-weight: 500; color: var(--ink); font-size: 13px; }
a.dev-name:hover { color: var(--accent-deep); }
.dev-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.muted { color: var(--ink-4); }
.note  { color: var(--ink-3); font-size: 12px; }
.nowrap { white-space: nowrap; }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }

td.actions-cell { text-align: right; white-space: nowrap; }
td.actions-cell form { display: inline; }
td.actions-cell form + form { margin-left: 6px; }

.row-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  color: var(--ink-3); background: transparent; border: 0; cursor: pointer;
}
.row-action:hover { background: var(--canvas-soft-2); color: var(--ink); }

/* ---------- Status ---------- */

/* A 6px dot and a word. That is the whole vocabulary. */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap; letter-spacing: 0;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); flex-shrink: 0; }
.pill.state-open    { color: var(--ink); }
.pill.state-open    .dot { background: var(--accent); }
.pill.state-storm   { color: var(--warn-ink); }
.pill.state-storm   .dot { background: var(--warn); }
.pill.state-closed  { color: var(--danger-ink); }
.pill.state-closed  .dot { background: var(--danger); }
.pill.state-unknown .dot { background: var(--ink-4); }
.pill.ok      { color: var(--accent-deep); } .pill.ok .dot     { background: var(--accent); }
.pill.warn    { color: var(--warn-ink); }    .pill.warn .dot   { background: var(--warn); }
.pill.bad     { color: var(--danger-ink); }  .pill.bad .dot    { background: var(--danger); }
.pill.info    { color: var(--info-ink); }    .pill.info .dot   { background: #6366f1; }
.pill.neutral { color: var(--ink-3); }
.pill.live .dot { animation: pulse 2.4s ease-in-out infinite; }
.pill-lg { font-size: 13px; }

/* Where a badge really is a badge — a tag, not a status. */
.tag {
  display: inline-flex; align-items: center; padding: 1px 7px;
  border-radius: var(--radius-xs); border: 1px solid var(--line);
  background: var(--canvas-soft); color: var(--ink-3);
  font-size: 11px; font-weight: 500;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

.auto-refresh { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.auto-refresh .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); }
.dot.ok { background: var(--accent); } .dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger); } .dot.off { background: var(--ink-4); }

/* ---------- Banners ---------- */

.status-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 18px;
  border: 1px solid var(--warn-line); background: var(--warn-soft);
  color: var(--warn-ink); border-radius: var(--radius);
}
.status-banner .ico { margin-top: 1px; }
.status-banner-body { flex: 1; min-width: 0; }
.status-banner-title { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.status-banner-text  { font-size: 12.5px; line-height: 1.5; opacity: .95; }
.status-banner-action { margin-left: auto; align-self: center; white-space: nowrap; }
.status-banner.ok   { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-deep); }
.status-banner.bad  { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger-ink); }
.status-banner.info { border-color: var(--line); background: var(--canvas); color: var(--ink-2); }
.status-banner.info .ico { color: var(--ink-3); }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; border: 1px solid var(--line); }
.flash-ok   { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-deep); }
.flash-err  { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-ink); }
.flash-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }

/* ---------- Numbers and timestamps ---------- */

.code, .num, .mono {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 12.5px; color: var(--ink);
}
.ts  { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.ago { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.ago.fresh { color: var(--accent-deep); }
.ago.stale { color: var(--danger); }

/* ---------- Timeline ---------- */

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -20px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--canvas); border: 1.5px solid var(--ink-4);
}
.tl-item.ok::before   { border-color: var(--accent); }
.tl-item.warn::before { border-color: var(--warn); }
.tl-item.bad::before  { border-color: var(--danger); }
.tl-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.tl-title  { font-size: 13px; font-weight: 500; margin-bottom: 1px; }
.tl-detail { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.tl-time   { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--ink-4); text-align: right; flex-shrink: 0; }
.tl-empty  { text-align: center; color: var(--ink-3); padding: 32px; font-size: 13px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-secondary { background: var(--canvas); color: var(--ink-2); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--canvas-soft); color: var(--ink); border-color: var(--ink-4); }
.btn-danger { background: var(--canvas); color: var(--danger-ink); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-ink); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: var(--canvas-soft-2); color: var(--ink); }
.btn-purple { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.btn-sm { height: 27px; padding: 0 10px; font-size: 12px; }

/* ---------- Forms ---------- */

.inp {
  height: 32px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 13px;
  background: var(--canvas); color: var(--ink);
}
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.inp { height: auto; padding: 8px 10px; line-height: 1.55; resize: vertical; }
.inp-full { width: 100%; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 5px; }
.form-row .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.form-section { border-bottom: 1px solid var(--line); margin-bottom: 16px; padding-bottom: 6px; }
.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.check-row input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--accent); }

.config-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.config-table td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.config-table tr:last-child td { border-bottom: 0; }
.config-table td:first-child { color: var(--ink-3); width: 230px; padding-right: 20px; }
.config-table td:last-child { font-family: var(--mono); font-size: 12px; }

/* ---------- Map ---------- */

.map-shell {
  position: relative; height: 620px;
  overflow: hidden; background: var(--canvas-soft-2);
}
/* The at-a-glance map on Live status — tall enough to read the rings, short
   enough that the buildings table stays above the fold. */
.map-shell-compact { height: 380px; }
.map-shell #gmap { position: absolute; inset: 0; }
.map-note {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: 480px; text-align: left; padding: 20px 22px;
  background: var(--canvas); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 13px; color: var(--ink-2);
  line-height: 1.55;
}
.map-note strong { display: block; color: var(--ink); margin-bottom: 6px; font-weight: 600; }
.map-note code { font-family: var(--mono); font-size: 12px; background: var(--canvas-soft-2); padding: 1px 5px; border-radius: var(--radius-xs); }

/* Layer switches, floated over the top-right of the map. */
.map-layers {
  position: absolute; right: 12px; top: 12px; z-index: 3;
  background: rgba(255,255,255,.95); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 11px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.map-layers label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink); cursor: pointer; user-select: none;
  padding: 2px 0;
}
.map-layers input { width: 14px; height: 14px; accent-color: var(--accent); margin: 0; }
.map-layers .swatch { width: 9px; height: 9px; border-radius: 2px; }

/* ---------- Review rail (NVR-style scrub timeline) ---------- */

.review { display: flex; height: 560px; }
.review-map { flex: 1; position: relative; background: var(--canvas-soft-2); min-width: 0; }
/* Only the map canvas fills the box. This was `> div`, which also caught the
   timestamp card — a 94%-white panel stretched across the whole map, which
   looked like the map had simply gone pale. */
.review-map #gmap { position: absolute; inset: 0; }

.review-rail {
  width: 168px; flex: 0 0 168px;
  border-left: 1px solid var(--line); background: var(--canvas);
  display: flex; flex-direction: column;
}
.rail-head {
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.rail-scale { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.rail-zoom { display: flex; gap: 4px; }
.rail-zoom button {
  width: 22px; height: 22px; padding: 0; line-height: 1;
  border: 1px solid var(--line-strong); background: var(--canvas);
  border-radius: var(--radius-xs); color: var(--ink-2);
  font-size: 13px; cursor: pointer;
}
.rail-zoom button:hover { background: var(--canvas-soft); color: var(--ink); }
.rail-track { position: relative; flex: 1; cursor: ns-resize; overflow: hidden; user-select: none; }
.rail-track canvas { display: block; width: 100%; height: 100%; }
.rail-foot {
  padding: 8px 12px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--canvas-soft);
}
.live-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
.live-btn.paused { background: var(--canvas); color: var(--ink-2); border-color: var(--line-strong); }
.live-btn .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.live-btn:not(.paused) .dot { background: #fff; animation: pulse 2.4s ease-in-out infinite; }

.review-stamp {
  position: absolute; left: 14px; top: 14px; z-index: 2;
  background: rgba(255,255,255,.94); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 12px; min-width: 190px;
}
.review-stamp .t {
  font-family: var(--mono); font-size: 15px; font-weight: 500;
  letter-spacing: -0.02em; color: var(--ink);
}
.review-stamp .d { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.review-stamp .c { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.review-stamp .c b { font-family: var(--mono); font-weight: 500; }

@media (max-width: 760px) {
  .review { flex-direction: column; height: auto; }
  .review-map { height: 320px; }
  .review-rail { width: 100%; flex: none; height: 220px; border-left: 0; border-top: 1px solid var(--line); }
}

.map-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--ink-3); }
.map-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); display: inline-block; }
.swatch.ok { background: var(--accent); } .swatch.warn { background: var(--warn); }
.swatch.bad { background: var(--danger); }

/* ---------- Misc ---------- */

.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; background: var(--canvas); }
.tile-name  { font-size: 11px; color: var(--ink-3); margin-bottom: 5px; }
.tile-value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 500; letter-spacing: -0.02em; }
.tile-sub   { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; padding: 15px 16px; margin-bottom: 18px;
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius);
}
.meta-k { font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
.meta-v { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }

.danger-zone { margin-top: 18px; padding: 16px; background: var(--danger-soft); border: 1px solid var(--danger-line); border-radius: var(--radius); }
.danger-zone h4 { color: var(--danger-ink); font-size: 13px; margin-bottom: 6px; }

@media (max-width: 900px) {
  .cit-layout { flex-direction: column; }
  .cit-sidebar { width: 100%; flex: none; height: auto; position: static; }
  .cit-nav { display: flex; flex-wrap: wrap; padding: 6px; }
  .cit-nav-section { display: none; }
  .cit-main { padding: 20px 16px 40px; }
}

@media print {
  .cit-sidebar, .toolbar .btn, .status-banner { display: none !important; }
  .cit-main { padding: 0; max-width: none; }
  .card { break-inside: avoid; }
}
