/* ============================================================================
   BlockGenie Codex — Ops hub ("Night Desk")
   Same room as the console. This is the machine log, not another product.
   Art direction: docs/18-ui-redesign.md
   ========================================================================== */

:root {
  --ink: #0b0d11;
  --room: #10131a;
  --panel: #171b23;
  --panel-2: #1d222b;
  --edge: #262c37;
  --bone: #edeae4;

  --edge-soft: #1a1f28;
  --edge-strong: #333a46;
  --bone-dim: #a7aeb9;
  --faint: #848d9a;
  --glacier: #8fb9cf;
  --glacier-dim: #6d93a8;
  --glacier-sunk: #1b2b34;
  --ember: #d9705e;
  --ember-sunk: #2c1a18;
  /* semantic tokens (docs/52) — night values; shell.css owns the day values */
  --on-bone: #14171d; --bone-hi: #ffffff; --on-ember: #1a0f0d; --ember-hi: #e58472; --ember-soft: #f0b3a8;
  --code-fg: #d7dbe2; --wash: rgba(143, 185, 207, .052); --scrim: rgba(6, 8, 11, .62); --tap: rgba(143, 185, 207, .12);
  --slab-sheen: rgba(255, 255, 255, .035);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-display: clamp(2.5rem, 5.2vw, 3.75rem); /* docs/53: the one serif line reads as display */
  --t-title: 1.0625rem;
  --t-body: 1rem;
  --t-ui: 0.9375rem;
  --t-sm: 0.8125rem;
  --t-micro: 0.6875rem;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px; --s10: 72px;

  --r-sm: 3px; --r-md: 6px; --r-lg: 10px; --r-xl: 14px; --r-pill: 6px; /* docs/53: pills are gone; the alias means "a control" */

  --sh-1: 0 1px 2px rgba(0, 0, 0, .34);
  --sh-2: 0 2px 8px rgba(0, 0, 0, .3), 0 14px 34px -10px rgba(0, 0, 0, .5);
  --sh-3: 0 4px 14px rgba(0, 0, 0, .34), 0 26px 60px -16px rgba(0, 0, 0, .66);

  --measure: 46rem;
  --rail: 264px;
  --gutter: 30px;

  --e-out: cubic-bezier(.22, .68, .28, 1);
  --z-rail: 60; --z-boot: 90; --z-topbar: 25;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--room);
  color: var(--bone);
  font-family: var(--sans);
  font-size: var(--t-ui);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(115% 58% at 50% -14%, var(--wash), transparent 62%);
}

h1, h2, h3, p, ol, ul { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: var(--tap); }
a { color: var(--glacier); text-decoration-color: color-mix(in srgb, var(--glacier) 40%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--glacier); }

:focus-visible {
  outline: 2px solid var(--glacier);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: var(--s4); top: -60px; z-index: var(--z-boot);
  padding: var(--s2) var(--s4); border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--edge); color: var(--bone);
  text-decoration: none; transition: top 140ms var(--e-out);
}
.skip-link:focus { top: var(--s4); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 16px; height: 16px; flex: none; display: block; }

.tape {
  font-family: var(--mono);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--t-display);
  line-height: 1.02;
  letter-spacing: -.016em;
  text-wrap: balance;
  color: var(--bone);
}

.btn-solid, .btn-outline, .btn-quiet, .btn-danger {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4);
  border-radius: var(--r-md); border: 1px solid transparent;
  font-size: var(--t-ui); font-weight: 500; cursor: pointer;
  transition: background-color 140ms var(--e-out), border-color 140ms var(--e-out),
              color 140ms var(--e-out), transform 140ms var(--e-out);
}
.btn-solid { background: var(--bone); color: var(--on-bone); }
.btn-solid:hover { background: var(--bone-hi); }
.btn-solid:active { transform: translateY(1px); }
.btn-outline { background: transparent; border-color: var(--edge-strong); color: var(--bone); }
.btn-outline:hover { background: var(--panel-2); border-color: var(--faint); }
.btn-quiet { background: transparent; color: var(--bone-dim); }
.btn-quiet:hover { background: var(--panel-2); color: var(--bone); }
.btn-danger { background: var(--ember-sunk); color: var(--ember-soft); border-color: color-mix(in srgb, var(--ember) 35%, var(--edge)); }
.btn-danger:hover { background: var(--ember); color: var(--on-ember); }
.btn-solid:disabled, .btn-outline:disabled, .btn-quiet:disabled {
  opacity: .42; cursor: not-allowed; transform: none;
}

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 4px 0;
  font-size: var(--t-sm); color: var(--bone-dim); cursor: pointer;
  border-radius: 6px; text-decoration: none;
  transition: color 140ms var(--e-out);
}
.ghost-btn:hover { color: var(--bone); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--bone-dim); cursor: pointer;
  transition: background-color 140ms var(--e-out), color 140ms var(--e-out);
}
.icon-btn:hover { background: var(--panel-2); color: var(--bone); }

