/* Fly CISO — dark technical dashboard.
   Near-black ground, mint for signal and labels, amber for numbers the reader
   is meant to take seriously. Mono for anything that is data; sans for prose.
   One stylesheet, no framework. */

:root {
  --ink: #0a0b0d;
  --panel: #101216;
  --panel-lift: #15181e;
  --rule: #1d222a;
  --rule-bright: #2b323c;

  --text: #d7dce2;
  --muted: #7d8895;
  --dim: #525c68;

  --mint: #7fe3c0;
  --mint-deep: #2f6f5e;
  --amber: #f5a623;
  --amber-deep: #7a5410;
  --red: #e0574f;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Helvetica, sans-serif;

  --rail: 330px;
  --gap: 2.4rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 1.75rem; }

a { color: var(--mint); text-decoration: none; }
a:hover { color: #fff; }
p { margin: 0 0 0.9rem; max-width: 74ch; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; letter-spacing: -0.01em; }
h3 { font-size: 1rem; }

code, .mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 0.82rem; }
.num { font-variant-numeric: tabular-nums; }

/* Wide-tracked mono uppercase: the label voice used throughout. */
.label, .eyebrow, .masthead nav a, .statusbar, .stat-label, .meter-label,
.key, th, .cellday, figcaption, .legend {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
}
.label, .eyebrow { color: var(--muted); }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem; top: 1rem; z-index: 20;
  background: var(--panel); padding: 0.6rem 1rem; color: var(--mint);
}

/* ---------------------------------------------------------------- masthead */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead .wrap {
  display: flex; align-items: baseline; gap: 1.5rem;
  padding-block: 1.1rem; flex-wrap: wrap;
}
.brand {
  margin: 0; font-size: 1.35rem; font-weight: 800;
  letter-spacing: 0.04em; color: var(--mint);
}
.brand a { color: inherit; }
.brand span { color: var(--text); }
.tagline {
  margin: 0; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 0.68rem; color: var(--dim);
}
.masthead nav { margin-left: auto; display: flex; gap: 1.4rem; }
.masthead nav a { color: var(--muted); }
.masthead nav a:hover { color: var(--mint); }
.masthead nav a[aria-current="page"] { color: var(--mint); }

/* --------------------------------------------------------------- statusbar */
.statusbar { border-bottom: 1px solid var(--rule); background: #0c0e11; }
.statusbar-inner {
  display: flex; align-items: center; gap: 1.25rem;
  padding-block: 0.55rem; flex-wrap: wrap;
}
.statusbar p { margin: 0; }
.statusbar .sep { color: var(--rule-bright); }
.status-day strong { color: var(--text); font-weight: 700; }
.countdown { color: var(--muted); margin-left: auto; }
.countdown .clock { color: var(--mint); }
.newday a { color: var(--amber); }

.tag {
  padding: 0.1rem 0.45rem; border: 1px solid currentColor; border-radius: 2px;
}
.tag-live { color: var(--mint); }
.tag-paused { color: var(--amber); }
.tag-crisis { color: var(--red); }
.tag-end { color: var(--muted); }

/* -------------------------------------------------------------- page shell */
/* Two asides and the day between them in the source (the phone's reading
   order); on a wide screen both asides share the left column. The day spans
   both rows, so the connectome panel sits right under the CISO however long
   the day runs. */
.shell {
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "ciso main" "more main";
  gap: 1.5rem var(--gap); padding-block: 1.75rem 3rem;
}
.shell > main { grid-area: main; min-width: 0; overflow-wrap: break-word; }
.rail-ciso { grid-area: ciso; }
.rail-more { grid-area: more; align-self: start; }
.rail { display: flex; flex-direction: column; gap: 1.5rem; }

/* ------------------------------------------------------------ rail panels */
.panel { border: 1px solid var(--rule); background: var(--panel); }
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--rule);
}
.panel-head .label { color: var(--mint); }
.panel figure { margin: 0; }
.panel img { display: block; width: 100%; height: auto; background: var(--ink); }
.panel-foot {
  padding: 0.5rem 0.8rem; border-top: 1px solid var(--rule);
  color: var(--dim); font-family: var(--mono); font-size: 0.68rem;
}
.panel-body { padding: 0.8rem; }

/* The key to a day's activity animation. The swatch carries the identity;
   the text stays in ink so it reads the same for everyone. */
