:root {
  --paper: #edf2f4;
  --ink: #17252d;
  --muted: #62737b;
  --line: #c5d1d6;
  --blue: #245d88;
  --blue-soft: #c9ddea;
  --green: #176b4d;
  --amber: #93631b;
  --red: #a23c3a;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: var(--blue); font-weight: 650; text-underline-offset: 3px; }
button, input { font: inherit; }
.shell { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 32px; }
.masthead { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.owner { color: var(--ink); text-decoration: none; }
.masthead-actions { display: flex; gap: 20px; align-items: baseline; color: var(--muted); font-size: .9rem; }
.masthead-actions form { margin: 0; }
.text-button { padding: 0; border: 0; color: var(--blue); background: transparent; cursor: pointer; }
.signal { display: grid; grid-template-columns: 62px 1fr; gap: 24px; padding: clamp(54px, 8vw, 92px) 0 58px; }
.runner-mark { display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid var(--blue); border-radius: 50%; }
.runner-mark span { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); }
.system-name { margin: 0 0 10px; color: var(--muted); }
h1 { margin: 0; font-size: clamp(3.2rem, 8vw, 6.8rem); font-weight: 540; letter-spacing: -.065em; line-height: .9; }
.summary { max-width: 680px; margin: 26px 0 0; color: var(--muted); font-size: 1.16rem; line-height: 1.55; }
.task, .waterfall, .queue, .activity-grid > section { padding: 27px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; }
.section-heading h2 { margin: 0; font-size: 1.03rem; font-weight: 700; }
.section-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.task-ticket { margin: 28px 0 4px; color: var(--blue); font-size: .92rem; font-weight: 700; }
.task-name { max-width: 780px; margin: 0; font-size: clamp(1.4rem, 3vw, 2.15rem); line-height: 1.2; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 28px 0 0; }
.facts div { min-width: 0; padding-right: 20px; }
.facts div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.facts dt { margin-bottom: 7px; color: var(--muted); font-size: .8rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); margin: 26px 0 0; padding: 0; list-style: none; counter-reset: stage; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stage { min-height: 94px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .79rem; line-height: 1.35; counter-increment: stage; }
.stage::before { display: block; margin-bottom: 13px; content: counter(stage, decimal-leading-zero); color: var(--muted); font-size: .7rem; }
.stage.done { color: var(--green); background: rgba(23, 107, 77, .06); }
.stage.current { color: var(--ink); background: var(--blue-soft); font-weight: 700; }
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; }
.activity-list, .queue-list { margin: 20px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.activity-list li, .queue-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.activity-title { margin: 0; font-weight: 650; }
.activity-detail { margin: 4px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.45; overflow-wrap: anywhere; }
.activity-time { color: var(--muted); font-size: .75rem; }
.run-button { width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.run-button:hover .activity-title { color: var(--blue); }
.queue-row { display: grid; grid-template-columns: 105px 1fr auto; gap: 16px; align-items: baseline; }
.queue-row a { text-decoration: none; }
.queue-status { color: var(--muted); font-size: .82rem; }
footer { padding-top: 22px; color: var(--muted); font-size: .8rem; }
dialog { width: min(760px, calc(100% - 32px)); max-height: min(86vh, 900px); padding: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(23, 37, 45, .62); }
.dialog-header { position: sticky; top: 0; display: flex; justify-content: space-between; gap: 20px; align-items: start; padding: 22px 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.dialog-header h2 { margin: 0; font-size: 1.55rem; }
.close-button { padding: 8px 0; border: 0; color: var(--blue); background: transparent; cursor: pointer; }
.dialog-body { padding: 4px 24px 28px; }
.handoff-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.handoff-section:last-child { border-bottom: 0; }
.handoff-section h3 { margin: 0 0 10px; font-size: .9rem; }
.handoff-section p { margin: 0; color: var(--muted); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.handoff-list { margin: 0; padding-left: 20px; color: var(--muted); }
.handoff-list li + li { margin-top: 8px; }
.finding { padding: 14px 0; border-top: 1px solid var(--line); }
.finding:first-child { border-top: 0; }
.finding-title { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 8px; font-weight: 700; }
.finding-severity { color: var(--muted); font-size: .76rem; font-weight: 500; }
body[data-state="parked"] .runner-mark { border-color: var(--red); }
body[data-state="parked"] .runner-mark span { background: var(--red); }
body[data-state="published"] .runner-mark { border-color: var(--green); }
body[data-state="published"] .runner-mark span { background: var(--green); }
.login-page { display: grid; place-items: center; padding: 28px; }
.login-shell { width: min(470px, 100%); }
.login-shell h1 { margin-top: 18px; font-size: clamp(3rem, 13vw, 5.8rem); }
.login-copy { margin: 26px 0; color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 10px; }
.login-form label { color: var(--muted); font-size: .82rem; }
.login-form input { width: 100%; padding: 14px 15px; border: 1px solid var(--line); border-radius: 0; background: white; color: var(--ink); }
.login-form button { margin-top: 5px; padding: 14px; border: 0; background: var(--ink); color: white; cursor: pointer; font-weight: 700; }
.login-error { color: var(--red); }
:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 3px; }

@media (max-width: 720px) {
  .shell { width: min(100% - 28px, 1040px); padding-top: 24px; }
  .signal { grid-template-columns: 40px 1fr; gap: 15px; }
  .runner-mark { width: 40px; height: 40px; }
  .runner-mark span { width: 12px; height: 12px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); }
  .facts div + div { padding-left: 12px; }
  .facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stages { grid-template-columns: repeat(3, 1fr); }
  .activity-grid { grid-template-columns: 1fr; gap: 0; }
  .queue-row { grid-template-columns: 90px 1fr; }
  .queue-status { grid-column: 2; }
  dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-right: 0; border-bottom: 0; border-left: 0; }
  .dialog-header, .dialog-body { padding-right: 18px; padding-left: 18px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