.error-text { margin-top: var(--s2); font-size: var(--t-sm); color: var(--ember); }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--faint); flex: none; display: inline-block;
}
.dot.is-on { background: var(--glacier); }
.dot.is-off { background: var(--ember); }

.boot {
  position: fixed; inset: 0; z-index: var(--z-boot);
  display: grid; place-content: center; justify-items: center; gap: var(--s4);
  background: var(--ink);
}
.boot-node {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--glacier);
  animation: pulse-node 1.5s linear infinite;
}
.boot-tape { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

@keyframes pulse-node {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}

.gate {
  position: fixed; inset: 0; z-index: 80;
  display: flex; overflow-y: auto;
  background: var(--ink);
  padding: var(--s8) var(--s5);
}
.gate-col {
  width: 100%; max-width: 31rem; margin: auto;
  animation: rise 320ms var(--e-out) both;
}
.gate-head { margin-bottom: var(--s7); }
.wordmark {
  display: flex; flex-direction: column; gap: 3px;
  font-size: var(--t-sm); font-weight: 600; letter-spacing: .01em; color: var(--bone);
}
.wordmark span {
  font-family: var(--mono); font-size: var(--t-micro); font-weight: 400;
  letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
}
.wordmark a {
  color: var(--faint);
  text-decoration-color: transparent;
  transition: color 140ms var(--e-out), text-decoration-color 140ms var(--e-out);
}
.wordmark a:hover { color: var(--glacier); text-decoration-color: currentColor; }
.gate-head .display { margin: var(--s6) 0 var(--s3); }
.gate-lede { font-size: var(--t-ui); color: var(--bone-dim); max-width: 52ch; }
.gate-form label {
  display: block; font-family: var(--mono); font-size: var(--t-micro);
  letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px;
}
.field-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.field-row input, .field-row select, .slab-left input, .slab-left select {
  flex: 1 1 12rem; min-width: 0; min-height: 40px;
  padding: 0 var(--s3);
  background: var(--ink); color: var(--bone);
  border: 1px solid var(--edge); border-radius: var(--r-md);
  transition: border-color 140ms var(--e-out);
}
.field-row input::placeholder, textarea::placeholder { color: var(--faint); }
.gate-foot { margin-top: var(--s5); font-size: var(--t-sm); color: var(--faint); }
.gate-foot em { color: var(--bone-dim); font-style: italic; }
.gate-foot code { font-family: var(--mono); color: var(--bone-dim); }

.app {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
  height: 100dvh;
}

.scrim {
  position: fixed; inset: 0; z-index: calc(var(--z-rail) - 1);
  background: var(--scrim);
}

.sidebar {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--ink);
  border-right: 1px solid var(--edge-soft);
  padding: var(--s4) var(--s3) var(--s3);
  animation: rise 280ms var(--e-out) both;
}
.side-top { display: flex; align-items: flex-start; justify-content: space-between; padding: var(--s1) var(--s2) var(--s5); }
.side-close { display: none; }

.nav { display: grid; gap: 2px; flex: 1; align-content: start; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 40px; padding: 0 var(--s3);
  border-radius: var(--r-sm); text-decoration: none; color: var(--bone-dim);
  font-size: var(--t-sm); font-weight: 500;
  transition: background-color 130ms var(--e-out), color 130ms var(--e-out);
}
.nav-item:hover { background: var(--panel); color: var(--bone); }
.nav-item.is-active { background: var(--panel-2); color: var(--bone); }
.nav-count { color: var(--faint); }

