/* Actuarial Atlas · ozan.ing */
:root {
  --bg: #050608;
  --ink: #f3f1eb;
  --ink-2: rgba(243, 241, 235, 0.78);
  --muted: rgba(243, 241, 235, 0.56);
  --faint: rgba(243, 241, 235, 0.30);
  --hair: rgba(243, 241, 235, 0.15);
  --brass: #d9a441;
  --brass-hi: #f5b942;
  --ember: #eb6a38;
  --panel: rgba(6, 7, 10, 0.86);
  --serif: 'Fraunces', Georgia, serif;
  --mono: 'Chivo Mono', ui-monospace, Menlo, monospace;
  --sans: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --math: 'STIX Two Text', 'Cambria Math', 'Times New Roman', serif;
  --pad-x: 34px;
  --pad-y: 24px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#gl.dragging { cursor: grabbing; }

.frame {
  position: fixed;
  inset: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l));
  pointer-events: none;
  z-index: 2;
}
.frame i {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--faint);
  border-style: solid;
  border-width: 0;
}
.frame i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.frame i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.top {
  position: fixed;
  top: calc(var(--pad-y) + var(--safe-t));
  left: calc(var(--pad-x) + var(--safe-l));
  right: calc(var(--pad-x) + var(--safe-r));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  z-index: 6;
}
.crumbs-col { display: flex; flex-direction: column; gap: 6px; }
.crumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand, .crumb {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}
.crumb { color: var(--brass); }
.brand:hover { color: var(--brass-hi); }
.crumb:hover { color: var(--ink); }
.sep { font-family: var(--mono); font-size: 11px; color: var(--hair); }
.tagline {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  padding: 8px 13px;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--hair);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { color: var(--ink); border-color: rgba(243, 241, 235, 0.45); }
.btn:focus-visible, .step:focus-visible, .scale:focus-visible, .card:focus-visible,
.brand:focus-visible, .crumb:focus-visible, .fallback a:focus-visible {
  outline: 1px solid var(--brass-hi);
  outline-offset: 3px;
}

.plate {
  position: fixed;
  left: calc(var(--pad-x) + var(--safe-l));
  bottom: calc(118px + var(--safe-b));
  width: min(450px, 37vw);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.plate.swap { opacity: 0; transform: translateY(6px); }
.plate .pl-name, .plate .pl-formula, .plate .pl-params, .plate .pl-by, .plate .pl-note {
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
  width: fit-content;
  max-width: 100%;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.plate-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  letter-spacing: 0.18em;
}
.pl-no { color: var(--ink); }
.pl-no .of { color: var(--muted); }
.pl-fam {
  color: var(--brass);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.pl-fam::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--hair);
}
.pl-day {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.pl-day b { color: var(--brass-hi); font-weight: 500; }

.pl-name {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  font-weight: 400;
  font-size: clamp(32px, 3.8vw, 50px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: #fbfaf7;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.9);
  margin-top: 2px;
}
.pl-name.long { font-size: clamp(26px, 3.0vw, 40px); }

.pl-formula {
  font-family: var(--math);
  font-size: 17px;
  line-height: 1.38;
  color: var(--ink);
  border-left: 1px solid var(--brass);
  padding-left: 12px;
  margin-top: 2px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.95);
}
.pl-formula.long { font-size: 14px; }
/* Formula subscripts and accents, drawn by view.js from the plain data string. */
.pl-formula sub, .fb-formula sub { font-size: 0.68em; line-height: 0; vertical-align: -0.28em; }
.acc { position: relative; display: inline-block; line-height: 1; }
.acc::after { content: ''; position: absolute; pointer-events: none; }
.acc.bar::after { left: 0.06em; right: 0.02em; top: 0.02em; border-top: 0.06em solid currentColor; }
/* A drawn chevron, so the hat sits on the letter whatever face the formula falls back to. */
.acc.hat::after {
  left: 50%; top: -0.2em; width: 0.22em; height: 0.22em;
  border-top: 0.075em solid currentColor; border-left: 0.075em solid currentColor;
  transform: translateX(-50%) scaleY(0.62) rotate(45deg);
}
.acc.hat.low::after { top: 0.02em; }
.acc.hat.wide::after { top: -0.22em; transform: translateX(-50%) scale(2.6, 0.5) rotate(45deg); border-width: 0.05em; }
.pl-params {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-left: 13px;
}
.pl-by {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-2);
  margin-top: 2px;
}
.pl-note {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.95);
}

