/* ============================================================
   MatteMedMartin.no — felles stilark
   ============================================================ */

:root {
  --bg-1: #0d1b2a;
  --bg-2: #11263a;
  --surface: #15314a;
  --surface-2: #1b3d5c;
  --border: #234b6d;
  --border-soft: #1c3854;
  --blue: #6aa9d6;
  --blue-soft: #4f8db8;
  --teal: #5fc4b8;
  --green: #8ad29b;
  --amber: #f5c971;
  --rose: #e98ba2;
  --violet: #a48cd9;
  --text: #e7eef5;
  --text-muted: #9bb1c5;
  --text-dim: #6f8aa1;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --radius: 14px;
  --radius-sm: 9px;
  --topbar-bg: rgba(13, 27, 42, .88);
  --nav-bg: rgba(17, 38, 58, .6);
}

/* Lys modus: følger systeminnstilling (kun når ingen manuelt valg er gjort) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-1: #f8fafc; --bg-2: #f1f5f9; --surface: #ffffff; --surface-2: #f1f5f9;
    --border: #94a3b8; --border-soft: #cbd5e1;
    --blue: #2563eb; --blue-soft: #1d4ed8; --teal: #10b981; --green: #059669;
    --amber: #d97706; --rose: #e11d48; --violet: #7c3aed;
    --text: #1e2937; --text-muted: #475569; --text-dim: #94a3b8;
    --shadow: 0 8px 24px rgba(0,0,0,.10);
    --topbar-bg: rgba(255,255,255,.92); --nav-bg: rgba(241,245,249,.85);
  }
  :root:not([data-theme]) .logo-mark { color: #ffffff; }
  :root:not([data-theme]) .nav-tab { border-color: #cbd5e1; color: var(--text); }
  :root:not([data-theme]) .nav-tab.active { color: #ffffff; }
  :root:not([data-theme]) .nav-tab:hover { border-color: var(--teal); }
  :root:not([data-theme]) .card .num { background: rgba(16,185,129,.12); }
  :root:not([data-theme]) .test-yourself .start-btn { color: #ffffff; }
  :root:not([data-theme]) .fysikk-promo { background: linear-gradient(135deg,#1e3a5f 0%,#0f2742 100%); }
  :root:not([data-theme]) input[type="range"] { background: #94a3b8; }
}

/* Lys modus: manuelt valgt via knapp */
:root[data-theme="light"] {
  --bg-1: #f8fafc; --bg-2: #f1f5f9; --surface: #ffffff; --surface-2: #f1f5f9;
  --border: #94a3b8; --border-soft: #cbd5e1;
  --blue: #2563eb; --blue-soft: #1d4ed8; --teal: #10b981; --green: #059669;
  --amber: #d97706; --rose: #e11d48; --violet: #7c3aed;
  --text: #1e2937; --text-muted: #475569; --text-dim: #94a3b8;
  --shadow: 0 8px 24px rgba(0,0,0,.10);
  --topbar-bg: rgba(255,255,255,.92); --nav-bg: rgba(241,245,249,.85);
}
:root[data-theme="light"] .logo-mark { color: #ffffff; }
:root[data-theme="light"] .nav-tab { border-color: #cbd5e1; color: var(--text); }
:root[data-theme="light"] .nav-tab.active { color: #ffffff; }
:root[data-theme="light"] .nav-tab:hover { border-color: var(--teal); }
:root[data-theme="light"] .card .num { background: rgba(16,185,129,.12); }
:root[data-theme="light"] .test-yourself .start-btn { color: #ffffff; }
:root[data-theme="light"] .fysikk-promo { background: linear-gradient(135deg,#1e3a5f 0%,#0f2742 100%); }
:root[data-theme="light"] input[type="range"] { background: #94a3b8; }

/* Sol/måne-knapp */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  width: 34px; height: 34px;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s ease;
  margin-left: 6px;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface); border-color: var(--teal); }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

.topbar {
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.logo-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal) 100%);
  display: grid; place-items: center;
  font-weight: 700; color: var(--bg-1); font-size: 18px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(95, 196, 184, .3);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 600; font-size: 17px; color: var(--text); text-decoration: none; }
.brand-sub { font-size: 12px; color: var(--text-muted); letter-spacing: 0.4px; }

.nav-tabs {
  display: flex; gap: 4px;
  padding: 8px 28px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 67px; z-index: 49;
  flex-wrap: wrap;
}
.nav-tab {
  padding: 8px 14px; border-radius: 999px;
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent;
  font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: all .15s ease;
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.nav-tab:hover { color: var(--text); background: var(--surface); }
.nav-tab.active {
  background: linear-gradient(135deg, var(--blue-soft), var(--teal));
  color: var(--bg-1); font-weight: 600; border-color: var(--teal);
  box-shadow: 0 2px 12px rgba(95, 196, 184, .25);
}
.nav-tab .tab-num { opacity: .65; font-size: 12px; margin-right: 4px; }
.nav-spacer { margin-left: auto; }

/* Dropdown-meny */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-trigger {
  background: transparent;
  border: 1px solid transparent;
  font-family: inherit;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  padding-top: 12px;
  min-width: 230px;
  z-index: 100;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.nav-dropdown-menu a {
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  display: block;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--surface-2); color: var(--teal); }
.nav-dropdown-menu a.featured {
  background: rgba(95, 196, 184, .12);
  color: var(--teal);
  font-weight: 600;
  margin-bottom: 4px;
  border: 1px solid rgba(95, 196, 184, .25);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: flex; }

/* Topic-velger på alle-quizer */
.topic-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}
.topic-btn {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all .15s ease;
}
.topic-btn:hover { border-color: var(--teal); color: var(--text); }
.topic-btn.active {
  background: linear-gradient(135deg, var(--blue-soft), var(--teal));
  color: var(--bg-1);
  font-weight: 600;
  border-color: var(--teal);
  box-shadow: 0 2px 12px rgba(95, 196, 184, .25);
}
.topic-btn .topic-num { opacity: .65; font-size: 12px; margin-right: 4px; }
.topic-btn.active .topic-num { opacity: .9; }

/* Test deg selv-CTA på forsiden */
.test-yourself {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 28px;
  margin: 28px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.test-yourself::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(95, 196, 184, .18) 0%, transparent 70%);
  pointer-events: none;
}
.test-yourself h2 { color: var(--teal); margin: 0 0 8px; }
.test-yourself p { color: var(--text-muted); margin: 0 0 18px; max-width: 520px; margin-left: auto; margin-right: auto; }
.test-yourself .start-btn {
  background: var(--teal);
  color: var(--bg-1);
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  z-index: 1;
  transition: all .15s ease;
}
.test-yourself .start-btn:hover {
  background: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(95, 196, 184, .35);
}

main { max-width: 1200px; margin: 0 auto; padding: 28px; }
h1, h2, h3, h4 { color: var(--text); margin-top: 0; }
h1 { font-size: 28px; font-weight: 600; }
h2 { font-size: 22px; font-weight: 600; color: var(--blue); }
h3 { font-size: 17px; font-weight: 600; color: var(--teal); }
p { color: var(--text-muted); }

.hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 28px;
  position: relative; overflow: hidden;
}
.hero h1 { margin-bottom: 8px; }
.hero p { color: var(--text-muted); font-size: 15px; max-width: 620px; }

.hero-with-image {
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: center;
}
.hero-image {
  width: 100%; max-width: 400px; height: auto; display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.hero-text h1 { margin: 0 0 10px 0; }
.hero-text p { margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px; cursor: pointer;
  transition: all .15s ease;
  text-align: left; color: inherit;
  text-decoration: none; display: block;
}
.card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card .num {
  display: inline-block; width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(95, 196, 184, .15);
  color: var(--teal);
  text-align: center; line-height: 32px;
  font-weight: 600; margin-bottom: 12px; font-size: 14px;
}
.card h3 { margin: 0 0 6px 0; color: var(--text); font-size: 16px; }
.card .desc { font-size: 13px; color: var(--text-muted); }

.section {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}
.section.accent-blue { border-left: 4px solid var(--blue); }
.section.accent-green { border-left: 4px solid var(--green); }
.section.accent-teal { border-left: 4px solid var(--teal); }
.section.accent-amber { border-left: 4px solid var(--amber); }
.section.accent-violet { border-left: 4px solid var(--violet); }

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-top: 18px;
}
.flip-card { perspective: 1000px; height: 130px; cursor: pointer; }
.flip-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.6s; transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center; border: 1px solid var(--border);
}
.flip-front { background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); }
.flip-front .term { color: var(--blue); font-weight: 600; font-size: 16px; }
.flip-front .hint { color: var(--text-dim); font-size: 11px; margin-top: 8px; }
.flip-back {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  transform: rotateY(180deg);
  color: var(--text); font-size: 13px; line-height: 1.45;
}

