/* Parekonomistudien – Köksbordet.
   Ett lugnt, redaktionellt formulär på papper (riktning A), med värme, en lugn blå accentfärg,
   tydligare knappar och tvåspaltig datorvy från riktning B (SPEC B7).
   Inga style-attribut i HTML och inga inbäddade stilblock: allt sätts via klasser här eller via
   element.style i app.js (CSP style-src 'self'). */

/* ================================================================== typsnitt */
@font-face { font-family: 'Newsreader'; src: url('../fonts/newsreader-opsz-normal.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('../fonts/newsreader-wght-italic.woff2') format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'Albert Sans'; src: url('../fonts/albert-sans-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ================================================================== färger */
:root {
  --font-display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Albert Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --bg: #EEEFE8;
  --sheet: #F8F8F3;
  --ink: #232822;
  --ink-2: #535A50;
  --rule: #CDD0C4;
  --rule-strong: #7A8174;
  --honey: #8A5E12;
  --on-accent: #F7F8F1;
  --illo-line: #2F362D;
  --illo-warm: #EBDDBB;
  --shadow: 0 1px 0 rgb(35 40 34 / .06), 0 14px 28px -20px rgb(35 40 34 / .5);
  --selection: #D6E4F0;
  color-scheme: light;

  --fs-body: 18px;
  --head-h: 64px;
  --gutter: 20px;
  --col: 38rem;
  --r-paper: 4px;
  --r-ctl: 10px;
  --bar-h: 84px;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131A23; --sheet: #1B2430; --ink: #E3E8EF; --ink-2: #A2AEBD; --rule: #2D3846; --rule-strong: #7B8899; /* mörkblått (Rasam 2026-10-20) */
    --honey: #D9AE5C; --on-accent: #12202B; --illo-line: #C8D2DE; --illo-warm: #2E3440;
    --shadow: 0 1px 0 rgb(0 0 0 / .3), 0 14px 28px -20px rgb(0 0 0 / .8);
    --selection: #2E4152;
    color-scheme: dark;
  }
}

/* Accentfärg: lugn blå (Rasam 2026-10-20). Samma blå i alla kapitel; kapitel 7 är en ännu
   lugnare gråblå. Ljusblått används för ytor (soft, glow, panel), djupare blå för knappar och text
   så att kontrasten klarar WCAG AA. Klassen tone-N sätts på html (aktuellt kapitel) och på panelbilder. */
.tone-0, .tone-1, .tone-2, .tone-3, .tone-4, .tone-5, .tone-6, .tone-8, .tone-9 { --accent: #41698A; --accent-soft: #DDE8F2; --glow: #CFDFEC; --panel: #E4EDF5; }
.tone-7 { --accent: #4F6372; --accent-soft: #E2E8EC; --glow: #D9E1E7; --panel: #E8ECEF; }
@media (prefers-color-scheme: dark) {
  .tone-0, .tone-1, .tone-2, .tone-3, .tone-4, .tone-5, .tone-6, .tone-8, .tone-9 { --accent: #A9C7E2; --accent-soft: #223143; --glow: #27394E; --panel: #19222D; }
  .tone-7 { --accent: #B3C3CF; --accent-soft: #26303B; --glow: #2C3743; --panel: #1B232C; }
}
html { --focus: var(--accent); }

/* ================================================================== grund */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 12px); scroll-padding-bottom: calc(var(--bar-h) + 24px); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.5; font-weight: 400;
  overflow-x: clip; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-kerning: normal; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { display: block; }
h1, h2, h3, p, figure, fieldset, ol, ul, dl, dd { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
legend { padding: 0; float: left; width: 100%; }
legend + * { clear: both; }
ol, ul { list-style: none; }
strong { font-weight: 650; }
em { font-style: italic; }
.lede em, .help em, .body-text em { font-family: var(--font-display); font-size: 1.08em; }
[tabindex="-1"]:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--selection); color: var(--ink); }
a { color: var(--ink); text-decoration-color: var(--rule-strong); text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration-color: currentColor; } } /* QA: ingen klibbig hover på pekskärm */
.nb { white-space: nowrap; }
.todo { background: color-mix(in srgb, var(--honey) 22%, transparent); border-radius: 3px; padding: 0 3px; }

.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 12px 16px; background: var(--ink); color: var(--bg); border-radius: var(--r-ctl); transition: transform .15s; }
.skip-link:focus { transform: translateY(92px); }
.noscript { max-width: 34rem; margin: 40px auto; padding: 0 var(--gutter); font-size: 19px; }

/* ================================================================== sidhuvud och förlopp */
.top { position: sticky; top: 0; z-index: 30; height: var(--head-h); background: var(--bg); }
.top-inner { position: relative; height: 100%; max-width: 72rem; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter); }
.brand { font-family: var(--font-display); font-style: italic; font-size: 20px; letter-spacing: .005em; }
.progress { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.chapter-label { font-family: var(--font-display); font-style: italic; font-size: 17px; line-height: 1; white-space: nowrap; }
.dots { display: flex; gap: 6px; }
.dots li { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--rule-strong); transition: background-color .3s, border-color .3s, transform .3s; }
.dots li.is-done { background: var(--rule-strong); }
.dots li.is-current { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.time-left { margin-left: auto; font-size: 15px; line-height: 1.2; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.top.is-intro .progress, .top.is-intro .time-left, .top.is-intro .meter { display: none; }
.top:not(.is-intro) .brand { display: none; }
.top.is-calm .time-left { display: none; }
.meter { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--rule); overflow: hidden; }
.meter-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform .7s var(--ease-out); }
.quick { flex: none; min-height: 48px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--rule-strong); border-radius: var(--r-ctl); background: var(--sheet); color: var(--ink); font-weight: 600; font-size: 15px; }
.quick svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .quick:hover { border-color: var(--ink); } } /* QA: ingen klibbig hover på pekskärm */
.top.is-calm .quick { margin-left: auto; }

