/* Shared styles for the manual, common problems and FAQ pages.
   Colours and fonts match index.html. */
:root {
  --bg: #f5f2ea;
  --surface: #ffffff;
  --fg: #16242c;
  --muted: #5b6b70;
  --accent: #1f6f72;
  --accent-fg: #ffffff;
  --line: #dcd6c6;
  --warn-bg: #fbf1dd;
  --warn-line: #e3c98a;
  --ok: #1e8a5a;
  --watch: #c27c1e;
  --concern: #c0453a;
  --wave: #6b4fbb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10191c;
    --surface: #182428;
    --fg: #e9ece9;
    --muted: #9cb0b4;
    --accent: #5fb8ba;
    --accent-fg: #0b1618;
    --line: #2a3a3e;
    --warn-bg: #2a2516;
    --warn-line: #5a4c26;
    --ok: #4cc08a;
    --watch: #e2a24a;
    --concern: #e9776c;
    --wave: #a48ee8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10191c;
  --surface: #182428;
  --fg: #e9ece9;
  --muted: #9cb0b4;
  --accent: #5fb8ba;
  --accent-fg: #0b1618;
  --line: #2a3a3e;
  --warn-bg: #2a2516;
  --warn-line: #5a4c26;
  --ok: #4cc08a;
  --watch: #e2a24a;
  --concern: #e9776c;
  --wave: #a48ee8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  padding: 40px 16px 64px;
  display: flex;
  justify-content: center;
}
main { width: 100%; max-width: 760px; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; text-decoration: none; color: inherit; }
.brand svg { flex: none; }
.brand .name { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.brand .tag { font-size: 0.8rem; color: var(--muted); }

nav.site {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 0.9rem; font-weight: 600;
  padding-bottom: 14px; margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
nav.site a { text-decoration: none; color: var(--muted); }
nav.site a[aria-current="page"] { color: var(--accent); }

h1 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-style: italic;
  font-size: clamp(1.9rem, 5vw, 2.5rem); line-height: 1.15; margin: 0 0 10px; text-wrap: balance;
}
.lede { color: var(--muted); font-size: 1.02rem; max-width: 58ch; margin: 0 0 8px; }
.updated { color: var(--muted); font-size: 0.82rem; margin: 0 0 28px; }

h2 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.45rem;
  margin: 56px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}
h3 { font-size: 1.05rem; margin: 30px 0 8px; scroll-margin-top: 16px; }
p, li { max-width: 66ch; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 6px; }

.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 22px; margin: 0 0 12px;
}
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; columns: 2 230px; column-gap: 28px; }
.toc li { break-inside: avoid; margin-bottom: 4px; }

.note, .tip {
  border-radius: 10px; padding: 14px 18px; font-size: 0.95rem; margin: 18px 0;
}
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.tip { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.note strong, .tip strong { display: block; margin-bottom: 2px; }

/* Screenshots: shown at phone size, tall ones scroll inside their frame. */
.shots { display: flex; flex-wrap: wrap; gap: 22px; margin: 20px 0 26px; align-items: flex-start; }
figure.shot { margin: 0; flex: 1 1 260px; max-width: 340px; }
figure.shot.wide { max-width: 520px; flex-basis: 100%; }
.frame {
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #eef4f5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
}
.frame img { display: block; width: 100%; height: auto; }
.frame.scroll { max-height: 600px; overflow-y: auto; }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.scroll-hint { font-size: 0.75rem; color: var(--muted); }

/* Badges and tables */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.8rem;
  padding: 3px 10px; border-radius: 999px; letter-spacing: 0.03em; white-space: nowrap;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.badge.watch { color: var(--watch); background: color-mix(in srgb, var(--watch) 16%, transparent); }
.badge.concern { color: var(--concern); background: color-mix(in srgb, var(--concern) 14%, transparent); }

.table-wrap { overflow-x: auto; margin: 16px 0 22px; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; background: var(--surface); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:last-child td { border-bottom: none; }

.diagram {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin: 18px 0 24px;
}
.diagram svg { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 auto; }
.diagram .cap { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 6px; }
svg text { font-family: "Inter", system-ui, sans-serif; }
.svg-fg { fill: var(--fg); }
.svg-muted { fill: var(--muted); }

/* Barometer tendency scale */
.scale { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; margin-top: 8px; font-size: 0.72rem; text-align: center; }
.scale div { padding: 8px 2px; border-radius: 6px; background: var(--bg); line-height: 1.25; }
.scale .warn { background: var(--warn-bg); outline: 2px solid var(--watch); font-weight: 700; }
.scale .steady { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.scale-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
@media (max-width: 560px) {
  .scale { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.steps { counter-reset: s; list-style: none; padding-left: 0; }
.steps > li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: 12px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-fg);
  font-weight: 700; font-size: 0.85rem; display: grid; place-items: center;
}

/* Problems and FAQ */
.problem, .faq-item { border-bottom: 1px solid var(--line); padding-block: 14px; }
.problem summary, .faq-item summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.problem summary::-webkit-details-marker, .faq-item summary::-webkit-details-marker { display: none; }
.chev { color: var(--accent); font-size: 0.85rem; transition: transform 0.15s ease; flex: none; }
details[open] > summary .chev { transform: rotate(90deg); }
.problem .body, .faq-item .body { margin-top: 10px; color: var(--fg); }
.problem .body p, .faq-item .body p { margin: 8px 0; }
.label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; display: block; margin-top: 10px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 18px; }
.toolbar input {
  flex: 1 1 240px; font: inherit; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}
.toolbar button {
  font: inherit; font-weight: 600; font-size: 0.85rem; background: var(--surface); color: var(--accent);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; cursor: pointer;
}
.empty { color: var(--muted); display: none; }

.cta {
  margin-top: 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px;
}

footer {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  font-size: 0.82rem; color: var(--muted);
}
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chev { transition: none; }
}
@media print {
  body { background: #fff; color: #000; padding: 0; }
  nav.site, .toolbar, .cta { display: none; }
  .frame.scroll { max-height: none; overflow: visible; }
  details { display: block; }
  details > :not(summary) { display: block !important; }
}
