











.sida {
  flex: 1;
  width: 100%;
  max-width: calc(var(--sida-bredd, 820px) + 2 * var(--sida));
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--sida) clamp(64px, 8vw, 112px);
}

.sida-smal { --sida-bredd: 760px; }

.sida-huvud { margin-bottom: clamp(24px, 3vw, 36px); }

.sida-huvud h1 {
  font-family: var(--head);
  font-size: clamp(1.875rem, 1.3rem + 1.8vw, 2.5rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--fg-brand);
  text-wrap: balance;
}

.sida-lede {
  margin-top: 16px;
  max-width: 62ch;
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--text-soft);
}



.beta-tag {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: var(--t-etikett);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-text);
  background: var(--amber-bg);
  box-shadow: inset 0 0 0 1px var(--amber-border);
  border-radius: var(--ui-r-pill);
}


.beta-panel {
  background: var(--ark-yta);
  border-radius: var(--r-ark);
  box-shadow: var(--sh-ark);
  padding: clamp(20px, 3vw, 28px);
  margin-bottom: 16px;
}

.beta-panel h2 {
  font-family: var(--head);
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg-brand);
  margin-bottom: 14px;
}

.beta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.beta-row-gap { margin-top: 16px; }

.beta-row select { flex: 1 1 280px; width: auto; min-width: 0; }

.beta-timer {
  display: none;
  font-family: var(--sans);
  font-size: var(--text-body);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--danger-text);
}

.beta-status {
  min-height: 20px;
  margin-top: 14px;
  font-size: var(--t-small);
  line-height: 1.45;
  color: var(--text-soft);
}

.beta-progress {
  display: none;
  height: 6px;
  margin-top: 14px;
  background: var(--bg-sunk);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--ui-r-pill);
  overflow: hidden;
}

.beta-progress b {
  display: block;
  height: 100%;
  width: 0;
  background: var(--fill-brand);
  border-radius: var(--ui-r-pill);
  transition: width 0.2s var(--ease-byt);
}

.beta-note {
  margin-top: 16px;
  max-width: 62ch;
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--text-muted);
}

.beta-note a {
  color: var(--fg-brand);
  font-weight: 650;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

#beta-out {
  display: none;
  min-height: 200px;
  margin-top: 16px;
  font-size: var(--text-body);
  line-height: 1.6;
  resize: vertical;
}


.facit {
  font-family: var(--sans);
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--rad-kant);
  border-radius: var(--r-kontroll);
  padding: 16px 18px;
}


.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.duel .beta-panel { margin-bottom: 0; min-width: 0; }
@media (max-width: 720px) { .duel { grid-template-columns: 1fr; } }

.wer {
  margin: 2px 0 4px;
  font-family: var(--head);
  font-size: 2.25rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.wer small {
  margin-left: 10px;
  font-family: var(--sans);
  font-size: var(--t-etikett);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wer-good { color: var(--mint-text); }
.wer-mid { color: var(--amber-text); }
.wer-bad { color: var(--danger-text); }

.transcript {
  margin-top: 14px;
  font-size: var(--text-body);
  line-height: 1.8;
  word-break: break-word;
}

.transcript .ok { color: inherit; }
.transcript .sub { background: var(--danger-bg); color: var(--danger-text); border-radius: var(--r-token); padding: 1px 4px; }
.transcript .ins { background: var(--amber-bg); color: var(--amber-text); border-radius: var(--r-token); padding: 1px 4px; }
.transcript .del { background: var(--danger-bg); color: var(--danger-text); border-radius: var(--r-token); padding: 1px 4px; text-decoration: line-through; }

.meta-line { margin-top: 10px; font-size: var(--t-small); color: var(--text-muted); }

.legend {
  margin-top: 20px;
  max-width: 70ch;
  font-size: var(--t-small);
  line-height: 1.8;
  color: var(--text-muted);
}

.legend span { border-radius: var(--r-token); padding: 1px 5px; }
.legend .sub { background: var(--danger-bg); color: var(--danger-text); }
.legend .del { background: var(--danger-bg); color: var(--danger-text); text-decoration: line-through; }
.legend .ins { background: var(--amber-bg); color: var(--amber-text); }

.promo-banner { display: block; margin-top: 40px; border-radius: var(--r-scen); }
.promo-banner picture { display: block; }
.promo-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-scen);
  box-shadow: var(--sh-ark);
}



#icd-q {
  height: 60px;
  padding: 0 22px;
  font-size: var(--t-lead);
  font-weight: 500;
  border-radius: var(--r-ark);
  background: var(--ark-yta);
  box-shadow: var(--sh-ark);
}

#icd-q:hover { box-shadow: var(--sh-ark), 0 0 0 1px var(--line-strong); }
#icd-q:focus { outline: none; box-shadow: var(--sh-ark-fokus); }

