/* ============================================================
   Workflow Control Surface — white-label register
   Paper cream · oxblood accent · serif + mono + Plex Sans
   Modeled after examples/adumbrate_brochure.html
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@300;400;500;600&family=IBM+Plex+Sans+Condensed:wght@400;500;600&family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap");

:root {
  color-scheme: light;

  /* Canvas — lighter cool gray, white cards, forest-green accent */
  --paper:         #FAFAFB;          /* near-white canvas, cool */
  --paper-2:       #FFFFFF;          /* card surface */
  --paper-3:       #F1F2F4;          /* recessed / striped rows */
  --paper-4:       #E4E6EA;          /* strong divider / status bar */
  --vellum:        #FBFCFD;          /* input / editor recessed */
  --surface:       #FFFFFF;
  --surface-2:     #F5F6F8;

  --ink:           #121416;          /* primary text */
  --ink-soft:      #2A2D32;
  --ink-muted:     #5B636E;
  --ink-mute-2:    #8C95A1;

  /* Rules — translucent darks on the light canvas */
  --rule:          #12141614;        /* ~8% */
  --rule-strong:   #12141630;        /* ~19% */
  --rule-full:     #12141666;
  --divider:       #1214160A;

  /* Accent — deep corporate forest-green, pulled from the logo */
  --accent:        #2D6A4F;
  --accent-2:      #3E8566;
  --accent-hover:  #215340;
  --accent-press:  #163829;
  --accent-tint:   #2D6A4F0D;
  --accent-soft:   #2D6A4F1F;
  --accent-paper:  #E8F1EC;
  --accent-ink:    #FFFFFF;           /* white text on green buttons */
  --accent-navy:   #163829;            /* deepest green partner */
  --accent-glow:   #2D6A4F00;

  /* Functional — tuned to coexist with the green accent */
  --ok:            #1F8161;            /* success: brighter green */
  --ok-soft:       #1F81611A;
  --ok-border:     #1F816166;
  --warn:          #C5870A;
  --warn-soft:     #C5870A1A;
  --warn-border:   #C5870A66;
  --err:           #C23030;
  --err-soft:      #C230301A;
  --err-border:    #C2303066;
  --info:          #4A6073;            /* slate — distinct from accent green */
  --info-soft:     #4A60731A;
  --info-border:   #4A607366;
  --violet:        #634DBF;
  --violet-soft:   #634DBF1A;

  /* Type — IBM Plex family: industrial, technical, Palantir-adjacent without generic sans */
  --display:     "IBM Plex Sans Condensed", "IBM Plex Sans", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --serif:       var(--display);   /* legacy alias */
  --sans:        "IBM Plex Sans", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --mono:        "IBM Plex Mono", "SFMono-Regular", ui-monospace, "Ubuntu Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  /* Back-compat with older style names */
  --font-sans:   var(--sans);
  --font-mono:   var(--mono);

  /* Shape */
  --radius-xs:   0px;
  --radius-sm:   0px;
  --radius:     2px;

  /* Geometry */
  --sidebar-w:            236px;
  --sidebar-w-collapsed:  56px;
  --topbar-h:             52px;
  --statusbar-h:          28px;
  --content-pad:          28px;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  min-height: 100vh;
  background: var(--paper);
  position: relative;
}
/* Engineer dot-grid texture — technical blueprint paper */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle at 0.5px 0.5px, rgba(18, 20, 22, 0.11) 0.9px, transparent 1.1px),
    radial-gradient(circle at 0.5px 0.5px, rgba(18, 20, 22, 0.04) 0.9px, transparent 1.1px);
  background-size: 96px 96px, 24px 24px;
  background-position: 0 0, 0 0;
}
/* Faint corner vignette — slightly cooler so the green accent reads true */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 62%, rgba(18, 20, 22, 0.05) 100%);
}
.app-shell { position: relative; z-index: 2; }

/* ============================================================
   Page-load orchestration — single staggered reveal
   ============================================================ */

@keyframes opc-rise {
  0%   { opacity: 0; transform: translate3d(0, 12px, 0); filter: blur(3px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}
@keyframes opc-sweep {
  0%   { transform: scaleX(0); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}
.page-overture,
.metrics,
#hero-actions,
.board-section,
.detail-section,
.workflows-footer {
  animation: opc-rise 480ms cubic-bezier(0.2, 0.7, 0.15, 1) backwards;
}
.page-overture    { animation-delay: 40ms; }
.metrics          { animation-delay: 120ms; }
#hero-actions     { animation-delay: 200ms; }
.board-section    { animation-delay: 280ms; }
.detail-section   { animation-delay: 360ms; }
.workflows-footer { animation-delay: 440ms; }

.strip-head::before { animation: opc-sweep 560ms cubic-bezier(0.3, 0.8, 0.25, 1) backwards; animation-delay: 500ms; }

@media (prefers-reduced-motion: reduce) {
  .page-overture, .metrics, #hero-actions,
  .board-section, .detail-section, .workflows-footer,
  .strip-head::before { animation: none !important; }
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: transparent; cursor: pointer; }

/* Kill default italic — CJK + italic looks bad. Semantic emphasis stays but uses weight/border. */
em, i, cite, dfn, address { font-style: normal; }

::selection { background: var(--accent-soft); color: var(--accent); }

/* --- Type base --- */
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-family: var(--serif); font-size: 30px; line-height: 1.08; font-variation-settings: "opsz" 36; font-weight: 400; }
h2 { font-family: var(--serif); font-size: 20px; line-height: 1.14; font-variation-settings: "opsz" 24; font-weight: 400; }
h3 { font-family: var(--serif); font-size: 16px; line-height: 1.22; font-variation-settings: "opsz" 20; font-weight: 400; }
h4 { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }
p { margin: 0; }

pre, code, kbd, .mono, .code-inline {
  font-family: var(--mono);
  font-variant-ligatures: none;
}
pre {
  margin: 0;
  padding: 10px 12px;
  background: var(--vellum);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
code, .code-inline {
  padding: 0 4px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 11.5px;
}
kbd {
  padding: 0 5px;
  min-height: 17px;
  display: inline-flex;
  align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  color: var(--ink-muted);
  font-size: 10px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.label-mono {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ============================================================
   Login gate — full-screen, shown only when html[data-auth="off"]
   ============================================================ */

.login-screen { display: none; }
html[data-auth="off"] .login-screen {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: stretch;
  justify-content: stretch;
  background: var(--paper);
  animation: login-fade 280ms cubic-bezier(0.2, 0.7, 0.15, 1);
}
html[data-auth="off"] .app-shell { visibility: hidden; }

@keyframes login-fade {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes login-card-in {
  0%   { opacity: 0; transform: translate3d(0, 16px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}
@media (max-width: 960px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .login-side { display: none !important; }
}

/* Left rail — editorial, branded */
.login-side {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 48px 56px 40px;
  background:
    linear-gradient(180deg, var(--accent) 0%, var(--accent-navy) 100%);
  color: #FFFFFF;
  overflow: hidden;
}
.login-side::before {
  /* concentric registration rings top-right */
  content: "";
  position: absolute;
  top: -160px;
  right: -160px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.06) 0 42%, transparent 43%),
    radial-gradient(circle, transparent 50%, rgba(255,255,255,0.05) 51% 52%, transparent 53%),
    radial-gradient(circle, transparent 62%, rgba(255,255,255,0.04) 63% 64%, transparent 65%);
  pointer-events: none;
}
.login-side::after {
  /* dot-grid matching the main app, inverted on dark */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    radial-gradient(circle at 0.5px 0.5px, rgba(255, 255, 255, 0.12) 0.9px, transparent 1.1px),
    radial-gradient(circle at 0.5px 0.5px, rgba(255, 255, 255, 0.04) 0.9px, transparent 1.1px);
  background-size: 96px 96px, 24px 24px;
}

.login-side > * { position: relative; z-index: 2; }

.login-side-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  align-self: flex-start;
}
.login-side-tag-dot {
  width: 6px;
  height: 6px;
  background: #FFFFFF;
  animation: live-pulse 1.6s steps(1, end) infinite;
}

.login-side-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  margin-top: auto;     /* push the whole hero block toward vertical center */
  margin-bottom: auto;
}
.login-side-logo {
  max-height: 44px;
  max-width: 220px;
  width: auto;
  filter: brightness(0) invert(1);    /* render white on the green rail */
  object-fit: contain;
}
.login-side-logo-fallback {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  position: relative;
}
.login-side-logo-fallback::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--accent);
}
.login-side-logo-fallback::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: var(--accent);
}

.login-side-caption { display: none; }
.login-side-kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  width: 100%;
  max-width: 280px;
}
.login-side-kicker::after {
  /* trailing hair-line — gives the label a confident stop */
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}
.login-side-headline {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: #FFFFFF;
}
.login-side-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  max-width: 34ch;
  letter-spacing: 0.005em;
}

.login-side-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.login-side-foot .login-side-v {
  color: #FFFFFF;
  font-weight: 500;
  letter-spacing: 0.22em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.login-side-foot .login-side-v::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: rgba(255, 255, 255, 0.8);
  flex: 0 0 auto;
}

.login-side-axis {
  position: absolute;
  top: 48px; bottom: 40px; left: 24px;
  width: 1px;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.5) 0 2px, transparent 2px 8px);
  z-index: 3;
}

