/* ── page head ─────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-5); margin-bottom: var(--s-6); flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 6px; }
.lede { color: var(--text-2); font-size: 17px; line-height: 1.45; margin-top: 8px; max-width: 60ch; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ── buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 18px; border-radius: var(--r-pill);
  border: 0; cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap;
  background: var(--fill-quiet); color: var(--text);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease),
    opacity var(--t-fast) var(--ease);
}
.btn:hover { background: color-mix(in srgb, var(--fill-quiet) 100%, var(--text) 6%); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { border-radius: var(--r-pill); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--plain { background: transparent; color: var(--accent-text); padding: 0 10px; }
.btn--plain:hover { background: var(--accent-soft); }
.btn--lg { min-height: 44px; padding: 0 22px; font-size: 15px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ── surfaces ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated); border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
}
.card--pad { padding: var(--s-5); }
.section { margin-top: var(--s-6); }
.section > h3 { margin-bottom: var(--s-3); }
.divider { height: 0; border: 0; border-top: 0.5px solid var(--hairline); margin: var(--s-5) 0; }

/* key / value grid */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 10px var(--s-5); margin: 0; }
.kv dt { color: var(--text-2); font-size: 13px; padding-top: 1px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ── badges ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--fill-quiet); color: var(--text-2);
}
.badge svg { width: 12px; height: 12px; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--review { background: var(--review-soft); color: var(--review); }
.badge--blocked { background: var(--blocked-soft); color: var(--blocked); }
.badge--fail { background: var(--fail-soft); color: var(--fail); }
.badge--accent { background: var(--accent-soft); color: var(--accent-text); }

/* An unknown value. Visibly not a number, never a zero. */
.unknown {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 6px; font-family: var(--font-text); font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em; color: var(--review);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--review) 45%, transparent);
  font-variant-numeric: normal;
}
.zero { color: var(--text-3); }

/* ── notices (calm; tinted edge, never a red slab) ─────────────────── */
.notice {
  display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start;
  padding: 14px 16px; border-radius: var(--r-m);
  background: var(--bg-sunken); color: var(--text);
  box-shadow: inset 3px 0 0 var(--hairline-strong);
  font-size: 14px;
}
.notice svg { width: 20px; height: 20px; color: var(--text-2); }
.notice p + p { margin-top: 4px; }
.notice--ok { box-shadow: inset 3px 0 0 var(--ok); }
.notice--ok svg { color: var(--ok); }
.notice--review { box-shadow: inset 3px 0 0 var(--review); }
.notice--review svg { color: var(--review); }
.notice--fail { box-shadow: inset 3px 0 0 var(--fail); }
.notice--fail svg { color: var(--fail); }
.notice--blocked svg { color: var(--blocked); }
.notice strong { font-weight: 600; }

/* ── inputs ────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; align-content: start; }
.field > label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  background: var(--bg-elevated); color: var(--text);
  border: 0; box-shadow: inset 0 0 0 1px var(--hairline-strong);
  transition: box-shadow var(--t-fast) var(--ease);
}
.input:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 30%, transparent); }
.input:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), var(--focus); border-radius: 10px; }
.input::placeholder { color: var(--text-3); }

.search {
  position: relative; display: flex; align-items: center;
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.search .input { min-height: 52px; padding-left: 46px; font-size: 17px; border-radius: 14px;
  box-shadow: var(--shadow-2), inset 0 0 0 0.5px var(--hairline); }
.search .input:focus-visible { box-shadow: var(--shadow-2), inset 0 0 0 1px var(--accent), var(--focus); border-radius: 14px; }

/* ── tables (data, not the workbook) ───────────────────────────────── */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-m); }
/* Scroll shadows: an edge darkens only on a side with more to scroll. The
   covers move with the content (local); the shadows stay put (scroll). */
.table-wrap, .paper-frame {
  --sb: var(--scroll-bg, var(--bg-elevated));
  background:
    linear-gradient(to right, var(--sb) 30%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--sb) 30%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.16), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.16), transparent) right / 12px 100% no-repeat scroll,
    var(--sb);
}
.table { width: 100%; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--text-2);
  padding: 10px 14px; border-bottom: 0.5px solid var(--hairline-strong); white-space: nowrap;
}
.table td, .table tbody th { padding: 11px 14px; border-bottom: 0.5px solid var(--hairline); vertical-align: middle; }
.table tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table .r, .table th.r { text-align: right; }
.table td.r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table--hover tbody tr:hover { background: var(--bg-hover); }

/* ── segmented control ─────────────────────────────────────────────── */
.segmented { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill-quiet); }
.segmented a, .segmented button {
  border: 0; background: transparent; color: var(--text); cursor: pointer;
  padding: 5px 14px; border-radius: 7px; font-size: 13px; font-weight: 500;
}
.segmented a:hover { text-decoration: none; }
.segmented [aria-current="page"], .segmented [aria-pressed="true"] {
  background: var(--bg-elevated); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 0.5px rgba(0,0,0,.04);
}

/* ── empty / loading / error states ────────────────────────────────── */
.empty { padding: var(--s-8) var(--s-5); text-align: center; color: var(--text-2); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty svg { width: 36px; height: 36px; color: var(--text-3); margin-bottom: var(--s-3); }
.skeleton {
  border-radius: 6px; background: var(--fill-quiet); height: 14px;
  animation: fade 900ms var(--ease) infinite alternate;
}
.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in srgb, currentColor 22%, transparent);
  border-top-color: currentColor; animation: spin 800ms linear infinite;
}

/* ── footer ───────────────────────────────────────────────────────── */
.foot {
  margin-top: var(--s-8); padding-top: var(--s-4); border-top: 0.5px solid var(--hairline);
  display: flex; gap: var(--s-4); justify-content: space-between; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3);
}

@media (max-width: 760px) {
  .page-head { margin-bottom: var(--s-5); }
  .lede { font-size: 15px; }
  .card--pad { padding: var(--s-4); }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .search .input { font-size: 16px; }
}
