:root {
  --paper: #f3efe6;
  --paper-deep: #eae4d8;
  --paper-light: #fbf8f0;
  --ink: #17322b;
  --ink-soft: #3f514a;
  --muted: #737e77;
  --forest: #123a32;
  --forest-deep: #0b211c;
  --forest-mid: #1a4a40;
  --accent: #c86f50;
  --accent-deep: #a85339;
  --gold: #c8a66c;
  --line: rgba(23, 50, 43, 0.14);
  --line-strong: rgba(23, 50, 43, 0.24);
  --display: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --body: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow-lg: 0 32px 80px rgba(14, 37, 31, 0.13);
  --shadow-md: 0 16px 40px rgba(14, 37, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.26;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: #fff8ed;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

p,
h1,
h2,
h3,
h4,
ul,
ol {
  margin-top: 0;
}

p {
  line-height: 1.75;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 4px;
  background: var(--forest);
  color: var(--paper-light);
  font-size: 12px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.wrap {
  width: min(1440px, calc(100% - 80px));
  margin-inline: auto;
}

/* -------------------------------------------------------------------------- */
/* Typography and shared elements                                             */
/* -------------------------------------------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: currentColor;
  opacity: 0.42;
}

.eyebrow-index {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 8px;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

.hero-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 3px;
  padding: 3px 7px;
  border: 1px solid rgba(200, 111, 80, 0.26);
  border-radius: 999px;
  color: var(--accent-deep);
  font-size: 6.5px;
  letter-spacing: 0.09em;
}

.hero-live-badge i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 111, 80, 0.12);
}

.eyebrow.on-dark {
  color: rgba(246, 239, 225, 0.62);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button span {
  font-size: 15px;
  font-weight: 400;
}

.button-primary {
  background: var(--forest);
  color: var(--paper-light);
}

.button-primary:hover {
  background: var(--forest-mid);
}

.button-quiet {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button-quiet:hover {
  border-color: var(--ink);
  background: rgba(23, 50, 43, 0.04);
}

.button-dark {
  background: var(--forest);
  color: var(--paper-light);
}

.button-dark:hover {
  background: var(--forest-mid);
}

.button-small {
  min-height: 40px;
  padding: 0 17px;
  font-size: 11px;
}

.full-width {
  width: 100%;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.9;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-button:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
}

.text-button.on-dark {
  border-color: rgba(255, 249, 236, 0.24);
  color: rgba(255, 249, 236, 0.92);
}

.text-button.on-dark:hover {
  color: #fff;
  border-color: var(--accent);
}

.text-button span {
  font-size: 14px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 300;
  line-height: 1;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.icon-button:hover {
  border-color: var(--ink);
  background: rgba(23, 50, 43, 0.05);
  transform: rotate(5deg);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 60px;
  margin-bottom: 38px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-family: var(--display);
  font-size: clamp(38px, 4.2vw, 62px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.section-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(380px, 34vw);
  padding-bottom: 7px;
}

.section-side p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

/* -------------------------------------------------------------------------- */
/* Site header                                                               */
/* -------------------------------------------------------------------------- */

.site-topline {
  position: relative;
  z-index: 110;
  background: var(--forest-deep);
  color: rgba(245, 237, 223, 0.62);
}

.topline-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.topline-mid {
  color: rgba(245, 237, 223, 0.35);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: rgba(243, 239, 230, 0.9);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(247, 243, 235, 0.95);
  box-shadow: 0 8px 30px rgba(23, 50, 43, 0.05);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  color: var(--forest);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-text strong {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
}

.brand-text small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.18em;
  line-height: 1;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-left: auto;
}

.main-nav a {
  position: relative;
  padding: 10px 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--ink);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.note-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.note-button svg {
  width: 17px;
  height: 17px;
}

.note-button:hover {
  color: var(--accent-deep);
}

.note-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper-light);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 17px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--paper-light);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-cta:hover {
  background: var(--forest-mid);
  transform: translateY(-1px);
}

.nav-cta span {
  font-size: 13px;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  margin: 4px auto;
  background: var(--ink);
  transition: transform 0.25s ease;
}

/* -------------------------------------------------------------------------- */
/* Hero                                                                      */
/* -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 58px 0 82px;
  background:
    radial-gradient(circle at 77% 41%, rgba(200, 111, 80, 0.09), transparent 32%),
    radial-gradient(circle at 22% 5%, rgba(200, 166, 108, 0.08), transparent 30%),
    linear-gradient(180deg, #f6f2e9 0%, var(--paper) 82%);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% + 142px);
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(23, 50, 43, 0.1) 18%, rgba(23, 50, 43, 0.06) 76%, transparent);
}

.hero::after {
  content: "FIG. 01 / ANATOMY COMMONS";
  position: absolute;
  right: 26px;
  bottom: 110px;
  color: rgba(23, 50, 43, 0.22);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  transform: rotate(90deg) translateX(100%);
  transform-origin: right bottom;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  gap: 58px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding-top: 6px;
}

.hero-eyebrow {
  margin-bottom: 27px;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 31px;
  font-family: var(--display);
  font-size: clamp(58px, 6.6vw, 98px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.99;
}

.hero h1 .title-line {
  display: block;
  white-space: nowrap;
}

.title-accent {
  position: relative;
  display: inline-block;
  z-index: 0;
  color: var(--accent);
}

.title-accent::after {
  content: "";
  position: absolute;
  right: -3%;
  bottom: 5%;
  left: 2%;
  z-index: -1;
  height: 12px;
  border-radius: 50%;
  background: rgba(200, 111, 80, 0.16);
  transform: rotate(-1.6deg);
}

.title-dot {
  color: var(--accent);
}

.hero-lede {
  max-width: 490px;
  margin-bottom: 31px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 2;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 50px;
}

.hero-actions .button {
  min-width: 133px;
}

.hero-stats {
  display: flex;
  gap: 0;
  width: fit-content;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.hero-stats > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 126px;
  padding: 15px 30px 0 0;
}

.hero-stats > div + div {
  padding-left: 30px;
  border-left: 1px solid var(--line);
}

.hero-stats strong {
  font-family: var(--display);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-stats span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.09em;
}

/* Hero illustration */
.hero-art {
  position: relative;
  min-height: 600px;
  padding: 6px 0 0 32px;
}

.art-orbit {
  position: absolute;
  border: 1px solid rgba(23, 50, 43, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one {
  top: 72px;
  right: -64px;
  width: 520px;
  height: 520px;
}

.orbit-two {
  top: 119px;
  right: -17px;
  width: 426px;
  height: 426px;
  border-style: dashed;
  opacity: 0.55;
}

.plate-card {
  position: relative;
  z-index: 2;
  width: min(430px, 92%);
  margin-left: auto;
  padding: 13px;
  border: 1px solid rgba(23, 50, 43, 0.22);
  border-radius: 3px;
  background: #faf6ed;
  box-shadow: 0 32px 70px rgba(33, 47, 40, 0.17);
  transform: rotate(-3deg);
  animation: plate-float 9s ease-in-out infinite;
}

@keyframes plate-float {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-2.4deg) translateY(-8px); }
}

.plate-head,
.plate-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 5px 12px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
}

.plate-head span:last-child {
  color: var(--muted);
}

.plate-foot {
  padding: 10px 5px 0;
  font-family: var(--body);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.plate-foot span:last-child {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.plate-visual {
  position: relative;
  overflow: hidden;
  border-radius: 1px;
  background:
    radial-gradient(circle at 50% 45%, rgba(209, 191, 160, 0.09), transparent 58%),
    var(--forest-deep);
}

.plate-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(240, 228, 206, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(240, 228, 206, 0.035) 1px, transparent 1px) 0 0 / 28px 28px;
  pointer-events: none;
}

.hero-anatomy {
  width: 100%;
  height: auto;
}

.plate-stamp {
  position: absolute;
  top: 22px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(207, 139, 103, 0.7);
  border-radius: 50%;
  color: rgba(224, 166, 135, 0.85);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-align: center;
  transform: rotate(9deg);
}

.floating-note {
  position: absolute;
  right: 20px;
  bottom: 62px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 196px;
  padding: 14px 18px;
  border: 1px solid rgba(23, 50, 43, 0.17);
  background: rgba(250, 246, 237, 0.94);
  box-shadow: 0 14px 34px rgba(23, 50, 43, 0.13);
  transform: rotate(2deg);
  backdrop-filter: blur(6px);
}

.floating-note-index {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff8ed;
  font-family: var(--mono);
  font-size: 10px;
}

.floating-note div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.floating-note strong {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
}

.floating-note small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.art-caption {
  position: absolute;
  right: -9px;
  bottom: 26px;
  color: rgba(23, 50, 43, 0.34);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
  writing-mode: vertical-rl;
}

/* -------------------------------------------------------------------------- */
/* Atlas section                                                             */
/* -------------------------------------------------------------------------- */

.lab-section {
  position: relative;
  padding: 104px 0 105px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 5% 12%, rgba(200, 166, 108, 0.08), transparent 23%),
    #f2eee5;
}

.lab-section .section-heading {
  align-items: flex-end;
}

.atlas-frame {
  overflow: hidden;
  border: 1px solid rgba(23, 50, 43, 0.22);
  border-radius: 22px;
  background: var(--paper-light);
  box-shadow: var(--shadow-lg);
}

