:root {
  --cream: #fbf7f0;
  --linen: #f3ebde;
  --fawn: #c98a5e;
  --caramel: #a86b43;
  --espresso: #2e2620;
  --mocha: #6f6356;
  --sage: #8aa17f;
  --rosy: #e8b4a0;
  --night: #211c18;
  --walnut: #2e2722;
  --darkink: #efe7da;
  --lightfawn: #e0a878;
  --focus: #3b82f6;
  /* semantic (light defaults) */
  --bg: var(--cream);
  --surface: var(--linen);
  --surface-2: #fff;
  --text: var(--espresso);
  --muted: var(--mocha);
  --accent: var(--fawn);
  --accent-strong: var(--caramel);
  --accent-text: var(--caramel);
  --border: #e3d8c7;
  --shadow: rgba(46, 38, 32, 0.1);
  --tip-bg: #eef2ea;
  --tip-bd: #8aa17f;
  --warn-bg: #fbe9e2;
  --warn-bd: #d98b6e;
  --crit-bg: #fdecea;
  --crit-bd: #d4503f;
  --crit-text: #a23528;
  --hdr-h: 58px;
  --serif: 'Fraunces', ui-serif, Georgia, serif;
  --sans: 'Inter', -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
  --maxw: 74ch;
  --radius: 14px;
}
html[data-theme='dark'] {
  --bg: var(--night);
  --surface: var(--walnut);
  --surface-2: #37302a;
  --text: var(--darkink);
  --muted: #b8ab9a;
  --accent: var(--lightfawn);
  --accent-strong: var(--lightfawn);
  --accent-text: var(--lightfawn);
  --border: #3f372f;
  --shadow: rgba(0, 0, 0, 0.35);
  --tip-bg: #28302a;
  --tip-bd: #6f8a63;
  --warn-bg: #3a2a23;
  --warn-bd: #b07a5e;
  --crit-bg: #3a221e;
  --crit-bd: #e0705e;
  --crit-text: #f0b3a6;
}
@media (prefers-color-scheme: dark) {
  html[data-theme='auto'] {
    --bg: var(--night);
    --surface: var(--walnut);
    --surface-2: #37302a;
    --text: var(--darkink);
    --muted: #b8ab9a;
    --accent: var(--lightfawn);
    --accent-strong: var(--lightfawn);
    --accent-text: var(--lightfawn);
    --border: #3f372f;
    --shadow: rgba(0, 0, 0, 0.35);
    --tip-bg: #28302a;
    --tip-bd: #6f8a63;
    --warn-bg: #3a2a23;
    --warn-bd: #b07a5e;
    --crit-bg: #3a221e;
    --crit-bd: #e0705e;
    --crit-text: #f0b3a6;
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.09rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
}
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  line-height: 1.18;
  letter-spacing: -0.01em;
  font-weight: 600;
}
a {
  color: var(--accent-text);
  text-underline-offset: 2px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* skip link */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #1a1410;
  padding: 0.6em 1em;
  border-radius: 0 0 8px 0;
  z-index: 2000;
  font-weight: 600;
}
.skip:focus {
  left: 0;
}

/* progress bar */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--fawn), var(--caramel));
  z-index: 1500;
  transition: width 0.12s linear;
}