/* ================================================================== scen */
.stage { position: relative; max-width: calc(var(--col) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) calc(var(--bar-h) + 48px); overflow-x: clip; }
.screen { position: relative; padding-top: 24px; max-width: var(--col); margin: 0 auto; }
.screen.is-leaving { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 0; }
.screen:not(.is-leaving) { z-index: 1; }
.end-marker { height: 1px; margin-top: 8px; }
html.is-booting .stage, html.is-booting .bar, html.is-booting .top { visibility: hidden; }

.display { font-family: var(--font-display); font-weight: 360; font-size: clamp(42px, 11vw, 72px); line-height: 1.02; letter-spacing: -0.015em; text-wrap: balance; }
.lede { font-size: 19px; line-height: 1.6; max-width: 34rem; margin-top: 20px; text-wrap: pretty; }
.lede + .lede { margin-top: 12px; }
.meta { margin-top: 16px; font-size: 17px; }
.meta a { display: inline-flex; align-items: center; min-height: 48px; }
.q-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(27px, 7.2vw, 40px); line-height: 1.14; letter-spacing: -0.01em; text-wrap: balance; margin-bottom: 22px; }
.q-title.is-long { font-size: clamp(24px, 6.4vw, 33px); line-height: 1.2; }
.help { margin: -8px 0 20px; font-size: 17px; color: var(--ink-2); max-width: 34rem; }
.chapter-no { font-family: var(--font-display); font-style: italic; font-size: 21px; color: var(--accent); margin-bottom: 6px; }
.display:focus, .q-title:focus { outline: none; }

/* ================================================================== illustrationer (en tunn linje) */
.illo-slot { margin: 0 -6px 10px; }
.illo { width: 100%; max-width: 380px; height: auto; overflow: visible; }
.illo .ln { fill: none; stroke: var(--illo-line); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; }
.illo .ln.thin { stroke-width: 1.2; }
.illo .fillpaper { fill: var(--sheet); stroke: var(--illo-line); stroke-width: 1.6; stroke-linejoin: round; }
.illo .glow { fill: var(--glow); }
.illo .warm { fill: var(--illo-warm); }
.illo .accent { fill: var(--accent); stroke: none; }
.illo .accent-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; }
.illo .honey-fill { fill: var(--honey); opacity: .85; }
.illo .dash { fill: none; stroke: var(--illo-line); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: .1 5.2; }
.illo .accent-line.ring-25 { stroke-dasharray: .25 1.01; } .illo .accent-line.ring-50 { stroke-dasharray: .5 1.01; } .illo .accent-line.ring-75 { stroke-dasharray: .75 1.01; }
.illo.play .ln, .illo.play .accent-line { animation: draw 1.25s cubic-bezier(.45, 0, .2, 1) both; }
.illo.play .glow, .illo.play .warm, .illo.play .accent { animation: bloom 1.1s ease-out both; transform-box: fill-box; transform-origin: 50% 50%; }
.illo.play .d1 { animation-delay: .05s; } .illo.play .d2 { animation-delay: .25s; } .illo.play .d3 { animation-delay: .45s; }
.illo.play .d4 { animation-delay: .65s; } .illo.play .d5 { animation-delay: .9s; } .illo.play .d6 { animation-delay: 1.15s; }
.illo.play .beam { animation: settle 1.7s cubic-bezier(.3, .7, .3, 1) .9s both; transform-box: view-box; transform-origin: 160px 58px; }
.illo.play .sway { animation: sway 2.4s ease-in-out .6s both; transform-box: fill-box; transform-origin: 50% 100%; }
.illo.play .steam { animation: steam 3.2s ease-out 1.2s infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.illo.play .lit { animation: lit 1.8s ease-out 1.2s both; }
.illo.play .dash { animation: lit 1s ease-out .9s both; }
.illo.play .accent-line.ring-25 { animation: ring25 1.3s cubic-bezier(.4, 0, .2, 1) .6s both; }
.illo.play .accent-line.ring-50 { animation: ring50 1.3s cubic-bezier(.4, 0, .2, 1) .6s both; }
.illo.play .accent-line.ring-75 { animation: ring75 1.3s cubic-bezier(.4, 0, .2, 1) .6s both; }
.illo.play .bar-grow { animation: grow 1s cubic-bezier(.3, .7, .2, 1) .5s both; transform-box: fill-box; transform-origin: 0 50%; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes bloom { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
@keyframes settle { 0% { transform: rotate(-5deg); } 55% { transform: rotate(2deg); } 100% { transform: none; } }
@keyframes sway { 0% { transform: rotate(-3deg); } 60% { transform: rotate(1.5deg); } 100% { transform: none; } }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px); } 30% { opacity: .75; } 100% { opacity: 0; transform: translateY(-9px); } }
@keyframes lit { from { opacity: 0; } to { opacity: 1; } }
@keyframes ring25 { from { stroke-dasharray: 0 1.01; } to { stroke-dasharray: .25 1.01; } }
@keyframes ring50 { from { stroke-dasharray: 0 1.01; } to { stroke-dasharray: .5 1.01; } }
@keyframes ring75 { from { stroke-dasharray: 0 1.01; } to { stroke-dasharray: .75 1.01; } }
@keyframes grow { from { transform: scaleX(.05); } to { transform: none; } }
.tone-7 .illo.play .ln, .is-calm-screen .illo.play .ln { animation: none; }
.is-calm-screen .illo.play .glow, .is-calm-screen .illo.play .warm { animation: lit 1.2s ease-out both; }