.side-foot {
  border-top: 1px solid var(--edge-soft); margin-top: var(--s2);
  padding: var(--s3) var(--s3) var(--s2);
  display: grid; gap: var(--s2); justify-items: start;
}
.who-name { font-size: var(--t-sm); font-weight: 500; }
.who-plan { display: flex; align-items: center; gap: 6px; margin-top: 2px; }

.stage {
  position: relative; min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  isolation: isolate;
}

.topbar {
  position: relative; z-index: var(--z-topbar); min-width: 0;
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s5);
  min-height: 56px;
  animation: rise 300ms 60ms var(--e-out) both;
}
.gate-topbar {
  position: fixed; inset: 0 0 auto;
  background: var(--ink);
}
.rail-toggle { display: none; }
.top-title { min-width: 0; flex: 1; }
.top-title h1 {
  font-size: var(--t-title); font-weight: 600; letter-spacing: -.005em;
}
.product-nav {
  display: flex; align-items: center; gap: 2px;
}
.product-nav a {
  display: inline-flex; align-items: center; min-height: 34px;
  padding: 0 var(--s3); border-radius: var(--r-sm);
  color: var(--bone-dim); text-decoration: none; font-size: var(--t-sm);
  transition: background-color 140ms var(--e-out), color 140ms var(--e-out);
}
.product-nav a:hover { background: var(--panel); color: var(--bone); }
.product-nav a[aria-current="page"] { background: var(--panel-2); color: var(--bone); }
.status-tape {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint);
}
.status-tape.is-live { color: var(--glacier); }
.status-tape.is-live .dot { background: var(--glacier); animation: pulse-node 1.5s linear infinite; }
.status-tape.is-bad { color: var(--ember); }
.status-tape.is-bad .dot { background: var(--ember); }

.banner {
  margin: 0 var(--s5) var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid color-mix(in srgb, var(--ember) 35%, var(--edge));
  border-radius: var(--r-md);
  background: var(--ember-sunk);
  color: var(--ember-soft);
  font-size: var(--t-sm);
}

.view {
  min-width: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: var(--s2) var(--s5) var(--s8);
  animation: rise 320ms 120ms var(--e-out) both;
}

.sec { max-width: 76rem; }

.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.chip {
  min-height: 32px; padding: 0 var(--s3);
  border-radius: var(--r-md); border: 1px solid var(--edge);
  background: transparent; color: var(--bone-dim); cursor: pointer;
  font-size: var(--t-sm);
  transition: background-color 140ms var(--e-out), color 140ms var(--e-out), border-color 140ms var(--e-out);
}
.chip:hover { color: var(--bone); border-color: var(--edge-strong); }
.chip.is-on { background: var(--panel-2); color: var(--bone); border-color: var(--edge-strong); }

.job-rail {
  position: relative;
  padding-left: var(--gutter);
}
.job-rail:not(:empty)::before {
  content: "";
  position: absolute; left: 9px; top: 8px; bottom: 8px;
  width: 1px; background: var(--edge-soft);
}

.job {
  position: relative;
  padding-bottom: var(--s4);
  animation: rise 200ms var(--e-out) both;
}
.job-node {
  position: absolute; left: calc(var(--gutter) * -1); top: 2px;
  width: 19px; height: 19px; border-radius: 50%;
  border: 1.5px solid var(--edge); background: var(--room);
  display: grid; place-items: center;
}
.job-node::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--edge-strong);
}
.job.is-live .job-node { border-color: var(--glacier); }
.job.is-live .job-node::after { background: var(--glacier); animation: pulse-node 1.5s linear infinite; }
.job.is-queued .job-node { border-color: var(--glacier-dim); }
.job.is-queued .job-node::after { background: var(--glacier-dim); }
.job.is-failed .job-node { border-color: var(--ember); }
.job.is-failed .job-node::after { background: var(--ember); }

