:root {
  color-scheme: light;
  --page: #f4f4f8;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --surface-hover: #f2f2f7;
  --divider: #e9e9f0;
  --border: #dedee6;
  --border-input: #8c8c94;
  --text: #0f141a;
  --text-2: #424650;
  --muted: #656871;
  --faint: #a8a8b1;
  --link: 0 108 224;
  --nav-bg: #0f141a;
  --nav-text: #ffffff;
  --nav-muted: #b4b4bb;
  --accent: 49 16 129;
  --accent-ui: 74 31 184;
  --brand-gradient: linear-gradient(303deg, #5d69ba 0%, #311081 100%);
  --mint: 158 255 240;
  --on-status: #ffffff;
  --ok: 0 128 47;
  --bad: 219 0 0;
  --run: 0 108 224;
  --wait: 196 118 0;
  --idle: 101 104 113;
  --shadow: 0 1px 1px 0 rgb(0 7 22 / 0.05), 0 1px 8px 2px rgb(0 7 22 / 0.06);
  --display: "Satoshi", "Open Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidenav: 264px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b0e13;
    --surface: #161b23;
    --surface-2: #1a2029;
    --surface-hover: #1f2631;
    --divider: #262d38;
    --border: #2f3744;
    --border-input: #6b7280;
    --text: #e6e8ee;
    --text-2: #c2c6cf;
    --muted: #949aa6;
    --faint: #5a616d;
    --link: 92 166 255;
    --nav-bg: #06080b;
    --accent-ui: 158 140 255;
    --brand-gradient: linear-gradient(303deg, #6c7bd6 0%, #4a1fb8 100%);
    --on-status: #0b0e13;
    --ok: 41 185 99;
    --bad: 255 102 102;
    --run: 92 166 255;
    --wait: 245 180 50;
    --idle: 140 146 158;
    --shadow: 0 1px 1px 0 rgb(0 0 0 / 0.3), 0 1px 8px 2px rgb(0 0 0 / 0.25);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0e13;
  --surface: #161b23;
  --surface-2: #1a2029;
  --surface-hover: #1f2631;
  --divider: #262d38;
  --border: #2f3744;
  --border-input: #6b7280;
  --text: #e6e8ee;
  --text-2: #c2c6cf;
  --muted: #949aa6;
  --faint: #5a616d;
  --link: 92 166 255;
  --nav-bg: #06080b;
  --accent-ui: 158 140 255;
  --brand-gradient: linear-gradient(303deg, #6c7bd6 0%, #4a1fb8 100%);
  --on-status: #0b0e13;
  --ok: 41 185 99;
  --bad: 255 102 102;
  --run: 92 166 255;
  --wait: 245 180 50;
  --idle: 140 146 158;
  --shadow: 0 1px 1px 0 rgb(0 0 0 / 0.3), 0 1px 8px 2px rgb(0 0 0 / 0.25);
}

[data-status="success"] { --c: var(--ok); }
[data-status="failure"] { --c: var(--bad); }
[data-status="in_progress"] { --c: var(--run); }
[data-status="waiting"] { --c: var(--wait); }
[data-status="queued"], [data-status="cancelled"], [data-status="skipped"], [data-status="not_reached"] { --c: var(--idle); }
[data-tone="ok"] { --c: var(--ok); }
[data-tone="bad"] { --c: var(--bad); }
[data-tone="run"] { --c: var(--run); }
[data-tone="wait"] { --c: var(--wait); }
[data-tone="neutral"] { --c: var(--accent-ui); }
[data-tone="mine"] { --c: var(--accent-ui); }

* { box-sizing: border-box; }

html, body { background: var(--page); }

body {
  margin: 0;
  color: var(--text);
  font: 400 14px/20px var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgb(var(--accent-ui) / 0.22); }
.mono { font-family: var(--mono); font-size: 12.5px; font-variant-ligatures: none; }
.faint { color: var(--faint); }
.link { color: rgb(var(--link)); font-weight: 600; }
.link:hover { text-decoration: underline; }

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.spin { animation: spin 0.9s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes halo { 0% { transform: scale(0.8); opacity: 0.7; } 100% { transform: scale(2); opacity: 0; } }
@keyframes stripes { to { background-position: 28px 0; } }
@keyframes flow { to { background-position: 24px 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgb(var(--c) / 0.12); } }

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 20px;
  color: var(--nav-text);
  background: var(--nav-bg);
  box-shadow: inset 0 -1px 0 rgb(255 255 255 / 0.06);
}
.topnav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, #311081, #5d69ba 40%, rgb(var(--mint)) 100%);
  opacity: 0.9;
}
.nav-toggle { display: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 24px; height: 24px; }
.brand-mark path { fill: #ffffff; }
.brand-name { font-family: var(--display); font-size: 18px; font-weight: 500; letter-spacing: -0.03em; }
.brand-tag {
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  color: var(--nav-muted);
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 999px;
}
.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.org { color: var(--nav-muted); font-size: 13px; white-space: nowrap; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 11px 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgb(var(--mint));
  background: rgb(var(--mint) / 0.12);
  border: 1px solid rgb(var(--mint) / 0.25);
  border-radius: 999px;
  white-space: nowrap;
}
.live[hidden] { display: none; }
.live.offline { color: #ff8a8a; background: rgb(255 102 102 / 0.12); border-color: rgb(255 102 102 / 0.3); }
.live-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: halo 2s ease-out infinite; }

.shell { display: grid; grid-template-columns: var(--sidenav) minmax(0, 1fr); min-height: calc(100vh - 52px); }
.sidenav {
  position: sticky;
  top: 52px;
  align-self: start;
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 20px 0 24px;
  background: var(--surface);
  border-right: 1px solid var(--divider);
}
.sn-head { padding: 0 24px 14px; }
.sn-head a { font-family: var(--display); font-size: 19px; font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
.sn-divider { height: 1px; margin: 10px 24px; background: var(--divider); }
.sn-section { display: flex; align-items: center; gap: 6px; padding: 6px 24px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); }
.sn-count { margin-left: 4px; font-weight: 400; }
.sn-list { list-style: none; margin: 0; padding: 0; }
.sn-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 5px 20px 5px 24px;
  color: var(--text-2);
  font-weight: 400;
}
.sn-link:hover { color: rgb(var(--link)); }
.sn-link.active { color: rgb(var(--accent-ui)); font-weight: 700; }
.sn-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-gradient);
}
.sn-repo .icon { width: 14px; height: 14px; color: rgb(var(--c)); }
.sn-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: rgb(var(--run));
  border-radius: 999px;
}
.scrim { display: none; }
.content { min-width: 0; }
.banner-slot:empty { display: none; }
.banner-slot { padding: 16px 32px 0; }
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  background: rgb(var(--c) / 0.1);
  border: 1px solid rgb(var(--c) / 0.45);
  border-radius: 12px;
}
.banner .icon { margin-top: 2px; color: rgb(var(--c)); }
.live.stale { color: rgb(var(--wait)); background: rgb(var(--wait) / 0.14); border-color: rgb(var(--wait) / 0.35); }