/* ================================================================== knappar */
.btn { min-height: 56px; padding: 0 26px; border: 1.5px solid transparent; border-radius: var(--r-ctl); display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap; font-weight: 650; font-size: 17px; line-height: 1; transition: background-color .2s, border-color .2s, transform .12s, opacity .22s; }
.btn:disabled { cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgb(0 0 0 / .14), 0 10px 18px -12px var(--accent); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .btn-ghost:hover { border-color: var(--ink); } } /* QA: ingen klibbig hover på pekskärm */
.btn svg { width: 20px; height: 20px; }
.link-btn { min-height: 48px; padding: 0 4px; margin-left: -4px; border: 0; background: transparent; color: var(--ink-2); font-size: 16px; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) { .link-btn:hover { color: var(--ink); text-decoration-color: currentColor; } } /* QA: ingen klibbig hover på pekskärm */
.q-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin-top: 10px; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 12px var(--gutter) max(12px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid transparent; transition: border-color .2s; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 30px; background: linear-gradient(to top, var(--bg), transparent); opacity: 0; transition: opacity .22s; pointer-events: none; }
.bar.has-more { border-top-color: var(--rule); }
.bar.has-more::before { opacity: 1; }
.bar-inner { max-width: var(--col); margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar .next { margin-left: auto; min-width: 10rem; transition: opacity .22s, transform .22s; }
.bar .next.is-hidden { opacity: 0; transform: translateY(6px); pointer-events: none; }
.bar .back { padding: 0 20px; }
.bar.is-solo .bar-inner { justify-content: flex-end; }
.bar.is-off { display: none; }

/* Signalen "Fler alternativ" (SPEC 7.5) */
.more { position: fixed; z-index: 24; left: 50%; bottom: calc(var(--bar-h) + 12px); transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .22s; }
.more.is-on { opacity: 1; pointer-events: auto; }
.more-btn { min-height: 44px; padding: 0 18px 0 20px; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--rule-strong); border-radius: 999px; background: var(--sheet); color: var(--ink); font-weight: 600; font-size: 15px; box-shadow: var(--shadow); }
.more-btn svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .more-btn:hover { border-color: var(--ink); } } /* QA: ingen klibbig hover på pekskärm */
.more.is-on .more-btn svg { animation: nudge 1.9s ease-in-out 1s infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(3px); } 90% { transform: translateY(0); } }

.toast { position: fixed; z-index: 45; left: 50%; bottom: calc(var(--bar-h) + 16px); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: var(--r-ctl); background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 500; }

