:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #4a5568;
  --line: #e4e1d8;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-dark: #9a3412;
  --soft: #f1ede4;
  --focus: #1d4ed8;
  --radius: 14px;
  --max: 1080px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; color: #fff; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 720px) { .container { padding: 0 1.5rem; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .94);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -.01em; }
.logo svg { width: 28px; height: 28px; }
.nav { display: none; gap: 1.5rem; align-items: center; }
.nav a { text-decoration: none; font-weight: 500; }
@media (min-width: 820px) { .nav { display: flex; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.4rem; border-radius: 999px;
  font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid transparent; cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-dark); color: var(--accent-ink); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn-small { min-height: 40px; padding: .5rem 1rem; font-size: .95rem; }

/* Sections */
section { padding: 4rem 0; }
@media (min-width: 720px) { section { padding: 5.5rem 0; } }
.section-alt { background: var(--soft); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 1rem; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: 1.2rem; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 40rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent-dark); margin: 0 0 .75rem; }

/* Hero */
.hero { padding-top: 3.5rem; }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 1rem; }
.offer-note { display: inline-block; background: #fff3ee; border: 1px solid #f6c9b8; color: var(--accent-dark); font-weight: 600; padding: .4rem .8rem; border-radius: 8px; font-size: .95rem; }

/* Mock draft card */
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px -24px rgba(20, 33, 61, .35); padding: 1.25rem; font-size: .95rem; }
.mock-row { display: flex; gap: .5rem; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: .5rem; margin-bottom: .75rem; }
.mock-q { background: var(--soft); border-radius: 10px; padding: .75rem; margin-bottom: .75rem; }
.mock-a { border: 2px dashed #f6c9b8; border-radius: 10px; padding: .75rem; }
.mock-tag { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--accent-dark); margin-bottom: .25rem; }
.mock-actions { display: flex; gap: .5rem; margin-top: .75rem; }
.mock-actions span { font-size: .8rem; padding: .3rem .7rem; border-radius: 999px; background: var(--ink); color: #fff; }
.mock-actions span.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

/* Lists and cards */
.pain-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
@media (min-width: 820px) { .pain-list { grid-template-columns: repeat(3, 1fr); } }
.pain-list li, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.cards { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 820px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card p { margin: 0; color: var(--muted); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; margin-bottom: .75rem; }
.steps p { margin: 0; color: var(--muted); }

/* Pricing table */
.table-wrap { overflow-x: auto; margin-top: 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
caption { text-align: left; padding: 1rem 1.25rem 0; color: var(--muted); font-size: .95rem; }
th, td { text-align: left; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
td.price { font-weight: 800; white-space: nowrap; }
.offer-box { margin-top: 1.5rem; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 1.5rem; }
.offer-box p { margin: 0; }
.offer-box strong { color: #ffd2c2; }

/* About */
.about-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 820px) { .about-grid { grid-template-columns: 220px 1fr; } }
.avatar { width: 200px; height: 200px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; font-size: 3rem; font-weight: 800; color: var(--accent-dark); }

/* FAQ */
.faq { margin-top: 2rem; display: grid; gap: .75rem; max-width: 46rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 1.25rem; }
.faq summary { cursor: pointer; font-weight: 700; padding: 1.1rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--accent-dark); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 1.1rem; color: var(--muted); }

/* Contact */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: .9fr 1.1fr; } }
.contact-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: 1rem; }
label { font-weight: 600; display: block; margin-bottom: .35rem; }
.req { color: var(--accent-dark); }
input, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid #b9b4a6; border-radius: 10px; padding: .75rem .85rem; min-height: 48px;
}
textarea { min-height: 130px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--focus); }
.hint { font-size: .9rem; color: var(--muted); margin: .35rem 0 0; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; }
.checkbox input { width: 22px; height: 22px; min-height: 0; margin-top: .2rem; flex: none; }
.checkbox label { font-weight: 400; margin: 0; }
.hidden { position: absolute !important; left: -9999px !important; }

/* Footer */
.site-footer { background: var(--ink); color: #dfe4ee; padding: 3rem 0 2rem; font-size: .95rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.linklike { background: none; border: 0; padding: 0; color: #fff; text-decoration: underline; font: inherit; cursor: pointer; }

/* Legal pages */
.legal { padding: 3rem 0 4rem; }
.legal .container { max-width: 760px; }
.legal h2 { font-size: 1.4rem; margin-top: 2.25rem; }
.legal p, .legal li { color: #2d3748; }
.updated { color: var(--muted); font-size: .95rem; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 4rem 0; }

/* Cookie banner */
.consent {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 200;
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 50px -20px rgba(20, 33, 61, .45); padding: 1.25rem;
}
.consent[hidden] { display: none; }
.consent h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.consent p { margin: 0 0 1rem; font-size: .95rem; color: var(--muted); }
.consent-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Mobile CTA bar */
.mobile-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); background: rgba(251,250,247,.96); border-top: 1px solid var(--line); }
.mobile-cta .btn { width: 100%; }
@media (min-width: 820px) { .mobile-cta { display: none; } }
@media (max-width: 819px) { body.has-mobile-cta { padding-bottom: 76px; } }