.slide-deck {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; margin: 18px 0;
}
.slide { display: none; padding: 32px 28px; min-height: 220px; }
.slide.active { display: block; }
.slide h3 { color: var(--amber); margin-bottom: 14px; }
.slide-controls {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; background: var(--bg-1);
  border-top: 1px solid var(--border-soft);
}
.slide-btn {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 14px; cursor: pointer; font-size: 13px;
  transition: all .15s ease;
}
.slide-btn:hover:not(:disabled) { background: var(--blue-soft); border-color: var(--blue); }
.slide-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.slide-counter { color: var(--text-muted); font-size: 13px; }

.example {
  background: var(--bg-2);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 12px 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 14px;
}
.example .label {
  display: inline-block;
  background: rgba(138, 210, 155, .15);
  color: var(--green);
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  margin-bottom: 8px; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.example.warn { border-left-color: var(--amber); }
.example.warn .label { background: rgba(245, 201, 113, .15); color: var(--amber); }
.example.tip { border-left-color: var(--teal); }
.example.tip .label { background: rgba(95, 196, 184, .15); color: var(--teal); }

.steps {
  margin: 14px 0; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--border-soft);
}
.step {
  padding: 12px 16px; background: var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
  display: grid; grid-template-columns: 32px 1fr;
  gap: 12px; align-items: center;
}
.step:last-child { border-bottom: none; }
.step.hidden .step-content { display: none; }
.step .step-num {
  width: 28px; height: 28px;
  background: var(--blue-soft); color: var(--text);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
}
.step.hidden .step-num { background: var(--surface-2); color: var(--text-dim); }
.step-content { color: var(--text); font-size: 14px; }
.reveal-btn {
  background: var(--teal); color: var(--bg-1);
  border: none; border-radius: 8px;
  padding: 8px 16px; cursor: pointer;
  font-weight: 600; font-size: 13px;
  margin-top: 10px;
}
.reveal-btn:hover { background: var(--green); }

