/* /system/noc — NOC self-monitoring.
   Namespaced to .noc-* so these rules are inert on every other page
   (see project_css_module_layout.md). Colors come from tokens.css only —
   no hardcoded hex (feedback_visual_direction.md). */

/* ── Overall verdict band ─────────────────────────────────────────── */
.noc-hero{
  display:flex; align-items:center; gap:var(--space-4);
  padding:var(--space-5) var(--space-6);
  border:1px solid var(--border); border-left-width:5px;
  border-radius:var(--radius-lg);
  background:var(--card-bg);
  margin:var(--space-4) 0 var(--space-6);
}
.noc-hero-green { border-left-color:var(--green);  background:var(--green-bg); }
.noc-hero-yellow{ border-left-color:var(--yellow); background:var(--yellow-bg); }
.noc-hero-red   { border-left-color:var(--red);    background:var(--red-bg); }

.noc-hero-dot{ width:14px; height:14px; border-radius:50%; flex:0 0 auto; }
.noc-hero-green  .noc-hero-dot{ background:var(--green); }
.noc-hero-yellow .noc-hero-dot{ background:var(--yellow); }
.noc-hero-red    .noc-hero-dot{ background:var(--red); }

.noc-hero-title{ font-size:1.15rem; font-weight:650; letter-spacing:-.01em; }
.noc-hero-green  .noc-hero-title{ color:var(--green-deep); }
.noc-hero-yellow .noc-hero-title{ color:var(--yellow-deep); }
.noc-hero-red    .noc-hero-title{ color:var(--red-deep); }
.noc-hero-sub{ color:var(--text-mute); font-size:.86rem; margin-top:2px; }

/* ── Shared dot ───────────────────────────────────────────────────── */
.noc-dot{ width:9px; height:9px; border-radius:50%; flex:0 0 auto; display:inline-block; }
.noc-dot-green { background:var(--green); }
.noc-dot-yellow{ background:var(--yellow); }
.noc-dot-red   { background:var(--red); }

.noc-h2{ font-size:1rem; font-weight:650; margin:var(--space-6) 0 var(--space-1); }
.noc-hint{ color:var(--text-mute); font-size:.82rem; margin:0 0 var(--space-3); }
.noc-muted{ color:var(--text-mute); }

/* ── Subsystems ───────────────────────────────────────────────────── */
.noc-subs{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:var(--space-3); margin-bottom:var(--space-2);
}
.noc-sub{
  background:var(--card-bg); border:1px solid var(--border);
  border-top:3px solid var(--border); border-radius:var(--radius);
  padding:var(--space-3) var(--space-4);
}
.noc-sub-green { border-top-color:var(--green); }
.noc-sub-yellow{ border-top-color:var(--yellow); }
.noc-sub-red   { border-top-color:var(--red); }
.noc-sub-head{ display:flex; align-items:center; gap:var(--space-2); }
.noc-sub-label{ font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--text-mute); font-weight:600; }
.noc-sub-value{ font-size:1.05rem; font-weight:600; margin-top:var(--space-1); }
.noc-sub-detail{ font-size:.78rem; color:var(--text-mute); margin-top:2px; line-height:1.4; }

/* ── Node cards ───────────────────────────────────────────────────── */
.noc-nodes{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(340px,1fr));
  gap:var(--space-4);
}
.noc-node{
  background:var(--card-bg); border:1px solid var(--border);
  border-left:4px solid var(--border); border-radius:var(--radius-lg);
  padding:var(--space-4) var(--space-5);
}
.noc-node-green { border-left-color:var(--green); }
.noc-node-yellow{ border-left-color:var(--yellow); }
.noc-node-red   { border-left-color:var(--red); }

.noc-node-head{ display:flex; align-items:center; gap:var(--space-3); }
.noc-node-id{ flex:1 1 auto; min-width:0; }
.noc-node-name{ font-weight:650; letter-spacing:-.01em; }
.noc-node-role{ font-size:.78rem; color:var(--text-mute); }
.noc-node-ip{ font-size:.78rem; color:var(--text-mute); white-space:nowrap; }

.noc-metrics{
  display:grid; grid-template-columns:1.4fr 1fr 1fr;
  gap:var(--space-3); margin:var(--space-4) 0 var(--space-3);
  padding-bottom:var(--space-3); border-bottom:1px solid var(--border-soft);
}
.noc-metric-label{ font-size:.68rem; text-transform:uppercase; letter-spacing:.06em; color:var(--text-faint); font-weight:600; }
.noc-metric-value{ font-size:.82rem; margin-top:2px; }
.noc-bar{ height:5px; background:var(--bg-soft); border-radius:99px; overflow:hidden; margin:5px 0 3px; }
.noc-bar > i{ display:block; height:100%; border-radius:99px; }
.noc-bar-green { background:var(--green); }
.noc-bar-yellow{ background:var(--yellow); }
.noc-bar-red   { background:var(--red); }

/* ── Services ─────────────────────────────────────────────────────── */
.noc-svcs{ display:flex; flex-direction:column; gap:5px; }
.noc-svc{
  display:grid; grid-template-columns:auto 1fr auto auto;
  align-items:center; gap:var(--space-2);
  font-size:.8rem; padding:3px 0;
}
.noc-svc-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.noc-svc-kind{
  font-size:.62rem; text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-faint); border:1px solid var(--border-soft);
  border-radius:99px; padding:1px 6px;
}
.noc-svc-detail{ font-size:.72rem; color:var(--text-mute); white-space:nowrap; }
.noc-svc-red   .noc-svc-detail{ color:var(--red-deep);    font-weight:650; }
.noc-svc-yellow .noc-svc-detail{ color:var(--yellow-deep); font-weight:650; }
.noc-svc-none{ font-size:.78rem; padding:2px 0; }

