* {
  box-sizing: border-box;
}
:root {
  /* The explainer's palette: black, white and warm greys with one gold accent, light and dark. */
  color-scheme: light;
  font:
    16px/1.48 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  --bg: #f3f1eb;
  --panel: #fcfbf8;
  --ink: #0f0e0b;
  --ink-2: #4d4a43;
  --muted: #6f6b62;
  --line: #e3dfd5;
  --axis: #c5bfb1;
  --accent: #8a6d3b;
  --accent-strong: #6e5630;
  --accent-mid: #cdbb98;
  --accent-soft: rgba(188, 169, 138, 0.22);
  --on-accent: #ffffff;
  --good-mark: #4d4a43;
  --warn-ink: #6e5630;
  --warn-bg: #f1e9d8;
  --bad: #8a6d3b;
  --teal: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12110d;
    --panel: #1b1a15;
    --ink: #efe5d0;
    --ink-2: #c9c0ad;
    --muted: #8f887a;
    --line: #2c2a23;
    --axis: #48443a;
    --accent: #bca98a;
    --accent-strong: #d9c49d;
    --accent-mid: #6e5a38;
    --accent-soft: rgba(188, 169, 138, 0.16);
    --on-accent: #12110d;
    --good-mark: #c9c0ad;
    --warn-ink: #d9c49d;
    --warn-bg: #2e281b;
    --bad: #d9c49d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12110d;
  --panel: #1b1a15;
  --ink: #efe5d0;
  --ink-2: #c9c0ad;
  --muted: #8f887a;
  --line: #2c2a23;
  --axis: #48443a;
  --accent: #bca98a;
  --accent-strong: #d9c49d;
  --accent-mid: #6e5a38;
  --accent-soft: rgba(188, 169, 138, 0.16);
  --on-accent: #12110d;
  --good-mark: #c9c0ad;
  --warn-ink: #d9c49d;
  --warn-bg: #2e281b;
  --bad: #d9c49d;
}
body {
  margin: 0;
}
header {
  height: 56px;
  background: var(--panel);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 0 max(4vw, 20px);
}
.brand {
  font-weight: 750;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.brand span,
.local {
  font-size: 14px;
  color: var(--muted);
  font-weight: 450;
}
.brand span {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.mark {
  display: inline-flex;
  width: 18px;
  height: 18px;
}
.mark svg {
  width: 100%;
  height: 100%;
}
nav {
  display: flex;
  align-self: stretch;
  gap: 8px;
}
button,
select,
input {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  padding: 0.46rem 0.8rem;
  font-weight: 600;
}
button:hover {
  border-color: var(--axis);
  background: var(--bg);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
nav button {
  border: 0;
  color: var(--ink-2);
  background: none;
  padding: 0 1rem;
  border-radius: 0;
  border-bottom: 3px solid transparent;
}
nav button[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
nav button:hover {
  background: var(--bg);
  color: var(--ink);
}
.local {
  margin-left: auto;
}
.local:before {
  content: "";
  display: inline-block;
  background: var(--good-mark);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
}
main {
  max-width: 1580px;
  margin: auto;
  padding: 32px max(4vw, 20px) 60px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1.16;
  letter-spacing: -0.046em;
  color: var(--ink);
  font-weight: 660;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 16px;
}
p,
.muted,
small {
  color: var(--muted);
}
p {
  margin: 0.45rem 0 0;
}
small {
  font-size: 13px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 26px;
}
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}
.stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  min-width: 0;
}
.panel > h2:first-child,
.panel > h3:first-child {
  margin-bottom: 12px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head p,
.aside p {
  font-size: 14px;
}
.aside label,
form label,
.fields label {
  font-size: 14px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 540;
}
.aside form,
.fields,
.import-form {
  display: grid;
  gap: 12px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 5px 0;
}
.fieldpair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lifetime-field {
  display: grid;
  gap: 4px;
}
.lifetime-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.lifetime-field small {
  color: var(--muted);
  line-height: 1.4;
}
input,
select {
  width: 100%;
  border: 1px solid var(--axis);
  border-radius: 5px;
  padding: 7px 9px;
  background: var(--panel);
  color: var(--ink);
  min-width: 0;
}
input:focus,
select:focus {
  border-color: var(--teal);
}
.primary {
  background: var(--teal);
  color: var(--on-accent);
  border-color: var(--teal);
}
.primary:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}
.small {
  font-size: 13px;
}
.quiet {
  color: var(--teal);
  background: transparent;
}
.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  border-radius: 20px;
  padding: 3px 9px;
  color: var(--ink);
  background: var(--accent-soft);
}
.warn {
  color: var(--warn-ink);
  background: var(--warn-bg);
}
.mono,
.num,
td {
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
}
.scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
th,
td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
}
th:first-child,
td:first-child {
  padding-left: 0;
}
tr:last-child td {
  border: 0;
}
.profile {
  color: var(--teal);
  border: 0;
  background: transparent;
  padding: 2px 0;
  text-align: left;
  font-size: 14px;
}
.profile:hover {
  text-decoration: underline;
  background: transparent;
}
.meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.summary {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.chart {
  display: grid;
  gap: 9px;
}
.chartrow {
  display: grid;
  grid-template-columns: 158px 1fr 64px;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}
.track {
  height: 7px;
  background: var(--bg);
  border-radius: 5px;
  position: relative;
}
.segment {
  position: absolute;
  inset-block: 0;
  background: var(--accent-mid);
  border-radius: 5px;
}
.dot {
  position: absolute;
  top: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--teal);
  transform: translateX(-50%);
}
.dot.end {
  background: var(--panel);
  border: 2px solid var(--teal);
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.symbol {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
}
.symbol.open {
  background: var(--panel);
  border: 2px solid var(--teal);
  margin-left: 10px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.fine {
  font-size: 13px;
  color: var(--muted);
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  color: var(--teal);
  font-weight: 600;
}
.hist {
  display: flex;
  align-items: end;
  height: 64px;
  gap: 2px;
  margin: 12px 0;
}
.hist i {
  background: var(--accent);
  flex: 1;
  min-width: 2px;
}
.error {
  color: var(--bad);
}
.empty {
  padding: 12px;
  background: var(--bg);
  border-radius: 5px;
}
.file {
  overflow-wrap: anywhere;
}
.import-form {
  margin-top: 12px;
  max-width: 640px;
}
.import-form label.check {
  display: flex;
  align-items: center;
}
.check input {
  width: auto;
}
a {
  color: var(--teal);
}
#notice:not(:empty) {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  background: var(--ink);
  color: var(--panel);
  padding: 12px 18px;
  border-radius: 7px;
  z-index: 5;
}
.grid7 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}
.resultsmall {
  font-size: 13px;
  color: var(--muted);
}
.axis {
  display: flex;
  justify-content: space-between;
  margin: 0 75px 0 170px;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 940px) {
  .layout {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .brand span {
    display: none;
  }
  header {
    gap: 1rem;
  }
  .panel {
    padding: 15px;
  }
}
@media (max-width: 700px) {
  header {
    padding: 0 12px;
    gap: 8px;
    height: 58px;
  }
  .local {
    display: none;
  }
  nav {
    margin-left: auto;
    gap: 0;
  }
  nav button {
    padding: 0 10px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .aside form {
    grid-template-columns: 1fr 1fr;
  }
  .aside .divider {
    display: none;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .chartrow {
    grid-template-columns: 118px 1fr 52px;
    gap: 6px;
    font-size: 12px;
  }
  .axis {
    margin: 0 56px 0 122px;
  }
  .panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  main {
    padding: 22px 12px;
  }
  .aside {
    order: 0;
  }
}

.search-results th.group {
  text-align: center;
  background: var(--accent-soft);
  color: var(--teal);
}
.search-results td {
  vertical-align: top;
}
.search-results thead tr:last-child th {
  white-space: normal;
  vertical-align: bottom;
}
.grid7 label {
  align-content: space-between;
}
.cost {
  margin: 0;
  min-width: 82px;
}
.cost summary {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cost[open] {
  min-width: 160px;
}
.cost dl {
  margin: 0.65rem 0;
  font-size: 0.82rem;
}
.cost dt,
.cost p,
.validation p {
  color: var(--muted);
}
.cost dd {
  margin: 0 0 0.4rem;
  font-weight: 600;
}
.cost p {
  font-size: 0.82rem;
}
.cost .extended {
  font-weight: 500;
  color: var(--warn-ink);
}
.validation h3 {
  margin-top: 1rem;
}

.measurement-page .panel > p {
  max-width: 78ch;
}
.measurement-page td {
  vertical-align: top;
}
.measurement-page summary {
  cursor: pointer;
  color: var(--teal);
}
.measurement-page fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
@media (max-width: 520px) {
  header {
    height: auto;
    flex-wrap: wrap;
    padding-top: 9px;
  }
  nav {
    flex-basis: 100%;
  }
  nav button {
    flex: 1;
    padding: 10px 3px;
  }
  .measurement-page .fieldpair {
    grid-template-columns: 1fr;
  }
}

.layout-group {
  min-width: 0;
  margin: 1rem 0;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
}
.layout-group legend { font-weight: 600; }
.height-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
}
.layout-row { margin-bottom: .75rem; }
.layout-row button { margin-top: .4rem; }
.sweep-count { display: block; margin-top: .75rem; }
