/* Romtegner – kjølig blågrå med turkis aksent (samme familie som CNC-tegner) */
:root {
  --bg:#f1f5f9;--card:#fff;--ink:#0f172a;--muted:#475569;--line:#cbd5e1;--brand:#0f766e;--brand-d:#115e59;--brand-on:#fff;
  --aksent:#2dd4bf;--aksent-myk:#ccfbf1;--ok:#1b7f3b;--warn:#b26a00;--err:#c0261d;--blue:#1d6fd8;
  --top:#0f172a;--top-tekst:#fff;--top-dim:#94a3b8;--felt:#fff;--btn:#fff;--btn-hover:#e2e8f0;--pane:#f8fafc;--toolbar:#f8fafc;
  --sel:#ccfbf1;--canvas-bg:#e2e8f0;--fokus:#0ea5e9;
  --msg-err-bg:#fde8e6;--msg-err-kant:#f3b3ae;--msg-err:#7c150f;--msg-warn-bg:#fff3dc;--msg-warn-kant:#f0cf8a;--msg-warn:#6d4300;--msg-ok-bg:#e4f5e8;--msg-ok-kant:#a9d9b5;--msg-ok:#14572a;
  --banner-bg:#fff4d6;--banner-kant:#f0b429;--toast-bg:#0f172a;--skygge:0 10px 30px rgba(15,23,42,.18);
  --sikker-b:env(safe-area-inset-bottom,0px);--sikker-t:env(safe-area-inset-top,0px);--sikker-v:env(safe-area-inset-left,0px);--sikker-h:env(safe-area-inset-right,0px);
  color-scheme: light;
}
.tema-mork {
  --bg:#0f172a;--card:#1e293b;--ink:#e2e8f0;--muted:#94a3b8;--line:#334155;--brand:#2dd4bf;--brand-d:#14b8a6;--brand-on:#0f172a;
  --aksent-myk:#134e4a;--ok:#4ade80;--warn:#fbbf24;--err:#f87171;--blue:#60a5fa;
  --top:#020617;--top-tekst:#e2e8f0;--felt:#111827;--btn:#1e293b;--btn-hover:#334155;--pane:#111827;--toolbar:#0b1222;
  --sel:#134e4a;--canvas-bg:#0f172a;--fokus:#38bdf8;
  --msg-err-bg:#3a1614;--msg-err-kant:#7f2a24;--msg-err:#fca5a5;--msg-warn-bg:#3a2e10;--msg-warn-kant:#8a6a14;--msg-warn:#fde68a;--msg-ok-bg:#14301c;--msg-ok-kant:#2a6a3a;--msg-ok:#86efac;
  --banner-bg:#3a3008;--banner-kant:#d4a017;--toast-bg:#020617;--skygge:0 10px 30px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
svg { display: block; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* topplinje */
.top { flex: none; display: flex; align-items: center; gap: 10px; background: var(--top); color: var(--top-tekst);
  padding: calc(6px + var(--sikker-t)) calc(10px + var(--sikker-h)) 6px calc(10px + var(--sikker-v)); min-height: 56px; }
.merke { display: flex; align-items: center; gap: 8px; flex: none; }
.merke img { border-radius: 7px; }
.brand { font-weight: 750; font-size: 18px; letter-spacing: -.02em; }
.prosjekt { min-width: 0; max-width: 260px; flex: 0 1 auto; background: #ffffff14; border: 1px solid #ffffff1f; color: var(--top-tekst);
  border-radius: 9px; height: 40px; padding: 0 12px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prosjekt::after { content: " ▾"; color: var(--top-dim); }
.etasjer { display: flex; gap: 4px; background: #ffffff10; border-radius: 10px; padding: 3px; flex: none; }
.etasjer button { min-width: 40px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--top-tekst); font-weight: 700; padding: 0 8px; }
.etasjer button.on { background: var(--aksent); color: #0f172a; }
.etasjer button[data-e="+"] { color: var(--top-dim); font-size: 20px; font-weight: 500; }
.seg { display: inline-flex; background: var(--btn-hover); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 8px; min-height: 36px; padding: 0 12px; font-weight: 650; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.18); }
.seg.mork { background: #ffffff10; flex: none; }
.seg.mork button { color: var(--top-dim); min-width: 46px; }
.seg.mork button.on { background: var(--aksent); color: #0f172a; }
.seg.liten button { flex: 1; }
.seg.liten { display: flex; margin: 6px 0 10px; }
.top-hoyre { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.ikonknapp { width: 44px; height: 44px; border: 0; background: transparent; color: var(--top-tekst); border-radius: 10px; display: grid; place-items: center; }
.ikonknapp svg { width: 22px; height: 22px; }
.ikonknapp:hover:not(:disabled) { background: #ffffff14; }
.toppknapp { height: 40px; border-radius: 10px; border: 0; background: var(--aksent); color: #0f172a; font-weight: 700; padding: 0 14px; }

/* hovedområde */
.hoved { flex: 1; min-height: 0; display: flex; position: relative; }
.verktoy { flex: none; width: 76px; background: var(--toolbar); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; overflow-y: auto; }
.verktoy button { border: 0; background: transparent; border-radius: 12px; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.verktoy button svg { width: 24px; height: 24px; }
.verktoy button:hover { background: var(--btn-hover); }
.verktoy button.on { background: var(--sel); color: var(--brand); }
.verktoy .fra-bilde { margin-top: auto; color: var(--brand); border: 1.5px dashed var(--brand); }
.lerret { flex: 1; min-width: 0; position: relative; background: var(--canvas-bg); overflow: hidden; touch-action: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.vis3d { position: absolute; inset: 0; display: none; touch-action: none; }
.vis3d canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
body.i3d .vis3d { display: block; }
body.i3d #cv, body.i3d .verktoy, body.i3d .kun2d, body.i3d .hint-boble, body.i3d .panel { display: none; }
.v3kontroller { display: none; position: absolute; top: 12px; left: 12px; right: 12px; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.v3kontroller .seg { pointer-events: auto; background: color-mix(in srgb, var(--card) 85%, transparent); box-shadow: var(--skygge); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
body.i3d .v3kontroller { display: flex; }
.v3status { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-weight: 600; color: var(--muted); }
.v3status:empty { display: none; }
.joystick { position: absolute; left: calc(24px + var(--sikker-v)); bottom: calc(24px + var(--sikker-b)); width: 128px; height: 128px; border-radius: 50%;
  background: color-mix(in srgb, var(--card) 70%, transparent); border: 2px solid var(--line); box-shadow: var(--skygge); touch-action: none; }
.joystick[hidden] { display: none; }
.joystick .knott { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: var(--aksent); box-shadow: 0 2px 8px rgba(0,0,0,.3); pointer-events: none; }
.zoomknapper { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.zoomknapper button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 22px; font-weight: 600; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.zoomknapper svg { width: 22px; height: 22px; }
.hint-boble { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); max-width: calc(100% - 24px); background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--muted); box-shadow: 0 2px 10px rgba(15,23,42,.1); pointer-events: none; text-align: center; }
.hint-boble:empty { display: none; }

/* panel */
.panel { flex: none; width: 330px; background: var(--pane); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-hode { flex: none; padding: 14px 16px 6px; display: flex; align-items: center; gap: 8px; }
.panel-hode h2 { font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.grep { display: none; }
.panel-innhold { flex: 1; overflow-y: auto; padding: 4px 16px calc(20px + var(--sikker-b)); -webkit-overflow-scrolling: touch; }
.panel-innhold h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 8px; font-weight: 700; }
.panel-innhold h3:first-child { margin-top: 6px; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0; }
.etikett { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 10px 0 4px; }
.felt-rad { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.felt-rad > input, .felt-rad > select, .tall input { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--felt); color: var(--ink); padding: 0 12px; font-size: 16px; font-weight: 500; width: 100%; }
.felt-rad > input[type=color] { padding: 4px; width: 80px; }
.tall { display: flex; align-items: center; position: relative; }
.tall input { padding-right: 42px; font-variant-numeric: tabular-nums; }
.tall em { position: absolute; right: 12px; font-style: normal; color: var(--muted); font-size: 14px; pointer-events: none; }
.knapperad .tall { width: 110px; }
.tre { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tre .felt-rad { margin: 4px 0; }
.btn { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--btn); color: var(--ink); padding: 0 14px; font-weight: 650; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover:not(:disabled) { background: var(--btn-hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.btn.primary:hover:not(:disabled) { background: var(--brand-d); }
.btn.fare { color: var(--err); }
.btn.liten { min-height: 36px; font-size: 14px; padding: 0 10px; }
.btn.bred { width: 100%; margin: 6px 0; }
label.btn { cursor: pointer; }
.knapperad { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }
.knapperad.stor .btn { flex: 1; min-height: 50px; font-size: 16px; }
.bryter { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; }
.bryter input { width: 20px; height: 20px; accent-color: var(--brand); }
.arealer { display: flex; flex-direction: column; gap: 2px; }
.areal-rad { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; background: transparent; border-radius: 9px; text-align: left; font-size: 15px; }
button.areal-rad:hover { background: var(--btn-hover); }
.areal-rad i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(15,23,42,.25); flex: none; }
.areal-rad span { flex: 1; }
.areal-rad b { font-variant-numeric: tabular-nums; }
.areal-rad.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; color: var(--muted); }
.areal-rad.total b { color: var(--ink); }
.stor-tall { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.melding { border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; border: 1px solid; }
.melding.ok { background: var(--msg-ok-bg); border-color: var(--msg-ok-kant); color: var(--msg-ok); }
.melding.feil { background: var(--msg-err-bg); border-color: var(--msg-err-kant); color: var(--msg-err); }
.melding.varsel { background: var(--msg-warn-bg); border-color: var(--msg-warn-kant); color: var(--msg-warn); }
.melding .btn { margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chip { border: 1px solid var(--line); background: var(--btn); border-radius: 999px; min-height: 34px; padding: 0 12px; font-size: 14px; }
.farger { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; }
.farger input[type=color] { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--felt); }
.fargeknapp { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); }
.fargeknapp.on { outline: 3px solid var(--brand); outline-offset: 2px; }
.bibliotek { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mobelkort { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 6px; min-height: 96px; color: var(--muted); touch-action: none; -webkit-user-select: none; user-select: none; }
.mobelkort:hover { border-color: var(--brand); }
.mobelkort span { display: flex; flex-direction: column; align-items: center; color: var(--ink); text-align: center; }
.mobelkort b { font-size: 14px; font-weight: 650; }
.mobelkort small { font-size: 12px; color: var(--muted); }
.spokelse { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -50%); background: var(--card); border: 2px solid var(--brand); border-radius: 12px; padding: 6px; color: var(--ink); box-shadow: var(--skygge); }
.mobelbilde { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin: 6px 0; font-size: 13px; color: var(--muted); }
.mobelbilde img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: none; }
.ute-valg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0 10px; }
.ute-knapp { display: flex; align-items: center; gap: 8px; min-height: 44px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 10px; font-weight: 600; font-size: 14px; }
.ute-knapp i { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(15,23,42,.25); }
.ute-knapp.on { border-color: var(--brand); background: var(--sel); }

/* statuslinje */
.statuslinje { flex: none; display: flex; gap: 18px; align-items: center; height: 30px; padding: 0 14px; font-size: 13px; color: var(--muted); background: var(--toolbar); border-top: 1px solid var(--line); }
.statuslinje .lagret { margin-left: auto; }

/* banner og toast */
.banner { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); top: calc(64px + var(--sikker-t)); background: var(--banner-bg); border: 1.5px solid var(--banner-kant); color: var(--msg-warn);
  border-radius: 12px; padding: 12px 18px; font-weight: 700; box-shadow: var(--skygge); max-width: calc(100% - 24px); }
.banner[hidden] { display: none; }
.toast { position: fixed; z-index: 95; left: 50%; bottom: calc(46px + var(--sikker-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s; background: var(--toast-bg); color: #fff;
  padding: 11px 16px; border-radius: 12px; font-size: 15px; max-width: min(520px, calc(100% - 24px)); box-shadow: var(--skygge); text-align: center; }
.toast.vis { opacity: 1; transform: translate(-50%, 0); }
.toast.feil { background: #7c150f; }

/* modal */
.modal-bak { position: fixed; inset: 0; z-index: 80; background: rgba(2,6,23,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--card); color: var(--ink); border-radius: 18px; width: min(460px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; box-shadow: var(--skygge); }
.modal.bred { width: min(720px, 100%); }
.modal-hode { display: flex; align-items: center; padding: 16px 18px 8px; gap: 8px; }
.modal-hode h2 { font-size: 20px; font-weight: 750; flex: 1; }
.lukk { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--btn-hover); font-size: 16px; }
.modal-kropp { padding: 4px 18px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-kropp p { margin: 6px 0; }
.modal-kropp h3 { font-size: 15px; margin: 18px 0 8px; }
.modal-kropp h4 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); }
.modal-fot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 18px 18px; }
.modal-fot .btn { min-width: 100px; }
.eksport-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.eks { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 14px; min-height: 76px; }
.eks:hover { border-color: var(--brand); }
.eks b { font-size: 16px; }
.eks small { color: var(--muted); font-size: 13px; }
.dxfvalg summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.prosjektliste { display: flex; flex-direction: column; gap: 6px; }
.prosjekt-liste-tom { color: var(--muted); }
.prosjektliste .prosjekt { display: flex; align-items: center; gap: 8px; max-width: none; height: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px 4px 4px; color: var(--ink); }
.prosjektliste .prosjekt::after { content: none; }
.prosjektliste .prosjekt.aktiv { border-color: var(--brand); }
.prosjektliste .apne, .prosjektliste .apne-nett { flex: 1; text-align: left; border: 0; background: transparent; padding: 8px; display: flex; flex-direction: column; min-width: 0; }
.prosjektliste small { color: var(--muted); font-size: 13px; font-weight: 400; }
.merke { font-size: 12px; }
.prosjekt .merke { color: var(--brand); font-weight: 700; padding: 0 8px; }
.pinform { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.pinform .btn { margin-bottom: 8px; }
.lagre-nett { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.lagre-nett .btn { margin-bottom: 8px; }
.versjoner { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.versjon { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.menyliste { display: flex; flex-direction: column; gap: 6px; }
.menyliste button { text-align: left; min-height: 52px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 0 14px; font-size: 16px; font-weight: 600; }
.temavalg.stor { display: flex; gap: 6px; }
.temavalg.stor button { flex: 1; min-height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-weight: 650; }
.temavalg button.valgt { border-color: var(--brand); background: var(--sel); color: var(--brand); }
.hjelp { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

/* fra bilde */
.fotomodal .modal-kropp { padding-bottom: 22px; }
.bildefaner { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; }
.bildefaner button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; min-height: 40px; padding: 0 12px; font-weight: 650; display: flex; gap: 6px; align-items: center; }
.bildefaner button small { background: var(--btn-hover); border-radius: 6px; padding: 0 6px; font-size: 12px; }
.bildefaner button.on { border-color: var(--brand); background: var(--sel); }
.merkeverktoy { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.merkeverktoy button { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 650; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; padding: 0 8px; }
.merkeverktoy button.on { border-color: var(--ink); background: var(--card); box-shadow: 0 0 0 1px var(--ink); }
.prikk { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.prikk.teal { background: #2dd4bf; } .prikk.oransje { background: #f59e0b; } .prikk.bla { background: #60a5fa; }
.skalarad { display: flex; gap: 8px; margin: 6px 0; }
.skalarad select { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--felt); padding: 0 10px; flex: 1; font-size: 16px; }
.skalarad .tall { width: 120px; }
.merkeflate { border-radius: 12px; overflow: hidden; background: #0f172a; touch-action: none; }
.merkeflate canvas { display: block; touch-action: none; }
.estimat { font-weight: 700; color: var(--brand); min-height: 1.4em; }
.laster { display: flex; flex-direction: column; align-items: center; padding: 40px 0; gap: 8px; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--aksent); animation: snurr 0.9s linear infinite; }
@keyframes snurr { to { transform: rotate(360deg); } }
.forslag-plan { background: var(--bg); border-radius: 12px; padding: 8px; margin: 10px 0; }
.forslag-plan svg { width: 100%; height: auto; max-height: 340px; }
.kilder { padding-left: 18px; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.mobelforhand { margin: 10px 0; text-align: center; }
.mobelforhand img { max-width: 100%; max-height: 260px; border-radius: 12px; }
.mobelresultat { display: flex; gap: 12px; align-items: flex-start; background: var(--bg); border-radius: 12px; padding: 10px; }
.mobelresultat img { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; flex: none; }
.fargeprikk { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; border: 1px solid rgba(15,23,42,.3); }
.typevalg { display: flex; flex-wrap: wrap; gap: 6px; }
.typevalg button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; min-height: 38px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.typevalg button.on { border-color: var(--brand); background: var(--sel); color: var(--brand); }

/* utskrift */
.utskrift { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { overflow: visible; height: auto; background: #fff; color: #000; }
  #app, .banner, .toast, .modal-bak { display: none !important; }
  .utskrift { display: block; }
  .ark header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #000; padding-bottom: 4mm; margin-bottom: 4mm; }
  .ark h1 { font-size: 16pt; }
  .ark-plan svg { width: 100%; height: auto; max-height: 150mm; }
  .ark footer { display: flex; gap: 12mm; margin-top: 4mm; font-size: 10pt; }
  .ark table { border-collapse: collapse; } .ark td { padding: 1mm 4mm 1mm 0; } .ark .sum td { border-top: 1px solid #000; font-weight: bold; }
}

/* iPad stående og mindre */
@media (max-width: 1024px) { .panel { width: 300px; } }
/* telefon */
@media (max-width: 760px) {
  .merke, .prosjekt, .skjul-smal, .kun2d { display: none; }
  .top { gap: 5px; padding-left: calc(6px + var(--sikker-v)); padding-right: calc(2px + var(--sikker-h)); }
  .etasjer { padding: 2px; gap: 2px; }
  .etasjer button { min-width: 36px; padding: 0 5px; height: 38px; }
  .seg.mork { padding: 2px; }
  .seg.mork button { min-width: 40px; padding: 0 6px; }
  .top-hoyre { gap: 0; }
  .ikonknapp { width: 40px; }
  .hoved { flex-direction: column; }
  .verktoy { order: 3; width: auto; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + var(--sikker-b)); overflow-x: auto; overflow-y: hidden; gap: 2px; }
  .verktoy button { min-width: 58px; min-height: 54px; font-size: 11px; flex: 1 0 auto; }
  .verktoy .fra-bilde { margin-top: 0; }
  .panel { position: absolute; left: 0; right: 0; bottom: calc(63px + var(--sikker-b)); width: auto; z-index: 20; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 24px rgba(15,23,42,.18); max-height: 54px; transition: max-height .22s ease; overflow: hidden; }
  .panel.apen { max-height: 62%; }
  .panel-hode { cursor: pointer; padding: 6px 16px 10px; flex-direction: column; align-items: stretch; gap: 4px; }
  .grep { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
  .panel-hode h2 { font-size: 16px; }
  .panel-innhold { padding-bottom: 20px; }
  .statuslinje { display: none; }
  .zoomknapper { bottom: 66px; }
  .zoomknapper button { width: 44px; height: 44px; }
  body.i3d .zoomknapper { bottom: 12px; }
  .hint-boble { top: 8px; font-size: 12px; }
  .toast { bottom: calc(130px + var(--sikker-b)); }
  .modal-bak { align-items: flex-end; padding: 0; }
  .modal, .modal.bred { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: var(--sikker-b); }
  .eksport-grid { grid-template-columns: 1fr; }
  .pinform { grid-template-columns: 1fr; }
  .v3kontroller .seg button { padding: 0 9px; font-size: 13px; }
}