/* header */
header.bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease;
  box-shadow: 0 1px 0 var(--shadow);
}
header.bar.hidden {
  transform: translateY(-100%);
}
.bar-in {
  max-width: 1280px;
  margin: 0 auto;
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 clamp(0.8rem, 3vw, 1.4rem);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.06rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.brand .paw {
  font-size: 1.3rem;
  line-height: 1;
}
.brand b {
  color: var(--accent-strong);
}
.brand span.full {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-sp {
  flex: 1;
}
.iconbtn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  min-height: 42px;
  min-width: 42px;
  padding: 0 0.6rem;
  font-size: 0.95rem;
  font-family: var(--sans);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.iconbtn:hover {
  border-color: var(--accent);
}
.menu-btn {
  display: inline-flex;
}
@media (min-width: 1024px) {
  .menu-btn {
    display: none;
  }
}
.bar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.42rem 0.7rem;
  min-width: 0;
  max-width: 520px;
}
.bar-search:focus-within {
  border-color: var(--accent);
}
.bar-search input {
  border: none;
  background: transparent;
  flex: 1;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  outline: none;
  min-width: 0;
}
@media (max-width: 560px) {
  .brand .full {
    display: none;
  }
}

/* layout */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(0.8rem, 3vw, 1.4rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 270px;
    align-items: start;
  }
  .toc-side {
    order: 2;
  }
  main {
    order: 1;
  }
}
main {
  min-width: 0;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

/* hero */
.hero {
  padding: 2.2rem 0 1rem;
}
.hero .kicker {
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-family: var(--sans);
}
.hero h1 {
  font-size: clamp(1.9rem, 1.3rem + 3.4vw, 3.1rem);
  font-weight: 700;
  margin: 0.5rem 0 0.3rem;
}
.hero .sub {
  font-size: clamp(1.05rem, 1rem + 0.6vw, 1.3rem);
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  margin: 0 0 1rem;
}
.frenchie {
  display: block;
  margin: 1rem auto;
  width: clamp(130px, 40vw, 190px);
  height: auto;
  filter: drop-shadow(0 8px 16px var(--shadow));
}
.intro p {
  margin: 0 0 1rem;
}
.namechip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--rosy);
  color: #5a2f22;
  font-weight: 700;
  padding: 0.25em 0.8em;
  border-radius: 999px;
  font-size: 0.85rem;
  font-family: var(--sans);
}

/* section */
section.block {
  padding: 1.4rem 0;
  scroll-margin-top: calc(var(--hdr-h) + 14px);
}
section.block > h2 {
  font-size: clamp(1.45rem, 1.2rem + 1.4vw, 2rem);
  margin: 0.2rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.block .lead {
  color: var(--muted);
  margin: 0.2rem 0 1.1rem;
}
.phase-meta {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  font-family: var(--sans);
  margin-bottom: 0.6rem;
}
.goals {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0.6rem 0 1.2rem;
}
.goals h4 {
  margin: 0.1rem 0 0.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--sans);
  color: var(--accent-strong);
}
.goals ul {
  margin: 0;
  padding-left: 1.2rem;
}
.goals li {
  margin: 0.25rem 0;
}

/* principles cards */
.principles {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr;
}
@media (min-width: 680px) {
  .principles {
    grid-template-columns: 1fr 1fr;
  }
}
.principle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.principle .t {
  font-weight: 700;
  font-family: var(--serif);
  display: block;
  margin-bottom: 0.2rem;
}
.principle .d {
  color: var(--muted);
  font-size: 0.95rem;
}

/* accordion (procedures, troubleshooting, glossary) */
details.acc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0.6rem 0;
  overflow: hidden;
}
details.acc[open] {
  box-shadow: 0 4px 18px var(--shadow);
}
details.acc > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-weight: 600;
  font-family: var(--serif);
  font-size: 1.06rem;
}
details.acc > summary::-webkit-details-marker {
  display: none;
}
.chev {
  margin-left: auto;
  transition: transform 0.2s ease;
  color: var(--accent-strong);
  flex: none;
  font-size: 1.1rem;
}
details.acc[open] .chev {
  transform: rotate(90deg);
}
.sum-num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1410;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.acc-body {
  padding: 0 1rem 1.1rem;
  border-top: 1px solid var(--border);
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.9rem 0;
}
.badge {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25em 0.65em;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.diff {
  color: var(--accent-strong);
  border-color: var(--accent);
}
.obj {
  font-style: italic;
  color: var(--text);
  margin: 0.4rem 0 0.2rem;
}
.acc-body h5 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 1.1rem 0 0.4rem;
  color: var(--accent-strong);
}
.acc-body ol,
.acc-body ul {
  margin: 0.2rem 0;
  padding-left: 1.3rem;
}
.acc-body ol li,
.acc-body ul li {
  margin: 0.35rem 0;
}
.tips,
.mistakes,
.success {
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-top: 0.7rem;
}
.tips {
  background: var(--tip-bg);
  border: 1px solid var(--tip-bd);
}
.mistakes {
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
}
.success {
  background: var(--surface-2);
  border: 1px dashed var(--border);
}
.tips h5,
.mistakes h5,
.success h5 {
  margin-top: 0;
}
.success b {
  font-family: var(--sans);
}
/* completion toggle */
.done-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--border);
}
.done-row label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.done-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--sage);
}
details.acc.done {
  border-color: var(--sage);
}
details.acc.done > summary .sum-num {
  background: var(--sage);
}

