:root {
  --ink: #111418;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --soft: #f3f4f6;
  --stage: #f7f7f8;
  --paper: #ffffff;
  --lime: #dfff4f;
  --lime-line: #b7d23c;
  --danger: #c0392b;
  --ok: #2e9e5b;
  --warn: #b35c00;
  --radius: 14px;
  --radius-sm: 10px;
  --menu-h: 64px;
  font-family: Poppins, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .4; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8fb000; outline-offset: 2px; }
h2 { font-size: 18px; margin: 4px 0 12px; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-3); font-size: 14px; }
.center { text-align: center; }
.label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 8px; }
.error { color: var(--danger); font-size: 14px; margin: 10px 0 0; }
.warn { color: var(--warn); background: #fff4e5; border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; }
.progress-text { font-size: 14px; color: var(--ink-2); margin: 10px 0 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.link-btn { text-decoration: underline; font-size: 14px; min-height: 44px; }

/* Knapper */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; text-decoration: none; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--lime); border: 1px solid var(--lime-line); }
.btn-primary:hover:not(:disabled) { background: #d6f83f; }
.btn-primary:disabled { background: var(--soft); border-color: var(--line-2); }
.btn-outline { background: var(--paper); border: 1px solid var(--line-2); }
.btn-dark { background: #111827; color: #fff; }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; font-size: 15px; padding: 0 22px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); }
.icon-btn:hover:not(:disabled) { background: var(--soft); }
.sheet-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 44px; height: 44px; z-index: 2; }

/* Start */
.start { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; overflow: auto; background: var(--stage); }
.start-logo { height: 28px; }
.start h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.02em; text-align: center; }
.start-choices { display: grid; gap: 14px; grid-template-columns: 1fr; width: min(100%, 720px); }
.start-card { display: grid; justify-items: start; gap: 8px; text-align: left; padding: 22px; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius); }
.start-card:hover { border-color: var(--ink); }
.start-card.is-primary { background: var(--lime); border-color: var(--ink); }
.start-card strong { font-size: 20px; color: var(--ink); }
.start-card span { color: var(--ink-2); font-size: 14px; }
.start-card.is-primary span { color: var(--ink); }
.start-card svg { width: 28px; height: 28px; }
.start-continue { display: flex; align-items: center; gap: 16px; width: min(100%, 720px); padding: 14px 22px 14px 14px; border-color: var(--ink); }
.start-continue-text { display: grid; gap: 6px; min-width: 0; }
.start-continue .start-thumb { flex: none; height: 104px; width: auto; }
.start-shop { color: var(--ink-2); font-size: 14px; padding: 12px; }
.loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); font-size: 15px; color: var(--ink-2); padding: 24px; text-align: center; z-index: 5; }