.pulse-key {
  list-style: none; margin: 0; padding: 0.55rem 0.8rem;
  display: grid; gap: 0.3rem; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 0.68rem; color: var(--dim);
}
.pulse-key li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.45rem; }
.pulse-key b { font-weight: 500; color: var(--text, #e6e8eb); }
.pulse-key .swatch {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  align-self: center;
}
.swatch-violet { background: #9085e9; }
.swatch-amber { background: #f59e0b; }
.swatch-mint { background: var(--mint); }

/* The per-day fly state, as a readout rather than a picture. */
.state-readout {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 0.8rem; border-top: 1px solid var(--rule);
}
.state-readout .label { white-space: nowrap; }
.state-readout .value { min-width: 0; }
.state-readout .value {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.8rem; color: var(--amber);
}
.state-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
  animation: blip 2.4s infinite ease-in-out;
}
@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ------------------------------------------------------------ stat blocks */
.stats {
  display: grid; gap: 1.25rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(8rem, auto));
  justify-content: start;
  padding-block: 1.25rem;
}
.stat-label { color: var(--muted); display: block; margin-bottom: 0.25rem; }
.stat-value {
  font-family: var(--mono); font-size: 1.85rem; font-weight: 700;
  line-height: 1; color: var(--amber); font-variant-numeric: tabular-nums;
}
.stat-value.is-text { font-size: 1.3rem; }
.stat-value .delta { font-size: 0.7rem; margin-left: 0.4rem; font-weight: 400; }
.delta.up { color: var(--mint); }
.delta.down { color: var(--red); }

.meters { border-top: 1px solid var(--rule); }
.meter-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  padding-block: 1.1rem;
}
.meter-label { color: var(--muted); display: block; margin-bottom: 0.3rem; }
.meter-value {
  font-family: var(--mono); font-size: 1.15rem; color: var(--text);
  font-variant-numeric: tabular-nums; margin-bottom: 0.35rem;
}
/* Every meter in a row shares three tracks — label, value, bar — so a label
   that wraps ("International Communications") lifts only its own label and
   the values and bars still line up across the row. */
@supports (grid-template-rows: subgrid) {
  .meter-grid > * {
    display: grid; grid-row: span 3; grid-template-rows: subgrid;
    row-gap: 0; align-content: start;
  }
  .meter-grid .meter-label { align-self: end; }
}
.bar { background: #171b21; height: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--mint-deep); }
.bar-mint > span { background: var(--mint); }
.bar-amber > span { background: var(--amber); }
.bar-danger > span { background: var(--red); }
.bar-lg { height: 6px; }

/* ------------------------------------------------------------- day content */
.eyebrow-row {
  display: flex; align-items: center; gap: 0.75rem;
  flex-wrap: wrap; margin-bottom: 0.6rem;
}
.crumbs { color: var(--dim); }
.crumbs b { color: var(--mint); font-weight: 400; }

.lede { font-size: 1.05rem; color: var(--muted); max-width: 68ch; }
h1 + .lede { margin-top: 0.6rem; }
.narration { margin-top: 1.25rem; }
.narration p { color: var(--text); }

.section { border-top: 1px solid var(--rule); margin-top: 2rem; padding-top: 1.25rem; }
.section > h2 { margin-bottom: 1rem; }
.section > h2 .label { margin-left: 0.6rem; color: var(--dim); }

.events { margin: 0.9rem 0 0.3rem; }
.events-label { margin: 0 0 0.35rem; }
.eventline {
  display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap;
  border-left: 2px solid var(--rule-bright); padding: 0.15rem 0 0.15rem 0.7rem;
  margin-bottom: 0.5rem;
}
.eventline strong { color: var(--text); }
.eventline.sev-4 { border-color: var(--amber); }
.eventline.sev-5 { border-color: var(--red); }

/* Decisions */
.decision { border-top: 1px solid var(--rule); padding-top: 1.1rem; margin-top: 1.1rem; }
.decision:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.decision h3 { margin-bottom: 0.3rem; font-size: 1.25rem; }
.decision-meta { display: flex; gap: 0.2rem 1.4rem; flex-wrap: wrap; align-items: baseline; margin-bottom: 0.7rem; }
/* A label and its value wrap together, never apart. */
.meta-pair { display: inline-flex; gap: 0.7rem; align-items: baseline; }
.verdict {
  display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.verdict-name {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.95rem; font-weight: 700;
}
.verdict-approve .verdict-name { color: var(--mint); }
.verdict-reject .verdict-name { color: var(--red); }
.verdict-defer .verdict-name,
.verdict-demand_more_info .verdict-name { color: var(--amber); }
.verdict-escalate_to_board .verdict-name { color: #c9a3ea; }
.conviction { color: var(--dim); font-family: var(--mono); font-size: 0.72rem; }

/* The trace: this is the data panel, so it is all mono. */
.trace { margin-top: 0.5rem; border: 1px solid var(--rule); background: #0c0e11; }
.trace summary {
  cursor: pointer; padding: 0.55rem 0.8rem; color: var(--mint);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.68rem;
}
.trace summary::marker { color: var(--rule-bright); }
.trace[open] summary { border-bottom: 1px solid var(--rule); }
.trace-body { padding: 0.8rem; }
.explain {
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
  border-left: 2px solid var(--mint-deep); padding-left: 0.7rem; margin-bottom: 1rem;
}
.trace h4 {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.66rem; color: var(--dim); margin: 1rem 0 0.4rem; font-weight: 400;
}
.channels { width: 100%; border-collapse: collapse; font-family: var(--mono); }
.channels th {
  text-align: left; color: var(--dim); font-weight: 400;
  border-bottom: 1px solid var(--rule); padding: 0.3rem 0.5rem 0.3rem 0;
}
.channels td {
  padding: 0.32rem 0.5rem 0.32rem 0; border-bottom: 1px solid #15181e;
  font-size: 0.76rem; vertical-align: middle;
}
.channels tr.dominant td { background: rgba(127, 227, 192, 0.05); }
.channels tr.dominant .chan-name { color: var(--mint); }
.chan-name { color: var(--text); }
.chan-feature { color: var(--dim); }
.neurons { color: var(--mint); font-size: 0.72rem; }
.channels .figure { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

.neuronlist {
  list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap;
  gap: 0.35rem 0.5rem; font-family: var(--mono); font-size: 0.74rem;
}
.neuronlist li {
  border: 1px solid var(--rule); padding: 0.2rem 0.45rem; color: var(--muted);
}
.neuronlist code { color: var(--mint); }

/* Reactions */
.reactions { list-style: none; padding: 0; margin: 0; }
.reaction {
  border-left: 2px solid var(--rule-bright); padding: 0.1rem 0 0.1rem 0.9rem;
  margin-bottom: 1.1rem;
}
.reaction-comply { border-color: var(--mint); }
.reaction-push_back { border-color: var(--red); }
.reaction-negotiate { border-color: var(--amber); }
.reaction-scheme { border-color: var(--dim); border-left-style: dashed; }
.quote { font-size: 1.05rem; color: var(--text); margin-bottom: 0.3rem; }
.attrib { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0; }
.attrib .who { color: var(--text); font-family: var(--mono); font-size: 0.72rem; }
.reaction-label {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.68rem; color: var(--muted);
}
.reaction-story { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.4rem; }
.followup { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0; }

/* Agenda */
.agenda { list-style: none; padding: 0; margin: 0; }
.agenda li {
  display: flex; gap: 0.8rem; align-items: baseline; flex-wrap: wrap;
  padding: 0.5rem 0; border-bottom: 1px solid var(--rule);
}
.agenda strong { color: var(--text); font-weight: 500; }
.agenda .agenda-story { color: var(--muted); font-size: 0.9rem; flex-basis: 100%; margin: 0.2rem 0 0; }
.agenda .outcome { color: var(--dim); font-size: 0.85rem; flex-basis: 100%; margin: 0; }
.agenda-declined strong { color: var(--dim); text-decoration: line-through; }

/* Day navigation */
.daynav {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 1.1rem;
  flex-wrap: wrap; font-family: var(--mono); font-size: 0.78rem;
}
.daystep { display: inline-block; padding-block: 0.7rem; }
.jump { display: flex; gap: 0.4rem; align-items: center; }
.jump input { width: 5rem; }

/* --------------------------------------------------------------- day list */
.daylist { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.daylist li { border-bottom: 1px solid var(--rule); }
.daylist a {
  display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1rem;
  padding: 0.7rem 0.2rem; align-items: baseline; color: var(--text);
}
.daylist a:hover { background: var(--panel); }
.daylist .n { font-family: var(--mono); font-size: 0.72rem; color: var(--mint); }
.daylist .ev { font-family: var(--mono); font-size: 0.68rem; color: var(--dim); }

/* --------------------------------------------------------------- calendar */
.legend { display: flex; gap: 0.35rem 1rem; flex-wrap: wrap; color: var(--muted); margin-bottom: 1rem; }
.key::before {
  content: ""; display: inline-block; width: 7px; height: 7px;
  margin-right: 0.4rem; background: var(--rule-bright);
}
.key-held::before { background: var(--mint); }
.key-declined::before { background: var(--dim); }
.key-rescheduled::before { background: #c9a3ea; }

.calendar { display: flex; flex-direction: column; gap: 0.4rem; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.4rem; }
.cell {
  position: relative;
  border: 1px solid var(--rule); background: var(--panel);
  padding: 0.45rem; min-height: 6.5rem; font-size: 0.74rem;
}
.cellday { display: block; margin-bottom: 0.3rem; color: var(--mint); }
/* The whole cell opens the day: the "Day n" label alone is a small target. */
.cellday::after { content: ""; position: absolute; inset: 0; }
.cell:hover { border-color: var(--rule-bright); }
.cellhead { margin: 0 0 0.3rem; color: var(--text); line-height: 1.35; }
.cellsev { margin: 0; font-family: var(--mono); font-size: 0.62rem; color: var(--dim); }
.cellsev.sev-4, .cellsev.sev-5 { color: var(--red); }
.cellitem {
  margin: 0.3rem 0 0; padding-left: 0.4rem; line-height: 1.3;
  border-left: 2px solid var(--amber); color: var(--muted); font-size: 0.68rem;
}
.cellitem-status {
  display: block; font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.1rem;
}
.cellitem.agenda-held .cellitem-status { color: var(--mint); }
.cellitem.agenda-held { border-color: var(--mint); }
.cellitem.agenda-declined { border-color: var(--dim); color: var(--dim); }
.cellitem.agenda-rescheduled { border-color: #c9a3ea; }

/* ------------------------------------------------------------------ about */
.facts { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.facts li { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.facts strong { color: var(--mint); font-size: 1.1rem; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: 0.9rem; max-width: 74ch; }
.steps strong { color: var(--mint); }
.disclaimer, .warning, .attribution {
  border: 1px solid var(--rule); background: var(--panel);
  padding: 0.9rem 1rem; margin-bottom: 1rem; max-width: 74ch;
}
.disclaimer { border-left: 2px solid var(--mint); }
.warning { border-left: 2px solid var(--amber); color: var(--text); }
.attribution { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

/* ------------------------------------------------------------------ forms */
input, button, select, textarea {
  font: inherit; background: #0c0e11; color: var(--text);
  border: 1px solid var(--rule-bright); padding: 0.45rem 0.6rem; border-radius: 2px;
}
input:focus, button:focus, select:focus, textarea:focus { outline: 1px solid var(--mint); outline-offset: 1px; }
button { cursor: pointer; }

.button {
  display: inline-block; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 0.7rem; padding: 0.6rem 1.1rem;
  border: 1px solid var(--mint); color: var(--mint); background: transparent;
}
.button:hover { background: var(--mint); color: var(--ink); }
.button-quiet { border-color: var(--rule-bright); color: var(--muted); }
.button-quiet:hover { background: var(--rule-bright); color: var(--text); }
.button-danger { border-color: var(--red); color: var(--red); }
.button-danger:hover { background: var(--red); color: var(--ink); }
.cta { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* ------------------------------------------------------ visitors' tasks */
.taskform { max-width: 40rem; margin-top: 1.5rem; }
.taskform label, .taskform .optional {
  display: block; margin: 1.1rem 0 0.3rem; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.66rem; color: var(--muted);
}
.taskform .optional { display: inline; margin: 0 0 0 0.4rem; color: var(--dim); }
.taskform input, .taskform textarea { width: 100%; }
.taskform textarea { resize: vertical; min-height: 6rem; line-height: 1.5; }
.taskform .button { margin-top: 1.3rem; }
.taskform .error { margin-bottom: 0.5rem; }
.field-help { margin: 0.3rem 0 0; font-size: 0.82rem; color: var(--dim); }
.taskform-rules { margin-top: 1rem; }
.task-sent p:last-child { margin-bottom: 0; }
.visitor-credit { color: var(--mint); }

.task-review { border: 1px solid var(--rule); background: var(--panel); padding: 0.9rem 1rem; margin-bottom: 1rem; }
.task-review.task-approved { border-left: 2px solid var(--mint); }
.task-head h3 { font-size: 1.1rem; margin: 0.2rem 0 0.5rem; }
.task-head .label { margin: 0; }
.task-details { white-space: pre-line; color: var(--muted); font-size: 0.9rem; }
.task-estimate { font-size: 0.88rem; margin-bottom: 0.8rem; }
.task-form { display: grid; gap: 0.8rem; }
.task-form .cta { margin-top: 0.2rem; }
.task-names { display: grid; gap: 0.8rem; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
@media (max-width: 40rem) { .task-names { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ admin */
.login { max-width: 23rem; }
.login label, .pauseform label {
  display: block; margin: 0.9rem 0 0.25rem; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.66rem;
  color: var(--muted);
}
.login input { width: 100%; }
.error, .notice {
  border: 1px solid var(--rule); padding: 0.7rem 0.9rem; margin-bottom: 1rem;
  font-size: 0.9rem;
}
.error { border-left: 2px solid var(--red); }
.notice { border-left: 2px solid var(--mint); }
.adminhead {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.5rem; margin: 0; }
.kv dt {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.66rem; color: var(--muted); padding-top: 0.15rem;
}
.kv dd { margin: 0; font-family: var(--mono); font-size: 0.82rem; }
/* The next-day editor */
.edit-status { border: 1px solid var(--rule); border-left-width: 2px; padding: 0.7rem 0.9rem; margin-top: 1rem; }
.edit-status p { margin: 0 0 0.6rem; font-size: 0.9rem; }
.edit-status p:last-child, .edit-status form { margin-bottom: 0; }
.edit-pending { border-left-color: var(--amber); }
.edit-applied { border-left-color: var(--mint); }
.edit-failed { border-left-color: var(--red); }
.scenario label {
  display: block; margin: 0 0 0.25rem; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.64rem; color: var(--muted);
}
.scenario label.check {
  display: inline-flex; align-items: center; gap: 0.45rem; margin: 0;
  text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 0.85rem; color: var(--text);
}
.scenario input.wide { width: 100%; }
.scenario input[type="number"], .scenario select { width: 100%; }
.table-scroll { overflow-x: auto; }
.scenario-events { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.scenario-events th {
  text-align: left; font-family: var(--mono); font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 0.64rem; color: var(--muted); padding: 0 0.8rem 0.4rem 0;
}
.scenario-events td { padding: 0.45rem 0.8rem 0.45rem 0; border-top: 1px solid var(--rule); vertical-align: middle; }
.scenario-events select { width: auto; }
.decision-edit {
  border: 1px solid var(--rule); margin: 0 0 1rem; padding: 0.4rem 1rem 1rem;
  display: grid; gap: 0.8rem; min-width: 0;
}
.decision-edit legend { padding: 0 0.4rem; font-weight: 500; display: flex; gap: 0.7rem; align-items: baseline; flex-wrap: wrap; }
.decision-new { border-style: dashed; }
.feature-grid { display: grid; gap: 0.8rem; grid-template-columns: minmax(10rem, 2fr) repeat(4, minmax(5rem, 1fr)); }
@media (max-width: 720px) { .feature-grid { grid-template-columns: 1fr 1fr; } .feature-grid > :first-child { grid-column: 1 / -1; } }
.decision-flags { display: flex; gap: 0.6rem 1.6rem; flex-wrap: wrap; }
.submitbar { display: grid; gap: 0.6rem; justify-items: start; margin-top: 0.5rem; }
.submitbar p { margin: 0; max-width: 68ch; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Transcripts */
.transcript-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap; font-family: var(--mono); font-size: 0.78rem; margin-bottom: 0.5rem;
}
.daypick { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.daypick select { max-width: 100%; min-width: 0; }
.transcript-decision h2 { text-wrap: balance; }
.turn { border-left: 2px solid var(--rule-bright); padding: 0.2rem 0 0.2rem 0.9rem; margin: 0 0 1rem; }
.turn-who { margin: 0 0 0.35rem; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: baseline; }
.turn-matter { border-left-color: var(--dim); }
.turn-fly { border-left-color: #9085e9; }
.turn-fly p { margin: 0.15rem 0; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0; }
.chips span:not(.tag) {
  font-family: var(--mono); font-size: 0.72rem; border: 1px solid var(--rule);
  padding: 0.1rem 0.45rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.exchange-accepted { border-left-color: var(--mint); }
.exchange-rejected { border-left-color: var(--amber); }
.exchange-failed { border-left-color: var(--red); }
.status { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }
.status-accepted { color: var(--mint); }
.status-rejected { color: var(--amber); }
.status-failed { color: var(--red); }
.exchange details { margin: 0.2rem 0 0.5rem; }
.exchange summary, .turn summary {
  cursor: pointer; font-size: 0.82rem; color: var(--muted); padding: 0.15rem 0;
}
.exchange summary:hover, .turn summary:hover { color: var(--text); }
.turn h4 {
  margin: 0.7rem 0 0.3rem; font-family: var(--mono); font-weight: 400; font-size: 0.64rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.turn pre {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 26rem; overflow: auto;
  background: #0c0e11; border: 1px solid var(--rule); padding: 0.7rem 0.8rem;
  font-family: var(--mono); font-size: 0.76rem; line-height: 1.55; color: var(--text);
}
.turn pre.reply-text { font-family: var(--sans); font-size: 0.9rem; }
.reply { margin: 0.3rem 0 0.4rem; padding: 0; }
.reply .quote { margin-bottom: 0.25rem; }

.spendlist, .userlist { list-style: none; padding: 0; font-family: var(--mono); font-size: 0.8rem; }
.spendlist li, .userlist li { padding: 0.25rem 0; border-bottom: 1px solid var(--rule); }
.spendbars { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: 0.72rem; }
.spendbars li {
  display: grid; grid-template-columns: 4.5rem 1fr 5rem; gap: 0.6rem;
  align-items: center; padding: 0.16rem 0;
}
.spendbar { background: #171b21; height: 5px; }
.spendbar > span { display: block; height: 100%; background: var(--amber); }
.spendval { text-align: right; }
.log { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.72rem; }
.log th { text-align: left; color: var(--dim); font-weight: 400; border-bottom: 1px solid var(--rule); padding: 0.3rem 0.5rem; }
.log td { padding: 0.3rem 0.5rem; border-bottom: 1px solid #15181e; color: var(--muted); }
.log tr.bad td:first-child { border-left: 2px solid var(--red); }
.log tr.ok td:first-child { border-left: 2px solid var(--mint-deep); }

/* ----------------------------------------------------------------- footer */
footer { border-top: 1px solid var(--rule); }
footer .wrap {
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding-block: 1.1rem 2rem; font-family: var(--mono); font-size: 0.68rem;
  color: var(--dim);
}
footer p { margin: 0; max-width: 60ch; }
/* Inline, so the padding widens what a finger can hit without moving the line. */
.footlink { padding-block: 0.8rem; }

/* ------------------------------------------------ the §14 state sprite rig */
/* The rail's hero is a rendered loop, but the day's fly_state still has to be
   visible, so it drives this small indicator. */
.sprite { width: 34px; height: 26px; flex: none; }
.sprite svg { width: 100%; height: 100%; overflow: visible; }
.sprite .body { fill: var(--amber); }
.sprite .wing { fill: none; stroke: var(--mint); stroke-width: 1.4; opacity: 0.85; }
.sprite-idle .wing { animation: flick 2.4s infinite ease-in-out; }
.sprite-at_computer .wing { animation: flick 0.6s infinite ease-in-out; }
.sprite-in_meeting .wing, .sprite-one_on_one .wing { animation: flick 1.2s infinite ease-in-out; }
.sprite-war_room .wing { animation: flick 0.18s infinite linear; }
.sprite-stressed .wing { animation: flick 0.32s infinite linear; }
.sprite-celebrating .wing { animation: flick 0.14s infinite linear; }
.sprite-sleeping .wing { opacity: 0.3; animation: none; }
.sprite-war_room .body, .sprite-stressed .body { fill: var(--red); }
.sprite-celebrating .body { fill: var(--mint); }
.sprite-sleeping .body { fill: var(--dim); }
@keyframes flick {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.45); }
}

@media (prefers-reduced-motion: reduce) {
  .sprite *, .state-dot { animation: none !important; }
}

/* ---------------------------------------------------------------- narrow */
/* One column: the CISO as a short card (picture beside its status), then the
   day, then the connectome and the company. */
@media (max-width: 60rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
    grid-template-areas: "ciso" "main" "more"; row-gap: 2rem;
    padding-block: 1.25rem 2.5rem;
  }
  .rail-more { flex-direction: row; flex-wrap: wrap; }
  .rail-more > .panel { flex: 1 1 18rem; }
  .ciso-panel { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); }
  .ciso-panel .panel-head { grid-column: 1 / -1; }
  .ciso-panel figure { align-self: stretch; background: var(--ink); }
  .ciso-status {
    display: flex; flex-direction: column; justify-content: center;
    border-left: 1px solid var(--rule); min-width: 0;
  }
  .ciso-status .state-readout { border-top: 0; flex-wrap: wrap; row-gap: 0.35rem; }
  .ciso-status .state-readout .value { order: 3; flex-basis: 100%; }
  .ciso-status .sprite { order: 2; margin-left: auto; }
  .week { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 40rem) {
  .wrap { padding-inline: 1rem; }

  /* Masthead: the name, then the sections on a row of their own. */
  .masthead .wrap { align-items: center; gap: 0 1rem; padding-block: 0.35rem 0; }
  .tagline { display: none; }
  .masthead nav { margin-left: 0; width: 100%; gap: 0 1.1rem; flex-wrap: wrap; }
  .statusbar-inner { gap: 0.4rem 0.9rem; }

  .ciso-panel { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); }
  .ciso-panel figure img { height: 100%; object-fit: cover; }
  .ciso-status .state-readout { padding: 0.6rem 0.7rem; }

  h1 { font-size: 1.85rem; }
  .decision h3 { font-size: 1.15rem; }
  .lede { font-size: 1rem; }

  .week { grid-template-columns: repeat(2, 1fr); }
  .legend > :first-child { flex-basis: 100%; }
  .daylist a { grid-template-columns: 1fr; gap: 0.2rem; }
  .stats { gap: 1rem 1.5rem; }
  .cta .button { flex: 1 1 auto; text-align: center; }

  /* Day navigation: previous and next either side, the day picker under them. */
  .daynav, .transcript-nav { display: grid; grid-template-columns: 1fr 1fr; row-gap: 0.4rem; }
  .daystep-prev { grid-column: 1; grid-row: 1; justify-self: start; }
  .daystep-next { grid-column: 2; grid-row: 1; justify-self: end; }
  .jump, .daypick { grid-column: 1 / -1; grid-row: 2; justify-content: center; flex-wrap: wrap; }

  footer .wrap { gap: 0.6rem; }
}

/* Anything tapped with a finger, on a phone or a touch tablet: targets about
   44px tall, and text fields at 16px so a phone does not zoom the page when
   one is focused. */
@media (max-width: 40rem), (pointer: coarse) {
  .brand a { display: inline-block; padding-block: 0.45rem; }
  .masthead nav a { display: flex; align-items: center; min-height: 2.75rem; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, button {
    min-height: 2.75rem;
  }
  input, select, textarea { font-size: max(16px, 1em); }
  .button { padding-block: 0.85rem; }
  .trace summary { padding-block: 0.85rem; }
  .exchange summary, .turn summary { padding-block: 0.7rem; }
  .scenario label.check { min-height: 2.75rem; }
  .scenario input[type="checkbox"] { width: 1.15rem; height: 1.15rem; }
  .morelink { display: inline-block; padding-block: 0.7rem; }
  .daylist a { padding-block: 0.8rem; }
}

/* Headings that stand alone rather than inside a .section wrapper (the About
   and admin pages) still need their own breathing room. */
.section-h { margin-top: 1.9rem; margin-bottom: 0.5rem; }
.about-diagram { margin: 1.4rem 0 0.6rem; }
.about-diagram img {
  display: block; width: 100%; height: auto; max-width: 100%;
  border: 1px solid var(--rule); background: var(--ink);
}
.about-diagram figcaption {
  margin-top: 0.55rem; max-width: 70ch; font-family: var(--sans); font-size: 0.88rem;
  text-transform: none; letter-spacing: normal; line-height: 1.55; color: var(--muted);
}
.admin-h { margin-top: 1.6rem; margin-bottom: 0.8rem; }
.section-h:first-of-type { margin-top: 1.4rem; }