.job-tape {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2);
  font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint);
  margin-bottom: 6px;
}
.job.is-live .job-tape { color: var(--glacier-dim); }
.job-prompt {
  font-size: var(--t-body); line-height: 1.55; color: var(--bone);
  max-width: var(--measure);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.job-meta {
  margin-top: 6px;
  font-size: var(--t-sm); color: var(--bone-dim);
}
.job-actions {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  margin-top: var(--s2);
}

.empty-block {
  display: grid; gap: var(--s3);
  padding: clamp(var(--s7), 8vh, var(--s10)) 0;
  max-width: 40rem;
}
.empty-block .display { font-family: var(--sans); font-weight: 600; font-size: var(--t-title); letter-spacing: -.005em; line-height: 1.3; }
.empty-lede { font-size: var(--t-ui); color: var(--bone-dim); max-width: 52ch; }

.split {
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
  gap: var(--s5);
  min-height: calc(100dvh - 8rem);
}
.split-kicker { margin-bottom: var(--s3); }
.proj-list { display: grid; gap: 2px; align-content: start; }
.proj {
  display: grid; gap: 2px;
  width: 100%; text-align: left;
  padding: var(--s3);
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--bone-dim); cursor: pointer;
  transition: background-color 130ms var(--e-out), color 130ms var(--e-out);
}
.proj:hover { background: var(--panel); color: var(--bone); }
.proj.is-active { background: var(--panel-2); color: var(--bone); }
.proj .ttl { font-size: var(--t-sm); font-weight: 500; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj .meta { font-size: var(--t-micro); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj .meta b {
  font-family: var(--mono); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--glacier-dim);
}

.files-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s3); margin-bottom: var(--s3);
}
.files-title { font-size: var(--t-title); font-weight: 600; }
.path-tape { text-transform: none; letter-spacing: 0; font-size: var(--t-sm); color: var(--bone-dim); word-break: break-all; margin-top: 2px; }
.upload-label { cursor: pointer; margin: 0; }
.files-body {
  display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1px;
  background: var(--edge-soft);
  border: 1px solid var(--edge-soft); border-radius: var(--r-md);
  overflow: hidden;
  min-height: 22rem;
}
.files-list { background: var(--ink); overflow-y: auto; max-height: 36rem; padding: var(--s2); }
.files-list button {
  display: flex; align-items: center; gap: var(--s2);
  width: 100%; text-align: left; min-height: 32px; padding: 0 var(--s2);
  border: 0; border-radius: 6px; background: transparent; color: var(--bone-dim);
  font-family: var(--mono); font-size: var(--t-sm); cursor: pointer;
}
.files-list button:hover { background: var(--panel); color: var(--bone); }
.files-list button.is-active { background: var(--panel-2); color: var(--bone); }
.files-list button .ic { color: var(--faint); }
.files-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-view { background: var(--room); overflow: auto; max-height: 36rem; padding: var(--s4); }
.files-view pre { margin: 0; font-family: var(--mono); font-size: var(--t-sm); line-height: 1.6; color: var(--code-fg); white-space: pre; }
.files-empty { font-size: var(--t-sm); color: var(--faint); }
.files-status { margin-top: var(--s3); }

.slab {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2), inset 0 1px 0 var(--slab-sheen);
  padding: var(--s5);
  margin-bottom: var(--s6);
}
.slab textarea {
  width: 100%; min-height: 56px; max-height: 160px; resize: vertical;
  background: transparent; border: 0; outline: none;
  font-size: var(--t-body); line-height: 1.5;
  margin: var(--s3) 0 var(--s4);
}
.slab-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.slab-left { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; flex: 1; }
.slab-left input, .slab-left select { flex: 0 1 auto; min-width: 10rem; }
.hint { margin-top: var(--s3); font-size: var(--t-sm); color: var(--faint); }

.seg {
  display: inline-flex; padding: 2px;
  background: var(--ink); border: 1px solid var(--edge); border-radius: var(--r-md);
}
.seg button {
  min-height: 32px; padding: 0 var(--s3);
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--bone-dim); cursor: pointer;
  font-size: var(--t-sm); font-weight: 500;
}
.seg button[aria-checked="true"] { background: var(--panel-2); color: var(--bone); }

