/* Hälsokalkylatorn – admin guide (formerly shared with the visitor manual). Same palette as the site.
   Prints to A4 PDF via Chrome (tests/make-manual-pdfs.mjs). */
:root {
  --bg: #f7f6f2; --surface: #fff; --ink: #1f2a1c; --muted: #5f6a5a; --line: #dedcd3;
  --green: #2e5e1e; --green-soft: #e8f1e1; --amber: #f2b705; --amber-soft: #fff6d9; --amber-ink: #7a5000;
  --blue-soft: #e8f0fb; --bad-bg: #f8e4dd; --bad: #a23a1e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--green); }
:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; } /* same focus ring as the calculator */
.topbar :focus-visible { outline-color: #fff; }
.topbar { background: var(--green); color: #fff; padding: 12px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar a { color: #fff; }
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.topbar .mark { width: 32px; height: 32px; border-radius: 8px; background: #fff; color: var(--green); display: grid; place-items: center; font: 700 19px var(--serif); }
.topbar .title { font: 700 1.05rem var(--serif); }
.topbar .actions { display: flex; gap: 12px; font-size: .92rem; }
main.manual { max-width: 860px; margin: 0 auto; padding: 28px 20px 80px; container-type: inline-size; }
/* Running text at about 70 characters per line (63ch: median 70–71 on screen and in print; was about 108).
   Figures, screenshots, tables and the formula keep the full column. A screenshot inside a numbered step
   is widened back to the column's right edge (100cqw = the width of main.manual). */
main.manual > :is(p, ul, ol, .note, .tip, .warn), figcaption { max-width: 63ch; }
ol.steps > li > figure { width: calc(100cqw - 40px); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; }
h1 { font-size: 2rem; margin: .2em 0 .3em; }
h2 { font-size: 1.45rem; margin: 2em 0 .5em; padding-top: .4em; border-top: 1px solid var(--line); }
h3 { font-size: 1.12rem; margin: 1.5em 0 .4em; }
.lead { font-size: 1.1rem; color: #3c4638; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 20px; margin: 20px 0; }
.toc ol { margin: 6px 0 0; padding-left: 22px; }
figure { margin: 18px 0 22px; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.06); background: #fff; }
figcaption { font-size: .88rem; color: var(--muted); margin-top: 6px; }
ol.steps { padding-left: 0; list-style: none; counter-reset: s; }
ol.steps > li { counter-increment: s; position: relative; padding: 2px 0 10px 40px; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.ui { display: inline-block; padding: 0 6px; border: 1px solid #c9c6ba; border-radius: 5px; background: #fff; font-size: .92em; font-weight: 600; white-space: nowrap; }
.note, .tip, .warn { border-radius: 8px; padding: 10px 14px; margin: 14px 0; border: 1px solid; }
.note { background: var(--blue-soft); border-color: #c4d6f2; }
.tip { background: var(--green-soft); border-color: #b9d9ad; }
.warn { background: var(--amber-soft); border-color: #f0d68a; color: var(--amber-ink); }
.note > :last-child, .tip > :last-child, .warn > :last-child { margin-bottom: 0; }
table { border-collapse: collapse; width: 100%; margin: 12px 0; background: #fff; font-size: .95rem; }
th, td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: #f3f2ec; }
.formula { font-family: var(--serif); font-size: 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 12px 0; overflow-x: auto; }
.lang-switch { font-size: .9rem; }
footer.manual-foot { max-width: 860px; margin: 0 auto; padding: 18px 20px 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  h1 { font-size: 1.6rem; }
  main.manual { padding: 20px 16px 60px; }
  .topbar, footer.manual-foot { padding-left: 16px; padding-right: 16px; }
  .ui { white-space: normal; } /* long button names may wrap, so tables fit a phone screen */
}
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .no-print { display: none !important; }
  main.manual { max-width: none; padding: 0; }
  h2 { break-before: page; border-top: 0; margin-top: 0; }
  h2.keep { break-before: auto; }
  figure, table, .note, .tip, .warn { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  figure img { box-shadow: none; max-height: 125mm; width: auto; max-width: 100%; }
  a { color: inherit; text-decoration: none; }
}
