:root {
  --bg: #fbf7ef;
  --surface: #ffffff;
  --text: #1d1b4f;
  --muted: #55527f;
  --line: #d8d3e6;
  --accent: #5b2a9e;
  --accent-text: #ffffff;
  --focus: #1b5fd1;
  --edge: rgba(0, 0, 0, 0.55);
  --grid: rgba(0, 0, 0, 0.3);
  --note-bg: #fff4d6;
  --note-line: #b98a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14122e;
    --surface: #1d1b4f;
    --text: #fbf7ef;
    --muted: #c3bfe6;
    --line: #3d3a7a;
    --accent: #c4a5f5;
    --accent-text: #14122e;
    --focus: #8ab4ff;
    --edge: rgba(255, 255, 255, 0.65);
    --grid: rgba(255, 255, 255, 0.32);
    --note-bg: #3a2f10;
    --note-line: #e0b000;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { display: inline-block; line-height: 0; }
.brand img { height: 48px; width: auto; display: block; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.site-header nav a { color: var(--text); padding: 0.25rem 0; display: inline-block; }
.site-header nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 3px; }

main { padding: 1.5rem 0 3rem; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.2; margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; line-height: 1.3; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.1rem; margin: 1.25rem 0 0.25rem; }
p, ul, ol { margin: 0 0 1rem; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 44rem; }
.prose { max-width: 44rem; }
.small { font-size: 0.875rem; color: var(--muted); }

.notice { background: var(--note-bg); border: 1px solid var(--note-line); border-left-width: 6px; padding: 0.6rem 0.9rem; margin: 1rem 0; border-radius: 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin: 1.25rem 0; }
.panel h2 { margin-top: 0; }

label { font-weight: 600; display: block; margin-bottom: 0.2rem; }
select, input[type="search"] {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--edge); border-radius: 6px; padding: 0.5rem 0.6rem; width: 100%; min-height: 2.75rem;
}
button {
  font: inherit; cursor: pointer; min-height: 2.75rem; padding: 0.4rem 0.9rem;
  border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); font-weight: 600;
}
button.secondary { background: transparent; color: var(--accent); }
button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
button:hover { filter: brightness(1.08); }

.compare-grid { display: grid; gap: 0.75rem; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 40rem) { .compare-grid { grid-template-columns: 1fr auto 1fr; } }
.result { margin-top: 1rem; padding: 0.9rem 1rem; border-left: 6px solid var(--accent); background: var(--bg); border-radius: 4px; }
.result .headline { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.4rem; }
.result p { margin: 0 0 0.5rem; }
.result .figures { display: grid; gap: 0.25rem 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .result .figures { grid-template-columns: 1fr 1fr; } }

.controls { display: grid; gap: 0.75rem; grid-template-columns: 1fr; margin-bottom: 0.75rem; }
@media (min-width: 48rem) { .controls { grid-template-columns: 2fr 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin: 0.25rem 0 0.75rem; }
.check input { width: 1.25rem; height: 1.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }

.legend { list-style: none; padding: 0; margin: 0.5rem 0 1rem; display: grid; gap: 0.5rem; font-size: 0.95rem; }
.legend li { display: flex; align-items: flex-start; gap: 0.5rem; }
.legend .sw { flex: none; margin-top: 0.35rem; }
.yardstick { margin: 0.75rem 0 1rem; max-width: 24rem; }
.yardstick p { margin: 0.3rem 0 0; }
.row .nums .vs { display: block; font-size: 0.85rem; color: var(--muted); }
.sw { display: inline-block; width: 1.1rem; height: 0.8rem; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--edge); }

/* Bands use a pattern as well as a colour, so colour is never the only cue. */
/* The six band colours are the same ramp as the logo, from violet to gold. */
.b-mild { background-color: #46039f; }
.b-medium { background-color: #7201a8; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.5) 0 2px, transparent 2px 6px); }
.b-hot { background-color: #9c179e; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.5) 0 2px, transparent 2px 6px); }
.b-very-hot { background-color: #d8576b; background-image: radial-gradient(rgba(0,0,0,0.45) 1.5px, transparent 1.6px); background-size: 6px 6px; }
.b-superhot { background-color: #fb9f3a; background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.45) 0 2px, transparent 2px 6px), repeating-linear-gradient(-45deg, rgba(0,0,0,0.45) 0 2px, transparent 2px 6px); }
.b-extreme { background-color: #fdca26; background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.5) 0 2px, transparent 2px 6px); }

.axis { position: relative; height: 1.4rem; margin: 0 0 0.25rem; font-size: 0.75rem; color: var(--muted); }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }

@media (max-width: 30rem) { .axis span:nth-child(even) { display: none; } }
.dil-controls { grid-template-columns: 1fr; }
@media (min-width: 40rem) { .dil-controls { grid-template-columns: 1fr 1fr; } }
.dil-track { height: 1.6rem; margin-bottom: 0.5rem; }
.dil-track .bar { top: 0.3rem; height: 1rem; }
.refmark { position: absolute; top: 0; width: 0; height: 100%; border-left: 2px dashed var(--muted); }
.tubs-block { margin: 1rem 0; }
.tubs { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin: 0.25rem 0; }
.tub { display: block; width: 3.5rem; height: auto; }
.share { margin: 1rem 0; }
.share-row { display: flex; gap: 0.5rem; }
.share-row input { flex: 1 1 auto; min-width: 0; }
.share-row button { flex: none; }
.dil-labels { margin: 0 0 0.5rem; }
.dil-labels span, .axis.dil-labels span:nth-child(even) { display: block; transform: translateX(-50%); }
.dil-labels span:first-child, .dil-labels span:last-child { transform: translateX(-50%); }
.axis-wrap.dil-axis { display: block; }
.axis-wrap.dil-axis .axis { grid-column: auto; }
.ladder { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 1fr; gap: 0.2rem 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); align-items: center; }
.row .name strong { display: block; }
.row .name .note { display: block; font-size: 0.85rem; color: var(--muted); }
.row .name .tag { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; margin-top: 0.15rem; }
.row .nums { font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.track { position: relative; height: 1.1rem; background-image: var(--grid-lines); background-color: transparent; border-bottom: 1px solid var(--grid); }
.bar { position: absolute; top: 0.1rem; height: 0.9rem; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--edge); }
.row button { justify-self: start; min-height: 2.25rem; padding: 0.2rem 0.7rem; font-size: 0.9rem; }
@media (min-width: 48rem) {
  .row { grid-template-columns: 14rem 1fr 11rem 7.5rem; }
  .axis-wrap { display: grid; grid-template-columns: 14rem 1fr 11rem 7.5rem; gap: 0 1rem; }
  .axis-wrap .axis { grid-column: 2; }
}
.empty { padding: 1rem 0; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 1.25rem 0; font-size: 0.9rem; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }

table { border-collapse: collapse; width: 100%; margin: 0 0 1rem; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface); }

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --line: #999; --grid: rgba(0,0,0,0.25); --edge: #000; }
  .site-header nav, .skip, .controls, .actions, .compare-panel, .row button, .check, .notice, noscript, .no-print { display: none !important; }
  body { font-size: 11pt; }
  .panel { border: 0; padding: 0; }
  .row { break-inside: avoid; grid-template-columns: 12rem 1fr 10rem; }
  .b-mild, .b-medium, .b-hot, .b-very-hot, .b-superhot, .b-extreme, .sw { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-footer { border: 0; }
}