.atlas-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  min-height: 84px;
  padding: 16px 22px 16px 26px;
  border-bottom: 1px solid var(--line);
  background: #f9f6ee;
}

.atlas-title {
  min-width: 240px;
}

.atlas-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.17em;
}

.atlas-title h3 {
  margin-bottom: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.atlas-title h3 em {
  margin-left: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.atlas-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 268px;
  height: 40px;
  padding: 0 11px 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.72);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  border-color: rgba(23, 50, 43, 0.42);
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(23, 50, 43, 0.05);
}

.search-box > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  height: 100%;
  margin: 0 8px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.search-box input::placeholder {
  color: #9aa29c;
}

.search-box input::-webkit-search-cancel-button {
  opacity: 0.45;
}

.search-shortcut {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #8d968f;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.03em;
}

.search-results {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 40;
  width: 354px;
  max-height: 370px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 20px 50px rgba(23, 50, 43, 0.18);
}

.search-result {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: background-color 0.15s ease;
}

.search-result:hover,
.search-result.is-highlighted {
  background: #f1ebdf;
}

.search-result-index {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.search-result-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.search-result-name strong {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
}

.search-result-name small {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-region {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.search-empty {
  padding: 18px 16px;
}

.search-empty > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
}

.search-empty p {
  margin: 7px 0 13px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.search-empty small {
  display: block;
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.search-empty-missing > span {
  color: var(--accent-deep);
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.search-suggestions button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 10px;
}

.search-suggestions button:hover {
  background: #f1ebdf;
}

.sex-switch {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid rgba(23, 50, 43, 0.08);
  border-radius: 999px;
  background: #eae5da;
}

.sex-switch button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sex-switch button small {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.sex-switch button.active {
  background: #fffdf7;
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(23, 50, 43, 0.1);
}

/* Work area */
.atlas-work {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 356px;
  min-height: 760px;
  background: var(--paper-light);
}

.layer-rail {
  display: flex;
  flex-direction: column;
  padding: 26px 20px 22px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.8), rgba(245, 240, 231, 0.8));
}

.rail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.rail-heading span {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.rail-heading small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 17px;
}

.layer-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 13px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.layer-item:hover {
  background: rgba(23, 50, 43, 0.045);
  color: var(--ink);
}

.layer-item.active {
  background: var(--forest);
  color: var(--paper-light);
  box-shadow: 0 5px 18px rgba(23, 50, 43, 0.16);
}

.layer-num {
  color: currentColor;
  font-family: var(--mono);
  font-size: 8px;
  opacity: 0.55;
}

.layer-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.layer-name strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.1;
}

.layer-name small {
  font-family: var(--mono);
  font-size: 6.8px;
  letter-spacing: 0.08em;
  opacity: 0.58;
  text-transform: uppercase;
}

.layer-item i {
  width: 5px;
  height: 5px;
  justify-self: end;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.18;
}

.layer-item.active i {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(200, 111, 80, 0.15);
}

.rail-depth {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 19px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 5.8px;
  letter-spacing: 0.12em;
  writing-mode: vertical-rl;
}

.rail-depth i {
  width: 1px;
  height: 38px;
  background: linear-gradient(180deg, rgba(23, 50, 43, 0.04), rgba(23, 50, 43, 0.25), rgba(23, 50, 43, 0.04));
}

.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.rail-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.7;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 16px;
  padding: 0 3px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 252, 245, 0.7);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 7px;
}

.xray-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.xray-toggle span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.xray-toggle.active {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--paper-light);
}

.xray-toggle.active span {
  color: var(--gold);
}

.explode-toggle + .explode-toggle,
.xray-toggle + .explode-toggle {
  margin-top: 6px;
}

.explode-toggle {
  border-color: rgba(200, 111, 80, 0.3);
}

.explode-toggle.active {
  border-color: var(--accent);
  background: var(--accent);
}

.explode-toggle.active span {
  color: rgba(255, 248, 237, 0.78);
}

.explode-toggle:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.stage-explode-badge {
  width: fit-content;
  padding: 2px 5px;
  border: 1px solid rgba(200, 111, 80, 0.52);
  border-radius: 2px;
  color: #efb08f;
  font-family: var(--mono);
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.11em;
  line-height: 1.3;
  background: rgba(44, 16, 12, 0.45);
}

.footnote-link {
  margin-left: 6px;
  color: var(--accent-deep);
  font-size: 9px;
  white-space: nowrap;
}

.mobile-url-list {
  display: grid;
  gap: 7px;
  margin: 12px 0 16px;
}

.mobile-url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 252, 245, 0.6);
}

.mobile-url-row > div {
  min-width: 0;
}

.mobile-url-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.06em;
}

.mobile-url-row code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--forest);
  font-size: 11px;
}

.mobile-url-row button {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-soft);
  font-size: 8px;
}

.mobile-link-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.mobile-region-dock {
  display: none;
}

/* Model stage */
.model-stage {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(58, 102, 88, 0.24), transparent 44%),
    linear-gradient(145deg, #0c231e 0%, #102e27 45%, #0a1d19 100%);
  color: var(--paper-light);
  isolation: isolate;
}

.model-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(230, 218, 196, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 218, 196, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 77%);
  pointer-events: none;
}

.model-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: radial-gradient(ellipse at center, transparent 42%, rgba(4, 14, 12, 0.48) 100%);
  pointer-events: none;
}

.stage-topline {
  position: absolute;
  top: 20px;
  right: 23px;
  left: 24px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(242, 234, 218, 0.4);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.15em;
  pointer-events: none;
}

.stage-ruler {
  position: absolute;
  top: 105px;
  bottom: 96px;
  left: 19px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: rgba(242, 234, 218, 0.26);
  font-family: var(--mono);
  font-size: 6.5px;
  pointer-events: none;
}

.stage-ruler::before {
  content: "";
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(239, 228, 207, 0.2), transparent);
}

.stage-caption {
  position: absolute;
  bottom: 38px;
  left: 25px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.stage-caption span {
  color: rgba(242, 234, 218, 0.42);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.stage-caption strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.stage-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid rgba(240, 229, 208, 0.13);
  border-radius: 999px;
  background: rgba(7, 23, 19, 0.44);
  color: rgba(247, 239, 225, 0.65);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.stage-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, 5px);
}

.hint-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 111, 80, 0.14);
}

.stage-bottom {
  position: absolute;
  right: 22px;
  bottom: 27px;
  left: 22px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}

