/*
  Gate AI Sverige. Statiska sidor utan skript, kakor eller externa anrop.
  Formen kommer från Kuggfris designsystem (neutrala ytor, Figtree, rundade block,
  pillerknappar) och färgen från Gate AI (magenta och portens gradient).
  Varumärket beskrivs i ../BRAND.md.
*/
@import url("tokens/kuggfri.css");
@import url("tokens/kuggfri-sajt.css");
@import url("tokens/gate.css");

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/*
  Färgerna, formerna och skuggorna kommer från tokens/, med Kuggfris tokens i botten och
  Gate AI:s accent ovanpå. Här står bara det som är sajtens eget.
*/
:root {
  --kugg: #1d1c19;
  --frame: #1d1c19;
  --glow-opacity: 0.22;
  --shadow-shot: 0 2px 6px rgb(0 0 0 / 0.05), 0 24px 60px rgb(0 0 0 / 0.12);
  --gate: linear-gradient(100deg, #ffb14a 0%, #ff4fd8 28%, #7a3cff 62%, #2bb6ff 100%);
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Kuggfris egna färger för utsnitten ur appen, hämtade ur Kuggfris tokens. */
  --k-accent: var(--kuggfri-accent);
  --k-accent-fg: var(--kuggfri-accent-fg);
  --k-accent-soft: var(--kuggfri-accent-soft);
  --k-accent-ink: var(--kuggfri-accent-ink);
  --k-surface-3: var(--surface-3);
  --k-card-border: var(--line);
  --k-c1: var(--chart-1);
  --k-c2: var(--chart-2);
  --k-c3: var(--chart-3);
  --k-c4: var(--chart-4);
  --k-grid: var(--chart-grid);
  --k-rate-1: var(--rate-1);
  --k-rate-2: var(--rate-2);
  --k-rate-3: var(--rate-3);
  --k-rate-4: var(--rate-4);
  --k-rate-5: var(--rate-5);
  --k-tag-1: var(--tag-1);
  --k-tag-2: var(--tag-2);
  --k-tag-3: var(--tag-3);
  --k-tag-4: var(--tag-4);
  --k-tag-5: var(--tag-5);
  --k-tag-6: var(--tag-6);
  --k-tag-7: var(--tag-7);
  --k-tag-8: var(--tag-8);
  --k-tag-9: var(--tag-9);
  --k-tag-10: var(--tag-10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --kugg: #ffffff;
    --frame: #2f3030;
    --glow-opacity: 0.3;
    --shadow-shot: 0 0 0 1px rgb(255 255 255 / 0.04), 0 24px 60px rgb(0 0 0 / 0.55);
    --k-card-border: transparent;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.375rem;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  z-index: 10;
}
.skip:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Porten. Svart i ljust läge och vit i mörkt, gradienten finns bara i skenet bakom den stora. */
.port { fill: var(--fg); }

/* Toppraden */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.brand svg { width: 1.7rem; height: 1.7rem; flex: none; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav a {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); }

/* Knappar */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: var(--surface-2); color: var(--fg); }
.btn-quiet:hover { background: var(--line); }
.btn svg { width: 1rem; height: 1rem; flex: none; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Rubriker och text */
h1 {
  margin: 0;
  font-size: clamp(2.6rem, 1.5rem + 4.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}

h2 {
  margin: 0;
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: balance;
}

h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.lead {
  margin-top: 1.5rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-ink);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

section { padding-bottom: 5.5rem; }

/* Inledningen, centrerad på båda sidorna */
.hero-center {
  padding-top: 5rem;
  padding-bottom: 5rem;
  text-align: center;
}
.hero-center h1 { max-width: 48rem; margin-left: auto; margin-right: auto; }
.hero-center .lead { margin-left: auto; margin-right: auto; max-width: 38rem; }
.hero-center .actions { justify-content: center; }
.hero-center small {
  display: block;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.hero-center small a { font-weight: 600; text-underline-offset: 3px; }
.hero-mark { display: block; width: 4rem; height: 4rem; margin: 0 auto 1.75rem; }
.hero-mark .kugg { fill: var(--kugg); }

/* Kuggfri på startsidan */
.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  padding: 3rem;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.kuggfri-name {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.25rem;
}
.kuggfri-name svg { width: 2.6rem; height: 2.6rem; flex: none; }
.kugg { fill: var(--kugg); }

.product p.body {
  margin-top: 1.25rem;
  color: var(--muted);
}
.product .actions { margin-top: 1.75rem; }
.product .shot { box-shadow: var(--shadow-card); }

/* Det vi bygger */
.intro {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}
.intro p:not(.eyebrow) {
  margin-top: 1rem;
  color: var(--muted);
}

.areas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.area {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.icon svg { width: 1.4rem; height: 1.4rem; }
.area p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1rem;
}

/* Kontakt */
.contact {
  padding: 3.5rem 3rem;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.contact p {
  max-width: 32rem;
  margin: 1rem auto 0;
  color: var(--muted);
}
.contact .actions { justify-content: center; }

/* Skärmbilder i ett enkelt fönster */
.shot {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-shot);
}
.shot-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.25rem;
  padding: 0 0.9rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.shot-bar i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--line);
}
.shot-bar span {
  margin: 0 auto;
  padding: 0.1rem 0.9rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  transform: translateX(-1.1rem);
}

/* Telefoner */
.phone {
  overflow: hidden;
  width: 100%;
  max-width: 15.5rem;
  border: 0.55rem solid var(--frame);
  border-radius: 2.4rem;
  background: var(--frame);
  box-shadow: var(--shadow-shot);
}
.phone img { border-radius: 1.85rem; }

/* Utställningen av Kuggfri */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  align-items: center;
  gap: 3.5rem;
}
.feature.flip { grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr); }
.feature.flip .feature-text { order: 2; }
.feature-text p:not(.eyebrow) {
  margin-top: 1rem;
  color: var(--muted);
}