/* App-skelet */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; height: 100dvh; }
.top { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); min-height: 60px; flex: none; }
.logo img { height: 22px; display: block; }
.top-back { display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink); }
.top-actions { margin-left: auto; flex: none; display: flex; align-items: center; gap: 4px; }
.save-state { font-size: 12px; color: var(--ink-3); margin-right: 8px; white-space: nowrap; }
.color-row { flex: none; width: 100%; padding-top: 6px; border-bottom: 1px solid var(--line); background: var(--paper); }
.color-label { margin: 0; text-align: center; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.top-colors { display: flex; gap: 2px; overflow-x: auto; width: 100%; padding: 0 12px; scrollbar-width: none; }
/* Auto-margener centrerer farverne, men lader dem stadig kunne rulle, når der er mange */
.top-colors > :first-child { margin-left: auto; }
.top-colors > :last-child { margin-right: auto; }
.top-colors::-webkit-scrollbar { display: none; }
.top-colors .swatch-btn { flex: none; display: grid; place-items: center; width: 36px; height: 44px; }
.dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(17,20,24,.25); flex: none; }
.swatch-btn.is-active .dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111418; }
.work { flex: 1; min-height: 0; display: flex; position: relative; }
.stage-wrap { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--stage); }
.stage { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
.mock { mix-blend-mode: multiply; position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; pointer-events: none; will-change: transform, opacity; max-width: none; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; outline: none; }
.side-label { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; letter-spacing: .1em; pointer-events: none; }
.side-arrow { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.85); }
.side-arrow.left { left: 6px; }
.side-arrow.right { right: 6px; }
.stage-empty { position: absolute; transform: translate(-50%, -50%); display: grid; gap: 4px; text-align: center; font-size: 14px; line-height: 1.35; pointer-events: none; }
.stage-empty strong { color: inherit; }
.price-chip { position: absolute; right: 12px; bottom: 12px; background: var(--paper); padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.08); pointer-events: none; }
.quickbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 2px; background: var(--paper); border-radius: var(--radius); padding: 4px; box-shadow: 0 4px 18px rgba(0,0,0,.16); }
.quickbar button { display: grid; justify-items: center; gap: 2px; min-width: 60px; min-height: 48px; padding: 4px; font-size: 11px; font-weight: 600; }
.quickbar .danger { color: var(--danger); }
.side-thumbs { position: absolute; right: 12px; top: 12px; display: none; gap: 8px; flex-direction: column; background: var(--paper); padding: 8px; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.side-thumb { display: grid; gap: 4px; padding: 4px; border: 1px solid transparent; border-radius: var(--radius-sm); justify-items: center; }
.side-thumb.is-active { border-color: #8fb000; box-shadow: inset 0 0 0 1px var(--lime); }
.side-thumb small { font-size: 10px; letter-spacing: .04em; }
.thumb-box { position: relative; display: block; width: 100%; }
.side-thumb .thumb-box { width: 60px; }
.thumb-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.thumb-box canvas { position: absolute; }

/* Paneler */
.panel, .props { position: relative; background: var(--paper); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.tool-icons { display: flex; flex-direction: column; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 46px; border: 1.5px solid var(--ink); border-radius: var(--radius-sm); }
.search svg { color: var(--ink-3); }
.search input { flex: 1; border: 0; outline: 0; background: none; min-width: 0; font-size: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 0 14px; min-height: 40px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; background: var(--paper); white-space: nowrap; }
.chip.is-active { background: var(--lime); border-color: var(--lime); font-weight: 700; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.grid-size { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--ink-3); padding-bottom: 12px; }
.segmented { display: inline-flex; background: var(--soft); padding: 3px; border-radius: var(--radius-sm); }
.segmented button { display: grid; place-items: center; min-width: 44px; min-height: 40px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.segmented button.is-active { background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.icon-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); grid-auto-rows: max-content; gap: 8px; }
.icon-grid > p { grid-column: 1 / -1; }
.icon-card { position: relative; aspect-ratio: 1 / 1; width: 100%; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.icon-card:hover { border-color: var(--ink); }
.icon-card img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; }
.ideas-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.idea-card { display: grid; gap: 4px; justify-items: center; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.idea-card:hover { border-color: var(--ink); }
.idea-card canvas { width: 100%; aspect-ratio: 1; display: block; }
.color-list { display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.color-list .swatch-btn { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: var(--radius-sm); text-align: left; font-size: 14px; }
.color-list .swatch-btn.is-active { background: var(--soft); font-weight: 600; }
.upload-actions { display: grid; gap: 8px; }
/* Selve filfeltet ligger usynligt over knappen, så trykket rammer det direkte. Via en label svigter det af og til på iPhone. */
.upload-actions .btn { position: relative; }
.upload-actions .btn:has(.file-cover:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.file-cover { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop { margin-top: 10px; padding: 26px 12px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); color: var(--ink-3); font-size: 14px; }
.drop.is-over { border-color: var(--ink); background: var(--soft); }

.variant-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.variant-card { display: grid; gap: 4px; padding: 4px 4px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; text-align: center; background: var(--paper); }
.variant-card:hover { border-color: var(--ink); }
.variant-card.is-active { border: 2px solid #111418; padding: 3px 3px 5px; font-weight: 700; }
.variant-img { display: block; aspect-ratio: 4 / 5; background: var(--stage); border-radius: 6px; overflow: hidden; }
.variant-img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

/* Egenskaber */
.peek { display: none; }
.view-switch-top { display: none; }
.view-row { flex: none; display: flex; justify-content: center; padding: 8px 12px 0; }
.view-switch { min-height: 40px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); font-size: 13px; font-weight: 600; white-space: nowrap; }
@media (hover: hover) { .view-switch:hover { border-color: var(--ink); } }
.prop { margin-bottom: 16px; }
.prop .label:first-child { margin-top: 0; }
.prop-head { display: flex; justify-content: space-between; align-items: baseline; }
.prop-head output { font-size: 13px; color: var(--ink-3); }
.prop.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prop.two .btn { padding: 0 6px; font-size: 13px; }
textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 16px; resize: vertical; }
input[type="range"] { width: 100%; height: 32px; accent-color: #111418; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(17,20,24,.25); }
.swatches button.is-fav { position: relative; }
.swatches button.is-fav::after { content: "★"; position: absolute; right: -4px; top: -6px; font-size: 13px; line-height: 1; color: #111418; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.fav-toggle { display: block; min-height: 40px; font-size: 13px; }
#propsBody[data-group] .prop-single { display: none; }
.copy-here { pointer-events: auto; justify-self: center; margin-top: 8px; min-height: 44px; padding: 0 16px; background: var(--paper); color: var(--ink); border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; font-weight: 600; }
.swatches button.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111418; }
.custom-color { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; min-height: 44px; cursor: pointer; }
.custom-color input { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; }
.font-select { position: relative; }
.font-btn { width: 100%; min-height: 46px; padding: 0 12px; text-align: left; font-size: 18px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.font-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,.14); z-index: 5; }
.font-list button { display: block; width: 100%; min-height: 46px; padding: 0 12px; text-align: left; font-size: 18px; }
.font-list button:hover { background: var(--soft); }
.text-style { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.text-style svg { width: 18px; height: 18px; }

/* Bundbjælke og menu */
.bar { display: none; }
.menu { display: none; flex: none; border-top: 1px solid var(--line); background: var(--paper); padding-bottom: env(safe-area-inset-bottom); }
.menu button { flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: var(--menu-h); font-size: 12px; font-weight: 500; }
.menu button.is-primary { font-weight: 700; }
.menu button.is-primary svg { background: var(--lime); border-radius: 8px; padding: 4px; width: 30px; height: 30px; }
body.one-color .needs-colors { display: none !important; }

/* Overlays */
.overlay { position: fixed; inset: 0; background: var(--paper); z-index: 20; overflow: hidden; }
.picker-inner { display: flex; flex-direction: column; height: 100%; padding: 12px 16px 0; overflow-y: auto; }
.picker-head { display: flex; justify-content: space-between; align-items: center; }
.picker-head h2 { margin: 0; }
.picker-head small { color: var(--ink-3); font-weight: 400; font-size: 14px; margin-left: 6px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; flex: none; scrollbar-width: none; }
.filters select { flex: none; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); font-size: 13px; }
.filters select.is-active { border-color: var(--ink); background: var(--lime); font-weight: 600; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 12px; padding-bottom: 24px; }
.product-card h3 { font-size: 14px; font-weight: 600; margin: 6px 0 2px; }
.product-card p { font-size: 14px; margin: 0; color: var(--ink-2); }
.pmain { display: block; width: 100%; aspect-ratio: 4 / 5; background: var(--stage); border-radius: var(--radius-sm); overflow: hidden; }
.pmain img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.pdots { display: flex; align-items: center; gap: 2px; margin-top: 6px; flex-wrap: wrap; min-height: 26px; }
.pdot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--paper); box-shadow: 0 0 0 1px rgba(17,20,24,.25); margin: 1px; }
.pmore { font-size: 12px; color: var(--ink-3); margin-left: 4px; }

.dot.in { background: var(--ok); }
.dot.out { background: var(--danger); }
.progress-track { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.progress-fill { height: 100%; width: 0; background: #111418; transition: width .25s; }


.test-note { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: #fff4e5; color: var(--warn); font-size: 13px; }
.test-note a { color: inherit; font-weight: 600; margin-right: 8px; }
.test-badge { flex: none; padding: 3px 8px; border-radius: 6px; background: #fff4e5; color: var(--warn); font-size: 11px; font-weight: 700; letter-spacing: .04em; }

/* Beskær */
.crop-modal { width: min(100%, 560px); }
.crop-stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto 12px; overflow: hidden; line-height: 0; background: var(--soft); user-select: none; -webkit-user-select: none; }
.crop-stage img { display: block; max-width: 100%; max-height: 52dvh; width: auto; height: auto; -webkit-user-drag: none; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid #fff; outline: 1px solid rgba(17,20,24,.6); box-shadow: 0 0 0 2000px rgba(17,20,24,.55); cursor: move; touch-action: none; }
.crop-handle { position: absolute; width: 44px; height: 44px; touch-action: none; }
.crop-handle::after { content: ""; position: absolute; width: 18px; height: 18px; background: var(--lime); border: 2px solid #111418; }
.crop-handle[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.crop-handle[data-h="nw"]::after { left: 0; top: 0; border-radius: 0 0 6px 0; }
.crop-handle[data-h="ne"] { right: 0; top: 0; cursor: nesw-resize; }
.crop-handle[data-h="ne"]::after { right: 0; top: 0; border-radius: 0 0 0 6px; }
.crop-handle[data-h="sw"] { left: 0; bottom: 0; cursor: nesw-resize; }
.crop-handle[data-h="sw"]::after { left: 0; bottom: 0; border-radius: 0 6px 0 0; }
.crop-handle[data-h="se"] { right: 0; bottom: 0; cursor: nwse-resize; }
.crop-handle[data-h="se"]::after { right: 0; bottom: 0; border-radius: 6px 0 0 0; }
.crop-ratios { display: flex; width: 100%; }
.crop-ratios button { flex: 1; }
.crop-modal .modal-actions { justify-content: space-between; }

/* Modal + toast */
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(17,20,24,.45); padding: 16px; z-index: 40; }
.modal { position: relative; width: min(100%, 460px); max-height: 90dvh; overflow-y: auto; background: var(--paper); border-radius: var(--radius); padding: 22px; }
.modal-wide { width: min(100%, 620px); }
.modal h2 { padding-right: 36px; }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.link-input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 14px; background: var(--soft); }
.my-designs { list-style: none; margin: 0; padding: 0; }
.my-designs li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; border-bottom: 1px solid var(--line); }
.my-designs a { color: var(--ink); padding: 10px 0; flex: 1; }
#guideImg { display: block; width: 100%; max-height: 300px; object-fit: contain; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
#guideTable { width: 100%; border-collapse: collapse; font-size: 14px; }
#guideTable th, #guideTable td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.toast { position: fixed; left: 50%; bottom: calc(var(--menu-h) + 24px); transform: translate(-50%, 16px); max-width: calc(100vw - 32px); width: max-content; padding: 10px 16px; background: #111418; color: #fff; border-radius: var(--radius-sm); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobil ---------- */
@media (max-width: 1023.98px) {
  .rail, .only-desktop, .side-thumbs { display: none !important; }
  .top { gap: 6px; padding: 4px 8px; min-height: 52px; flex-wrap: nowrap; }
  .test-badge { padding: 2px 5px; font-size: 9px; }
  .logo img { height: 17px; }
  .save-state, .tool-cart span, .tool-clear span, .tool-save span { display: none; }
  .tool-clear, .tool-save, .tool-cart { width: 44px; padding: 0; }
  .menu-main { display: flex; }
  body[data-mode="univers"] .menu-main { display: none; }
  body[data-mode="univers"] .menu-univers { display: flex; }
  body[data-mode="main"] .only-canvas-tools, body[data-mode="main"] .only-univers-mobile,
  body[data-mode="main"] .tool-clear, body[data-mode="main"] .tool-save,
  body[data-mode="main"] #undo, body[data-mode="main"] #redo { display: none; }
  body[data-mode="univers"] .only-main, body[data-mode="univers"] .logo, body[data-mode="univers"] .tool-cart { display: none; }
  .top-return { padding: 0 10px; font-size: 13px; }
  .work { flex-direction: column; }
  .stage-wrap { order: 1; }
  body[data-sheet] .color-row, body[data-sheet] .view-row { display: none; }
  /* Altid synlig, også når der rulles i panelet */
  .panel h2, .props h2 { padding-right: 96px; min-height: 30px; }
  .sheet-hide { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 4px; width: max-content; height: 44px; padding: 0 10px 0 12px; margin: 0 -6px -44px auto; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: 0 1px 6px rgba(17,20,24,.08); }
  .sheet-hide svg { width: 16px; height: 16px; }
  .panel, .props { display: none; order: 2; flex: none; max-height: 44dvh; border-top: 1px solid var(--line); padding: 14px 16px 16px; box-shadow: 0 -4px 14px rgba(0,0,0,.05); }
  body[data-sheet]:not([data-sheet="props"]) .panel { display: block; }
  body[data-sheet="props"] .props { display: block; }
  body[data-sheet="icons"] .panel { height: 44dvh; }
  .price-chip { right: 8px; bottom: 8px; padding: 8px 12px; font-size: 13px; }
  body[data-sheet] .price-chip { display: none; }
  .quickbar:not([hidden]) ~ .price-chip { display: none; }
  .has-quickbar .toast { bottom: calc(var(--menu-h) + 96px); }
  body[data-mode="univers"] .price-chip { display: none; }
  .chips { margin-right: -16px; padding-right: 16px; }

  .menu-univers button { font-size: 11px; min-width: 0; }

  /* Åbent panel: knappen flytter op i topbjælken, så den altid kan nås */
  body[data-sheet][data-mode="univers"] .view-switch-top { display: block; flex: 0 1 auto; min-width: 0; min-height: 40px; padding: 0 10px; font-size: 12px; line-height: 1.15; white-space: normal; }
  body[data-sheet][data-mode="univers"] .test-badge { display: none; }
  body[data-sheet][data-mode="univers"] .top-return { width: 44px; padding: 0; }
  body[data-sheet][data-mode="univers"] .top-return span { display: none; }
  body[data-sheet] .top-actions { gap: 0; }

  /* Mens der skrives: kun tekstfelt + design */
  body[data-typing] .menu, body[data-typing] #propsTitle, body[data-typing] #propWarn, body[data-typing] .props .prop:not(#propText),
  body[data-typing] #propText > :not(textarea), body[data-typing] .side-arrow { display: none; }
  body[data-typing] .props { padding: 8px 16px; max-height: none; }
  body[data-typing] #textInput { width: calc(100% - 92px); display: block; }
  body[data-typing] .prop { margin-bottom: 0; }

  /* Åbent panel: designfeltet skal stadig kunne ses og bruges */
  body[data-sheet] .side-label { left: 10px; top: 6px; transform: none; font-size: 11px; }
  body[data-sheet] .side-arrow.left { left: 6px; top: calc(50% - 26px); }
  body[data-sheet] .side-arrow.right { left: 6px; right: auto; top: calc(50% + 26px); }
  body[data-sheet] .quickbar { left: auto; right: 4px; bottom: auto; top: 50%; transform: translateY(-50%); flex-direction: column; padding: 2px; gap: 0; }
  body[data-sheet] .quickbar button { min-width: 52px; min-height: 50px; padding: 2px; font-size: 10px; }
  body[data-sheet] .quickbar svg { width: 18px; height: 18px; }

  /* Ikoner: søgning + kategorier + to rækker, resten scrolles nedad. Toppen af tredje række viser, at der er mere */
  body[data-sheet="icons"] .panel { height: auto; max-height: none; overflow: hidden; padding: 10px 16px; }
  body[data-sheet="icons"] .tool-icons h2, body[data-sheet="icons"] .grid-size { display: none; }
  body[data-sheet="icons"] .search { min-height: 44px; margin-right: 92px; }
  body[data-sheet="icons"] .chips { padding: 8px 16px 8px 0; }
  body[data-sheet="icons"] .icon-grid { grid-template-columns: repeat(auto-fill, 64px); grid-auto-rows: 64px; justify-content: space-between; height: 152px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  body[data-sheet="icons"] .icon-grid::-webkit-scrollbar { display: none; }

  /* Idéer: én række, der swipes sidelæns */
  body[data-sheet="ideas"] .panel { overflow: hidden; padding: 10px 16px; }
  body[data-sheet="ideas"] .tool[data-body="ideas"] .muted { display: none; }
  body[data-sheet="ideas"] .ideas-grid { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 112px; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  body[data-sheet="ideas"] .ideas-grid::-webkit-scrollbar { display: none; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .only-mobile, .only-univers-mobile, .menu, .sheet-hide, .quickbar, .side-arrow { display: none !important; }
  .start-choices { grid-template-columns: 1fr 1fr; }
  .start-card { padding: 28px; }
  .top { padding: 8px 18px; gap: 18px; }
  .rail { flex: none; width: 84px; display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; border-right: 1px solid var(--line); overflow-y: auto; }
  .rail button { display: grid; justify-items: center; gap: 4px; min-height: 64px; padding: 8px 2px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; }
  .rail button:hover { background: var(--soft); }
  .rail button.is-active { background: var(--lime); }
  .panel { flex: none; width: 330px; border-right: 1px solid var(--line); padding: 18px; }
  .props { flex: none; width: 300px; border-left: 1px solid var(--line); padding: 18px; }
  .peek { position: sticky; top: -18px; z-index: 3; display: grid; justify-items: center; gap: 6px; width: calc(100% + 36px); margin: -18px -18px 14px; padding: 10px 18px 12px; background: var(--stage); border-bottom: 1px solid var(--line); }
  .peek .thumb-box { display: block; height: 170px; width: auto; }
  .side-thumbs { display: flex; flex-direction: row; top: auto; right: auto; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 4px; }
  .side-thumb { grid-template-columns: 40px auto; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; }
  .side-thumb .thumb-box { width: 40px; }
  .side-label { display: none; }
  .bar { display: flex; flex: none; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); }
  .bar-info, .bar-cta { display: flex; align-items: center; gap: 16px; min-width: 0; }
  .bar-product, .bar-count { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bar-count { font-weight: 600; color: var(--ink); }
  .bar-price { font-size: 20px; white-space: nowrap; }
  .price-chip { display: none; }
  .toast { bottom: 90px; }
  .picker { background: rgba(17,20,24,.45); padding: 32px; }
  .picker-inner { width: min(100%, 1100px); margin: 0 auto; background: var(--paper); border-radius: var(--radius); padding: 18px 24px 0; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
/* ---------- Størrelse og antal: samme udtryk som butikkens kurv ---------- */
.sizes { display: flex; flex-direction: column; overflow-y: auto; background: var(--paper); -webkit-overflow-scrolling: touch; }
.sizes-showcase, .sizes-drawer, .drawer-scroll { display: contents; }
.drawer-head { order: 1; position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.count-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: #c6e62f; }
.drawer-close { margin-left: auto; color: var(--ink-3); }
.final-stage { order: 2; display: grid; justify-items: center; gap: 6px; padding: 8px 16px; background: var(--stage); }
/* Billedet følger skærmens højde, så størrelserne kan ses uden at rulle */
.final-previews { display: flex; justify-content: center; height: 150px; height: clamp(120px, 20svh, 230px); }
.final-previews .thumb-box { height: 100%; width: auto; }
.side-pills { order: -1; display: inline-flex; padding: 3px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.side-pill { min-height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.side-pill.is-active { background: var(--soft); color: var(--ink); }
.sizes-meta { order: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px 2px; }
.sizes-meta strong { display: block; font-size: 15px; font-weight: 500; }
.sizes-meta small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.sizes-list { order: 4; list-style: none; margin: 0; padding: 0 16px; }
.sizes-list li { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.sizes-list li:last-child { border-bottom: 0; }
.sizes-list .dot { width: 8px; height: 8px; border: 0; }
.size-info { flex: 1; min-width: 0; display: grid; gap: 1px; }
.size-name { font-size: 15px; font-weight: 500; }
.size-info small { font-size: 12px; color: var(--ink-3); }
.is-out .size-name { color: var(--ink-3); }
.is-out .size-info small { color: var(--danger); }
.stepper { display: inline-flex; align-items: stretch; flex: none; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.stepper button { width: 44px; height: 44px; background: var(--soft); font-size: 20px; line-height: 1; }
.stepper button:hover:not(:disabled) { background: var(--line); }
.stepper output { display: grid; place-items: center; width: 48px; border-inline: 1px solid var(--line-2); background: var(--paper); font-size: 14px; font-weight: 500; }
.upsell { order: 5; padding: 18px 16px 18px; border-top: 1px solid var(--line); }
.upsell-title { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.offer { padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.offer:last-child { border-bottom: 0; padding-bottom: 0; }
.offer-row { display: flex; align-items: center; gap: 12px; }
.offer-img { flex: none; display: flex; justify-content: center; width: 58px; height: 58px; background: var(--stage); border-radius: 8px; overflow: hidden; }
.offer-img .thumb-box { height: 100%; width: auto; }
.offer-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.offer-text strong { font-size: 14px; font-weight: 500; line-height: 1.3; }
.offer-text small { font-size: 12px; color: var(--ink-3); }
.offer-toggle { flex: none; min-width: 72px; min-height: 44px; padding: 0 14px; background: var(--lime); border: 1px solid var(--lime-line); border-radius: 10px; font-size: 14px; font-weight: 600; }
.is-added .offer-toggle { background: var(--paper); border-color: var(--line-2); font-weight: 500; }
.offer-color { margin: 12px 0 6px; font-size: 13px; color: var(--ink-3); }
.offer-dots { display: flex; gap: 2px; margin-inline: -4px; overflow-x: auto; scrollbar-width: none; }
.offer-dots::-webkit-scrollbar { display: none; }
.offer-dot { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.offer-dot::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--dot); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.offer-dot.is-active::before { outline: 2px solid var(--ink); outline-offset: 2px; }
.offer .sizes-list { margin-top: 6px; padding: 0; }
.offer .sizes-list li:last-child { padding-bottom: 0; }
.sticky-cart { order: 6; position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.usp-bar { min-height: 28px; display: grid; place-items: center; margin-bottom: 8px; padding: 4px 10px; background: var(--soft); border-radius: 8px; font-size: 12px; line-height: 1.3; text-align: center; transition: opacity .2s; }
.usp-bar.is-changing { opacity: 0; }
.delivery { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.sticky-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.total-label { display: block; font-size: 15px; }
.sticky-row small { font-size: 12px; color: var(--ink-3); }
.total { font-size: 18px; font-weight: 600; white-space: nowrap; }
.busy { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.94); padding: 24px; z-index: 3; }
.busy-box { width: min(100%, 360px); text-align: center; font-size: 15px; }
@media (min-width: 1024px) {
  .sizes { flex-direction: row; overflow: hidden; }
  .sizes-showcase { display: flex; flex: 1; min-width: 0; flex-direction: column; background: var(--stage); }
  .sizes-drawer { display: flex; flex: none; flex-direction: column; width: 460px; height: 100%; background: var(--paper); box-shadow: -8px 0 30px rgba(17,20,24,.08); }
  .drawer-scroll { display: block; flex: 1; min-height: 0; overflow-y: auto; }
  .drawer-head { order: 0; position: static; padding: 18px 12px 18px 24px; }
  .drawer-scroll { order: 1; }
  .sticky-cart { order: 2; }
  .drawer-head h2 { font-size: 26px; }
  .sizes-meta { padding: 18px 24px 6px; }
  .sizes-list { padding: 0 24px; }
  .sticky-cart { position: static; margin-top: 0; padding: 16px 24px 20px; }
  .final-stage { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; padding: 24px; }
  .final-previews { height: 100%; min-height: 0; }
  .side-pills { order: 0; }
  .side-pill { min-height: 38px; }
  .sizes-list li { min-height: 66px; padding: 8px 0; }
  .upsell { padding: 18px 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .progress-fill, .usp-bar { transition: none; }
}