/* ================================================================== alternativ: linjerade rader som på ett formulär */
/* Översta linjen läggs på första raden, så att alla linjer är lika breda (raderna går lite utanför spalten) */
.opts { border-top: 0; }
.opts > .opt:first-child { border-top: 1px solid var(--rule); }
.opt { position: relative; display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 12px 10px 12px 6px; margin: 0 -10px 0 -6px; border-bottom: 1px solid var(--rule); cursor: pointer; transition: background-color .2s ease, box-shadow .2s ease; -webkit-tap-highlight-color: transparent; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -2px; }
.opt-text { flex: 1; line-height: 1.4; }
.opt-letter { font-family: var(--font-display); font-style: italic; font-size: 1.1em; margin-right: 6px; color: var(--ink-2); }
.opt-key { display: none; font: 500 12px/1 var(--font-body); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 3px; padding: 4px 6px; }
@media (hover: hover) and (pointer: fine) { .opt-key { display: inline-block; } .opt:hover:not(:has(input:checked)) { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); } }
.mark { flex: none; width: 26px; height: 26px; }
.mark svg { width: 26px; height: 26px; overflow: visible; }
.mark .ring { fill: transparent; stroke: var(--rule-strong); stroke-width: 1.5; transition: fill .2s, stroke .2s; }
.mark .tick { fill: none; stroke: var(--on-accent); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.opt:has(input:checked) { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.opt:has(input:checked) .ring { fill: var(--accent); stroke: var(--accent); }
.opt:has(input:checked) .tick { stroke-dashoffset: 0; transition: stroke-dashoffset .24s .04s ease-out; }
.opt.is-picked .mark { animation: pop .34s cubic-bezier(.3, .7, .4, 1.5); }
@keyframes pop { from { transform: scale(.78); } to { transform: none; } }
.opts.is-compact .opt { min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
.opts.is-compact .opt-text { font-size: 17px; }
.opt.is-off { margin-top: 14px; border-top: 1px solid var(--rule); }

.other-field { margin: 14px 0 4px; }
.other-field label { display: block; font-size: 17px; color: var(--ink-2); margin-bottom: 6px; }
.other-field.is-in { animation: fade .3s ease-out both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
input[type="text"], input[type="email"] { width: 100%; display: block; min-height: 52px; padding: 12px 14px; font-size: max(16px, 1em); background: var(--sheet); border: 1.5px solid var(--rule-strong); border-radius: var(--r-ctl); }
input[type="text"]:focus-visible, input[type="email"]:focus-visible { outline-offset: 2px; border-color: var(--accent); }

/* Tidslinje (Q8_6) */
.timeline { position: relative; padding-left: 8px; }
.timeline > .opt:first-child { border-top: 0; }
.timeline::before { content: ""; position: absolute; left: 20px; top: 28px; bottom: 28px; width: 0; border-left: 2px dashed var(--rule-strong); }
.timeline .opt { margin-left: 0; padding-left: 0; border-bottom: 0; min-height: 60px; }
.timeline .opt:has(input:checked) { box-shadow: none; background: transparent; }
.timeline .mark { width: 26px; height: 26px; margin-left: 0; background: var(--bg); border-radius: 50%; position: relative; z-index: 1; }
.timeline .opt-text { padding: 8px 14px; border-radius: var(--r-ctl); border: 1px solid var(--rule); background: var(--sheet); flex: 0 1 auto; transition: background-color .2s, border-color .2s; }
.timeline .opt:has(input:checked) .opt-text { background: var(--accent-soft); border-color: var(--accent); }
.timeline .opt-key { margin-left: auto; }
.timeline .opt.is-off { margin-top: 18px; }
.timeline .opt.is-off .mark { visibility: visible; }

/* ================================================================== flerval: chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; display: inline-flex; flex: 1 1 auto; align-items: center; gap: 12px; min-height: 52px; max-width: 100%; padding: 10px 18px 10px 14px; border: 1.5px solid var(--rule-strong); border-radius: var(--r-ctl); background: var(--sheet); cursor: pointer; transition: background-color .18s, border-color .18s, transform .12s; -webkit-tap-highlight-color: transparent; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.chip-box { flex: none; width: 22px; height: 22px; border: 1.5px solid var(--rule-strong); border-radius: 6px; display: grid; place-items: center; transition: background-color .18s, border-color .18s; }
.chip-box svg { width: 16px; height: 16px; }
.chip-box .tick { fill: none; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.chip-text { line-height: 1.3; }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.chip:has(input:checked) .chip-box { background: var(--accent); border-color: var(--accent); }
.chip:has(input:checked) .tick { stroke-dashoffset: 0; transition: stroke-dashoffset .22s .03s ease-out; }
.chip.is-picked { animation: pressed .28s cubic-bezier(.3, .7, .4, 1.4); }
@keyframes pressed { 0% { transform: scale(.96); } 100% { transform: none; } }
.chip.is-exclusive { border-style: dashed; }
.chip.is-exclusive:has(input:checked) { border-style: solid; }
@media (hover: hover) { .chip:hover:not(:has(input:checked)) { border-color: var(--ink); } }
.chips-sep { flex-basis: 100%; height: 0; }

/* ================================================================== skala 1–5 */
.scale { position: relative; }
.scale-row { position: relative; display: flex; justify-content: space-between; gap: 8px; }
.scale-row::before { content: ""; position: absolute; left: 28px; right: 28px; top: 50%; height: 0; border-top: 1.5px solid var(--rule-strong); transform: translateY(-.75px); }
.stone { position: relative; flex: 1 1 0; max-width: 64px; min-width: 0; aspect-ratio: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stone input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.stone-face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--rule-strong); background: var(--sheet); font-family: var(--font-display); font-size: 24px; font-weight: 450; transition: background-color .18s, border-color .18s, transform .22s var(--ease-out), color .18s; }
.stone:has(input:checked) .stone-face { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.1); }
.stone:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 50%; }
@media (hover: hover) { .stone:hover:not(:has(input:checked)) .stone-face { border-color: var(--ink); } }
.scale-ends { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; font-size: 17px; color: var(--ink-2); }
.scale-ends span:last-child { text-align: right; }
.concept { margin: 0 0 26px; padding: 18px 20px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-paper); box-shadow: var(--shadow); }
.concept .illo { max-width: 300px; margin: 0 auto 10px; }
.concept p { font-family: var(--font-display); font-size: 21px; line-height: 1.45; text-wrap: pretty; }