main { min-width: 0; padding: 18px 32px 64px; }

.breadcrumbs { display: flex; align-items: center; gap: 8px; min-height: 20px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.breadcrumbs .icon { width: 12px; height: 12px; color: var(--faint); }
.crumb-current { color: var(--muted); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-family: var(--display); font-size: 32px; font-weight: 500; line-height: 1.15; letter-spacing: -0.035em; word-break: break-word; }
.counter { font-family: var(--font); font-weight: 400; color: var(--muted); letter-spacing: 0; }
.page-head .counter { font-size: 26px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 18px;
  font: 700 14px/1 var(--font);
  color: rgb(var(--link));
  background: var(--surface);
  border: 2px solid rgb(var(--link));
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.button:hover { background: rgb(var(--link) / 0.08); }
.button .icon { width: 14px; height: 14px; stroke-width: 2; }
.button.primary {
  color: #fff;
  background: var(--brand-gradient);
  border-color: transparent;
  box-shadow: 0 1px 4px rgb(45 24 93 / 0.25), 0 6px 14px -6px rgb(49 16 129 / 0.55);
}
.button.primary:hover { box-shadow: 0 1px 4px rgb(45 24 93 / 0.3), 0 10px 20px -8px rgb(49 16 129 / 0.65); }

.container {
  margin-bottom: 20px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.c-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 10px; }
.c-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 700; line-height: 22px; }
.c-head .counter { font-size: 18px; }
.c-body { padding: 4px 20px 20px; }
.container.flush .c-body { padding: 0 0 4px; }

.kv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kv-grid.five { grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); }
.kv-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 2px 20px; border-left: 1px solid var(--divider); }
.kv-item:first-child { padding-left: 0; border-left: 0; }
.kv-label { font-size: 14px; font-weight: 700; color: var(--text-2); }
.kv-value { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv-big {
  align-self: flex-start;
  padding: 0 2px;
  font: 500 36px/1.15 var(--display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--c));
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
button.kv-big:hover, a.kv-big:hover { border-bottom-color: rgb(var(--c) / 0.35); }
.kv-big.active { border-bottom-color: rgb(var(--c)); }
.kv-big.static { cursor: default; }
.kv-big[data-tone="neutral"] { color: rgb(var(--link)); }
.kv-of { font-size: 20px; color: var(--muted); letter-spacing: -0.02em; }

.si { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: rgb(var(--c)); font-weight: 400; white-space: nowrap; }
.si .icon { width: 15px; height: 15px; stroke-width: 1.9; }
.si-label { overflow: hidden; text-overflow: ellipsis; }

.table-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 2px 20px 14px; }
.text-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  max-width: 100%;
  height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface);
  border: 2px solid var(--border-input);
  border-radius: 8px;
}
.text-filter:focus-within { border-color: rgb(var(--link)); box-shadow: 0 0 0 2px rgb(var(--link) / 0.2); }
.text-filter input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: none; border: 0; outline: none; }
.text-filter input::placeholder { color: var(--muted); font-style: italic; }
.matches { color: var(--muted); }
.repo-rows { margin: 0; padding: 0; list-style: none; }
.repo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 20px; border-top: 1px solid var(--divider); }
.repo-row:hover { background: var(--surface-hover); }
.repo-row .repo-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-row .button { flex-shrink: 0; }
.segmented { display: inline-flex; margin-left: auto; padding: 2px; border: 2px solid var(--border-input); border-radius: 999px; }
.segmented button {
  height: 24px;
  padding: 0 14px;
  font: 700 13px/1 var(--font);
  color: var(--text-2);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.segmented button:hover { color: rgb(var(--link)); }
.segmented button.active { color: #fff; background: var(--brand-gradient); }

.board-head, .track {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) 80px;
  align-items: center;
  column-gap: 16px;
  padding: 0 20px;
}
.board-head, .runs-head {
  min-height: 38px;
  font-weight: 700;
  color: var(--text-2);
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.board-stages { display: grid; grid-template-columns: repeat(var(--stages, 4), minmax(0, 1fr)); text-align: center; }
.board-flight { text-align: right; }
.track { position: relative; min-height: 112px; border-bottom: 1px solid var(--divider); transition: background 0.12s; }
.track:last-child { border-bottom: 0; }
.track:hover { background: var(--surface-hover); }
.track:hover .repo-name { text-decoration: underline; }
.track-repo { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px 0; }
.repo-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.repo-name { font-weight: 700; color: rgb(var(--link)); }
.repo-commit { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.meta .si { font-size: 12.5px; }
.meta .si .icon { width: 13px; height: 13px; }
.sep { width: 3px; height: 3px; flex-shrink: 0; border-radius: 50%; background: var(--faint); }
.avatar { width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%; background: var(--divider); }

.track-line { display: grid; grid-template-columns: repeat(var(--stages, 4), minmax(0, 1fr)); align-self: stretch; }
.station {
  display: grid;
  grid-template-rows: 20px 26px 18px 22px;
  justify-items: center;
  align-content: center;
  row-gap: 3px;
  min-width: 0;
  padding: 8px 4px;
}
.markers { display: flex; align-items: flex-end; justify-content: center; gap: 4px; min-width: 0; }
.marker {
  padding: 0 7px;
  font: 600 11px/17px var(--mono);
  color: rgb(var(--c));
  background: rgb(var(--c) / 0.1);
  border: 1px solid rgb(var(--c) / 0.45);
  border-radius: 999px;
  white-space: nowrap;
}
.marker[data-status="in_progress"], .marker[data-status="waiting"] { animation: pulse 1.8s ease-in-out infinite; }
.marker.more { --c: var(--idle); }
.node-wrap { position: relative; display: grid; place-items: center; width: 100%; height: 26px; }
.node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: rgb(var(--c));
  background: var(--surface);
  border-radius: 50%;
}
.node .icon { width: 22px; height: 22px; }
.node[data-status="in_progress"], .node[data-status="waiting"] { animation: pulse 1.8s ease-in-out infinite; }
.node[data-status="not_reached"] { width: 12px; height: 12px; border: 1.5px dashed var(--border-input); }
.track:hover .node { background: var(--surface-hover); }
.rail { position: absolute; left: 50%; top: 50%; width: 100%; height: 2px; margin-top: -1px; background: rgb(var(--c) / 0.55); }
.rail[data-status="not_reached"] { background: repeating-linear-gradient(90deg, var(--border) 0 4px, transparent 4px 8px); }
.rail[data-status="in_progress"], .rail[data-status="waiting"] {
  background: repeating-linear-gradient(90deg, rgb(var(--c)) 0 6px, rgb(var(--c) / 0.15) 6px 12px);
  background-size: 24px 2px;
  animation: flow 0.9s linear infinite;
}
.station-meta { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.station-age { color: var(--muted); }
.station-pd { display: flex; justify-content: center; min-width: 0; }
.pd-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px 0 5px;
  font-size: 11px;
  color: rgb(var(--c));
  background: rgb(var(--c) / 0.08);
  border: 1px dashed rgb(var(--c) / 0.5);
  border-radius: 999px;
  white-space: nowrap;
}
.pd-pill .icon { width: 12px; height: 12px; }
.pd-pill .icon:first-child { color: var(--faint); }
.track-flight { text-align: right; font: 500 24px/1 var(--display); letter-spacing: -0.03em; color: var(--faint); font-variant-numeric: tabular-nums; }
.track-flight.busy { color: rgb(var(--run)); }

.stage-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(calc(var(--stages) - 1), 36px minmax(0, 1fr));
  align-items: start;
  padding-top: 6px;
}
.stage-col { display: flex; flex-direction: column; min-width: 0; }
.stage-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid rgb(var(--c));
  border-radius: 12px;
}
.stage-box[data-status="not_reached"] { border-top-color: var(--border); }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.sb-name { font-family: var(--display); font-size: 17px; font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }
.sb-head .si { font-weight: 600; }
.sb-run { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.sb-title { color: var(--text-2); }
.actions-list { list-style: none; margin: 0; padding: 4px 0; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
.action { display: flex; align-items: center; gap: 8px; min-width: 0; height: 28px; font-size: 13px; }
.action .icon { width: 14px; height: 14px; color: rgb(var(--c)); }
.action.more { padding-left: 22px; color: var(--muted); }
.more-toggle { padding: 0; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.more-toggle:hover, .more-toggle:focus-visible { color: var(--text); text-decoration: underline; }
.job-link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
a.job-link:hover { color: rgb(var(--link)); text-decoration: underline; }
.action-time { margin-left: auto; padding-left: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sb-flights { display: flex; flex-direction: column; gap: 6px; }
.sb-flights .kv-label { font-size: 12.5px; }
.flight {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 30px;
  padding: 0 4px 0 10px;
  font-size: 13px;
  color: var(--text);
  background: rgb(var(--c) / 0.08);
  border: 1px solid rgb(var(--c) / 0.35);
  border-radius: 999px;
}
.flight:hover { background: rgb(var(--c) / 0.14); }
.flight .icon { width: 14px; height: 14px; color: rgb(var(--c)); }
.flight-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.flight-time { color: rgb(var(--c)); font-size: 12px; }
.sb-foot { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; }
.sb-foot .kv-label { font-size: 12.5px; }
.sb-age { margin-left: auto; color: var(--muted); }

.post-deploy {
  position: relative;
  margin: 14px 0 0 18px;
  padding: 10px 14px 6px;
  background: var(--surface-2);
  border: 1px dashed rgb(var(--c) / 0.55);
  border-radius: 12px;
}
.post-deploy::before {
  content: "";
  position: absolute;
  left: -11px;
  top: -16px;
  width: 11px;
  height: 34px;
  border-left: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  border-bottom-left-radius: 8px;
}
.pd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.pd-title { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.pd-title .icon { width: 13px; height: 13px; color: var(--faint); }
.post-deploy .si { font-size: 13px; font-weight: 600; }
.post-deploy .actions-list { border: 0; padding: 0; }

.transition { position: relative; align-self: stretch; display: grid; place-items: start center; padding-top: 44px; color: var(--muted); }
.transition-line { position: absolute; left: 4px; right: 4px; top: 52px; height: 2px; background: var(--border); }
.transition .icon { position: relative; width: 18px; height: 18px; padding: 2px; background: var(--surface); border-radius: 50%; }
.transition.flowing { color: rgb(var(--run)); }
.transition.flowing .transition-line {
  background: repeating-linear-gradient(90deg, rgb(var(--run)) 0 6px, transparent 6px 12px);
  background-size: 24px 2px;
  animation: flow 0.8s linear infinite;
}

.runs-head, .run-main {
  display: grid;
  grid-template-columns: 20px minmax(240px, 340px) minmax(0, 1fr) 80px;
  align-items: center;
  column-gap: 14px;
  padding: 0 20px 0 14px;
}
.segments-head { display: grid; grid-template-columns: repeat(var(--stages), minmax(0, 1fr)); gap: 4px; }
.segments-head span { padding-left: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segments-head span:first-child { padding-left: 12px; }
.runs-head-total { text-align: right; }
.run { border-bottom: 1px solid var(--divider); }
.run:last-child { border-bottom: 0; }
.run-main {
  width: 100%;
  min-height: 72px;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}
.run-main:hover, .run.expanded .run-main { background: var(--surface-hover); }
.run-main:focus-visible { outline: 2px solid rgb(var(--link)); outline-offset: -2px; }
.run-caret { display: flex; color: var(--text-2); transition: transform 0.15s; }
.run.expanded .run-caret { transform: rotate(90deg); }
.run-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 0; }
.run-title { display: flex; gap: 8px; align-items: baseline; min-width: 0; font-weight: 600; white-space: nowrap; }
.run-number { flex-shrink: 0; color: rgb(var(--link)); font-weight: 600; }
.run-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.run-total { text-align: right; color: var(--text-2); }

.segments { display: grid; grid-template-columns: repeat(var(--stages), minmax(0, 1fr)); gap: 4px; padding: 10px 0; }
.seg-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.seg {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  height: 38px;
  padding: 0 14px 0 20px;
  overflow: hidden;
  background: rgb(var(--c) / 0.14);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%, 11px 50%);
}
.seg-cell:first-child .seg { padding-left: 12px; clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%); border-radius: 999px 0 0 999px; }
.seg[data-status="not_reached"] { background: rgb(var(--idle) / 0.07); }
.seg[data-status="skipped"], .seg[data-status="cancelled"] { background: rgb(var(--idle) / 0.1); }
.seg[data-status="in_progress"]::after, .seg[data-status="waiting"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, rgb(var(--c) / 0.14) 0 7px, transparent 7px 14px);
  background-size: 28px 100%;
  animation: stripes 1.1s linear infinite;
  pointer-events: none;
}
.seg[data-status="waiting"]::after { animation-duration: 2.4s; }
.seg-status { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; font-size: 13px; color: rgb(var(--c)); white-space: nowrap; }
.seg-status .icon { width: 14px; height: 14px; }
.seg-label { overflow: hidden; text-overflow: ellipsis; }
.seg-meta { position: relative; z-index: 1; font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-pd {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 20px;
  margin-left: 10px;
  padding: 0 8px 0 4px;
  font-size: 11px;
  color: rgb(var(--c));
  background: rgb(var(--c) / 0.07);
  border: 1px dashed rgb(var(--c) / 0.45);
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
}
.seg-pd .icon { width: 12px; height: 12px; }
.seg-pd .icon:first-child { color: var(--faint); }
.seg-pd-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.seg-pd .mono { margin-left: auto; font-size: 11px; }
.seg-pd.empty { visibility: hidden; }

.run-detail { padding: 6px 20px 18px 48px; background: var(--surface-hover); }
.timeline { padding: 12px 16px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.timeline-empty { color: var(--muted); }
.tl-axis, .tl-row { display: grid; grid-template-columns: 280px minmax(0, 1fr); column-gap: 16px; align-items: center; }
.tl-axis { height: 22px; margin-bottom: 4px; }
.tl-ticks { position: relative; height: 100%; margin-right: 44px; }
.tl-ticks span { position: absolute; top: 2px; transform: translateX(-50%); font: 11px var(--mono); color: var(--muted); white-space: nowrap; }
.tl-ticks span:first-child { transform: none; }
.tl-ticks span:last-child { transform: translateX(-100%); }
.tl-group + .tl-group { margin-top: 8px; }
.tl-stage { height: 24px; font-family: var(--display); font-size: 15px; font-weight: 500; letter-spacing: -0.01em; line-height: 24px; }
.tl-sub { display: flex; align-items: center; gap: 6px; height: 22px; padding-left: 14px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tl-sub .icon { width: 12px; height: 12px; color: var(--faint); }
.tl-sub ~ .tl-row .tl-label { padding-left: 32px; }
.tl-row { height: 26px; }
.tl-label { display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 14px; font-size: 13px; }
.tl-label .icon { width: 13px; height: 13px; color: rgb(var(--c)); }
.tl-lane {
  position: relative;
  height: 100%;
  margin-right: 44px;
  background: linear-gradient(90deg, var(--divider) 1px, transparent 1px) 0 0 / 25% 100%;
  border-right: 1px solid var(--divider);
}
.bar { position: absolute; top: 6px; height: 14px; min-width: 3px; border-radius: 4px; background: rgb(var(--c) / 0.85); }
.bar[data-status="in_progress"] {
  background: repeating-linear-gradient(-45deg, rgb(var(--c)) 0 6px, rgb(var(--c) / 0.6) 6px 12px);
  background-size: 24px 100%;
  animation: stripes 1s linear infinite;
}
.bar[data-status="skipped"], .bar[data-status="cancelled"] { background: rgb(var(--c) / 0.35); }
.bar-time { position: absolute; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar.outside .bar-time { left: calc(100% + 6px); }
.bar.inside .bar-time { right: calc(100% + 6px); }
.bar-pending {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  font-size: 11.5px;
  color: rgb(var(--c));
  background: rgb(var(--c) / 0.08);
  border: 1px dashed rgb(var(--c) / 0.5);
  border-radius: 999px;
  white-space: nowrap;
}
.bar-pending .icon { width: 12px; height: 12px; }
.run-detail-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 32px; color: var(--muted); }
.empty-state strong { color: var(--text-2); }
.empty-state.waiting-limit { padding: 64px 32px; }
.empty-state.waiting-limit .icon { width: 28px; height: 28px; margin-bottom: 8px; color: var(--muted); }
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  color: #fff;
  background: rgb(var(--bad));
  border-radius: 12px;
  --on-status: rgb(var(--bad));
}
.flash .icon { --c: 255 255 255; color: #fff; width: 18px; height: 18px; }
.flash div { display: flex; flex-direction: column; }
.skeleton { display: flex; flex-direction: column; gap: 14px; }
.skeleton-line, .skeleton-block {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hover) 50%, var(--surface) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton-line.short { width: 140px; height: 16px; }
.skeleton-line.title { width: 260px; height: 34px; margin-bottom: 6px; }
.skeleton-block { height: 120px; border-radius: 16px; }

body.signed-out .shell { grid-template-columns: minmax(0, 1fr); }
body.signed-out .sidenav, body.signed-out .scrim, body.signed-out .nav-toggle { display: none; }
body.signed-out main { padding: 0; }
.sign-in { display: grid; place-items: center; min-height: calc(100vh - 52px); padding: 32px 16px; }
.sign-in-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.sign-in-badge {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  background: var(--brand-gradient);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgb(45 24 93 / 0.25), 0 10px 24px -10px rgb(49 16 129 / 0.7);
}
.sign-in-mark { width: 30px; height: 30px; }
.sign-in-mark path { fill: #ffffff; }
.sign-in-title { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.sign-in-text { margin: 8px 0 24px; font-size: 14px; color: var(--muted); }
.sign-in-failure { width: 100%; margin-bottom: 16px; text-align: left; font-size: 13px; }
.button.sign-in-google {
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.button.sign-in-google:hover { background: var(--surface-hover); border-color: var(--border-input); }
.button.sign-in-google:focus-visible { outline: 2px solid rgb(var(--accent-ui)); outline-offset: 2px; }
.google-g { width: 18px; height: 18px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-left: -6px;
    padding: 0;
    color: #fff;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
  }
  .nav-toggle:hover { background: rgb(255 255 255 / 0.08); }
  .nav-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .sidenav {
    position: fixed;
    left: 0;
    top: 52px;
    z-index: 15;
    width: min(var(--sidenav), 86vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    box-shadow: 4px 0 24px rgb(0 7 22 / 0.18);
  }
  body.nav-open .sidenav { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 52px 0 0 0; z-index: 14; background: rgb(0 7 22 / 0.35); }
  main { padding: 18px 24px 56px; }
  .kv-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .kv-grid.five .kv-item:nth-child(4) { padding-left: 0; border-left: 0; }
  .seg-label, .seg-pd-label { display: none; }
  .stage-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .transition { display: none; }
}

@media (max-width: 760px) {
  .topnav { padding: 0 14px; gap: 8px; }
  .org { display: none; }
  .live #updated { display: none; }
  .live { padding: 0 9px; }
  main { padding: 14px 16px 48px; }
  .banner-slot { padding: 12px 16px 0; }
  .page-head h1 { font-size: 26px; }
  .page-head .counter { font-size: 21px; }
  .actions .button { padding: 0 14px; }
  .c-head { padding: 12px 16px 8px; }
  .c-body { padding: 4px 16px 16px; }

  .kv-grid, .kv-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .kv-item:nth-child(odd) { padding-left: 0; border-left: 0; }
  .kv-grid.five .kv-item:nth-child(4) { padding-left: 20px; border-left: 1px solid var(--divider); }
  .kv-label { font-size: 13px; }
  .kv-big { font-size: 30px; }

  .table-tools { padding: 2px 16px 12px; }
  .text-filter { width: 100%; }
  .repo-row { padding: 6px 16px; }
  .segmented { margin-left: 0; overflow-x: auto; max-width: 100%; }
  .segmented button { padding: 0 10px; font-size: 12px; }

  .board-head { display: none; }
  .track {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "repo flight" "line line";
    padding: 0 14px 6px;
  }
  .track-repo { grid-area: repo; padding: 12px 0 2px; }
  .track-flight { grid-area: flight; align-self: start; padding-top: 14px; }
  .track-line { grid-area: line; }
  .station { grid-template-rows: auto 18px 24px 16px 22px; padding: 6px 2px; }
  .station::before { content: attr(data-stage); font-size: 11px; font-weight: 700; color: var(--muted); }
  .station-age { display: none; }
  .marker { padding: 0 5px; font-size: 10px; }
  .markers .marker:nth-child(n + 2):not(.more) { display: none; }
  .pd-pill .icon:first-child { display: none; }

  .stage-flow { grid-template-columns: minmax(0, 1fr); }
  .sb-title { display: none; }
  .post-deploy { margin-left: 14px; }

  .runs-head { display: none; }
  .run-main {
    grid-template-columns: 16px minmax(0, 1fr) auto;
    grid-template-areas: "caret info total" "segs segs segs";
    padding: 0 14px 10px 10px;
    column-gap: 8px;
  }
  .run-caret { grid-area: caret; }
  .run-info { grid-area: info; }
  .run-total { grid-area: total; }
  .segments { grid-area: segs; gap: 3px; padding: 0; }
  .meta .meta-sha { display: none; }
  .seg { flex-direction: row; align-items: center; justify-content: center; gap: 4px; height: 32px; padding: 0 10px 0 13px; }
  .seg-cell:first-child .seg { padding-left: 4px; }
  .seg:not([data-status="skipped"]) .seg-status { display: none; }
  .seg-meta { font-size: 10.5px; }
  .seg-pd { margin-left: 4px; padding: 0 6px 0 3px; justify-content: center; }
  .seg-pd .icon:first-child { display: none; }
  .seg-pd .mono { margin-left: 0; }

  .run-detail { padding: 0 10px 12px; }
  .timeline { padding: 10px; }
  .tl-axis, .tl-row { grid-template-columns: 112px minmax(0, 1fr); column-gap: 8px; }
  .tl-label, .tl-sub { padding-left: 0; font-size: 11.5px; }
  .tl-sub ~ .tl-row .tl-label { padding-left: 8px; }
  .tl-label .icon { display: none; }
  .tl-label .button.small { height: 22px; padding: 0 6px; font-size: 11px; border-width: 1px; }
  .tl-ticks, .tl-lane { margin-right: 0; }
  .tl-ticks span:nth-child(2n) { display: none; }
  .bar-time { display: none; }
}

.theme-toggle { display: inline-flex; padding: 2px; background: rgb(255 255 255 / 0.06); border: 1px solid rgb(255 255 255 / 0.14); border-radius: 999px; }
.theme-toggle button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 22px;
  padding: 0;
  color: var(--nav-muted);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.theme-toggle button:hover { color: #fff; }
.theme-toggle button.active { color: #fff; background: var(--brand-gradient); }
.theme-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.viewer { display: inline-flex; align-items: center; gap: 8px; color: var(--nav-text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.viewer-avatar { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgb(var(--mint) / 0.6); }

.sn-section .icon { width: 14px; height: 14px; }
.sn-badge.mine { background: var(--brand-gradient); }
.sn-empty { padding: 4px 24px; color: var(--faint); font-size: 13px; }
.sn-link .sn-count { color: var(--muted); }

.owners { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.owner, .unmanaged-tag, .draft-tag {
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  color: var(--text-2);
  background: var(--surface-hover);
  border: 1px solid var(--divider);
  border-radius: 999px;
}
.unmanaged-tag, .draft-tag { white-space: nowrap; }
.owner.mine { color: rgb(var(--accent-ui)); background: rgb(var(--accent-ui) / 0.08); border-color: rgb(var(--accent-ui) / 0.35); }
.kv-value.owners { flex-direction: row; }
.kv-grid.six { grid-template-columns: 1.3fr 1fr repeat(4, minmax(0, 1fr)); }
.c-head h2 .icon { width: 18px; height: 18px; color: rgb(var(--accent-ui)); }
.team-meta { padding: 0 20px 12px; color: var(--muted); font-size: 13px; }
a.kv-big { display: inline-block; }
.marker.mine { box-shadow: 0 0 0 2px rgb(var(--accent-ui) / 0.45); }
.mine-tag {
  flex-shrink: 0;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  color: #fff;
  background: var(--brand-gradient);
  border-radius: 999px;
}

.run-actions { display: inline-flex; gap: 6px; }
.button.small { height: 26px; padding: 0 10px; font-size: 12.5px; border-width: 1.5px; }
.button.small .icon { width: 12px; height: 12px; }
.button.danger { color: rgb(var(--bad)); border-color: rgb(var(--bad)); }
.button.danger:hover { background: rgb(var(--bad) / 0.08); }
.button.danger.solid { color: #fff; background: rgb(var(--bad)); }
.button.danger.solid:hover { background: rgb(var(--bad) / 0.88); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.action.rerun-row { padding-left: 22px; }
.tl-label .button { flex-shrink: 0; margin-left: auto; }
.flight-link { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.flight .run-actions .button span { display: none; }
.flight .run-actions .button { width: 26px; padding: 0; justify-content: center; }
.flight.mine { box-shadow: inset 3px 0 0 rgb(var(--accent-ui)); }

.changes { display: flex; flex-direction: column; }
.change {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border-top: 1px solid var(--divider);
  box-shadow: inset 4px 0 0 rgb(var(--c));
}
.change-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.change-repo { font-size: 13px; }
.change-title { display: flex; gap: 8px; align-items: baseline; min-width: 0; font-weight: 600; white-space: nowrap; }
.change-where { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.change-now { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.change-now .si { font-weight: 600; }
.change-time { color: var(--muted); font-size: 12px; }
.change-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mini-chain { display: flex; align-items: center; min-width: 0; }
.mini-stage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px 0 6px;
  font-size: 12px;
  color: rgb(var(--c));
  background: rgb(var(--c) / 0.1);
  border: 1px solid rgb(var(--c) / 0.3);
  border-radius: 999px;
  white-space: nowrap;
}
.mini-stage .icon { width: 14px; height: 14px; }
.mini-stage[data-status="not_reached"] { color: var(--muted); background: none; border-style: dashed; }
.mini-stage.current { border-width: 2px; box-shadow: 0 0 0 3px rgb(var(--c) / 0.15); font-weight: 700; }
.mini-label { color: var(--text-2); }
.mini-stage.current .mini-label { color: var(--text); }
.mini-rail { flex: 1; min-width: 10px; max-width: 40px; height: 2px; background: rgb(var(--c) / 0.4); }
.mini-rail[data-status="not_reached"] { background: repeating-linear-gradient(90deg, var(--border) 0 4px, transparent 4px 8px); }

.modal {
  width: min(640px, calc(100vw - 32px));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgb(0 7 22 / 0.35);
}
.modal::backdrop { background: rgb(0 7 22 / 0.45); backdrop-filter: blur(2px); }
.modal-card { display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.icon-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; color: var(--muted); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.icon-close:hover { color: var(--text); background: var(--surface-hover); }
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 8px 20px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 18px; }
.modal-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; margin: 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--divider); border-radius: 10px; }
.modal-facts dt { font-weight: 700; color: var(--text-2); }
.modal-facts dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-note { margin: 0; color: var(--muted); font-size: 13px; }
.modal-loading { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.changelog { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cl-head .link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.cl-head .icon { width: 12px; height: 12px; }
.cl-title { font-weight: 700; color: var(--text-2); }
.cl-summary, .cl-shown { margin: 0; font-size: 13px; }
.cl-shown { color: var(--muted); }
.cl-list { max-height: 204px; margin: 0; padding: 0; overflow-y: auto; list-style: none; border: 1px solid var(--divider); border-radius: 10px; }
.cl-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: baseline; gap: 10px; padding: 6px 12px; font-size: 13px; }
.cl-row + .cl-row { border-top: 1px solid var(--divider); }
.cl-message { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-author { max-width: 120px; overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.cl-age { color: var(--muted); white-space: nowrap; }
.env-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; }
.env-list legend { margin-bottom: 6px; font-weight: 700; color: var(--text-2); }
.env-option {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.env-option:has(input:checked) { border-color: rgb(var(--accent-ui)); background: rgb(var(--accent-ui) / 0.05); }
.env-option.disabled { cursor: not-allowed; opacity: 0.7; }
.env-option input { grid-row: span 2; margin-top: 3px; accent-color: rgb(var(--accent-ui)); }
.env-name { font-weight: 700; }
.env-reviewers { color: var(--muted); font-size: 12.5px; }
.comment-field { display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: var(--text-2); }
.comment-field textarea {
  font: 400 14px/20px var(--font);
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border-input);
  border-radius: 8px;
  padding: 6px 10px;
  resize: vertical;
}
.comment-field textarea:focus { outline: none; border-color: rgb(var(--link)); }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 40px));
  padding: 12px 16px;
  color: var(--text);
  background: var(--surface);
  border-left: 4px solid rgb(var(--c));
  border-radius: 12px;
  box-shadow: 0 12px 32px rgb(0 7 22 / 0.25);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.visible { opacity: 1; transform: none; }
.toast .icon { color: rgb(var(--c)); width: 18px; height: 18px; }

.import-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.import-main, .import-side { min-width: 0; }
.spec-editor {
  box-sizing: border-box;
  width: 100%;
  min-height: 360px;
  padding: 10px 12px;
  line-height: 18px;
  color: var(--text);
  background: var(--surface-2);
  border: 2px solid var(--border-input);
  border-radius: 8px;
  resize: vertical;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.spec-editor:focus { outline: none; border-color: rgb(var(--link)); }
.import-team { margin-top: 12px; }
.team-input { display: flex; align-items: center; gap: 4px; min-width: 0; }
.team-input input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border-input);
  border-radius: 8px;
}
.team-input input:focus { outline: none; border-color: rgb(var(--link)); }
.import-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.import-error { margin-top: 12px; }
.import-error-text { margin: 0; min-width: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.import-done { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-weight: 700; color: rgb(var(--c)); }
.import-done .link { min-width: 0; overflow-wrap: anywhere; }
.import-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 18px; overflow-wrap: anywhere; }
.import-removed { margin-top: 14px; }
.checklist { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; overflow-wrap: anywhere; }
.check > .icon { width: 16px; height: 16px; margin-top: 2px; color: rgb(var(--c)); }
.check-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.check-names { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.check-names code { padding: 1px 6px; background: var(--surface-2); border: 1px solid var(--divider); border-radius: 6px; }
.file-preview { border-top: 1px solid var(--divider); }
.file-preview summary { padding: 8px 0; cursor: pointer; overflow-wrap: anywhere; }
.file-content {
  max-height: 420px;
  margin: 0 0 10px;
  padding: 10px 12px;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  border-radius: 8px;
  white-space: pre;
}

@media (max-width: 1180px) {
  .kv-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .import-grid { grid-template-columns: minmax(0, 1fr); }
  .kv-grid.six .kv-item:nth-child(4) { padding-left: 0; border-left: 0; }
  .change { grid-template-columns: minmax(0, 1fr) auto; }
  .change-where { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 760px) {
  .viewer-login { display: none; }
  .theme-toggle button { width: 24px; }
  .kv-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-grid.six .kv-item:nth-child(odd) { padding-left: 0; border-left: 0; }
  .kv-grid.six .kv-item:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--divider); }
  .kv-grid.five .kv-item:last-child { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
  .change { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px 16px; }
  .cl-row { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 2px; }
  .cl-message { grid-column: 1 / -1; grid-row: 2; }
  .cl-author { max-width: none; }
  .change-actions { justify-content: flex-start; }
  .mini-label { display: none; }
  .mini-stage { padding: 0 6px; }
  .mini-stage.current .mini-label { display: inline; }
  .team-meta { padding: 0 16px 10px; }
  .run-detail-foot { justify-content: flex-start; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

.review-tabs { display: flex; flex-wrap: wrap; column-gap: 20px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.review-tab { margin-bottom: -1px; padding: 6px 2px 8px; font-weight: 700; color: var(--text-2); white-space: nowrap; border-bottom: 3px solid transparent; }
.review-tab:hover { color: rgb(var(--link)); }
.review-tab.active { color: rgb(var(--accent-ui)); border-bottom-color: rgb(var(--accent-ui)); }
.review-count { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.review-tab.active .review-count { color: rgb(var(--accent-ui)); }
.review-tab:focus-visible, .review-chip:focus-visible { outline: 2px solid rgb(var(--link)); outline-offset: 2px; }

.review-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.review-lists { display: flex; flex-wrap: wrap; gap: 6px; }
.review-chip, .team-picker .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  font: 700 13px/1 var(--font);
  white-space: nowrap;
  border-radius: 999px;
}
.review-chip { color: var(--text-2); background: var(--surface); border: 1.5px solid var(--border-input); }
.review-chip:hover { color: rgb(var(--link)); border-color: rgb(var(--link)); }
.review-chip.active { color: #fff; background: var(--brand-gradient); border-color: transparent; }
.review-chip .review-count { color: inherit; opacity: 0.85; }
.team-picker { position: relative; margin-left: auto; }
.team-picker .button .icon { transform: rotate(90deg); }
.team-picker .button[aria-expanded="true"] .icon { transform: rotate(-90deg); }
.team-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 6;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.team-menu[hidden] { display: none; }
.team-option { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 10px; border-radius: 8px; cursor: pointer; }
.team-option:hover { background: var(--surface-hover); }
.team-option input { width: 15px; height: 15px; margin: 0; accent-color: rgb(var(--accent-ui)); }

.pr-list { container-type: inline-size; margin: 0; padding: 0; list-style: none; }
.pr-row, .approval-row {
  display: grid;
  align-items: center;
  column-gap: 12px;
  height: 36px;
  padding: 0 20px;
  border-top: 1px solid var(--divider);
}
.pr-row:first-child, .approval-row:first-child { border-top: 0; }
.pr-row:hover, .approval-row:hover { background: var(--surface-hover); }
.pr-row {
  grid-template-columns: clamp(120px, 16%, 190px) minmax(0, 1fr) clamp(120px, 17%, 196px) clamp(140px, 17%, 190px);
  grid-template-areas: "repo title flags meta";
}
.approval-row {
  grid-template-columns: clamp(120px, 16%, 190px) minmax(0, 1fr) clamp(96px, 12%, 150px) clamp(160px, 19%, 230px) 88px;
  grid-template-areas: "repo title environments meta action";
}
.pr-repo { grid-area: repo; min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.pr-title { grid-area: title; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-flags { grid-area: flags; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.pr-flags .draft-tag { flex-shrink: 0; margin-left: auto; }
.approval-environments { grid-area: environments; display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.approval-environments .owner { flex-shrink: 0; }
.pr-meta { grid-area: meta; display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.pr-author { display: flex; flex: 1 1 0; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.pr-author span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pr-age { flex: none; width: 56px; text-align: right; }
.pr-age.waited { width: 76px; text-align: left; }
.approval-action { grid-area: action; display: flex; justify-content: flex-end; }
.pr-capped { margin: 0; padding: 8px 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--divider); }
.review-more { display: flex; justify-content: center; padding: 8px 20px; border-top: 1px solid var(--divider); }

@container (max-width: 999px) {
  .pr-row, .approval-row { column-gap: 10px; }
  .pr-row { grid-template-columns: clamp(110px, 15%, 190px) minmax(0, 1fr) clamp(110px, 17%, 196px) clamp(130px, 17%, 190px); }
  .approval-row { grid-template-columns: clamp(110px, 15%, 190px) minmax(0, 1fr) clamp(84px, 11%, 150px) clamp(150px, 17%, 230px) 88px; }
}

@container (max-width: 699px) {
  .pr-row, .approval-row { height: auto; padding: 8px 16px; row-gap: 3px; column-gap: 10px; }
  .pr-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title flags" "repo meta"; }
  .approval-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "title title action" "repo environments meta"; }
  .pr-flags { max-width: 60cqw; }
  .approval-environments { max-width: 40cqw; }
  .pr-author { flex: 0 1 auto; max-width: 28cqw; }
  .pr-age, .pr-age.waited { width: auto; }
  .pr-capped, .review-more { padding: 8px 16px; }
}

/* The pull request page. The diffs-container custom element reads the --diffs-* variables through its shadow root, so the diff follows the page's own light and dark theme. */
.pull-page {
  --diffs-font-family: var(--mono);
  --diffs-font-size: 12.5px;
  --diffs-line-height: 20px;
  --diffs-fg: var(--text);
  --diffs-bg: var(--surface);
  --diffs-foreground: var(--text);
  --diffs-background: var(--surface);
  --diffs-token-comment: var(--muted);
  --diffs-token-keyword: rgb(var(--accent-ui));
  --diffs-token-string: rgb(var(--ok));
  --diffs-token-string-expression: rgb(var(--ok));
  --diffs-token-constant: rgb(var(--wait));
  --diffs-token-function: rgb(var(--run));
  --diffs-token-parameter: var(--text-2);
  --diffs-token-punctuation: var(--muted);
  --diffs-token-link: rgb(var(--link));
  --diffs-addition-color-override: rgb(var(--ok));
  --diffs-deletion-color-override: rgb(var(--bad));
  --diffs-modified-color-override: rgb(var(--run));
  --diffs-bg-addition-override: rgb(var(--ok) / 0.12);
  --diffs-bg-addition-emphasis-override: rgb(var(--ok) / 0.3);
  --diffs-bg-deletion-override: rgb(var(--bad) / 0.12);
  --diffs-bg-deletion-emphasis-override: rgb(var(--bad) / 0.3);
  --diffs-bg-context-override: var(--surface);
  --diffs-bg-separator-override: var(--surface-2);
  --diffs-bg-buffer-override: var(--surface-2);
  display: block;
}
.pull-page diffs-container { color-scheme: inherit; }
.pull-head { margin-bottom: 12px; }
.pull-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.pull-title { margin: 0; min-width: 0; font: 500 24px/30px var(--display); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.pull-number { font-weight: 400; color: var(--muted); }
.pull-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; font-size: 13px; color: var(--text-2); }
.pull-author { display: inline-flex; align-items: center; gap: 6px; }
.pull-branches { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pull-add { color: rgb(var(--ok)); }
.pull-del { color: rgb(var(--bad)); }
.pull-updated { color: var(--muted); }
.pull-state[data-state="merged"] { color: rgb(var(--accent-ui)); border-color: rgb(var(--accent-ui) / 0.35); background: rgb(var(--accent-ui) / 0.08); }
.pull-notice { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; font-size: 13px; background: rgb(var(--wait) / 0.1); border: 1px solid rgb(var(--wait) / 0.45); border-radius: 8px; }
.pull-notice .icon { color: rgb(var(--wait)); }
.pull-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.pull-files { position: sticky; top: 68px; max-height: calc(100vh - 84px); overflow: auto; padding: 10px 0; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.pull-files-title { margin: 0; padding: 0 14px 6px; font-size: 14px; font-weight: 700; }
.pull-files-title .counter { font-size: 14px; }
.pull-file-list { margin: 0; padding: 0; list-style: none; }
.pull-file { border-top: 1px solid var(--divider); }
.pull-file-main { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; align-items: center; gap: 6px; width: 100%; min-height: 30px; padding: 3px 14px 3px 10px; font: 400 12.5px/18px var(--font); text-align: left; color: var(--text); background: none; border: 0; }
button.pull-file-main { cursor: pointer; }
button.pull-file-main:hover { background: var(--surface-hover); }
button.pull-file-main:focus-visible { outline: 2px solid rgb(var(--link)); outline-offset: -2px; }
.pull-file-path { display: flex; min-width: 0; white-space: nowrap; }
.pull-file-dir { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.pull-file-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.pull-file-was { grid-column: 2 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; }
.pull-file-counts { font-size: 11.5px; white-space: nowrap; }
.pull-viewed { display: inline-grid; place-items: center; width: 16px; height: 16px; color: rgb(var(--ok)); }
.pull-viewed .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.pull-kind { padding: 0 6px; font-size: 10.5px; font-weight: 700; line-height: 16px; text-transform: uppercase; letter-spacing: 0.02em; color: rgb(var(--c, var(--idle))); background: rgb(var(--c, var(--idle)) / 0.12); border-radius: 4px; }
.pull-kind[data-kind="added"] { --c: var(--ok); }
.pull-kind[data-kind="deleted"] { --c: var(--bad); }
.pull-kind[data-kind="renamed"] { --c: var(--wait); }
.pull-kind[data-kind="modified"] { --c: var(--run); }
.pull-file.not-shown .pull-file-main { padding-bottom: 0; }
.pull-file-note { display: block; padding: 0 14px 6px 32px; font-size: 12px; color: var(--muted); }
.pull-main { min-width: 0; }
.pull-toolbar { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.pull-style { display: inline-flex; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; }
.pull-style-choice { padding: 2px 12px; font: 500 12px/20px var(--font); color: var(--text-2); background: var(--surface); border: 0; cursor: pointer; }
.pull-style-choice + .pull-style-choice { border-left: 1px solid var(--border); }
.pull-style-choice[aria-pressed="true"] { color: var(--text); background: rgb(var(--accent-ui) / 0.16); }
/* The top bar is 52px, the toolbar 32px with its margin, and the page leaves 16px around the panes: scrolled to its end, the page shows the diff area whole, 68px below the top and 16px above the bottom. */
main:has(.pull-page) { padding-bottom: 16px; }
.pull-scroll { height: calc(100vh - 116px); min-height: 360px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.pull-annotation { margin: 4px 8px; color: var(--text); font: 400 13px/18px var(--font); white-space: normal; }
.pull-thread { margin: 4px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.pull-thread summary { display: flex; align-items: center; gap: 8px; padding: 4px 10px; cursor: pointer; list-style: none; }
.pull-thread summary::-webkit-details-marker { display: none; }
.pull-resolved { padding: 0 7px; font-size: 11px; font-weight: 600; line-height: 18px; color: rgb(var(--ok)); background: rgb(var(--ok) / 0.1); border-radius: 999px; }
.pull-preview { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.pull-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pull-comment { padding: 6px 10px; border-top: 1px solid var(--divider); }
.pull-thread > .pull-comment:first-child { border-top: 0; }
.pull-comment-head { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.pull-comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.pull-outdated { margin: 4px 0; }
.pull-outdated-title { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.pull-outdated-title .counter { font-size: 13px; }
.pull-outdated-place { color: var(--muted); }
.pull-hunk { margin: 2px 0 4px; padding: 4px 0; overflow: auto; background: var(--surface); border: 1px solid var(--divider); border-radius: 6px; font-size: 12px; line-height: 18px; }
.pull-hunk-line { display: block; padding: 0 10px; white-space: pre; }
.pull-hunk-line[data-change="add"] { background: rgb(var(--ok) / 0.12); }
.pull-hunk-line[data-change="del"] { background: rgb(var(--bad) / 0.12); }

@media (max-width: 899px) {
  .pull-body { grid-template-columns: minmax(0, 1fr); }
  .pull-files { position: static; max-height: 200px; }
  .pull-toolbar { display: none; }
  .pull-scroll { height: 70vh; }
}