/* Right side — the card */
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
}
.login-main::before {
  /* dot grid mirrors main app */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 0.5px 0.5px, rgba(18, 20, 22, 0.10) 0.9px, transparent 1.1px),
    radial-gradient(circle at 0.5px 0.5px, rgba(18, 20, 22, 0.035) 0.9px, transparent 1.1px);
  background-size: 96px 96px, 24px 24px;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  padding: 36px 36px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-shadow:
    0 1px 2px rgba(18, 20, 22, 0.04),
    0 30px 60px -24px rgba(18, 20, 22, 0.22);
  animation: login-card-in 360ms 80ms cubic-bezier(0.2, 0.7, 0.15, 1) backwards;
}

/* Four registration-mark corners — no L / R asymmetry */
.login-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.login-corner-tl { top: -1px; left: -1px;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 14px no-repeat;
}
.login-corner-tr { top: -1px; right: -1px;
  background:
    linear-gradient(var(--ink), var(--ink)) right top / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 1px 14px no-repeat;
}
.login-corner-bl { bottom: -1px; left: -1px;
  background:
    linear-gradient(var(--ink), var(--ink)) left bottom / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 1px 14px no-repeat;
}
.login-corner-br { bottom: -1px; right: -1px;
  background:
    linear-gradient(var(--ink), var(--ink)) right bottom / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 14px no-repeat;
}

.login-head { display: flex; flex-direction: column; gap: 10px; }
.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  align-self: flex-start;
}
.login-eyebrow-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  display: inline-block;
}
.login-title {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--ink);
  margin: 4px 0 0;
}
.login-lede {
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.52;
  color: var(--ink-muted);
  max-width: 38ch;
}

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.login-field-key {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.login-field-req {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute-2);
}
.login-field input {
  padding: 10px 12px;
  height: 40px;
  border: 1px solid var(--rule-strong);
  background: var(--vellum);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  color: var(--ink);
  transition: border-color 100ms ease, box-shadow 100ms ease, background 100ms ease;
}
.login-field input::placeholder { color: var(--ink-mute-2); }
.login-field input:focus {
  border-color: var(--accent);
  background: var(--paper-2);
  box-shadow: 0 0 0 2px var(--accent-tint);
}
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 40px var(--vellum) inset;
  box-shadow: 0 0 0 40px var(--vellum) inset;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--err);
  background: var(--err-soft);
  border: 1px solid var(--err-border);
  border-left: 3px solid var(--err);
}
.login-error::before {
  content: "!";
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--err);
  border-radius: 50%;
  font-size: 10px;
  flex: 0 0 auto;
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  margin-top: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.login-submit:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.login-submit:active { transform: translateY(1px); background: var(--accent-press); }
.login-submit:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.login-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute-2);
  flex-wrap: wrap;
}
.login-foot-sep { color: var(--rule-full); }

/* ============================================================
   Shell — Sidebar + Topbar + Content + Statusbar
   ============================================================ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: transparent;
  transition: grid-template-columns 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
.app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
.app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-item span,
.app-shell.sidebar-collapsed .sidebar-foot,
.app-shell.sidebar-collapsed .sidebar-brand .sidebar-sub { display: none; }
.app-shell.sidebar-collapsed .sidebar-brand { padding: 12px 0; justify-content: center; }
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding: 9px 0; }

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
  grid-column: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: var(--paper-2);
  border-right: 1px solid var(--rule-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  min-height: var(--topbar-h);
}
.sidebar-brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  cursor: pointer;
  color: var(--ink);
  transition: opacity 120ms ease;
}
.sidebar-brand-link:hover { opacity: 0.85; }
.sidebar-logo {
  max-height: 28px;
  max-width: 140px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}
.sidebar-logo-fallback {
  display: inline-block;
  width: 28px;
  height: 28px;
  position: relative;
  background: var(--accent);
}
.sidebar-logo-fallback::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  pointer-events: none;
}
.sidebar-logo-fallback::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  background: #FFFFFF;
}
.sidebar-node-chip {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 2px 7px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.sidebar-node-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--ok);
  display: inline-block;
  animation: live-pulse 1.6s steps(1, end) infinite;
}
.app-shell.sidebar-collapsed .sidebar-node-chip { display: none; }
.app-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 10px 0; }
.app-shell.sidebar-collapsed .sidebar-logo { max-width: 28px; }

/* ============================================================
   Module switcher — top of sidebar, platform-module selector
   ============================================================ */

.module-switcher {
  position: relative;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.module-switcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 100ms ease, background 100ms ease;
  position: relative;
}
.module-switcher-btn::before {
  /* left accent bar denoting the active module */
  content: "";
  position: absolute;
  top: 6px; bottom: 6px; left: 0;
  width: 2px;
  background: var(--accent);
}
.module-switcher-btn:hover {
  border-color: var(--accent);
  background: var(--paper-3);
}
.module-switcher[data-open="true"] .module-switcher-btn {
  border-color: var(--accent);
  background: var(--paper-3);
}
.module-switcher-glyph {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 14px;
  font-weight: 600;
  flex: 0 0 auto;
  letter-spacing: 0;
  margin-left: 2px;
  position: relative;
}
.module-switcher-glyph::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
}
.module-switcher-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
  flex: 1 1 auto;
}
.module-switcher-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 2px;
}
.module-switcher-name {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.module-switcher-caret {
  color: var(--ink-muted);
  flex: 0 0 auto;
  transition: transform 160ms ease, color 100ms ease;
}
.module-switcher[data-open="true"] .module-switcher-caret {
  transform: rotate(180deg);
  color: var(--accent);
}

.module-switcher-menu {
  position: absolute;
  top: calc(100% - 4px);
  left: 10px;
  right: 10px;
  z-index: 60;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  box-shadow:
    0 1px 2px rgba(18, 20, 22, 0.04),
    0 18px 40px -14px rgba(18, 20, 22, 0.22);
  animation: module-menu-in 180ms cubic-bezier(0.2, 0.7, 0.15, 1);
}
.module-switcher-menu::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 8px; height: 8px;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 8px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 8px no-repeat;
  opacity: 0.6;
  pointer-events: none;
}
.module-switcher-menu::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 8px; height: 8px;
  background:
    linear-gradient(var(--ink), var(--ink)) right bottom / 8px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 8px no-repeat;
  opacity: 0.6;
  pointer-events: none;
}
@keyframes module-menu-in {
  0%   { opacity: 0; transform: translate3d(0, -4px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

.module-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 12px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
}
.module-menu-head .mono {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-mute-2);
}

.module-menu-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--divider);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: background 100ms ease;
}
.module-menu-item:first-of-type { border-top: 0; }
.module-menu-item:hover:not([disabled]) { background: var(--paper-3); }
.module-menu-item[disabled] { cursor: not-allowed; opacity: 0.58; }
.module-menu-item.active { background: var(--accent-tint); }
.module-menu-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
}
.module-menu-item { position: relative; }

.module-menu-glyph {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}
.module-menu-item[disabled] .module-menu-glyph {
  background: var(--paper-4);
  color: var(--ink-muted);
}
.module-menu-body {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.module-menu-body strong {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.module-menu-body span {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.module-menu-status {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute-2);
  padding: 2px 6px;
  border: 1px solid var(--rule-strong);
  white-space: nowrap;
  align-self: center;
}
.module-menu-status.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-tint);
}

.app-shell.sidebar-collapsed .module-switcher { padding: 8px 6px; }
.app-shell.sidebar-collapsed .module-switcher-btn {
  padding: 6px;
  justify-content: center;
}
.app-shell.sidebar-collapsed .module-switcher-meta,
.app-shell.sidebar-collapsed .module-switcher-caret { display: none; }
.app-shell.sidebar-collapsed .module-switcher-menu { left: calc(100% + 8px); right: auto; top: 0; width: 280px; }
.sidebar-brand .brand-text strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
  font-variation-settings: "opsz" 22;
}
.sidebar-brand .brand-text span,
.sidebar-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label {
  padding: 4px 10px 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 80ms ease, color 80ms ease, border-color 80ms ease;
  font-family: var(--sans);
}
.nav-item svg { color: var(--ink-muted); flex: 0 0 auto; }
.nav-item:hover { background: var(--paper-3); color: var(--ink); }
.nav-item:hover svg { color: var(--ink); }
.nav-item.active {
  background: var(--accent-tint);
  color: var(--accent);
  border-color: var(--rule-strong);
  border-left: 2px solid var(--accent);
  padding-left: 9px;
  font-weight: 500;
}
.nav-item.active svg { color: var(--accent); }
.nav-item[data-nav-disabled] { opacity: 0.5; cursor: not-allowed; }

.sidebar-foot {
  border-top: 1px solid var(--rule);
  padding: 10px 10px 12px;
}
.foot-card {
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  position: relative;
}
.foot-card::before,
.foot-card::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 6px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 6px no-repeat;
  opacity: 0.6;
}
.foot-card::before { top: -1px; left: -1px; }
.foot-card::after {
  bottom: -1px; right: -1px;
  background:
    linear-gradient(var(--ink), var(--ink)) right bottom / 6px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 6px no-repeat;
}
.foot-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
  font-size: 11px;
  border-top: 1px dashed var(--rule);
}
.foot-row:first-of-type { border-top: 0; }
.foot-row span {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.foot-row strong {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Sidebar signout button — always-visible logout affordance */
.sidebar-signout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 100ms ease, background 100ms ease, color 100ms ease;
  position: relative;
}
.sidebar-signout::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 8px; height: 8px;
  pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 8px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 8px no-repeat;
  opacity: 0.55;
}
.sidebar-signout::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 8px; height: 8px;
  pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) right bottom / 8px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 8px no-repeat;
  opacity: 0.55;
}
.sidebar-signout:hover {
  border-color: var(--err);
  color: var(--err);
  background: var(--err-soft);
}
.sidebar-signout:hover svg { color: var(--err); }

