:root {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #fafafa;
  --band: #ececec;
  --ink: #0a0a0a;
  --text: #262626;
  --muted: #737373;
  --faint: #a3a3a3;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
  --hover: #f4f4f5;
  --active: #ebebeb;
  --accent: #2456d6;
  --good: #3d7a2a;
  --good-bg: #edf6e9;
  --warn: #92560c;
  --warn-bg: #fcf3e2;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --info: #3b55c6;
  --info-bg: #eef1fd;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-width: 260px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 18px 0 6px; }
h4 { font-size: 14px; margin: 16px 0 4px; }
p { max-width: 760px; }
code {
  font: 12.5px/1.6 var(--mono);
  overflow-wrap: anywhere;
  background: var(--hover);
  padding: 1px 5px;
}
pre {
  font: 12px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--sidebar);
  border: 1px solid var(--line);
  padding: 14px 16px;
  max-height: 420px;
  overflow: auto;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Controls */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 500; line-height: 20px;
  cursor: pointer;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 7px 14px;
  text-decoration: none;
  white-space: nowrap;
}
button:hover, .button:hover { background: var(--hover); text-decoration: none; }
button:disabled { opacity: 0.5; cursor: wait; }
button .i, .button .i { width: 16px; height: 16px; }
.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.primary:hover { background: #262626; }
.block { width: 100%; padding: 11px 16px; }
.quiet { border-color: transparent; background: none; color: var(--muted); }
.quiet:hover { color: var(--ink); background: var(--hover); }
.icon-button {
  border-color: transparent; background: none; color: var(--muted);
  padding: 6px; border-radius: 4px;
}
.icon-button:hover { color: var(--ink); background: var(--active); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input, select {
  display: block; width: 100%; min-width: 0;
  font: inherit; color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 8px 11px;
  line-height: 20px;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: var(--ink); outline: none; }
select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 16px;
}
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
summary { cursor: pointer; color: var(--muted); }
summary:hover { color: var(--ink); }
form { display: flex; align-items: end; gap: 12px; margin: 18px 0 0; }

/* Type helpers */
.eyebrow, .mono-label {
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.mono-small { font: 11px/1.45 var(--mono); color: var(--muted); letter-spacing: 0.02em; }
.display {
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 500;
  color: var(--ink);
  margin: 12px 0 28px;
}
.muted { color: var(--muted); font-size: 13px; }
.footnote { color: var(--muted); font-size: 12px; margin: 28px 0 0; max-width: 820px; }
.intro { margin: 0 0 6px; }
.status-line { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

/* Brand */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .i { width: 22px; height: 22px; }

/* App shell */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0;
  width: var(--sidebar-width); height: 100vh; flex: none;
  display: flex; flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 14px 10px 12px;
  transition: width 0.15s ease;
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 22px 10px;
}
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font-size: 14.5px;
  text-decoration: none;
  white-space: nowrap;
}
.sidebar nav a .i { color: var(--muted); }
.sidebar nav a:hover { background: var(--hover); }
.sidebar nav a[aria-current] { background: var(--active); color: var(--ink); }
.sidebar nav a[aria-current] .i { color: var(--ink); }
.nav-label {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint);
  margin: 22px 10px 8px;
}
.account {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 6px 4px 8px;
  border-top: 1px solid var(--line);
}
#user-button:empty { display: none; }
#user-button:not(:empty) + .avatar { display: none; }
.avatar {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 600;
}
.account-text { min-width: 0; flex: 1; display: grid; line-height: 1.3; }
.account-text strong { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text small { color: var(--muted); font-size: 12px; }

/* Collapsed sidebar */
.app.collapsed .sidebar { width: 64px; }
.app.collapsed .sidebar nav a span,
.app.collapsed .nav-label,
.app.collapsed .brand span,
.app.collapsed .account-text { display: none; }
.app.collapsed .sidebar-head { flex-direction: column; gap: 14px; padding: 4px 0 18px; }
.app.collapsed .sidebar nav a { justify-content: center; padding: 9px 0; }
.app.collapsed .account { flex-direction: column; padding: 10px 0 4px; }
.app.collapsed #sidebar-toggle .i { transform: scaleX(-1); }

.mobile-bar { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 10, 0.28); z-index: 30; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { flex: 1; }
.page-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  min-height: 60px;
  padding: 10px 32px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.page-bar > .i { color: var(--muted); width: 16px; height: 16px; }
.page-bar h1 { font-size: 15px; font-weight: 500; margin: 0; letter-spacing: 0; }
.page-hint { color: var(--muted); font-size: 14px; margin-left: 6px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.page-body { padding: 28px 32px 48px; }
.page-body.narrow { max-width: 920px; }
#notice {
  margin: 16px 32px 0;
  padding: 11px 16px;
  background: var(--info-bg);
  border: 1px solid #d8def9;
  color: var(--ink);
  font-size: 13.5px;
}
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: 36px 0 14px;
}
.block-head h2 { margin: 0; }
.block-head a { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; }
.block-head a .i { width: 14px; height: 14px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards and callouts */
.card { border: 1px solid var(--line); background: var(--bg); padding: 22px 24px; margin: 0 0 20px; }
.card > h2 { margin-bottom: 4px; }
.card > p.muted:first-of-type { margin-top: 0; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--ink); background: var(--sidebar); padding: 16px 20px; margin: 16px 0 20px; }
.callout h3 { margin-top: 0; }
.command {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line-strong);
  background: var(--sidebar);
  padding: 8px 8px 8px 14px;
  margin: 12px 0;
}
.command code { background: none; padding: 0; font-size: 13px; color: var(--ink); }

