:root {
  --ink: #e9e4da;
  --inkSoft: #a7a197;
  --inkFaint: #6f6a62;
  --ground: #16171b;
  --raised: #1e2025;
  --sunk: #111215;
  --rule: #2c2e35;
  --rec: #e5484d;
  --recDim: #4a2124;
  --calm: #8fb8a6;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: #fff; }

h1, h2 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 18px; }
p { margin: 0 0 12px; }

.quiet { color: var(--inkSoft); }

.pageWidth {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* top strip */
.topStrip {
  border-bottom: 1px solid var(--rule);
  background: var(--sunk);
}
.topStripRow {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 56px;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
}
.wordmarkGlyph { width: 20px; height: 20px; fill: var(--inkSoft); }
.wordmarkGlyph .wordmarkDot { fill: var(--rec); }
.viewSwitch { display: flex; gap: 4px; margin-left: 12px; }
.viewTab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--inkSoft);
  font: inherit;
  padding: 16px 8px 14px;
  cursor: pointer;
}
.viewTab:hover { color: var(--ink); }
.viewTab.isOn { color: var(--ink); border-bottom-color: var(--rec); }
.parentLink { margin-left: auto; color: var(--inkSoft); font-size: 14px; }

/* intro */
.introGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px;
  padding: 36px 0 28px;
}
.introText p { max-width: 60ch; }

.signCard {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 20px;
  align-self: start;
}
.actButton {
  width: 100%;
  background: var(--ink);
  color: var(--sunk);
  border: 0;
  border-radius: 4px;
  padding: 11px 14px;
  font: 600 14px/1.2 var(--sans);
  cursor: pointer;
}
.actButton:hover { background: #fff; }
.actButton[disabled] { opacity: 0.6; cursor: progress; }
.signNote {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--rec);
  background: var(--recDim);
  font-size: 14px;
}

/* figures */
.meterRow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.meterCell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-right: 1px solid var(--rule);
  background: var(--raised);
}
.meterCell:last-child { border-right: 0; }
.meterValue {
  font: 600 20px/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.meterLabel { font-size: 13px; color: var(--inkSoft); }
.freshLine { font-size: 13px; color: var(--inkFaint); margin: 8px 0 28px; }
.freshLine.isStale { color: var(--rec); }

/* collections */
.shelfTools {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
#shelfQuery {
  flex: 1 1 220px;
  max-width: 340px;
  background: var(--sunk);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}
#shelfQuery:focus { outline: 2px solid var(--calm); outline-offset: -1px; }
.familyPick { display: flex; gap: 6px; flex-wrap: wrap; }
.familyChip {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--inkSoft);
  font: inherit;
  font-size: 13px;
  padding: 4px 12px;
  cursor: pointer;
}
.familyChip.isOn { border-color: var(--calm); color: var(--ink); }

.shelfHead,
.shelfRow {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) 88px;
  gap: 12px;
  align-items: center;
}
.shelfHead {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--inkFaint);
  padding: 0 12px 6px;
  border-bottom: 1px solid var(--rule);
}
.shelfList { list-style: none; margin: 0; padding: 0; }
.shelfItem { border-bottom: 1px solid var(--rule); }
.shelfRow { padding: 11px 12px; }
.shelfItem:hover { background: var(--raised); }
.shelfTitle { font-weight: 600; }
.shelfFamily { display: block; font-size: 12px; color: var(--inkFaint); }
.shelfNum { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.shelfWhen { font-size: 14px; color: var(--inkSoft); }
.ghostButton {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 5px 10px;
  cursor: pointer;
}
.ghostButton:hover { border-color: var(--inkSoft); }
.shelfLock {
  margin: 0 12px 12px;
  padding: 8px 12px;
  font-size: 14px;
  border-left: 3px solid var(--rec);
  background: var(--recDim);
}
.emptyNote { padding: 16px 12px; }

/* clients */
.viewPane[data-pane="clients"] p { max-width: 70ch; }
.codeBox {
  position: relative;
  background: var(--sunk);
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin: 16px 0 20px;
}
.codeBox pre {
  margin: 0;
  padding: 14px 16px;
  padding-right: 80px;
  font: 13px/1.6 var(--mono);
  overflow-x: auto;
}
.codeBox .ghostButton { position: absolute; top: 10px; right: 10px; }
.factList {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  margin: 0;
}
.factList dt { color: var(--inkSoft); }
.factList dd { margin: 0; }

.footLine {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 18px;
  padding-bottom: 28px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--inkFaint);
}
.footLine a { color: var(--inkFaint); }

@media (max-width: 860px) {
  .introGrid { grid-template-columns: 1fr; gap: 20px; }
  .meterRow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meterCell:nth-child(3) { border-right: 0; }
  .meterCell:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
}

@media (max-width: 600px) {
  .viewSwitch { margin-left: 0; order: 3; width: 100%; }
  .parentLink { margin-left: auto; }
  .meterRow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meterCell { border-right: 0; border-bottom: 1px solid var(--rule); }
  .meterCell:nth-child(odd) { border-right: 1px solid var(--rule); }
  .meterCell:nth-last-child(-n+2) { border-bottom: 0; }
  .shelfHead { display: none; }
  .shelfRow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .shelfRow .shelfNum, .shelfRow .shelfWhen { grid-column: 1; }
  .shelfRow .ghostButton { grid-column: 2; grid-row: 1; }
  .factList { grid-template-columns: 1fr; gap: 2px; }
  .factList dd { margin-bottom: 10px; }
}