.cron-list { display: grid; gap: var(--s2); }
.cron-row {
  display: grid; gap: var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--panel);
  border: 1px solid var(--edge-soft);
  border-radius: var(--r-md);
}
.cron-row .prompt { color: var(--bone); font-size: var(--t-ui); }
.cron-row .when { font-family: var(--mono); font-size: var(--t-sm); color: var(--bone-dim); text-transform: none; letter-spacing: 0; }
.cron-row .foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }

.facts {
  display: grid; gap: 1px;
  background: var(--edge-soft);
  border: 1px solid var(--edge-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--s7);
  max-width: 40rem;
}
.quota-tape { margin: 0 0 var(--s4); }
.fact {
  display: grid; grid-template-columns: 10rem minmax(0, 1fr);
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  background: var(--room);
}
.fact dt {
  font-family: var(--mono); font-size: var(--t-micro);
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  padding-top: 3px;
}
.fact dd { font-size: var(--t-ui); color: var(--bone); margin: 0; word-break: break-word; }
.fact dd .sub { display: block; margin-top: 2px; font-family: var(--mono); font-size: var(--t-sm); color: var(--bone-dim); text-transform: none; letter-spacing: 0; }

.box-login {
  max-width: 40rem;
  padding: var(--s5);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
}
.box-login h2 { font-size: var(--t-title); font-weight: 600; margin-bottom: 6px; }
.box-login-top { display: grid; gap: var(--s4); margin-bottom: var(--s3); }
.acct-line { font-size: var(--t-sm); color: var(--bone-dim); }

.device {
  margin-top: var(--s5); padding: var(--s5);
  background: var(--ink); border: 1px solid var(--edge); border-radius: var(--r-md);
}
.device-code-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin: var(--s3) 0 var(--s4); flex-wrap: wrap; }
.device-code {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(1.5rem, 6vw, 1.875rem); letter-spacing: .2em;
  color: var(--bone);
}
.device-url { display: flex; flex-direction: column; gap: 3px; font-size: var(--t-sm); word-break: break-all; }
.device-wait { margin-top: var(--s3); font-family: var(--mono); font-size: var(--t-sm); color: var(--glacier); }