/* checklist */
.ck-cat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0.6rem 0;
  padding: 0.4rem 0.2rem;
}
.ck-cat > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 0.9rem;
  font-family: var(--serif);
  font-weight: 600;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.ck-cat > summary::-webkit-details-marker {
  display: none;
}
.ck-list {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0.9rem 1rem;
}
.ck-list li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.ck-list li:last-child {
  border-bottom: none;
}
.ck-list input {
  width: 19px;
  height: 19px;
  margin-top: 0.2rem;
  accent-color: var(--sage);
  flex: none;
}
.ck-list label {
  cursor: pointer;
}
.ck-list li.checked label {
  color: var(--muted);
  text-decoration: line-through;
}
.catcount {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

/* health cards */
.hcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin: 0.6rem 0;
}
.hcard h3 {
  margin: 0.1rem 0 0.4rem;
  font-size: 1.1rem;
}
.hcard.crit {
  background: var(--crit-bg);
  border: 1.5px solid var(--crit-bd);
}
.hcard.crit h3 {
  color: var(--crit-text);
}
.hcard.crit::before {
  content: '🚨 EMERGENCY';
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--crit-text);
  margin-bottom: 0.3rem;
}

/* callout — block-renderer component (no original generic equivalent). tip/warning map to
   the existing tip/warn palette tokens; crit reuses the .hcard.crit emergency styling. */
.callout {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin: 0.7rem 0;
  border: 1px solid var(--border);
  background: var(--surface);
}
.callout.tip {
  background: var(--tip-bg);
  border-color: var(--tip-bd);
}
.callout.warning {
  background: var(--warn-bg);
  border-color: var(--warn-bd);
}
/* callout.crit — parity with .hcard.crit for the built render (R1) */
.callout.crit {
  background: var(--crit-bg);
  border: 1.5px solid var(--crit-bd);
  position: relative;
}
.callout.crit::before {
  content: '🚨 EMERGENCY';
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--crit-text);
  margin-bottom: 0.3rem;
}

