:root {
  color-scheme: dark;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 13px;
  color: #e9ebed;
  background: #181a1c;
  font-synthesis: none;
  --bg: #181a1c;
  --sidebar: #202225;
  --surface: #242629;
  --surface-hover: #2a2d30;
  --field: #1b1d1f;
  --border: #3a3d40;
  --text: #e9ebed;
  --muted: #a4a9ad;
  --subtle: #7f858a;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff453a;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }
::selection { background: #0a84ff; color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { border-right: 1px solid var(--border); background: var(--sidebar); padding: 24px 14px; display: flex; flex-direction: column; gap: 30px; }
.brand { display: flex; align-items: center; text-decoration: none; padding: 0 10px; min-height: 28px; }
.brand strong { font-size: 17px; font-weight: 650; letter-spacing: -.03em; }
.nav { display: grid; gap: 3px; }
.nav button { border: 0; background: transparent; color: var(--muted); text-align: left; padding: 9px 12px; border-radius: 7px; display: flex; gap: 11px; align-items: center; font-weight: 500; }
.nav button:hover { background: var(--surface-hover); color: var(--text); }
.nav button.active { background: #183656; color: #d9edff; }
.nav .glyph { font-size: 16px; width: 18px; text-align: center; line-height: 1; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding: 16px 10px 0; color: var(--subtle); font-size: 11px; line-height: 1.55; }
.sidebar-foot strong { display: block; color: var(--text); font-size: 12px; }
.main { min-width: 0; padding: 34px clamp(24px, 4vw, 64px) 72px; max-width: 1440px; width: 100%; margin: 0 auto; }
.topline, .eyebrow { color: var(--subtle); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 8px 0 26px; }
.heading h1 { font-size: 27px; line-height: 1.15; font-weight: 650; letter-spacing: -.035em; margin: 0; }
.heading p { color: var(--muted); margin: 7px 0 0; max-width: 620px; line-height: 1.45; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { border: 1px solid #50555a; border-radius: 7px; background: #303337; color: var(--text); padding: 9px 13px; font-weight: 600; line-height: 1.2; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: #3a3e42; text-decoration: none; }
.btn:active { background: #4a4f54; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: #ffc6c2; border-color: #77413f; background: #3c2827; }
.btn.quiet { background: transparent; border-color: var(--border); color: var(--muted); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 11px; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 650; white-space: nowrap; }
.section-head span { color: var(--subtle); font-size: 11px; }
.surface { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { padding: 16px 18px; min-height: 91px; }
.metric strong { display: block; font-size: 27px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 5px; }
.metric span { font-size: 12px; color: var(--muted); }
.list { display: grid; gap: 5px; }
.row { padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.row:hover { background: var(--surface-hover); }
.row-title { display: flex; gap: 9px; align-items: center; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.row-title .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--muted); font-size: 11px; display: flex; gap: 9px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; display: inline-block; }
.dot.github { background: #838ecf; }
.dot.gitlab { background: #f0a777; }
.status { font-size: 12px; font-weight: 600; color: var(--success); white-space: nowrap; }
.status.failed, .status.needs_confirmation { color: var(--danger); }
.status.pending, .status.waiting_source, .status.waiting_target, .status.waiting_promotion, .status.waiting_prod { color: var(--warning); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.field { width: 100%; border: 1px solid #50555a; border-radius: 7px; background: var(--field); color: var(--text); padding: 9px 11px; outline: none; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #0a84ff28; }
.toolbar .field { max-width: 300px; }
.toolbar select.field { max-width: 170px; }
.empty { border: 1px dashed #50555a; border-radius: 10px; padding: 28px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 5px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 14px; }
.pad { padding: 20px; }
.pad h2 { font-size: 16px; font-weight: 650; margin: 0 0 16px; }
.pad h3 { font-size: 13px; font-weight: 650; margin: 23px 0 10px; }
.facts { display: grid; grid-template-columns: 100px 1fr; gap: 11px 14px; font-size: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.route-card { margin-bottom: 14px; }
.timeline { display: flex; align-items: center; margin: 23px 0 12px; gap: 0; }
.station { flex: 1; position: relative; color: var(--subtle); font-size: 10px; }
.station:before { content: ''; display: block; width: 13px; height: 13px; border: 2px solid #747a80; border-radius: 50%; background: var(--surface); margin-bottom: 7px; position: relative; z-index: 2; }
.station:not(:last-child):after { content: ''; position: absolute; top: 7px; left: 15px; right: 0; height: 2px; background: #656a6e; }
.station.done:before, .station.current:before { background: var(--accent); border-color: var(--accent); }
.station.done:after { background: var(--accent); }
.station.current { color: var(--text); }
.station.current:before { box-shadow: 0 0 0 5px #0a84ff25; }
.event { border-top: 1px solid var(--border); padding: 12px 0; display: flex; gap: 16px; line-height: 1.45; font-size: 12px; }
.event time { color: var(--subtle); white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
.file { border-top: 1px solid var(--border); padding: 11px 0; font-size: 12px; word-break: break-all; }
.file summary { cursor: pointer; color: var(--text); }
.file pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--field); padding: 12px; border-radius: 7px; color: var(--muted); max-height: 340px; overflow: auto; }
.notice { padding: 12px 14px; border: 1px solid #725936; border-radius: 7px; background: #352c21; color: #f2d7ac; margin: 12px 0; font-size: 12px; }
.notice.error { background: #3b2525; border-color: #79413f; color: #ffd0cc; }
.subtle { color: var(--muted); font-size: 12px; }
.stack { display: grid; gap: 10px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .field { flex: 1; }
.preview-list { max-height: 220px; overflow: auto; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.preview-list li { margin: 7px 0; color: var(--muted); font-size: 12px; }
.banner { background: #1c2d3e; border: 1px solid #375b7b; border-radius: 7px; padding: 13px 15px; margin: 16px 0; color: #cce4ff; font-size: 12px; }
.link { color: #65b4ff; text-decoration: none; }
.link:hover { text-decoration: underline; }
.visually-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Sign-in and temporary unavailable state. */
.auth-shell { min-height: 100vh; background: var(--bg); }
.auth-topbar { height: 58px; padding: 0 clamp(20px, 4vw, 54px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.auth-wordmark { font-size: 17px; font-weight: 650; letter-spacing: -.03em; }
.auth-topnote { color: var(--subtle); font-size: 12px; }
.auth-main { max-width: 1000px; margin: 0 auto; padding: 62px 26px 80px; }
.auth-heading { max-width: 630px; margin-bottom: 34px; }
.auth-kicker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .03em; margin-bottom: 12px; }
.auth-heading h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.035em; font-weight: 650; margin: 0 0 10px; }
.auth-heading p { color: var(--muted); line-height: 1.5; margin: 0; font-size: 14px; }
.auth-form { max-width: 480px; border-top: 1px solid var(--border); padding-top: 22px; }
.auth-form label { display: block; font-weight: 600; margin-bottom: 8px; }
.optional { color: var(--subtle); font-weight: 400; }
.auth-provider-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 17px; }
.auth-footnote { color: var(--subtle); font-size: 11px; margin: 15px 0 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; gap: 10px; align-items: center; padding: 10px 18px; position: sticky; top: 0; z-index: 10; }
  .sidebar .brand { margin-right: auto; }
  .sidebar-foot { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav button { font-size: 0; padding: 10px; }
  .nav .glyph { font-size: 18px; }
  .main { padding: 28px 20px 60px; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .auth-main { padding: 40px 20px 60px; }
  .auth-heading h1 { font-size: 27px; }
}
@media (max-width: 600px) {
  .heading { align-items: start; flex-direction: column; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .metric:last-child { grid-column: span 2; }
  .row { padding: 13px; }
  .row-title { font-size: 12px; }
  .row .btn { padding: 6px 8px; font-size: 11px; }
  .facts { grid-template-columns: 78px 1fr; }
  .timeline { overflow-x: auto; padding: 4px 0 12px; }
  .timeline .station { flex: 0 0 82px; }
}
@media (prefers-reduced-motion: no-preference) {
  .station.current:before { animation: pulse 2s infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 9px #0a84ff12; } }
}