.sidebar-signout-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.sidebar-signout-avatar {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}
.sidebar-signout:hover .sidebar-signout-avatar {
  background: var(--err);
}
.sidebar-signout-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.sidebar-signout-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-signout-hint {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-mute-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-top: 2px;
}
.sidebar-signout svg { color: var(--ink-muted); flex: 0 0 auto; }
.app-shell.sidebar-collapsed .sidebar-signout {
  justify-content: center;
  padding: 8px 0;
}
.app-shell.sidebar-collapsed .sidebar-signout-meta,
.app-shell.sidebar-collapsed .sidebar-signout svg {
  display: none;
}

/* ============================================================
   Topbar + Brand Block (logo top-left)
   ============================================================ */

.workspace-main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: var(--paper);
  border-bottom: 1px solid var(--rule-strong);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
}
.topbar::after {
  /* subtle grain band under topbar */
  content: "";
  position: absolute;
  inset: auto 0 -6px 0;
  height: 6px;
  background:
    repeating-linear-gradient(90deg, var(--paper-3) 0 48px, transparent 48px 96px);
  opacity: 0.4;
  pointer-events: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* ------- Brand Block ("cool" logo treatment, top-left) ------- */

.brand-block {
  display: inline-flex;
  align-items: center;
  padding: 0;
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: opacity 120ms ease;
}
.brand-block:hover { opacity: 0.85; }

/* ============================================================
   Platform wordmark — DingtaiOS
   Condensed sans for "Dingtai" + mono accent chip for "OS"
   ============================================================ */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  color: var(--ink);
  user-select: none;
  transition: opacity 120ms ease;
}
.wordmark:hover { opacity: 0.85; }
.wordmark .wm-main {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: inherit;
}
.wordmark .wm-suffix {
  font-family: "IBM Plex Mono", "Noto Sans SC", monospace;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 2px 5px 2px 5px;
  margin-left: 3px;
  position: relative;
}
.wordmark .wm-suffix::after {
  /* subtle inset stroke for a machined look */
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

/* Small — for topbar / inline placements */
.wordmark-sm .wm-main { font-size: 17px; }
.wordmark-sm .wm-suffix { font-size: 11.5px; padding: 2px 5px; }

/* Large — for the login side rail */
.wordmark-lg .wm-main { font-size: 38px; }
.wordmark-lg .wm-suffix {
  font-size: 22px;
  padding: 4px 9px 4px 9px;
  margin-left: 6px;
  letter-spacing: 0.02em;
}
.wordmark-lg .wm-suffix::after { inset: 3px; }

/* Inverse — for dark backgrounds (login side rail on green) */
.wordmark-inverse { color: #FFFFFF; }
.wordmark-inverse .wm-main { color: #FFFFFF; }
.wordmark-inverse .wm-suffix {
  color: var(--accent);          /* dark-green glyph... */
  background: #FFFFFF;            /* ...on white chip — inverts the relationship */
}
.wordmark-inverse .wm-suffix::after {
  border-color: rgba(18, 20, 22, 0.18);
}

.brand-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0;
  background: transparent;
  position: relative;
  overflow: visible;
  flex: 0 0 auto;
}
.brand-frame::after { display: none; }
.brand-logo-img {
  filter: none;              /* white-label: use the logo's native colors */
  max-height: 30px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.brand-fallback {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: var(--accent);
  position: relative;
}
.brand-fallback::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.55);
}
.brand-fallback::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: #FFFFFF;
}
.brand-frame::after {
  /* inner corner registration accents */
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(11, 17, 23, 0.45);
  pointer-events: none;
}
.brand-monogram {
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 20px;
  color: var(--accent-ink);
  letter-spacing: -0.01em;
  line-height: 1;
  font-weight: 600;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0;
}
.brand-meta .brand-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.brand-meta .brand-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
  font-variation-settings: "opsz" 22;
  white-space: nowrap;
}
.brand-meta .brand-name em {
  font-style: normal;
  color: var(--ink-muted);
  font-weight: 500;
  margin-left: 2px;
}

/* ------- Crumbs ------- */

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.crumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { color: var(--ink-mute-2); font-weight: 300; }
.crumb-current { color: var(--ink); }

.icon-button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { background: var(--paper-3); color: var(--ink); border-color: var(--rule); }
.icon-button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-tint);
}

/* ------- Topbar search ------- */

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 30px;
  height: 28px;
  background: var(--vellum);
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  max-width: 420px;
  width: 100%;
  justify-self: start;
}
.topbar-search:focus-within { background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.topbar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
}
.topbar-search input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
  min-width: 0;
}
.topbar-search input::placeholder {
  color: var(--ink-mute-2);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

/* Search results dropdown (command palette) */
.topbar-search { position: relative; }
.topbar-search.search-open { border-color: var(--accent); background: var(--paper-2); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 70;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  max-height: 60vh;
  overflow-y: auto;
  box-shadow:
    0 1px 2px rgba(18, 20, 22, 0.04),
    0 18px 40px -14px rgba(18, 20, 22, 0.26);
  animation: search-results-in 160ms cubic-bezier(0.2, 0.7, 0.15, 1);
}
.search-results::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 8px; height: 8px;
  pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 8px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 8px no-repeat;
  opacity: 0.5;
}
.search-results::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 8px; height: 8px;
  pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) right bottom / 8px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 8px no-repeat;
  opacity: 0.5;
}
@keyframes search-results-in {
  0%   { opacity: 0; transform: translate3d(0, -3px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

.search-group { border-bottom: 1px solid var(--rule); }
.search-group:last-child { border-bottom: 0; }
.search-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 12px 5px;
  background: var(--paper-3);
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--divider);
}
.search-group-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.search-group-count {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-mute-2);
}

.search-list { list-style: none; margin: 0; padding: 0; }
.search-item {
  display: grid;
  grid-template-columns: 38px 1fr 16px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--divider);
  cursor: pointer;
}
.search-item:first-child { border-top: 0; }
.search-item.active {
  background: var(--accent-tint);
  box-shadow: inset 2px 0 0 var(--accent);
}
.search-item.active .search-go { color: var(--accent); }

.search-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
}
.search-kind-page { color: var(--ink); background: var(--paper-3); }
.search-kind-wf   { color: var(--accent); border-color: var(--accent); background: var(--accent-tint); }
.search-kind-run  { color: var(--info); border-color: var(--info); background: var(--info-soft); }
.search-kind-user { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.search-kind-conn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.search-item[data-status="awaiting"] .search-kind-run { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.search-item[data-status="failed"] .search-kind-run   { color: var(--err); border-color: var(--err); background: var(--err-soft); }
.search-item[data-status="completed"] .search-kind-run { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }

.search-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.search-label {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-sub {
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-go {
  color: var(--ink-mute-2);
  justify-self: end;
  transition: color 100ms ease;
}

.search-empty {
  padding: 28px 12px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.search-empty-glyph {
  font-size: 22px;
  color: var(--ink-mute-2);
  letter-spacing: 0;
}
.search-empty-hint {
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--ink-mute-2);
  font-size: 10px;
}

/* ------- Topbar right ------- */

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  font-family: var(--mono);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 0;            /* square LED */
  background: var(--ok);
  animation: live-pulse 1.6s steps(1, end) infinite;
  flex: 0 0 auto;
}
@keyframes live-pulse {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0.25; }
}
.live-label {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.live-indicator strong {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ============================================================
   Notifications bell + popover
   ============================================================ */

.bell-wrap { position: relative; display: inline-flex; }
.bell-btn { position: relative; }
.bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--err);
  color: #FFFFFF;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--paper);
  animation: bell-badge-in 280ms cubic-bezier(0.2, 0.7, 0.15, 1);
}
@keyframes bell-badge-in {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.bell-btn:hover .bell-badge { border-color: var(--paper-3); }

.bell-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 92vw;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  box-shadow:
    0 1px 2px rgba(18, 20, 22, 0.04),
    0 18px 40px -14px rgba(18, 20, 22, 0.22);
  z-index: 60;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: bell-popover-in 200ms cubic-bezier(0.2, 0.7, 0.15, 1);
}
.bell-popover::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 10px; height: 10px;
  pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 10px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 10px no-repeat;
  opacity: 0.7;
}
.bell-popover::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) right bottom / 10px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 10px no-repeat;
  opacity: 0.7;
}
@keyframes bell-popover-in {
  0%   { opacity: 0; transform: translate3d(0, -4px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

.bell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule);
}
.bell-head-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.bell-clear {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--rule-strong);
  padding: 3px 8px;
  cursor: pointer;
  transition: color 100ms ease, border-color 100ms ease;
}
.bell-clear:hover { color: var(--accent); border-color: var(--accent); }

.bell-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 380px;
  overflow-y: auto;
}
.bell-empty {
  padding: 32px 14px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute-2);
}
.bell-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background 100ms ease;
  position: relative;
}
.bell-item:hover { background: var(--paper-3); }
.bell-item-read { opacity: 0.55; }
.bell-item:last-child { border-bottom: 0; }
.bell-item:not(.bell-item-read)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--accent);
}
.bell-item-glyph {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-3);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid currentColor;
  align-self: flex-start;
  margin-top: 1px;
}
.bell-item-glyph.ok   { color: var(--ok);  background: var(--ok-soft); }
.bell-item-glyph.warn { color: var(--warn); background: var(--warn-soft); }
.bell-item-glyph.err  { color: var(--err); background: var(--err-soft); }
.bell-item-glyph.info { color: var(--accent); background: var(--accent-soft); }

.bell-item-body { min-width: 0; }
.bell-item-title {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  word-break: break-word;
}
.bell-item-message {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bell-item-time {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--ink-mute-2);
  align-self: flex-start;
  white-space: nowrap;
  padding-top: 3px;
}

