/* Total Health site theme. Concept: the plate rack. Chalk, iron, and plate colors that carry meaning:
   blue = stays on your phone, green = stored with an account, amber = shared with a trainer you approve. */

@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 200 900; font-style: normal; font-display: swap; src: url("/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 200 900; font-style: italic; font-display: swap; src: url("/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2"); }

:root {
  --chalk: #f2f5f5;
  --paper: #ffffff;
  --sunken: #e8edee;
  --iron: #141a1f;
  --steel: #4d5c66;
  --line: #d5dde0;
  --focus: #1b3bd6;
  --accent: #2446e8;
  --accent-ink: #ffffff;
  --accent-soft: #e3e8fe;
  --device: #2446e8;      --device-ink: #1b3bd6;  --device-soft: #e3e8fe;
  --account: #1f9d55;     --account-ink: #11693a; --account-soft: #dff3e8;
  --trainer: #f2b705;     --trainer-ink: #7a5600; --trainer-soft: #fdf1c9;
  --danger-ink: #a5251f;  --danger-soft: #fbe3e1;
  --bar-hi: #c9d2d6; --bar-lo: #8d9ba3;
  --ui: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --header-h: 4rem; --fg-device: #fff; --fg-account: #fff; --fg-trainer: #3a2b00;
  --radius-panel: 14px; --radius-control: 10px; --radius-chip: 999px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --chalk: #0f1418; --paper: #171e24; --sunken: #0b1013; --iron: #e9eef0; --steel: #9bacb6; --line: #2a353c;
  --focus: #9db0ff; --accent: #8da2ff; --accent-ink: #0b1230; --accent-soft: #1d2652;
  --device: #6f88ff; --device-ink: #a9b9ff; --device-soft: #1b2450;
  --account: #3fbd7a; --account-ink: #78dda5; --account-soft: #123424;
  --trainer: #f3c33a; --trainer-ink: #f3c33a; --trainer-soft: #3a2f0a;
  --danger-ink: #ff948d; --danger-soft: #3b1816;
  --bar-hi: #4c5a63; --bar-lo: #2a353c;
  --fg-device: #0b1230; --fg-account: #052512; --fg-trainer: #3a2b00;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chalk: #0f1418; --paper: #171e24; --sunken: #0b1013; --iron: #e9eef0; --steel: #9bacb6; --line: #2a353c;
    --focus: #9db0ff; --accent: #8da2ff; --accent-ink: #0b1230; --accent-soft: #1d2652;
    --device: #6f88ff; --device-ink: #a9b9ff; --device-soft: #1b2450;
    --account: #3fbd7a; --account-ink: #78dda5; --account-soft: #123424;
    --trainer: #f3c33a; --trainer-ink: #f3c33a; --trainer-soft: #3a2f0a;
    --danger-ink: #ff948d; --danger-soft: #3b1816;
    --bar-hi: #4c5a63; --bar-lo: #2a353c;
    --fg-device: #0b1230; --fg-account: #052512; --fg-trainer: #3a2b00;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--chalk); color: var(--iron); font-family: var(--text); font-size: 1.0625rem; line-height: 1.68; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--iron); color: var(--chalk); padding: 0.6rem 1rem; border-radius: var(--radius-control); font-family: var(--ui); font-weight: 600; z-index: 100; }
.skip:focus { top: 1rem; }
.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--chalk); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 0.75rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--ui); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.01em; color: var(--iron); text-decoration: none; }
.brand svg { width: 2rem; height: 2rem; color: var(--accent); }
.nav { display: flex; gap: 0.25rem; margin-left: auto; margin-right: 0.5rem; }
.nav a { font-family: var(--ui); font-weight: 600; font-size: 1.1875rem; letter-spacing: 0.02em; color: var(--steel); text-decoration: none; padding: 0.4rem 0.9rem; border-radius: var(--radius-chip); }
.nav a:hover { color: var(--iron); background: var(--sunken); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.icon-btn { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); background: var(--paper); color: var(--iron); border-radius: 50%; cursor: pointer; }
.icon-btn:hover { background: var(--sunken); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--ui); font-weight: 600; font-size: 1.1875rem; letter-spacing: 0.02em; line-height: 1; padding: 0.8rem 1.2rem; border-radius: var(--radius-control); border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn svg { width: 1.15rem; height: 1.15rem; }
.btn-quiet { background: transparent; color: var(--accent); }
.btn-quiet:hover { background: var(--accent-soft); filter: none; }
.chip { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--ui); font-weight: 600; font-size: 1.0625rem; letter-spacing: 0.02em; padding: 0.3rem 0.85rem; border-radius: var(--radius-chip); background: var(--paper); border: 1px solid var(--line); color: var(--iron); }
.chip svg { width: 1rem; height: 1rem; color: var(--account-ink); }