.noc-unreach{
  margin-top:var(--space-3); padding:var(--space-3) var(--space-4);
  background:var(--red-bg); border-radius:var(--radius-sm);
  color:var(--red-deep); font-size:.82rem;
}

.noc-foot{
  margin-top:var(--space-6); padding-top:var(--space-3);
  border-top:1px solid var(--border-soft);
  color:var(--text-mute); font-size:.78rem;
}

/* ══ TOOLKIT HEADLINE + UPDATE PRE-FLIGHT — 2026-08-20 ════════════════════════
   The page's job, above the tabs. Matt asked for fleet-wide core update, which
   had existed for months behind one of ten tabs — unfindable is the same as
   absent. Headline = a number and a verb; the action opens a pre-flight that
   states what will be SKIPPED and why, before anything runs. */
.tk-headline {
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}
.tk-headline-n {
  font-size: 2rem; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  /* --brand as TEXT on white is 2.28:1. --brand-ink is the darker orange that
     keeps the brand read and clears the floor (5.02:1). */
  color: var(--brand-ink);
}
.tk-headline-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tk-headline-t b { font-size: var(--fs-md); }
.tk-headline-t span { font-size: var(--fs-sm); }
.tk-headline-a { margin-left: auto; display: flex; gap: var(--space-2); flex-wrap: wrap; }

.tk-pf {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev); margin-bottom: var(--space-3); overflow: hidden;
}
.tk-pf-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.tk-pf-t { font-weight: 660; }
.tk-pf-x { margin-left: auto; text-decoration: none; color: var(--text-mute); }
.tk-pf-sub {
  font-size: var(--fs-xs); font-weight: 660; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-mute); margin-bottom: var(--space-2);
}
/* The skip list is FIRST and visually distinct — it is the half that decides
   whether the run is worth starting, and the half no competitor shows. */
.tk-pf-skip { padding: var(--space-3) var(--space-4); background: var(--orange-bg); }
.tk-pf-list { padding: var(--space-3) var(--space-4); max-height: 420px; overflow-y: auto; }
.tk-pf-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 5px 0; border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm);
}
.tk-pf-row:last-child { border-bottom: 0; }
.tk-pf-n {
  font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.2em;
  text-align: right; color: var(--orange);
}
.tk-pf-sites, .tk-pf-ver { margin-left: auto; white-space: nowrap; }
.tk-pf-ver { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-mute); }
.tk-pf-dom { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Manage menu — the four occasional tabs (2026-08-20). Ten tabs put the primary
   action behind one of them; Matt asked for a fleet-wide core update that had
   shipped months earlier. CSS-only disclosure: CSP forbids inline JS. */
.tk-manage { position: relative; }
.tk-manage > summary {
  list-style: none; cursor: pointer; user-select: none;
  border: 0; border-left: 1px solid var(--border);
  padding: 8px 16px; font-weight: 600; font-size: var(--fs-sm);
  background: var(--bg-elev); color: var(--text);
}
.tk-manage > summary::-webkit-details-marker { display: none; }
.tk-manage[open] > summary { background: var(--bg-soft); }
.tk-manage-menu {
  position: absolute; right: 0; top: 100%; z-index: 20; min-width: 12rem;
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.18));
  padding: 4px;
}
.tk-manage-menu .tk-tab {
  border: 0 !important; text-align: left; border-radius: var(--radius);
  padding: 8px 12px !important; background: transparent !important; color: var(--text) !important;
}
.tk-manage-menu .tk-tab:hover { background: var(--bg-soft) !important; }

/* Apply bar inside the pre-flight */
.tk-pf-bar {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4) var(--space-2);
}

/* One line of provenance above the headline — replaces four stat cards that used
   to push the actual work 613px down the page. */
.tk-scanline { margin: 0 0 var(--space-2); font-size: var(--fs-xs); }

/* Getting OUT of the pre-flight must be as obvious as getting in. */
.tk-pf-back {
  margin-left: auto; font-size: var(--fs-sm); font-weight: 600;
  color: var(--brand-ink); text-decoration: none; white-space: nowrap;
}
.tk-pf-back:hover { text-decoration: underline; }
.tk-pf-x { margin-left: var(--space-3); text-decoration: none; color: var(--text-mute); }
.tk-pf-foot {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-strong); background: var(--bg-soft);
}

/* "+3 more names" — the site answers to domains we do not show. Hovering lists
   them; the Filter box matches them whether or not they are visible. */
.tk-alias {
  margin-left: var(--space-2); font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-mute); background: var(--bg-soft);
  border: 1px solid var(--border-strong); border-radius: 99px; padding: 0 7px;
  cursor: help; white-space: nowrap;
}

/* A site matched by NAME in the Find-anywhere panel. Boxed and outlined so a
   site hit is not mistaken for an extension group. */
.tk-site-hits { margin-bottom: var(--space-4); }
.tk-site-hits-h {
  font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-mute); margin-bottom: var(--space-2);
}
.tk-site-hit {
  border: 1px solid var(--border-strong); border-left: 4px solid var(--brand);
  border-radius: var(--radius); background: var(--surface);
  padding: var(--space-3); margin-bottom: var(--space-2);
}
.tk-site-hit-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.tk-site-hit-meta { font-size: var(--fs-sm); color: var(--text-mute); margin-top: 2px; }
