/* LottoAIPredictor — felles stilark for alle sidene (forside, vilkår,
   personvern, kontakt). Mørkt tema som appen, én skala for avstander og
   typografi, og samme navigasjon og bunntekst overalt. */

:root {
  --bg: #0b1020;
  --bg-2: #0f1630;
  --card: #151b30;
  --card-2: #1b2340;
  --border: #232c4d;
  --border-2: #2c3763;
  --text: #eef1f8;
  --dim: #a8b0c8;
  --muted: #7c85a3;
  --accent: #e63946;
  --gold: #f4a827;
  --green: #38b26f;
  --radius: 14px;
  --radius-s: 10px;
  --wrap: 1040px;
  --narrow: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ball-size: clamp(30px, 9.5vw, 44px);
  --ball-gap: clamp(4px, 1.6vw, 10px);
  --drum-size: min(300px, 72vw);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
}
a { color: var(--text); text-decoration-color: var(--border-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
strong { color: var(--text); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--narrow); margin: 0 auto; }
.skip {
  position: absolute; left: -9999px; top: 8px; background: var(--gold); color: #241a05;
  padding: 8px 14px; border-radius: 8px; font-weight: 600; z-index: 100;
}
.skip:focus { left: 8px; }

/* ---------- Navigasjon ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 16, 32, 0.82);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav .wrap { max-width: 1160px; }
.nav-links { display: flex; gap: 18px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--dim); font-size: 0.92rem; font-weight: 500; white-space: nowrap; }
@media (max-width: 1100px) { .nav-links .opt { display: none; } }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-cta {
  display: inline-block; padding: 8px 16px; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  background: var(--text); color: var(--bg); text-decoration: none; white-space: nowrap;
}
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- Knapper ---------- */
.btn {
  display: inline-block; padding: 14px 30px; border-radius: 999px; font-weight: 600; text-decoration: none;
  font-size: 1rem; border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255,255,255,0.14); }
.btn-primary[aria-disabled="true"] { opacity: 0.85; cursor: default; }
.btn-primary[aria-disabled="true"]:hover { transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-row { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Hero ---------- */
.hero { padding: 72px 24px 40px; text-align: center; }
.hero .logo-badge { width: 92px; height: 92px; border-radius: 22px; margin-bottom: 22px; box-shadow: 0 14px 44px rgba(244, 168, 39, 0.28); }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px;
}
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); line-height: 1.12; letter-spacing: -0.025em; max-width: 820px; margin: 0 auto; }
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--dim); margin: 18px auto 26px; max-width: 640px; }
.trust { display: flex; gap: 10px 22px; justify-content: center; flex-wrap: wrap; margin-top: 18px; padding: 0; list-style: none; font-size: 0.86rem; color: var(--dim); }
.trust li::before { content: "✓"; color: var(--green); margin-right: 6px; font-weight: 700; }

/* Trekningshjul + rekke (animasjonen i hero) */
.drum-wrap { display: flex; justify-content: center; margin: 40px 0 0; }
#drum { width: var(--drum-size); height: var(--drum-size); display: block; }
@media (prefers-reduced-motion: reduce) { .drum-wrap { display: none; } }
.balls { display: flex; gap: var(--ball-gap); justify-content: center; margin: 28px 0 0; }
.ball-slot { width: var(--ball-size); height: var(--ball-size); border-radius: 50%; border: 1px dashed var(--border-2); position: relative; flex-shrink: 0; }
.ball {
  position: absolute; inset: -1px; width: var(--ball-size); height: var(--ball-size); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: clamp(0.75rem, 3vw, 1rem);
  background: radial-gradient(circle at 30% 30%, #46c98b, #2a8a56); border: 1px solid var(--green); will-change: transform;
}
.ball.bonus { background: radial-gradient(circle at 30% 30%, #ffc45e, #c98524); border-color: var(--gold); color: #241a05; }
.ball.landed { animation: ball-glow 0.4s ease-out; }
@keyframes ball-glow { 0% { box-shadow: 0 0 0 0 rgba(56,178,111,0.7); } 100% { box-shadow: 0 0 0 14px rgba(56,178,111,0); } }
.hero-caption { color: var(--muted); font-size: 0.82rem; margin-top: 14px; }

/* ---------- Seksjoner ---------- */
section { padding: 64px 0; }
section.wrap { padding: 64px 24px; }
[id] { scroll-margin-top: 76px; }
p.prose { color: var(--dim); margin-bottom: 12px; }
section.alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; line-height: 1.2; }
.section-head p { color: var(--dim); margin-top: 12px; font-size: 1.05rem; }
h3 { font-size: 1.1rem; letter-spacing: -0.01em; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.card .icon { font-size: 1.7rem; margin-bottom: 12px; display: block; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--dim); font-size: 0.95rem; }

/* Slik virker det */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold); color: #241a05; font-weight: 800; margin-bottom: 14px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--dim); font-size: 0.95rem; }

/* Trekningsmaskinen: tekst + tabeller + nøkkeltall */
.machine-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: start; }
@media (max-width: 760px) { .machine-grid { grid-template-columns: 1fr; } }
.machine-text p { color: var(--dim); margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 20px 14px; text-align: center; }
.stat .num { display: block; font-size: 1.7rem; font-weight: 800; color: var(--gold); letter-spacing: -0.02em; }
.stat .lbl { display: block; font-size: 0.8rem; color: var(--dim); margin-top: 4px; line-height: 1.4; }