/* Empty states */
.empty { border: 1px dashed var(--line-strong); padding: 44px 28px; text-align: center; margin: 8px 0 20px; }
.empty p { margin: 8px auto 18px; color: var(--muted); max-width: 520px; }
.empty h2 { margin: 10px 0 0; }
.empty-icon { width: 28px; height: 28px; color: var(--faint); }

/* Overview */
.hero {
  display: grid; grid-template-columns: minmax(280px, 0.9fr) 1.6fr;
  background: var(--band);
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
}
.hero-copy { padding: 36px 32px 34px; }
.hero .button { margin-top: 4px; }
.spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 1px solid rgba(0, 0, 0, 0.12); }
.spec {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 28px 22px;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.35);
}
.spec:last-child { border-right: 0; }
.spec strong { font: 600 clamp(22px, 2.3vw, 30px)/1 var(--mono); letter-spacing: -0.02em; color: var(--ink); margin-top: 8px; }
.spec-mark { position: absolute; right: 16px; bottom: 16px; width: 16px; height: 16px; color: var(--muted); }
.ticks {
  height: 10px; margin-top: auto;
  background: repeating-linear-gradient(to right, var(--ink) 0 1px, transparent 1px 6px);
  opacity: 0.55;
}
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; border-bottom: 1px solid var(--line); }
.overview-main { padding: 6px 32px 40px; min-width: 0; }
.overview-side { border-left: 1px solid var(--line); }
.side-block { padding: 6px 24px 22px; border-bottom: 1px solid var(--line); }
.side-block .block-head { margin-top: 30px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; }
.tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 24px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.tile + .tile { border-left: 1px solid var(--line); }
.tile .i { color: var(--accent); width: 22px; height: 22px; margin-bottom: 8px; }
.tile small { color: var(--muted); font-size: 12.5px; }
.tile:hover { background: var(--sidebar); text-decoration: none; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.metric { padding: 18px 20px; border-right: 1px solid var(--line); min-width: 0; }
.metric:last-child { border-right: 0; }
.metric h2 { font-size: 13px; color: var(--muted); font-weight: 400; margin: 0 0 12px; letter-spacing: 0; }
.metric strong {
  display: block;
  font-size: 26px; font-weight: 400; line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.metric strong + span { display: block; margin-bottom: 10px; }
.metric span { font-size: 12px; color: var(--muted); }
.metric p { margin: 6px 0 0; font-size: 12px; }
#aggregate-note { margin: 10px 0 0; font-size: 12px; }
.recent { border-top: 1px solid var(--line); }
.recent-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center;
  width: 100%;
  padding: 13px 4px;
  border: 0; border-bottom: 1px solid var(--line);
  background: none;
  text-align: left; font-weight: 400;
  white-space: normal;
}
.recent-row:hover { background: var(--sidebar); }
.recent-row strong { font-weight: 500; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-row small { color: var(--muted); font-size: 12px; }
.recent-row .num { font-variant-numeric: tabular-nums; }
.recent-empty { color: var(--muted); padding: 18px 0; margin: 0; }

/* Tables */
.filters { display: grid; grid-template-columns: minmax(220px, 320px) 180px 220px; gap: 10px; margin: 0 0 18px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th {
  color: var(--muted); font-size: 12.5px; font-weight: 400;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--sidebar); }
td button {
  border: 0; padding: 0; background: none;
  font-weight: 500; text-align: left; white-space: normal;
  color: var(--ink);
}
td button:hover { background: none; text-decoration: underline; }
td small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.data-table td:nth-child(2), .data-table td:nth-child(3) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td:last-child { color: var(--muted); white-space: nowrap; }
#load-more { margin-top: 16px; }

/* Badges */
.badge {
  display: inline-block;
  font-size: 12px; line-height: 18px;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--hover); color: var(--muted);
  white-space: nowrap;
}
.badge::first-letter { text-transform: uppercase; }
td small.badge { display: inline-block; margin-top: 5px; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }

/* Drawers */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: min(560px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(10, 10, 10, 0.1);
  display: flex; flex-direction: column;
  animation: drawer-in 0.16s ease-out;
}
.drawer.wide { width: min(880px, 100vw); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head {
  position: relative;
  padding: 20px 56px 18px 28px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 20px; margin: 6px 0 0; overflow-wrap: anywhere; }
.drawer-head .icon-button { position: absolute; top: 14px; right: 14px; }
.drawer-body { padding: 8px 28px 40px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.drawer-body dl {
  display: grid; grid-template-columns: 170px 1fr;
  margin: 12px 0 0;
  border-top: 1px solid var(--line);
}
.drawer-body dt, .drawer-body dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.drawer-body section, .drawer-body article { border: 1px solid var(--line); padding: 16px 18px; }
.drawer-body section h2, .drawer-body section h3, .drawer-body article h3 { margin-top: 0; }
.drawer-body article > a { font-weight: 500; }
.drawer-body article h3 { margin: 8px 0 4px; }
.drawer-body p { margin: 6px 0; }
.drawer-body details { border-top: 1px solid var(--line); padding-top: 12px; }
.drawer-body details[open] summary { margin-bottom: 10px; }

/* Repositories */
.list { border-top: 1px solid var(--line); }
#repository-list:empty { border-top: 0; }
#repository-list article {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
#repository-list article > div { grid-row: span 3; }
#repository-list article h2 { font-size: 15px; margin: 0 0 2px; }
#repository-list article p { margin: 2px 0; font-size: 13px; }
#repository-list article > button { justify-self: end; min-width: 190px; }
#backfill-progress { margin: 8px 0 24px; border-left: 3px solid var(--accent); }
#backfill-progress h2 { margin: 0; }
#backfill-progress h3 { font-size: 16px; margin: 18px 0 0; }
.job-status { font-size: 12.5px; font-weight: 500; color: var(--info); }
.backfill-run + .backfill-run { border-top: 1px solid var(--line); margin-top: 22px; }
.backfill-phases {
  list-style: none;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
  padding: 0; margin: 18px 0;
}
.backfill-phases li {
  border-top: 3px solid var(--line);
  padding-top: 10px;
  display: flex; gap: 7px; align-items: baseline;
  font-size: 12px; color: var(--muted);
}
.backfill-phases .done, .backfill-phases .current { border-color: var(--accent); color: var(--accent); }
.backfill-phases .current { font-weight: 600; }
.phase-marker { font: 11px var(--mono); font-variant-numeric: tabular-nums; }
.phase-description { margin: 16px 0; }
.backfill-times { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 13px; }
.backfill-times dd { margin-right: 18px; }
progress { width: 100%; height: 6px; accent-color: var(--accent); }
.progress-warning { color: var(--warn); font-size: 13px; }
.backfill-history { padding: 14px 0; border-bottom: 1px solid var(--line); }
.backfill-history p { margin: 6px 0; font-size: 13px; }
.backfill-history .section-heading { align-items: baseline; }
.backfill-history strong { font-weight: 500; color: var(--ink); }
.backfill-history > button { margin-top: 6px; }
#backfill-connection { margin: 4px 0 0; }

/* Settings */
.provider-fields { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 16px; width: 100%; }
#provider-form { flex-direction: column; align-items: stretch; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
#new-token label { flex: 1; }
#new-token label:nth-child(2) { flex: 0 0 150px; }
#token-list article {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
#token-list p { margin: 0; color: var(--ink); font-weight: 500; }
#token-list small { font-size: 12px; }
#token-secret { display: block; }
.api-reference { margin-top: 28px; }
.api-reference summary { color: var(--ink); font-weight: 500; }
.api-reference dl { display: grid; grid-template-columns: max-content 1fr; gap: 0 24px; border-top: 1px solid var(--line); }
.api-reference dt, .api-reference dd { padding: 10px 0; border-bottom: 1px solid var(--line); }
.api-reference dt { font: 12.5px/1.6 var(--mono); color: var(--ink); }

/* Sign-in */
.auth { display: grid; grid-template-columns: minmax(360px, 520px) 1fr; min-height: 100vh; }
.auth-panel { display: flex; flex-direction: column; padding: 32px 48px; border-right: 1px solid var(--line); }
.auth-form { margin: auto 0; padding: 48px 0; max-width: 400px; }
.auth-form h1 { font-size: 34px; letter-spacing: -0.03em; margin: 10px 0 10px; }
.lede { color: var(--muted); margin: 0 0 28px; }
.auth-form details { margin-top: 28px; }
.auth-form form { flex-wrap: wrap; }
.auth-form form label { flex: 1; }
#auth-status { color: var(--muted); font-size: 13px; }
.auth-foot { font-size: 12px; margin: 0; }
.auth-art {
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--band);
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.spec-hero { padding: 56px 48px; }
.spec-hero .display { font-size: clamp(44px, 6vw, 88px); }
.auth-art .spec-grid { border-left: 0; border-top: 1px solid rgba(0, 0, 0, 0.12); }
.auth-art .spec { min-height: 220px; }
.auth-center { grid-template-columns: 1fr; place-items: center; background: var(--sidebar); padding: 24px; }
.connect-card { width: min(460px, 100%); background: var(--bg); border: 1px solid var(--line); padding: 32px; }
.connect-card .brand { margin-bottom: 36px; }
.connect-card h1 { font-size: 28px; margin: 8px 0 12px; letter-spacing: -0.02em; }
.device-code-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--line); background: var(--sidebar);
  padding: 14px 16px; color: var(--muted); font-size: 13px;
}
#device-code { font: 600 22px/1 var(--mono); letter-spacing: 0.22em; color: var(--ink); }
#device-status { font-size: 13px; }

/* Responsive */
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .hero .spec-grid { border-left: 0; border-top: 1px solid rgba(0, 0, 0, 0.12); }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-side { border-left: 0; border-top: 1px solid var(--line); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { border-right: 0; padding: 24px; }
}
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .mobile-bar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--sidebar);
    border-bottom: 1px solid var(--line);
  }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 35;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: 12px 0 40px rgba(10, 10, 10, 0.12);
  }
  .app.nav-open .sidebar { transform: none; }
  #sidebar-toggle { display: none; }
  .app.collapsed .sidebar { width: var(--sidebar-width); }
  .app.collapsed .sidebar nav a span, .app.collapsed .nav-label, .app.collapsed .brand span, .app.collapsed .account-text { display: revert; }
  .app.collapsed .sidebar nav a { justify-content: start; padding: 8px 10px; }
  .page-bar { position: static; padding: 12px 16px; flex-wrap: wrap; }
  .page-hint { display: none; }
  .page-actions { margin-left: 0; width: 100%; justify-content: start; }
  .page-body { padding: 20px 16px 40px; }
  #notice { margin: 12px 16px 0; }
  .hero-copy, .overview-main, .side-block { padding-left: 16px; padding-right: 16px; }
  .spec-grid { grid-template-columns: 1fr; }
  .spec { border-right: 0; border-bottom: 1px solid rgba(0, 0, 0, 0.12); padding: 18px 16px; }
  .spec-mark, .ticks { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
  .provider-fields { grid-template-columns: 1fr; }
  form { flex-wrap: wrap; }
  #new-token label, #new-token label:nth-child(2) { flex: 1 1 100%; }
  #repository-list article { grid-template-columns: 1fr; }
  #repository-list article > div { grid-row: auto; }
  #repository-list article > button { justify-self: start; }
  .recent-row { grid-template-columns: minmax(0, 1fr) auto; }
  .recent-row > :nth-child(3) { display: none; }
  .drawer-body dl { grid-template-columns: 1fr; }
  .drawer-body dt { border-bottom: 0; padding-bottom: 0; }
  .backfill-phases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .backfill-times { display: grid; grid-template-columns: 1fr 1fr; }
  .backfill-times dd { margin: 0; }
  .backfill-history .section-heading, .backfill-run .section-heading { align-items: start; flex-direction: column; gap: 4px; }
  .backfill-run h3 { overflow-wrap: anywhere; }
}