/* AI-markering i exempelrutan */
.mock-ai-head { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muted); margin: 0 0 .6rem; }
.mock-ai-head strong { color: var(--ink); }
.mock-ai-icon { display: inline-grid; place-items: center; flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: linear-gradient(135deg, #14213d, #c2410c); color: #fff; font-size: .95rem; }
.mock-sources { margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

/* Tidskalkylator */
.calc { display: grid; gap: 1.25rem; margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
@media (min-width: 820px) { .calc { grid-template-columns: 1fr 1fr; padding: 1.75rem; } }
.calc-inputs { display: grid; gap: 1.1rem; }
.calc-inputs label { display: block; font-weight: 600; margin-bottom: .35rem; }
.calc-inputs input[type=range] { width: 100%; height: 1.5rem; margin: 0; padding: 0; border: 0; box-shadow: none; background: linear-gradient(to right, var(--accent) 0 var(--pct), var(--line) var(--pct) 100%) center / 100% 6px no-repeat; border-radius: 999px; -webkit-appearance: none; appearance: none; cursor: pointer; --pct: 50%; }
.calc-inputs input[type=range]::-webkit-slider-runnable-track { height: 6px; background: transparent; }
.calc-inputs input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(20,33,61,.35); }
.calc-inputs input[type=range]::-moz-range-track { height: 6px; background: transparent; }
.calc-inputs input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(20,33,61,.35); }
.calc-inputs input[type=range]:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.calc-inputs input[type=number] { width: 9rem; font: inherit; padding: .55rem .7rem; border: 1px solid #8a8577; border-radius: 8px; background: #fff; color: var(--ink); }
.calc-result { display: grid; gap: .9rem; background: var(--soft); border-radius: 10px; padding: 1rem 1.1rem; }
.calc-num { display: block; font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; line-height: 1.1; color: var(--ink); }
.calc-label { display: block; color: var(--muted); font-size: .95rem; }

/* AI-chattbot */
.chat-launcher { position: fixed; right: 1rem; bottom: 1rem; z-index: 45; font: inherit; font-weight: 700; color: #fff; background: var(--ink); border: 0; border-radius: 999px; padding: .8rem 1.15rem; box-shadow: 0 10px 30px -10px rgba(20,33,61,.6); cursor: pointer; }
.chat-launcher:hover { background: #0b1427; }
@media (max-width: 819px) { .chat-launcher { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.chat-panel { position: fixed; z-index: 50; right: 1rem; bottom: 4.6rem; width: min(380px, calc(100vw - 2rem)); height: min(560px, calc(100vh - 6rem)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 60px -20px rgba(20,33,61,.5); overflow: hidden; }
.chat-panel[hidden] { display: none; }
@media (max-width: 819px) { .chat-panel { left: .5rem; right: .5rem; width: auto; top: .5rem; bottom: .5rem; height: auto; } }
.chat-head { display: flex; align-items: flex-start; gap: .75rem; padding: .9rem 1rem; background: var(--ink); color: #fff; }
.chat-head h2 { font-size: 1.05rem; margin: 0; color: #fff; }
.chat-head p { margin: .15rem 0 0; font-size: .8rem; color: #d7dbe6; }
.chat-close { margin-left: auto; flex: none; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; font-size: 1.2rem; cursor: pointer; }
.chat-close:hover { background: rgba(255,255,255,.25); }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--bg); }
.chat-msg { max-width: 88%; padding: .6rem .8rem; border-radius: 12px; line-height: 1.45; font-size: .95rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.chat-typing { color: var(--muted); font-style: italic; }
.chat-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .75rem; background: var(--bg); }
.chat-chips[hidden] { display: none; }
.chat-chips button { font: inherit; font-size: .85rem; padding: .4rem .7rem; border-radius: 999px; border: 1px solid var(--accent-dark); background: #fff; color: var(--accent-dark); cursor: pointer; }
.chat-chips button:hover { background: #fff3ee; }
.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form input { flex: 1; min-width: 0; font: inherit; padding: .6rem .7rem; border: 1px solid #8a8577; border-radius: 8px; color: var(--ink); background: #fff; }
.chat-form button { font: inherit; font-weight: 700; padding: .6rem .9rem; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
.chat-form button:hover { background: var(--accent-dark); }
.chat-form button:disabled, .chat-form input:disabled { opacity: .6; cursor: default; }
td.price-intro { color: var(--accent-dark); white-space: normal; min-width: 9rem; }

.calc-teaser { margin-top: .75rem; font-weight: 600; }
.calc-teaser a { color: var(--accent-dark); }
.section-calc { border-top: 1px solid rgba(20,33,61,.08); }