/* ================================================================== fritext på linjerat papper */
.field { position: relative; }
textarea { width: 100%; display: block; resize: none; overflow: hidden; min-height: 134px; padding: 6px 2px 10px; font-size: max(16px, 1em); line-height: 32px; color: var(--ink); background-color: transparent;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px); background-position: 0 6px; background-attachment: local;
  border: 0; border-bottom: 1.5px solid var(--rule-strong); border-radius: 0; }
textarea:focus-visible { outline-offset: 6px; border-bottom-color: var(--accent); }
textarea::placeholder { color: var(--ink-2); opacity: .8; }
.counter { display: block; min-height: 24px; margin-top: 6px; font-size: 15px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.chip-btn { min-height: 48px; padding: 0 18px; background: transparent; border: 1.5px solid var(--rule-strong); border-radius: var(--r-ctl); font-size: 16px; color: var(--ink); display: inline-flex; align-items: center; gap: 10px; transition: background-color .2s, border-color .2s; }
@media (hover: hover) and (pointer: fine) { .chip-btn:hover { border-color: var(--ink); } } /* QA: ingen klibbig hover på pekskärm */
.chip-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip-btn.is-picked { animation: pressed .3s cubic-bezier(.3, .7, .4, 1.4); }
.has-follow .main-actions { display: none; }

/* Följdfrågan: en lugn, vänlig ruta, en pratbubbla och inget som liknar ett felmeddelande */
.followup { position: relative; margin-top: 30px; padding: 20px 18px 8px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 14px; }
.followup::before { content: ""; position: absolute; top: -9px; left: 34px; width: 16px; height: 16px; background: var(--accent-soft); border-left: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-top: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); transform: rotate(45deg); border-top-left-radius: 3px; }
.followup.is-in { animation: follow .42s var(--ease-out) both; }
@keyframes follow { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.follow-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.follow-head svg { flex: none; width: 28px; height: 28px; margin-top: 2px; color: var(--accent); }
.follow-label { display: block; font-family: var(--font-display); font-style: italic; font-size: 23px; line-height: 1.3; }
.followup textarea { background-color: var(--sheet); background-image: none; border: 1.5px solid var(--rule-strong); border-radius: var(--r-ctl); padding: 12px 14px; line-height: 1.5; min-height: 108px; }
.followup textarea:focus-visible { outline-offset: 2px; border-color: var(--accent); }

/* ================================================================== scenarier */
.scenario-no { font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--accent); margin-bottom: 8px; display: block; }
.scenario-text { font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 5.6vw, 27px); line-height: 1.38; text-wrap: pretty; }
.scenario-text .ask { display: block; margin-top: 10px; font-style: italic; }
.guess-title { margin-bottom: 18px; }
.guess-title .scenario-no { margin-bottom: 6px; }