.bell-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--rule);
  background: var(--paper-3);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute-2);
}

/* ============================================================
   Toast stack — bottom-right
   ============================================================ */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 44px;      /* above the sticky status-bar */
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
  max-width: 380px;
  pointer-events: none;
}
.toast {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  column-gap: 12px;
  align-items: flex-start;
  padding: 12px 14px 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  box-shadow:
    0 1px 2px rgba(18, 20, 22, 0.04),
    0 14px 30px -10px rgba(18, 20, 22, 0.22);
  pointer-events: auto;
  overflow: hidden;
  animation: toast-slide-in 260ms cubic-bezier(0.2, 0.7, 0.15, 1);
  cursor: pointer;
}
.toast.toast-leaving {
  animation: toast-slide-out 240ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes toast-slide-in {
  0%   { opacity: 0; transform: translate3d(16px, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes toast-slide-out {
  0%   { opacity: 1; transform: translate3d(0, 0, 0); }
  100% { opacity: 0; transform: translate3d(16px, 0, 0); }
}
.toast.toast-ok   { border-left: 3px solid var(--ok); }
.toast.toast-warn { border-left: 3px solid var(--warn); }
.toast.toast-err  { border-left: 3px solid var(--err); }
.toast.toast-info { border-left: 3px solid var(--accent); }

.toast-glyph {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid currentColor;
}
.toast-glyph.ok   { color: var(--ok);  background: var(--ok-soft); }
.toast-glyph.warn { color: var(--warn); background: var(--warn-soft); }
.toast-glyph.err  { color: var(--err); background: var(--err-soft); }
.toast-glyph.info { color: var(--accent); background: var(--accent-soft); }

.toast-body { min-width: 0; }
.toast-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.toast-message {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  margin-top: 3px;
  word-break: break-all;
}
.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color 100ms ease, border-color 100ms ease;
}
.toast-close:hover { color: var(--ink); border-color: var(--ink); }

.toast-progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  background: currentColor;
  color: var(--ink-mute-2);
  width: 100%;
  transform-origin: left;
  animation-name: toast-progress-shrink;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
.toast.toast-ok   .toast-progress { color: var(--ok); }
.toast.toast-warn .toast-progress { color: var(--warn); }
.toast.toast-err  .toast-progress { color: var(--err); }
.toast.toast-info .toast-progress { color: var(--accent); }
@keyframes toast-progress-shrink {
  0%   { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

/* ============================================================
   User widget / sign-in
   ============================================================ */

.user-widget { position: relative; }
.user-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px 2px 2px;
  height: 28px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  cursor: pointer;
}
.user-button:hover { background: var(--paper-3); border-color: var(--rule-full); }
.user-avatar {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.user-info { display: flex; flex-direction: column; line-height: 1; text-align: left; }
.user-info strong {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  font-variation-settings: "opsz" 16;
  letter-spacing: 0.01em;
}
.user-email {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-muted);
  margin-top: 2px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.user-caret { color: var(--ink-muted); }

.signin-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
}
.signin-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.user-menu,
.signin-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 50;
}
.signin-popover { min-width: 320px; }
.hidden { display: none !important; }

.user-menu-head,
.signin-head {
  padding: 12px 14px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.user-menu-head strong,
.signin-head strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  font-variation-settings: "opsz" 20;
}
.user-menu-head span,
.signin-head span {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-muted);
  margin-top: 4px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  border-top: 1px solid var(--rule);
}
.menu-row:hover { background: var(--paper-2); color: var(--ink); }
.menu-row-danger { color: var(--err); }
.menu-row-danger:hover { background: var(--err-soft); color: var(--err); }
.menu-sep { height: 1px; background: var(--rule); }

.signin-form { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.signin-field { display: flex; flex-direction: column; gap: 5px; }
.signin-field > span {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
}
.signin-field input {
  padding: 8px 10px;
  border: 1px solid var(--rule-strong);
  background: var(--vellum);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  color: var(--ink);
}
.signin-field input:focus { border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 2px var(--accent-tint); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  height: 30px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.primary-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.signin-footer {
  font-size: 10.5px;
  color: var(--ink-muted);
  line-height: 1.5;
  font-family: var(--sans);
}

/* ============================================================
   Content
   ============================================================ */

.content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px var(--content-pad) 36px;
  min-width: 0;
  min-height: calc(100vh - var(--topbar-h) - var(--statusbar-h));
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

/* Shared section head */
.strip-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 16px;
  align-items: baseline;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--rule-strong);
  position: relative;
}
.strip-head::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 48px;
  height: 2px;
  background: var(--accent);
}
.strip-head .section-no {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.strip-head h2 {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variation-settings: "opsz" 26;
  font-weight: 400;
}
.strip-head h2 em { font-style: normal; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.strip-head .strip-sub {
  grid-column: 2;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* ============================================================
   Page Overture (hero section)
   ============================================================ */

.page-overture {
  display: block;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--rule-strong);
}
.overture-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.overture-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.overture-eyebrow .dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}
.overture-eyebrow .sect {
  color: var(--accent);
  letter-spacing: 0.22em;
}
.overture-title {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 30ch;
  margin-top: 2px;
}
.overture-title em {
  display: inline-block;
  font-style: normal;
  font-weight: 600;
  color: var(--paper);
  background: var(--accent);
  padding: 0 0.16em 0.04em;
  line-height: 0.9;
  box-shadow: 3px 3px 0 var(--paper-3), 3px 3px 0 1px var(--accent);
  transform: translateY(-0.02em);
}
.overture-lede {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
  font-weight: 400;
  max-width: 72ch;
  margin-top: 6px;
}
.overture-lede em { font-style: normal; color: var(--ink); font-weight: 500; }

.overture-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  position: relative;
}
.overture-aside::before,
.overture-aside::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
}
.overture-aside::before {
  top: -1px; right: -1px;
  background:
    linear-gradient(var(--ink), var(--ink)) right top / 10px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center top / 1px 10px no-repeat;
  opacity: 0.85;
}
.overture-aside::after {
  bottom: -1px; left: -1px;
  background:
    linear-gradient(var(--ink), var(--ink)) left bottom / 10px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left center / 1px 10px no-repeat;
  opacity: 0.85;
}
.overture-aside .aside-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.overture-aside .aside-head strong { color: var(--accent); font-weight: 500; }

/* Legacy page-head scaffold disabled */
.page-head { display: none; }

/* ============================================================
   View Router
   ============================================================ */

.view { display: none; }
.view.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: view-fade 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes view-fade {
  0% { opacity: 0; transform: translate3d(0, 8px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

.view-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--rule-strong);
  position: relative;
}
.view-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 44px;
  height: 2px;
  background: var(--accent);
}
.view-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  flex-wrap: wrap;
}
.view-eyebrow .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  display: inline-block;
}
.view-eyebrow .sect { color: var(--accent); letter-spacing: 0.24em; font-weight: 500; }
.view-title {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 4px 0 0;
}
.view-lede {
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 76ch;
  margin-top: 4px;
}

/* Sidebar nav count badges */
.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  font-weight: 500;
  color: var(--ink-mute-2);
  padding: 1px 5px;
  min-width: 20px;
  text-align: center;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
.nav-count:empty { display: none; }
.nav-item.active .nav-count { color: var(--accent); border-color: var(--accent); }
.app-shell.sidebar-collapsed .nav-count { display: none; }

/* Workflows view enhancements */
.workflow-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 1px dashed var(--rule-strong);
}
.workflow-path {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute-2);
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: lowercase;
}
.view[data-view="workflows"] .workflow-card { padding: 22px 24px 20px; min-height: 180px; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.view[data-view="workflows"] .workflow-card:hover { border-color: var(--accent); background: var(--accent-tint); }
.view[data-view="workflows"] .workflow-card-head h3 { font-size: 22px; letter-spacing: -0.01em; }

/* ============================================================
   Schedule view — custom-timers jobs
   ============================================================ */

.schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
}
.schedule-filter-pills {
  display: flex;
  gap: 0;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
}
.schedule-pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.schedule-pill:last-child { border-right: 0; }
.schedule-pill:hover { background: var(--paper-3); color: var(--ink); }
.schedule-pill.active { background: var(--accent); color: var(--accent-ink); }
.schedule-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}
.schedule-meta strong { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Table rows */
.schedule-table tbody td { vertical-align: top; padding: 9px 12px; }
.schedule-dot-cell { padding-right: 0 !important; padding-left: 14px !important; }
.schedule-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--ink-muted);
  margin-top: 6px;
}
.schedule-dot-upcoming { background: var(--accent); box-shadow: 0 0 0 1px var(--paper), 0 0 0 2px var(--accent); animation: live-pulse 1.6s steps(1, end) infinite; }
.schedule-dot-recurring-idle { background: var(--violet); }
.schedule-dot-spent { background: var(--ink-mute-2); }

.schedule-row-disabled { opacity: 0.5; }
.schedule-row-disabled:hover { opacity: 0.75; }
.schedule-row-spent .schedule-dim { color: var(--ink-mute-2); }