#icd-status {
  min-height: 20px;
  margin: 14px 4px 0;
  font-size: var(--t-small);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

#icd-list {
  list-style: none;
  margin: 12px 0 0;
}


#icd-list:not(:empty) {
  padding: 6px;
  background: var(--ark-yta);
  border-radius: var(--r-ark);
  box-shadow: var(--sh-ark);
}

#icd-list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--r-kontroll);
  cursor: pointer;
  transition: background var(--tid-kort) var(--ease-byt);
}

#icd-list li + li { box-shadow: inset 0 1px 0 var(--line); }
#icd-list li:hover { background: var(--rad-hover); }
#icd-list li:focus-visible { outline-offset: -2px; background: var(--rad-hover); }

#icd-list .kod {
  min-width: 72px;
  font-family: var(--sans);
  font-size: var(--text-body);
  line-height: 1.5;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--mint-text);
  white-space: nowrap;
}

#icd-list .titel {
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--text);
}

#icd-list li.copied { background: var(--mint-soft); }

.icd-foot {
  margin-top: 28px;
  max-width: 62ch;
  font-size: var(--t-small);
  line-height: 1.6;
  color: var(--text-muted);
}







.testintyg-sida .warn {
  padding: 12px var(--sida);
  text-align: center;
  font-size: var(--t-small);
  line-height: 1.45;
  font-weight: 700;
  color: var(--bg);
  background: var(--danger-text);
}

.testintyg-sida .sida { padding-bottom: 120px; }

.testintyg-sida .sub {
  margin-top: 16px;
  max-width: 62ch;
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--text-soft);
}

.testintyg-sida .kat {
  background: var(--ark-yta);
  border-radius: var(--r-ark);
  box-shadow: var(--sh-ark);
  padding: clamp(20px, 3vw, 26px);
  margin-bottom: 16px;
}

.testintyg-sida .kat > h2 {
  font-family: var(--head);
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg-brand);
  margin-bottom: 16px;
  padding-bottom: 12px;
  box-shadow: 0 1px 0 var(--line);
}

.testintyg-sida .frg { margin-bottom: 18px; }
.testintyg-sida .frg:last-child { margin-bottom: 0; }

.testintyg-sida .frg h3 {
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 8px;
}

.testintyg-sida textarea { min-height: 96px; resize: vertical; }

.testintyg-sida label.cb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-size: var(--text-body);
  color: var(--text);
}

.testintyg-sida label.cb input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--fill-brand);
}

.testintyg-sida .row { display: flex; flex-wrap: wrap; gap: 4px 24px; }

.testintyg-sida .foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px var(--sida) max(12px, env(safe-area-inset-bottom));
  background: var(--surface-glass);
  box-shadow: 0 -1px 0 var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.testintyg-sida .foot .btn-ghost:disabled {
  color: var(--disabled-text);
  box-shadow: 0 0 0 1px var(--line);
  cursor: not-allowed;
}







.mobil-sida { min-height: 100vh; min-height: 100dvh; }

.mobil {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobil #flow,
.mobil #done { display: contents; }

.mobil h1 {
  order: 1;
  font-family: var(--head);
  font-size: 1.875rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--fg-brand);
  padding: 4px 2px 0;
}

.mobil .nocode {
  order: 2;
  padding: 16px 18px;
  font-size: var(--t-small);
  line-height: 1.5;
  font-weight: 650;
  color: var(--amber-text);
  background: var(--amber-bg);
  box-shadow: inset 0 0 0 1px var(--amber-border);
  border-radius: var(--r-panel);
}


.mobil-ark {
  order: 3;
  flex: 1 1 auto;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 20px;
  background: var(--ark-yta);
  border-radius: var(--r-scen);
  box-shadow: var(--sh-ark);
  transition: box-shadow var(--tid) var(--ease-byt);
}

body:has(#rec.on) .mobil-ark { box-shadow: var(--sh-ark), 0 0 0 1.5px var(--mint-line); }



#status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 16px 0 14px;
  font-size: var(--t-small);
  font-weight: 650;
  color: var(--text-soft);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--rad-kant);
  border-radius: 999px;
}

#status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}

