/* Gränssnitt utformat för läsbarhet: stor text, höga kontraster, stora tryckytor. */
:root {
  --bg: #f4f4f1; --panel: #ffffff; --ink: #111111; --muted: #444444; --line: #cfcfca;
  --accent: #1d4ed8; --accent-dark: #1e40af; --accent-ink: #ffffff;
  --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --risk: #6d28d9; --scale: #0e7490; --tool: #0f766e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 96px; }
h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 10px; }
h2 { font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 10px; }
h3 { font-size: 1.1rem; margin: 18px 0 6px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.lead { font-size: 1.15rem; }
.center { text-align: center; }
.tag { display: inline-block; font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; background: #e0e7ff; color: #312e81; font-weight: 600; }
.tag.risk { background: #ede9fe; color: var(--risk); }
.tag.scale { background: #cffafe; color: #155e75; }
.tag.tool { background: #ccfbf1; color: #115e59; }
.tag.ovrigt { background: #e5e7eb; color: #1f2937; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; margin-bottom: 18px; }
.card.active { border: 3px solid var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.hidden { display: none !important; }
.code { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: 0.14em; }
a { color: var(--accent); text-underline-offset: 3px; }

button, .btn { font: inherit; font-size: 1.05rem; font-weight: 700; min-height: 54px; padding: 12px 22px; border: 2px solid #9a9a94; background: #fff; color: var(--ink); border-radius: 12px; cursor: pointer; transition: background .15s, border-color .15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:hover, .btn:hover { border-color: var(--ink); }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.danger { color: var(--bad); border-color: #e5b4b4; }
button.quiet { border-color: transparent; background: transparent; text-decoration: underline; min-height: 44px; }
button.big, .btn.big { width: 100%; min-height: 64px; font-size: 1.2rem; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 4px solid #f59e0b; outline-offset: 2px; }

label.field { display: block; font-weight: 700; margin-bottom: 8px; }
input[type=text], input[type=password], textarea { font: inherit; font-size: 1.15rem; width: 100%; padding: 14px; border: 2px solid #9a9a94; border-radius: 12px; background: #fff; color: var(--ink); }
input:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 170px; resize: vertical; line-height: 1.5; }
input.code { font-size: 2rem; text-align: center; text-transform: uppercase; padding: 14px 8px; }

.status { display: inline-block; font-size: 0.95rem; font-weight: 700; padding: 6px 12px; border-radius: 8px; background: #e5e7eb; color: #1f2937; }
.status.open { background: #dcfce7; color: #14532d; }
.status.closed { background: #fef3c7; color: #78350f; }
.status.published { background: #dbeafe; color: #1e3a8a; }
.alert { padding: 14px 16px; border-radius: 12px; font-size: 1rem; margin: 0 0 14px; border: 2px solid transparent; }
.alert.warn { background: #fef3c7; color: #78350f; border-color: #fcd34d; }
.alert.bad { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }
.alert.ok { background: #dcfce7; color: #14532d; border-color: #86efac; }
.alert.info { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.banner { position: fixed; left: 0; right: 0; top: 0; z-index: 10; text-align: center; padding: 10px; background: #fef3c7; color: #78350f; font-weight: 700; border-bottom: 2px solid #fcd34d; }

/* Steg och framsteg (publik) */
.progress { margin: 6px 0 16px; }
.progress .track { height: 12px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.progress .fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width .2s; }
.progress .lbl { font-weight: 700; margin-bottom: 6px; }
.statement { font-size: 1.35rem; font-weight: 700; line-height: 1.35; margin: 8px 0 18px; }
.options { display: grid; gap: 8px; }
.option { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 14px; border: 2px solid #9a9a94; border-radius: 12px; background: #fff; cursor: pointer; font-size: 1.1rem; user-select: none; }
.option .num { flex: 0 0 40px; height: 40px; border-radius: 50%; border: 2px solid #9a9a94; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.option .txt { font-weight: 500; }
.option.selected { background: #dbeafe; border-color: var(--accent); }
.option.selected .num { background: var(--accent); color: #fff; border-color: var(--accent); }
.option input { position: absolute; opacity: 0; width: 0; height: 0; }
.nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 18px; position: sticky; bottom: 0; background: var(--panel); padding: 12px 0 4px; border-top: 1px solid var(--line); }
.nav.single { grid-template-columns: 1fr; }
.counter { text-align: right; font-size: 0.9rem; color: var(--muted); margin-top: 6px; }
.bigcheck { width: 96px; height: 96px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 56px; display: flex; align-items: center; justify-content: center; margin: 10px auto 18px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.steps li::before { content: counter(s); flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* Resultat */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); margin: 8px 0 14px; }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.legend .l::before { background: var(--bad); } .legend .m::before { background: var(--warn); } .legend .h::before { background: var(--ok); }
.bars { display: grid; gap: 14px; }
.bar { display: grid; grid-template-columns: minmax(140px, 1.3fr) 3fr 52px; gap: 12px; align-items: center; }
.bar .lbl { font-size: 1rem; font-weight: 600; }
.bar .lbl small { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 400; }
.bar .track { height: 22px; background: #e5e7eb; border-radius: 11px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 11px; background: var(--scale); }
.bar .fill.low { background: var(--bad); }
.bar .fill.mid { background: var(--warn); }
.bar .fill.high { background: var(--ok); }
.bar .val { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.overall { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.overall .big { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.themes { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.theme { border: 2px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; }
.theme .n { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0; }
.theme .n small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.theme blockquote { margin: 10px 0 0; padding-left: 12px; border-left: 4px solid #cbd5e1; color: #1f2937; font-style: italic; }
.theme .qrow { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; }
.theme .qrow label { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 700; white-space: nowrap; min-height: 44px; }
.theme .qrow input { width: 26px; height: 26px; }
.rek { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rek div { border-left: 4px solid var(--tool); padding-left: 12px; }
.rek b { display: block; color: var(--tool); font-size: 0.85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }

/* Föreläsarpanel */
.help { font-size: 0.95rem; color: var(--muted); margin: 8px 0 0; }
.now { font-size: 1.15rem; }
.now b { color: var(--accent-dark); }
details summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; }
details summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }
.actions { margin-top: 14px; }
.stepnum { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; background: #e5e7eb; color: #111; font-weight: 800; align-items: center; justify-content: center; margin-right: 8px; }
.card.active .stepnum { background: var(--accent); color: #fff; }
.livecount { font-size: 2rem; font-weight: 800; }

.text-result { display: grid; gap: 8px; }
.text-result h3:first-child { margin-top: 8px; }
body.screen .text-result { grid-template-columns: 1.15fr 1fr; gap: 40px; }
body.screen .text-result .themes { grid-template-columns: 1fr 1fr; gap: 12px; }
body.screen .text-result h3 { font-size: 1.35rem; margin: 6px 0 4px; }
body.screen .text-result h3:first-child { margin-top: 0; }
body.screen .text-result .rek { grid-template-columns: 1fr; gap: 10px; }
body.screen .text-result .theme { padding: 12px 14px; }
body.screen .text-result .theme .n { font-size: 2rem; margin: 2px 0; }
body.screen .text-result .theme blockquote { font-size: 1.05rem; margin-top: 6px; }
body.screen .result-view h1 { font-size: 2.6rem; margin-bottom: 4px; }
body.screen .result-view .subq { font-size: 1.25rem; margin-bottom: 10px; }
body.screen .text-result p, body.screen .text-result .rek { font-size: 1.02rem; line-height: 1.4; }
body.screen .text-result h3 { font-size: 1.2rem; }
body.screen .text-result .rek b { font-size: 0.85rem; }
body.screen .result-view .card { padding: 16px 24px; }
@media (max-width: 1100px) { body.screen .text-result { grid-template-columns: 1fr; } }

/* Skärm (projektor) */
body.screen { background: #0f1115; color: #f8fafc; font-size: 22px; }
body.screen .wrap { max-width: 1500px; padding: 40px 56px; }
body.screen h1 { font-size: 3.4rem; }
body.screen h2 { font-size: 2.2rem; }
body.screen .card, body.screen .theme { background: #181b22; border-color: #343945; color: #f8fafc; }
body.screen .muted { color: #cbd5e1; }
body.screen .tag { font-size: 1.1rem; padding: 6px 14px; }
body.screen .bar .track { background: #343945; height: 28px; border-radius: 14px; }
body.screen .bar .lbl { font-size: 1.2rem; line-height: 1.2; }
body.screen .bar .lbl small { font-size: 0.85rem; color: #cbd5e1; line-height: 1.25; }
body.screen .bar .val { font-size: 1.6rem; }
body.screen .bar { grid-template-columns: minmax(220px, 1.6fr) 3fr 80px; }
body.screen .bars { gap: 8px; }
body.screen .overall { margin-bottom: 4px; }
body.screen .overall .big { font-size: 4rem; }
body.screen .card { padding: 20px 26px; }
body.screen .legend { font-size: 1.05rem; color: #cbd5e1; }
body.screen .theme .n { font-size: 2.8rem; }
body.screen .theme blockquote { font-size: 1.3rem; color: #e2e8f0; border-color: #475569; }
body.screen p, body.screen .rek { font-size: 1.3rem; }
body.screen .rek b { font-size: 1rem; color: #5eead4; }
body.screen .rek div { border-color: #5eead4; }
body.screen .alert.warn { background: #3b2a06; color: #fde68a; border-color: #b45309; font-size: 1.2rem; }
body.screen .lobby { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; min-height: 78vh; }
body.screen .lobby .code { font-size: 6.5rem; line-height: 1; margin: 12px 0 24px; }
body.screen .lobby .steps li { font-size: 1.5rem; margin-bottom: 22px; align-items: center; }
body.screen .lobby .steps li::before { flex-basis: 56px; height: 56px; font-size: 1.6rem; }
body.screen .qr { background: #fff; padding: 24px; border-radius: 20px; display: inline-block; }
body.screen .count { font-size: 2.6rem; font-weight: 800; margin-top: 16px; }
body.screen .question-view { min-height: 78vh; display: grid; grid-template-columns: 2fr 1fr; gap: 56px; align-items: center; }
body.screen .question-view ol { font-size: 1.45rem; line-height: 1.35; padding-left: 1.3em; margin: 8px 0 0; }
body.screen .question-view ol li { margin-bottom: 6px; }
body.screen .question-view h1 { font-size: 2.6rem; }
body.screen .question-view .big-q { font-size: 2.8rem; font-weight: 700; line-height: 1.3; }
body.screen .footer { margin-top: 28px; color: #94a3b8; font-size: 1rem; }
@media (max-width: 900px) {
  body.screen .lobby, body.screen .question-view { grid-template-columns: 1fr; }
  body.screen .wrap { padding: 24px 16px; }
  body.screen h1 { font-size: 2.2rem; }
  body.screen .lobby .code { font-size: 4rem; }
}
@media (max-width: 480px) {
  .bar { grid-template-columns: 1fr; gap: 4px; }
  .bar .val { text-align: left; }
  .nav { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