.points {
  display: grid;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.points li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 1rem;
}
.points svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  margin-top: 0.15rem;
  color: var(--accent-ink);
}

.phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
}
.phones .phone:last-child { margin-top: 3rem; }

/* Sidfoten */
footer { border-top: 1px solid var(--line); }
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.75rem;
  padding-bottom: 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .hero-center { padding-top: 3rem; padding-bottom: 3.5rem; }
  .product {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
    padding: 2rem 1.5rem;
  }
  .areas { grid-template-columns: minmax(0, 1fr); }
  .contact { padding: 2.75rem 1.5rem; }
  section { padding-bottom: 4rem; }
  .feature, .feature.flip {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .feature.flip .feature-text { order: 0; }
  .phones { gap: 1rem; }
  .phones .phone:last-child { margin-top: 2rem; }
}

@media (max-width: 420px) {
  .nav a { padding: 0.5rem 0.65rem; }
  .brand { font-size: 1.15rem; }
  .actions .btn { flex: 1 1 100%; }
  .shot-bar { height: 1.75rem; }
  .shot-bar span { display: none; }
  .phone { border-width: 0.4rem; border-radius: 1.8rem; }
  .phone img { border-radius: 1.4rem; }
}

/*
  Utsnitt ur Kuggfri, ritade i HTML och SVG med Kuggfris former och färger (--k-*), så att de är
  skarpa och följer ljust och mörkt läge. Diagrammen byggs av ../brand-src/diagram.mjs.
*/
.k-card {
  position: relative;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--k-card-border);
  box-shadow: var(--shadow-card);
  text-align: left;
}
.k-h { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.k-help { margin-top: 0.15rem; color: var(--muted); font-size: 0.8rem; }
.k-head { margin-bottom: 1.1rem; }

/* Inledningens scen */
.stage {
  position: relative;
  max-width: 60rem;
  margin: 0 auto;
  padding-bottom: 6rem;
}
.stage::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  bottom: 15%;
  border-radius: 50%;
  background: var(--gate);
  filter: blur(90px);
  opacity: calc(var(--glow-opacity) * 0.75);
}
.stage-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.k-course-head { display: flex; align-items: center; gap: 0.75rem; }
.k-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
}
.k-icon svg { width: 1.3rem; height: 1.3rem; }
.k-title b { display: block; font-size: 1.05rem; letter-spacing: -0.01em; }
.k-title small { color: var(--muted); font-size: 0.8rem; }
.k-count {
  margin-left: auto;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
.k-count b { color: var(--fg); font-size: 0.95rem; }

.k-course-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2rem;
  align-items: end;
  margin-top: 1.5rem;
}
.k-big b { font-size: 3.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.k-big span { font-size: 1.4rem; font-weight: 700; margin-left: 0.15rem; }
.k-big small { display: block; margin-top: 0.4rem; font-size: 0.85rem; font-weight: 700; }

.k-areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem 1.25rem; }
.k-area { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 0.5rem; font-size: 0.78rem; }
.k-area > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-area > span:nth-child(2) { color: var(--muted); }
.k-area i {
  grid-column: 1 / -1;
  display: block;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--k-surface-3);
  overflow: hidden;
}
.k-area i em { display: block; height: 100%; border-radius: 999px; }