/* gear */
.gear {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr;
}
@media (min-width: 680px) {
  .gear {
    grid-template-columns: 1fr 1fr;
  }
}
.gitem {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
}
.gitem .gi {
  font-weight: 700;
  font-family: var(--serif);
  display: block;
  margin-bottom: 0.2rem;
  color: var(--accent-strong);
}
.gitem .gw {
  font-size: 0.92rem;
  color: var(--muted);
}
.gear-group {
  margin: 1.5rem 0;
}
.gear-cat {
  font-size: 1.12rem;
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: sticky;
  top: calc(var(--hdr-h) + 2px);
  background: var(--bg);
  z-index: 3;
}
.gear-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin: 0.7rem 0;
}
.gear-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.06rem;
  color: var(--text);
}
.gear-why {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.3rem 0 0.85rem;
}
.picks {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .picks {
    grid-template-columns: repeat(3, 1fr);
  }
}
.pick {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.6rem 0.7rem;
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}
.pick:hover,
.pick:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow);
}
.pk-rank {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1410;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.pk-body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  flex: 1;
}
.pk-name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.25;
}
.pk-meta {
  font-family: var(--sans);
  font-size: 0.74rem;
  color: var(--accent-strong);
  font-weight: 600;
}
.pk-why {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pk-cart {
  flex: none;
  font-size: 1rem;
  opacity: 0.45;
}
.pick:hover .pk-cart {
  opacity: 1;
}

/* schedule timeline */
.timeline {
  position: relative;
  margin: 0.5rem 0;
  padding-left: 1.4rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--border);
}
.tl {
  position: relative;
  padding: 0.55rem 0 0.55rem 0.4rem;
}
.tl::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0.9rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.tl .tt {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--accent-strong);
  font-size: 0.9rem;
}
.tl .ta {
  color: var(--text);
}

/* glossary */
.gloss summary {
  font-weight: 600;
}
.gloss .acc-body {
  padding-top: 0.8rem;
}

/* TOC desktop */
.toc-side {
  display: none;
}
@media (min-width: 1024px) {
  .toc-side {
    display: block;
    position: sticky;
    top: calc(var(--hdr-h) + 16px);
    max-height: calc(100vh - var(--hdr-h) - 32px);
    overflow: auto;
  }
  .toc-side h4 {
    font-family: var(--sans);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.5rem;
  }
  .toc-side nav {
    border-left: 2px solid var(--border);
  }
  .toc-side a {
    display: block;
    padding: 0.32rem 0.8rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 2px solid transparent;
    margin-left: -2px;
    font-family: var(--sans);
  }
  .toc-side a:hover {
    color: var(--text);
  }
  .toc-side a.active {
    color: var(--accent-strong);
    border-left-color: var(--accent);
    font-weight: 600;
  }
  .toc-side a.sub {
    padding-left: 1.5rem;
    font-size: 0.83rem;
  }
}

/* bottom sheet TOC */
.sheet-bg {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 12, 0.5);
  z-index: 1190;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}
.sheet-bg.open {
  opacity: 1;
  visibility: visible;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  max-height: 75vh;
  overflow: auto;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  padding: 0.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.3);
}
.sheet.open {
  transform: translateY(0);
}
.sheet .grip {
  width: 42px;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  margin: 0.6rem auto 1rem;
}
.sheet h4 {
  margin: 0.2rem 0 0.6rem;
  font-size: 1.1rem;
}
.sheet a {
  display: block;
  padding: 0.7rem 0.4rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.sheet a.sub {
  padding-left: 1.4rem;
  font-size: 0.92rem;
  color: var(--muted);
}

/* search & filter */
.controls {
  position: sticky;
  top: calc(var(--hdr-h));
  z-index: 500;
  background: var(--bg);
  padding: 0.7rem 0 0.5rem;
  margin-bottom: 0.4rem;
}
.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
}
.search input {
  border: none;
  background: transparent;
  flex: 1;
  font: inherit;
  color: var(--text);
  outline: none;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.35em 0.8em;
  border-radius: 999px;
  cursor: pointer;
}
.chip.active {
  background: var(--accent);
  color: #1a1410;
  border-color: var(--accent);
}
.noresult {
  color: var(--muted);
  font-style: italic;
  padding: 1rem 0;
  display: none;
}