.schedule-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.schedule-title strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
  word-break: break-all;
}
.schedule-desc {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.schedule-expr {
  font-size: 10px;
  color: var(--ink-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.schedule-rel {
  font-size: 9.5px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.schedule-dim { color: var(--ink-mute-2); }
.schedule-script {
  font-size: 10.5px;
  color: var(--ink-soft);
  word-break: break-all;
  line-height: 1.4;
}
.schedule-notes {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 3px;
  line-height: 1.4;
}
.schedule-flags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* make the table rows not clickable (overrides logs-table) */
.schedule-table tbody tr { cursor: default !important; }
.schedule-table tbody tr:hover { background: var(--paper-3); }
.schedule-table tbody tr[data-log-row]:hover td:first-child { box-shadow: none; }

/* ============================================================
   Connectors view
   ============================================================ */

.connectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1px;
  background: var(--rule-strong);
  border: 1px solid var(--rule-strong);
}
.connector-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 18px;
  background: var(--paper-2);
  min-width: 0;
  position: relative;
}
.connector-card.connector-connected    { border-left: 3px solid var(--ok); padding-left: 17px; }
.connector-card.connector-degraded     { border-left: 3px solid var(--warn); padding-left: 17px; }
.connector-card.connector-disconnected { border-left: 3px solid var(--err); padding-left: 17px; }
.connector-card.connector-unconfigured { border-left: 3px solid var(--rule-strong); padding-left: 17px; background: var(--paper-3); }
.connector-card.connector-unconfigured h3,
.connector-card.connector-unconfigured .connector-sub { color: var(--ink-muted); }

.connector-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.connector-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.connector-glyph {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 16px;
  font-weight: 600;
  flex: 0 0 auto;
  position: relative;
}
.connector-glyph::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}
.connector-unconfigured .connector-glyph { background: var(--paper-4); color: var(--ink-muted); }

.connector-title h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.005em;
}
.connector-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 3px;
}

.connector-status {
  align-self: flex-start;
  white-space: nowrap;
}
.connector-status.muted {
  color: var(--ink-muted);
  border-color: var(--rule-strong);
  background: var(--paper);
}
.connector-status-dot {
  width: 6px;
  height: 6px;
  background: currentColor;
}
.connector-connected .connector-status-dot { animation: live-pulse 2s steps(1, end) infinite; }

.connector-meta {
  display: grid;
  grid-template-columns: 72px 1fr;
  row-gap: 4px;
  column-gap: 12px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
}
.connector-meta dt {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  align-self: baseline;
}
.connector-meta dd {
  margin: 0;
  font-size: 12px;
  color: var(--ink);
  font-family: var(--sans);
  word-break: break-all;
  align-self: baseline;
}
.connector-meta dd.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.connector-objects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.connector-obj {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ink);
  padding: 2px 7px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
}
.connector-obj-muted { color: var(--ink-mute-2); }

.connector-notes {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.connector-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  margin-top: auto;
}

/* ============================================================
   Users view
   ============================================================ */

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
}

.user-row-inactive { opacity: 0.55; }
.user-row-inactive:hover { opacity: 0.8; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.user-cell > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-cell strong {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.005em;
}
.user-handle {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  margin-top: 1px;
}
.user-avatar-sm {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.perms-cell {
  padding: 8px 12px !important;
}
.perm-chip {
  display: inline-flex;
  align-items: stretch;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  border: 1px solid var(--rule-strong);
  margin: 2px 4px 2px 0;
  overflow: hidden;
  white-space: nowrap;
}
.perm-chip .perm-wf {
  padding: 3px 7px;
  background: var(--paper);
  color: var(--ink);
}
.perm-chip .perm-level {
  padding: 3px 7px;
  background: var(--paper-3);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 8.5px;
  border-left: 1px solid var(--rule-strong);
}

.perm-chip.perm-admin {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 3px 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-color: var(--accent);
}
.perm-chip.perm-approve .perm-level { color: var(--warn); border-left-color: var(--warn-border); background: var(--warn-soft); }
.perm-chip.perm-approve { border-color: var(--warn-border); }
.perm-chip.perm-operator .perm-level { color: var(--accent); border-left-color: var(--accent-soft); background: var(--accent-tint); }
.perm-chip.perm-operator { border-color: var(--accent-soft); }
.perm-chip.perm-run .perm-level { color: var(--ok); border-left-color: var(--ok-border); background: var(--ok-soft); }
.perm-chip.perm-run { border-color: var(--ok-border); }
.perm-chip.perm-read .perm-level { color: var(--info); border-left-color: var(--info-border); background: var(--info-soft); }
.perm-chip.perm-read { border-color: var(--info-border); }
.perm-chip.perm-stale { opacity: 0.45; }
.perm-chip.perm-stale::after {
  content: "·  未同步";
  align-self: center;
  padding: 0 6px;
  font-size: 8.5px;
  color: var(--err);
}
.perm-empty {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ============================================================
   Workflow detail modal
   ============================================================ */

.wfdetail-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.wfdetail-modal-shell.hidden { display: none; }
.wfdetail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  /* backdrop-filter removed — expensive GPU operation */
}
.wfdetail-modal {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--rule-full);
  box-shadow: 0 30px 60px -20px rgba(18, 20, 22, 0.45);
  width: min(860px, 100%);
  max-height: calc(100vh - 64px);
  overflow: auto;
  animation: bell-popover-in 260ms cubic-bezier(0.2, 0.7, 0.15, 1);
}
.wfdetail-modal::before,
.wfdetail-modal::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 14px no-repeat;
}
.wfdetail-modal::before { top: 6px; left: 6px; }
.wfdetail-modal::after {
  bottom: 6px;
  right: 6px;
  background:
    linear-gradient(var(--ink), var(--ink)) right bottom / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 14px no-repeat;
}

.wfdetail-loading {
  padding: 60px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.wfdetail-loading.wfdetail-err { color: var(--err); }

.wfdetail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 28px 18px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule-strong);
}
.wfdetail-title-block .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.wfdetail-title-block h2 {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 10px;
}
.wfdetail-desc {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
}

.wfdetail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-bottom: 1px solid var(--rule);
}
.wfdetail-meta-grid > div {
  padding: 10px 16px 12px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.wfdetail-meta-grid > div:last-child { border-right: 0; }
.wfdetail-meta-grid .label-mono {
  font-size: 9.5px;
  letter-spacing: 0.16em;
}
.wfdetail-meta-grid strong {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
}

.wfdetail-nodes {
  padding: 18px 28px 20px;
}
.wfdetail-nodes h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.wfdetail-node-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wfdetail-node {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.wfdetail-node:first-child { border-top: 0; padding-top: 0; }
.wfdetail-node-pos {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.wfdetail-node-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wfdetail-node-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wfdetail-node-head strong {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  word-break: break-all;
}
.wfdetail-node-desc {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.wfdetail-node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 2px;
}
.wfdetail-node-meta .label-mono {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
}
.wfdetail-node-meta strong { color: var(--ink); font-weight: 500; }

.wfdetail-node-instructions { margin-top: 4px; }
.wfdetail-node-instructions summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 0;
  list-style: none;
  outline: none;
}
.wfdetail-node-instructions summary::-webkit-details-marker { display: none; }
.wfdetail-node-instructions summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 120ms ease;
}
.wfdetail-node-instructions[open] summary::before { content: "▾ "; }
.wfdetail-node-instructions pre {
  margin-top: 6px;
  background: var(--vellum);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.wfdetail-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px 20px;
  border-top: 1px solid var(--rule-strong);
  background: var(--paper-3);
}

/* Recent runs strip in the workflow detail modal */
.wfdetail-runs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--rule);
}
.wfdetail-run {
  display: grid;
  grid-template-columns: auto 1fr auto 14px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--divider);
  cursor: pointer;
  background: var(--surface);
  transition: background 100ms ease;
}
.wfdetail-run:first-child { border-top: 0; }
.wfdetail-run:hover { background: var(--paper-3); }
.wfdetail-run:hover .wfdetail-run-arrow { color: var(--accent); transform: translateX(2px); }
.wfdetail-run-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.wfdetail-run-body strong {
  font-size: 11.5px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wfdetail-run-meta {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}
.wfdetail-run-time {
  font-size: 10.5px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.wfdetail-run-arrow {
  color: var(--ink-mute-2);
  transition: color 120ms ease, transform 120ms ease;
}
.wfdetail-foot .label-mono {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

/* ============================================================
   Run Detail modal — artifacts, node timeline, events
   ============================================================ */

.rundetail-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.rundetail-modal-shell.hidden { display: none; }
.rundetail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  /* backdrop-filter removed — expensive GPU operation on every paint */
}
.rundetail-modal {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--rule-full);
  box-shadow: 0 30px 60px -20px rgba(18, 20, 22, 0.45);
  width: min(960px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  animation: bell-popover-in 260ms cubic-bezier(0.2, 0.7, 0.15, 1);
}
.rundetail-modal::before,
.rundetail-modal::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 2;
}
.rundetail-modal::before {
  top: 6px; left: 6px;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 14px no-repeat;
}
.rundetail-modal::after {
  bottom: 6px; right: 6px;
  background:
    linear-gradient(var(--ink), var(--ink)) right bottom / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 14px no-repeat;
}

.rundetail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 28px 18px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule-strong);
  position: sticky;
  top: 0;
  z-index: 5;
}
.rundetail-head .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.rundetail-head h2 {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.rundetail-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 6px;
  letter-spacing: 0.02em;
  word-break: break-all;
}
.rundetail-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.rundetail-status { font-size: 10px; letter-spacing: 0.14em; }