.k-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.k-course .k-tiles { margin-top: 1.5rem; }
.k-tile { padding: 0.85rem 0.95rem; border-radius: 1rem; background: var(--surface-2); }
.k-tile > span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.k-tile > span::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--dot, var(--k-c1));
}
.k-tile b { display: block; margin-top: 0.35rem; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.k-tile small { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.72rem; }

.k-today { display: flex; flex-direction: column; }
.k-label { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.k-today-n { display: block; margin-top: 0.4rem; font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.k-sub { display: block; margin-top: 0.5rem; color: var(--muted); font-size: 0.8rem; }
.k-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  min-height: 2.9rem;
  border-radius: 999px;
  background: var(--k-accent);
  color: var(--k-accent-fg);
  font-weight: 700;
  font-size: 0.95rem;
}
.k-btn svg { width: 1rem; height: 1rem; }
.k-rows { display: grid; gap: 0.6rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.k-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 1rem;
  background: var(--surface-2);
  font-size: 0.85rem;
}
.k-row svg { width: 1.1rem; height: 1.1rem; flex: none; }
.k-row b { display: block; font-size: 0.9rem; }
.k-row small { color: var(--muted); font-size: 0.75rem; }

.k-float { position: absolute; z-index: 2; }
.k-streak {
  top: -1.25rem;
  right: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-shot);
  font-weight: 700;
  font-size: 0.9rem;
}
.k-streak svg { width: 1.05rem; height: 1.05rem; color: var(--k-c3); }
.k-rates {
  left: -1.5rem;
  bottom: 3rem;
  display: flex;
  gap: 0.45rem;
  padding: 0.6rem;
  border-radius: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-shot);
}
.k-rate {
  display: grid;
  place-items: center;
  width: 3.6rem;
  padding: 0.4rem 0.2rem;
  border-radius: 0.8rem;
  border: 1.5px solid color-mix(in srgb, var(--r) 55%, transparent);
  background: color-mix(in srgb, var(--r) 14%, var(--surface));
  font-size: 0.62rem;
  color: var(--muted);
  line-height: 1.2;
}
.k-rate b { font-size: 1rem; color: var(--fg); }

/* Så funkar Kuggfri, som i Tutorial */
.steps-block {
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.steps-block > p:not(.eyebrow) { margin-top: 1rem; max-width: 42rem; color: var(--muted); }
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.steps li { padding: 1.4rem; border-radius: var(--radius-lg); background: var(--surface-2); }
.steps .num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.95rem;
}
.steps p { margin-top: 0.5rem; color: var(--muted); font-size: 0.95rem; }

/* Rutnätet med diagram */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.25rem; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }
.bento > .k-tiles { grid-column: span 12; }
.bento > .k-tiles .k-tile { background: var(--surface); box-shadow: var(--shadow-card); border: 1px solid var(--k-card-border); padding: 1.1rem 1.2rem; }
.bento > .k-tiles .k-tile b { font-size: 1.9rem; }
.note { margin-top: 1rem; color: var(--muted); font-size: 0.85rem; }

.k-chart { display: block; width: 100%; height: auto; overflow: visible; }
.k-grid { stroke: var(--k-grid); stroke-width: 1; }
.k-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.k-area { fill-opacity: 0.12; }
.k-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.k-end { stroke: var(--surface); stroke-width: 2; }
.k-bar { fill: var(--k-c1); }

.k-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}
.k-key li { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); }
.k-key b { color: var(--fg); }
.k-key i { width: 0.625rem; height: 0.625rem; border-radius: 50%; }
.k-key i.sq { border-radius: 0.2rem; }
.k-center-key { justify-content: center; margin: 0.75rem 0 0; font-size: 0.78rem; }