.viz { margin: 22px 0 24px; padding: 18px 18px 20px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-paper); box-shadow: var(--shadow); }
.viz figcaption { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 14px; }
.viz-title { font-family: var(--font-display); font-style: italic; font-size: 21px; }
.viz-note { font-size: 15px; color: var(--ink-2); }
.viz-rows { position: relative; display: grid; gap: 14px; }
.viz-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name num" "track track"; gap: 4px 12px; align-items: baseline; transition: opacity .35s ease; }
.viz-name { grid-area: name; font-size: 16px; }
.viz-num { grid-area: num; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-track { grid-area: track; position: relative; display: block; height: 20px; border-left: 1.5px solid var(--rule-strong); overflow: hidden; }
.viz-fill { position: absolute; inset: 0; display: block; border-radius: 0 4px 4px 0; background: var(--accent); will-change: transform; }
.viz-row[data-who="ali"] .viz-fill { background: var(--honey); }
.viz-joint { position: absolute; inset: 0; opacity: 0; align-content: center; pointer-events: none; }
.viz-joint .viz-fill { background: repeating-linear-gradient(135deg, var(--accent) 0 9px, var(--honey) 9px 18px); }
.viz.is-joint .viz-row:not(.viz-joint) { opacity: 0; }
.viz.is-joint .viz-joint { opacity: 1; }
@media (max-height: 740px) and (max-width: 999px) {
  /* Lägre graf som följer med när man rullar bland alternativen (SPEC 7.3b) */
  .viz { position: sticky; top: var(--head-h); z-index: 6; margin: 12px 0 8px; padding: 10px 14px 12px; }
  .viz figcaption { margin-bottom: 6px; }
  .viz-title { font-size: 18px; }
  .viz-rows { gap: 7px; }
  .viz-row { gap: 1px 12px; }
  .viz-name { font-size: 15px; }
  .viz-num { font-size: 16px; }
  .viz-track { height: 11px; }
  .scenario-text { font-size: 20px; line-height: 1.34; }
  .scenario-text .ask { margin-top: 6px; }
  .s-scenario .opt { min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
}

/* ================================================================== kortbunten (registerkort) */
.deck-head { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.deck-count { font-family: var(--font-display); font-style: italic; font-size: 17px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.is-done .deck-count { visibility: hidden; }
.deck { position: relative; display: grid; margin-bottom: 32px; }
.card { grid-area: 1 / 1; position: relative; min-height: 196px; padding: 74px 22px 22px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-paper); box-shadow: var(--shadow); transform-origin: 50% 100%; transition: transform .34s var(--ease-out), opacity .34s;
  background-image: linear-gradient(to bottom, transparent 55px, var(--honey) 55px 56px, transparent 56px); background-repeat: no-repeat; }
.card[data-pos="0"] { z-index: 3; }
.card[data-pos="1"] { z-index: 2; transform: translateY(9px) scale(.965); }
.card[data-pos="2"] { z-index: 1; transform: translateY(18px) scale(.93); }
.card[data-pos="3"] { z-index: 0; opacity: 0; transform: translateY(18px) scale(.93); }
.card[data-pos="exit"] { z-index: 4; }
.card[data-pos="gone"] { visibility: hidden; }
.card-icon { position: absolute; top: 12px; left: 18px; width: 36px; height: 36px; color: var(--ink); }
.card-icon svg { width: 36px; height: 36px; }
.card-icon .ln { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card-icon .fl { fill: var(--glow); stroke: none; }
.card-topic { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 6.4vw, 30px); line-height: 1.22; }
.stamp { position: absolute; top: 12px; right: 14px; font-family: var(--font-display); font-style: italic; font-size: 19px; padding: 2px 10px; border: 1.5px solid currentColor; border-radius: 3px; color: var(--accent); background: var(--sheet); opacity: 0; transform: rotate(-4deg) scale(1.2); }
.card.is-answered .stamp { opacity: 1; transform: rotate(-4deg); transition: opacity .12s, transform .16s ease-out; }
.card-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card-btn { min-height: 58px; background: var(--sheet); border: 1.5px solid var(--rule-strong); border-radius: var(--r-ctl); font-size: 17px; font-weight: 650; color: var(--ink); transition: background-color .15s, border-color .15s, transform .12s; }
@media (hover: hover) and (pointer: fine) { .card-btn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); } } /* QA: ingen klibbig hover på pekskärm */
.card-btn:active:not(:disabled) { transform: translateY(1px); }
.card-btn:disabled { opacity: .45; }
.deck-done { position: relative; z-index: 5; grid-area: 1 / 1; align-self: center; padding: 22px; border: 1px dashed var(--rule-strong); border-radius: var(--r-paper); font-size: 17px; color: var(--ink-2); background: var(--bg); text-align: center; }
.deck-done.is-in { animation: fade .3s ease-out both; }

/* ================================================================== quizkort som vänds */
.quiz { perspective: 1400px; }
.quiz-card { position: relative; display: grid; transform-style: preserve-3d; transition: transform .62s cubic-bezier(.4, .1, .2, 1); }
.quiz-card.is-flipped { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; min-height: 250px; padding: 30px 24px 26px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-paper); box-shadow: var(--shadow); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background-image: linear-gradient(to bottom, transparent 55px, var(--honey) 55px 56px, transparent 56px); background-repeat: no-repeat; }
.face.back { transform: rotateY(180deg); background-color: var(--accent-soft); background-image: none; border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.face.front { padding-top: 78px; }
.quiz-no { position: absolute; top: 14px; left: 24px; font-family: var(--font-display); font-style: italic; font-size: 17px; color: var(--ink-2); }
.statement { font-family: var(--font-display); font-weight: 400; font-size: clamp(21px, 5.4vw, 25px); line-height: 1.42; text-wrap: pretty; }
.guessed { margin-bottom: 12px; font-size: 16px; color: var(--ink-2); }
.facit { font-size: 18px; line-height: 1.55; text-wrap: pretty; }
.facit strong { font-family: var(--font-display); font-weight: 600; font-size: 1.3em; margin-right: 4px; }
.facit-note { margin-top: 16px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.quiz-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 24px; transition: opacity .3s; }
.quiz-actions.is-done { opacity: 0; pointer-events: none; }

/* ================================================================== peppning (SPEC 7.6) */
.pep { display: flex; align-items: center; gap: 16px; margin-top: 30px; padding: 16px 18px 16px 14px; background: var(--sheet); border: 1px solid var(--rule); border-left: 3px solid var(--honey); border-radius: var(--r-paper); box-shadow: var(--shadow); max-width: 34rem; }
.pep .pep-illo { flex: none; width: 76px; }
.pep .pep-illo .illo { max-width: 76px; }
.pep p { font-family: var(--font-display); font-size: 19.5px; line-height: 1.4; text-wrap: pretty; }
.pep.is-in { animation: pepin .6s var(--ease-out) .5s both; }
/* Kapitelstart med peppkort: illustrationen blir lägre så att hela kortet ryms över nederkanten (390 x 844) */
@media (max-width: 999px) {
  .s-chapter.has-pep .illo-slot { max-width: 290px; margin: 0 auto 2px; }
  .s-chapter.has-pep .chapter-no { margin-bottom: 2px; }
  .s-chapter.has-pep .lede { margin-top: 14px; }
  .pep { margin-top: 22px; gap: 14px; padding: 14px 16px 14px 12px; }
  .pep .pep-illo { width: 60px; }
  .pep .pep-illo .illo { max-width: 60px; }
  .pep p { font-size: 19px; line-height: 1.38; }
}
@keyframes pepin { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ================================================================== inbjudan, slutskärm och stöd */
.invite .warn { margin-top: 14px; padding: 12px 16px; border-left: 3px solid var(--honey); background: var(--sheet); border-radius: 0 var(--r-paper) var(--r-paper) 0; font-size: 17px; font-weight: 500; }
.linkbox { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 8px 8px 8px 14px; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--r-ctl); }
.linkbox input { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; font-size: max(16px, 1em); color: var(--ink-2); text-overflow: ellipsis; }
.linkbox input:focus-visible { outline-offset: 6px; }
.share-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.share-status { min-height: 22px; margin-top: 8px; font-size: 17px; color: var(--ink-2); }
.later { margin-top: 2px; }
.invite .illo-slot.is-small { margin-bottom: 0; }
.invite .illo-slot.is-small .illo { max-width: 176px; }

.support { margin-top: 26px; padding: 6px 20px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-paper); }
.support li { padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 18px; line-height: 1.45; }
.support li:last-child { border-bottom: 0; }
.support a { color: var(--ink); font-weight: 650; text-decoration-color: var(--rule-strong); text-decoration-thickness: 1.5px; white-space: nowrap; }
.support-actions { margin-top: 22px; }
.end .display { font-size: clamp(38px, 10vw, 60px); }
.end-block { margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--rule); }
.end-block h2 { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 22px; line-height: 1.3; margin-bottom: 12px; }
.end-support { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--rule); }
.end-support h2 { font-size: 17px; font-weight: 500; line-height: 1.4; color: var(--ink-2); }
.end-support .support { margin-top: 12px; padding: 2px 16px; background: transparent; }
.end-support .support li { font-size: 17px; padding: 12px 0; }
.save-state { margin-top: 24px; font-size: 16px; color: var(--ink-2); min-height: 24px; }
.save-state .btn { min-height: 48px; margin-top: 10px; }
.resume { padding-top: 40px; }
.resume .btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* samtycke */
.consent { margin-top: 26px; }
.consent .opt:first-of-type { border-top: 1px solid var(--rule); }
.consent .opt { min-height: 64px; }
.consent .mark svg { width: 28px; height: 28px; }

