:root {
  --blue: #1f4e79;
  --blue2: #2e6ca4;
  --navy: #12324e;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e2e6ea;
  --bg: #f6f8fa;
  --card: #fff;
  --ok: #1e7a3b;
  --wait: #b45309;
  --teal: #0f766e;
  --amber: #d4a017;
  --idle: #c5d0db;
  --bad: #b42318;
  --banner: linear-gradient(90deg, #10263d, #152536 55%, #163042);
  --control-zoom: 1;
  --rail: #fff;
  --shadow: 0 10px 30px rgba(16, 38, 61, .08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 22px;
  min-height: 64px;
  background: var(--banner);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  min-width: 0;
}
button.logo-chip {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.logo-chip {
  height: 36px;
  background: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
}
.brand .logo { display: block; height: 28px; width: auto; }
.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  white-space: nowrap;
}
.logo-version {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 40;
  background: #fff;
  color: #1c2430;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(16, 40, 64, .18);
}
.logo-version[hidden] { display: none; }
.chrome {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px 12px;
}
.look {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #9db4cc;
  white-space: nowrap;
}
.look select {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  color: #fff;
  background-color: rgba(255, 255, 255, .08);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23ffffff' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 10px 6px;
  border: 1px solid #4d7394;
  border-radius: 6px;
  padding: 4px 22px 4px 8px;
}
.page-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}
.zoom-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.zoom-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.zoom-btn:disabled { opacity: .35; cursor: default; }
#pageZoomPct {
  color: #fff;
  min-width: 2.8rem;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.desk {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  height: calc((100vh - 64px) / var(--control-zoom, 1));
  min-height: 0;
  padding: 16px;
  box-sizing: border-box;
  zoom: var(--control-zoom, 1);
}
.rail {
  min-height: 0;
  background: var(--rail);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: auto;
  padding: 8px 6px 16px;
}
.work {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.home-picture { display: none; }
.work.home {
  overflow: hidden;
  padding: 0;
  background: #0f1720;
  border-color: #2c3f55;
}
.work.home .data-bar,
.work.home .persona,
.work.home .body { display: none; }
.work.home .home-picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #0f1720;
}
.seed-form {
  flex-wrap: wrap;
  align-items: flex-end;
  row-gap: 8px;
}
.seed-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin: 0;
  padding: 4px 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  background: transparent;
}
.seed-group legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
.seed-group label { margin: 0; }
.seed-product {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 5.5rem;
}
.seed-product input[type="number"] {
  width: 4.5rem;
  min-width: 4.5rem;
}
.seed-fixture {
  display: block;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}