/* ---------- hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
h1, h2, h3 { font-family: var(--ui); color: var(--iron); margin: 0; text-wrap: balance; }
h1 { font-weight: 700; font-size: clamp(3rem, 7.2vw, 5.25rem); line-height: 0.95; letter-spacing: -0.012em; }
.lede { font-size: 1.25rem; line-height: 1.6; color: var(--iron); margin: 1.4rem 0 0; max-width: 34em; }
.hero-meta { margin: 1.1rem 0 0; color: var(--steel); font-size: 0.98rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.6rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.8rem; }

/* ---------- plate rack (the one memorable element) ---------- */
.rack { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.1rem, 2.5vw, 1.8rem); }
.rack-title { font-size: 1.5rem; font-weight: 600; }
.rack-hint { margin: 0.2rem 0 1.4rem; color: var(--steel); font-size: 0.95rem; }
.rack-row { position: relative; display: flex; justify-content: space-between; gap: 0.5rem; padding-top: 0.6rem; }
.rack-row::before { content: ""; position: absolute; left: 0; right: 0; top: calc(0.6rem + 3.5rem - 5px); height: 10px; border-radius: 5px; background: linear-gradient(var(--bar-hi), var(--bar-lo)); }
.plate { position: relative; z-index: 1; flex: 1 1 0; display: grid; justify-items: center; gap: 0.7rem; background: none; border: 0; padding: 0 0 0.2rem; cursor: pointer; color: var(--steel); font-family: var(--ui); font-weight: 600; font-size: 1.15rem; line-height: 1.1; text-align: center; }
.plate-disc { position: relative; display: grid; place-items: center; width: 7rem; height: 7rem; border-radius: 50%; color: var(--plate-fg); background: var(--plate); box-shadow: inset 0 0 0 4px rgba(255,255,255,0.24), inset 0 0 0 9px var(--plate), inset 0 0 0 11px rgba(255,255,255,0.18), 0 2px 0 rgba(0,0,0,0.22); transition: transform 0.25s ease, opacity 0.2s ease, filter 0.2s ease; }
.plate-disc svg { width: 2.6rem; height: 2.6rem; }
.plate-device { --plate-fg: var(--fg-device); --plate: var(--device); --plate-ink: var(--device-ink); --plate-soft: var(--device-soft); }
.plate-account { --plate-fg: var(--fg-account); --plate: var(--account); --plate-ink: var(--account-ink); --plate-soft: var(--account-soft); }
.plate-trainer { --plate-fg: var(--fg-trainer); --plate: var(--trainer); --plate-ink: var(--trainer-ink); --plate-soft: var(--trainer-soft); }
.js .plate[aria-selected="false"] .plate-disc { opacity: 0.55; filter: saturate(0.7); transform: scale(0.88); }
.js .plate[aria-selected="false"]:hover .plate-disc { opacity: 0.9; }
.plate[aria-selected="true"] { color: var(--iron); }
.plate[aria-selected="true"] .plate-disc { transform: translateY(-4px); box-shadow: inset 0 0 0 4px rgba(255,255,255,0.24), inset 0 0 0 9px var(--plate), inset 0 0 0 11px rgba(255,255,255,0.18), 0 0 0 3px var(--paper), 0 0 0 6px var(--plate); }
@media (max-width: 430px) { .plate-disc { width: 5.4rem; height: 5.4rem; } .rack-row::before { top: calc(0.6rem + 2.7rem - 5px); } .plate-disc svg { width: 2.1rem; height: 2.1rem; } }
@media (prefers-reduced-motion: no-preference) {
  .plate-disc { animation: roll-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .plate:nth-child(2) .plate-disc { animation-delay: 0.12s; }
  .plate:nth-child(3) .plate-disc { animation-delay: 0.24s; }
  @keyframes roll-in { from { opacity: 0; translate: -70px 0; rotate: -200deg; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
}
.panel { margin-top: 1.5rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.js .panel:not(.on) { display: none; }
.panel + .panel { margin-top: 1.5rem; }
.panel h3 { font-size: 1.55rem; font-weight: 600; color: var(--plate-ink); }
.panel .p-lead { margin: 0.4rem 0 0.9rem; font-size: 1rem; line-height: 1.55; }
.panel-fade { animation: fade 0.3s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .panel-fade { animation: none; } }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.9rem; padding: 0; list-style: none; }
.tags li { font-family: var(--ui); font-weight: 500; font-size: 1.05rem; padding: 0.15rem 0.7rem; border-radius: var(--radius-chip); background: var(--plate-soft); color: var(--plate-ink); }
.tags.never li { background: var(--sunken); color: var(--steel); text-decoration: line-through; text-decoration-thickness: 1px; }
.panel .p-sub { margin: 0.9rem 0 0.35rem; font-family: var(--ui); font-weight: 600; font-size: 1.1rem; color: var(--iron); }
.panel .p-note { margin: 0.35rem 0 0; font-size: 0.95rem; line-height: 1.5; color: var(--steel); }
.panel .p-note + .p-note { margin-top: 0.5rem; }
.legend { margin: 1.1rem 0 0; font-size: 0.88rem; color: var(--steel); }

/* ---------- policy layout ---------- */
.doc { padding: 1rem 0 5rem; }
.doc .wrap { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.toc { position: sticky; top: 5.2rem; max-height: calc(100vh - 6.5rem); overflow: auto; padding-right: 0.5rem; }
.toc-title { font-family: var(--ui); font-weight: 600; font-size: 1.15rem; margin: 0 0 0.6rem; }
.search { position: relative; margin-bottom: 1rem; }
.search input { width: 100%; font: inherit; font-size: 1rem; padding: 0.65rem 2.4rem 0.65rem 2.5rem; border: 1.5px solid var(--line); border-radius: var(--radius-control); background: var(--paper); color: var(--iron); }
.search input::placeholder { color: var(--steel); opacity: 0.85; }
.search svg { position: absolute; left: 0.8rem; top: 50%; translate: 0 -50%; width: 1.1rem; height: 1.1rem; color: var(--steel); pointer-events: none; }
.search .clear { position: absolute; right: 0.35rem; top: 50%; translate: 0 -50%; border: 0; background: none; color: var(--steel); width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; display: none; }
.search .clear.on { display: grid; place-items: center; }
.search .clear svg { position: static; translate: none; width: 1rem; height: 1rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: flex; align-items: baseline; gap: 0.55rem; padding: 0.32rem 0.8rem; margin-left: -2px; border-left: 2px solid transparent; font-family: var(--ui); font-weight: 500; font-size: 1.1rem; line-height: 1.25; color: var(--steel); text-decoration: none; }
.toc li a:hover { color: var(--iron); }
.toc li a.on { color: var(--iron); border-left-color: var(--accent); font-weight: 600; }
.toc .dot { flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--line); translate: 0 -0.05em; }
.dot.z-device { background: var(--device); } .dot.z-account { background: var(--account); } .dot.z-trainer { background: var(--trainer); }
.toc li.hide { display: none; }
.found { margin: 0.6rem 0 0; font-size: 0.9rem; color: var(--steel); }

.policy section { padding: 0 0 2.6rem; }
.policy section.hide { display: none; }
.policy h2 { position: relative; font-weight: 600; font-size: clamp(2rem, 4vw, 2.5rem); line-height: 1.05; margin: 0 0 1rem; padding-left: 1.1rem; }
.policy h2::before { content: ""; position: absolute; left: 0; top: 0.12em; bottom: 0.12em; width: 5px; border-radius: 3px; background: var(--line); }
.policy .z-device h2::before { background: var(--device); } .policy .z-account h2::before { background: var(--account); } .policy .z-trainer h2::before { background: var(--trainer); }
.policy h2 a { color: inherit; text-decoration: none; }
.policy h2 .hash { margin-left: 0.5rem; font-size: 0.7em; color: var(--steel); opacity: 0; }
.policy h2:hover .hash, .policy h2 a:focus-visible .hash { opacity: 1; }
.policy h3 { font-weight: 600; font-size: 1.5rem; margin: 1.8rem 0 0.5rem; }
.policy p { margin: 0 0 1.05rem; max-width: 66ch; }
.policy ul.plain { max-width: 66ch; padding-left: 1.2rem; margin: 0 0 1.05rem; }
.policy ul.plain li { margin-bottom: 0.4rem; }
.policy .sec-body { padding-left: 1.1rem; }
.callout { max-width: 66ch; margin: 1.2rem 0 0; padding: 0.9rem 1.1rem; border-radius: var(--radius-control); background: var(--accent-soft); color: var(--iron); font-size: 1rem; line-height: 1.55; }

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.9rem 1.4rem; margin: 0.4rem 0 0; padding: 0; list-style: none; }
.services li { padding: 0.2rem 0 0.2rem 0.9rem; border-left: 3px solid var(--line); }
.services strong { display: block; font-family: var(--ui); font-weight: 600; font-size: 1.25rem; line-height: 1.2; }
.services span { font-size: 0.98rem; line-height: 1.5; color: var(--steel); }

.keep { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); font-size: 1rem; line-height: 1.5; }
.keep th, .keep td { text-align: left; vertical-align: top; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
.keep tr:last-child th, .keep tr:last-child td { border-bottom: 0; }
.keep th { width: 36%; font-family: var(--ui); font-weight: 600; font-size: 1.15rem; line-height: 1.3; background: var(--sunken); }
@media (max-width: 640px) { .keep, .keep tbody, .keep tr, .keep th, .keep td { display: block; width: 100%; } .keep th { border-bottom: 0; padding-bottom: 0.2rem; } }

/* ---------- support ---------- */
.contact { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.2rem, 2.5vw, 1.8rem); }
.contact h2 { font-size: 1.7rem; font-weight: 600; }
.contact .addr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.9rem 0 0.4rem; }
.contact .addr code { font-family: var(--ui); font-weight: 600; font-size: 1.35rem; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.copy-status { min-height: 1.4rem; margin: 0 0 0.6rem; font-size: 0.9rem; color: var(--account-ink); }
.checklist { margin: 0.6rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; font-size: 1rem; line-height: 1.5; }
.checklist li { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.5rem; }
.checklist svg { width: 1.2rem; height: 1.2rem; margin-top: 0.22rem; color: var(--account-ink); }
.checklist .no svg { color: var(--danger-ink); }
.contact .p-sub { margin: 1.1rem 0 0; font-family: var(--ui); font-weight: 600; font-size: 1.15rem; }

.find { margin-top: 1.8rem; max-width: 34rem; }
.find .search input { font-size: 1.15rem; padding-block: 0.9rem; border-radius: 14px; }
.quick { padding: 0 0 clamp(2rem, 4vw, 3rem); }
.quick h2, .faq h2 { font-weight: 600; font-size: clamp(1.9rem, 3.6vw, 2.4rem); margin-bottom: 1.2rem; }
.quick-grid { display: grid; grid-template-columns: 1.1fr 1.1fr 1.4fr; gap: 1rem; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 1.3rem 1.4rem; display: grid; align-content: start; gap: 0.7rem; }
.tile h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.tile p { margin: 0; font-size: 0.98rem; line-height: 1.55; }
.tile.t-danger { border-top: 5px solid var(--danger-ink); }
.tile.t-device { border-top: 5px solid var(--device); }
.tile.t-trainer { border-top: 5px solid var(--trainer); }
.path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; vertical-align: baseline; }
.path > span { font-family: var(--ui); font-weight: 600; font-size: 1.05rem; line-height: 1.3; padding: 0.05rem 0.55rem; border-radius: 8px; background: var(--sunken); border: 1px solid var(--line); color: var(--iron); }
.path > span + span::before { content: ""; display: inline-block; width: 0.4rem; height: 0.4rem; margin-right: 0.5rem; border-top: 2px solid var(--steel); border-right: 2px solid var(--steel); rotate: 45deg; translate: 0 -1px; }
.tile > .path { display: flex; }
.tile > .path > span { font-size: 1.15rem; padding: 0.2rem 0.65rem; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 1.9rem 1fr; gap: 0.6rem; align-items: center; font-family: var(--ui); font-weight: 600; font-size: 1.15rem; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--trainer); color: #3a2b00; font-size: 1.05rem; }
.tile .warn { padding: 0.6rem 0.8rem; border-radius: 8px; background: var(--trainer-soft); color: var(--iron); font-size: 0.93rem; }