/* Tabeller */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text); font-weight: 700; }
td { color: var(--dim); }
td:first-child { color: var(--text); font-weight: 600; }
td.odds, th.odds { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
caption { text-align: left; color: var(--text); font-weight: 600; padding: 16px 0 6px; }
.net-table { min-width: 520px; margin: 0 auto 8px; }
.footnote { color: var(--muted); font-size: 0.82rem; margin-top: 12px; }

/* Nettverksdiagram */
.net-diagram { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(10px, 3vw, 22px); row-gap: 18px; margin: 30px 0 8px; }
.net-layer { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.net-count { font-weight: 800; color: var(--text); font-size: 0.95rem; }
.net-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border-2); }
.net-layer.in .net-dot { background: var(--green); }
.net-layer.out .net-dot { background: var(--gold); }
.net-label { font-size: 0.72rem; color: var(--dim); margin-top: 3px; text-align: center; }
.net-arrow { color: var(--dim); font-size: 1.3rem; }
.net-caption { text-align: center; font-size: 0.85rem; color: var(--dim); margin-bottom: 24px; }
.prose p { color: var(--dim); margin-bottom: 16px; }
.prose h2 { text-align: left; margin-bottom: 18px; }

/* Spillkort */
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.game-head h3 { margin: 0; }
.draw-day { font-size: 0.78rem; font-weight: 600; color: var(--gold); white-space: nowrap; border: 1px solid rgba(244,168,39,0.35); background: rgba(244,168,39,0.08); padding: 3px 10px; border-radius: 999px; }
.game-rule { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.game-history { margin-top: 12px; font-size: 0.85rem; color: var(--green); }

/* Pris */
.support { max-width: 860px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 30px; }
.support p { color: var(--dim); font-size: 1rem; line-height: 1.65; }
.support p + p { margin-top: 12px; }
.support strong { color: var(--text); }
.plan-includes { list-style: none; max-width: 860px; margin: 22px auto 0; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; color: var(--dim); font-size: 0.92rem; }
.plan-includes li::before { content: "✓"; color: var(--green); margin-right: 6px; font-weight: 700; }
.after-trial { max-width: 760px; margin: 30px auto 0; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 22px 26px; }
.after-trial h3 { margin-bottom: 8px; }
.after-trial p { color: var(--dim); font-size: 0.95rem; margin-bottom: 8px; }
.after-trial p:last-child { margin-bottom: 0; }

/* FAQ */
.faq { max-width: var(--narrow); margin: 0 auto; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 22px; margin-bottom: 12px; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-weight: 700; flex-shrink: 0; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--dim); margin-top: 10px; font-size: 0.95rem; }

/* Advarsel / notis */
.disclaimer { background: var(--card-2); border-left: 4px solid var(--gold); border-radius: 8px; padding: 18px 22px; font-size: 0.92rem; color: var(--dim); max-width: var(--narrow); margin: 0 auto; }
.disclaimer a { color: var(--gold); }
.notice { border: 1px solid rgba(244,168,39,0.45); background: rgba(244,168,39,0.10); border-radius: var(--radius); padding: 20px 22px; margin: 8px 0 12px; }
.notice h2 { margin-top: 0; color: var(--gold); font-size: 1.2rem; }

/* ---------- Juridiske sider ---------- */
.legal { max-width: var(--narrow); margin: 0 auto; padding: 48px 24px 72px; }
.legal h1 { font-size: 1.9rem; text-align: left; margin: 0 0 8px; max-width: none; }
.legal .updated { color: var(--dim); font-size: 0.9rem; margin-bottom: 32px; }
.legal h2 { font-size: 1.2rem; margin: 34px 0 10px; text-align: left; }
.legal h3 { font-size: 1rem; margin: 20px 0 6px; }
.legal p, .legal li { color: var(--dim); margin-bottom: 10px; }
.legal ul { padding-left: 22px; margin: 6px 0 12px; }
.legal li { margin-bottom: 6px; }
.legal table { margin: 8px 0 4px; }
.legal .summary { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 8px; }
.legal .summary ul { margin-bottom: 0; }
.legal .toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 22px; margin: 0 0 24px; }
.legal .toc ol { padding-left: 20px; margin: 0; columns: 2; column-gap: 24px; }
.legal .toc li { margin-bottom: 4px; break-inside: avoid; }
.legal .toc a { text-decoration: none; color: var(--dim); font-size: 0.92rem; }
.legal .toc a:hover { color: var(--text); }
@media (max-width: 560px) { .legal .toc ol { columns: 1; } }