/* overall progress widget */
.progwrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin: 0.8rem 0 0;
}
.progwrap .pl {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.progwrap .pt {
  height: 9px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progwrap .pf {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sage), var(--fawn));
  transition: width 0.3s;
}
.resetbtn {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  background: none;
  border: none;
  color: var(--accent-text);
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--sans);
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.6rem 0 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}
footer .disc {
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.tag {
  display: inline-block;
  background: var(--sage);
  color: #16210f;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  font-family: var(--sans);
}
html[data-theme='dark'] .tag {
  color: #0f1409;
}
.hidden-el {
  display: none !important;
}

/* ---- Body Language section ---- */
:root {
  --green: #5e9a4e;
  --yellow: #d39a2a;
  --red: #d2503d;
}
#body-language {
  line-height: 1.72;
}
#body-language li {
  line-height: 1.62;
}
.bl-intro {
  margin-bottom: 0.6rem;
}
.bl-intro p {
  margin: 0 0 1.1rem;
}
.bl-intro p:first-child {
  font-size: 1.06rem;
}
.bl-rules {
  background: var(--tip-bg);
  border: 1px solid var(--tip-bd);
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 1.3rem 0 0.4rem;
}
.bl-rules-h {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.06rem;
  margin-bottom: 0.5rem;
}
.bl-rules ul {
  margin: 0.2rem 0 0;
  padding-left: 1.2rem;
}
.bl-rules li {
  margin: 0.55rem 0;
}
.bl-challenges {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  margin: 2.2rem 0 0;
}
.bl-qr,
.bl-cats,
.bl-ladder,
.bl-parts,
.bl-med,
.bl-myths,
.bl-refs {
  margin-top: 2.8rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--border);
}
.bl-challenges h3,
.bl-qr h3,
.bl-cats h3,
.bl-ladder h3,
.bl-parts h3,
.bl-med h3,
.bl-myths h3,
.bl-refs h3 {
  font-size: 1.26rem;
  margin: 0 0 0.9rem;
}
.bl-challenges ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}
.bl-challenges li {
  margin: 0.6rem 0;
}
.lead2 {
  color: var(--muted);
  margin: 0.1rem 0 1.1rem;
  font-size: 0.94rem;
}
.med-acc summary {
  font-size: 1rem;
}
details.med-crit {
  border-left: 5px solid var(--red);
}
details.med-crit > summary {
  color: var(--crit-text);
}
.qr-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .qr-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.qr-card {
  border-radius: 14px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-left-width: 6px;
  background: var(--surface);
}
.qr-head {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.qr-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex: none;
}
.qr-card ul {
  margin: 0.2rem 0 0.6rem;
  padding-left: 1.1rem;
}
.qr-card li {
  margin: 0.2rem 0;
  font-size: 0.89rem;
}
.qr-action {
  font-size: 0.85rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}
