/* Mockup universell: ett vindu, Kartverkets aapne kart, progresiv visning. Ingen eksterne fonter. */
:root {
  --ink: #1a2330;
  --muted: #5c6570;
  --line: #e2ddd4;
  --bg: #ece8e1;
  --card: #fff;
  --brand: #1e4d4a;
  --brand-dark: #163836;
  --brand-soft: #e6efee;
  --accent: #b85c38;
  --sand: #f3e6d4;
  --vipps: #ff5b24;
  --vipps-dark: #e04a18;
  --err: #9b1c1c;
  --radius: 12px;
  --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --header: 64px;
  --banner: 32px;
  --foot: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  font: 16px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100%;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }

.skip {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip:focus {
  width: auto; height: auto; margin: 0; clip: auto;
  left: 8px; top: 8px; z-index: 50; background: #fff; padding: 8px 12px; border-radius: 8px;
}

.mock-banner {
  background: #3b2a14;
  color: #f8efe4;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  line-height: 1.35;
}

.top { background: var(--top-bg, var(--brand)); color: var(--top-ink, #f4f1eb); }
.top-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { flex: 0 0 auto; line-height: 0; }
.logo svg { display: block; }
.name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag, .logo-note { margin: 0; font-size: 12px; color: var(--top-ink, #c9d6d4); opacity: 0.85; }
.logo-note { color: #e8c4a8; font-style: italic; }
.top-phone { margin: 0; text-align: right; flex: 0 0 auto; }
.top-phone a { color: var(--top-ink, #fff); font-weight: 700; text-decoration: none; display: block; white-space: nowrap; }
.top-phone span { display: block; font-size: 11px; color: #c9d6d4; }

.workspace {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.intro, .byggvalg { min-width: 0; }

.col-form, .prisdock {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(26,35,48,0.06);
  min-width: 0;
}
.col-form { padding: 16px 16px 18px; }
.col-form h1 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 4.6vw, 1.7rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.lead { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.hint.center { text-align: center; }

label, legend {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}
fieldset.choices { border: 0; margin: 14px 0 0; padding: 0; }
.choice-kicker {
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.choice-kicker:first-of-type { margin-top: 0; }

input[type="text"], input[type="tel"], input[type="email"] {
  width: 100%;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfc8bc;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  min-height: 46px;
}
input:focus, button:focus-visible, .choice:focus-within {
  outline: 3px solid #8bb8b4;
  outline-offset: 2px;
}

.search { position: relative; }
.search-row { position: relative; }
.search-spin {
  position: absolute;
  right: 12px; top: 50%;
  width: 16px; height: 16px;
  margin-top: -8px;
  border: 2px solid #c9d2d0;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .search-spin { animation: none; } }

.forslag {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  position: absolute;
  left: 0; right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(26,35,48,0.12);
  max-height: 240px;
  overflow: auto;
}
.forslag li {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  overflow-wrap: anywhere;
}
.forslag li small { display: block; color: var(--muted); font-size: 12px; }
.forslag li:hover, .forslag li.on { background: var(--brand-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  max-width: 100%;
  overflow-wrap: anywhere;
  min-height: 40px;
}
.chip:hover, .chip.on { border-color: var(--brand); background: var(--brand-soft); }

.bygg { margin-top: 16px; }
.bygg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.bygg-head h2 { margin: 0; font-size: 1rem; }
.bygg-adr { margin: 0 0 8px; font-weight: 650; overflow-wrap: anywhere; }
.badge-ex {
  display: inline-block;
  padding: 4px 8px;
  background: var(--sand);
  color: #6a3e16;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.facts {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.facts > div { background: var(--bg); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.facts dt { font-size: 11px; color: var(--muted); font-weight: 600; margin: 0 0 2px; }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: break-word; }

.choice-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.choice-grid.two { grid-template-columns: 1fr 1fr; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 9px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-width: 0;
  font-weight: 500;
  cursor: pointer;
}
.choice input { margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--brand); }
.choice span { min-width: 0; display: block; }
.choice strong { display: block; font-size: 14px; }
.choice em { display: block; font-style: normal; font-size: 12px; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

.map-wrap {
  position: relative;
  height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #d7d2c8;
  min-width: 0;
}
#kart { height: 100%; width: 100%; background: #d7d2c8; }
.map-empty {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  margin: 0;
  background: rgba(255,255,255,0.92);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
  z-index: 5;
}
.map-empty.off { display: none; }
.pin {
  width: 22px; height: 22px;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.prisdock { padding: 14px 16px 16px; }
.pris-top { text-align: left; }
.price-badge {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
}
.price {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 6vw, 1.85rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.price-sub, .action-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.action-note strong { color: var(--ink); }
.action-note.fee { color: var(--ink); background: #fff6f1; border: 1px solid #ffd4c4; border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.action-note.request { color: var(--ink); background: var(--brand-soft); border: 1px solid #c5d6d4; border-radius: 10px; padding: 10px 12px; margin-top: 10px; }

.fields { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0 10px; }
.field { min-width: 0; }
.err { color: var(--err); font-size: 13px; font-weight: 600; margin: 0 0 8px; }

.btn-primary, .btn-ghost, .btn-vipps {
  appearance: none; border: 0; border-radius: 10px;
  min-height: 46px; padding: 11px 16px; font-weight: 700;
  width: 100%; max-width: 100%;
}
.btn-primary { background: var(--brand); color: var(--btn-ink, #fff); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled, .btn-vipps:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--brand-dark); border: 1px solid #c9d2d0; }
.btn-vipps { background: var(--vipps); color: #fff; margin-top: 4px; }
.btn-vipps:hover { background: var(--vipps-dark); }

.modal {
  position: fixed; inset: 0; z-index: 40;
  display: grid; align-items: end;
}
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(26,35,48,0.45); }
.sheet {
  position: relative;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 22px 16px 28px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.12);
}
.vipps-mark { margin: 0 0 8px; font-weight: 800; color: var(--vipps); }
.sheet h2 { margin: 0 0 8px; font-size: 1.15rem; }
.sheet-pris { margin: 0 0 8px; font-family: var(--serif); font-size: 1.8rem; font-weight: 700; }
.sheet-note { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.sheet .btn-ghost { margin-top: 8px; }

.foot {
  max-width: 1440px;
  margin: 0 auto;
  padding: 4px 16px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.foot p { margin: 0 0 6px; overflow-wrap: anywhere; }
.made-with, .levert-av, .levert-av a { color: #8a9198; text-underline-offset: 2px; }
.levert-av { margin: 8px 0 0; font-size: 11px; }
.levert-av a { color: #8a9198; text-decoration: none; }
.levert-av a:hover { text-decoration: underline; color: #5c6570; }
html.kompakt .levert-av { font-size: 10.5px; margin-top: 6px; }

.leaflet-container { font: inherit; background: #d7d2c8; }
.leaflet-control-attribution {
  font-size: 11px !important;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: rgba(255,255,255,0.88) !important;
}

@media (min-width: 560px) {
  .choice-grid { grid-template-columns: 1fr 1fr 1fr; }
  .choice-grid.two { grid-template-columns: 1fr 1fr; }
  .fields { grid-template-columns: 1fr 1fr; }
  .field.wide { grid-column: 1 / -1; }
}

/* Mobil: kartet rett under adressen, ingen sideskift */
@media (max-width: 959px) {
  .col-form, .col-map { display: contents; }
  .intro { order: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(26,35,48,0.06); padding: 16px; }
  .map-wrap { order: 2; }
  .byggvalg { order: 3; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(26,35,48,0.06); padding: 16px; }
  .prisdock { order: 4; }
  .col-form { background: none; border: 0; box-shadow: none; padding: 0; }
}

/* Desktop: to kolonner, ett vindu, kartet fyller høyre side, pris over kartet */
@media (min-width: 960px) {
  html, body { height: 100%; }
  body { overflow: hidden; display: flex; flex-direction: column; }
  .mock-banner, .top, .foot { flex: 0 0 auto; }
  .workspace {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "form stage";
    gap: 12px 16px;
    padding: 12px 20px 8px;
  }
  .col-form {
    grid-area: form;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .col-map {
    grid-area: stage;
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
  }
  .map-wrap {
    flex: 1;
    height: auto;
    min-height: 0;
    width: 100%;
  }
  .prisdock {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 1100;
    padding: 12px 16px 12px;
    max-height: 48%;
    overflow: auto;
    box-shadow: 0 10px 28px rgba(26,35,48,0.18);
  }
  .prisdock .fields { margin: 8px 0 8px; grid-template-columns: 1fr 1fr 1fr; }
  .prisdock .field.wide { grid-column: auto; }
  .prisdock .action-note { font-size: 12.5px; }
  .pris-top { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; }
  .pris-top .price-badge { grid-column: 1; margin: 0; }
  .pris-top .price { grid-column: 2; font-size: 1.7rem; }
  .pris-top .price-sub { grid-column: 1 / -1; margin-top: 2px; }
  .modal { align-items: center; padding: 24px; }
  .sheet { border-radius: 16px; }
  .foot {
    padding-top: 6px;
    padding-bottom: 8px;
    background: var(--bg);
    position: relative;
    z-index: 2;
  }
}


@media (max-width: 419px) {
  .name { font-size: 1.05rem; }
  .logo svg { width: 36px; height: 36px; }
  .choice-grid.two { grid-template-columns: 1fr; }
}

/* ---- Universell v3: tjenestevelger, progresjon, visning A/B ---- */
.mock-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
}
.visning-bryter {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.visning-bryter button {
  appearance: none;
  border: 1px solid rgba(248,239,228,0.45);
  background: transparent;
  color: #f8efe4;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  min-height: 28px;
}
.visning-bryter button[aria-pressed="true"] {
  background: #f8efe4;
  color: #3b2a14;
  border-color: #f8efe4;
}

.tjenester {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(26,35,48,0.06);
  padding: 10px 12px 12px;
  min-width: 0;
}
.tjenester-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tjeneste-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tjeneste-tab {
  appearance: none;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  min-height: 56px;
}
.tjeneste-tab svg { display: block; color: var(--brand); }
.tjeneste-tab span { overflow-wrap: anywhere; text-align: center; }
.tjeneste-tab:hover { border-color: var(--brand); background: var(--brand-soft); }
.tjeneste-tab.on, .tjeneste-tab[aria-selected="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.felt-steg { margin-top: 12px; min-width: 0; }
.felt-steg.ny { animation: stegInn 0.35s ease; }
@keyframes stegInn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.felt-hint { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.choice-grid.tre { grid-template-columns: 1fr; }

.diff {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-dark);
}
.diff.plus { color: #8a4b20; }
.diff.minus { color: #1e4d4a; }
body[data-visning="b"] .diff { display: none !important; }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.stepper input[type="number"] {
  width: 96px;
  flex: 0 0 auto;
  text-align: center;
  -moz-appearance: textfield;
}
.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button { appearance: none; margin: 0; }
.step-btn {
  appearance: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  flex: 0 0 auto;
}
.step-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.stepper .enhet { font-size: 14px; color: var(--muted); font-weight: 650; }

.presisjon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.pres-prikker { display: inline-flex; gap: 3px; }
.pres-prikker i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #d7d2c8;
  display: block;
}
.pres-prikker i.on { background: var(--accent); }

.poster {
  list-style: none;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.poster li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  min-width: 0;
}
.poster li span { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.poster li strong { flex: 0 0 auto; font-weight: 700; }

.price.pris-oppdater { animation: prisPuls 0.45s ease; }
@keyframes prisPuls {
  0% { transform: scale(1); opacity: 0.55; }
  40% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .felt-steg.ny, .price.pris-oppdater { animation: none; }
}

@media (min-width: 560px) {
  .choice-grid.tre { grid-template-columns: 1fr 1fr 1fr; }
  .tjeneste-tab { flex: 1 1 0; min-width: 0; }
}

@media (max-width: 959px) {
  .tjenester { order: 0; }
  .intro { order: 1; }
  .map-wrap { order: 2; }
  .byggvalg { order: 3; }
  .prisdock { order: 4; }
}

@media (min-width: 960px) {
  .workspace {
    grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "tjenester tjenester" "form stage";
  }
  .tjenester { grid-area: tjenester; }
  .tjeneste-tab { flex-direction: row; gap: 6px; min-height: 44px; padding: 8px 10px; }
  .pris-top { grid-template-columns: auto 1fr auto; }
  .pris-top .presisjon { grid-column: 3; grid-row: 1; margin: 0; justify-self: end; }
  .pris-top .price { grid-column: 1 / -1; }
  .pris-top .price-sub { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
  .col-form { padding: 12px 14px 14px; }
  .lead { margin: 0 0 10px; font-size: 13.5px; }
  .bygg { margin-top: 10px; }
  .hint { margin: 4px 0 0; font-size: 12px; }
  .facts > div { padding: 6px 8px; }
  .choice { padding: 8px 9px; }
  .intro h1, .col-form h1 { font-size: 1.45rem; }
}

/* Fem tjenester på én rad, også på 375 px */
@media (max-width: 959px) {
  .tjeneste-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 3px;
    font-size: 11px;
  }
  .tjeneste-tab svg { width: 20px; height: 20px; }
}

/* Kilder og manuell takflate (preview) */
.badge-ex.ekte {
  background: #e7f3ee;
  color: #145c45;
  border: 1px solid #b7d8c9;
}
.badge-ex.blandet {
  background: #f4efe3;
  color: #5c4a1c;
  border: 1px solid #e0d3ad;
}
.badge-ex.venter { opacity: 0.8; }
.kilde {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #5c6570;
}
.kilde.ekte { color: #145c45; }
.manuell {
  margin: 10px 0 8px;
  padding: 10px 12px;
  border: 1px dashed #c9c3b6;
  border-radius: 10px;
  background: #fbfaf6;
}
.manuell label {
  display: block;
  font-weight: 650;
  margin-bottom: 6px;
}
.manuell input {
  width: 8rem;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid #c9c3b6;
  border-radius: 8px;
  font: inherit;
}
.bygg-poly {
  stroke: #c45a1a;
  stroke-width: 3;
  fill: #c45a1a;
  fill-opacity: 0.28;
}

/* ----- Kompakt innbyggbar widget (html.kompakt / ?kompakt=1 / /widget) ----- */
.banner-kort { display: none; }
html.kompakt .banner-full { display: none; }
html.kompakt .banner-kort { display: inline; }

html.kompakt,
html.kompakt body {
  height: auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  display: block !important;
  max-width: 100%;
}
html.kompakt body {
  background: #f3f1ec;
  font-size: 14.5px;
  line-height: 1.4;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  box-shadow: 0 0 0 1px rgba(26,35,48,0.04);
}
html.kompakt .skip { display: none; }
html.kompakt .mock-banner {
  font-size: 11px;
  padding: 5px 8px;
  text-align: left;
}
html.kompakt .visning-bryter {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  font-weight: 600;
}
html.kompakt .visning-bryter button { font-size: 11px; padding: 3px 7px; }
html.kompakt .top-inner { padding: 8px 10px; gap: 8px; }
html.kompakt .logo svg { width: 32px; height: 32px; }
html.kompakt .name { font-size: 0.98rem; }
html.kompakt .tag { font-size: 11px; }
html.kompakt .logo-note { display: none; }
html.kompakt .top-phone span { display: none; }
html.kompakt .top-phone a { font-size: 13px; }

html.kompakt .tjenester { margin: 0; padding: 0 2px; }
html.kompakt .tjenester-kicker { font-size: 10px; margin: 0 0 4px; letter-spacing: 0.04em; }
html.kompakt .tjeneste-liste { gap: 4px; }
html.kompakt .tjeneste-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  padding: 5px 2px;
  font-size: 11px;
  flex-direction: column;
  gap: 1px;
}
html.kompakt .tjeneste-tab svg { width: 18px; height: 18px; }

/* Alltid én smal kolonne, også på bred skjerm / i iframe på desktop. */
html.kompakt .workspace {
  display: flex !important;
  flex-direction: column !important;
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
  padding: 8px !important;
  gap: 8px !important;
  overflow: visible !important;
  min-height: 0 !important;
  grid-template-columns: none !important;
  grid-template-areas: none !important;
}
html.kompakt .col-form,
html.kompakt .col-map {
  display: contents !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
html.kompakt .intro,
html.kompakt .byggvalg,
html.kompakt .prisdock {
  order: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(26,35,48,0.06);
  padding: 10px 12px;
}
html.kompakt .intro { order: 1; }
html.kompakt .map-wrap { order: 2; }
html.kompakt .byggvalg { order: 3; }
html.kompakt .prisdock { order: 4; }

html.kompakt .col-form { background: none; border: 0; box-shadow: none; padding: 0; }
html.kompakt .col-form h1 { font-size: 1.15rem; margin-bottom: 4px; }
html.kompakt .lead {
  font-size: 12.5px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
html.kompakt .hint { font-size: 11px; }
html.kompakt .chips { gap: 4px; margin-top: 6px; }
html.kompakt .chip { font-size: 11px; padding: 4px 8px; }

html.kompakt .map-wrap {
  position: relative;
  height: 140px !important;
  min-height: 140px !important;
  max-height: 160px;
  flex: none !important;
  width: 100%;
  border-radius: 10px;
}
html.kompakt .map-wrap.lukket {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px;
}
html.kompakt .map-wrap.lukket #kart,
html.kompakt .map-wrap.lukket .map-empty { display: none; }
html.kompakt .kart-toggle {
  display: inline-flex;
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 8;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  padding: 3px 8px;
  box-shadow: 0 1px 4px rgba(26,35,48,0.15);
}
html.kompakt .map-wrap.lukket .kart-toggle {
  position: static;
  margin: 6px 8px;
  box-shadow: none;
  background: transparent;
}
html.kompakt .map-empty { font-size: 11px; left: 8px; right: 8px; bottom: 8px; padding: 5px 7px; }

html.kompakt .bygg { margin: 0 0 8px; }
html.kompakt .bygg-head h2 { font-size: 13px; }
html.kompakt .bygg-adr { font-size: 12.5px; margin-bottom: 6px; }
html.kompakt .facts { gap: 6px; }
html.kompakt .facts > div { padding: 6px 8px; }
html.kompakt .badge-ex { font-size: 10px; }

html.kompakt .prisdock {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  max-height: none !important;
  overflow: visible !important;
  box-shadow: 0 4px 12px rgba(26,35,48,0.06) !important;
  padding: 10px 12px !important;
}
html.kompakt .pris-top {
  display: block;
}
html.kompakt .pris-top .price { font-size: 1.35rem; margin: 2px 0 4px; }
html.kompakt .pris-top .price-sub { font-size: 11.5px; }
html.kompakt .poster { font-size: 12px; }
html.kompakt .action-note { font-size: 12px; }
html.kompakt .prisdock .fields { grid-template-columns: 1fr; margin: 8px 0; }
html.kompakt .choice { padding: 7px 8px; }
html.kompakt .choice strong { font-size: 13px; }
html.kompakt .choice em { font-size: 11px; }
html.kompakt .diff { font-size: 11px; }

html.kompakt .foot {
  position: static !important;
  max-width: 580px;
  margin: 0 auto;
  padding: 6px 10px 10px !important;
  font-size: 10.5px;
  background: transparent !important;
}
html.kompakt .foot p { margin: 0 0 4px; }

html.kompakt .modal { padding: 12px; }
html.kompakt .sheet { width: 100%; max-width: 520px; }

@media (max-width: 419px) {
  html.kompakt .workspace { padding: 6px !important; }
  html.kompakt .tjeneste-tab { font-size: 10px; padding: 4px 1px; }
}


/* Én kalkulator per bransje, og kart bare på tak. */
body.en-tjeneste .tjenester {
  display: none !important;
}
body.uten-kart #map-wrap {
  display: none !important;
}
body.uten-kart .col-map {
  position: relative;
}
body.kompakt.uten-kart .col-map {
  padding-top: 0;
}

html.kompakt .logo { width: 36px; height: 36px; flex: none; overflow: hidden; border-radius: 8px; }
html.kompakt .logo img { display: block; width: 36px; height: 36px; object-fit: contain; background: #fff; }
html.kompakt .logo svg { width: 36px; height: 36px; }
html.kompakt .choice-grid.two,
html.kompakt .choice-grid.tre {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 419px) {
  html.kompakt .choice-grid.two,
  html.kompakt .choice-grid.tre {
    grid-template-columns: 1fr;
  }
}


/* Innlimt: ingen firmabanner, prisen festes nederst. */
html.innramme .mock-banner,
html.innramme .top,
body.innramme .mock-banner,
body.innramme .top {
  display: none !important;
}
html.innramme .foot {
  padding-bottom: 8px;
}
.pris-feste {
  display: none;
}
/* Festet prislinje bare på mobil, slik at den aldri dekker innhold på PC. */
@media (max-width: 700px) {
  html.kompakt .pris-feste,
  html.innramme .pris-feste {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 580px;
    z-index: 40;
    background: var(--card, #fff);
    border-top: 1px solid var(--line, #ddd7cc);
    box-shadow: 0 -8px 24px rgba(26,35,48,0.12);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    font-weight: 650;
  }
  html.kompakt .pris-feste span,
  html.innramme .pris-feste span { font-size: 13px; color: var(--muted, #5c6570); }
  html.kompakt .pris-feste strong,
  html.innramme .pris-feste strong { font-size: 1.35rem; letter-spacing: -0.02em; font-weight: 800; }
  html.kompakt body,
  html.innramme body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}
html.kompakt .price { font-size: 1.7rem; }
html.kompakt .price-badge { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }

.areal-valg { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.areal-valg button {
  border: 1px solid var(--line, #c9c3b8); background: #fff; border-radius: 999px;
  padding: 5px 10px; font: 650 12px/1.2 inherit; cursor: pointer;
}
.areal-valg button.on { background: var(--brand, #163836); color: #fff; border-color: transparent; }
.areal-lm { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.areal-lm .areal-felt { display: flex; align-items: center; gap: 6px; }
.areal-lm input { width: 100%; }
.areal-sum { margin: 6px 0 0; font-size: 13px; font-weight: 650; }
#kjoring-hint { margin: 8px 0 0; }

.felt-steg.areal-lm-modus .stepper { display: none; }

.areal-hint,
.maal-forbehold {
  font-size: 12px;
  line-height: 1.35;
  color: #6b7280;
  margin: 8px 0 0;
  font-weight: 400;
}
.maal-forbehold { color: #6b7280; }

.vedlegg { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line, #e4dfd6); }
.vedlegg-tittel { margin: 0 0 4px; font-size: 14px; font-weight: 650; }
.vedlegg-hint { margin: 0 0 10px; font-size: 12px; line-height: 1.35; color: #6b7280; font-weight: 400; }
.vedlegg-knapp {
  border: 1px dashed #b9b3a8; background: #faf9f6; border-radius: 10px;
  padding: 8px 12px; font: 650 13px/1.2 inherit; cursor: pointer; color: #2a2f35;
}
.vedlegg-knapp:hover { background: #f3f0ea; }
.vedlegg-liste { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vedlegg-mini { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: #eee; }
.vedlegg-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vedlegg-mini button {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0;
  border-radius: 50%; background: rgba(20,20,20,0.72); color: #fff; font-size: 13px;
  line-height: 20px; cursor: pointer; padding: 0;
}
.kommentar-aapne { margin: 14px 0 0; }
.lenke-knapp {
  border: 0; background: none; padding: 0; font: 500 13px/1.3 inherit;
  color: #5c6570; cursor: pointer; text-decoration: none;
}
.lenke-knapp:hover { color: #163836; text-decoration: underline; }
.kommentar-felt { margin-top: 8px; }
.kommentar-felt label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 4px; }
.kommentar-felt textarea {
  width: 100%; min-height: 72px; resize: vertical; border: 1px solid var(--line, #c9c3b8);
  border-radius: 8px; padding: 8px 10px; font: inherit; box-sizing: border-box;
}


.areal-tri {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr);
  gap: 4px 6px;
  align-items: end;
  margin-top: 2px;
  width: 100%;
}
.areal-boks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0;
  width: auto;
}
.areal-tri-formel {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  font-size: 11px;
  line-height: 1.3;
  color: #5c6570;
  font-weight: 650;
}
.areal-boks .areal-lab { font-size: 11px; line-height: 1.2; color: #5c6570; font-weight: 650; }
.areal-rad { display: flex; align-items: center; gap: 3px; min-width: 0; }
.areal-rad input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 8px 6px;
  font-size: 15px;
  box-sizing: border-box;
}
.areal-tegn { font-weight: 800; color: #5c6570; padding-bottom: 8px; line-height: 1; }
@media (max-width: 400px) {
  .areal-tri { gap: 2px 4px; }
  .areal-rad input { padding: 8px 4px; font-size: 14px; }
  .areal-rad .enhet { font-size: 11px; }
  .areal-boks .areal-lab { font-size: 10px; }
}

.search.kompakt-sok { margin-bottom: 8px; }
.search.kompakt-sok label { margin-bottom: 4px; }
.search.kompakt-sok .search-row input { min-height: 40px; padding: 8px 10px; }
.chips { display: none !important; }
#kjoring-hint { display: none !important; }
.areal-presis-linje { margin: 8px 0 0; }
.slik-regner {
  margin: 10px 0 0;
  border-top: 1px solid var(--line, #e4dfd6);
  padding-top: 8px;
}
.slik-regner summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  color: #3d4a46;
  list-style: none;
}
.slik-regner summary::-webkit-details-marker { display: none; }
.slik-regner summary::before { content: "▸ "; color: #6b7280; }
.slik-regner[open] summary::before { content: "▾ "; }
.slik-regner .poster { margin: 8px 0 0; padding: 0; }
html.kompakt .intro .lead { font-size: 14px; margin-bottom: 10px; }

.mer-presis-wrap { margin: 14px 0 4px; }
.btn-mer-presis {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font: 700 15px/1.2 inherit;
  cursor: pointer;
  background: var(--merke, var(--brand, #1e4d4a));
  color: var(--btn-ink, #fff);
}
.btn-mer-presis:hover { filter: brightness(0.95); }
@keyframes mer-presis-puls {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--merke, var(--brand, #1e4d4a)) 35%, transparent); }
  50% { transform: scale(1.015); box-shadow: 0 0 0 8px transparent; }
}
.btn-mer-presis.puls { animation: mer-presis-puls 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .btn-mer-presis.puls { animation: none; }
}

.reserve-boks { max-width: 580px; margin: 16px auto 24px; padding: 16px 16px 12px; background: #fff; border: 1px solid #d7dddb; border-radius: 12px; color: #16212b; }
.reserve-boks h2 { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.25; }
.reserve-boks .lead { margin: 0 0 14px; font-size: 15px; line-height: 1.45; }
.reserve-boks .pk-tel { margin: 12px 0 0; font-size: 14px; }
.reserve-boks .pk-tel a, .reserve-boks #reserve-mailto { color: #2c5f5d; }
html.kompakt .reserve-boks { margin: 8px 0 12px; }