/* Kontaktskjema */
.contact-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
select, input[type="email"], textarea { width: 100%; padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 0.95rem; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 140px; resize: vertical; }
.submit-btn:disabled { opacity: 0.6; cursor: default; }
.form-note { font-size: 0.85rem; margin-top: 14px; color: var(--muted); }
.alert { margin-top: 18px; padding: 14px 18px; border-radius: var(--radius-s); font-size: 0.95rem; }
.alert-success { background: rgba(56,178,111,0.12); border: 1px solid var(--green); color: var(--text); }
.alert-error { background: rgba(230,57,70,0.12); border: 1px solid var(--accent); color: var(--text); }

/* ---------- Bunntekst ---------- */
footer { border-top: 1px solid var(--border); padding: 40px 0 36px; color: var(--dim); font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; margin-bottom: 26px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: var(--text); font-size: 0.9rem; margin-bottom: 10px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { text-decoration: none; color: var(--dim); }
.footer-grid a:hover { color: var(--text); }
.footer-note { color: var(--muted); font-size: 0.85rem; max-width: 520px; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; }
.footer-bottom a { color: var(--dim); text-decoration: none; }

@media print {
  .nav, footer, .drum-wrap, .balls, .app-bar { display: none; }
  body.has-app-bar { padding-bottom: 0; }
  body { background: #fff; color: #000; }
  .legal p, .legal li, td, th { color: #000; }
}

/* ---------- Hvorfor-seksjonen ---------- */
.fact { border: 1px solid rgba(244,168,39,0.45); background: rgba(244,168,39,0.08); border-radius: var(--radius); padding: 22px 26px; max-width: var(--narrow); margin: 0 auto 36px; }
.fact h3 { color: var(--gold); margin-bottom: 8px; }
.fact p { color: var(--dim); }
.why h3.lead { text-align: center; font-size: 1.35rem; margin: 40px 0 18px; }
.why .prose { max-width: var(--narrow); margin: 0 auto; }
.why .prose p { color: var(--dim); font-size: 1.02rem; margin-bottom: 16px; }
.why .prose p strong { color: var(--text); }
.why .prose ul { color: var(--dim); font-size: 1.02rem; margin: 0 0 16px 1.2em; padding: 0; }
.why .prose li { margin-bottom: 8px; }
.why .prose ul + p { margin-top: 18px; }
.why .prose li strong { color: var(--text); }

/* ---------- Simuleringssiden ---------- */
.page-head { padding: 56px 0 24px; text-align: center; }
.page-head h1 { max-width: 760px; }
.shot { max-width: 520px; margin: 0 auto; }
.shot img { display: block; width: 100%; border-radius: 22px; border: 1px solid var(--border-2); box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.shot figcaption { color: var(--dim); font-size: 0.9rem; text-align: center; margin-top: 12px; }
.shot .placeholder { border: 2px dashed var(--border-2); border-radius: 22px; padding: 48px 28px; text-align: center; color: var(--dim); background: var(--card); }
.shot .placeholder strong { display: block; color: var(--text); margin-bottom: 8px; }
.shot .placeholder code { color: var(--gold); font-size: 0.9rem; }
.sim-note { display: flex; gap: 12px; align-items: flex-start; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 16px 20px; color: var(--dim); font-size: 0.92rem; max-width: 900px; margin: 0 auto 24px; }
.sim-note .tag { flex-shrink: 0; background: var(--gold); color: #241a05; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; margin-top: 2px; }
.sim-controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .sim-grid { grid-template-columns: 1fr; } }
.sim-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.sim-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sim-card .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--gold); animation: spin 0.8s linear infinite; display: none; }
.sim-card.running .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.sim-line { color: var(--dim); font-size: 0.9rem; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.sim-line.good { color: var(--green); font-weight: 600; }
.sim-line.muted { color: var(--muted); font-size: 0.82rem; }
.targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; max-width: 900px; margin: 0 auto 26px; }
.target { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 12px 14px; }
.target .lbl { color: var(--dim); font-size: 0.8rem; margin-bottom: 6px; }
.row-balls { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mb { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; color: #fff; background: #2f3a63; border: 1px solid #3c4a7a; }
.mb.bonus { background: #a86b1a; border-color: var(--gold); }
.mb.top { background: var(--green); border-color: #46c98b; }
.mb.hit { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold), 0 0 10px rgba(244,168,39,0.8); }
.mb.dim { opacity: 0.55; }
.best { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.best-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 5px 0; }
.best-row .meta { color: var(--dim); font-size: 0.8rem; min-width: 120px; }
.best-row .prize { font-size: 0.8rem; font-weight: 600; color: var(--dim); }
.best-row .prize.top { color: var(--green); }
.train { max-width: 900px; margin: 0 auto 18px; }
.train .bar { height: 10px; background: var(--card-2); border: 1px solid var(--border-2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.train .bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width 0.15s linear; }
.train svg { width: 100%; height: 90px; display: block; margin-top: 8px; }
.train .stats { grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
.verdict { max-width: 900px; margin: 22px auto 0; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 22px 26px; }
.verdict h3 { margin-bottom: 10px; }
.verdict p { color: var(--dim); font-size: 0.95rem; margin-bottom: 10px; }
.verdict p.lead { color: var(--text); font-size: 1.05rem; font-weight: 600; }
.verdict p.lead.model { color: var(--green); }
.verdict p.lead.random { color: var(--accent); }
.verdict p.lead.noise { color: var(--gold); }
.verdict p.small { color: var(--muted); font-size: 0.85rem; }

/* Rapporten: tre skjermbilder side om side */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; max-width: 980px; margin: 0 auto; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; border-radius: 22px; border: 1px solid var(--border-2); box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.shots figcaption { color: var(--dim); font-size: 0.88rem; margin-top: 12px; line-height: 1.5; }
.shots figcaption strong { color: var(--text); }
.report { max-width: 900px; margin: 36px auto 0; }
.report h3 { margin: 26px 0 10px; }
.report p { color: var(--dim); margin-bottom: 12px; }
.report table td:first-child { white-space: nowrap; }
.report .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.report .callout { background: var(--card-2); border-left: 4px solid var(--green); border-radius: 8px; padding: 16px 20px; margin: 18px 0; }
.report .callout p { margin: 0; color: var(--text); }

/* ---------- Språkvalg: flagg i menyen ---------- */
.nav-inner { justify-content: flex-start; }
.nav-links { margin: 0 auto; }
.lang { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.nav-links + .lang { margin-left: 0; }
.lang a { display: inline-flex; line-height: 0; text-decoration: none; padding: 5px; border-radius: 8px; opacity: 0.5; border: 1px solid transparent; }
.lang img { width: 26px; height: 18px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,0.18); }
.lang a:hover { opacity: 1; }
.lang a[aria-current="true"] { opacity: 1; border-color: var(--border-2); background: var(--card); }
.lang .sr { position: absolute; left: -9999px; }
@media (max-width: 760px) { .lang { margin-left: auto; } }

/* ---------- App Store-merke ---------- */
/* Apples offisielle merke, uendret. Høyden styres her, bredden følger med,
   fordi den globale img-regelen ellers overstyrer forholdet. */
.appstore-badge { display: inline-block; line-height: 0; text-decoration: none; }
.appstore-badge img { height: 56px; width: auto; max-width: none; display: block; transition: transform 0.15s ease; }
.appstore-badge:hover img { transform: translateY(-2px); }
.appstore-badge-sm img { height: 40px; }
/* Merket i menyen tar plass; på smale skjermer strammes resten inn
   så appnavnet aldri legger seg oppå flaggene. */
.brand { overflow: hidden; }
@media (max-width: 560px) {
  .nav-inner { gap: 8px; }
  .appstore-badge-sm img { height: 32px; }
  .brand { font-size: 0.9rem; gap: 8px; }
  .brand img { width: 26px; height: 26px; }
  .lang a { padding: 3px; }
  .lang img { width: 22px; height: 15px; }
  .nav .wrap { padding: 0 16px; }
}
@media (max-width: 359px) { .brand-name { display: none; } }
.footer-badge { margin-top: 16px; }

/* ---------- Appfelt på iPhone der Safaris smarte appbanner ikke finnes ---------- */
.app-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 16, 32, 0.96);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--border);
}
.app-bar-icon { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.app-bar-text { flex: 1; min-width: 0; line-height: 1.3; }
.app-bar-text strong { display: block; font-size: 0.92rem; }
.app-bar-text span { display: block; font-size: 0.78rem; color: var(--dim); }
.app-bar .appstore-badge img { height: 40px; }
.app-bar-close {
  flex: none; background: none; border: 0; color: var(--dim);
  font-size: 1.4rem; line-height: 1; padding: 4px 2px; cursor: pointer; font-family: inherit;
}
body.has-app-bar { padding-bottom: 88px; }