.zone-green {
  border-left-color: var(--green);
}
.zone-green .qr-dot,
.zone-green .zone-pip {
  background: var(--green);
}
.zone-yellow {
  border-left-color: var(--yellow);
}
.zone-yellow .qr-dot,
.zone-yellow .zone-pip {
  background: var(--yellow);
}
.zone-red {
  border-left-color: var(--red);
}
.zone-red .qr-dot,
.zone-red .zone-pip {
  background: var(--red);
}
.zone-pip {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
}
details.bl-cat {
  border-left: 5px solid var(--border);
}
.bl-sum {
  margin: 0.3rem 0 0.9rem;
  padding-left: 1.2rem;
}
.bl-sum li {
  margin: 0.45rem 0;
  color: var(--text);
}
.sig-h {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0.6rem 0 0.3rem;
}
.sig-list {
  list-style: none;
  margin: 0.2rem 0;
  padding: 0;
}
.sig-list li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.sig-list li:last-child {
  border-bottom: none;
}
.sig-list li::before {
  content: '';
  position: absolute;
  left: 0.05rem;
  top: 1.2rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.sig-cue {
  font-weight: 700;
  font-size: 0.94rem;
}
.sig-mean {
  font-size: 0.91rem;
}
.sig-fr {
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}
.bl-do {
  margin-top: 0.8rem;
  background: var(--tip-bg);
  border: 1px solid var(--tip-bd);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 0.91rem;
}
.bl-do b {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.74rem;
  color: var(--accent-strong);
}
.bl-do ul,
.med-points {
  margin: 0.3rem 0 0;
  padding-left: 1.2rem;
}
.bl-do li {
  margin: 0.45rem 0;
}
.med-points li {
  margin: 0.6rem 0;
  font-size: 0.94rem;
}
.ladder {
  list-style: none;
  counter-reset: rung;
  margin: 0.5rem 0;
  padding: 0;
}
.ladder li {
  counter-increment: rung;
  position: relative;
  margin: 0.5rem 0;
  padding: 0.75rem 0.9rem 0.75rem 3.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.93rem;
}
.ladder li::before {
  content: counter(rung);
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1410;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
}
.ladder li:nth-last-child(-n + 4) {
  border-color: var(--red);
}
.ladder li:nth-last-child(-n + 4)::before {
  background: var(--red);
  color: #fff;
}
.parts-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .parts-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.part-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.part-name {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--accent-strong);
  font-size: 1.05rem;
}
.part-trait {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.2rem 0 0.4rem;
}
.part-card dl {
  margin: 0;
}
.part-card dt {
  font-weight: 700;
  font-size: 0.87rem;
  margin-top: 0.5rem;
}
.part-card dd {
  margin: 0.1rem 0 0;
  font-size: 0.87rem;
  color: var(--muted);
}
.bl-med .hcard {
  margin: 0.5rem 0;
}
.ref-list {
  margin: 0.3rem 0;
  padding-left: 1.3rem;
}
.ref-list li {
  margin: 0.7rem 0;
  font-size: 0.9rem;
}
.ref-text {
  display: block;
}
.ref-tier {
  display: inline-block;
  background: var(--sage);
  color: #16210f;
  font-size: 0.67rem;
  font-weight: 700;
  padding: 0.12em 0.6em;
  border-radius: 999px;
  margin: 0.3rem 0.4rem 0.15rem 0;
  font-family: var(--sans);
}
html[data-theme='dark'] .ref-tier {
  color: #0f1409;
}
.ref-rel {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
  margin-top: 0.1rem;
}
.ref-link {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
}
.ref-count {
  background: var(--accent);
  color: #1a1410;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.05em 0.5em;
  font-weight: 700;
  font-family: var(--sans);
}

/* ---- Frenchie illustrations ---- */
.hero {
  position: relative;
  overflow: hidden;
}
.hero-paws {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  color: var(--accent);
  opacity: 0.07;
}
.hero-paws svg {
  position: absolute;
  height: auto;
}
.hero > :not(.hero-paws) {
  position: relative;
  z-index: 1;
}
.phase-head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 0.2rem 0 0.5rem;
}
.phase-head-txt {
  flex: 1;
  min-width: 0;
}
.phase-head-txt h2 {
  font-size: clamp(1.45rem, 1.2rem + 1.4vw, 2rem);
  margin: 0.1rem 0 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.phase-portrait {
  flex: none;
  width: clamp(74px, 18vw, 108px);
  height: auto;
  border-radius: 50%;
  padding: 6px;
  background: radial-gradient(circle at 50% 32%, var(--surface-2), var(--surface));
  border: 3px solid var(--accent);
  box-shadow: 0 6px 16px var(--shadow);
}
@media (max-width: 480px) {
  .phase-head {
    gap: 0.7rem;
  }
  .phase-portrait {
    width: 64px;
  }
}
.paw-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--accent);
  opacity: 0.45;
  margin: 0.2rem 0;
}
.paw-divider svg {
  width: 24px;
  height: 24px;
  flex: none;
}
.paw-divider::before,
.paw-divider::after {
  content: '';
  height: 1px;
  width: min(130px, 24%);
  background: var(--border);
}
.foot-mousse {
  display: flex;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.foot-mousse svg {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  padding: 7px;
  background: radial-gradient(circle at 50% 32%, var(--surface-2), var(--surface));
  border: 3px solid var(--accent);
}
