/* /how-to-read, "How to read the catalogue" (the owner's pick PG12, 17 Nov 2026), and the small "What does this mean?"
   link of partials/howto_link.php. Every class starts .htr-. Colours are the site's own variables; the few literal ones
   (the gold of a chosen part) are left alone by tools/build_dark_css.php. The shade over the note and its dashed outline are
   colours of the SVG in the view (fill, stroke), and the rims of the numbers are currentColor, so the dark look, which would
   turn them pale or dark, leaves the marks on the photograph as they are. */

.htr-head { margin: .4rem 0 1.3rem; max-width: 46rem; }
.htr-kicker { font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.htr-head h1 { color: var(--navy); font-size: clamp(1.7rem, 3.6vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; margin: .25rem 0 .45rem; }
.htr-head > p { color: var(--muted); font-size: 1.05rem; }
.htr-jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.htr-jump a { display: inline-flex; align-items: center; min-height: 40px; padding: .35rem .9rem; border-radius: 999px; background: var(--card);
  box-shadow: var(--shadow); font-weight: 700; font-size: .92rem; text-decoration: none; }
.htr-jump a:hover { background: var(--accent-soft); }

.htr-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; white-space: nowrap; }
.htr-count { color: var(--muted); font-size: .84rem; }
.htr-ex-word { color: var(--muted); font-size: .84rem; margin-right: .25rem; }
.htr-credit { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }

/* the sections */
.htr-sec { margin-top: 1.6rem; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 1.3rem 1.5rem 1.5rem; scroll-margin-top: 1rem; }
.htr-sec > h2 { color: var(--navy); font-size: 1.35rem; margin-bottom: .3rem; }
.htr-lede { color: var(--muted); margin-bottom: 1.1rem; max-width: 72ch; }
.htr-lede b { color: var(--ink); }
.htr-sec-note { background: transparent; box-shadow: none; padding: 0; }
.htr-sec-note > h2, .htr-sec-note > .htr-lede { padding: 0 .2rem; }

/* part 1: the note and its parts */
.htr-anat { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.4rem; align-items: start; }
.htr-notecard { position: sticky; top: 1rem; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 1.1rem 1.1rem .8rem; min-width: 0; }
.htr-note { position: relative; margin: 0; }
.htr-note img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 6px 18px rgba(30,47,77,.16); }
.htr-note svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: 4px; }
.htr-dim { opacity: 0; transition: opacity .2s ease; }
.is-sel .htr-dim { opacity: 1; }
.htr-ring { fill: none; stroke: #f3c64a; stroke-width: 3.5; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .2s ease; }
.is-sel .htr-ring { opacity: 1; }
.htr-peek { stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; opacity: 0; }
.is-peek .htr-peek { opacity: 1; }
.htr-marks[hidden] { display: none; }
.htr-mark { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; border: 2px solid currentColor;
  background: #1e2f4d; color: #fff; font: inherit; font-weight: 800; font-size: .95rem; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(14,22,40,.45); padding: 0; cursor: pointer; transition: opacity .15s ease, background-color .15s ease; }
.htr-mark::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; }
.htr-mark[aria-pressed="true"] { background: #f3c64a; color: #2b2205; z-index: 2; }
.is-sel .htr-mark:not([aria-pressed="true"]) { opacity: .62; }
.is-sel .htr-mark:focus-visible { opacity: 1; }
.htr-mark:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; box-shadow: 0 0 0 6px var(--accent); }
@media (hover: hover) {
  .htr-mark:hover { background: #2563eb; }
  .htr-mark[aria-pressed="true"]:hover { background: #f3c64a; }
  .is-sel .htr-mark:hover { opacity: 1; }
  .htr-part-btn:hover { background: var(--row); }
  .htr-part.is-on .htr-part-btn:hover { background: transparent; }
}
.htr-notecap { display: flex; justify-content: space-between; align-items: center; gap: .4rem 1rem; flex-wrap: wrap; margin-top: .7rem; font-size: .9rem; color: var(--muted); }
.htr-notecap b { color: var(--navy); }
.htr-notecap button { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; font-size: .9rem; padding: .3rem 0; min-height: 40px; cursor: pointer; }
.htr-notecap button[hidden] { display: none; }

.htr-parts { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 1rem 1rem .7rem; min-width: 0; }
.htr-parts h3 { font-size: 1.05rem; color: var(--navy); margin: .1rem .3rem .2rem; }
.htr-hint { font-size: .88rem; color: var(--muted); margin: 0 .3rem .7rem; }
.htr-hint[hidden] { display: none; }
.htr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.htr-part { border-radius: 11px; border: 1px solid transparent; }
.htr-part.is-on { border-color: var(--amber-line); background: var(--amber-bg); }
.htr-part-btn { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 .7rem; align-items: center; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 10px; padding: .32rem .55rem; min-height: 48px; line-height: 1.35; color: var(--ink); font: inherit; cursor: pointer; }
.htr-num { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: .88rem; display: grid; place-items: center; }
.htr-part.is-on .htr-num { background: #f3c64a; color: #2b2205; }
.htr-pname { font-weight: 700; color: var(--navy); }
.htr-pfact { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.htr-pfact .htr-code { color: var(--ink); font-weight: 600; }
.htr-ptext { padding: .1rem .9rem .85rem 3.2rem; font-size: .95rem; }
.htr-ptext p + p { margin-top: .4rem; }
.htr-ptext[hidden] { display: none; }
.htr-where { color: var(--muted); font-size: .88rem; }
.htr-where a { font-weight: 700; }

.htr-names-wrap { margin-top: 1.4rem; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 1.2rem 1.5rem 1.3rem; }
.htr-names-wrap h3 { color: var(--navy); font-size: 1.1rem; margin-bottom: .8rem; }
.htr-names { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.htr-name { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem 1.1rem; background: var(--thead); min-width: 0; }
.htr-name dt { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.htr-name dd { margin: 0; font-size: .95rem; }
.htr-name dd.htr-big { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 800; color: var(--navy); margin: .25rem 0 .45rem; overflow-wrap: anywhere; }
.htr-names-foot { margin-top: 1rem; font-size: .92rem; color: var(--muted); }
.htr-names-foot a { font-weight: 700; }

/* part 2: the marks of a label */
.htr-marklist { margin: 0; display: grid; gap: 0; }
.htr-markrow { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .3rem 1.2rem; padding: .85rem 0; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.htr-markrow:first-child { border-top: 0; padding-top: .2rem; }
.htr-markrow:target { background: var(--amber-bg); border-radius: 10px; box-shadow: 0 0 0 .5rem var(--amber-bg); }
.htr-markrow dt { padding-top: .1rem; }
.htr-markrow dd { margin: 0; min-width: 0; }
.htr-markrow dd p + p { margin-top: .3rem; }
.htr-chip { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; font-size: 1.05rem;
  color: var(--accent-strong); background: var(--accent-soft); border-radius: 8px; padding: .2rem .6rem; white-space: nowrap; }
.htr-ex a { font-weight: 600; }

/* part 2: the kinds */
.htr-kinds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.htr-kind { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); scroll-margin-top: 1rem; min-width: 0; }
.htr-kind:target { border-color: var(--amber-line); box-shadow: 0 0 0 3px var(--amber-bg); }
.htr-pic { display: flex; align-items: center; justify-content: center; box-sizing: border-box; height: 9.5rem; background: var(--thead); padding: .7rem; border-bottom: 1px solid var(--line); }
.htr-pic img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.htr-kbody { padding: .75rem .9rem .9rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.htr-kbody h3 { font-size: 1.02rem; color: var(--navy); }
.htr-gloss { font-size: .93rem; }
.htr-kmeta { font-size: .84rem; color: var(--muted); }
.htr-kex { margin-top: auto; padding-top: .35rem; font-size: .9rem; }
.htr-kex a { font-weight: 600; }
.htr-kmark { font-size: .88rem; }
.htr-kmark a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 700; }

.htr-rest-h { color: var(--navy); font-size: 1.05rem; margin: 1.5rem 0 .6rem; }
.htr-rest { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .2rem 1.4rem; }
.htr-rest li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: .7rem; align-items: start; padding: .55rem 0; border-top: 1px solid var(--line); scroll-margin-top: 1rem; font-size: .92rem; min-width: 0; }
.htr-rest li:target { background: var(--amber-bg); border-radius: 8px; }
.htr-rest li > div { min-width: 0; }
.htr-rest-pic { display: grid; place-items: center; width: 80px; height: 44px; background: var(--thead); border-radius: 6px; overflow: hidden; }
.htr-rest-pic img { max-width: 80px; max-height: 44px; width: auto; height: auto; }
.htr-rest .htr-gloss { display: block; font-size: .88rem; }
.htr-rest-ex { display: block; font-size: .86rem; }
.htr-rest-ex .htr-credit { display: inline; }

.htr-close { text-align: center; padding: 1.6rem 1rem; }
.htr-close > h2 { margin-bottom: .35rem; }
.htr-close p { color: var(--muted); margin-bottom: 1rem; }
.htr-btns { display: flex; justify-content: center; gap: .8rem; flex-wrap: wrap; }
.htr-btns .btn { min-height: 46px; display: inline-flex; align-items: center; padding: .6rem 1.3rem; font-size: 1rem; }

/* the small link of partials/howto_link.php */
.htr-what { font-size: .82rem; font-weight: 600; white-space: nowrap; }

@media (max-width: 900px) {
  .htr-anat { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .htr-notecard { top: 0; border-radius: 0 0 14px 14px; padding: .7rem .7rem .3rem; z-index: 5; box-shadow: 0 6px 16px rgba(30,47,77,.12); }
  .htr-names { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .htr-mark { width: 24px; height: 24px; font-size: .74rem; border-width: 1.5px; }
  .htr-mark::before { inset: -10px; }
  .htr-notecap { font-size: .86rem; margin-top: .4rem; }
  .htr-sec { padding: 1.1rem 1rem 1.2rem; }
  .htr-sec-note { padding: 0; }
  .htr-names-wrap { padding: 1.1rem 1rem 1.2rem; }
  .htr-ptext { padding-left: .9rem; }
  .htr-markrow { grid-template-columns: minmax(0, 1fr); }
  .htr-kinds { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .htr-pic { height: 8.5rem; padding: .5rem; }
  .htr-kbody { padding: .6rem .75rem .5rem; gap: .2rem; }
  .htr-rest { grid-template-columns: minmax(0, 1fr); }
  .htr-jump a, .htr-notecap button, .htr-kmark a { min-height: 44px; }
  .htr-what { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (hover: none) { .htr-hint { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .htr-dim, .htr-ring, .htr-mark { transition: none; }
}
@media print {
  .htr-jump, .htr-marks, .htr-close, .htr-note svg { display: none !important; }
  .htr-notecard { position: static; }
  .htr-ptext[hidden] { display: block; }
}