#status::after { content: "Redo att spela in"; }
body:has(#rec.on) #status::after { content: "Spelar in ..."; }
body:has(#rec.paused) #status::after { content: "Pausad"; }
body:has(#rec.busy) #status::after { content: "Arbetar ..."; }

body:has(#rec.on) #status::before { background: var(--mint-text); box-shadow: 0 0 0 3px var(--mint-soft); animation: status-puls 1.6s ease-in-out infinite; }
body:has(#rec.paused) #status::before { background: var(--amber-text); }
body:has(#rec.busy) #status::before { background: var(--fg-brand); }

@keyframes status-puls { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

#timer {
  min-height: 4.25rem;
  font-family: var(--sans);
  font-size: 3.75rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

#wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  height: 64px;
  max-width: 100%;
}

#wave i {
  flex: 0 0 3.5px;
  width: 3.5px;
  height: 12px;
  border-radius: 999px;
  background: var(--line-strong);
  transform-origin: center;
  transition: background var(--tid) var(--ease-byt);
}

#wave i:nth-child(4n+1) { height: 26px; }
#wave i:nth-child(4n+2) { height: 44px; }
#wave i:nth-child(4n+3) { height: 18px; }
#wave i:nth-child(5n) { height: 34px; }

body:has(#rec.on) #wave i { background: var(--fg-brand); animation: vag 1.1s ease-in-out infinite; }
#wave i:nth-child(2n) { animation-delay: 0.15s; }
#wave i:nth-child(3n) { animation-delay: 0.35s; }
#wave i:nth-child(5n) { animation-delay: 0.5s; }

@keyframes vag { 0%, 100% { transform: scaleY(0.45); } 50% { transform: scaleY(1.25); } }

#par-status {
  order: 4;
  padding: 0 4px;
  font-size: var(--t-small);
  line-height: 1.5;
  text-align: center;
  color: var(--text-soft);
}
#par-status:empty { display: none; }

#hint {
  order: 4;
  min-height: 3em;
  padding: 0 4px;
  font-size: var(--t-small);
  line-height: 1.5;
  text-align: center;
  color: var(--text-soft);
}

.mobil .foot {
  order: 5;
  margin-top: auto;
  padding: 0 4px;
  font-size: 0.8125rem;
  line-height: 1.55;
  text-align: center;
  color: var(--text-muted);
}



.dock {
  order: 6;
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 -20px;
  padding: 16px 20px max(20px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, transparent);
}

.dock .actions { display: flex; flex-direction: column; }




#resume { display: none; }

#rec,
#finish,
.dock .go {
  width: 100%;
  border: 0;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--on-fill-brand);
  background: var(--fill-brand);
  box-shadow: var(--sh-knapp), 0 14px 28px -16px rgba(13, 27, 64, 0.6);
  transition: background var(--tid-kort) var(--ease-byt), box-shadow var(--tid-kort) var(--ease-byt), color var(--tid-kort) var(--ease-byt), transform var(--tid-kort) var(--ease-ut);
}

#rec,
.dock .go { height: 72px; font-size: 1.1875rem; }

#finish { height: 60px; font-size: 1.0625rem; }

#rec:active:not(:disabled),
#finish:active,
.dock .go:active { transform: scale(0.98); }

#rec svg { width: 26px; height: 26px; flex-shrink: 0; }
#rec .ikon-pause { display: none; }
#rec.on .ikon-rec { display: none; }
#rec.on .ikon-pause { display: block; }

#rec.on { animation: rec-puls 1.8s ease-in-out infinite; }

@keyframes rec-puls {
  0%, 100% { box-shadow: var(--sh-knapp), 0 14px 28px -16px rgba(13, 27, 64, 0.6), 0 0 0 0 color-mix(in srgb, var(--fill-brand) 32%, transparent); }
  50% { box-shadow: var(--sh-knapp), 0 14px 28px -16px rgba(13, 27, 64, 0.6), 0 0 0 12px color-mix(in srgb, var(--fill-brand) 0%, transparent); }
}


#rec.paused {
  color: var(--fg-brand);
  background: var(--rad-yta);
  box-shadow: 0 0 0 1.5px var(--fg-brand);
}

#rec:disabled {
  color: var(--disabled-text);
  background: var(--disabled-bg);
  box-shadow: none;
  cursor: not-allowed;
}

.dock button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }


.mobil .done-kort {
  order: 3;
  flex: 1 1 auto;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 28px 24px;
  background: var(--mint-soft);
  box-shadow: inset 0 0 0 1px var(--mint-line);
  border-radius: var(--r-scen);
}

.mobil .done-kort b {
  display: block;
  font-family: var(--head);
  font-size: 1.625rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--mint-text);
}

.mobil .done-kort span {
  font-size: var(--text-body);
  line-height: 1.55;
  color: var(--text);
}

@media (max-height: 700px) {
  .mobil-ark, .mobil .done-kort { min-height: 180px; }
  #timer { font-size: 3rem; min-height: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  body:has(#rec.on) #wave i { animation: none; }
  #rec.on { animation: none; }
  body:has(#rec.on) #status::before { animation: none; }
  .beta-progress b { transition: none; }
}



#wave { display: none; }
#status { box-shadow: none; background: var(--bg-sunk); }
#timer { font-weight: 300; font-size: 3.25rem; letter-spacing: -0.04em; }
#rec .ikon-rec { color: #ff8a9b; }
#rec.on { background: #1c1f2e; }
#rec.on .ikon-pause { color: #fff; }