.faq { padding: 0 0 5rem; }
.faq-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1.2rem; }
.filter { font-family: var(--ui); font-weight: 600; font-size: 1.1rem; padding: 0.35rem 0.95rem; border-radius: var(--radius-chip); border: 1.5px solid var(--line); background: var(--paper); color: var(--steel); cursor: pointer; }
.filter:hover { color: var(--iron); }
.filter[aria-pressed="true"] { background: var(--iron); border-color: var(--iron); color: var(--chalk); }
.faq-count { margin-left: auto; font-size: 0.92rem; color: var(--steel); }
.qa { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 0.6rem; }
.qa[hidden] { display: none; }
.qa summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; padding: 1rem 1.2rem; font-family: var(--ui); font-weight: 600; font-size: 1.35rem; line-height: 1.2; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ""; width: 0.7rem; height: 0.7rem; border-right: 2.5px solid var(--steel); border-bottom: 2.5px solid var(--steel); rotate: 45deg; translate: 0 -3px; transition: rotate 0.2s ease, translate 0.2s ease; }
.qa[open] summary::after { rotate: 225deg; translate: 0 3px; }
.qa[open] summary { padding-bottom: 0.5rem; }
.qa .ans { padding: 0 1.2rem 1.2rem; max-width: 62ch; }
.qa .ans p { margin: 0 0 0.6rem; }
.qa .tag { display: inline-block; margin: 0 1.2rem 1rem; padding: 0.05rem 0.6rem; border-radius: var(--radius-chip); font-family: var(--ui); font-weight: 500; font-size: 0.98rem; background: var(--sunken); color: var(--steel); }
.empty { padding: 1.4rem; border: 1.5px dashed var(--line); border-radius: 12px; text-align: center; }
.empty[hidden] { display: none; }
.empty p { margin: 0 0 0.8rem; }
.more { margin-top: 2rem; padding: 1.2rem 1.4rem; border-radius: var(--radius-panel); background: var(--sunken); display: flex; flex-wrap: wrap; gap: 0.8rem 1.4rem; align-items: center; justify-content: space-between; }
.more p { margin: 0; max-width: 40em; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); padding: 2rem 0 2.6rem; font-size: 0.95rem; color: var(--steel); }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: start; }
.site-footer .brand { font-size: 1.3rem; }
.site-footer p { margin: 0.4rem 0 0; max-width: 46ch; }
.foot-links { display: grid; gap: 0.35rem; font-family: var(--ui); font-weight: 600; font-size: 1.1rem; }
.foot-links a { color: var(--iron); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero .wrap > div:first-child { display: contents; }
  .hero h1 { order: 1; }
  .hero .lede { order: 2; }
  .hero .chips { order: 3; }
  .hero .rack, .hero .contact { order: 4; margin-top: 1.6rem; }
  .hero .hero-meta { order: 5; }
  .hero .actions { order: 6; }
  .doc .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc .wrap > * { min-width: 0; }
  .toc { position: sticky; top: var(--header-h); z-index: 40; max-height: none; overflow: visible; margin: 0 -1.25rem 1.5rem; padding: 0.55rem 1.25rem; background: var(--chalk); border-bottom: 1px solid var(--line); }
  .toc-title { display: none; }
  .toc ol { position: relative; display: flex; flex-wrap: nowrap; gap: 0.4rem; overflow-x: auto; border: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .toc ol::-webkit-scrollbar { display: none; }
  .toc li a { white-space: nowrap; border: 1.5px solid var(--line); border-radius: var(--radius-chip); background: var(--paper); margin: 0; padding: 0.3rem 0.85rem; min-height: 2.5rem; align-items: center; }
  .toc li a.on { border-color: var(--accent); background: var(--accent-soft); }
  .quick-grid { grid-template-columns: 1fr; }
  .policy .sec-body { padding-left: 0; }
  html { scroll-padding-top: 8rem; }
}
@media (max-width: 560px) {
  .site-footer .wrap { grid-template-columns: 1fr; }
}

/* ---------- print ---------- */
@media print {
  :root { --chalk: #fff; --paper: #fff; --iron: #000; --steel: #333; --line: #bbb; }
  body { font-size: 11pt; background: #fff; }
  .site-header, .toc, .actions, .rack-hint, .legend, .plate-disc, .skip, .icon-btn, .search, .find, .faq-tools { display: none !important; }
  .hero .wrap, .doc .wrap { display: block; }
  .rack { border: 0; padding: 0; }
  .rack-row { display: none; }
  .panel { display: block !important; }
  .policy section { break-inside: avoid-page; padding-bottom: 1.2rem; }
  a { color: #000; }
  .qa .ans { display: block; }
}


/* ================= phone-first layer ================= */
.btn, .filter, .icon-btn { min-height: 2.75rem; }
.btn { justify-content: center; }
.hero-meta { line-height: 1.5; }
.actions .btn { flex: 0 1 auto; }

.search-btn { display: none; align-items: center; gap: 0.55rem; min-height: 2.5rem; padding: 0 0.8rem 0 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-chip); background: var(--paper); color: var(--steel); font-family: var(--ui); font-weight: 600; font-size: 1.1rem; cursor: pointer; }
.js .search-btn { display: inline-flex; }
.search-btn:hover { color: var(--iron); background: var(--sunken); }
.search-btn svg { width: 1.1rem; height: 1.1rem; }
.search-btn kbd { font: inherit; font-size: 0.95rem; padding: 0 0.4rem; border: 1px solid var(--line); border-radius: 5px; background: var(--chalk); }

.tabbar { display: none; }
.to-top { position: fixed; right: 1rem; bottom: 1rem; z-index: 45; width: 2.9rem; height: 2.9rem; display: none; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--iron); cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.14); }
.to-top.on { display: grid; }
.to-top svg { width: 1.3rem; height: 1.3rem; }

@media (max-width: 720px) {
  :root { --header-h: 3.5rem; }
  body { padding-bottom: calc(4.4rem + env(safe-area-inset-bottom)); font-size: 1.0625rem; }
  .nav, .search-btn, .js .search-btn { display: none; }
  .site-header .brand { margin-right: auto; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
  .tab { display: grid; justify-items: center; align-content: center; gap: 0.1rem; min-height: 3.4rem; border: 0; border-radius: 12px; background: none; color: var(--steel); font-family: var(--ui); font-weight: 600; font-size: 1.05rem; text-decoration: none; cursor: pointer; }
  .tab svg { width: 1.45rem; height: 1.45rem; }
  .tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .to-top { bottom: calc(4.9rem + env(safe-area-inset-bottom)); }
  .wrap { width: calc(100% - 2.5rem); }
  .hero { padding-top: 1.6rem; }
  .lede { font-size: 1.0625rem; line-height: 1.58; margin-top: 1rem; }
  .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
  .hero-support .actions { order: 3; }
  .hero-support .contact { order: 4; }
  .hero-support .hero-meta { order: 5; }
  .contact .addr .btn { width: 100%; }
  .policy h2 { font-size: 2rem; }
  .qa summary { font-size: 1.3rem; min-height: 3.5rem; }
  .filters { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; margin: 0 -1.25rem; padding: 0 1.25rem; }
  .faq-tools { display: grid; }
  .faq-count { margin: 0.2rem 0 0; }
}
@media (min-width: 721px) { .tabbar { display: none; } }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter { flex: none; }

/* in-page search */
.faq .search { max-width: 34rem; margin-bottom: 1rem; }
.faq .search input { font-size: 1.1rem; padding-block: 0.8rem; border-radius: 14px; }
.faq .search .clear { display: none; }
.faq .search .clear.on { display: grid; }
.qa-link { margin: 0.2rem 0 0; }
.qa-link a, .tile-more { display: inline-flex; align-items: center; gap: 0.2rem; font-family: var(--ui); font-weight: 600; font-size: 1.15rem; text-decoration: none; }
.qa-link a:hover, .tile-more:hover { text-decoration: underline; }
.qa-link svg, .tile-more svg { width: 1rem; height: 1rem; }
.tile h3 { display: flex; align-items: center; gap: 0.6rem; }
.tile-ic { flex: none; width: 1.7rem; height: 1.7rem; }
.t-danger .tile-ic { color: var(--danger-ink); } .t-device .tile-ic { color: var(--device-ink); } .t-trainer .tile-ic { color: var(--trainer-ink); }
.tile-more { margin-top: 0.2rem; color: var(--accent); }
.hero-support .wrap { align-items: start; }
.wrap.one { grid-template-columns: 1fr; }

/* cross-links */
.next-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.8rem; margin-top: 2.2rem; max-width: 66rem; }
.next-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.9rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--paper); color: var(--iron); text-decoration: none; min-height: 4.5rem; }
.next-card:hover { border-color: var(--accent); }
.next-ic { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.next-ic svg { width: 1.3rem; height: 1.3rem; }
.next-tx { display: grid; gap: 0.1rem; }
.next-tx strong { font-family: var(--ui); font-weight: 600; font-size: 1.3rem; line-height: 1.15; }
.next-tx span { font-size: 0.93rem; line-height: 1.45; color: var(--steel); }
.next-go { width: 1.1rem; height: 1.1rem; color: var(--steel); }

/* footer columns */
.site-footer .wrap { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem 2.5rem; }
.foot-col { display: grid; align-content: start; gap: 0.1rem; font-family: var(--ui); font-weight: 600; font-size: 1.15rem; }
.foot-col h2 { font-size: 1.15rem; font-weight: 600; color: var(--steel); margin: 0 0 0.3rem; }
.foot-col a { display: block; padding: 0.3rem 0; color: var(--iron); text-decoration: none; overflow-wrap: anywhere; }
.foot-col a:hover { text-decoration: underline; }
.foot-about .copy { margin-top: 0.8rem; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } .foot-about { grid-column: 1 / -1; } }