/* Parameter dial · one live parameter per plate (shown only when the plate declares one) */
.dial {
  --p: 0.5;
  --p0: 0.5;
  --thumb: 14px;
  pointer-events: auto;
  width: min(340px, 100%);
  margin-top: 4px;
  padding: 9px 11px 6px;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-left-color: var(--brass);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dial-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}
.dial-sym {
  font-family: var(--math);
  font-style: italic;
  font-size: 18px;
  line-height: 1;
  color: var(--brass-hi);
  flex: none;
}
.dial-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.dial-val {
  flex: none;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
.dial.moved .dial-val { color: var(--brass-hi); }
.dial-reset {
  appearance: none;
  flex: none;
  align-self: center;
  width: 24px;
  height: 24px;
  margin-right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--faint);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.dial-reset[aria-disabled="true"] { cursor: default; opacity: 0.45; }
.dial.moved .dial-reset { color: var(--brass); }
.dial.moved .dial-reset:hover { color: var(--brass-hi); border-color: rgba(245, 185, 66, 0.45); }
.dial-reset:focus-visible { outline: 1px solid var(--brass-hi); outline-offset: 1px; }
.dial-track {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dial-end {
  flex: none;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.dial-rail {
  position: relative;
  flex: 1 1 auto;
  height: 30px;
}
/* hairline, vernier ticks, brass fill up to the value, and a mark at the default */
.dial-rail::before {
  content: '';
  position: absolute;
  left: calc(var(--thumb) / 2);
  right: calc(var(--thumb) / 2);
  top: 50%;
  height: 7px;
  transform: translateY(-1px);
  background:
    linear-gradient(var(--hair), var(--hair)) left top / 100% 1px no-repeat,
    repeating-linear-gradient(to right, rgba(243, 241, 235, 0.22) 0 1px, transparent 1px 10%) left top / calc(100% + 1px) 5px no-repeat;
  pointer-events: none;
}
.dial-rail::after {
  content: '';
  position: absolute;
  left: calc(var(--thumb) / 2);
  top: 50%;
  width: calc((100% - var(--thumb)) * var(--p));
  height: 1px;
  transform: translateY(-1px);
  background: linear-gradient(to right, rgba(217, 164, 65, 0.25), var(--brass-hi));
  box-shadow: 0 0 8px rgba(245, 185, 66, 0.5);
  pointer-events: none;
}
.dial-input {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  background:
    linear-gradient(var(--brass), var(--brass)) calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--p0) - 0.5px) 4px / 1px 6px no-repeat;
  cursor: ew-resize;
  touch-action: none;
}
.dial-input::-webkit-slider-runnable-track { height: 100%; background: transparent; border: 0; }
.dial-input::-moz-range-track { height: 100%; background: transparent; border: 0; }
.dial-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--thumb);
  height: 100%;
  border: 0;
  background:
    linear-gradient(var(--brass-hi), var(--brass-hi)) center 7px / 2px 16px no-repeat,
    linear-gradient(var(--brass-hi), var(--brass-hi)) center 5px / 10px 2px no-repeat;
  filter: drop-shadow(0 0 5px rgba(245, 185, 66, 0.75));
}
.dial-input::-moz-range-thumb {
  width: var(--thumb);
  height: 100%;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(var(--brass-hi), var(--brass-hi)) center 7px / 2px 16px no-repeat,
    linear-gradient(var(--brass-hi), var(--brass-hi)) center 5px / 10px 2px no-repeat;
  filter: drop-shadow(0 0 5px rgba(245, 185, 66, 0.75));
}
.dial-input:focus { outline: none; }
.dial-input:focus-visible { outline: 1px solid var(--brass-hi); outline-offset: 2px; }

.readout {
  position: fixed;
  right: calc(var(--pad-x) + var(--safe-r));
  bottom: calc(118px + var(--safe-b));
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  pointer-events: none;
}