.seed-summary .seed-fixture {
  margin: 2px 0;
  white-space: normal;
}
.seed-fixture-inline {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.seed-form > .eoy-status {
  align-self: center;
  flex: 1 1 14rem;
  min-width: 10rem;
}
.seed-busy {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 220px;
  padding: 24px 18px;
}
.seed-look {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 28rem;
}
.seed-look svg {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}
.seed-look circle { fill: none; stroke-width: 6; }
.seed-look-track { stroke: var(--line); }
.seed-look-ring {
  stroke: #2e6ca4;
  stroke-linecap: round;
  stroke-dasharray: 50 50;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 36px 36px;
  animation: seed-spin 1s linear infinite;
}
@keyframes seed-spin {
  to { transform: rotate(270deg); }
}
.seed-look strong {
  display: block;
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.seed-look span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}
.seed-look p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
}
.seed-board {
  padding: 16px 18px 20px;
  overflow: auto;
  height: 100%;
}
.seed-board h3 {
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 700;
}
.seed-summary p { margin: 0 0 6px; font-size: 13px; line-height: 1.45; }
.seed-checks {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.seed-checks li {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
}
.seed-checks li.ok { border-color: #1e7a3b55; }
.seed-checks li.bad { border-color: #b4231855; color: var(--bad); }
.seed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}
.seed-table th,
.seed-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.seed-table th { color: var(--muted); font-weight: 600; }
.seed-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.seed-table tr.seed-empty td { color: var(--muted); }
.seed-status.seed-good,
#seedStatus.seed-good { color: var(--ok); }
.seed-status.seed-bad,
#seedStatus.seed-bad { color: var(--bad); }
.work.seed .stage-tools,
.work.seed .scrub,
.work.seed .timing,
.work.seed .key-hint { display: none !important; }
.work.seed .stage-head { align-items: flex-start; }
.run-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.run-status {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 160px;
}
.controls { display: flex; gap: 8px; }
.pace-ctl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.pace-ctl input {
  width: 56px;
  font: inherit;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.pace-ctl span { color: var(--muted); font-weight: 500; }

.persona:empty { display: none; }

.mode-tab {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}
.rail-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail-panels {
  margin: 0 6px 8px 14px;
  padding-left: 8px;
  border-left: 2px solid var(--line);
}
.rail-panels[hidden] { display: none; }
.rail-panels.steps-hidden .hops { display: none; }
.rail-panels.detail-hidden .app-pane,
.rail-panels.detail-hidden .rail-apps { display: none; }
.rail-panels.results-hidden .results-pane { display: none; }
/* EoD / EoY — Engine Trace is the result view; no Detail pane. */
.rail-panels.night-trace #menuDetail,
.rail-panels.night-trace .app-pane,
.rail-panels.night-trace .rail-apps { display: none !important; }
.results-pane {
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.5rem 0.55rem;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  max-height: min(70vh, 520px);
  overflow: auto;
}
.results-pane h3 {
  margin: 0.55rem 0 0.2rem;
  font-size: 12px;
  font-weight: 700;
}
.results-pane h3:first-child { margin-top: 0.15rem; }
.results-pane .muted { color: var(--muted); }
.results-pane .batch-line {
  font-size: 14px;
  font-weight: 800;
  margin: 0.15rem 0 0.4rem;
}
.results-pane .results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.15rem 0 0.35rem;
}
.results-pane .results-head .batch-line { margin: 0; flex: 1 1 auto; }
.results-pane .results-head .file-full,
.results-pane .results-calc-head .file-full {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 3px 8px;
}
.results-pane .results-calc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.results-pane .calc-sheet {
  margin: 0.25rem 0 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line, #d5dde6);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.results-pane .calc-sheet p { margin: 0.12rem 0; }
.results-pane .calc-math {
  margin: 0.45rem 0 0;
  padding: 0.4rem 0.45rem;
  white-space: pre-wrap;
  font: inherit;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
}
html[data-theme="night"] .results-pane .calc-math { background: rgba(255, 255, 255, 0.06); }
.sub-item, .rail-app {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}
.sub-item:hover, .rail-app:hover { background: #f4f7fa; }
.sub-item.on, .rail-app.on { background: #e4eef6; color: #1f4e79; }
html[data-theme="night"] .sub-item:hover,
html[data-theme="night"] .rail-app:hover { background: rgba(255, 255, 255, .06); }
html[data-theme="night"] .sub-item.on,
html[data-theme="night"] .rail-app.on { background: rgba(31, 78, 121, .55); color: #fff; }
.mode-tab:hover { background: #f4f7fa; }
.mode-tab.on {
  background: #1f4e79;
  color: #fff;
}
.menu-stack {
  display: flex;
  flex-direction: column;
}
.menu-stack:not(:has(.data-bar:not([hidden]))) { display: none; }
.data-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 16px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.data-bar[hidden] { display: none; }
.fold-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}
.fold-bar strong {
  font-size: 12px;
  color: var(--blue);
}
.fold-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  color: var(--amber, #d4a017);
  border: 1px solid var(--amber, #d4a017);
  border-radius: 6px;
  cursor: pointer;
}
.fold-toggle:hover { background: rgba(212, 160, 23, 0.12); }
.fold-toggle svg { display: block; }
.fold-body { min-width: 0; }
.fold-body[hidden] { display: none; }
.data-bar .btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.run-bar { background: #f4f7fb; }
.data-form[hidden] { display: none; }
.data-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
}
.data-form label { font-size: 11px; font-weight: 600; color: var(--muted); }
.data-form input, .data-form select {
  display: block;
  margin-top: 3px;
  font: inherit;
  padding: 6px 8px;
  border: 1px solid #c8ced4;
  border-radius: 6px;
  min-width: 88px;
}
.data-form input[type="text"] { min-width: 140px; }
.data-form select { max-width: 22rem; }
.run-bar .data-form select { max-width: 28rem; min-width: 16rem; }
.data-form label.check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
}
.data-form fieldset.roll-components {
  border: 1px solid var(--line, #d0d7de);
  border-radius: 6px;
  padding: 8px 10px 10px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: end;
  width: 100%;
}
.data-form fieldset.roll-components:disabled {
  opacity: 0.55;
}
.data-form fieldset.roll-components legend {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
}
.data-form .roll-components-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 11px;
  font-weight: 400;
}
.data-form fieldset.roll-components label {
  min-width: 7.5rem;
}
.data-form fieldset.roll-components input {
  width: 6.5rem;
}
.data-form label.check input {
  display: inline;
  min-width: 0;
  margin: 0;
}
.data-form .btn {
  background: var(--blue2);
  color: #fff;
  border: 0;
}
.data-form .btn.secondary {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--blue2);
}

.ctr-roster-panel {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  max-height: 14rem;
  overflow: auto;
}
.ctr-roster-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
}
.ctr-roster-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 12px;
  line-height: 1.45;
}
.ctr-roster-list li.in-file {
  font-weight: 600;
  color: var(--blue);
}
.ctr-roster-list li.in-file.err {
  color: #b45309;
}
.ctr-roster-list .member-num {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  margin-right: 6px;
}

.mot-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(18, 50, 78, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.mot-modal-overlay[hidden] { display: none; }
.mot-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  max-width: 42rem;
  width: 100%;
  max-height: min(90vh, 640px);
  display: flex;
  flex-direction: column;
}
.mot-modal.engine-trace-modal {
  width: min(calc(100vw - 2rem), 72rem);
  max-width: min(calc(100vw - 2rem), 72rem);
  max-height: min(94vh, 920px);
  min-height: min(70vh, 640px);
}
.mot-modal.results-proof-modal {
  width: min(calc(100vw - 2rem), 28rem);
  max-width: min(calc(100vw - 2rem), 28rem);
  max-height: min(90vh, 28rem);
}
.results-proof-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.25rem;
}
.results-proof-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line, #d8dee6);
  border-radius: 8px;
  background: var(--card, #fff);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.results-proof-item:hover:not(:disabled) {
  border-color: var(--blue2, #2e6ca4);
  background: #f3f7fb;
}
.results-proof-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.results-proof-item.results-proof-registry {
  border-color: #2a9d8f;
  box-shadow: inset 0 0 0 1px rgba(42, 157, 143, 0.25);
}
.results-proof-item.results-proof-registry:hover:not(:disabled) {
  border-color: #2a9d8f;
  background: #f0faf8;
}
.results-proof-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line, #e2e6ea);
  padding: 4px;
}
.results-proof-icon-eng {
  width: 56px;
  height: 36px;
  padding: 2px;
  object-fit: cover;
  object-position: left center;
}
.results-proof-icon-reg {
  width: 48px;
  height: 30px;
  padding: 2px;
}
.results-proof-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.results-proof-copy strong {
  font-size: 1rem;
}
.results-proof-copy span {
  color: var(--muted, #6b7280);
  font-size: 0.875rem;
}
.btn-registry {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
  border-color: #2a9d8f !important;
}
.btn-registry img {
  display: block;
  width: 36px;
  height: 22px;
  object-fit: contain;
  border-radius: 3px;
  background: #fff;
}
html[data-theme="night"] .results-proof-item {
  background: #15202b;
  border-color: #2a3848;
}
html[data-theme="night"] .results-proof-item:hover:not(:disabled) {
  background: #1a2a3a;
  border-color: #2e6ca4;
}
html[data-theme="night"] .results-proof-item.results-proof-registry {
  border-color: #2a9d8f;
}
html[data-theme="night"] .results-proof-icon {
  background: #0f1720;
  border-color: #2a3848;
}
.engine-trace-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 28rem;
  border: 0;
  border-top: 1px solid var(--line, #d8dee6);
  background: var(--panel2, #f4f6f8);
}
.mot-modal.contrib-detail-modal {
  width: min(calc(100vw - 2rem), 56rem);
  max-width: min(calc(100vw - 2rem), 56rem);
  max-height: min(94vh, 900px);
  min-height: 0;
}
.mot-modal.mrr-registration-modal {
  width: min(calc(100vw - 2rem), 76rem);
  max-width: min(calc(100vw - 2rem), 76rem);
  max-height: min(94vh, 920px);
  min-height: 0;
}
.mot-modal.ctr-contribution-modal {
  width: min(calc(100vw - 2rem), 62rem);
  max-width: min(calc(100vw - 2rem), 62rem);
}
.contrib-detail-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.member-capture-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 1rem 0.65rem;
  flex-shrink: 0;
}
.member-capture-search.searchbox {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  flex: 1 1 12rem;
  max-width: 22rem;
  min-width: 11rem;
  background: var(--bg, #fff);
  color: var(--muted);
}
.member-capture-search.searchbox input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 13.5px;
  font-family: inherit;
  background: transparent;
  color: var(--ink, #0f1720);
  min-width: 0;
}
.searchbox-icon {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.member-capture-search-meta {
  font-size: 12px;
  min-width: 4.5rem;
}
.contrib-detail-grid tr.member-capture-filtered {
  display: none;
}
.mrr-registration-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 1rem 0.5rem;
  flex-shrink: 0;
}
.mrr-toolbar-hint {
  font-size: 12px;
  line-height: 1.35;
}
.contrib-detail-modal .contrib-detail-grid-wrap {
  flex: 1 1 auto;
  min-height: 14rem;
  max-height: min(58vh, 560px);
  margin-bottom: 0.65rem;
  overflow: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.contrib-detail-grid-wrap.mrr-registration-grid {
  max-height: min(60vh, 580px);
}
.contrib-detail-grid-wrap.ctr-contribution-grid {
  max-height: min(58vh, 540px);
}
.contrib-detail-grid.mrr-registration-table {
  width: max-content;
  min-width: 100%;
  font-size: 12px;
}
.contrib-detail-grid.mrr-registration-table th,
.contrib-detail-grid.mrr-registration-table td {
  white-space: nowrap;
  vertical-align: middle;
  padding: 0.4rem 0.5rem;
}
.contrib-detail-grid.ctr-contribution-table {
  font-size: 13px;
  min-width: 100%;
}
.contrib-detail-grid.ctr-contribution-table th,
.contrib-detail-grid.ctr-contribution-table td {
  padding: 0.4rem 0.55rem;
  vertical-align: middle;
}
.contrib-detail-grid.ctr-contribution-table td:nth-child(3) {
  min-width: 9rem;
  max-width: 14rem;
  white-space: normal;
}
.contrib-detail-grid.ctr-contribution-table .ctr-sticky-col {
  position: sticky;
  z-index: 3;
  background: #f4f7fa;
}
.contrib-detail-grid.ctr-contribution-table .ctr-sticky-1 {
  left: 0;
  min-width: 5.25rem;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.06);
}
.contrib-detail-grid.ctr-contribution-table .ctr-sticky-2 {
  left: 5.25rem;
  min-width: 5.5rem;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.08);
}
.contrib-detail-grid.ctr-contribution-table .ctr-sticky-3 {
  left: 10.75rem;
  min-width: 8.5rem;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.1);
}
.contrib-detail-grid.ctr-contribution-table tbody td:nth-child(1),
.contrib-detail-grid.ctr-contribution-table tbody td:nth-child(2),
.contrib-detail-grid.ctr-contribution-table tbody td:nth-child(3) {
  position: sticky;
  z-index: 1;
  background: #fff;
}
.contrib-detail-grid.ctr-contribution-table tbody td:nth-child(1) {
  left: 0;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.06);
}
.contrib-detail-grid.ctr-contribution-table tbody td:nth-child(2) {
  left: 5.25rem;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.08);
}
.contrib-detail-grid.ctr-contribution-table tbody td:nth-child(3) {
  left: 10.75rem;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.1);
}
html[data-theme="night"] .contrib-detail-grid.ctr-contribution-table .ctr-sticky-col {
  background: #243040;
}
html[data-theme="night"] .contrib-detail-grid.ctr-contribution-table tbody td:nth-child(1),
html[data-theme="night"] .contrib-detail-grid.ctr-contribution-table tbody td:nth-child(2),
html[data-theme="night"] .contrib-detail-grid.ctr-contribution-table tbody td:nth-child(3) {
  background: #1a2430;
}
.contrib-detail-grid.mrr-registration-table .mrr-grid-group-row th {
  top: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #eef2f6;
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0.45rem;
}
.contrib-detail-grid.mrr-registration-table thead tr:nth-child(2) th {
  top: 1.65rem;
}
.contrib-detail-grid.mrr-registration-table .mrr-sticky-col {
  position: sticky;
  z-index: 3;
  background: #f4f7fa;
}
.contrib-detail-grid.mrr-registration-table .mrr-sticky-1 {
  left: 0;
  min-width: 4.75rem;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.06);
}
.contrib-detail-grid.mrr-registration-table .mrr-sticky-2 {
  left: 4.75rem;
  min-width: 4.25rem;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.08);
}
.contrib-detail-grid.mrr-registration-table tbody td:nth-child(1),
.contrib-detail-grid.mrr-registration-table tbody td:nth-child(2) {
  position: sticky;
  z-index: 1;
  background: #fff;
}
.contrib-detail-grid.mrr-registration-table tbody td:nth-child(1) {
  left: 0;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.06);
}
.contrib-detail-grid.mrr-registration-table tbody td:nth-child(2) {
  left: 4.75rem;
  box-shadow: 2px 0 0 rgba(18, 50, 78, 0.08);
}
.contrib-detail-grid.mrr-registration-table .mrr-check-cell {
  text-align: center;
}
.contrib-detail-grid.mrr-registration-table .mrr-check-cell .check {
  justify-content: center;
}
html[data-theme="night"] .contrib-detail-grid.mrr-registration-table .mrr-grid-group-row th {
  background: #1e2834;
}
html[data-theme="night"] .contrib-detail-grid.mrr-registration-table .mrr-sticky-col {
  background: #243040;
}
html[data-theme="night"] .contrib-detail-grid.mrr-registration-table tbody td:nth-child(1),
html[data-theme="night"] .contrib-detail-grid.mrr-registration-table tbody td:nth-child(2) {
  background: #1a2430;
}
.mot-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--navy, #12324e);
  color: #fff;
  border-radius: 8px 8px 0 0;
}
.mot-modal-head-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.mot-modal-journey-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  color: var(--navy, #12324e);
}
.mot-modal-journey-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mot-modal-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.contrib-detail-toolbar {
  margin: 0 1rem 0.5rem;
}
.contrib-detail-toolbar .btn.secondary {
  font-size: 12px;
}
.contrib-detail-grid .mrr-remove-cell {
  white-space: nowrap;
  vertical-align: middle;
}
.contrib-detail-grid .mrr-remove {
  font-size: 11px;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  background: #fff;
  color: var(--navy, #12324e);
  border: 1px solid var(--navy, #12324e);
}
.contrib-detail-grid .mrr-remove:hover {
  background: #eef5fb;
  color: #0f2438;
  border-color: #0f2438;
}
html[data-theme="night"] .contrib-detail-grid .mrr-remove {
  background: #fff;
  color: var(--navy, #12324e);
  border-color: var(--navy, #12324e);
}
html[data-theme="night"] .contrib-detail-grid .mrr-remove:hover {
  background: #e8eef4;
  color: #0f2438;
}
.mot-modal-head .panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  color: var(--navy, #12324e);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
}
.mot-modal-head .panel-toggle:hover {
  background: #e8eef4;
  color: #0f2438;
}
html[data-theme="night"] .mot-modal-head .panel-toggle {
  background: #fff;
  color: var(--navy, #12324e);
  border-color: #fff;
}
html[data-theme="night"] .mot-modal-head .panel-toggle:hover {
  background: #dce6f0;
  color: #0f2438;
}
.contrib-detail-counts {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}
.contrib-detail-grid th.num,
.contrib-detail-grid td.num {
  white-space: nowrap;
}
.contrib-detail-grid input.ctr-amt {
  width: 6.25rem;
  text-align: right;
}
.contrib-detail-grid td.line-total {
  font-weight: 600;
  color: var(--text-muted, #4a5568);
}
.contrib-detail-lead {
  margin: 0.65rem 1rem 0.35rem;
  font-size: 13px;
}
.contrib-detail-modal .contrib-detail-lead,
.contrib-detail-modal .contrib-detail-counts {
  margin-left: 1rem;
  margin-right: 1rem;
}
.contrib-detail-grid-wrap {
  flex: 1;
  overflow: auto;
  margin: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.contrib-detail-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.contrib-detail-grid th,
.contrib-detail-grid td {
  padding: 0.35rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.contrib-detail-grid th {
  position: sticky;
  top: 0;
  background: #f4f7fa;
  font-weight: 600;
  color: var(--muted);
}
.contrib-detail-grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.contrib-detail-grid input[type="text"] {
  width: 5.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.contrib-detail-modal .contrib-detail-grid input[type="text"],
.contrib-detail-modal .contrib-detail-grid input[type="email"],
.contrib-detail-modal .contrib-detail-grid select,
.contrib-detail-modal .contrib-detail-foot input,
.contrib-detail-modal .contrib-detail-foot select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg, #fff);
  padding: 0 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink, #0f1720);
  box-sizing: border-box;
}
.contrib-detail-modal .contrib-detail-grid input:focus,
.contrib-detail-modal .contrib-detail-grid select:focus,
.contrib-detail-modal .contrib-detail-foot input:focus,
.contrib-detail-modal .contrib-detail-foot select:focus {
  border-color: var(--teal, #2a9d8f);
  outline: none;
}
.contrib-detail-foot {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1.25rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  background: #f8fafc;
}
html[data-theme="night"] .contrib-detail-foot {
  background: #151d28;
}
.contrib-detail-filename {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.contrib-detail-filename input {
  font-size: 13px;
  max-width: 24rem;
}
.contrib-detail-foot label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.contrib-detail-foot input {
  font-size: 13px;
  min-width: 7rem;
}
.ctr-setup-summary {
  flex: 1 1 100%;
  font-size: 12px;
  margin-top: 0.15rem;
}
.contrib-type-totals-wrap {
  flex: 1 1 100%;
  font-size: 12px;
}
.contrib-type-totals {
  width: 100%;
  max-width: 22rem;
  border-collapse: collapse;
  margin-top: 0.35rem;
}
.contrib-type-totals th,
.contrib-type-totals td {
  padding: 0.25rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.contrib-type-totals td.num,
.contrib-type-totals th.num { text-align: right; font-variant-numeric: tabular-nums; }
.contrib-type-totals tfoot th { font-weight: 600; }
.contrib-detail-grid tr.out-of-fund td,
.contrib-detail-grid tr.out-of-file td { opacity: 0.45; }
.contrib-detail-grid tr.out-of-fund input.ctr-amt,
.contrib-detail-grid tr.out-of-file input { pointer-events: none; }
.contrib-detail-grid.mrr-registration-table input[type="text"],
.contrib-detail-grid.mrr-registration-table input[type="email"] {
  text-align: left;
  font-variant-numeric: normal;
}
.contrib-detail-grid.mrr-registration-table input.mrr-given,
.contrib-detail-grid.mrr-registration-table input.mrr-family {
  width: 6.5rem;
}
.contrib-detail-grid.mrr-registration-table input.mrr-other-given {
  width: 6rem;
}
.contrib-detail-grid.mrr-registration-table input.mrr-start,
.contrib-detail-grid.mrr-registration-table input.mrr-dob {
  width: 7.25rem;
}
.contrib-detail-grid.mrr-registration-table input.mrr-postcode,
.contrib-detail-grid.mrr-registration-table input.mrr-country,
.contrib-detail-grid.mrr-registration-table input.mrr-payroll {
  width: 5rem;
}
.contrib-detail-grid.mrr-registration-table input.mrr-address {
  width: 8rem;
}
.contrib-detail-grid.mrr-registration-table input.mrr-locality {
  width: 6.25rem;
}
.contrib-detail-grid.mrr-registration-table input.mrr-email {
  width: 8.5rem;
}
.contrib-detail-grid.mrr-registration-table input.mrr-mobile {
  width: 6.5rem;
}
.contrib-detail-grid.mrr-registration-table select.mrr-sex {
  width: 7.5rem;
  max-width: 7.5rem;
}
.contrib-detail-grid.mrr-registration-table select.mrr-state,
.contrib-detail-grid.mrr-registration-table select.mrr-title {
  width: 4.25rem;
}
.contrib-detail-check {
  flex: 1 1 100%;
  font-size: 11px;
}
.contrib-detail-check.warn { color: #b45309; font-weight: 600; }
.contrib-detail-check.ok { color: #2a9d8f; }
.contrib-detail-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}
.contrib-detail-foot .btn.secondary {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--blue2);
}
.contrib-detail-foot .btn.secondary:hover {
  background: #eef5fb;
  color: var(--blue);
}
html[data-theme="night"] .mot-modal { background: #1a2430; }
html[data-theme="night"] .contrib-detail-grid th { background: #243040; }
html[data-theme="night"] .contrib-detail-foot input[readonly] { background: #243040; }

.scrub[hidden] { display: none; }
.scrub input[type="range"] { flex: 1; accent-color: var(--teal); }
.scrub-ticks { display: flex; gap: 3px; flex-wrap: wrap; }
.tick {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 3px;
  background: #d5dde6;
  cursor: pointer;
  padding: 0;
}
.tick.on { background: var(--teal); }
.tick.err { background: #e8a8a3; }
.tick.err.on { background: var(--bad); }

/* Board timing strip retired — Time taken is a fold in Results (+ large window). */
.stage > .timing { display: none !important; }
.timing-panel {
  margin: 0.65rem 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  overflow: hidden;
}
.timing-panel-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
}
.timing-panel-sum::-webkit-details-marker { display: none; }
.timing-panel-label { flex: 1 1 auto; min-width: 0; }
.timing-panel-sum .file-full { flex: 0 0 auto; }
/* Bars live in the body — only paint when the fold is open (or Large window). */
.timing-panel:not([open]) .timing-panel-body { display: none; }
.timing-panel[open] .timing-panel-body { display: block; padding: 0 0.55rem 0.65rem; }
.timing-note { margin: 0 0 0.45rem; font-size: 11px; }
.timing-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.timing-col { min-width: 0; }
.timing-cols .col-h {
  display: block;
  font-size: 12px;
  margin: 0 0 6px;
  color: var(--ink);
}
.trow { margin: 0 0 8px; }
.trow-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 3px;
}
.trow-lab { color: var(--ink); }
.trow-ms { color: var(--muted); font-variant-numeric: tabular-nums; }
.tbar {
  height: 10px;
  background: #e8edf2;
  border-radius: 99px;
  overflow: hidden;
  width: 100%;
}
.tbar > i {
  display: block;
  height: 100%;
  min-width: 0;
  background: var(--blue2);
  border-radius: 99px;
}
.tbar.msg > i { background: var(--teal); }
html[data-theme="night"] .timing-panel { background: #1a2a3c; }
html[data-theme="night"] .tbar { background: #243447; }
.file-screen-html .timing-panel-full {
  padding: 8px 12px 24px;
  max-width: 960px;
  margin: 0 auto;
}
.file-screen-html .timing-panel-full .timing-full-title {
  margin: 0 0 12px;
  font-size: 22px;
  color: var(--blue);
}
.file-screen-html .timing-panel-full .timing-cols {
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.file-screen-html .timing-panel-full .tbar { height: 14px; }
.file-screen-html .timing-panel-full .trow-lab { font-size: 13px; }
.file-screen-html .timing-panel-full .col-h { font-size: 15px; }
.recs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rec {
  font: inherit;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.rec.err { border-color: #e8a8a3; color: var(--bad); }
.rec.on { border-color: var(--blue2); background: #eef5fb; }

button.btn {
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  border: 0;
  background: var(--blue2);
  color: #fff;
  cursor: pointer;
}
button.btn:hover { background: var(--blue); }
/* Secondary buttons sit on white pages (26 October 2026, Rory: they looked inactive): blue text on white. */
button.btn.secondary {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--blue2);
}
button.btn.secondary:hover { background: #eef5fb; color: var(--blue); }
html[data-theme="night"] button.btn.secondary { background: transparent; color: var(--blue); border-color: var(--blue2); }
html[data-theme="night"] button.btn.secondary:hover { background: rgba(126, 176, 214, 0.14); }
button.btn:disabled { opacity: 0.55; cursor: default; }

.persona {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding: 8px 20px;
  background: #eef3f8;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.persona span { color: var(--muted); }
.persona strong { color: var(--blue); font-weight: 700; }

.body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.hops {
  background: transparent;
  overflow: visible;
  padding: 4px 4px 8px;
}
.hops h3 {
  margin: 0 8px 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue2);
}
.hops .muted { font-size: 12px; color: var(--muted); padding: 8px; line-height: 1.4; }
.hop {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 28px 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  margin-bottom: 2px;
  position: relative;
}
.hop .mark {
  position: absolute;
  right: 8px;
  top: 10px;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--idle);
  border-radius: 3px;
  background: #fff;
}
.hop.done .mark {
  background: var(--ok);
  border-color: var(--ok);
}
.hop.done .mark::after {
  content: "";
  display: block;
  width: 3px;
  height: 6px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin: 1px 0 0 4px;
}
.hop:hover { background: #eef3f8; }
.hop.current { background: #e6f4f2; }
.hop.error { background: #fdecec; }
.hop .n { display: block; font-size: 10px; font-weight: 700; color: var(--muted); }
.hop .t { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
.hop .a { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--blue2); }
.hop.current .n { color: var(--teal); }
.hop.error .n, .hop.error .t { color: var(--bad); }

.stage {
  padding: 8px 12px 4px;
  min-width: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  min-width: 0;
}
.key-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.stage-tools {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.stage-tools .btn { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.stage-tools .pace-ctl input { padding: 3px 6px; }
.stage-head h2 {
  margin: 0;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board {
  flex: 1;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  overflow: auto;
}
.board svg.arch {
  max-height: 100%;
}
.zoom { display: flex; align-items: center; gap: 4px; }
.zoom-fit { min-width: 40px; }
.panel-toggle {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
.panel-toggle:hover { background: #eef3f8; }

svg.arch { width: 100%; height: auto; display: block; margin: 0 auto; }
.n-box { fill: #f4f7fa; stroke: var(--idle); stroke-width: 1.5; }
.n-box.done { fill: #e8f7ee; stroke: var(--ok); }
.n-box.inflight { fill: #e6f4f2; stroke: var(--teal); stroke-width: 2.5; }
.n-box.waiting { fill: #fff7ed; stroke: var(--wait); }
.n-box.error { fill: #fdecec; stroke: var(--bad); stroke-width: 2.5; }
.n-lab { font-size: 12px; font-weight: 700; fill: #1f2430; }
.n-sub { font-size: 10px; fill: #6b7280; }
.n-chip { font-size: 9px; font-weight: 700; fill: #fff; }
.chip-bg { rx: 8; }
.chip-bg.inflight { fill: var(--teal); }
.chip-bg.done { fill: var(--ok); }
.chip-bg.waiting { fill: var(--wait); }
.chip-bg.error { fill: var(--bad); }
.edge { fill: none; stroke: #c5d0db; stroke-width: 1.6; }
.edge.active { stroke: var(--teal); stroke-width: 2.4; stroke-dasharray: 6 5; animation: ants 0.7s linear infinite; }
.edge.error { stroke: var(--bad); stroke-width: 2.4; stroke-dasharray: 6 5; animation: ants 0.7s linear infinite; }
.edge.done { stroke: #8fbf9c; }
.node { cursor: pointer; }
.node:hover .n-box { stroke: var(--blue2); }
.eod-dials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: end;
}
.eod-dials input {
  width: 64px;
  min-width: 0;
}
.eod-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  padding-bottom: 7px;
}
.eod-tick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.eod-tick .mark { font-size: 13px; line-height: 1; }
.eod-tick.ok { color: var(--ok); }
.eod-tick.short { color: var(--bad); }
.eod-report { list-style: none; margin: 8px 0 0; padding: 0; }
.eod-report li { font-size: 13px; line-height: 1.45; padding: 3px 0; color: var(--ink); }
.eod-report li.short b { color: var(--wait); }
.eod-report li.ok b { color: var(--ok); }

.eoy-form {
  gap: 6px 10px;
  align-items: end;
}
.eoy-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--navy, #12324e);
  background: #e8eef5;
  border-radius: 4px;
  padding: 4px 7px;
  white-space: nowrap;
}
#eoyRun .fold-bar {
  justify-content: flex-start;
}
#eoyRun .fold-bar .eoy-tag {
  margin-left: 8px;
}
#eoyRun .fold-bar .fold-toggle {
  margin-left: auto;
}
.eoy-form .eoy-tag {
  align-self: center;
}
.eoy-form .eoy-sep {
  align-self: stretch;
  width: 1px;
  margin: 2px 2px 0;
  background: #c8ced4;
  flex: 0 0 1px;
}
.eoy-form .eoy-date input,
.eoy-form .eoy-members input {
  min-width: 0;
  width: 7.5rem;
}
.eoy-form .eoy-members input {
  width: 5.5rem;
  font-variant-numeric: tabular-nums;
}
.eoy-form .eod-dials {
  gap: 4px 6px;
}
.eoy-form .eod-dials label {
  font-size: 10px;
}
.eoy-form .eod-dials input {
  width: 52px;
  min-width: 0;
  padding: 4px 5px;
  margin-top: 2px;
}
.eoy-form .eoy-year-dials input {
  width: 56px;
}
.eoy-form label:has(#eoyCount) input {
  width: 4.5rem;
  min-width: 0;
}
.eoy-form .eoy-status {
  flex: 1 1 12rem;
  align-self: center;
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  min-width: 10rem;
}
html[data-theme="night"] .eoy-tag {
  background: #243041;
  color: #d5e4f6;
}
html[data-theme="night"] .eoy-form .eoy-sep {
  background: #3a4554;
}

@keyframes ants { to { stroke-dashoffset: -22; } }
@keyframes pulse {
  50% { opacity: 0.55; }
}

.token {
  pointer-events: none;
}
.token-bg { fill: var(--navy); }
.token-bg.error { fill: var(--bad); }
.token-bg.done { fill: #1f6b4a; }
.token-tx { fill: #fff; font-size: 11px; font-weight: 700; }
.token-sub { fill: #d5e4f6; font-size: 9px; font-weight: 600; }

.app-pane {
  background: transparent;
  overflow: visible;
  min-width: 0;
}
.rail-panels .sim {
  margin: 0 0 8px;
  min-height: 0;
}
.file-view {
  margin: 4px 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}
.file-view-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #12324e;
  color: #fff;
  font-size: 12px;
}
.file-view-bar span { color: #c5d4e4; font-weight: 600; }
.file-view-bar .file-full { margin-left: auto; }
.file-view .api-json { margin: 0; max-height: 280px; border-radius: 0; }
.sim {
  margin: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: calc(100% - 20px);
}
.sim.is-live {
  border: 2px solid var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.22);
}
.sim.is-live .sim-bar {
  background: #0f4d56;
}
.sim.is-error {
  border: 2px solid var(--bad);
  outline: 3px solid rgba(180, 35, 24, 0.2);
}
.sim.is-error .sim-bar { background: #5c1612; }
.sim.is-error .live-pill { background: #fecaca; color: var(--bad); }
.sim-bar {
  background: var(--navy);
  color: #fff;
  padding: 10px 12px 8px;
}
.sim-bar .app-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.live-pill {
  margin-left: auto;
  background: #14b8a6;
  color: #042f2e;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  animation: liveglow 1.2s ease-in-out infinite;
}
@keyframes liveglow {
  50% { opacity: 0.65; }
}
.sim-logo { height: 22px; width: auto; }
.sim-bar .app-sub { font-size: 11px; color: #9db6d0; margin-top: 2px; }
.sim-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  background: #12324e;
}
.sim-switch button {
  border: 1px solid transparent;
  background: #1f4e79;
  color: #dce6f1;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
}
.sim-switch button.on {
  background: #14b8a6;
  color: #042f2e;
  border-color: #99f6e4;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.35);
}
.sim-body { padding: 12px; }
.sim-body h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--blue);
}
.sim-menu {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.sim-menu span {
  font-size: 11px;
  color: var(--blue2);
  font-weight: 700;
  padding: 4px 0;
}
.sim-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.sim-table th, .sim-table td {
  text-align: left;
  padding: 6px 6px;
  border-bottom: 1px solid var(--line);
}
.sim-table th { color: var(--muted); font-size: 10px; }
.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.badge.ok { background: #e8f7ee; color: var(--ok); }
.badge.wait { background: #fff7ed; color: var(--wait); }
.badge.bad { background: #fdecec; color: var(--bad); }
.badge.idle { background: #eef3f8; color: var(--blue); }
.err {
  background: #fdecec;
  color: var(--bad);
  border: 1px solid #f2c2bf;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  margin: 0 0 12px;
}
.kv { margin: 0 0 10px; }
.kv div { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.kv dt { width: 110px; flex-shrink: 0; color: var(--muted); }
.kv dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-word; }
.api-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #eef3f8;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.api-line code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--blue);
  word-break: break-all;
}
.api-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.api-line .file-full { margin-left: 0; }
.detail-panel {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.detail-panel summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: var(--blue);
  padding: 8px 10px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.file-full {
  margin-left: auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.file-full:hover { background: #eef3f8; }
.file-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  border-radius: 14px;
  background: #0d2137;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.file-screen-actions { display: flex; gap: 8px; }
.file-screen[hidden] { display: none; }
.file-screen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #0a1929;
  color: #fff;
}
.file-screen-bar strong { font-size: 15px; }
.file-screen-bar button {
  border: 0;
  background: #1f4e79;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.file-screen pre {
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 16px 20px 28px;
  overflow: scroll;
  background: #12324e;
  color: #dce6f1;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
}
.file-screen pre::-webkit-scrollbar { width: 14px; height: 14px; }
.file-screen pre::-webkit-scrollbar-thumb { background: #8aa4c0; border-radius: 7px; }
.file-screen pre::-webkit-scrollbar-track { background: #0a1929; }
.file-screen-html {
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 20px 24px 32px;
  overflow: auto;
  background: #f4f7fa;
  color: #1a2433;
  font-size: 14px;
  line-height: 1.5;
}
.file-screen-html[hidden] { display: none; }
.file-screen.calc-mode pre,
.file-screen.results-mode pre { display: none; }
.file-screen.calc-mode .file-screen-html,
.file-screen.results-mode .file-screen-html { display: block; }
.file-screen.results-mode .file-screen-html {
  padding: 1.25rem 1.5rem 2rem;
  overflow: auto;
}
.file-screen-html .results-pane-full {
  max-width: 920px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.45;
}
.file-screen-html .results-pane-full .batch-line { font-size: 22px; margin-bottom: 0.35rem; }
.file-screen-html .results-pane-full h3 { font-size: 14px; margin-top: 1.1rem; }
.file-screen-html .results-pane-full .results-head-full { margin-bottom: 0.75rem; }
.file-screen-html .calc-sheet-full {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 1.35rem;
  background: #fff;
  border: 1px solid #d5dde6;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(18, 50, 78, 0.06);
}
.file-screen-html .calc-sheet-full h2 {
  margin: 0 0 0.85rem;
  font-size: 18px;
  font-weight: 800;
  color: #12324e;
}
.file-screen-html .calc-sheet-full h3 {
  margin: 1rem 0 0.35rem;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2E6CA4;
}
.file-screen-html .calc-sheet-full h3:first-of-type { margin-top: 0.25rem; }
.file-screen-html .calc-sheet-full p { margin: 0.2rem 0; }
.file-screen-html .calc-sheet-full .muted { color: #5a6b7d; }
.file-screen-html .calc-math {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  white-space: pre-wrap;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: #3a4a5c;
  background: #eef3f8;
  border-radius: 8px;
}
html[data-theme="night"] .file-screen-html { background: #0f1720; color: #e8eef5; }
html[data-theme="night"] .file-screen-html .calc-sheet-full {
  background: #121c2b;
  border-color: #243247;
}
html[data-theme="night"] .file-screen-html .calc-sheet-full h2 { color: #e8eef5; }
html[data-theme="night"] .file-screen-html .calc-math { background: rgba(255,255,255,0.06); color: #c5d0dc; }
.detail-panel summary::-webkit-details-marker { display: none; }
.detail-panel summary::before { content: "▸  "; color: var(--muted); }
.detail-panel[open] summary::before { content: "▾  "; }
.detail-panel:not([open]) > :not(summary) { display: none; }
.detail-panel .muted { margin: 0 10px 8px; color: var(--muted); font-size: 12px; }
.api-json {
  margin: 0;
  padding: 10px;
  background: #12324e;
  color: #dce6f1;
  border-radius: 0 0 8px 8px;
  font-size: 11px;
  line-height: 1.45;
  overflow: auto;
  max-height: 140px;
  white-space: pre;
}
.detail-panel[open] .api-json {
  max-height: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
}
.toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  display: none;
}
.toast.show { display: block; }

html[data-theme="night"] {
  color-scheme: dark;
  --ink: #e8eef7;
  --muted: #9aabbf;
  --line: #2a3a4d;
  --bg: #0e1724;
  --card: #152233;
  --rail: #152233;
  --blue: #9ec4e4;
  --blue2: #7eb0d6;
  --banner: linear-gradient(90deg, #0c1520, #152536 55%, #163042);
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
html[data-theme="night"] .mode-tab:hover { background: rgba(255, 255, 255, .06); }
html[data-theme="night"] .mode-tab.on { background: #1f4e79; color: #fff; }
html[data-theme="night"] .data-bar,
html[data-theme="night"] .run-bar,
html[data-theme="night"] .persona,
html[data-theme="night"] .hops,
html[data-theme="night"] .footer,
html[data-theme="night"] .board,
html[data-theme="night"] .panel-toggle,
html[data-theme="night"] .app-pane,
html[data-theme="night"] .timing,
html[data-theme="night"] .sim,
html[data-theme="night"] .data-form input,
html[data-theme="night"] .data-form select,
html[data-theme="night"] .data-form .btn.secondary,
html[data-theme="night"] .rec,
html[data-theme="night"] .file-full {
  background: var(--card);
  color: var(--ink);
}
html[data-theme="night"] .panel-toggle { color: var(--blue); }
html[data-theme="night"] .data-form .btn.secondary { border-color: var(--blue2); color: var(--blue); }
html[data-theme="night"] .fold-toggle {
  color: var(--amber);
  border-color: var(--amber);
  background: transparent;
}
html[data-theme="night"] .fold-toggle:hover { background: rgba(212, 160, 23, 0.14); }
html[data-theme="night"] .persona { background: #121c2b; }
html[data-theme="night"] .app-pane { background: #121c2b; }
html[data-theme="day"] { color-scheme: light; }

@media (max-width: 1100px) {
  .desk { grid-template-columns: 1fr; height: auto; }
  .body { grid-template-columns: 1fr; }
  .hops, .app-pane { border: 0; border-top: 1px solid var(--line); max-height: 320px; }
  .top { flex-wrap: wrap; }
}