.economics-controls{display:flex;gap:.6rem;flex-wrap:wrap;margin:1rem 0}.economics-controls select{width:auto;min-width:9rem}.economics-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin:1rem 0}.economics-metrics>div{display:flex;flex-direction:column;gap:.4rem}.economics-metrics strong{font-size:1.6rem}.economics-cost{color:#dc2626}.economics-value{color:#16a34a}.economics-chart svg{display:block;width:100%;max-height:320px}.economics-pr{padding:1rem 0;border-top:1px solid #94a3b855}.economics-pr>div:first-child{display:flex;justify-content:space-between;gap:1rem}.economics-pr details{margin:.8rem 0}.economics-pr form{margin:1rem 0}.economics-status{padding:.6rem;border-left:3px solid #d97706}@media(max-width:600px){.economics-metrics{grid-template-columns:1fr}.economics-pr>div:first-child{display:block}}
/* BugDrop stays outside workspace navigation, reachable by mouse, touch and keyboard. */
#bugdrop-tray{position:fixed;right:16px;bottom:16px;z-index:45}
#bug-tickets{display:grid;place-items:center;width:48px;height:48px;padding:0;border-radius:50%;background:var(--bg);box-shadow:0 4px 20px rgba(10,10,10,.15)}
#bugdrop-reports{position:absolute;right:0;bottom:56px;width:min(380px,calc(100vw - 32px));max-height:calc(100dvh - 104px);overflow:auto;padding:18px;background:var(--bg);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 32px rgba(10,10,10,.15);overflow-wrap:anywhere}
#bugdrop-reports h2{margin:0;font-size:18px}
#bugdrop-status{font-size:12px}
#bugdrop-ticket-list article{border-top:1px solid var(--line);padding:12px 0}
#bugdrop-ticket-list p{margin:6px 0}
/* Repository page */
.crumb { color: var(--muted); font-size: 15px; }
.crumb:hover { color: var(--ink); }
.crumb-sep { color: var(--faint); }
.repo-page { padding-top: 24px; }
.repo-stats { margin-bottom: 12px; }
.repo-meta { margin: 0 0 22px; font-size: 12.5px; max-width: none; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab {
  border: 0; border-bottom: 2px solid transparent; background: none;
  padding: 10px 0; margin-bottom: -1px;
  color: var(--muted); font-weight: 500;
}
.tab:hover { background: none; color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab-panel .callout { max-width: none; margin-top: 0; }
.provenance { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 14px; }
.provenance p { font-size: 12.5px; margin: 6px 0; }

.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.map-toolbar input { width: 260px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-left: auto; }
.legend-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.legend-title { color: var(--text); font-weight: 500; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.legend-item i.size { border: 1.5px solid var(--muted); background: none; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; border: 1px solid var(--line); min-height: 560px; }
.graph-wrap {
  position: relative; overflow: hidden;
  background-color: var(--sidebar);
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.07) 1px, transparent 1px);
  background-size: 18px 18px;
}
.graph { display: block; width: 100%; height: 100%; min-height: 560px; cursor: grab; touch-action: none; }
.graph:active { cursor: grabbing; }
.graph .edges line { stroke: #8f8f8f; }
.graph .edges line.dim { stroke-opacity: 0.05; }
.graph .nodes circle { stroke: #fff; stroke-width: 2; cursor: pointer; transition: opacity 0.12s ease; }
.graph .nodes circle:hover { stroke: var(--ink); }
.graph .nodes circle.negative { stroke: var(--bad); stroke-dasharray: 3 2; }
.graph .nodes circle.dim { opacity: 0.16; }
.graph .nodes circle.selected { stroke: var(--ink); stroke-width: 3; }
.graph .labels text {
  display: none;
  font: 500 11px var(--sans); fill: var(--ink);
  paint-order: stroke; stroke: rgba(250, 250, 250, 0.92); stroke-width: 4px; stroke-linejoin: round;
  pointer-events: none;
}
.graph .labels text.show { display: block; }
.graph-tip {
  position: absolute; z-index: 5; pointer-events: none;
  display: grid; gap: 2px;
  max-width: 260px;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(10, 10, 10, 0.1);
  font-size: 12px; color: var(--muted);
}
.graph-tip strong { font-size: 16px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.graph-tip b { font-weight: 500; color: var(--text); margin-top: 4px; }

.map-side { border-left: 1px solid var(--line); padding: 18px 20px; overflow-y: auto; max-height: 640px; background: var(--bg); }
.map-side h3 { margin: 6px 0 8px; font-size: 16px; overflow-wrap: anywhere; }
.map-side h4 { margin: 20px 0 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.map-side dl { display: grid; grid-template-columns: 1fr; margin: 12px 0 0; border-top: 1px solid var(--line); }
.map-side dt { font-size: 12px; padding-top: 8px; }
.map-side dd { padding: 2px 0 8px; border-bottom: 1px solid var(--line); }
.map-side .muted { font-size: 12px; }
.side-head { position: relative; padding-right: 48px; }
.side-head .quiet { position: absolute; top: -4px; right: -8px; padding: 4px 8px; font-size: 12px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.side-list { border-top: 1px solid var(--line); }
.side-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  width: 100%;
  padding: 8px 2px;
  border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text);
  font-weight: 400; font-size: 13px; text-align: left; white-space: normal;
}
.side-row:hover { background: var(--sidebar); text-decoration: none; }
.side-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.side-row .num { flex: none; font-variant-numeric: tabular-nums; color: var(--ink); }
.side-row .num.muted { color: var(--muted); font-size: 12px; }

.sortable th { padding: 0; }
.sortable th button {
  width: 100%; justify-content: start;
  border: 0; background: none;
  padding: 10px 14px;
  color: var(--muted); font-size: 12.5px; font-weight: 400;
}
.sortable th button:hover { color: var(--ink); background: none; }
.sortable th[aria-sort="ascending"] button, .sortable th[aria-sort="descending"] button { color: var(--ink); }
.sortable td:first-child { display: flex; align-items: baseline; gap: 10px; font-weight: 500; color: var(--ink); white-space: normal; }
.swatch { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.sortable td:nth-child(2) { font-variant-numeric: tabular-nums; }

.range-chart { position: relative; margin: 18px 0 8px; }
.range-row { display: grid; grid-template-columns: minmax(160px, 34%) minmax(0, 1fr) 96px; gap: 16px; align-items: center; min-height: 32px; border-bottom: 1px solid var(--line); }
.range-row:hover { background: var(--sidebar); }
.range-axis, .range-scale { border-bottom: 0; color: var(--muted); font-size: 12px; min-height: 26px; }
.range-axis:hover, .range-scale:hover { background: none; }
.range-label { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.range-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-size: 13px; }
.range-track { position: relative; height: 20px; }
.range-track .zero { position: absolute; top: -6px; bottom: -6px; width: 1px; background: var(--line-strong); }
.range-track .bar { position: absolute; top: 9px; height: 2px; border-radius: 2px; background: #86b6ef; min-width: 2px; }
.range-track .dot { position: absolute; top: 4px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #1c5cab; border: 2px solid #fff; }
.range-track .dot.negative { background: var(--bad); }
.range-scale .range-track span { position: absolute; transform: translateX(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pr-list { border-top: 1px solid var(--line); }
.pr-list article { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pr-list article > a { font-weight: 500; }
.pr-list h3 { margin: 6px 0 2px; font-size: 15px; }
.pr-list p { margin: 4px 0; font-size: 13px; }

/* Capability value timeline (ADR 0006) */
.timeline-scrubber { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 16px; border: 1px solid var(--line); padding: 12px 16px; margin-bottom: 14px; background: var(--bg); }
.timeline-scrubber .mono-label { grid-column: 1 / -1; }
.scrub-controls { display: flex; gap: 6px; }
.scrub-controls button { min-width: 38px; padding: 6px 10px; font-family: var(--mono); font-size: 12px; }
.scrub-controls .scrub-play { min-width: 64px; }
.timeline-scrubber input[type="range"] { padding: 0; border: 0; accent-color: var(--ink); height: 28px; }
.scrub-label { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scrub-label strong { color: var(--ink); font-weight: 500; }
.map-toolbar .check { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); }
.map-toolbar .check input { width: auto; display: inline-block; }
.graph .absent { display: none !important; }
.graph .dependencies line { stroke: var(--ink); stroke-width: 1.2; stroke-opacity: 0.55; }
.graph .dependencies line.dim { stroke-opacity: 0.06; }
.graph marker path { fill: var(--ink); fill-opacity: 0.7; }
.graph .nodes circle.kind-enabling, .graph .nodes circle.kind-unclassified { stroke-width: 3.5; }
.graph .nodes circle.kind-unclassified { stroke-dasharray: 4 2.5; }
.graph .nodes circle.unknown-value { stroke: var(--muted); stroke-dasharray: 2 2; }
.legend-item i.ring { background: #fff; border: 2.5px solid var(--muted); }
.legend-item i.ring.dashed { border-style: dashed; }
.legend-item i.square { border-radius: 0; }
.step-changes .side-row > span:first-child { display: grid; gap: 2px; }
.step-changes small, .valuation-table small { color: var(--muted); font-size: 12px; display: block; }
.step-changes b { font-weight: 500; }
.waterfall-legend { margin: 6px 0 10px; }
.waterfall-wrap { position: relative; border: 1px solid var(--line); padding: 8px 4px 0; }
.waterfall { display: block; width: 100%; height: auto; }
.waterfall .grid { stroke: var(--line); stroke-width: 1; }
.waterfall .baseline { stroke: var(--faint); stroke-width: 1; }
.waterfall .axis { font: 11px var(--mono); fill: var(--muted); }
.waterfall .connector { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 2 2; }
.waterfall .range { stroke: var(--ink); stroke-width: 1.2; }
.waterfall .gap { opacity: 0.7; }
.waterfall .gap-mark { font: 12px var(--mono); fill: var(--muted); }
.waterfall .hit { fill: transparent; cursor: pointer; }
.waterfall .hit:hover { fill: rgba(10, 10, 10, 0.04); }
.waterfall-table, .valuation-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.waterfall-table th, .valuation-table th { text-align: left; font-weight: 400; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.waterfall-table td, .valuation-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.waterfall-table tr.negative td:nth-child(5) { color: var(--bad); }
.valuation-metrics { margin-bottom: 12px; }
.policy { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 24px 0 0; font-size: 13px; }
.policy dt { color: var(--muted); }
.policy dd { margin: 0; }

@media (max-width: 1100px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-side { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .map-legend { margin-left: 0; }
}
@media (max-width: 820px) {
  .graph { min-height: 420px; }
  .map-layout { min-height: 0; }
  .map-toolbar input { width: 100%; }
  .range-row { grid-template-columns: minmax(0, 1fr) 84px; }
  .range-row .range-track { grid-column: 1 / -1; grid-row: 2; }
  .range-scale > span:first-child, .range-axis > span:first-child { display: none; }
  .repo-meta { font-size: 12px; }
  .timeline-scrubber { grid-template-columns: 1fr; padding: 10px 12px; }
  .scrub-controls button { flex: 1; min-height: 40px; }
  .policy { grid-template-columns: 1fr; gap: 2px; }
  .policy dd { margin-bottom: 8px; }
}