.dock {
  position: fixed;
  left: calc(var(--pad-x) + var(--safe-l));
  right: calc(var(--pad-x) + var(--safe-r));
  bottom: calc(20px + var(--safe-b));
  height: 58px;
  z-index: 6;
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.step {
  appearance: none;
  flex: none;
  width: 56px;
  background: var(--panel);
  border: 1px solid var(--hair);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.step:hover { color: var(--brass-hi); border-color: rgba(245, 185, 66, 0.45); }

.scale {
  position: relative;
  flex: 1 1 auto;
  background: var(--panel);
  border: 1px solid var(--hair);
  cursor: ew-resize;
  touch-action: none;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.scale-fams, .scale-ticks { position: absolute; inset: 0; pointer-events: none; }
.scale-tick {
  position: absolute;
  bottom: 7px;
  width: 1px;
  height: 8px;
  background: rgba(243, 241, 235, 0.25);
  transform: translateX(-50%);
}
.scale-tick.major { height: 22px; background: rgba(243, 241, 235, 0.45); }
.scale-fam {
  position: absolute;
  top: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  transition: color 0.2s ease;
}
.scale-fam .n { color: var(--brass); margin-right: 5px; }
.scale-fams.compact .scale-fam { letter-spacing: 0.04em; }
.scale-fams.compact .scale-fam .n { margin-right: 0; }
.scale-fam.on { color: var(--ink); }
.scale-fam.on .n { color: var(--brass-hi); }

.scale-needle {
  position: absolute;
  top: 20px;
  bottom: 6px;
  width: 2px;
  background: var(--brass-hi);
  box-shadow: 0 0 12px var(--brass-hi);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}
.scale-needle::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -4px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--brass-hi);
}

.scale-hover {
  position: absolute;
  top: 6px;
  padding: 2px 7px;
  background: #0b0d12;
  border: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.index {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  overflow-y: auto;
  padding: 0 calc(var(--pad-x) + var(--safe-r)) calc(48px + var(--safe-b)) calc(var(--pad-x) + var(--safe-l));
}
.index-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: calc(var(--pad-y) + var(--safe-t)) 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--hair);
}
.index-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3vw, 40px);
}
.index-title .count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-left: 14px;
}
.fam-section { padding-top: 30px; }
.fam-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.fam-head .n { color: var(--brass); flex: none; min-width: 3.2em; }
.fam-head .fam-label { flex: 0 1 auto; min-width: 0; }
.fam-head .c { flex: none; }
.fam-head .c { color: var(--muted); }
.fam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}
.card {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--hair);
  padding: 8px 8px 10px;
  cursor: pointer;
}
.card:hover { border-color: rgba(243, 241, 235, 0.45); }
.card.current { border-color: var(--brass); }
.card canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #020304;
}
.card .no { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; color: var(--muted); }
.card.current .no { color: var(--brass-hi); }
.card .nm { font-family: var(--serif); font-size: 15px; line-height: 1.15; color: var(--ink); }

body.no-gl, body.no-gl html {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}
body.no-gl { height: auto; min-height: 100dvh; overflow-y: auto; }
body.no-gl #gl, body.no-gl .frame, body.no-gl .plate, body.no-gl .readout, body.no-gl .dock, body.no-gl .index, body.no-gl #index-btn {
  display: none !important;
}
body.no-gl .top {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--hair);
  padding: calc(var(--pad-y) + var(--safe-t)) calc(var(--pad-x) + var(--safe-r)) 16px calc(var(--pad-x) + var(--safe-l));
}

.fallback {
  position: relative;
  min-height: 100dvh;
  z-index: 4;
  background: var(--bg);
  padding: calc(36px + var(--safe-t)) calc(var(--pad-x) + var(--safe-r)) calc(56px + var(--safe-b)) calc(var(--pad-x) + var(--safe-l));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fallback-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--brass);
}
.fallback-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.02;
}
.fallback-msg {
  font-size: 14px;
  color: var(--muted);
  max-width: 640px;
}
.fallback-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 780px;
  margin-top: 6px;
}
.fallback-list li {
  border-top: 1px solid var(--hair);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fb-head {
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--brass);
}
.fb-name {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
}
.fb-formula {
  overflow-wrap: anywhere;
  font-family: var(--math);
  font-size: 15px;
  color: var(--ink);
  border-left: 1px solid var(--brass);
  padding-left: 10px;
}
.fb-params {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.fb-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}
.fb-note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.fallback a { color: var(--brass); text-underline-offset: 3px; }