.identity-sec { max-width: 58rem; }
.identity-note {
  max-width: 64ch; margin-bottom: var(--s5); color: var(--bone-dim);
}
.identity-note code, .secret-once { font-family: var(--mono); }
.identity-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--s3); align-items: end;
}
.identity-form label { display: grid; gap: 6px; color: var(--bone-dim); font-size: var(--t-sm); }
.identity-form input, .identity-form select, .identity-row select {
  min-width: 0; min-height: 40px; padding: 0 var(--s3);
  background: var(--ink); border: 1px solid var(--edge); border-radius: var(--r-md);
}
.secret-once {
  margin-bottom: var(--s5); padding: var(--s4); overflow-wrap: anywhere;
  color: var(--glacier); background: var(--glacier-sunk);
  border: 1px solid var(--glacier-dim); border-radius: var(--r-md);
}
.identity-list { display: grid; gap: var(--s2); }
.identity-row {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  padding: var(--s4); background: var(--panel); border: 1px solid var(--edge-soft);
  border-radius: var(--r-md);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  :root { --rail: 240px; }
  .status-tape { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .files-body { grid-template-columns: minmax(0, 1fr); }
  .files-list { max-height: 11rem; }
  .fact { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: var(--z-rail); inset: 0 auto 0 0;
    width: min(19rem, 86vw);
    transform: translateX(-101%);
    transition: transform 220ms var(--e-out);
    animation: none;
    border-right: 1px solid var(--edge);
    padding-top: max(var(--s4), env(safe-area-inset-top));
  }
  .sidebar.is-open { transform: none; }
  .side-close { display: inline-grid; }
  .rail-toggle { display: inline-grid; }
  .topbar {
    min-height: 52px; padding-top: max(var(--s2), env(safe-area-inset-top));
    flex-wrap: wrap;
  }
  .top-title .tape { display: none; }
  .product-nav { order: 3; width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
  .product-nav a { min-height: 40px; flex: 1 0 auto; justify-content: center; }
  .view { padding-left: var(--s4); padding-right: var(--s4); }
  .job-rail { padding-left: 0; }
  .job-rail::before { display: none; }
  .job-node { position: static; margin-bottom: var(--s2); }
  .slab-left input, .slab-left select { min-width: 0; width: 100%; }
  .icon-btn { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (forced-colors: active) {
  .slab, .nav-item.is-active, .job-node, .box-login, .cron-row { border: 1px solid CanvasText; }
  .job-rail::before, body::before { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Shell integration — Runs & Projects (docs/43 §5, docs/44 §2). Appended so it
   layers over the rules above without touching their cascade.
   ═══════════════════════════════════════════════════════════════════════════ */
.app { height: calc(100dvh - var(--bar-h)); }
.gate, .boot { top: var(--bar-h); }
.product-nav, .gate-topbar { display: none; }
.sidebar { padding-top: var(--s3); }
.side-kicker { padding-left: var(--s1); }
.who-plan { display: flex; align-items: center; gap: 6px; }

/* nav groups + the quiet "moved to settings" doors */
.nav-group { padding: var(--s4) var(--s2) var(--s1); color: var(--faint); }
.nav-group:first-child { padding-top: 0; }
.nav-item-quiet { color: var(--faint); }
.nav-item-quiet:hover { color: var(--bone-dim); }
.nav-item-quiet .ic { opacity: .7; }

/* the lane, present tense — first row of Runs */
.lane-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); align-items: start;
  padding: var(--s4) var(--s4); margin-bottom: var(--s4);
  border: 1px solid var(--edge-soft); border-radius: var(--r-md); background: var(--panel);
  position: relative; overflow: hidden;
}
.lane-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--edge); transition: background var(--d-hover) var(--e-out);
}
.lane-row.is-live::before { background: var(--glacier); }
.lane-copy { min-width: 0; }
.lane-text { color: var(--bone); margin: 0 0 4px; }
.lane-sub { font-size: var(--t-sm); color: var(--bone-dim); margin: 0; }

.lane-node {
  position: relative; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%;
  border: 1.5px solid var(--edge); background: transparent; flex: none;
}
.lane-node::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: currentColor; color: var(--faint); opacity: 0; transform: scale(.6);
  transition: opacity var(--d-hover) var(--e-out), transform var(--d-hover) var(--e-out);
}
.lane-node[data-state="queued"] { border-color: var(--bone-dim); }
.lane-node[data-state="queued"] { border-style: dotted; }
.lane-node[data-state="queued"]::after { color: var(--bone-dim); opacity: 1; transform: scale(.8); }
/* thinking = the ring breathes (opacity, 1.5s linear). A spinner would say "computer";
   the breath says "the lane is held" — same node, same table as every other surface. */
.lane-node[data-state="thinking"] { border-color: var(--glacier); animation: pulse-node 1.5s linear infinite; }
.lane-node[data-state="thinking"]::after { color: var(--glacier); opacity: 1; transform: scale(.9); }
.lane-node[data-state="failed"] { border-color: var(--ember); }
.lane-node[data-state="failed"]::after { color: var(--ember); opacity: 1; transform: scale(1); }

/* empties: a statement, one line, one door — never a poem */
.sh-empty .display { display: block; font-family: var(--sans); font-weight: 600; font-size: var(--t-title); letter-spacing: -.005em; margin-bottom: var(--s2); }
.sh-empty .empty-lede { display: block; max-width: 48ch; }
.sh-empty .empty-action { margin-top: var(--s4); display: inline-flex; align-items: center; gap: 6px; width: auto; text-decoration: none; }

/* the identity sections are stubs here; the real ones live under Settings */
.identity-sec { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .lane-node[data-state="thinking"] { animation-duration: 2s; } /* the wait must still read as a wait */
  .lane-node[data-state="queued"]::after { animation: none; opacity: 1; transform: scale(.8); }
}
.gate > .sh-signin { margin: auto; width: 100%; max-width: 31rem; align-self: center; animation: rise 320ms var(--e-out) both; }