/* ================================================================== dator: två spalter */
.panel { display: none; }
@media (min-width: 720px) {
  :root { --gutter: 32px; --head-h: 76px; }
  .screen { padding-top: 40px; }
  .illo-slot .illo { max-width: 440px; }
  .card { min-height: 224px; padding: 78px 30px 28px; }
}
@media (min-width: 1000px) {
  :root { --gutter: 40px; --head-h: 84px; --panel-w: min(46vw, 760px); --bar-h: 92px; }
  .panel { display: block; position: fixed; z-index: 20; left: 0; top: 0; bottom: 0; width: var(--panel-w); padding: 16px 0 16px 16px; pointer-events: none; }
  .panel-stack { position: relative; width: 100%; height: 100%; }
  .panel-item { position: absolute; inset: 0; display: grid; place-items: center; padding: 40px; border-radius: 22px; background: var(--panel); overflow: hidden; opacity: 0; transition: opacity .5s ease; }
  .panel-item.is-on { opacity: 1; }
  .panel-item .illo { width: 100%; max-width: min(560px, 100%); max-height: 70vh; }
  .panel-item.has-viz { align-content: center; gap: 28px; }
  .top, .stage { margin-left: var(--panel-w); }
  .top-inner { max-width: none; padding-left: var(--gutter); padding-right: var(--gutter); }
  .stage { max-width: none; padding-left: var(--gutter); padding-right: var(--gutter); }
  .bar { left: var(--panel-w); padding-left: var(--gutter); padding-right: var(--gutter); padding-bottom: max(20px, env(safe-area-inset-bottom)); padding-top: 18px; }
  .more { left: calc(var(--panel-w) + (100vw - var(--panel-w)) / 2); }
  .illo-slot { display: none; }
  .screen[data-center] { min-height: calc(100dvh - var(--head-h) - var(--bar-h) - 56px); display: flex; flex-direction: column; justify-content: center; padding-top: 0; }
  .screen { padding-top: 56px; }
  .viz { margin: 0; width: min(100%, 540px); }
  .panel-item .viz { background: var(--sheet); }
  .is-calm-screen .panel-item { background: var(--panel); }
}
@media (min-width: 1000px) and (max-height: 860px) {
  .screen { padding-top: 40px; }
  .s-scenario .scenario-text { font-size: 24px; line-height: 1.32; }
  .s-scenario .scenario-text .ask { margin-top: 6px; }
  .s-scenario .opt { min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
  .end .display { font-size: 48px; }
  .end-block { margin-top: 24px; padding-top: 18px; }
  .end-support { margin-top: 28px; padding-top: 16px; }
}
@media (min-width: 1000px) and (max-height: 700px) {
  .screen { padding-top: 32px; }
}

/* ================================================================== rörelse */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .illo .ln, .illo .accent-line { stroke-dasharray: none; }
  .illo.play .ln, .illo.play .accent-line, .illo.play .beam, .illo.play .sway, .illo.play .steam { animation: none !important; }
  .more.is-on .more-btn svg { animation: none; }
}

