/* Läxhjälpen – färgglad stil. Ämnets färg (--c) följer med genom hela ämnet. */
:root {
  --ink: #141414;
  --paper: #FFFFFF;
  --mist: #F2F4F7;
  --line: #D7DBE2;
  --muted: #4B5563;
  --ok: #0B7A43;
  --ok-bg: #DDF7E8;
  --no: #B3261E;
  --no-bg: #FDE7E5;
  --c: #141414;
  --ci: #FFFFFF;
  --display: 'Bricolage Grotesque', 'Outfit', system-ui, sans-serif;
  --text: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-block: 28px;
  --r-ctl: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-size: 18px; line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #2D5BFF; outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 8px; }
.boot { padding: 48px 24px; text-align: center; color: var(--muted); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sidhuvud */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 18px 0; }
.brand { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand svg { flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.nav a { padding: 10px 16px; border-radius: 999px; font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { background: var(--mist); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.me { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #FFD23F; font-family: var(--display); font-weight: 800; font-size: 19px; }

/* Knappar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border: 2.5px solid var(--ink); border-radius: var(--r-ctl); background: var(--paper); font-weight: 600; text-decoration: none; transition: transform .08s ease, box-shadow .08s ease; }
.btn:hover { box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.btn:active { box-shadow: none; transform: none; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { box-shadow: 4px 4px 0 var(--c, #2D5BFF); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 16px; border-width: 2px; }
.btn.quiet { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; padding: 0 10px; }
.btn.quiet:hover { box-shadow: none; transform: none; background: var(--mist); }
.btn[disabled], .btn[disabled]:hover { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.field { width: 100%; min-height: 58px; padding: 14px 20px; border: 2.5px solid var(--ink); border-radius: var(--r-ctl); background: var(--paper); }
.field::placeholder { color: #6B7280; }
label.lbl { display: block; font-weight: 600; margin-bottom: 8px; }

/* Hem */
.hero { padding: 28px 0 40px; display: grid; gap: 28px; }
.hero h1 { font-size: clamp(56px, 10vw, 112px); }
.hero .sub { font-size: clamp(22px, 3vw, 28px); font-weight: 500; margin-top: 8px; }
.ask { display: flex; flex-wrap: wrap; gap: 12px; }
.ask .field { flex: 1 1 320px; }
.blocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-bottom: 64px; }
.block { position: relative; min-height: 190px; padding: 28px; border-radius: var(--r-block); background: var(--c); color: var(--ci); text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; transition: transform .12s ease; }
.block:hover { transform: translateY(-4px) rotate(-0.6deg); }
.block h2 { font-size: clamp(34px, 4vw, 46px); }
.block .meta { font-weight: 500; font-size: 17px; }
.block .bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--ci) 22%, transparent); margin-top: 10px; overflow: hidden; }
.block .bar i { display: block; height: 100%; background: var(--ci); border-radius: 4px; }
.block.go h2 { font-size: clamp(26px, 3vw, 32px); }
.block.go .kicker { font-weight: 600; color: #FFD23F; }

/* Ämnessida */
.band { background: var(--c); color: var(--ci); padding: 36px 0 44px; border-radius: 0 0 var(--r-block) var(--r-block); }
.band h1 { font-size: clamp(52px, 9vw, 96px); }
.band p { font-size: 20px; font-weight: 500; margin-top: 10px; max-width: 46ch; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; margin-bottom: 12px; }
.back:hover { text-decoration: underline; }
.part { padding: 40px 0 0; }
.part h2 { font-size: 30px; margin-bottom: 16px; }
.areas { display: grid; gap: 12px; }
.area { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 18px 22px; border: 2.5px solid var(--ink); border-radius: 22px; background: var(--paper); }
.area .txt { flex: 1 1 320px; min-width: 0; }
.area h3 { font-family: var(--text); font-weight: 700; font-size: 20px; letter-spacing: 0; line-height: 1.25; }
.area p { color: var(--muted); font-size: 16px; margin-top: 2px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.dots i.on { background: var(--c); }
.area .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 14px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--mist); margin-left: 8px; vertical-align: middle; }
.pagepad { padding-bottom: 72px; }

/* Övning */
.stage { max-width: 760px; margin: 0 auto; padding: 24px 0 72px; display: grid; gap: 24px; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.steps i.ok { background: var(--ok); }
.steps i.no { background: var(--no); }
.steps i.now { background: var(--ink); }
.card { border: 2.5px solid var(--ink); border-radius: var(--r-block); padding: 32px; background: var(--paper); display: grid; gap: 24px; }
.card .q { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; letter-spacing: -0.01em; }
.opts { display: grid; gap: 12px; }
.opt { text-align: left; min-height: 58px; padding: 14px 20px; border: 2.5px solid var(--ink); border-radius: var(--r-ctl); background: var(--paper); font-weight: 500; transition: transform .08s ease, box-shadow .08s ease; }
.opt:hover:not([disabled]) { box-shadow: 4px 4px 0 var(--c); transform: translate(-2px, -2px); }
.opt.right { background: var(--ok-bg); border-color: var(--ok); }
.opt.wrong { background: var(--no-bg); border-color: var(--no); }
.opt[disabled] { cursor: default; }
.answer { display: flex; flex-wrap: wrap; gap: 12px; }
.answer .field { flex: 1 1 220px; }
.hint { background: #FFF3C4; border-radius: var(--r-ctl); padding: 14px 18px; }
.verdict { border-radius: var(--r-ctl); padding: 18px 20px; display: grid; gap: 6px; }
.verdict.ok { background: var(--ok-bg); }
.verdict.no { background: var(--no-bg); }
.verdict strong { font-family: var(--display); font-size: 24px; }
.verdict.ok strong { color: var(--ok); }
.verdict.no strong { color: var(--no); }
@keyframes stamp { 0% { transform: scale(.94); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.verdict { animation: stamp .22s ease-out; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row .push { margin-left: auto; }
.note { color: var(--muted); font-size: 15px; }
.done h1 { font-size: clamp(40px, 7vw, 64px); }

/* Hjälp */
.chat { max-width: 800px; margin: 0 auto; padding: 16px 0 24px; display: grid; gap: 16px; }
.chat h1 { font-size: clamp(40px, 7vw, 64px); }
.aiinfo { background: var(--mist); border-radius: var(--r-ctl); padding: 12px 16px; font-size: 16px; }
.msgs { display: grid; gap: 14px; }
.msg { max-width: 88%; padding: 14px 18px; border-radius: 22px; overflow-wrap: anywhere; }
.msg.user { justify-self: end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { justify-self: start; background: var(--mist); border-bottom-left-radius: 6px; }
.msg img { display: block; max-width: 240px; max-height: 240px; border-radius: 12px; margin-bottom: 8px; }
.msg .rep { display: inline-block; margin-top: 8px; font-size: 14px; background: none; border: 0; padding: 4px 0; text-decoration: underline; color: var(--muted); min-height: 32px; }
.msg.err { background: var(--no-bg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.composer { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0 20px; display: grid; gap: 10px; }
.composer .line { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.composer textarea { flex: 1 1 260px; resize: none; min-height: 58px; max-height: 180px; }
.thumb { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; }
.thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; border: 2px solid var(--ink); }
.typing { color: var(--muted); }

/* Resultat */
.res { padding: 16px 0 72px; display: grid; gap: 36px; }
.res h1 { font-size: clamp(44px, 8vw, 80px); }
.res section { display: grid; gap: 12px; }
.res h2 { font-size: 30px; display: flex; align-items: center; gap: 12px; }
.res h2 i { width: 22px; height: 22px; border-radius: 7px; background: var(--c); display: inline-block; }
.meter { height: 14px; border-radius: 7px; background: var(--mist); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--c); border-radius: 7px; }
.reslist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.reslist li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.reslist li span:first-child { flex: 1; }
.reslist .st { font-size: 15px; color: var(--muted); }

/* Inloggning */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login .art { background: #2D5BFF; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login .art h1 { font-size: clamp(56px, 9vw, 120px); }
.login .tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.login .tiles i { aspect-ratio: 1; border-radius: 18px; }
.login form { padding: 48px; display: grid; gap: 18px; align-content: center; max-width: 520px; width: 100%; }
.login form h2 { font-size: 36px; }
.formerr { background: var(--no-bg); color: var(--no); border-radius: var(--r-ctl); padding: 12px 16px; font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 500; z-index: 20; }

@media (max-width: 860px) {
  body { font-size: 17px; }
  .wrap { padding: 0 18px; }
  .blocks { grid-template-columns: 1fr; }
  .block { min-height: 150px; }
  .login { grid-template-columns: 1fr; }
  .login .art { padding: 32px 24px; }
  .login form { padding: 32px 24px; }
  .card { padding: 22px; }
  .nav { margin-left: 0; order: 3; width: 100%; }
  .me { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
