:root {
  --blue: #0000ee;
  --red: #cc1b12;
  --ink: #111111;
  --faint: #858585;
  --hair: #dedbd4;
  --paper: #f1efe9;
  --bone: #d8cdb8;
  --panel: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: Verdana, Geneva, Arial, sans-serif;
  font-size: 11px;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
}

#hdr {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 45px;
  padding: 14px 18px 11px 24px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
  overflow-x: auto;
  background: #fff;
}
#hdr::-webkit-scrollbar { display: none; }
#brand {
  color: var(--blue);
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 5px;
  text-decoration: none;
}
#nav { color: var(--faint); font-size: 10px; letter-spacing: 1px; }
#nav a { color: var(--red); text-decoration: none; padding: 0 2px; }
#nav a:hover { text-decoration: underline; }
#nav a.cur { font-weight: bold; color: var(--blue); }
#nav .loc { color: var(--faint); font-size: 8px; vertical-align: super; letter-spacing: 0; }

#wrap { display: flex; height: calc(100% - 45px); }
#panel {
  flex: 0 0 322px;
  overflow-y: auto;
  border-right: 1px solid var(--hair);
  padding: 21px 18px 54px 24px;
  background: var(--panel);
  scrollbar-width: thin;
}
#view { flex: 1; min-width: 0; position: relative; overflow: hidden; background: var(--paper); }
#view canvas { display: block; cursor: grab; outline: none; }
#view canvas:active { cursor: grabbing; }

.eyebrow { color: var(--red); font-size: 8px; letter-spacing: 1.7px; margin-bottom: 8px; }
h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 31px;
  font-weight: normal;
  font-style: italic;
  letter-spacing: -.8px;
  margin-bottom: 10px;
}
.lede { color: #5e5e5e; font-size: 9px; line-height: 1.65; max-width: 270px; }
.panel-section { margin-top: 22px; padding-top: 2px; }
.panel-section.first { margin-top: 18px; }
.panel-section h2 {
  color: var(--blue);
  font-size: 10px;
  letter-spacing: 1.8px;
  margin-bottom: 11px;
}
.panel-section h2 span { color: var(--red); font-weight: normal; }
.section-note { color: var(--faint); font-size: 8px; line-height: 1.55; margin: -3px 0 12px; }
.row { margin-bottom: 10px; }
.row > label,
.seed-line label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 8px;
  margin-bottom: 4px;
}
.row label output { color: var(--blue); font-size: 9px; letter-spacing: 0; }
.seed-line { display: grid; grid-template-columns: 1fr 94px; align-items: end; gap: 8px; margin-top: 2px; }
.seed-line label { margin-bottom: 6px; }

select,
input[type="number"],
button {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--blue);
  font: inherit;
}
select, input[type="number"] { height: 26px; padding: 4px 6px; }
input[type="range"] {
  width: 100%;
  height: 15px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 14px;
  margin-top: -6px;
  background: #fff;
  border: 1.5px solid var(--red);
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--ink); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 12px; border: 1.5px solid var(--red); border-radius: 0; background: #fff; }
button {
  color: var(--red);
  border-color: var(--red);
  min-height: 29px;
  padding: 7px 8px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 8px;
  cursor: pointer;
}
button:hover, button.primary { color: #fff; background: var(--red); }
button.primary:hover { background: var(--blue); border-color: var(--blue); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.button-grid { display: grid; gap: 6px; }
.button-grid.two { grid-template-columns: 1fr 1fr; }
.check-line { display: flex; gap: 7px; align-items: center; color: var(--red); font-size: 8px; letter-spacing: .7px; text-transform: uppercase; }
.check-line input { accent-color: var(--blue); }
.note { color: var(--faint); font-size: 8px; line-height: 1.55; margin-top: 10px; }

.print-note { display: flex; align-items: center; gap: 9px; border-left: 2px solid var(--hair); padding: 4px 0 5px 9px; margin-bottom: 10px; }
.print-note div { display: flex; flex-direction: column; gap: 2px; }
.print-note b { color: var(--blue); font-size: 9px; letter-spacing: .5px; font-weight: normal; }
.print-note small { color: var(--faint); font-size: 8px; line-height: 1.35; }
.print-dot { width: 8px; height: 8px; border: 1px solid var(--red); background: #fff; }
.print-dot.good { background: #149545; border-color: #149545; }
.print-dot.warn { background: #e5a900; border-color: #e5a900; }

#status,
#stageReadout,
#meta,
#hint,
#speciesCard,
#inspector,
#legend { position: absolute; z-index: 2; pointer-events: none; }
#status { top: 16px; left: 19px; color: var(--red); font-size: 9px; letter-spacing: 2px; }
#stageReadout { top: 14px; right: 19px; display: flex; gap: 8px; align-items: baseline; color: var(--faint); font-size: 8px; letter-spacing: 1.5px; }
#stageReadout b { color: var(--blue); font-size: 11px; }
#speciesCard {
  top: 49px;
  left: 19px;
  padding-left: 9px;
  border-left: 2px solid var(--red);
  display: flex;
  flex-direction: column;
  max-width: 230px;
}
#speciesCard p,
#inspector p { color: var(--red); font-size: 7px; letter-spacing: 1.4px; margin-bottom: 4px; }
#speciesCard strong,
#inspector strong { color: var(--blue); font-family: Georgia, 'Times New Roman', serif; font-size: 16px; font-style: italic; font-weight: normal; }
#speciesCard span,
#inspector span { color: var(--faint); font-size: 8px; letter-spacing: .5px; line-height: 1.45; margin-top: 3px; }
#inspector {
  left: 19px;
  bottom: 38px;
  width: 250px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, .86);
  display: flex;
  flex-direction: column;
}
#inspector strong { font-size: 14px; }
#legend { right: 19px; top: 48px; display: none; color: #555; font-size: 8px; text-transform: uppercase; letter-spacing: .8px; }
#legend.show { display: flex; }
#legend > div { display: none; flex-direction: column; align-items: flex-end; gap: 5px; }
#legend[data-mode="REGION"] [data-legend="REGION"],
#legend[data-mode="SURFACE"] [data-legend="SURFACE"] { display: flex; }
#legend span { display: flex; align-items: center; gap: 6px; }
#legend i { display: block; width: 8px; height: 8px; }
#legend .axial { background: #e7d9bd; }
#legend .ribs { background: #d8a77d; }
#legend .limbs { background: #aebcc2; }
#legend .skull { background: #d8a4aa; }
#legend .tail { background: #b9b18d; }
#legend .cortical { background: #d8cdb8; }
#legend .attachment { background: #b68063; }
#legend .endplate { background: #c69e62; }
#legend .articular { background: #a9c7ca; }
#legend .dental { background: #eee2bd; }
#meta { left: 19px; bottom: 14px; color: var(--faint); font-size: 8px; letter-spacing: .8px; }
#hint { right: 19px; bottom: 14px; color: var(--faint); font-size: 8px; letter-spacing: .8px; text-align: right; }
#webglError { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); color: var(--red); }

@media (max-width: 820px) {
  #wrap { flex-direction: column-reverse; }
  #panel { flex: 1; width: 100%; border-right: 0; border-top: 1px solid var(--hair); }
  #view { flex: 0 0 48vh; }
  #inspector { display: none; }
  #hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