@media print { .bar, .more, .top .quick { display: none !important; } }

/* ================================================================== tillägg */
.btn-primary:disabled { background: var(--rule); color: var(--ink-2); box-shadow: none; }
.btn .label { display: inline; }
.field-note { margin-top: 8px; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.field-error { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--honey); background: var(--sheet); border-radius: 0 var(--r-paper) var(--r-paper) 0; font-size: 17px; }
.viz.is-out { opacity: 0; transition: opacity .18s; }
.illo-slot.is-small .illo { max-width: 220px; }
@media (max-height: 740px) and (max-width: 999px) { .s-scenario .illo-slot { display: none; } }
@media (max-width: 999px) and (min-height: 741px) {
  .viz { margin: 16px 0 14px; padding: 14px 16px 16px; }
  .viz figcaption { margin-bottom: 10px; }
  .viz-rows { gap: 10px; }
  .viz-track { height: 14px; }
}
.end .illo-slot { margin-bottom: 20px; }

/* ================================================================== informationssidan (integritet.html) */
.doc-page { background: var(--bg); }
.doc-head { position: sticky; top: 0; z-index: 30; height: var(--head-h); background: var(--bg); border-bottom: 1px solid var(--rule); }
.doc-head-inner { height: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.doc-back { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px; font-weight: 600; font-size: 16px; text-decoration: none; }
.doc-back svg { width: 20px; height: 20px; }
.doc-back:hover { text-decoration: underline; text-decoration-thickness: 1.5px; }
.doc { max-width: calc(var(--col) + 2 * var(--gutter)); margin: 0 auto; padding: 28px var(--gutter) 96px; }
.doc > * { max-width: var(--col); }
.doc-illo { margin: 0 0 26px -6px; max-width: 320px; }
.doc-illo .illo { max-width: 320px; }
.doc .display { font-size: clamp(36px, 9vw, 54px); }
.doc section { margin-top: 42px; padding-top: 26px; border-top: 1px solid var(--rule); }
.doc h2 { font-family: var(--font-display); font-weight: 420; font-size: 26px; line-height: 1.2; letter-spacing: -.005em; margin-bottom: 14px; text-wrap: balance; }
.doc p { line-height: 1.6; text-wrap: pretty; }
.doc p + p { margin-top: 12px; }
.doc ul:not(.support) { margin-top: 4px; }
.doc ul:not(.support) li { position: relative; padding: 5px 0 5px 22px; line-height: 1.55; text-wrap: pretty; }
.doc ul:not(.support) li::before { content: ''; position: absolute; left: 2px; top: 1.05em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.doc a { font-weight: 600; }
.doc-support { padding: 26px 0 0; }
.doc-support .support { margin-top: 16px; }
.doc-support .support a { white-space: nowrap; }
.doc-page .noscript { margin: 0 auto 40px; font-size: 16px; color: var(--ink-2); }
@media (min-width: 1000px) {
  .doc { padding-top: 48px; }
}
