/* NGC 3079 hot-wind handbook stylesheet (H-N3079-001). Includes the fixed lang.css block. */
:root {
  --bg: #faf9f7; --panel: #ffffff; --ink: #1c1c1c; --mute: #5f6368; --rule: #d8d5d0;
  --soft: #f0eee9; --accent: #1a5fb4; --warn: #9b3a3a; --ok: #2e7a57; --cand: #a8790a;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
html[data-theme="dark"] {
  --bg: #16181c; --panel: #1e2126; --ink: #e6e4e0; --mute: #9aa0a6; --rule: #33363c;
  --soft: #26292f; --accent: #6ea4e0; --warn: #e08a8a; --ok: #5fbf93; --cand: #f2c94c;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans SC", sans-serif;
  line-height: 1.55;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 12px 16px 48px; }
a { color: var(--accent); }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--f-mono); font-size: 0.85em; }

/* header */
header.page {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
  padding: 10px 0 12px; border-bottom: 2px solid var(--rule); margin-bottom: var(--s4);
}
header.page h1 { font-size: 1.25rem; margin: 0; flex: 1 1 auto; min-width: 200px; }
header.page .sub { color: var(--mute); font-size: 0.8rem; }
.hbtns { display: flex; gap: var(--s2); }
button.tool {
  font: inherit; font-size: 0.85rem; padding: 0.35rem 0.9rem; min-height: 40px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--panel);
  color: var(--ink); cursor: pointer;
}
button.tool:hover { border-color: var(--accent); }

/* TOC */
nav.toc { display: flex; flex-wrap: wrap; gap: var(--s2); font-size: 0.78rem; margin-bottom: var(--s4); }
nav.toc a {
  text-decoration: none; border: 1px solid var(--rule); padding: 3px 9px; border-radius: 4px;
  color: var(--ink); background: var(--panel); font-family: var(--f-mono);
}
nav.toc a:hover { background: var(--soft); text-decoration: none; }

/* sections */
section { margin-bottom: var(--s5); }
h2 { font-size: 1.12rem; border-bottom: 1px solid var(--rule); padding-bottom: 4px; margin: var(--s5) 0 var(--s3); }
h3 { font-size: 1.0rem; margin: var(--s4) 0 var(--s2); }
h4 { font-size: 0.92rem; margin: var(--s3) 0 var(--s2); color: var(--mute); }
p { margin: 0 0 var(--s3); max-width: 90ch; }
ul.pts { margin: 0 0 var(--s3); padding-left: 1.25rem; max-width: 92ch; }
ul.pts li { margin-bottom: var(--s2); }

/* glossary box */
.gloss {
  background: var(--soft); border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: var(--s3) var(--s4); margin: var(--s3) 0 var(--s4); max-width: 90ch;
}
.gloss .gt { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--mute); text-transform: uppercase; }

/* status chips */
.chip {
  display: inline-block; font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.04em;
  padding: 1px 7px; border-radius: 3px; color: #fff; vertical-align: 1px; white-space: nowrap;
}
.chip.meas { background: var(--ok); }
.chip.inf { background: var(--accent); }
.chip.cond { background: #7a4fa3; }
.chip.cand { background: var(--cand); }
.chip.wd { background: var(--warn); }
.chip.pend { background: #777; }

/* tables */
.tablewrap { overflow-x: auto; margin: var(--s3) 0; max-width: 100%; }
table { border-collapse: collapse; font-size: 0.84rem; }
th, td { border: 1px solid var(--rule); padding: 4px 8px; text-align: left; vertical-align: top; }
th { background: var(--soft); font-weight: 600; }
td.n { font-family: var(--f-mono); font-size: 0.8rem; white-space: nowrap; }
tr.hl td { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* figures */
figure.fig { margin: var(--s3) 0 var(--s4); }
figure.fig img { max-width: 100%; height: auto; border: 1px solid var(--rule); background: #fff; display: block; }
figure.fig figcaption { font-size: 0.8rem; color: var(--mute); margin-top: var(--s2); max-width: 95ch; }
.figrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s4); }

/* source notes */
.src { font-size: 0.74rem; color: var(--mute); font-family: var(--f-mono); margin: -6px 0 var(--s4); word-break: break-all; max-width: 100%; }

/* animations / widgets */
.widget {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 8px;
  padding: var(--s4); margin: var(--s3) 0 var(--s5); max-width: 720px;
}
.widget .row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.widget input[type="range"] { flex: 1 1 220px; min-width: 160px; }
.widget .val { font-family: var(--f-mono); font-size: 0.9rem; min-width: 100px; }
.widget .out { font-family: var(--f-mono); font-size: 0.85rem; line-height: 1.8; }
.widget .out b { color: var(--accent); }
.wnote { font-size: 0.74rem; color: var(--mute); margin-top: var(--s2); }

/* svg skeleton */
svg.skel { max-width: 100%; height: auto; display: block; margin: var(--s3) 0; }
svg text { font-family: -apple-system, "Segoe UI", sans-serif; }

/* phone */
@media (max-width: 600px) {
  .wrap { padding: 8px 16px 40px; }
  header.page h1 { font-size: 1.05rem; }
  p, ul.pts, figure.fig figcaption { max-width: none; }
  .figrow { grid-template-columns: 1fr; }
}

/* handbook bilingual switch (skill 0.5.0).  Paste into the site's stylesheet unchanged.
   Without JavaScript nothing sets data-lang, so Chinese shows. */
html[data-lang="en"] .l-zh,
html:not([data-lang="en"]) .l-en { display: none !important; }

.lang-toggle {
  font: inherit; font-size: 0.9rem; padding: 0.3rem 0.8rem; min-height: 44px; min-width: 44px;
  border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; cursor: pointer;
}
.lang-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* skeleton svg boxes */
svg.skel rect { fill: var(--panel); stroke: var(--rule); }
svg.skel rect.sk-a { stroke: var(--accent); }
svg.skel rect.sk-b { stroke: var(--ok); }
svg.skel rect.sk-c { stroke: #7a4fa3; }
svg.skel rect.sk-d { stroke: var(--cand); }

/* phone: no horizontal scroll (D23). Tables and pre wrap inside their containers. */
@media (max-width: 600px) {
  html, body { overflow-x: hidden; }
  .tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .tablewrap table { min-width: 420px; width: max-content; max-width: none; }
  figure.fig img { max-width: 100%; }
  svg.skel { min-width: 0; }
  .wrap { max-width: 100vw; }
}

/* svg skeleton must not force the page wide: it scales with the container. */
svg.skel { width: 100%; max-width: 980px; overflow: visible; }
svg.skel text { font-size: 12.5px; }

/* D23 final fix: the page never scrolls horizontally at 375 px. Tables scroll inside .tablewrap;
   long code/source strings wrap; the wrap container is clamped. */
.wrap { max-width: 1080px; margin: 0 auto; padding: 12px 16px 48px; min-width: 0; }
p.src code, code { overflow-wrap: anywhere; word-break: break-all; }
.tablewrap { max-width: 100%; overflow-x: auto; }
.tablewrap table { max-width: 100%; }
section { min-width: 0; }
h2, h3, h4 { overflow-wrap: anywhere; }

/* chips and source notes must wrap, not push the page wide */
.chip { white-space: normal; }
p.src { overflow-wrap: anywhere; }
p.src code { white-space: normal; overflow-wrap: anywhere; }
code { white-space: normal; }
code { white-space: normal; overflow-wrap: anywhere; word-break: break-all; max-width: 100%; display: block; }