.interactive {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px; margin: 16px 0;
}
.slider-row {
  display: grid; grid-template-columns: 110px 1fr 60px;
  gap: 14px; align-items: center; margin-bottom: 12px;
}
.slider-label { color: var(--blue); font-weight: 500; font-size: 14px; }
.slider-value {
  color: var(--amber); font-family: 'JetBrains Mono', monospace;
  text-align: right; background: var(--surface);
  padding: 4px 8px; border-radius: 6px; font-size: 13px;
}
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 6px; background: var(--surface-2);
  border-radius: 3px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--teal); border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(95, 196, 184, .4);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--teal); border-radius: 50%;
  cursor: pointer; border: none;
}

canvas {
  background: var(--bg-1);
  border-radius: var(--radius-sm);
  display: block; width: 100%;
  max-width: 600px; margin: 16px auto 0;
}

/* Trekantløser */
.trisolve {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 16px 0;
  padding: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.trisolve-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.trisolve-input { display: flex; flex-direction: column; gap: 4px; }
.trisolve-label { font-size: 12px; font-weight: 600; letter-spacing: 0.3px; }
.trisolve-input input {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 14px; outline: none;
}
.trisolve-input input:focus { border-color: var(--teal); }
.trisolve-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.trisolve-btn {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.trisolve-btn:hover { background: var(--surface); border-color: var(--teal); }
.trisolve-hint { font-size: 12px; color: var(--text-dim); }
.trisolve-error { color: var(--rose); font-size: 13px; min-height: 18px; }
.trisolve-display { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.trisolve-display svg {
  width: 100%; max-width: 380px; height: auto;
  background: var(--bg-1); border-radius: var(--radius-sm);
}
.trisolve-formulas {
  width: 100%; font-size: 13px; color: var(--text);
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 10px 14px; border: 1px solid var(--border-soft);
}
.trisolve-formulas ul { margin: 0; padding-left: 18px; }
.trisolve-formulas li { margin: 3px 0; font-family: 'JetBrains Mono', monospace; }
.trisolve-formulas .label-default { color: var(--text-dim); font-size: 12px; font-style: italic; }

/* Quiz */
.quiz { margin: 18px 0; }
.quiz-levels { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.quiz-level-btn {
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 18px; font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: all .15s ease;
}
.quiz-level-btn:hover { color: var(--text); background: var(--surface); }
.quiz-level-btn.active {
  background: linear-gradient(135deg, var(--blue-soft), var(--teal));
  color: var(--bg-1); font-weight: 600; border-color: var(--teal);
  box-shadow: 0 2px 12px rgba(95, 196, 184, .25);
}
.quiz-progress { margin-bottom: 18px; }
.quiz-progress-text {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}
.quiz-progress-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--teal) 100%);
  transition: width .3s ease;
}
.quiz-single { animation: quizFadeIn .25s ease; }
@keyframes quizFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.quiz-next-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.quiz-next-btn {
  background: var(--teal); color: var(--bg-1);
  border: none; border-radius: 8px;
  padding: 8px 18px; font-weight: 600; font-size: 14px;
  cursor: pointer; font-family: inherit;
  transition: all .15s ease;
}
.quiz-next-btn:hover { background: var(--green); }
.quiz-results {
  text-align: center; padding: 36px 20px;
  background: var(--bg-2); border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  animation: quizFadeIn .4s ease;
}
.quiz-results-emoji { font-size: 64px; margin-bottom: 8px; }
.quiz-results-title { font-size: 22px; color: var(--teal); font-weight: 600; margin-bottom: 12px; }
.quiz-results-score {
  font-size: 48px; font-weight: 700; color: var(--text);
  font-family: 'JetBrains Mono', monospace; line-height: 1.1;
}
.quiz-results-pct {
  font-size: 18px; color: var(--amber);
  margin: 6px 0 28px; font-family: 'JetBrains Mono', monospace;
}
.quiz-results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.quiz-restart-btn, .quiz-share-btn {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 18px; font-size: 14px; cursor: pointer;
  font-family: inherit; transition: all .15s ease;
}
.quiz-restart-btn { background: var(--teal); color: var(--bg-1); font-weight: 600; border-color: var(--teal); }
.quiz-restart-btn:hover { background: var(--green); }
.quiz-share-btn:hover { background: var(--surface); border-color: var(--teal); color: var(--text); }
.quiz-q {
  background: var(--bg-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.quiz-q .question { color: var(--text); font-size: 15px; margin-bottom: 12px; font-weight: 500; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  background: var(--surface); border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 10px 14px; border-radius: 8px;
  cursor: pointer; text-align: left; font-family: inherit; font-size: 14px;
  transition: all .15s ease;
}
.quiz-opt:hover { border-color: var(--teal); color: var(--text); }
.quiz-opt.correct { background: rgba(138, 210, 155, .15); border-color: var(--green); color: var(--green); }
.quiz-opt.wrong { background: rgba(233, 139, 162, .12); border-color: var(--rose); color: var(--rose); }
.quiz-opt.disabled { cursor: default; pointer-events: none; }
.quiz-feedback {
  margin-top: 10px; padding: 10px 12px;
  border-radius: 8px; font-size: 13px;
  background: var(--surface-2); color: var(--text);
  display: none;
}
.quiz-feedback.show { display: block; }

.label-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill {
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; background: var(--surface-2);
  color: var(--text-muted); border: 1px solid var(--border-soft);
}
.pill.blue { color: var(--blue); border-color: rgba(106, 169, 214, .35); }
.pill.green { color: var(--green); border-color: rgba(138, 210, 155, .35); }
.pill.teal { color: var(--teal); border-color: rgba(95, 196, 184, .35); }
.pill.amber { color: var(--amber); border-color: rgba(245, 201, 113, .35); }

.table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}
.table th { background: var(--surface-2); color: var(--blue); font-weight: 600; }
.table td { color: var(--text); }
.table tr:hover td { background: rgba(95, 196, 184, .04); }

body[data-ads="off"] .ad-slot { display: none; }
.ad-slot { margin: 18px auto; max-width: 1200px; padding: 0 28px; }
.ad-slot .ad-label {
  text-align: center; font-size: 10px;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 6px;
}
.ad-frame {
  background: var(--surface);
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-dim); font-size: 12px;
  overflow: hidden;
}
.ad-top .ad-frame { min-height: 90px; max-width: 728px; margin: 0 auto; }
.ad-incontent { margin: 22px 0; padding: 0; }
.ad-incontent .ad-frame { width: 300px; height: 250px; margin: 0 auto; }
.ad-bottom .ad-frame { min-height: 90px; max-width: 728px; margin: 0 auto; }

.share-bar {
  display: flex; gap: 8px; align-items: center;
  margin: 24px 0 18px; padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.share-bar .share-label { font-size: 13px; color: var(--text-muted); margin-right: 6px; }
.share-btn {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px; font-size: 13px;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s ease;
}
.share-btn:hover { background: var(--teal); color: var(--bg-1); border-color: var(--teal); }

.about-grid {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 30px; align-items: start;
}
.about-photo {
  width: 240px; height: 240px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 3px solid var(--teal);
  display: grid; place-items: center;
  color: var(--text-dim); font-size: 13px;
  text-align: center; overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-text h1 { margin-top: 0; }
.about-text .tagline { color: var(--teal); font-size: 16px; margin-bottom: 18px; }
.contact-list { list-style: none; padding: 0; margin: 14px 0 0 0; }
.contact-list li { padding: 8px 0; color: var(--text); font-size: 14px; }
.contact-list a { color: var(--teal); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.legal {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 28px; color: var(--text); line-height: 1.65;
}
.legal h2 { color: var(--blue); margin-top: 24px; font-size: 19px; }
.legal h2:first-child { margin-top: 0; }
.legal p { color: var(--text); }
.legal ul { padding-left: 22px; }
.legal ul li { margin: 5px 0; }
.legal .updated {
  font-size: 12px; color: var(--text-dim);
  border-top: 1px solid var(--border-soft);
  padding-top: 14px; margin-top: 24px;
}

/* FAQ — kollapsibel */
.faq { margin: 20px 0; }
.faq-item {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-q {
  padding: 14px 16px;
  cursor: pointer;
  color: var(--blue);
  font-weight: 500;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::after {
  content: '+';
  color: var(--teal);
  font-size: 20px;
  transition: transform .15s ease;
}
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  transition: all .25s ease;
}
.faq-item.open .faq-a {
  padding: 0 16px 14px;
  max-height: 800px;
}

mjx-container { color: var(--text) !important; }

footer {
  text-align: center; padding: 30px;
  color: var(--text-dim); font-size: 13px;
  border-top: 1px solid var(--border-soft);
  margin-top: 40px;
}
footer a { color: var(--teal); text-decoration: none; }

@media (max-width: 720px) {
  main { padding: 18px; }
  .topbar { padding: 12px 18px; }
  .nav-tabs { padding: 8px 18px; top: 64px; }
  .hero { padding: 22px 18px; }
  .hero-with-image { grid-template-columns: 1fr; text-align: center; padding: 22px; }
  .hero-image { margin: 0 auto; max-width: 200px; }
  .slider-row { grid-template-columns: 90px 1fr 50px; gap: 10px; }
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-photo { margin: 0 auto; }
  .trisolve { grid-template-columns: 1fr; }
}
pace-between;
  align-items: center;
}
.faq-q::after {
  content: '+';
  color: var(--teal);
  font-size: 20px;
  transition: transform .15s ease;
}
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  transition: all .25s ease;
}
.faq-item.open .faq-a {
  padding: 0 16px 14px;
  max-height: 800px;
}

mjx-container { color: var(--text) !important; }

footer {
  text-align: center; padding: 30px;
  color: var(--text-dim); font-size: 13px;
  border-top: 1px solid var(--border-soft);
  margin-top: 40px;
}
footer a { color: var(--teal); text-decoration: none; }

/* FysikkMedMartin cross-promo boks */
.fysikk-promo {
  background: linear-gradient(135deg, #0f2742 0%, #1a3a5c 100%);
  border: 1px solid rgba(95, 196, 184, .35);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin: 28px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.fysikk-promo::before {
  content: "⚡";
  position: absolute;
  right: 24px; top: 16px;
  font-size: 64px;
  opacity: .12;
  pointer-events: none;
}
.fysikk-promo-badge {
  display: inline-block;
  background: var(--teal);
  color: var(--bg-1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.fysikk-promo h2 {
  color: #e7eef5;
  margin: 0 0 8px;
  font-size: 22px;
}
.fysikk-promo p {
  color: #9bb1c5;
  margin: 0 0 20px;
  font-size: 15px;
}
.fysikk-promo-btn {
  display: inline-block;
  background: var(--teal);
  color: var(--bg-1);
  font-weight: 700;
  font-size: 15px;
  padding: 13px 28px;
  border-radius: 999px;
  text-decoration: none;
  transition: all .15s ease;
}
.fysikk-promo-btn:hover {
  background: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(95, 196, 184, .35);
}

/* Kort-emoji */
.card .emoji {
  font-size: 22px;
  display: block;
  margin-bottom: 8px;
}

@media (max-width: 720px) {
  main { padding: 18px; }
  .topbar { padding: 12px 18px; }
  .nav-tabs { padding: 8px 18px; top: 64px; }
  .hero { padding: 22px 18px; }
  .hero-with-image { grid-template-columns: 1fr; text-align: center; padding: 22px; }
  .hero-image { margin: 0 auto; max-width: 200px; }
  .slider-row { grid-template-columns: 90px 1fr 50px; gap: 10px; }
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-photo { margin: 0 auto; }
  .trisolve { grid-template-columns: 1fr; }
  .fysikk-promo { padding: 24px 18px; }
}