.stage-legend {
  display: flex;
  gap: 15px;
  margin-left: auto;
  margin-right: 18px;
  padding-bottom: 5px;
  color: rgba(247, 239, 225, 0.42);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.stage-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-swatch.bone {
  background: #e2cda3;
}

.legend-swatch.cartilage {
  border: 1px dashed #91ab9c;
}

.reset-view {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(240, 229, 208, 0.14);
  border-radius: 5px;
  background: rgba(8, 25, 21, 0.4);
  color: rgba(247, 239, 225, 0.58);
  font-size: 8px;
  letter-spacing: 0.04em;
  pointer-events: auto;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.reset-view:hover {
  border-color: rgba(240, 229, 208, 0.35);
  color: var(--paper-light);
}

.reset-view span {
  font-size: 11px;
}

.body-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.model-stage.model-switching .body-svg {
  animation: model-swap 0.56s ease;
}

@keyframes model-swap {
  0% { opacity: 0.55; transform: scale(0.995); }
  100% { opacity: 1; transform: scale(1); }
}

/* Real-time 3D layer */
.three-mount {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.model-stage.has-3d .three-mount {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.three-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.three-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
  touch-action: none;
  outline: none;
}

.three-canvas canvas:active {
  cursor: grabbing;
}

.model-stage.has-3d .body-svg {
  display: none;
}

.model-stage.has-3d .region-note {
  opacity: 0 !important;
  visibility: hidden !important;
}

.model-stage.has-3d .stage-ruler {
  opacity: 0.35;
}

.loader-kicker,
.three-notice-kicker {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.15em;
}

.three-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(circle at 50% 48%, rgba(49, 96, 82, 0.36), transparent 35%),
    rgba(5, 19, 16, 0.86);
  color: var(--paper-light);
  text-align: center;
  backdrop-filter: blur(5px);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.three-loading.is-done {
  opacity: 0;
  visibility: hidden;
}

.three-loading[hidden] {
  display: none;
}

.loader-orbit {
  position: relative;
  width: 66px;
  height: 66px;
  margin-bottom: 12px;
  border: 1px solid rgba(224, 210, 185, 0.22);
  border-radius: 50%;
  animation: loader-spin 6s linear infinite;
}

.loader-orbit span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(200, 111, 80, 0.7);
}

.loader-orbit span:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg) translateY(-33px); }
.loader-orbit span:nth-child(2) { transform: translate(-50%, -50%) rotate(120deg) translateY(-33px); background: var(--gold); }
.loader-orbit span:nth-child(3) { transform: translate(-50%, -50%) rotate(240deg) translateY(-33px); background: #8bb6a4; }

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

.three-loading strong {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.three-loading p {
  margin: 0;
  color: rgba(247, 239, 225, 0.44);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.loader-progress {
  width: min(220px, 55%);
  height: 2px;
  margin-top: 13px;
  overflow: hidden;
  background: rgba(247, 239, 225, 0.15);
}

.loader-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.3s ease;
}

.loader-percent {
  color: rgba(247, 239, 225, 0.55);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.three-notice {
  position: absolute;
  top: 72px;
  left: 50%;
  z-index: 9;
  width: min(390px, calc(100% - 44px));
  padding: 15px 17px;
  border: 1px solid rgba(240, 229, 208, 0.19);
  border-radius: 8px;
  background: rgba(8, 27, 22, 0.92);
  color: var(--paper-light);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.three-notice[hidden] {
  display: none;
}

.three-notice strong {
  display: block;
  margin: 5px 0 5px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
}

.three-notice p {
  margin: 0;
  color: rgba(247, 239, 225, 0.58);
  font-size: 9.5px;
  line-height: 1.75;
}

.three-notice-action {
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(240, 229, 208, 0.22);
  border-radius: 4px;
  background: transparent;
  color: var(--paper-light);
  font-size: 8px;
}

.stage-tools {
  position: absolute;
  top: 48px;
  right: 22px;
  z-index: 5;
  display: flex;
  gap: 6px;
}

.stage-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid rgba(240, 229, 208, 0.16);
  border-radius: 5px;
  background: rgba(7, 24, 19, 0.58);
  color: rgba(247, 239, 225, 0.6);
  font-size: 8px;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.stage-tool:hover {
  border-color: rgba(240, 229, 208, 0.35);
  color: var(--paper-light);
}

.stage-tool span {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 6.5px;
}

.stage-tool.is-on {
  border-color: rgba(200, 166, 108, 0.36);
  color: var(--paper-light);
}

.view-orientation {
  position: absolute;
  top: 86px;
  right: 22px;
  z-index: 5;
  display: grid;
  grid-template-columns: 27px 27px;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(240, 229, 208, 0.13);
  border-radius: 5px;
  background: rgba(7, 24, 19, 0.48);
  backdrop-filter: blur(8px);
}

.view-orientation-label {
  grid-column: 1 / -1;
  padding: 1px 0 3px;
  color: rgba(247, 239, 225, 0.3);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.12em;
  text-align: center;
}

.view-orientation button {
  width: 27px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: rgba(247, 239, 225, 0.48);
  font-family: var(--display);
  font-size: 10px;
}

.view-orientation button:hover,
.view-orientation button.active {
  border-color: rgba(240, 229, 208, 0.2);
  background: rgba(240, 229, 208, 0.08);
  color: var(--paper-light);
}

.model-stage:not(.has-3d) .stage-tools,
.model-stage:not(.has-3d) .view-orientation,
.model-stage:not(.has-3d) .three-mount {
  display: none;
}

.model-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  background-color: var(--forest-deep);
}

.model-stage:fullscreen .stage-tools {
  top: 62px;
  right: 36px;
}

.model-stage:fullscreen .view-orientation {
  top: 102px;
  right: 36px;
}

.detail-pick-badge {
  margin-left: 8px;
  padding: 3px 6px;
  border: 1px solid rgba(200, 111, 80, 0.28);
  border-radius: 999px;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}

/* Bone tooltip */
.bone-tooltip {
  position: absolute;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  padding: 10px 13px;
  border: 1px solid rgba(242, 231, 211, 0.2);
  border-radius: 7px;
  background: rgba(249, 245, 236, 0.97);
  color: var(--ink);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.bone-tooltip[hidden] {
  display: none;
}

.bone-tooltip span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

.bone-tooltip strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.1;
}

.bone-tooltip small {
  color: var(--accent-deep);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

/* SVG layers and bones */
.body-svg .layer {
  transition: opacity 0.48s ease, visibility 0.48s ease;
}

.body-svg .skin-layer,
.body-svg .muscle-layer,
.body-svg .organ-layer,
.body-svg .skeleton-layer {
  opacity: 0;
  visibility: hidden;
}

.body-svg[data-mode="skin"] .skin-layer,
.body-svg[data-mode="muscle"] .muscle-layer,
.body-svg[data-mode="organs"] .organ-layer,
.body-svg[data-mode="skeleton"] .skeleton-layer {
  opacity: 1;
  visibility: visible;
}

.body-svg[data-mode="xray"] .skin-layer {
  opacity: 0.08;
  visibility: visible;
}

.body-svg[data-mode="xray"] .muscle-layer {
  opacity: 0.22;
  visibility: visible;
}

.body-svg[data-mode="xray"] .organ-layer {
  opacity: 0.88;
  visibility: visible;
}

.body-svg[data-mode="xray"] .skeleton-layer {
  opacity: 0.68;
  visibility: visible;
}

.body-svg[data-mode="skin"] .ghost-body {
  opacity: 0;
}

.ghost-body {
  fill: rgba(238, 226, 204, 0.1);
  opacity: 0.72;
  transition: opacity 0.4s ease;
}

.body-svg[data-mode="muscle"] .ghost-body,
.body-svg[data-mode="organs"] .ghost-body {
  opacity: 0.34;
}

.body-svg[data-mode="skeleton"] .ghost-body {
  opacity: 0.55;
}

.body-svg[data-mode="xray"] .ghost-body {
  opacity: 0.18;
}

.body-svg[data-sex="male"] .sex-female,
.body-svg[data-sex="female"] .sex-male {
  display: none;
}

.skin-fill {
  fill: url(#skinGrad);
}

.skin-contours,
.skin-highlights {
  fill: none;
  stroke-linecap: round;
}

.skin-contours {
  stroke: rgba(73, 48, 35, 0.34);
  stroke-width: 0.9;
}

.skin-highlights {
  stroke: rgba(255, 244, 228, 0.2);
  stroke-width: 1.4;
}

.surface-labels line,
.muscle-labels line,
.organ-labels line {
  stroke: rgba(235, 223, 202, 0.28);
  stroke-width: 0.8;
}

.surface-labels text,
.muscle-labels text,
.organ-labels text {
  fill: rgba(246, 238, 222, 0.76);
  font-family: var(--body);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.surface-labels .label-sub,
.muscle-labels .label-sub,
.organ-labels .label-sub {
  fill: rgba(246, 238, 222, 0.38);
  font-family: var(--mono);
  font-size: 6.2px;
  letter-spacing: 0.06em;
}

.muscle-base {
  fill: url(#muscleBase);
}

.muscle-contour path {
  fill: url(#muscleGrad);
  stroke: rgba(48, 17, 14, 0.4);
  stroke-width: 0.75;
  opacity: 0.89;
}

.muscle-line {
  fill: none;
  stroke: rgba(255, 222, 201, 0.17);
  stroke-width: 1.1;
}

.organ-body {
  fill: rgba(238, 226, 204, 0.075);
}

.organ-set > path {
  stroke: rgba(67, 27, 25, 0.35);
  stroke-width: 0.9;
}

.organ-brain { fill: url(#organBrain); }
.organ-lung-left,
.organ-lung-right { fill: url(#organLung); }
.organ-heart { fill: url(#organPink); }
.organ-liver { fill: url(#organLiver); }
.organ-stomach { fill: url(#organStomach); }
.organ-kidney-left,
.organ-kidney-right { fill: #a0615b; }
.organ-intestine { fill: #bc7b70; }
.organ-bladder { fill: #c9967c; }
.organ-trachea { fill: #b9837a; }
.organ-uterus { fill: #c88784; }
.organ-ovary { fill: #b56c6b; }
.organ-prostate { fill: #a96258; }

.body-svg[data-mode="xray"] .surface-labels,
.body-svg[data-mode="xray"] .muscle-labels {
  opacity: 0;
}

.region-note {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.model-stage[data-region="pelvis"] .pelvis-note,
.model-stage[data-region="skull"] .skull-note {
  opacity: 1;
  visibility: visible;
}

.region-note line {
  stroke: rgba(232, 218, 194, 0.35);
  stroke-width: 0.8;
  stroke-dasharray: 2 3;
}

.region-note text {
  fill: rgba(248, 240, 225, 0.82);
  font-family: var(--body);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.region-note .label-sub {
  fill: rgba(248, 240, 225, 0.42);
  font-family: var(--mono);
  font-size: 6.2px;
  letter-spacing: 0.07em;
}

.pelvis-male .bone-cutout,
.pelvis-female .bone-cutout {
  opacity: 0.52;
}

.bone-group {
  outline: none;
  cursor: pointer;
  transition: opacity 0.32s ease;
}

.bone-art {
  fill: url(#boneGrad);
  stroke: rgba(252, 244, 226, 0.6);
  stroke-width: 0.8;
  transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

.bone-stroke {
  fill: none;
  stroke: url(#boneGrad);
  stroke-width: 4.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease, filter 0.2s ease;
}

.bone-thin {
  stroke-width: 2.2;
}

.bone-ramus {
  stroke-width: 9;
}

.bone-soft {
  fill: url(#boneGrad);
  stroke: rgba(252, 244, 226, 0.28);
  stroke-width: 0.6;
  opacity: 0.6;
}

.bone-suture {
  stroke-width: 0.9;
  opacity: 0.55;
}

.bone-cartilage {
  fill: none;
  stroke: #8ca797;
  stroke-width: 2.2;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
  opacity: 0.65;
  pointer-events: none;
}

.bone-cutout {
  fill: #10261f;
  stroke: rgba(237, 224, 200, 0.24);
  stroke-width: 1;
  pointer-events: none;
}

.bone-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
}

.bone-group:hover .bone-art {
  fill: #f5e4bd;
  stroke: #fff1d4;
  filter: drop-shadow(0 0 5px rgba(245, 213, 158, 0.55));
}

.bone-group:hover .bone-stroke {
  stroke: #f8e4bc;
  filter: drop-shadow(0 0 4px rgba(245, 213, 158, 0.55));
}

.bone-group.is-selected {
  opacity: 1;
}

.bone-group.is-selected .bone-art {
  fill: url(#boneGold);
  stroke: #ffe7bc;
  filter: drop-shadow(0 0 7px rgba(230, 169, 104, 0.78));
}

.bone-group.is-selected .bone-stroke {
  stroke: #f5bd7c;
  filter: drop-shadow(0 0 6px rgba(230, 169, 104, 0.8));
}

.bone-group.is-muted {
  opacity: 0.11;
}

.bone-group.is-muted:hover {
  opacity: 0.68;
}

.bone-group:focus-visible .bone-art {
  stroke: #ffd5a0;
  stroke-width: 2;
  filter: drop-shadow(0 0 7px rgba(245, 188, 121, 0.85));
}

.bone-group:focus-visible .bone-stroke {
  stroke: #ffd5a0;
  filter: drop-shadow(0 0 6px rgba(245, 188, 121, 0.85));
}

.bone-group.selection-flash .bone-art,
.bone-group.selection-flash .bone-stroke {
  animation: bone-flash 0.75s ease;
}

@keyframes bone-flash {
  0% { opacity: 0.4; }
  40% { opacity: 1; filter: drop-shadow(0 0 14px rgba(255, 204, 140, 1)); }
  100% { opacity: 1; }
}

/* Detail panel */
.detail-panel {
  max-height: 760px;
  overflow-y: auto;
  padding: 27px 26px 24px;
  border-left: 1px solid var(--line);
  background: #f9f6ee;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 50, 43, 0.24) transparent;
}

.detail-panel::-webkit-scrollbar {
  width: 5px;
}

.detail-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(23, 50, 43, 0.18);
}

.detail-panel > * {
  animation: detail-in 0.4s ease both;
}

.detail-panel.is-selection-refreshed {
  animation: detail-panel-refresh 0.72s ease;
}

@keyframes detail-panel-refresh {
  0% { box-shadow: inset 0 0 0 0 rgba(200, 111, 80, 0); background: #f9f6ee; }
  26% { box-shadow: inset 0 0 0 2px rgba(200, 111, 80, 0.52); background: #fffaf0; }
  100% { box-shadow: inset 0 0 0 0 rgba(200, 111, 80, 0); background: #f9f6ee; }
}

@keyframes detail-in {
  0% { opacity: 0; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}

.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  margin-bottom: 12px;
}

.detail-kicker {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  line-height: 1.6;
}

.detail-count {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}

.detail-close {
  width: 25px;
  height: 25px;
  margin: -4px -4px -4px auto;
  border-color: transparent;
  color: var(--muted);
  font-size: 17px;
}

.detail-region {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.region-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 111, 80, 0.13);
}

.region-en {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.detail-name {
  margin-bottom: 3px;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.16;
}

.detail-name .detail-en {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-latin {
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.03em;
}

.detail-summary {
  margin-bottom: 17px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.95;
  text-align: justify;
}

.bone-facts {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  margin-bottom: 19px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.bone-facts div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 10px 11px 0;
}

.bone-facts div + div {
  padding-left: 15px;
  border-left: 1px solid var(--line);
}

.bone-facts span,
.layer-stats span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bone-facts strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.detail-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.detail-subhead span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
  font-weight: 400;
  letter-spacing: 0.11em;
}

.function-list {
  list-style: none;
  margin: 0 0 17px;
  padding: 0;
}

.function-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(23, 50, 43, 0.09);
}

.function-list li:last-child {
  border-bottom: 1px solid rgba(23, 50, 43, 0.09);
}

.function-list li > span {
  padding-top: 3px;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 7px;
}

.function-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.65;
}

.clinical-card {
  margin: 17px 0;
  padding: 13px 14px 12px;
  border-left: 2px solid var(--accent);
  background: #f0e6d7;
}

.clinical-label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 6.3px;
  letter-spacing: 0.1em;
}

.clinical-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.75;
}

.sex-note {
  margin: 13px 0;
  padding: 12px 13px;
  border: 1px solid rgba(23, 50, 43, 0.13);
  background: rgba(23, 50, 43, 0.045);
}

.sex-note span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.3px;
  letter-spacing: 0.11em;
}

.sex-note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.75;
}

.fact-line {
  padding: 10px 0 0;
  border-top: 1px dashed var(--line);
}

.fact-line span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.fact-line p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.7;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.detail-actions .button {
  flex: 1 1 auto;
  min-height: 38px;
  padding: 0 12px;
  font-size: 9.5px;
  gap: 6px;
}

.detail-actions .button.is-saved {
  background: var(--accent-deep);
}

.bone-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.bone-stepper button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.bone-stepper button:hover {
  color: var(--accent-deep);
}

.bone-stepper span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.layer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.layer-stats div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 70px;
  padding: 12px 10px 11px 0;
}

.layer-stats div + div {
  padding-left: 11px;
  border-left: 1px solid var(--line);
}

.layer-stats strong {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.notice-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  padding: 9px 0;
  border-top: 1px solid rgba(23, 50, 43, 0.09);
}

.notice-list li:last-child {
  border-bottom: 1px solid rgba(23, 50, 43, 0.09);
}

.notice-list li > span {
  padding-top: 2px;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 7px;
}

.notice-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.68;
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 17px;
}

.detail-chips span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
}

.bone-chip-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 15px;
}

.bone-chip-list button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  text-align: left;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.bone-chip-list button:hover {
  border-color: var(--ink);
  background: rgba(23, 50, 43, 0.04);
}

.bone-chip-list span {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
}

.bone-chip-list small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.03em;
}

.detail-prompt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 15px 0 10px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
}

.prompt-arrow {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.2;
}

.detail-prompt p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

/* Region bar */
.region-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line);
  background: #f6f2e9;
}

.region-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 80px;
  padding: 15px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.region-tab:last-child {
  border-right: 0;
}

.region-tab:hover {
  background: #eee8dc;
  color: var(--ink);
}

.region-tab.active {
  background: var(--forest);
  color: var(--paper-light);
}

.region-num {
  color: currentColor;
  font-family: var(--mono);
  font-size: 7.5px;
  opacity: 0.48;
}

.region-tab > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.region-tab strong {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.region-tab small {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.atlas-footnote {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 820px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.atlas-footnote span {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}

/* -------------------------------------------------------------------------- */
/* Learning paths                                                            */
/* -------------------------------------------------------------------------- */

.path-section {
  padding: 104px 0 112px;
  background:
    radial-gradient(circle at 92% 6%, rgba(200, 111, 80, 0.06), transparent 24%),
    var(--paper);
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.path-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  padding: 23px 25px 21px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 240, 0.56);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.path-card:hover {
  z-index: 2;
  border-color: rgba(23, 50, 43, 0.3);
  box-shadow: 0 22px 45px rgba(23, 50, 43, 0.09);
  transform: translateY(-6px);
}

.path-card-accent {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--paper-light);
}

.path-card-accent:hover {
  border-color: var(--forest);
  box-shadow: 0 22px 45px rgba(18, 58, 50, 0.18);
}

.path-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 33px;
}

.path-index {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.9;
  opacity: 0.7;
}

.path-level {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

.path-card-accent .path-level {
  border-color: rgba(247, 239, 225, 0.2);
  color: rgba(247, 239, 225, 0.58);
}

.path-kicker {
  margin-bottom: 10px;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.path-card-accent .path-kicker {
  color: var(--gold);
}

.path-card h3 {
  margin-bottom: 14px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.path-desc {
  max-width: 320px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.85;
}

.path-card-accent .path-desc {
  color: rgba(247, 239, 225, 0.6);
}

.path-meta {
  display: flex;
  gap: 18px;
  margin-top: auto;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.path-card-accent .path-meta {
  color: rgba(247, 239, 225, 0.47);
}

.path-progress {
  width: 100%;
  height: 2px;
  margin-bottom: 9px;
  overflow: hidden;
  background: rgba(23, 50, 43, 0.1);
}

.path-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.path-card-accent .path-progress {
  background: rgba(247, 239, 225, 0.14);
}

.path-card-accent .path-progress span {
  background: var(--gold);
}

.path-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.path-bottom > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
}

.path-card-accent .path-bottom > span {
  color: rgba(247, 239, 225, 0.45);
}

.path-card .text-button {
  border-bottom-color: transparent;
  font-size: 9px;
}

.path-card .text-button:hover {
  border-bottom-color: currentColor;
}

.path-card-accent .text-button {
  color: var(--paper-light);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.path-card:nth-child(2) {
  transition-delay: 0.06s;
}

.path-card:nth-child(3) {
  transition-delay: 0.12s;
}

/* -------------------------------------------------------------------------- */
/* Practice / quiz                                                           */
/* -------------------------------------------------------------------------- */

.practice-section {
  position: relative;
  overflow: hidden;
  padding: 100px 0;
  background:
    radial-gradient(circle at 85% 30%, rgba(200, 111, 80, 0.11), transparent 35%),
    linear-gradient(135deg, #123a32 0%, #0d2b24 75%, #0a211c 100%);
  color: var(--paper-light);
}

.practice-section::after {
  content: "";
  position: absolute;
  top: -180px;
  left: 52%;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(245, 236, 220, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.practice-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  align-items: center;
  gap: 84px;
}

.practice-copy h2 {
  margin-bottom: 22px;
  font-family: var(--display);
  font-size: clamp(42px, 4.5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.practice-lede {
  max-width: 430px;
  margin-bottom: 33px;
  color: rgba(247, 239, 225, 0.58);
  font-size: 12.5px;
  line-height: 1.95;
}

.practice-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 400px;
  padding-top: 17px;
  border-top: 1px solid rgba(247, 239, 225, 0.14);
}

.practice-note-index {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid rgba(247, 239, 225, 0.16);
  border-radius: 3px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}

.practice-note p {
  margin: 0;
  color: rgba(247, 239, 225, 0.38);
  font-size: 9px;
  line-height: 1.7;
}

.quiz-card {
  display: flex;
  flex-direction: column;
  min-height: 466px;
  padding: 26px 30px 22px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(200, 111, 80, 0.07), transparent 28%),
    #faf7ef;
  color: var(--ink);
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.2);
}

.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.quiz-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.quiz-counter {
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.quiz-progress {
  width: 100%;
  height: 2px;
  margin: 16px 0 30px;
  overflow: hidden;
  background: rgba(23, 50, 43, 0.1);
}

.quiz-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.45s ease;
}

#quizBody {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.quiz-question {
  max-width: 570px;
  margin-bottom: 26px;
  font-family: var(--display);
  font-size: clamp(23px, 2.2vw, 31px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.48;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: left;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.quiz-option > span {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: rgba(23, 50, 43, 0.4);
  background: rgba(23, 50, 43, 0.035);
}

.quiz-option:hover:not(:disabled) > span {
  border-color: var(--ink);
  color: var(--ink);
}

.quiz-option.is-correct {
  border-color: #5c8771;
  background: rgba(92, 135, 113, 0.12);
  color: #28533f;
}

.quiz-option.is-correct > span {
  border-color: #5c8771;
  background: #5c8771;
  color: #fff;
}

.quiz-option.is-wrong {
  border-color: #bd7a64;
  background: rgba(189, 122, 100, 0.1);
  color: #7e3f30;
}

.quiz-option.is-wrong > span {
  border-color: #bd7a64;
  background: #bd7a64;
  color: #fff;
}

.quiz-feedback {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 2px solid #5c8771;
  background: rgba(92, 135, 113, 0.1);
}

.quiz-feedback.is-wrong {
  border-left-color: var(--accent);
  background: rgba(200, 111, 80, 0.08);
}

.quiz-feedback span {
  display: block;
  margin-bottom: 4px;
  color: #3f6d55;
  font-size: 9px;
  font-weight: 600;
}

.quiz-feedback.is-wrong span {
  color: var(--accent-deep);
}

.quiz-feedback p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.7;
}

.quiz-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  padding: 16px 0;
}

.quiz-result-kicker {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.quiz-result-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0 16px;
  color: var(--ink);
}

.quiz-result-score strong {
  font-family: var(--display);
  font-size: 76px;
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}

.quiz-result-score span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.quiz-result-message {
  max-width: 470px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.9;
}

.quiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.quiz-foot > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.05em;
}

.quiz-foot .button:disabled {
  opacity: 0.35;
}

/* -------------------------------------------------------------------------- */
/* Community                                                                 */
/* -------------------------------------------------------------------------- */

.community-section {
  padding: 108px 0 112px;
  background:
    radial-gradient(circle at 4% 80%, rgba(200, 166, 108, 0.08), transparent 26%),
    var(--paper);
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 332px;
  gap: 54px;
  align-items: start;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.tag-filters button {
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tag-filters button:hover {
  color: var(--ink);
}

.tag-filters button.active {
  background: var(--forest);
  color: var(--paper-light);
}

.feed-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.post-card {
  padding: 25px 3px 22px;
  border-bottom: 1px solid var(--line);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.post-tag {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.post-card h3 {
  max-width: 760px;
  margin-bottom: 9px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.48;
  transition: color 0.2s ease;
}

.post-card:hover h3 {
  color: var(--accent-deep);
}

.post-excerpt {
  max-width: 760px;
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.9;
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 50, 43, 0.15);
  border-radius: 50%;
  background: #e7dfd1;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 11px;
}

.post-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-author strong {
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 500;
}

.post-author small {
  color: var(--muted);
  font-size: 8px;
}

.post-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.post-action svg {
  width: 15px;
  height: 15px;
}

.post-action:hover {
  background: rgba(23, 50, 43, 0.05);
  color: var(--ink);
}

.post-action.is-liked {
  color: var(--accent-deep);
}

.post-comments {
  margin-top: 15px;
  padding: 12px 14px;
  border-left: 1px solid rgba(23, 50, 43, 0.2);
  background: rgba(255, 252, 245, 0.45);
}

.post-comments[hidden] {
  display: none;
}

.comment {
  padding: 8px 0;
  border-bottom: 1px solid rgba(23, 50, 43, 0.08);
}

.comment:first-child {
  padding-top: 0;
}

.comment-author {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 600;
}

.comment p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.comment-cta {
  padding-top: 9px;
  color: #9aa19b;
  font-size: 7.5px;
}

.no-comments {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.feed-end {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 0 0;
}

.feed-end span {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.feed-end p {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 8.5px;
}

.feed-empty {
  padding: 50px 0;
  text-align: center;
}

.feed-empty > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.feed-empty p {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 11px;
}

.community-aside {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.reading-card {
  position: relative;
  overflow: hidden;
  padding: 26px 24px 21px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 90% 4%, rgba(200, 166, 108, 0.22), transparent 35%),
    var(--forest);
  color: var(--paper-light);
  box-shadow: 0 18px 40px rgba(18, 58, 50, 0.15);
}

.reading-card::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -100px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(245, 237, 223, 0.09);
  border-radius: 50%;
}

.reading-kicker {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.14em;
}

.reading-date {
  margin: 8px 0 22px;
  color: rgba(245, 237, 223, 0.38);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.09em;
}

.reading-card h3 {
  margin-bottom: 12px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.42;
}

.reading-card > p:not(.reading-date) {
  margin-bottom: 17px;
  color: rgba(245, 237, 223, 0.55);
  font-size: 10px;
  line-height: 1.85;
}

.reading-participants {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid rgba(245, 237, 223, 0.12);
}

.reading-participants > span {
  display: flex;
  padding-left: 4px;
}

.reading-participants i {
  width: 20px;
  height: 20px;
  margin-left: -5px;
  border: 1px solid var(--forest);
  border-radius: 50%;
  background: #d3c1a4;
}

.reading-participants i:nth-child(2) { background: #c88769; }
.reading-participants i:nth-child(3) { background: #9cac9e; }

.reading-participants small {
  color: rgba(245, 237, 223, 0.42);
  font-size: 8px;
}

.community-card {
  padding: 19px 20px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 240, 0.5);
}

.community-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
}

.community-card-head span:last-child {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 400;
}

.community-card ol {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.community-card li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 6px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.7;
}

.community-card li span {
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 6.5px;
}

.small-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 16px 15px;
}

.small-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.small-stats div + div {
  border-left: 1px solid var(--line);
}

.small-stats strong {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.small-stats span {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.5;
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                    */
/* -------------------------------------------------------------------------- */

.site-footer {
  padding: 78px 0 22px;
  background:
    radial-gradient(circle at 80% 15%, rgba(200, 166, 108, 0.07), transparent 30%),
    var(--forest-deep);
  color: var(--paper-light);
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 60px;
  padding-bottom: 58px;
  border-bottom: 1px solid rgba(245, 237, 223, 0.12);
}

.footer-brand .brand-mark {
  color: var(--paper-light);
}

.footer-brand .brand-text small {
  color: rgba(245, 237, 223, 0.38);
}

.footer-brand > p {
  margin: 25px 0 0;
  color: rgba(245, 237, 223, 0.46);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.8;
}

.footer-brand > .footer-model-credit {
  max-width: 470px;
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid rgba(245, 237, 223, 0.1);
  color: rgba(245, 237, 223, 0.29);
  font-family: var(--mono);
  font-size: 6.5px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.footer-model-credit a {
  color: rgba(245, 237, 223, 0.46);
  border-bottom: 1px solid rgba(245, 237, 223, 0.18);
}

.footer-model-credit a:hover {
  color: var(--paper-light);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 68px;
}

.footer-nav > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
}

.footer-nav span {
  margin-bottom: 5px;
  color: rgba(245, 237, 223, 0.3);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.footer-nav a,
.footer-nav button {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(245, 237, 223, 0.66);
  font-size: 10px;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.footer-nav a:hover,
.footer-nav button:hover {
  color: var(--paper-light);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding-top: 20px;
}

.footer-bottom p {
  margin: 0;
  color: rgba(245, 237, 223, 0.3);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  line-height: 1.7;
}

.footer-disclaimer {
  max-width: 550px;
  text-align: center;
}

.footer-bottom p:last-child {
  color: rgba(245, 237, 223, 0.2);
}

/* -------------------------------------------------------------------------- */
/* Overlay, drawers, modals, toast                                           */
/* -------------------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 23, 19, 0.52);
  opacity: 1;
  backdrop-filter: blur(4px);
  animation: overlay-in 0.25s ease;
}

.overlay[hidden] {
  display: none;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 220;
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  padding: 28px 27px 20px;
  background: #faf7ef;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.16);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.36s;
}

.drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-wide {
  width: min(620px, 100vw);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.13em;
}

.drawer-head h2 {
  margin-bottom: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.drawer-desc {
  margin: 14px 0 16px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.8;
}

.note-list {
  flex: 1;
  overflow-y: auto;
  margin: 0 -5px;
  padding: 0 5px;
}

.note-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.note-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 15px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.note-index {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.note-main > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.note-main strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
}

.note-main small {
  color: var(--muted);
  font-size: 8.5px;
}

.note-main:hover strong {
  color: var(--accent-deep);
}

.note-remove {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
}

.note-remove:hover {
  background: rgba(23, 50, 43, 0.06);
  color: var(--ink);
}

.drawer-empty {
  padding: 46px 13px;
  text-align: center;
}

.drawer-empty > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.drawer-empty p {
  max-width: 270px;
  margin: 12px auto 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.85;
}

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.drawer-foot > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.drawer-foot .text-button {
  font-size: 8.5px;
}

.drawer-foot .text-button:disabled {
  opacity: 0.35;
}

.index-groups {
  flex: 1;
  overflow-y: auto;
  margin: 0 -5px;
  padding: 0 5px 20px;
}

.index-group {
  padding-top: 19px;
}

.index-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.index-group-head > span {
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 7px;
}

.index-group-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
}

.index-group-head small {
  margin-left: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.index-bone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
}

.index-bone-grid button {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 9px;
  border: 0;
  border-bottom: 1px solid rgba(23, 50, 43, 0.08);
  background: transparent;
  text-align: left;
}

.index-bone-grid button:hover {
  background: rgba(23, 50, 43, 0.04);
}

.index-bone-grid button span {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
}

.index-bone-grid button small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-layer[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 23, 19, 0.58);
  backdrop-filter: blur(5px);
}

.modal {
  position: relative;
  z-index: 1;
  width: min(610px, 100%);
  max-height: min(88vh, 800px);
  overflow-y: auto;
  padding: 27px 29px 25px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  background: #faf7ef;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  animation: modal-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-narrow {
  width: min(560px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

#postForm {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#postForm label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

#postForm input,
#postForm select,
#postForm textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: #fffdf8;
  color: var(--ink);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#postForm textarea {
  resize: vertical;
  min-height: 118px;
  line-height: 1.7;
}

#postForm input:focus,
#postForm select:focus,
#postForm textarea:focus {
  border-color: rgba(23, 50, 43, 0.48);
  box-shadow: 0 0 0 3px rgba(23, 50, 43, 0.05);
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
}

.form-foot p {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.info-modal-body p {
  margin-bottom: 13px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.9;
}

.info-modal-body h4 {
  margin: 20px 0 8px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
}

.info-modal-body ul {
  padding-left: 18px;
  margin-bottom: 16px;
}

.info-modal-body li {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.8;
}

.info-modal-body em {
  font-family: var(--display);
  font-style: italic;
}

.modal-note {
  padding: 11px 13px;
  border-left: 2px solid var(--accent);
  background: #f0e6d7;
  font-size: 10px !important;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 400;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--paper-light);
  font-size: 10px;
  letter-spacing: 0.04em;
  opacity: 0;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                */
/* -------------------------------------------------------------------------- */

@media (max-width: 1280px) {
  .wrap {
    width: calc(100% - 56px);
  }

  .hero-grid {
    gap: 32px;
  }

  .hero h1 {
    font-size: clamp(60px, 7.2vw, 96px);
  }

  .atlas-work {
    grid-template-columns: 170px minmax(0, 1fr) 330px;
  }

  .detail-panel {
    padding: 25px 22px 22px;
  }

  .detail-name {
    font-size: 32px;
  }

  .main-nav {
    gap: 23px;
  }

  .community-layout {
    gap: 36px;
  }

  .path-card h3 {
    font-size: 24px;
  }
}

@media (max-width: 1120px) {
  .hero-art {
    padding-left: 5px;
  }

  .plate-card {
    width: min(390px, 96%);
  }

  .floating-note {
    right: 4px;
  }

  .art-caption {
    display: none;
  }

  .nav-actions .nav-cta {
    display: none;
  }

  .atlas-tools {
    gap: 9px;
  }

  .search-box {
    width: 228px;
  }

  .sex-switch button {
    padding: 0 9px;
  }

  .atlas-work {
    grid-template-columns: 154px minmax(0, 1fr) 316px;
  }

  .layer-rail {
    padding: 23px 15px 18px;
  }

  .region-tab {
    padding: 14px 10px;
    gap: 7px;
  }

  .region-tab strong {
    font-size: 13px;
  }

  .region-tab small {
    font-size: 5.8px;
  }

  .practice-grid {
    gap: 48px;
  }
}

@media (max-width: 980px) {
  body::before {
    opacity: 0.18;
  }

  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .nav-actions {
    margin-left: auto;
  }

  body.nav-open .main-nav {
    position: absolute;
    top: 100%;
    right: 28px;
    left: 28px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbf8f0;
    box-shadow: var(--shadow-md);
  }

  body.nav-open .main-nav a {
    width: 100%;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }

  body.nav-open .main-nav a:last-child {
    border-bottom: 0;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .hero h1 {
    font-size: clamp(64px, 11vw, 104px);
  }

  .hero-art {
    width: min(540px, 88vw);
    min-height: 560px;
    margin: 0 auto;
    padding: 0;
  }

  .plate-card {
    width: 390px;
    margin: 0 auto;
  }

  .floating-note {
    right: 4%;
  }

  .hero::before {
    display: none;
  }

  .section-heading {
    gap: 30px;
  }

  .section-side {
    width: min(340px, 40vw);
  }

  .atlas-bar {
    flex-wrap: wrap;
    gap: 14px;
  }

  .atlas-tools {
    flex: 1;
    justify-content: flex-end;
  }

  .atlas-work {
    grid-template-columns: 148px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    max-height: none;
    min-height: 350px;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 28px 30px 26px;
  }

  .model-stage {
    min-height: 700px;
  }

  .detail-panel .detail-name {
    font-size: 32px;
  }

  .bone-facts {
    max-width: 440px;
  }

  .function-list,
  .clinical-card,
  .sex-note,
  .fact-line,
  .detail-actions {
    max-width: 720px;
  }

  .practice-grid {
    grid-template-columns: 1fr;
    gap: 43px;
  }

  .practice-copy h2 {
    font-size: clamp(44px, 7vw, 64px);
  }

  .community-layout {
    grid-template-columns: 1fr;
  }

  .community-aside {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }

  .small-stats {
    grid-column: 1 / -1;
  }

  .footer-top {
    flex-direction: column;
    gap: 44px;
  }

  .footer-nav {
    width: 100%;
    justify-content: space-between;
    gap: 25px;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .topline-mid {
    display: none;
  }

  .site-topline {
    font-size: 7px;
  }

  .nav-wrap {
    min-height: 70px;
  }

  .brand-text strong {
    font-size: 20px;
  }

  .nav-cta,
  .note-button span:not(.note-count) {
    display: none;
  }

  .note-button {
    padding: 8px;
  }

  .nav-actions {
    gap: 8px;
  }

  .hero {
    padding: 30px 0 58px;
  }

  .hero h1 {
    margin-bottom: 24px;
    font-size: clamp(51px, 15vw, 76px);
    line-height: 1;
  }

  .hero-lede {
    font-size: 13px;
  }

  .hero-actions {
    gap: 12px;
    margin-bottom: 36px;
  }

  .hero-actions .button {
    min-width: 0;
    padding: 0 17px;
    font-size: 10.5px;
  }

  .hero-stats {
    width: 100%;
  }

  .hero-stats > div {
    min-width: 0;
    flex: 1;
    padding-right: 12px;
  }

  .hero-stats > div + div {
    padding-left: 12px;
  }

  .hero-stats strong {
    font-size: 25px;
  }

  .hero-stats span {
    font-size: 7.5px;
    line-height: 1.5;
  }

  .hero-art {
    min-height: 480px;
    padding-top: 12px;
  }

  .plate-card {
    width: min(350px, 92%);
  }

  .floating-note {
    right: 0;
    bottom: 25px;
    min-width: 170px;
    padding: 11px 13px;
  }

  .floating-note-index {
    width: 27px;
    height: 27px;
  }

  .floating-note strong {
    font-size: 12px;
  }

  .orbit-one {
    right: -130px;
    width: 380px;
    height: 380px;
  }

  .orbit-two {
    right: -70px;
    width: 310px;
    height: 310px;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 28px;
  }

  .section-heading h2 {
    font-size: clamp(35px, 10vw, 47px);
  }

  .section-side {
    width: 100%;
  }

  .section-side p {
    margin-bottom: 14px;
  }

  .lab-section,
  .path-section,
  .community-section {
    padding: 70px 0;
  }

  .practice-section {
    padding: 70px 0;
  }

  .atlas-frame {
    border-radius: 14px;
  }

  .atlas-bar {
    align-items: flex-start;
    padding: 16px;
  }

  .atlas-title {
    min-width: 0;
  }

  .atlas-title h3 {
    font-size: 19px;
  }

  .atlas-title h3 em {
    display: none;
  }

  .atlas-tools {
    flex: 1 0 100%;
    align-items: stretch;
    justify-content: space-between;
    gap: 7px;
  }

  .search-box {
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .search-shortcut {
    display: none;
  }

  .search-results {
    right: auto;
    left: -1px;
    width: min(354px, calc(100vw - 66px));
  }

  .sex-switch button {
    padding: 0 9px;
    font-size: 9px;
  }

  .sex-switch button small {
    display: none;
  }

  .atlas-work {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .layer-rail {
    padding: 13px 12px 11px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-heading,
  .rail-depth,
  .rail-foot p {
    display: none;
  }

  .layer-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    margin-top: 0;
  }

  .layer-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 9px 8px;
    border: 1px solid transparent;
  }

  .layer-item.active {
    border-color: var(--forest);
  }

  .layer-num {
    font-size: 6.5px;
  }

  .layer-name {
    gap: 1px;
  }

  .layer-name strong {
    font-size: 13px;
    letter-spacing: 0.04em;
  }

  .layer-name small {
    font-size: 5.8px;
  }

  .layer-item i {
    display: none;
  }

  .rail-foot {
    display: block;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 0;
  }

  .xray-toggle {
    min-height: 28px;
    padding: 5px 9px;
    font-size: 8px;
  }

  .model-stage {
    min-height: 620px;
  }

  .stage-topline {
    top: 16px;
    right: 16px;
    left: 16px;
    font-size: 6.5px;
  }

  .stage-tools {
    top: 40px;
    right: 12px;
    gap: 4px;
  }

  .stage-tool {
    min-height: 26px;
    padding: 0 8px;
    font-size: 7px;
  }

  .stage-tool span {
    font-size: 5.5px;
  }

  .view-orientation {
    top: 74px;
    right: 12px;
    grid-template-columns: 24px 24px;
    padding: 4px;
  }

  .view-orientation button {
    width: 24px;
    height: 21px;
    font-size: 9px;
  }

  .three-notice {
    top: 62px;
    width: calc(100% - 28px);
    padding: 12px 13px;
  }

  .three-notice strong {
    font-size: 15px;
  }

  .three-loading strong {
    font-size: 18px;
  }

  .loader-orbit {
    width: 54px;
    height: 54px;
  }

  .loader-orbit span:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg) translateY(-27px); }
  .loader-orbit span:nth-child(2) { transform: translate(-50%, -50%) rotate(120deg) translateY(-27px); }
  .loader-orbit span:nth-child(3) { transform: translate(-50%, -50%) rotate(240deg) translateY(-27px); }

  .model-stage.has-3d .stage-ruler {
    display: none;
  }

  .stage-ruler {
    top: 85px;
    bottom: 89px;
    left: 12px;
  }

  .stage-caption {
    left: 17px;
    bottom: 23px;
  }

  .stage-caption strong {
    font-size: 14px;
  }

  .stage-hint {
    bottom: 17px;
    max-width: calc(100% - 170px);
    padding: 6px 9px;
    font-size: 7.5px;
    white-space: normal;
    text-align: center;
  }

  .stage-bottom {
    right: 14px;
    bottom: 20px;
    left: auto;
  }

  .stage-legend {
    display: none;
  }

  .reset-view {
    padding: 6px 8px;
    font-size: 7px;
  }

  .detail-panel {
    padding: 22px 18px;
  }

  .detail-name {
    font-size: 30px !important;
  }

  .bone-chip-list {
    grid-template-columns: 1fr 1fr;
  }

  .region-bar {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .region-bar::-webkit-scrollbar {
    display: none;
  }

  .region-tab {
    flex: 0 0 108px;
    min-height: 64px;
    padding: 10px 11px;
    gap: 6px;
  }

  .region-tab strong {
    font-size: 13px;
  }

  .region-tab small {
    font-size: 5.5px;
  }

  .atlas-footnote {
    font-size: 8px;
  }

  .path-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .path-card {
    min-height: 340px;
    padding: 21px;
  }

  .path-card h3 {
    font-size: 25px;
  }

  .practice-grid {
    gap: 34px;
  }

  .practice-copy h2 {
    font-size: clamp(38px, 11vw, 50px);
  }

  .quiz-card {
    min-height: 440px;
    padding: 21px 18px 18px;
    border-radius: 12px;
  }

  .quiz-question {
    font-size: 23px;
  }

  .quiz-option {
    min-height: 45px;
    padding: 9px 11px;
    font-size: 11px;
  }

  .quiz-result-score strong {
    font-size: 62px;
  }

  .community-layout {
    gap: 32px;
  }

  .feed-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .tag-filters {
    gap: 0;
  }

  .tag-filters button {
    padding: 6px 9px;
    font-size: 8.5px;
  }

  .feed-count {
    width: 100%;
  }

  .post-card {
    padding: 21px 0 18px;
  }

  .post-card h3 {
    font-size: 19px;
  }

  .post-excerpt {
    font-size: 10.5px;
  }

  .post-author-row {
    flex-wrap: wrap;
  }

  .post-actions {
    margin-left: auto;
  }

  .community-aside {
    display: flex;
  }

  .feed-end p {
    font-size: 7.5px;
    text-align: center;
  }

  .footer-top {
    padding-bottom: 35px;
  }

  .footer-brand > p {
    font-size: 16px;
  }

  .footer-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px 20px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 18px;
  }

  .footer-disclaimer {
    text-align: left;
  }

  .drawer {
    padding: 22px 19px 18px;
  }

  .drawer-head h2 {
    font-size: 26px;
  }

  .modal-layer {
    padding: 12px;
  }

  .modal {
    padding: 22px 18px 20px;
    border-radius: 11px;
  }

  .modal-head h2 {
    font-size: 25px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .form-foot .button {
    width: 100%;
  }

  .toast {
    bottom: 18px;
    font-size: 9px;
  }
}

/* Mobile-first 3D access: put body-category zoom directly under the viewer. */
@media (max-width: 960px) {
  .mobile-region-dock {
    display: flex;
    flex-direction: column;
    gap: 9px;
    grid-column: 1 / -1;
    padding: 12px 16px 14px;
    background:
      linear-gradient(180deg, #102c25, #0b211c);
    border-top: 1px solid rgba(240, 229, 208, 0.08);
    color: var(--paper-light);
  }

  .mobile-region-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-region-label {
    color: var(--gold);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.12em;
  }

  .mobile-region-label small {
    margin-left: 5px;
    color: rgba(247, 239, 225, 0.32);
    font-size: 5.8px;
    letter-spacing: 0.09em;
  }

  .mobile-region-note {
    color: rgba(247, 239, 225, 0.34);
    font-size: 7px;
    letter-spacing: 0.03em;
  }

  .mobile-region-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .mobile-region-scroll::-webkit-scrollbar {
    display: none;
  }

  .mobile-region-btn {
    display: flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 5px;
    min-height: 35px;
    padding: 8px 11px;
    border: 1px solid rgba(240, 229, 208, 0.13);
    border-radius: 5px;
    background: rgba(5, 19, 16, 0.34);
    color: rgba(247, 239, 225, 0.66);
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }

  .mobile-region-btn strong {
    font-family: var(--display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
  }

  .mobile-region-btn small {
    color: rgba(247, 239, 225, 0.32);
    font-family: var(--mono);
    font-size: 5.6px;
    letter-spacing: 0.04em;
  }

  .mobile-region-btn.active {
    border-color: rgba(244, 231, 208, 0.55);
    background: var(--paper-light);
    color: var(--ink);
  }

  .mobile-region-btn.active small {
    color: var(--muted);
  }

  .region-bar {
    display: none;
  }
}

@media (max-width: 760px) {
  .rail-foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-items: stretch;
  }

  .xray-toggle + .explode-toggle {
    margin-top: 0;
  }

  .mobile-region-dock {
    padding-right: 12px;
    padding-left: 12px;
  }

  .mobile-region-btn {
    min-height: 33px;
    padding: 7px 10px;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 49px;
  }

  .model-stage {
    min-height: 560px;
  }

  .quiz-question {
    font-size: 21px;
  }

  .bone-chip-list {
    grid-template-columns: 1fr;
  }
}

/* Open resources / downloads */
.download-section {
  position: relative;
  overflow: hidden;
  padding: 96px 0 82px;
  background:
    radial-gradient(circle at 78% 15%, rgba(71, 115, 96, 0.24), transparent 30%),
    linear-gradient(135deg, #0b211c, #102f27 58%, #0a1d18);
  color: var(--paper-light);
}

.download-section::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(238, 228, 209, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 228, 209, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000, transparent 78%);
  pointer-events: none;
}

.download-section .wrap {
  position: relative;
  z-index: 1;
}

.download-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 50px;
  align-items: end;
}

.download-section .eyebrow {
  color: rgba(239, 228, 207, 0.56);
}

.download-section .eyebrow-index {
  color: var(--gold);
  border-color: rgba(200, 166, 108, 0.54);
}

.download-head h2 {
  margin: 22px 0 0;
  color: var(--paper-light);
  font-family: var(--display);
  font-size: clamp(46px, 5.4vw, 78px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.download-intro p {
  margin: 0;
  color: rgba(247, 239, 225, 0.6);
  font-size: 12px;
  line-height: 1.95;
}

.download-stamp {
  display: block;
  margin-top: 22px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 54px;
}

.download-card {
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 23px 22px 21px;
  border: 1px solid rgba(237, 224, 203, 0.13);
  background: rgba(5, 19, 16, 0.28);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.download-card:hover {
  border-color: rgba(200, 166, 108, 0.48);
  background: rgba(8, 26, 22, 0.56);
  transform: translateY(-3px);
}

.download-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(239, 228, 207, 0.4);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.09em;
}

.download-card-top i {
  padding: 3px 5px;
  border: 1px solid rgba(200, 166, 108, 0.34);
  color: var(--gold);
  font-style: normal;
  font-size: 6px;
  letter-spacing: 0.08em;
}

.download-card h3 {
  margin: 34px 0 12px;
  color: var(--paper-light);
  font-family: var(--display);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.download-card p {
  margin: 0;
  color: rgba(247, 239, 225, 0.51);
  font-size: 10.5px;
  line-height: 1.9;
}

.download-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: auto;
  padding-top: 25px;
  color: rgba(239, 228, 207, 0.4);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
}

.download-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid rgba(200, 166, 108, 0.48);
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, color 0.2s ease;
}

.download-action:hover {
  background: var(--gold);
  color: #132a23;
}

.download-action span {
  font-size: 14px;
  line-height: 1;
}

.download-license-links {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.download-license-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(239, 228, 207, 0.12);
  color: rgba(247, 239, 225, 0.67);
  font-size: 8.5px;
  line-height: 1.5;
}

.download-license-links a:hover {
  color: var(--gold);
}

.download-license-links a span {
  color: var(--gold);
  font-size: 12px;
}

.download-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  margin-top: 28px;
  padding-top: 19px;
  border-top: 1px solid rgba(239, 228, 207, 0.1);
}

.download-foot p {
  max-width: 690px;
  margin: 0;
  color: rgba(247, 239, 225, 0.37);
  font-size: 8.5px;
  line-height: 1.8;
}

.download-foot p span {
  margin-right: 8px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
}

.download-foot-links {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 18px;
}

.download-access-link {
  display: inline-block;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(200, 166, 108, 0.52);
  background: transparent;
  color: var(--gold);
  font-size: 9px;
  line-height: 1.8;
  text-align: left;
  cursor: pointer;
}

.download-access-link:hover {
  color: var(--paper-light);
  border-bottom-color: rgba(255, 252, 245, 0.45);
}

@media (max-width: 1000px) {
  .download-head {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .download-intro {
    max-width: 620px;
  }

  .download-grid {
    grid-template-columns: 1fr 1fr;
  }

  .download-card-license {
    grid-column: 1 / -1;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .download-section {
    padding: 64px 0 56px;
  }

  .download-head h2 {
    font-size: 45px;
  }

  .download-grid {
    grid-template-columns: 1fr;
    margin-top: 32px;
  }

  .download-card {
    min-height: 0;
    padding: 20px 17px;
  }

  .download-card h3 {
    margin-top: 25px;
    font-size: 23px;
  }

  .download-foot {
    display: block;
  }

  .download-foot-links {
    justify-content: flex-start;
    margin-top: 17px;
  }

  .download-access-link {
    margin-top: 0;
  }
}

/* Accounts, shared discussions and admin */
.account-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.account-entry[hidden] {
  display: none;
}

.platform-static-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.account-entry svg {
  width: 16px;
  height: 16px;
}

.account-entry:hover {
  color: var(--accent-deep);
}

.account-entry em {
  padding: 2px 4px;
  border: 1px solid rgba(200, 111, 80, 0.4);
  border-radius: 2px;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 5.5px;
  font-style: normal;
  letter-spacing: 0.06em;
}

body.platform-modal-open {
  overflow: hidden;
}

.auth-tabs {
  display: flex;
  gap: 2px;
  margin: 18px 0 16px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(241, 235, 223, 0.55);
}

.auth-tabs button {
  flex: 1;
  min-height: 31px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}

.auth-tabs[hidden] {
  display: none;
}

.auth-tabs button.active {
  background: #fffdf7;
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(23, 50, 43, 0.08);
}

.auth-form,
.password-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.auth-form[hidden],
.password-form[hidden],
.account-panel[hidden] {
  display: none;
}

.auth-form label,
.password-form label,
.rename-modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.auth-form input,
.password-form input,
.rename-modal input {
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 252, 245, 0.75);
  color: var(--ink);
  font-size: 12px;
  outline: none;
}

.auth-form input:focus,
.password-form input:focus,
.rename-modal input:focus {
  border-color: rgba(23, 50, 43, 0.45);
  background: #fffdf8;
}

.auth-error {
  margin: 0;
  padding: 8px 10px;
  border-left: 2px solid var(--accent);
  background: rgba(200, 111, 80, 0.07);
  color: var(--accent-deep);
  font-size: 10px;
  line-height: 1.6;
}

.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.account-panel {
  margin-top: 19px;
}

.account-person {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 252, 245, 0.62);
}

.account-avatar,
.admin-user-avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper-light);
  font-family: var(--display);
  font-size: 17px;
}

.account-person strong {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
}

.account-person small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.06em;
}

.password-warning {
  margin-top: 11px;
  padding: 7px 9px;
  border-left: 2px solid var(--accent);
  background: rgba(200, 111, 80, 0.06);
  color: var(--accent-deep);
}

.password-warning[hidden] {
  display: none;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
}

.account-actions .text-button {
  color: var(--muted);
  font-size: 9px;
}

.password-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.account-panel .password-form[hidden] {
  display: none;
}

.admin-modal {
  width: min(820px, calc(100vw - 34px));
  max-height: min(86vh, 820px);
  overflow-y: auto;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 18px 0;
}

.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 245, 0.55);
}

.admin-stat strong {
  color: var(--forest);
  font-family: var(--display);
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
}

.admin-stat span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.04em;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px;
  border: 1px solid rgba(200, 111, 80, 0.27);
  background: rgba(200, 111, 80, 0.05);
}

.admin-toolbar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.7;
}

.admin-toolbar .button {
  flex: 0 0 auto;
}

.admin-subtitle {
  margin: 23px 0 10px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
}

.admin-users {
  border-top: 1px solid var(--line);
}

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.admin-user-row > span:nth-child(2) {
  min-width: 0;
}

.admin-user-row strong,
.admin-user-row small {
  display: block;
}

.admin-user-row strong {
  font-size: 11px;
  font-weight: 500;
}

.admin-user-row small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.admin-user-row em {
  margin-left: auto;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.admin-user-row em.is-admin {
  border-color: rgba(200, 111, 80, 0.35);
  color: var(--accent-deep);
}

.admin-loading {
  margin: 10px 0;
  color: var(--muted);
  font-size: 10px;
}

.rename-target {
  margin: 0 0 16px;
  padding: 9px 11px;
  border-left: 2px solid var(--gold);
  background: rgba(200, 166, 108, 0.08);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.rename-modal form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rename-modal label[hidden] {
  display: none;
}

.admin-edit-bar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: calc(100vw - 36px);
  padding: 10px 13px;
  border: 1px solid rgba(200, 166, 108, 0.38);
  background: #102c25;
  color: var(--paper-light);
  box-shadow: 0 12px 35px rgba(4, 15, 12, 0.28);
}

.admin-edit-bar[hidden] {
  display: none;
}

.admin-edit-bar span {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.admin-edit-bar p {
  margin: 0;
  color: rgba(247, 239, 225, 0.67);
  font-size: 9px;
}

.admin-edit-bar button {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(245, 237, 223, 0.23);
  border-radius: 3px;
  color: var(--paper-light);
  font-size: 8px;
}

.post-rating-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 9px 0 2px;
}

.post-rating-score {
  color: var(--accent-deep);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
}

.post-rating-meta {
  margin-right: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.03em;
}

.post-rating-stars {
  display: flex;
  gap: 1px;
}

.post-rating-stars button {
  padding: 1px;
  border: 0;
  background: transparent;
  color: rgba(23, 50, 43, 0.18);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.post-rating-stars button.is-active,
.post-rating-stars button:hover {
  color: var(--accent);
}

.server-comment-form {
  display: flex;
  gap: 6px;
  margin-top: 11px;
}

.server-comment-form input {
  flex: 1;
  min-width: 0;
  min-height: 31px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 252, 245, 0.6);
  color: var(--ink);
  font-size: 10px;
}

.server-comment-form button {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--forest);
  border-radius: 3px;
  background: var(--forest);
  color: var(--paper-light);
  font-size: 8px;
}

.comment-login-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.comment-author small {
  margin-left: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
}

@media (max-width: 760px) {
  .account-entry {
    padding: 7px 0;
  }

  .account-entry span {
    display: none;
  }

  .account-entry em {
    display: none;
  }

  .platform-static-badge {
    display: none;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .admin-toolbar .button {
    width: 100%;
  }

  .admin-edit-bar {
    right: 10px;
    bottom: 10px;
    left: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 7px 12px;
  }

  .admin-edit-bar p {
    order: 3;
    width: 100%;
  }

  .post-rating-row {
    flex-wrap: wrap;
  }

  .post-rating-meta {
    margin-right: 0;
  }

  .post-rating-stars {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