/* Desktop guard: the plate never runs under the header (--top-b, set by view.js) or into the dock;
   what does not fit scrolls inside the note, with the same soft edge as on a phone. */
@media (min-width: 761px) {
  .plate { max-height: calc(100vh - var(--top-b, 96px) - 12px - 118px - var(--safe-b)); }
  .plate > * { flex-shrink: 0; }
  .plate > .pl-note {
    flex: 0 1 auto;
    min-height: 3em;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  .plate > .pl-note::-webkit-scrollbar { display: none; }
  .plate > .pl-note.scrolls {
    padding-bottom: 16px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
  }
  .plate > .pl-note:focus-visible { outline: 1px solid var(--brass-hi); outline-offset: 3px; }
}
@media (min-width: 761px) and (max-height: 660px) {
  .pl-day { display: none; }
  .plate { gap: 7px; }
}

@media (max-width: 760px) {
  :root { --pad-x: 16px; --pad-y: 16px; }
  .frame { display: none; }
  .top { flex-wrap: wrap; gap: 8px 12px; }
  .actions { gap: 6px; margin-left: auto; }
  .tagline { font-size: 10.5px; }
  .brand, .crumb { font-size: 10.5px; letter-spacing: 0.16em; }
  .btn { padding: 7px 9px; font-size: 9.5px; letter-spacing: 0.11em; }
  .plate {
    width: auto;
    right: calc(var(--pad-x) + var(--safe-r));
    bottom: calc(86px + var(--safe-b));
    gap: 6px;
    /* The figure keeps at least 190px under the 104px header; longer text scrolls in place. */
    max-height: calc(100vh - 86px - var(--safe-b) - 104px - 190px);
    max-height: calc(100dvh - 86px - var(--safe-b) - 104px - 190px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    pointer-events: auto;
    padding-bottom: 16px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
  }
  .plate::-webkit-scrollbar { display: none; }
  .pl-name, .pl-name.long { font-size: clamp(24px, 7.2vw, 34px); }
  .plate-head { flex-wrap: wrap; gap: 4px 10px; font-size: 9.5px; letter-spacing: 0.12em; }
  .pl-fam::before { display: none; }
  .pl-formula { font-size: 14px; }
  .pl-formula.long { font-size: 12.5px; }
  .pl-params { font-size: 9.5px; }
  .pl-by { font-size: 9.5px; }
  .pl-note { font-size: 12.5px; line-height: 1.42; }
  .readout { display: none; }
  .dock { bottom: calc(14px + var(--safe-b)); height: 54px; gap: 6px; }
  .step { width: 46px; }
  .scale-fam .t { display: none; }
  .step { width: 36px; }
  .scale-fam { top: 6px; font-size: 9px; }
  /* Ten Roman numerals over 30 ticks: VII and VIII sit one span apart, so no tracking here. */
  .scale-fams.compact .scale-fam { letter-spacing: 0; font-size: 8.5px; }
  .scale-tick.major { height: 20px; }
  .dial { width: 100%; padding: 7px 10px 4px; margin-top: 2px; }
  .dial-sym { font-size: 16px; }
  .dial-val { font-size: 13px; }
  .dial-rail { height: 28px; }
  .index-title .count { display: block; margin: 6px 0 0; }
  .fam-section { padding-top: 24px; }
  .fam-head { gap: 10px; letter-spacing: 0.12em; font-size: 10.5px; }
  .fam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 6px 6px 8px; gap: 6px; }
  .card .nm { font-size: 14px; }
  .fb-name { font-size: 20px; }
}

@media (max-width: 760px) and (max-height: 720px) {
  .pl-day { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .plate, .scale-fam, .btn, .step, .dial-reset { transition: none; }
}