/* search sheet */
dialog#finder { width: min(40rem, 100% - 2rem); max-height: min(36rem, 80vh); margin: 8vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--iron); box-shadow: 0 24px 60px rgba(0,0,0,0.3); overflow: hidden; }
dialog#finder::backdrop { background: rgba(8, 12, 16, 0.55); }
.finder-box { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem; border-bottom: 1px solid var(--line); }
.finder-box .search { flex: 1; margin: 0; }
.finder-box .search input { font-size: 1.1rem; padding-block: 0.75rem; }
.finder-box .btn { flex: none; padding-inline: 0.8rem; border-color: transparent; }
.finder-results { overflow: auto; max-height: calc(min(36rem, 80vh) - 4.6rem); padding: 0.4rem 0.8rem 1rem; }
.finder-head { margin: 0.7rem 0.2rem 0.3rem; font-family: var(--ui); font-weight: 600; font-size: 1.1rem; color: var(--steel); }
.finder-list { list-style: none; margin: 0; padding: 0; }
.finder-item { display: grid; gap: 0.15rem; padding: 0.7rem 0.8rem; border-radius: 10px; color: var(--iron); text-decoration: none; min-height: 3.4rem; }
.finder-item:hover, .finder-item:focus-visible { background: var(--sunken); }
.finder-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.finder-title { font-family: var(--ui); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.finder-kind { flex: none; font-family: var(--ui); font-weight: 500; font-size: 1rem; color: var(--steel); }
.finder-snip { font-size: 0.93rem; line-height: 1.45; color: var(--steel); }
.finder-snip mark { background: var(--trainer-soft); color: var(--iron); border-radius: 3px; padding: 0 0.1em; }
.finder-msg { padding: 1.4rem 0.8rem; color: var(--steel); }
.finder-msg p { margin: 0 0 0.3rem; }
@media (max-width: 720px) {
  dialog#finder { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .finder-results { max-height: calc(100dvh - 4.6rem); }
}
.search .clear { display: none; }
.search .clear.on { display: grid; }

@media print { .tabbar, .to-top, dialog, .next-row, .site-footer .foot-col { display: none !important; } body { padding: 0; } }

.chiplist { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0; padding: 0; list-style: none; }
.chiplist li { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.8rem 0.3rem 0.6rem; border-radius: 999px; background: var(--sunken); font-size: 0.95rem; line-height: 1.35; }
.chiplist svg { flex: none; width: 1rem; height: 1rem; color: var(--account-ink); }
.chiplist.no svg { color: var(--danger-ink); }
.copy-status { min-height: 0; margin: 0; }
.copy-status:not(:empty) { margin: 0 0 0.5rem; }
.lede.clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.lede-toggle { order: 2; justify-self: start; margin: 0.4rem 0 0; padding: 0.4rem 0; border: 0; background: none; color: var(--accent); font-family: var(--ui); font-weight: 600; font-size: 1.15rem; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
@media (max-width: 720px) { .contact { padding: 1.1rem; } .contact .addr { margin-top: 0.6rem; } .contact .p-sub { margin-top: 0.8rem; } .hero .lede-toggle { order: 2; } }

input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