.k-radar { max-width: 20rem; margin: 0 auto; }
.k-radar-partial { fill: var(--k-c1); fill-opacity: 0.08; stroke: var(--k-c1); stroke-opacity: 0.35; stroke-width: 1.5; stroke-linejoin: round; }
.k-radar-learned { fill: var(--k-c1); fill-opacity: 0.6; stroke: var(--k-c1); stroke-width: 2; stroke-linejoin: round; }
.k-radar-dot { fill: var(--k-c1); stroke: var(--surface); stroke-width: 1.5; }
.k-radar-num { fill: var(--fg); font-size: 10px; font-weight: 700; font-family: var(--font); }

.k-heat-wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.k-heat { max-width: 15rem; }
.k-heat-0 { fill: var(--k-surface-3); }
.k-heat-1 { fill: var(--k-c1); fill-opacity: 0.28; }
.k-heat-2 { fill: var(--k-c1); fill-opacity: 0.52; }
.k-heat-3 { fill: var(--k-c1); fill-opacity: 0.78; }
.k-heat-4 { fill: var(--k-c1); }
.k-heat-x { fill: none; }
.k-heat-today { stroke: var(--fg); stroke-width: 2; }
.k-heat-wrap .k-tiles { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }

.k-donut-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.k-donut { width: 9.5rem; height: 9.5rem; }
.k-grid-ring { stroke: var(--k-grid); }
.k-donut-total { fill: var(--fg); font-size: 22px; font-weight: 800; font-family: var(--font); }
.k-donut-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.k-legend { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; }
.k-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 2.6rem; gap: 0.55rem; align-items: center; }
.k-dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; }
.k-pct { text-align: right; color: var(--muted); }

.k-progress { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 2.5rem; margin: 0; padding: 0; list-style: none; }
.k-progress li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.45rem 0.65rem; align-items: center; font-size: 0.9rem; }
.k-progress .k-n {
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--t);
  font-size: 0.65rem;
  font-weight: 700;
}
.k-progress li > span:nth-child(3) { color: var(--muted); font-variant-numeric: tabular-nums; }
.k-progress i {
  grid-column: 2 / -1;
  display: flex;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--k-surface-3);
  overflow: hidden;
}
.k-progress i em { display: block; height: 100%; background: var(--k-c1); }
.k-progress i em + em { background: color-mix(in srgb, var(--k-c1) 35%, transparent); }

/* Granskningen med verktygsraden längst ner, som i appen */
.review { position: relative; padding-bottom: 0.9rem; background: var(--bg); }
.review img {
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 82%);
  mask-image: linear-gradient(to bottom, #000 40%, transparent 82%);
}
.k-toolbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: -2.75rem 0.9rem 0;
  padding: 0.45rem;
  border-radius: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-shot);
  font-size: 0.8rem;
  font-weight: 600;
}
.k-tb {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--surface-2);
}
.k-tb svg { width: 0.9rem; height: 0.9rem; }
.k-tb kbd {
  padding: 0 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  font-family: var(--font);
  font-size: 0.6rem;
  color: var(--muted);
}
.k-tb-go { background: var(--k-accent); color: var(--k-accent-fg); }
.k-tb-go kbd { border-color: color-mix(in srgb, var(--k-accent-fg) 40%, transparent); color: inherit; }

@media (max-width: 860px) {
  .stage { padding-bottom: 4rem; }
  .stage-grid { grid-template-columns: minmax(0, 1fr); }
  .k-rates { position: relative; left: auto; bottom: auto; margin-top: 1rem; justify-content: space-between; }
  .k-rate { width: auto; flex: 1; }
  .k-streak { top: -1.1rem; right: 1rem; }
  .k-course-body { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .k-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-block { padding: 1.75rem 1.25rem; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .span-5, .span-6, .span-7, .span-12, .bento > .k-tiles { grid-column: auto; }
  .k-progress { grid-template-columns: minmax(0, 1fr); }
  .k-heat-wrap { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .k-course-head { flex-wrap: wrap; }
  .k-count { margin-left: 0; }
  .k-areas { grid-template-columns: minmax(0, 1fr); }
  .k-donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .k-legend { width: 100%; }
  .k-axis { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
