  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html, body { margin: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; background: #f4f5f7; color: #222; }
  .app { display: grid; grid-template-columns: 220px 1fr 320px; grid-template-rows: 56px 1fr; height: 100vh; }
  .appbar {
    grid-column: 1 / -1;
    background: white;
    border-bottom: 1px solid #e3e5e8;
    display: flex; align-items: center; padding: 0 20px;
    gap: 16px;
  }
  .appbar .brand {
    font-size: 16px; font-weight: 600; color: #2c3e50;
    letter-spacing: 0.01em;
  }
  .appbar .brand small { font-weight: 400; color: #6c757d; margin-left: 6px; }
  .appbar .logo { height: 42px; width: auto; }
  .appbar .spacer { flex: 1; }
  .appbar .admin-link { font-size: 13px; color: #6c757d; text-decoration: none; }
  .appbar .admin-link:hover { color: #3a86ff; text-decoration: underline; }
  aside { background: white; padding: 20px; overflow-y: auto; border: 1px solid #e3e5e8; border-top: none; border-bottom: none; }
  aside.palette { border-left: none; border-right: 1px solid #e3e5e8; display: flex; flex-direction: column; }
  /* Kontakt-notatet skyves helt ned, under forklaringen. */
  aside.palette .avansert-note { margin-top: auto; }
  aside.sidebar { border-left: 1px solid #e3e5e8; border-right: none; display: flex; flex-direction: column; }
  h2 { margin: 0 0 14px 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #6c757d; }
  h2:not(:first-child) { margin-top: 22px; }
  .palett-gruppe {
    margin: 10px 0 4px; font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em; color: #99a0a7;
  }
  .palett-gruppe:first-child { margin-top: 0; }
  .palette-item {
    padding: 6px 9px;
    white-space: nowrap;
    background: #f7f8fa;
    border: 1px solid #e3e5e8;
    border-radius: 6px;
    margin-bottom: 3px;
    cursor: grab;
    user-select: none; -webkit-user-select: none;
    touch-action: none;
    display: flex; align-items: center; gap: 9px; font-size: 12.5px;
    font-size: 14px;
    transition: background 0.1s, border-color 0.1s;
  }
  .palette-item:hover { background: #eef1f5; border-color: #c7cdd4; }
  .palette-item:active { cursor: grabbing; }
  .palette-item .swatch {
    width: 19px; height: 19px;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: #4a5260;
  }
  .palette-item .swatch svg { width: 100%; height: 100%; }
  .canvas-area {
    position: relative;
    display: flex;
    padding: 24px; overflow: auto; background: #f4f5f7;
  }
  svg#canvas {
    display: block; margin: auto; flex-shrink: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    user-select: none; -webkit-user-select: none;
    touch-action: none;
  }
  .toolbar {
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
    background: white; border: 1px solid #e3e5e8; border-radius: 6px;
    padding: 6px 12px; font-size: 13px; color: #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    z-index: 5; white-space: nowrap;
  }
  .view-controls {
    position: absolute; top: 16px; right: 16px;
    display: flex; gap: 8px;
    z-index: 5;
  }
  .view-controls button {
    width: 40px; height: 40px;
    border-radius: 8px;
    background: white;
    border: 1px solid #e3e5e8;
    cursor: pointer;
    line-height: 1;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: background 0.1s, border-color 0.1s;
    display: flex; align-items: center; justify-content: center;
  }
  .view-controls button:hover { background: #f0f3f7; border-color: #c7cdd4; }
  .view-controls .threed-btn { font-weight: 700; font-size: 13px; letter-spacing: 0.02em; }
  .view-controls .rotate-btn { font-size: 22px; }
  .view-controls button:disabled { opacity: 0.35; cursor: not-allowed; }
  .view-controls .icon-btn { padding: 0; }
  .view-controls .icon-btn svg { width: 22px; height: 22px; }
  .container-card {
    background: #f7f8fa; border: 1px solid #e3e5e8; border-radius: 8px;
    padding: 12px; font-size: 14px; color: #444;
  }
  .container-card { padding: 14px; }
  .container-card .info { font-size: 13px; color: #666; margin-bottom: 12px; line-height: 1.5; }
  /* ----- Egenskapsmeny ved elementet ----- */
  .egenskapsmeny {
    position: fixed; z-index: 120;
    background: #fff; border: 1px solid #cfd5dc; border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    padding: 12px 14px 12px; min-width: 210px; max-width: 300px;
  }
  .egenskapsmeny h2 {
    margin: 0 0 10px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; color: #3a86ff;
  }
  .egenskapsmeny .edit-field:last-of-type { margin-bottom: 4px; }
  .egenskaps-tom { margin: 0 0 4px; font-size: 12px; color: #8a9199; }
  .egenskaps-slett {
    margin-top: 10px; width: 100%;
    padding: 7px 10px; font-size: 12px; font-family: inherit;
    background: #fff; color: #b94343;
    border: 1px solid #e3c5c5; border-radius: 6px; cursor: pointer;
  }
  .egenskaps-slett:hover { background: #fbeaea; }

  /* ----- Søppeldunk: dra et element hit for å slette ----- */
  .soppeldunk {
    position: absolute; right: 16px; bottom: 16px; z-index: 6;
    width: 56px; height: 56px; border-radius: 14px;
    background: #fff; border: 1px solid #e3e5e8; color: #98a0a8;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s;
    pointer-events: none;
  }
  .soppeldunk svg { width: 26px; height: 26px; }
  .soppeldunk.aktiv { border-color: #c7cdd4; color: #6c757d; }
  .soppeldunk.over {
    background: #b94343; border-color: #b94343; color: #fff;
    transform: scale(1.12);
  }
  body.readonly .soppeldunk { display: none; }

  /* ----- Bekreftelsesdialog ----- */
  .bekreft-modal {
    position: fixed; inset: 0; z-index: 130;
    background: rgba(20, 26, 36, 0.55);
    display: flex; align-items: center; justify-content: center; padding: 20px;
  }
  .bekreft-modal[hidden] { display: none; }
  .bekreft-kort-bred { max-width: 470px; }
  .bekreft-kort {
    background: #fff; border-radius: 12px; padding: 24px 26px 20px;
    width: 100%; max-width: 380px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  }
  .bekreft-kort h3 { margin: 0 0 8px; font-size: 17px; color: #222; }
  .bekreft-tekst { margin: 0 0 20px; font-size: 14px; color: #555; line-height: 1.5; }
  .bekreft-knapper { display: flex; gap: 10px; justify-content: flex-end; }
  .knapp-avbryt, .knapp-slett {
    padding: 9px 18px; border-radius: 8px; font-size: 14px; font-family: inherit; cursor: pointer;
  }
  .knapp-avbryt { background: #fff; color: #444; border: 1px solid #d8dde3; }
  .knapp-avbryt:hover { background: #f7f8fa; }
  .knapp-slett { background: #b94343; color: #fff; border: none; font-weight: 500; }
  .knapp-slett:hover { background: #9c3636; }
  /* Samme knapp brukes til vanlige bekreftelser, der rødt ville vært feil signal */
  .knapp-slett.noytral { background: #2c3e50; }
  .knapp-slett.noytral:hover { background: #1a2734; }
  .bekreft-knapper.enkel { justify-content: center; }

  /* ----- Lengdevelger ----- */
  .lengde-merke {
    display: block; font-size: 11px; color: #555; margin: 16px 0 7px;
    text-transform: uppercase; letter-spacing: 0.03em;
  }
  .lengde-merke:first-of-type { margin-top: 4px; }
  .lengde-valg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .lengde-btn {
    padding: 9px 4px; font-size: 13px; font-family: inherit;
    background: #fff; color: #444;
    border: 1px solid #d8dde3; border-radius: 6px; cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
  }
  .lengde-btn:hover { background: #f7f8fa; border-color: #c7cdd4; }
  .lengde-btn.active {
    background: #2c3e50; color: #fff; border-color: #2c3e50; font-weight: 500;
  }

  /* ----- Tips-boble, kun første besøk ----- */
  .tips-boble {
    position: relative; margin-top: 12px;
    background: #2c3e50; color: #fff;
    border-radius: 10px; padding: 11px 13px;
    font-size: 12.5px; line-height: 1.45;
    box-shadow: 0 6px 18px rgba(20,26,36,0.25);
    animation: tipsInn 0.35s ease-out;
  }
  .tips-boble[hidden] { display: none; }
  .tips-boble strong { display: block; margin-bottom: 3px; font-size: 13px; }
  .tips-boble::after {
    content: ''; position: absolute; top: -7px; left: 26px;
    border-left: 8px solid transparent; border-right: 8px solid transparent;
    border-bottom: 8px solid #2c3e50;
  }
  @keyframes tipsInn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
  }

  .container-fakta { margin: 14px 0 0; font-size: 12px; color: #777; line-height: 1.4; }
  .module-controls {
    display: flex; align-items: center; justify-content: space-between;
    background: white; border: 1px solid #e3e5e8; border-radius: 6px;
    padding: 4px 6px;
  }
  .module-controls .count { font-weight: 600; font-size: 16px; color: #222; min-width: 60px; text-align: center; }
  .module-controls .count small { font-weight: 400; color: #777; font-size: 11px; }
  .module-controls button {
    width: 32px; height: 32px; border-radius: 6px;
    background: #f7f8fa; border: 1px solid #e3e5e8;
    cursor: pointer; font-size: 18px; line-height: 1;
    color: #444;
    display: flex; align-items: center; justify-content: center;
  }
  .module-controls button:hover { background: #eaeef3; }
  .module-controls button:disabled { opacity: 0.4; cursor: not-allowed; }
  .container-card .module-controls { margin-bottom: 12px; }
  .container-card .total-dim {
    font-size: 12px; color: #666; text-align: center;
    margin-top: 12px; padding-top: 10px; border-top: 1px solid #e6e8eb;
  }
  .container-card .total-dim:empty { display: none; }
  .element-list {
    list-style: none; padding: 0; margin: 0;
    flex: 1 1 auto; min-height: 90px; overflow-y: auto;
  }
  .element-list li {
    padding: 6px 10px;
    background: #f7f8fa;
    border: 1px solid #e3e5e8;
    border-radius: 5px;
    margin-bottom: 4px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px;
  }
  .element-list li.selected { border-color: #3a86ff; background: #eaf3ff; }
  .element-list .name { display: flex; align-items: center; gap: 6px; }
  .element-list .name .swatch { width: 12px; height: 12px; border-radius: 2px; }
  .element-list button {
    background: transparent; color: #b94343; border: 1px solid transparent;
    border-radius: 4px; padding: 1px 6px; cursor: pointer; font-size: 11px;
  }
  .element-list button:hover { background: #fbeaea; border-color: #e3c5c5; }
  .element-list .empty { color: #888; font-size: 13px; padding: 6px; background: none; border: none; }
  .price-summary {
    margin-top: 16px;
    padding: 14px;
    background: #f7f8fa;
    border: 1px solid #e3e5e8;
    border-radius: 8px;
  }
  .price-row {
    display: flex; justify-content: space-between;
    padding: 4px 0; font-size: 14px;
    color: #4a5260;
  }
  .price-row .count-suffix { color: #888; font-size: 12px; margin-left: 4px; }
  .price-row.total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #d8dde3;
    font-weight: 600;
    font-size: 16px;
    color: #222;
  }
  .continue-btn {
    margin-top: auto;
    width: 100%;
    padding: 12px 16px;
    background: #2c3e50;
    color: white;
    border: none; border-radius: 8px;
    font-size: 15px; font-weight: 500;
    cursor: pointer;
    transition: background 0.1s;
  }
  .continue-btn:hover { background: #1a2734; }
  .reset-btn {
    margin-top: 8px; width: 100%;
    /* Samme høyde som .sekundaer-btn – de står rett over hverandre */
    padding: 9px 10px;
    background: transparent; color: #888;
    border: 1px solid #e3e5e8; border-radius: 8px;
    font-size: 13px; cursor: pointer;
  }
  .reset-btn:hover { background: #f7f8fa; color: #b94343; }
  .hint {
    font-size: 11.5px; color: #666; margin-top: 14px; padding: 8px 10px;
    background: #f7f8fa; border-radius: 6px; line-height: 1.45;
  }
  .hint kbd {
    background: #fff; border: 1px solid #ccc; border-radius: 3px;
    padding: 1px 5px; font-size: 11px; font-family: ui-monospace, monospace;
  }

  /* ----- Egenskaper-panel ----- */
  .edit-panel {
    background: white;
    padding: 14px;
    border: 1px solid #3a86ff;
    border-radius: 8px;
    margin-top: 16px;
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.08);
  }
  .edit-panel h2 { color: #3a86ff; margin: 0 0 12px 0; font-size: 11px; }
  .edit-field { margin-bottom: 10px; }
  .edit-field:last-of-type { margin-bottom: 4px; }
  .edit-field label {
    display: block; font-size: 11px;
    color: #555; margin-bottom: 3px;
    text-transform: uppercase; letter-spacing: 0.03em;
  }
  .edit-field select {
    width: 100%; padding: 6px 8px;
    border: 1px solid #d8dde3; border-radius: 5px;
    font-size: 13px; font-family: inherit;
    background: white; cursor: pointer;
  }
  .edit-field select:focus { outline: none; border-color: #3a86ff; }

  /* Segmenterte knapper for visuelle valg */
  .seg-control {
    display: flex; gap: 4px; flex-wrap: wrap;
  }
  .seg-btn {
    flex: 1; min-width: 38px; min-height: 36px;
    padding: 4px 6px;
    background: white; border: 1px solid #d8dde3;
    border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    font-size: 11px; color: #444;
    transition: background 0.1s, border-color 0.1s;
  }
  .seg-btn:hover { background: #f7f8fa; border-color: #c7cdd4; }
  .seg-btn.active {
    background: #3a86ff; color: white; border-color: #3a86ff;
    box-shadow: 0 0 0 2px rgba(58, 134, 255, 0.18);
  }
  .seg-btn.active .seg-swatch {
    box-shadow: 0 0 0 2px #fff;
  }
  .seg-btn .seg-swatch {
    width: 18px; height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.18);
    flex-shrink: 0;
  }
  .seg-btn .seg-icon {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .seg-btn .seg-icon svg { width: 100%; height: 100%; display: block; }
  .seg-btn .seg-label { white-space: nowrap; }
  .seg-control-varianter { display: grid; gap: 6px; }
  .seg-btn.seg-btn-stack {
    flex-direction: column; gap: 5px;
    padding: 9px 5px; min-height: 100px;
  }
  .seg-btn .seg-icon-tall { width: 48px; height: 56px; }
  .seg-btn .seg-caption { font-size: 11px; line-height: 1.15; text-align: center; white-space: nowrap; }
  .slot-menu-icon {
    width: 17px; height: 20px; flex-shrink: 0;
    display: inline-flex; color: #97a0aa;
  }
  .slot-menu-icon svg { width: 100%; height: 100%; display: block; }


  /* ----- 3D modal ----- */
  .three-modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(20, 26, 36, 0.85);
    z-index: 100;
    padding: 28px;
  }
  .three-modal.open { display: flex; flex-direction: column; }
  .three-modal-inner {
    flex: 1;
    display: flex; flex-direction: column;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
  }
  .three-modal-header {
    padding: 14px 20px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #e3e5e8;
  }
  .three-modal-header h2 {
    margin: 0; font-size: 16px; font-weight: 600;
    text-transform: none; letter-spacing: 0; color: #222;
  }
  .roof-toggle {
    margin-left: auto; margin-right: 16px;
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: #444; cursor: pointer; user-select: none;
  }
  .roof-toggle input { width: 16px; height: 16px; margin: 0; cursor: pointer; }
  .three-canvas-wrap {
    flex: 1;
    /* Himmel – nederste farge matcher tåken i 3D-scenen så bakkeplanet fader ut */
    background: linear-gradient(180deg, #7fa7d6 0%, #b9d0e6 45%, #e6ecf1 100%);
    overflow: hidden;
    position: relative;
  }
  .three-canvas-wrap canvas { display: block; touch-action: none; }
  .three-message {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; text-align: center;
    font-size: 14px; color: #334; line-height: 1.5;
  }
  .three-modal-footer {
    padding: 10px 20px;
    border-top: 1px solid #e3e5e8;
    font-size: 12px; color: #666;
    background: #fafbfc;
    display: flex; justify-content: space-between; align-items: center;
  }
  .three-modal-footer kbd {
    background: #fff; border: 1px solid #ccc; border-radius: 3px;
    padding: 1px 5px; font-size: 11px; font-family: ui-monospace, monospace;
  }
  .close-btn {
    border: none; background: transparent; cursor: pointer;
    font-size: 22px; color: #666;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
  }
  .close-btn:hover { background: #f0f0f0; color: #222; }

  /* ----- Notat om mer avanserte løsninger ----- */
  .avansert-note {
    margin: 14px 0 0; padding: 10px 12px;
    background: #f7f8fa; border: 1px solid #e8eaee; border-radius: 6px;
    font-size: 12px; color: #666; line-height: 1.5;
  }
  .avansert-note a { color: #3a86ff; }

  /* ----- «Få pris»-skjema ----- */
  .send-modal {
    position: fixed; inset: 0; z-index: 120;
    background: rgba(20, 26, 36, 0.6);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; overflow-y: auto;
  }
  .send-modal[hidden] { display: none; }
  .send-kort {
    position: relative;
    background: #fff; border-radius: 12px;
    padding: 26px 28px 22px;
    width: 100%; max-width: 440px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  }
  .send-kort h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; text-transform: none; letter-spacing: 0; color: #222; }
  .send-kort h3 { margin: 0 0 8px; font-size: 17px; color: #222; }
  .send-lukk { position: absolute; top: 12px; right: 12px; }
  .send-oppsummering { margin: 0 0 18px; font-size: 13px; color: #6c757d; }
  .send-kort label { display: block; font-size: 12px; color: #555; margin-bottom: 12px; text-transform: none; letter-spacing: 0; }
  .send-kort .valgfritt { color: #9aa1a9; font-weight: 400; }
  .send-kort input, .send-kort textarea {
    display: block; width: 100%; margin-top: 4px;
    padding: 9px 11px; border: 1px solid #d8dde3; border-radius: 6px;
    font-size: 14px; font-family: inherit; color: #222; background: #fff;
  }
  .send-kort input:focus, .send-kort textarea:focus { outline: none; border-color: #3a86ff; box-shadow: 0 0 0 3px rgba(58,134,255,0.12); }
  .send-kort textarea { resize: vertical; }
  .send-kort .continue-btn { margin-top: 6px; }
  .send-personvern { font-size: 11px; color: #9aa1a9; line-height: 1.5; margin: 10px 0 0; }
  .send-feil { margin: 0 0 12px; padding: 9px 11px; background: #fbeaea; border: 1px solid #e3c5c5; border-radius: 6px; color: #b94343; font-size: 13px; }
  .kvitt-lenke { display: block; font-size: 12px; color: #3a86ff; word-break: break-all; margin-top: 4px; }
  /* Honningkrukke mot bots – skjult for mennesker, men ikke display:none */
  .honning { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

  /* ----- Visningsmodus (/c/<token>) ----- */
  .visning-topp {
    position: absolute; top: 16px; left: 16px; z-index: 5;
    display: flex; gap: 10px; align-items: center;
  }
  .visning-meta:not(:empty), .visning-admin:not([hidden]) {
    background: #fff; border: 1px solid #e3e5e8; border-radius: 6px;
    padding: 6px 12px; font-size: 12px; color: #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  .visning-admin a { color: #3a86ff; text-decoration: none; font-weight: 500; }
  .visning-feil {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 6; background: #fff; border: 1px solid #e3c5c5; border-radius: 8px;
    padding: 16px 20px; color: #b94343; font-size: 14px;
  }

  body.readonly .palette,
  body.readonly .avansert-note,
  body.readonly .edit-panel { display: none; }
  body.readonly .app { grid-template-columns: 1fr 300px; }
  body.readonly svg#canvas { cursor: default; }
  body.readonly .module-controls button,
  body.readonly #undoBtn,
  body.readonly #redoBtn { display: none; }
  body.readonly .module-controls { justify-content: center; border: none; background: none; padding: 0; }

  body.embed .appbar,
  body.embed .sidebar,
  body.embed .palette,
  body.embed .toolbar,
  body.embed .visning-topp { display: none; }
  body.embed .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  body.embed .canvas-area { padding: 8px; }

  /* ----- Smale skjermer / nettbrett i portrett ----- */
  @media (max-width: 900px) {
    .app {
      grid-template-columns: 1fr;
      grid-template-rows: 56px auto minmax(420px, 62vh) auto;
      height: auto; min-height: 100vh;
    }
    .appbar .brand small { display: none; }
    aside { border: none; border-bottom: 1px solid #e3e5e8; overflow: visible; }
    aside.sidebar { border-bottom: none; }
    aside.palette #palette { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
    aside.palette .palette-item { margin-bottom: 0; flex: 0 0 auto; }
    aside.palette .hint { display: none; }
    .canvas-area { min-height: 420px; }
    .three-modal { padding: 8px; }
    body.readonly .app { grid-template-columns: 1fr; }
    .element-list { flex: 0 0 auto; max-height: 220px; }
    .send-kort { padding: 22px 20px 18px; }
    .three-modal-footer span:last-child { display: none; }
  }

  /* Fire containere ved siden av hverandre – egen rad så knappene ikke blir små */
  .antall-valg { grid-template-columns: repeat(4, 1fr); }

  /* ---------- Venteskjerm ---------- */
  .jobber-overlegg {
    position: fixed; inset: 0; z-index: 140;
    background: rgba(20, 26, 36, 0.55);
    display: flex; align-items: center; justify-content: center; padding: 20px;
  }
  .jobber-overlegg[hidden] { display: none; }
  .jobber-kort {
    background: #fff; border-radius: 12px; padding: 30px 34px 26px;
    text-align: center; min-width: 260px; max-width: 340px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  }
  .jobber-snurr {
    width: 34px; height: 34px; margin: 0 auto 16px;
    border: 3px solid #e3e5e8; border-top-color: #2c3e50; border-radius: 50%;
    animation: snurr 0.85s linear infinite;
  }
  @keyframes snurr { to { transform: rotate(360deg); } }
  .jobber-tittel { margin: 0; font-size: 16px; font-weight: 600; color: #222; }
  .jobber-tekst { margin: 7px 0 0; font-size: 13px; line-height: 1.5; color: #6c757d; }
  .jobber-tekst:empty { display: none; }
  /* Uten animasjon: en rolig puls i stedet for rotasjon */
  @media (prefers-reduced-motion: reduce) {
    .jobber-snurr { animation: puls 1.4s ease-in-out infinite; }
    @keyframes puls { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
  }

  /* ---------- Lagring ---------- */
  .lagre-rad { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
  .sekundaer-btn {
    padding: 9px 10px; border: 1px solid #c9cfd5; border-radius: 8px; background: #fff;
    color: #2c3138; font-size: 13px; font-weight: 500; cursor: pointer;
  }
  .sekundaer-btn:hover:not(:disabled) { background: #f2f4f6; border-color: #aeb6be; }
  .sekundaer-btn:disabled { opacity: .55; cursor: default; }
  .lagre-forklaring { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: #4a5158; }
  .lagre-kopiert { margin: 8px 0 0; font-size: 13px; color: #2f7d4f; }
  #lagreModal .lagre-rad { margin-top: 14px; }
  .pdf-dato { display: none; margin: 10px 0 0; font-size: 12px; color: #78808a; }

  /* ---------- Utskriftsmodus (/t/<token>?pdf=1) ----------
     Serveren rendrer denne siden til PDF. Målene står i mm slik at det som
     vises i nettleseren er nøyaktig det som havner på arket. */
  @page { size: A4 landscape; margin: 10mm; }
  body.pdf { background: #fff; }
  body.pdf .app {
    width: 277mm; height: 190mm;
    grid-template-columns: 1fr 72mm;
    grid-template-rows: 14mm 1fr;
  }
  body.pdf .palette,
  body.pdf .view-controls,
  body.pdf .admin-link,
  body.pdf .soppeldunk,
  body.pdf .tips-boble,
  body.pdf .lengde-valg,
  body.pdf .lengde-merke,
  body.pdf .continue-btn,
  body.pdf .reset-btn,
  body.pdf .lagre-rad,
  body.pdf .visning-topp,
  body.pdf .egenskapsmeny { display: none !important; }
  body.pdf .pdf-dato { display: block; }
  /* Elementlista hører hjemme i appen, ikke på arket */
  body.pdf .element-list,
  body.pdf .elementer-tittel { display: none !important; }
  body.pdf .app { grid-template-columns: 1fr 64mm; }
  body.pdf .canvas-area { padding: 4mm; }
  body.pdf .toolbar { justify-content: center; border: none; background: none; font-weight: 600; }
  body.pdf .element-list { max-height: none; overflow: visible; }

  /* ---------- Side 2 i PDF: fire 3D-vinkler ---------- */
  .pdf-bilder { display: none; }
  body.pdf .pdf-bilder {
    display: block;
    break-before: page; page-break-before: always;
    width: 277mm; height: 190mm; margin: 0 auto;
    font-family: inherit;
  }
  .pdf-bilder h2 {
    margin: 0 0 3mm; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; color: #6c757d;
  }
  .pdf-bilder-rutenett {
    display: grid;
    /* minmax(0,1fr) – uten den blir radhøyden bildets egen pikselhøyde,
       og de to nederste rutene skyves over på et tredje ark */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 4mm; height: 176mm;
  }
  .pdf-bilder figure { margin: 0; display: flex; flex-direction: column; min-height: 0; }
  .pdf-bilder img {
    width: 100%; flex: 1 1 auto; min-height: 0; object-fit: cover;
    border: 1px solid #e3e5e8; border-radius: 2mm;
  }
  .pdf-bilder figcaption {
    margin-top: 1.5mm; font-size: 10px; color: #78808a; text-align: center;
  }