.rundetail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border-bottom: 1px solid var(--rule);
}
.rundetail-meta-grid > div {
  padding: 10px 16px 12px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.rundetail-meta-grid > div:last-child { border-right: 0; }
.rundetail-meta-grid .label-mono {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.rundetail-meta-grid strong {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
}

.rundetail-section {
  padding: 18px 28px 20px;
  border-bottom: 1px solid var(--rule);
}
.rundetail-section:last-child { border-bottom: 0; }
.rundetail-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  gap: 12px;
}
.rundetail-section-head h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.rundetail-section-head .label-mono {
  font-size: 10px;
  color: var(--ink-mute-2);
  letter-spacing: 0.1em;
}

/* --- Files list (grouped by node / section) --- */

.files-group {
  border: 1px solid var(--rule);
  margin-bottom: 8px;
  background: var(--surface);
}
.files-group[open] { border-color: var(--rule-strong); }
.files-group summary {
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper-3);
  outline: none;
  border-bottom: 1px solid transparent;
}
.files-group[open] summary { border-bottom-color: var(--rule); }
.files-group summary::-webkit-details-marker { display: none; }
.files-group summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--ink-muted);
  transition: transform 120ms ease;
  font-family: var(--mono);
}
.files-group[open] summary::before { transform: rotate(90deg); color: var(--accent); }
.files-group-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.files-group-count {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink-mute-2);
  text-transform: uppercase;
}

.files-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.file-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid var(--divider);
  align-items: center;
}
.file-row:first-child { border-top: 0; }
.file-row:hover { background: var(--paper-3); }

.file-kind {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-3);
  border: 1px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}
.file-kind-json { color: var(--accent); border-color: var(--accent); background: var(--accent-tint); }
.file-kind-text { color: var(--ink); }
.file-kind-pdf  { color: var(--err); border-color: var(--err-border); background: var(--err-soft); }
.file-kind-image { color: var(--info); border-color: var(--info-border); background: var(--info-soft); }
.file-kind-archive { color: var(--warn); border-color: var(--warn-border); background: var(--warn-soft); }
.file-kind-spreadsheet { color: var(--ok); border-color: var(--ok-border); background: var(--ok-soft); }

.file-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.file-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.file-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.file-name:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }
.file-size {
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.file-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-mute-2);
  letter-spacing: 0.02em;
  min-width: 0;
}
.file-meta span:first-child {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-modified { flex: 0 0 auto; }

.file-download {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  border: 1px solid var(--rule-strong);
  background: var(--paper-2);
  transition: color 100ms ease, border-color 100ms ease, background 100ms ease;
  flex: 0 0 auto;
}
.file-download:hover {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* --- Node list (compact timeline inside the run modal) --- */

.rd-node-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-node {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.rd-node:first-child { border-top: 0; padding-top: 0; }
.rd-node-pos {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  padding-top: 2px;
}
.rd-node-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rd-node-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rd-node-head strong {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
}
.rd-node-head .label-mono {
  font-size: 9.5px;
  color: var(--ink-mute-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rd-node-desc {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.rd-node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.rd-node-meta .rd-fail { color: var(--err); }

/* --- Event list --- */

.rd-event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rd-event-row {
  display: grid;
  grid-template-columns: 160px 220px 1fr;
  gap: 14px;
  padding: 6px 0;
  border-top: 1px solid var(--divider);
  align-items: baseline;
  font-size: 11.5px;
}
.rd-event-row:first-child { border-top: 0; }
.rd-event-row:hover { background: var(--paper-3); }
.rd-event-focus {
  background: var(--accent-tint);
  box-shadow: inset 2px 0 0 var(--accent);
  padding-left: 8px;
  padding-right: 8px;
  animation: focus-pulse 1.8s ease-out 1;
}
@keyframes focus-pulse {
  0%   { background: var(--accent-soft); }
  100% { background: var(--accent-tint); }
}
.rd-event-time {
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.rd-event-type {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-event-summary {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.4;
}

/* Run detail: Human Decisions section — shown prominently, not buried as a file */
.rd-decisions-section {
  background: linear-gradient(180deg, var(--accent-tint), transparent);
}
.rd-decisions-section .rundetail-section-head h3 { color: var(--accent); }
.rd-decision-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rd-decision {
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  padding: 12px 14px 14px;
}
.rd-dec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--rule);
}
.rd-dec-node {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.rd-dec-node strong { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.rd-dec-who {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 10px;
}
.rd-dec-who strong { color: var(--ink); font-weight: 500; margin-right: 4px; }
.rd-dec-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rd-dec-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rd-dec-block .label-mono {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.rd-dec-string {
  display: inline-block;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  background: var(--accent-tint);
  padding: 4px 10px;
  border-left: 2px solid var(--accent);
  align-self: flex-start;
}
.rd-dec-notes {
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  padding: 6px 0 0;
}
.rd-dec-empty {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute-2);
  letter-spacing: 0.04em;
}
.rd-dec-kv {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rd-dec-kv-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 3px 0;
  border-top: 1px solid var(--divider);
}
.rd-dec-kv-row:first-child { border-top: 0; }
.rd-dec-kv-row dt {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rd-dec-kv-row dd {
  margin: 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-word;
}
.rd-dec-kv-row dd code {
  font-size: 11px;
  padding: 1px 5px;
}
.rd-dec-instructions { margin-top: 4px; }
.rd-dec-instructions summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 6px 0 4px;
  list-style: none;
  outline: none;
}
.rd-dec-instructions summary::-webkit-details-marker { display: none; }
.rd-dec-instructions summary::before {
  content: "▸ ";
  transition: transform 120ms ease;
}
.rd-dec-instructions[open] summary::before { content: "▾ "; }
.rd-dec-instructions[open] summary { color: var(--accent); }
.rd-dec-instructions pre {
  margin-top: 6px;
  background: var(--vellum);
  border: 1px solid var(--rule);
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Files toggle (show/hide system plumbing) */
.files-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
}
.files-toggle input {
  width: 12px;
  height: 12px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.files-toggle:hover { color: var(--accent); }

/* File category chip next to the filename */
.file-cat {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 1px 6px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink-muted);
  flex: 0 0 auto;
}
.file-cat-instructions { color: var(--ink); background: var(--paper-3); border-color: var(--rule-strong); }
.file-cat-decision     { color: var(--accent); background: var(--accent-tint); border-color: var(--accent-border, var(--accent)); }
.file-cat-output       { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-border); }
.file-cat-schema       { color: var(--info); background: var(--info-soft); border-color: var(--info-border); }
.file-cat-template     { color: var(--ink-mute-2); background: var(--paper-3); }
.file-cat-staging      { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }
.file-cat-system       { color: var(--ink-mute-2); background: var(--paper-3); }

/* Run detail: recovery actions footer */
.rundetail-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 28px 16px;
  border-top: 1px solid var(--rule-strong);
  background: var(--paper-3);
  position: sticky;
  bottom: 0;
  z-index: 3;
  flex-wrap: wrap;
}
.rundetail-actions-left {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rundetail-terminal {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute-2);
}
.action-button.danger {
  background: var(--paper);
  color: var(--err);
  border-color: var(--err-border);
}
.action-button.danger:hover {
  background: var(--err);
  color: var(--paper);
  border-color: var(--err);
}
.rundetail-action-status {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border: 1px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
  min-height: 24px;
}
.rundetail-action-status:empty { display: none; }
.rundetail-action-status.is-running { color: var(--info); border-color: var(--info-border); background: var(--info-soft); }
.rundetail-action-status.is-ok      { color: var(--ok);   border-color: var(--ok-border);   background: var(--ok-soft);   }
.rundetail-action-status.is-err     { color: var(--err);  border-color: var(--err-border);  background: var(--err-soft);  }

/* Skeleton shown while /api/run/<wf>/<run> is still fetching */
.rundetail-skeleton {
  padding: 18px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.rundetail-skeleton-head {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute-2);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 10px;
}
.rundetail-skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rundetail-skeleton-row {
  height: 40px;
  background: linear-gradient(90deg, var(--paper-3) 0%, var(--paper-2) 50%, var(--paper-3) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border: 1px solid var(--divider);
}
.rundetail-skeleton-row:nth-child(2) { width: 82%; }
.rundetail-skeleton-row:nth-child(3) { width: 68%; }
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rundetail-skeleton-row { animation: none; }
}

/* ============================================================
   Logs table
   ============================================================ */

.logs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
}
.logs-filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 520px;
  padding: 0 10px 0 30px;
  height: 30px;
  background: var(--vellum);
  border: 1px solid var(--rule-strong);
}
.logs-filter-wrap:focus-within { border-color: var(--accent); }
.logs-filter-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
}
.logs-filter-wrap input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
  min-width: 0;
}
.logs-filter-wrap input::placeholder { color: var(--ink-mute-2); }
.logs-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}
.logs-meta strong { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.logs-sep { color: var(--rule-full); }

.logs-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
}
.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 11.5px;
}
.logs-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper-3);
  padding: 8px 12px;
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
.logs-table tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
  color: var(--ink-soft);
}
.logs-table tbody tr:hover { background: var(--paper-3); cursor: pointer; }
.logs-table tbody tr[data-log-row]:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.logs-table tbody tr[data-log-row]:focus {
  outline: none;
  background: var(--accent-tint);
}
.logs-table tbody tr[data-log-row]:focus td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.logs-table tbody tr[data-event-kind="err"] { background: var(--err-soft); }
.logs-table tbody tr[data-event-kind="warn"] { background: var(--warn-soft); }
.logs-table td.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  white-space: nowrap;
}
.logs-table .log-summary {
  max-width: 640px;
  line-height: 1.4;
  color: var(--ink);
}
.logs-table .log-details {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  margin-top: 2px;
  word-break: break-all;
  letter-spacing: 0.02em;
}
.logs-empty {
  padding: 40px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute-2);
  text-align: center;
}
.event-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink-soft);
  white-space: nowrap;
}
.event-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  background: currentColor;
  opacity: 0.85;
}
.event-chip.ok   { color: var(--ok);  border-color: var(--ok);  background: var(--ok-soft); }
.event-chip.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.event-chip.err  { color: var(--err); border-color: var(--err); background: var(--err-soft); }
.event-chip.info { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ============================================================
   Priority / Focus Card
   ============================================================ */

.focus-strip { display: contents; }
.focus-card { display: none; }  /* Old focus card scaffold hidden; replaced by priority-card below */

.priority-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 20px;
  row-gap: 10px;
  align-items: center;
  padding: 16px 18px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  position: relative;
}
.priority-card::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  background: var(--accent);
}
.priority-card .priority-eyebrow {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  border-right: 1px solid var(--rule-strong);
  padding-right: 16px;
}
.priority-card .priority-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.priority-card .priority-title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 26;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.priority-card .priority-title em { font-style: normal; color: var(--ink); font-weight: 500; }
.priority-card .priority-detail {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-muted);
}
.priority-card .priority-progress {
  min-width: 220px;
  max-width: 260px;
}
.priority-card .priority-progress .pp-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.priority-card .priority-progress .pp-label strong {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.priority-card .priority-progress-track {
  height: 3px;
  background: var(--paper-4);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.priority-card .priority-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 240ms ease;
}

/* ============================================================
   Metrics Strip (brochure .metrics)
   ============================================================ */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--surface);
}
.metric-card {
  padding: 16px 16px 18px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  position: relative;
}
.metric-card:last-child { border-right: 0; }
.metric-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 14px; height: 1px;
  background: var(--accent);
}
.metric-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.metric-value {
  font-family: var(--mono);
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  margin-top: 4px;
}
.metric-note {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 4px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { border-right: 1px solid var(--rule); }
  .metric-card:nth-child(2n) { border-right: 0; }
  .metric-card:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ============================================================
   Queue Telemetry Strip (workspace-strip, manifest-style)
   ============================================================ */

.workspace-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--paper);
}
.workspace-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-right: 1px solid var(--rule);
  min-width: 0;
  position: relative;
}
.workspace-pill:last-child { border-right: 0; }
.workspace-pill-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.workspace-pill strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  letter-spacing: 0.02em;
}

/* ============================================================
   Hero-actions (toolbar) — rendered by app.js
   ============================================================ */

.page-head-copy, .page-head-actions, .page-head-controls { display: contents; }

#hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
}

.queue-telemetry-grid {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--rule);
  flex: 1 1 360px;
  min-width: 0;
}
.queue-telemetry-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  border-right: 1px solid var(--rule);
  flex: 1 1 0;
  min-width: 0;
}
.queue-telemetry-card:last-child { border-right: 0; }
.queue-telemetry-card span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.queue-telemetry-card strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.action-cluster {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.action-cluster-secondary { border-left: 1px solid var(--rule); padding-left: 10px; }

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 30px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 80ms ease, border-color 80ms ease, color 80ms ease;
}
.action-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.action-button:active { background: var(--accent-press); border-color: var(--accent-press); }
.action-button:disabled { opacity: 0.5; cursor: not-allowed; }

.action-button.secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule-strong);
}
.action-button.secondary:hover {
  background: var(--paper-3);
  color: var(--accent);
  border-color: var(--accent);
}

.action-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 6px 8px 6px 12px;
  max-width: 640px;
  word-break: break-word;
  align-self: center;
  border: 1px solid;
  animation: action-status-in 200ms cubic-bezier(0.2, 0.7, 0.15, 1);
}
@keyframes action-status-in {
  0%   { opacity: 0; transform: translate3d(0, -4px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
.action-status:empty { display: none; }
.action-status-text { flex: 1 1 auto; min-width: 0; }
.action-status-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 2px;
  cursor: pointer;
  flex: 0 0 auto;
  opacity: 0.55;
  transition: opacity 100ms ease, background 100ms ease;
}
.action-status-close:hover { opacity: 1; background: currentColor; color: var(--paper-2); }
.action-status.info    { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }
.action-status.success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.action-status.error   { background: var(--err-soft); color: var(--err); border-color: var(--err-border); }

/* ============================================================
   Kanban Board
   ============================================================ */

.board-section { display: flex; flex-direction: column; }
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--surface);
  min-height: 380px;
  /* Cap the kanban viewport so columns with many runs scroll internally
     instead of stretching the page. ~72% of viewport or 820px, whichever is smaller. */
  max-height: min(72vh, 820px);
}

/* Column body is the scrollable region inside each column */
.column { max-height: 100%; min-height: 0; }
.column-body {
  max-height: 100%;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-full) transparent;
}
.column-body::-webkit-scrollbar { width: 6px; }
.column-body::-webkit-scrollbar-track { background: transparent; }
.column-body::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border-radius: 3px;
}
.column-body::-webkit-scrollbar-thumb:hover { background: var(--rule-full); }

/* Load-more sentinel — terminal row in a scrolling column */
.column-loadmore {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 12px;
  margin-top: 2px;
  background: var(--paper-3);
  border: 1px dashed var(--rule-strong);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  flex-shrink: 0;
  user-select: none;
}
.column-loadmore:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.column-loadmore strong {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.column-loadmore:hover strong { color: var(--accent); }

.column-loadmore-spinner {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--rule-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: col-spin 900ms linear infinite;
  display: inline-block;
  flex: 0 0 auto;
}
.column-loadmore:hover .column-loadmore-spinner {
  border-color: var(--accent-soft);
  border-top-color: var(--accent);
}
@keyframes col-spin {
  to { transform: rotate(360deg); }
}

/* Loading state (brief, ~260ms) — spinner speeds up, text swaps, border solidifies */
.column-loadmore.is-loading {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
  cursor: progress;
  pointer-events: none;
}
.column-loadmore.is-loading .column-loadmore-spinner {
  animation-duration: 520ms;
  border-color: var(--accent-soft);
  border-top-color: var(--accent);
  border-width: 1.5px;
}
.column-loadmore.is-loading strong { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .column-loadmore-spinner { animation: none; }
}

.column {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--rule-strong);
  min-width: 0;
  background: var(--paper);
}
.column:last-child { border-right: 0; }

.column-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.column-header h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.column-header h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 0;       /* square LED */
  background: var(--ink-muted);
  box-shadow: 0 0 0 1px var(--paper), 0 0 0 2px var(--ink-muted);
}
.column-active .column-header h3::before,
.column-awaiting_human .column-header h3::before { animation: live-pulse 1.8s steps(1, end) infinite; }
.column-active   .column-header h3::before { box-shadow: 0 0 0 1px var(--paper), 0 0 0 2px var(--accent); }
.column-awaiting_human .column-header h3::before { box-shadow: 0 0 0 1px var(--paper), 0 0 0 2px var(--warn); }
.column-completed .column-header h3::before { box-shadow: 0 0 0 1px var(--paper), 0 0 0 2px var(--ok); }
.column-issues   .column-header h3::before { box-shadow: 0 0 0 1px var(--paper), 0 0 0 2px var(--err); }
.column-pending  .column-header h3::before { background: var(--violet); }
.column-active   .column-header h3::before { background: var(--accent); }
.column-awaiting_human .column-header h3::before { background: var(--warn); }
.column-completed .column-header h3::before { background: var(--ok); }
.column-issues   .column-header h3::before { background: var(--err); }

.column-subtle {
  grid-column: 1;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.column-count {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  font-variant-numeric: tabular-nums;
  align-self: center;
}
.column-pending  .column-count { border-color: var(--violet); color: var(--violet); }
.column-active   .column-count { border-color: var(--accent); color: var(--accent); }
.column-awaiting_human .column-count { border-color: var(--warn); color: var(--warn); }
.column-completed .column-count { border-color: var(--ok); color: var(--ok); }
.column-issues   .column-count { border-color: var(--err); color: var(--err); }

.column-body {
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.column-empty {
  position: relative;
  padding: 28px 12px 24px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute-2);
  text-align: center;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px dashed var(--rule-strong);
  background: var(--vellum);
  margin: 8px 2px;
}
.column-empty::before,
.column-empty::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
}
.column-empty::before {
  top: -1px; left: -1px;
  background:
    linear-gradient(var(--ink-muted), var(--ink-muted)) left top / 8px 1px no-repeat,
    linear-gradient(var(--ink-muted), var(--ink-muted)) left top / 1px 8px no-repeat;
  opacity: 0.6;
}
.column-empty::after {
  bottom: -1px; right: -1px;
  background:
    linear-gradient(var(--ink-muted), var(--ink-muted)) right bottom / 8px 1px no-repeat,
    linear-gradient(var(--ink-muted), var(--ink-muted)) right bottom / 1px 8px no-repeat;
  opacity: 0.6;
}

/* ---- Run cards ---- */

.run-card {
  position: relative;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease;
  flex-shrink: 0;    /* never let the parent flex container squish the card */
}
.run-card {
  overflow: hidden;
}
.run-card::after {
  /* subtle scan-line sweep on hover — memorable without being noisy */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0, rgba(45, 106, 79, 0.07) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.run-card:hover {
  background: var(--paper-2);
  border-color: var(--rule-full);
}
.run-card:hover::after { transform: translateX(100%); }
.run-card.selected {
  background: var(--accent-tint);
  border-color: var(--accent);
}
.run-card::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 2px;
  background: var(--ink-muted);
}
.column-pending  .run-card::before { background: var(--violet); }
.column-active   .run-card::before { background: var(--accent); }
.column-awaiting_human .run-card::before { background: var(--warn); }
.column-completed .run-card::before { background: var(--ok); }
.column-issues   .run-card::before { background: var(--err); }

.run-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.run-card-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}
.run-card-top h3 {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 20;
  word-break: break-word;
  letter-spacing: 0.01em;
}
.run-card-id {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  margin-top: 3px;
  word-break: break-all;
  letter-spacing: 0.02em;
}
.run-card-statuses {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex: 0 0 auto;
}

.run-card-description {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.progress-row strong { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.task-progress {
  height: 2px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.task-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 220ms ease;
}
.task-progress-bar.completed { background: var(--ok); }
.task-progress-bar.awaiting  { background: var(--warn); }
.task-progress-bar.failed    { background: var(--err); }

.run-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  border-top: 1px dashed var(--rule-strong);
  padding-top: 7px;
}
.run-card-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }

.flag-row { display: flex; gap: 5px; flex-wrap: wrap; }
.flag-row:empty { display: none; }

/* ---- Status / phase chips (brochure-tag) ---- */

.status-chip,
.phase-chip,
.flag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid;
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--rule-strong);
  white-space: nowrap;
  line-height: 1.4;
}
.status-chip::before,
.phase-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 0;        /* square LED-style indicator */
  background: currentColor;
  opacity: 0.95;
}
.status-chip.active,
.phase-chip.active,
.phase-chip.running,
.status-chip.running {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.status-chip.awaiting,
.phase-chip.awaiting_human {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: var(--warn);
}
.status-chip.completed,
.phase-chip.completed {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: var(--ok);
}
.status-chip.failed,
.phase-chip.failed {
  color: var(--err);
  background: var(--err-soft);
  border-color: var(--err);
}
.status-chip.pending,
.phase-chip.pending {
  color: var(--violet);
  background: var(--violet-soft);
  border-color: var(--violet);
}
.status-chip.info { color: var(--info); background: var(--info-soft); border-color: var(--info); }

.flag-pill {
  color: var(--ink-muted);
  border-color: var(--rule-strong);
}
.flag-pill.urgent { color: var(--warn); background: var(--warn-soft); border-color: var(--warn); }
.flag-pill.info   { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }

.run-card-ghost { pointer-events: none; }

/* ============================================================
   Detail Panel (Inspection) — manifest style
   ============================================================ */

.detail-section { display: flex; flex-direction: column; }
.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-card {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  overflow: hidden;
}
.detail-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.detail-card-head h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 20;
  letter-spacing: 0.01em;
}
.detail-card-head .run-card-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}
.detail-card-head > span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.detail-copy {
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* Summary grid (KV tiles) */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  background: var(--paper);
}
.summary-tile {
  padding: 10px 16px;
  border-right: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.summary-tile:nth-child(-n+6) { border-top: 0; }
.summary-tile span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.summary-tile strong {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  letter-spacing: 0.02em;
}

/* Timeline (manifest-style) */
.timeline-list { list-style: none; margin: 0; padding: 0; background: var(--paper); }
.timeline-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.timeline-row:first-child { border-top: 0; }
.timeline-row:hover { background: var(--vellum); }

.timeline-index {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.timeline-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.timeline-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.timeline-head strong {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
  letter-spacing: 0.02em;
}
.timeline-main > p {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Detail grid / subcards / preview */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  background: var(--paper);
}
.detail-subcard {
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  min-width: 0;
}
.detail-subcard:last-child { border-right: 0; }
.detail-subcard h4 { margin-bottom: 8px; color: var(--accent); }
.detail-subcard .detail-copy { padding: 0; font-size: 12px; }

.human-gate-card { border-color: var(--warn); }
.human-gate-card .detail-card-head { background: var(--warn-soft); border-bottom-color: var(--warn); }
.human-gate-card .detail-card-head h3 { color: var(--ink); }

.preview-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  margin: 8px 0;
  overflow: hidden;
}
.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}
.preview-head span:last-child {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 9.5px;
}
.preview-card pre { border: 0; border-left: 0; max-height: 220px; }

.context-group { padding: 10px 0; border-top: 1px solid var(--rule); }
.context-group:first-child { border-top: 0; padding-top: 0; }
.context-group header h4 { margin-bottom: 6px; }

.empty-block {
  padding: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute-2);
  text-align: center;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--vellum);
  border: 1px dashed var(--rule-strong);
  margin: 10px 16px;
}
.empty-detail { padding: 60px 20px; text-align: center; background: var(--paper); }

/* Events */
.event-list { list-style: none; margin: 0; padding: 0; background: var(--paper); }
.event-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
}
.event-row:first-child { border-top: 0; }
.event-row:hover { background: var(--vellum); }
.event-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.event-row strong {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 16;
  letter-spacing: 0.005em;
}
.event-row p {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.event-row > span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  white-space: nowrap;
  letter-spacing: 0.06em;
}

/* ============================================================
   Workflows Grid (brochure wfgrid)
   ============================================================ */

.workflows-footer { display: flex; flex-direction: column; }
.workflows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--paper);
}
.workflow-card {
  padding: 18px 20px 20px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.workflow-card:last-child { border-right: 0; }
.workflow-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.workflow-card-head .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.workflow-card-head h3 {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.12;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 22;
  letter-spacing: -0.008em;
  word-break: break-word;
}
.workflow-version {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--accent);
  padding: 3px 6px;
  border: 1px solid var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.workflow-copy {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.workflow-meta {
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--rule-strong);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.workflow-meta em {
  color: var(--accent);
  font-style: normal;
  letter-spacing: 0.16em;
  margin-right: 4px;
}

/* ============================================================
   App Footnote
   ============================================================ */

.app-footnote {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule-strong);
  background: transparent;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.dot-sep { color: var(--ink-mute-2); }

/* ============================================================
   Status Bar (bottom, mono manifest)
   ============================================================ */

.status-bar {
  position: sticky;
  bottom: 0;
  height: var(--statusbar-h);
  background: var(--paper-4);
  border-top: 1px solid var(--rule-strong);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink);
  z-index: 20;
  flex-shrink: 0;
  letter-spacing: 0.1em;
}
.status-bar .sb-cell { display: inline-flex; align-items: center; gap: 5px; }
.status-bar .sb-key {
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 9px;
}
.status-bar .sb-val {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.status-bar .sb-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
  margin-right: 5px;
}
.status-bar .sb-dot.ok   { background: var(--ok); }
.status-bar .sb-dot.warn { background: var(--warn); }
.status-bar .sb-dot.err  { background: var(--err); }
.status-bar .sb-push { margin-left: auto; }
.status-bar .sb-sep { color: var(--rule-full); }
.status-bar .sb-cell:last-child::after {
  content: "▊";
  color: var(--ink);
  margin-left: 4px;
  font-size: 10px;
  line-height: 1;
  animation: cursor-blink 1.1s steps(1, end) infinite;
}
@keyframes cursor-blink {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ============================================================
   Decision Modal
   ============================================================ */

.decision-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.decision-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}
.decision-modal {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--rule-full);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45);
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.decision-modal::before,
.decision-modal::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 14px no-repeat;
}
.decision-modal::before { top: 6px; left: 6px; }
.decision-modal::after {
  bottom: 6px;
  right: 6px;
  background:
    linear-gradient(var(--ink), var(--ink)) right bottom / 14px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 14px no-repeat;
}
.decision-modal > div { overflow-y: auto; padding: 0; }
.decision-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 22px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule-strong);
}
.decision-modal-head h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 26;
  margin: 6px 0 0;
  word-break: break-all;
  letter-spacing: -0.005em;
}
.decision-modal-copy {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 6px;
  max-width: 800px;
  line-height: 1.5;
}
.modal-close-button {
  padding: 4px 12px;
  height: 30px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.modal-close-button:hover { background: var(--paper-3); border-color: var(--ink); }

.decision-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  background: var(--rule-strong);
}
.modal-panel {
  padding: 16px 22px;
  background: var(--paper);
  min-width: 0;
  border-right: 1px solid var(--rule);
}
.modal-panel:last-child { border-right: 0; }
.modal-panel h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}
.modal-panel-emphasis { background: var(--accent-tint); }
.decision-modal-status {
  margin-top: 10px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  border: 1px solid;
}
.decision-modal-status.info    { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }
.decision-modal-status.success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.decision-modal-status.error   { background: var(--err-soft); color: var(--err); border-color: var(--err-border); }

.human-form { display: flex; flex-direction: column; gap: 10px; }
.human-form-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.human-select-input,
.human-text-input {
  padding: 8px 10px;
  border: 1px solid var(--rule-strong);
  background: var(--vellum);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  color: var(--ink);
}
.human-select-input:focus,
.human-text-input:focus {
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--accent-tint);
}
.human-notes-input {
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  background: var(--vellum);
  font-family: var(--sans);
  font-size: 12.5px;
  min-height: 90px;
  resize: vertical;
  outline: none;
  color: var(--ink);
  line-height: 1.5;
}
.human-notes-input:focus { border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 2px var(--accent-tint); }
.human-help {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.human-help code { font-size: 11px; }

.decision-editor {
  width: 100%;
  min-height: 240px;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  background: var(--vellum);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  outline: none;
}
.decision-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); background: var(--paper); }

.decision-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.decision-actions-left { justify-content: flex-start; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1400px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .column:nth-child(3n) { border-right: 0; }
  .column:nth-child(n+4) { border-top: 1px solid var(--rule-strong); }
}
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .column:nth-child(n) { border-right: 1px solid var(--rule); }
  .column:nth-child(2n) { border-right: 0; }
  .column:nth-child(n+3) { border-top: 1px solid var(--rule-strong); }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
  .sidebar { width: var(--sidebar-w-collapsed); }
  .sidebar .brand-text,
  .sidebar .nav-label,
  .sidebar .nav-item span,
  .sidebar .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 8px 0; }
  .sidebar-brand { justify-content: center; padding: 12px 0; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar-search { display: none; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .column { border-right: 0; border-bottom: 1px solid var(--rule-strong); }
  .column:last-child { border-bottom: 0; }
  .brand-meta { display: none; }
}
