/* Foliefabrikken Postkasse – scoped to .ffpk only. Colours follow the
   site's Astra palette (falls back to the same values if the theme changes). */
.ffpk {
	--ffpk-primary: var(--ast-global-color-0, #0067ff);
	--ffpk-primary-h: var(--ast-global-color-1, #005ee9);
	--ffpk-ink: var(--ast-global-color-2, #0f172a);
	--ffpk-text: var(--ast-global-color-3, #364151);
	--ffpk-soft: var(--ast-global-color-5, #e7f6ff);
	--ffpk-line: var(--ast-global-color-7, #d1dae5);
	--ffpk-err: #b42318;
	--ffpk-radius: 14px;
	--ffpk-sticky-top: 0px;
	container-type: inline-size;
	color: var(--ffpk-text);
	font-size: 15px;
	line-height: 1.45;
	width: 100%;
	margin: 0 0 1.5em;
}
.ffpk *, .ffpk *::before, .ffpk *::after { box-sizing: border-box; }
.ffpk-form.cart { display: block !important; width: 100%; max-width: 100%; }
/* Elementor/Astra wrappers that size to their content must take full width
   around the builder (the builder's container query has no intrinsic width). */
.elementor-widget:has(.ffpk-form), .elementor-widget-container:has(.ffpk-form), .elementor-shortcode:has(.ffpk-form),
.e-con:has(> .elementor-widget .ffpk-form), .summary:has(.ffpk-form), .woocommerce-product-details__short-description:has(.ffpk-form) {
	width: 100% !important; max-width: 100% !important; flex: 1 1 100% !important; align-self: stretch !important; min-width: 0;
}
.ffpk { min-width: min(100%, 300px); }
.ffpk-loading { opacity: .7; }

.ffpk-layout { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "preview" "extra" "steps"; }
.ffpk-preview { grid-area: preview; position: sticky; top: var(--ffpk-sticky-top); z-index: 5; }
.ffpk-preview-extra { grid-area: extra; padding: 0 4px; }
.ffpk-steps { grid-area: steps; }
@container (min-width: 760px) {
	.ffpk-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "preview steps" "extra steps"; align-items: start; column-gap: 28px; row-gap: 10px; }
	.ffpk-preview { top: calc(var(--ffpk-sticky-top) + 16px); }
}

/* ---------- Preview ---------- */
.ffpk .ffpk-preview { background: #fff; border: 1px solid var(--ffpk-line); border-radius: var(--ffpk-radius); padding: 12px; }
.ffpk-stage-wrap { position: relative; background: var(--ffpk-soft); border-radius: 10px; overflow: hidden; }
.ffpk-stage { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; width: 100%; transition: height .2s ease; }
@container (max-width: 759px) { .ffpk-stage { aspect-ratio: auto; } }
.ffpk-stage svg { width: 100%; height: 100%; display: block; }
.ffpk-stage.is-stale svg { opacity: .45; filter: grayscale(.4); }
.ffpk-badge { position: absolute; left: 8px; top: 8px; font-size: 12px; background: rgba(255,255,255,.9); color: var(--ffpk-ink); padding: 2px 8px; border-radius: 999px; }
.ffpk-status { position: absolute; right: 8px; top: 8px; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.ffpk-status:empty { display: none; }
.ffpk-status.is-busy { background: #fff; color: var(--ffpk-text); }
.ffpk-status.is-error { background: var(--ffpk-err); color: #fff; }

.ffpk-facts { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px 4px; flex-wrap: wrap; }
.ffpk-facts > div { display: flex; flex-direction: column; }
.ffpk-facts__label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ffpk-text); opacity: .8; }
.ffpk-dims { font-size: 18px; color: var(--ffpk-ink); }
.ffpk-facts__price { text-align: right; align-items: flex-end; }
.ffpk-price { font-size: 22px; color: var(--ffpk-ink); line-height: 1.1; }
.ffpk-price-suffix { font-size: 12px; }
.ffpk-mb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 2px; font-size: 12px; }
.ffpk-mb__sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--ffpk-line); padding: 0; cursor: pointer; min-height: 0; }
.ffpk-mb__sw[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ffpk-primary); }
.ffpk-note { font-size: 12.5px; margin: 6px 2px 0; }

/* ---------- Steps ---------- */
.ffpk-steps { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ffpk-step { border: 1px solid var(--ffpk-line); border-radius: var(--ffpk-radius); padding: 14px; background: #fff; }
.ffpk-step__title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 17px; color: var(--ffpk-ink); line-height: 1.3; }
.ffpk-step__no { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--ffpk-primary); color: #fff; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.ffpk-help { margin: 0 0 8px; font-size: 13.5px; }
.ffpk-sub { font-size: 14px; margin: 14px 0 6px; color: var(--ffpk-ink); }
.ffpk-sub:first-of-type { margin-top: 0; }

.ffpk-picker__row { margin-bottom: 8px; }
.ffpk-picker__group { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.ffpk-picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.ffpk .ffpk-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; border: 1px solid var(--ffpk-line); border-radius: 10px; background: #fff; color: var(--ffpk-ink); cursor: pointer; font-size: 12.5px; line-height: 1.2; min-height: 44px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.ffpk .ffpk-pick:hover { border-color: var(--ffpk-primary); background: var(--ffpk-soft); }
.ffpk .ffpk-pick:disabled { opacity: .45; cursor: not-allowed; }
.ffpk-pick .ffpk-thumb { width: 44px; height: 44px; fill: var(--ffpk-ink); }
.ffpk-pick__plus { position: absolute; right: 5px; top: 3px; font-weight: 700; color: var(--ffpk-primary); }

.ffpk-list-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; }
.ffpk-list-head h4 { margin: 0; font-size: 14px; color: var(--ffpk-ink); }
.ffpk-count { font-size: 12.5px; }
.ffpk-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ffpk-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--ffpk-line); border-radius: 10px; }
.ffpk-item__fig .ffpk-thumb { width: 44px; height: 44px; fill: var(--ffpk-ink); }
.ffpk-item__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ffpk-item__label { font-size: 13px; font-weight: 600; color: var(--ffpk-ink); }
.ffpk-item__tools { display: flex; gap: 4px; }
.ffpk .ffpk-move, .ffpk .ffpk-remove { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 8px; border: 1px solid var(--ffpk-line); background: #fff; color: var(--ffpk-ink); font-size: 20px; line-height: 1; cursor: pointer; }
.ffpk .ffpk-move:disabled { opacity: .3; cursor: default; }
.ffpk .ffpk-remove { color: var(--ffpk-err); }
.ffpk-empty { padding: 10px; border: 1px dashed var(--ffpk-line); border-radius: 10px; font-size: 13px; }

.ffpk input[type="text"], .ffpk input[type="number"] { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ffpk-line); border-radius: 10px; font-size: 16px; color: var(--ffpk-ink); background: #fff; }
.ffpk input[aria-invalid="true"] { border-color: var(--ffpk-err); box-shadow: 0 0 0 1px var(--ffpk-err); }
.ffpk-fields { display: grid; grid-template-columns: 1fr; gap: 10px; }
@container (min-width: 420px) { .ffpk-fields { grid-template-columns: 1fr 9em; } }
.ffpk-field label, .ffpk-qty label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; color: var(--ffpk-ink); }
.ffpk-err { color: var(--ffpk-err); font-size: 13px; margin: 2px 0 0; }
.ffpk-err:empty { display: none; }

.ffpk-sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ffpk .ffpk-size, .ffpk .ffpk-color, .ffpk .ffpk-font { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--ffpk-line); border-radius: 10px; background: #fff; color: var(--ffpk-ink); cursor: pointer; text-align: left; min-height: 44px; text-transform: none; letter-spacing: 0; font-weight: 500; line-height: 1.25; }
.ffpk .ffpk-size[aria-checked="true"], .ffpk .ffpk-color[aria-checked="true"], .ffpk .ffpk-font[aria-checked="true"] { border-color: var(--ffpk-primary); box-shadow: 0 0 0 2px var(--ffpk-primary) inset; background: var(--ffpk-soft); }
.ffpk-size__label { font-weight: 700; }
.ffpk-size__dims { font-size: 13px; }
.ffpk .ffpk-size.is-locked { opacity: .55; }
.ffpk .ffpk-size.is-locked .ffpk-size__dims { color: var(--ffpk-err); }
.ffpk-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ffpk .ffpk-color { flex-direction: row; align-items: center; gap: 8px; }
.ffpk-color__sw { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.ffpk-color__sw.is-light { box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.ffpk-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ffpk-font__sample { height: 22px; width: auto; max-width: 100%; fill: var(--ffpk-ink); }
.ffpk-font__name { font-size: 12.5px; }

.ffpk-summary { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 14px; }
.ffpk-summary dt { font-weight: 600; color: var(--ffpk-ink); }
.ffpk-summary dd { margin: 0; overflow-wrap: anywhere; }
.ffpk-info { font-size: 13.5px; margin: 0 0 6px; }
.ffpk-legal { font-size: 12.5px; margin: 10px 0 0; opacity: .9; }
.ffpk-buyrow { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.ffpk-qty { flex: 0 0 6.5em; }
.ffpk-buy-wrap { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; }
.ffpk-buy__price { font-weight: 700; color: var(--ffpk-ink); font-size: 14px; }
.ffpk .ffpk-buy { width: 100%; min-height: 48px; border-radius: 30px; background: var(--ffpk-primary); border-color: var(--ffpk-primary); color: #fff; font-size: 16px; }
.ffpk .ffpk-buy:hover { background: var(--ffpk-primary-h); }
.ffpk .ffpk-buy:disabled { opacity: .5; cursor: not-allowed; }

.ffpk button:focus-visible, .ffpk input:focus-visible { outline: 3px solid var(--ffpk-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ffpk-stage { transition: none; } }

@container (max-width: 759px) {
	.ffpk .ffpk-preview { box-shadow: 0 6px 18px rgba(15, 23, 42, .14); padding: 8px; margin: 0 -4px; }
	.ffpk-stage { height: 26vh; max-height: 240px; }
	.ffpk.is-typing .ffpk-stage { height: 20vh; }
	.ffpk-facts { padding: 6px 2px 0; }
	.ffpk-facts__label { font-size: 11px; }
	.ffpk-dims { font-size: 16px; }
	.ffpk-price { font-size: 18px; }
}

.ffpk-info--size:empty { display: none; }
.ffpk-info--size { margin-top: 6px; color: var(--ffpk-primary-h); }

.ffpk-info--full:empty { display: none; }
.ffpk-info--full { background: var(--ffpk-soft); border-radius: 8px; padding: 8px 10px; margin: 4px 0 0; }

.ffpk-topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ffpk .ffpk-topic { min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--ffpk-line); background: #fff; color: var(--ffpk-ink); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; cursor: pointer; }
.ffpk .ffpk-topic[aria-checked="true"] { background: var(--ffpk-primary); border-color: var(--ffpk-primary); color: #fff; }
.ffpk .ffpk-pick[hidden], .ffpk-picker__row[hidden] { display: none !important; }
.ffpk textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--ffpk-line); border-radius: 10px; font-size: 16px; color: var(--ffpk-ink); background: #fff; font-family: inherit; }
.ffpk-field--wide { grid-column: 1 / -1; }

/* Figurvælger med søgning og kategorier (mange figurer) */
.ffpk-figsearch { margin: 0 0 8px; }
.ffpk .ffpk-figsearch__input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ffpk-line); border-radius: 10px; font-size: 16px; background: #fff; color: var(--ffpk-ink); }
.ffpk .ffpk-figsearch__input:focus { outline: none; border-color: var(--ffpk-primary); box-shadow: 0 0 0 3px rgba(0, 94, 255, .15); }
.ffpk-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.ffpk-cats .ffpk-topic { flex: 0 0 auto; }
.ffpk-picker__grid--scroll { max-height: 360px; overflow-y: auto; overflow-x: hidden; padding: 4px 2px 4px 0; overscroll-behavior: contain; }
.ffpk-pick .ffpk-thumb--img { width: 56px; height: 56px; object-fit: contain; }
.ffpk-item__fig .ffpk-thumb--img { width: 44px; height: 44px; object-fit: contain; }
.ffpk-picker__empty { margin: 8px 0 0; color: #5b6b6f; font-size: 14px; }
.ffpk-picker__empty[hidden] { display: none; }
@media (max-width: 600px) { .ffpk-picker__grid--scroll { max-height: 300px; } }

/* Lange figurnavne må aldrig gøre gitteret bredere end kolonnen (vandret rullebjælke). */
.ffpk .ffpk-pick { min-width: 0; white-space: normal; }
.ffpk-pick__name { max-width: 100%; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }

/* Skrifttype: familie + tykkelse/stil (som i tekstkonfiguratoren) */
.ffpk-fontvar { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ffpk-fontvar:empty { display: none; }
.ffpk-seg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ffpk-seg__label { font-size: 13px; font-weight: 600; color: var(--ffpk-ink); min-width: 64px; }
.ffpk-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 3px; background: #eef1f4; border-radius: 999px; }
.ffpk .ffpk-seg__btn { border: 0; background: transparent; color: var(--ffpk-ink); padding: 7px 14px; min-height: 36px; border-radius: 999px; font-size: 13.5px; font-weight: 500; line-height: 1.2; cursor: pointer; text-transform: none; letter-spacing: 0; box-shadow: none; }
.ffpk .ffpk-seg__btn:hover { background: rgba(255,255,255,.7); }
.ffpk .ffpk-seg__btn[aria-checked="true"] { background: #fff; color: var(--ffpk-primary); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* Figurlisten: [figur] [navn] [▲▼] [Fjern] */
.ffpk-item { display: block; padding: 0; border: 0; }
.ffpk-item__row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: stretch; gap: 0; border: 1px solid var(--ffpk-line); border-radius: 12px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.ffpk-item__row:hover { border-color: var(--ffpk-primary); box-shadow: 0 2px 10px rgba(11, 92, 214, .10); }
.ffpk .ffpk-item__figbtn { display: flex; align-items: center; justify-content: center; margin: 0; padding: 4px; min-height: 60px; border: 0; border-right: 1px solid var(--ffpk-line); border-radius: 0; background: var(--ffpk-soft, #f2f6fb); cursor: pointer; box-shadow: none; }
.ffpk .ffpk-item__figbtn:hover { background: color-mix(in srgb, var(--ffpk-primary) 12%, #fff); }
.ffpk .ffpk-item__figbtn .ffpk-thumb, .ffpk .ffpk-item__figbtn .ffpk-thumb--img { width: 46px; height: 46px; object-fit: contain; }
.ffpk .ffpk-item__open { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; margin: 0; padding: 8px 12px; border: 0; border-radius: 0; background: transparent; color: var(--ffpk-ink); text-align: left; cursor: pointer; font: inherit; text-transform: none; letter-spacing: 0; box-shadow: none; -webkit-user-select: none; user-select: none; }
.ffpk .ffpk-item__open:hover { background: #fafcff; color: var(--ffpk-ink); }
.ffpk .ffpk-item__figbtn:focus-visible, .ffpk .ffpk-item__open:focus-visible, .ffpk .ffpk-order:focus-visible, .ffpk .ffpk-item__del:focus-visible { outline: 3px solid var(--ffpk-primary); outline-offset: -3px; }
.ffpk-item__name { font-size: 16px; font-weight: 600; color: var(--ffpk-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ffpk-item__name.is-empty { font-weight: 400; font-size: 14px; color: #6b7785; font-style: italic; }
.ffpk-item__label { font-size: 12.5px; font-weight: 500; color: #5b6b6f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ffpk-item__order { display: flex; flex-direction: column; border-left: 1px solid var(--ffpk-line); }
.ffpk .ffpk-order { flex: 1 1 50%; width: 38px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: #fff; color: var(--ffpk-ink); font-size: 11px; line-height: 1; cursor: pointer; box-shadow: none; }
.ffpk .ffpk-order + .ffpk-order { border-top: 1px solid var(--ffpk-line); }
.ffpk .ffpk-order:hover:not(:disabled) { background: var(--ffpk-soft, #f2f6fb); color: var(--ffpk-primary); }
.ffpk .ffpk-order:disabled { color: #c3cad2; cursor: default; }
.ffpk .ffpk-item__del { margin: 0; padding: 0 14px; min-height: 0; border: 0; border-left: 1px solid var(--ffpk-line); border-radius: 0; background: #fff; color: var(--ffpk-err, #b42318); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: 0; }
.ffpk .ffpk-item__del:hover { background: #fdf1f0; color: var(--ffpk-err, #b42318); }
@media (max-width: 380px) { .ffpk .ffpk-item__del { padding: 0 10px; font-size: 13px; } .ffpk .ffpk-order { width: 32px; } }
.ffpk-item > .ffpk-err:empty { display: none; }

/* "Tilføj figur" folder biblioteket ud */
.ffpk .ffpk-addfig { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 10px 0 0; padding: 12px 16px; min-height: 52px; border: 2px dashed var(--ffpk-primary); border-radius: 12px; background: #fff; color: var(--ffpk-primary); font-size: 16px; font-weight: 700; cursor: pointer; text-transform: none; letter-spacing: 0; box-shadow: none; }
.ffpk .ffpk-addfig:hover:not(:disabled) { background: var(--ffpk-soft, #f2f6fb); color: var(--ffpk-primary); }
.ffpk .ffpk-addfig.is-open { border-style: solid; background: var(--ffpk-soft, #f2f6fb); }
.ffpk .ffpk-addfig:disabled { border-color: var(--ffpk-line); color: #8a96a3; cursor: default; }
.ffpk-addfig__plus { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ffpk-primary); color: #fff; font-size: 20px; line-height: 1; }
.ffpk .ffpk-addfig:disabled .ffpk-addfig__plus { background: #c3cad2; }
.ffpk-pickwrap { margin-top: 10px; padding: 12px; border: 1px solid var(--ffpk-line); border-radius: 12px; background: #fbfcfe; animation: ffpkFold .18s ease-out; }
.ffpk-pickwrap[hidden] { display: none; }
@keyframes ffpkFold { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ffpk-pickwrap { animation: none; } }

/* Klikbar forhåndsvisning */
.ffpk-stage .ffpk-hit rect { cursor: pointer; pointer-events: all; }
@media (hover: hover) { .ffpk-stage .ffpk-hit rect:hover { fill: rgba(127, 127, 127, .12); stroke: currentColor; stroke-opacity: .25; stroke-dasharray: 2 2; } }

/* Redigeringsark: fuld side på mobil, dialog på computer */
html.ffpk-sheet-open, html.ffpk-sheet-open body { overflow: hidden; }
.ffpk.ffpk-sheet { position: fixed; inset: 0; margin: 0; width: auto; container-type: normal; z-index: 100000; display: flex; align-items: flex-end; justify-content: center; font-family: inherit; }
.ffpk.ffpk-sheet[hidden] { display: none; }
.ffpk-sheet__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); animation: ffpkFade .2s ease-out; }
.ffpk-sheet__panel { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; height: 100dvh; background: #fff; color: var(--ffpk-ink); animation: ffpkUp .25s cubic-bezier(.2, .8, .2, 1); overflow: hidden; }
@media (min-width: 720px) {
	.ffpk.ffpk-sheet { align-items: center; padding: 24px; }
	.ffpk-sheet__panel { width: 560px; height: auto; max-height: calc(100vh - 48px); border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
}
@keyframes ffpkUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ffpkFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ffpk-sheet__panel, .ffpk-sheet__backdrop { animation: none; } }
.ffpk-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid #eef1f4; }
.ffpk-sheet__title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--ffpk-ink); }
.ffpk-sheet button { font-family: inherit; text-transform: none; letter-spacing: 0; }
.ffpk-sheet .ffpk-sheet__close { width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #f1f3f5; color: var(--ffpk-ink); font-size: 24px; line-height: 1; cursor: pointer; }
.ffpk-sheet__mini { padding: 12px 16px; background: linear-gradient(180deg, #f5f8fc, #fff); }
.ffpk-sheet__mini svg { display: block; width: 100%; height: 110px; }
.ffpk-sheet__body { flex: 1 1 auto; overflow-y: auto; padding: 8px 16px 16px; -webkit-overflow-scrolling: touch; }
.ffpk-sheet__fig { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.ffpk-sheet__thumb { display: flex; align-items: center; justify-content: center; width: 84px; height: 84px; border-radius: 14px; background: #f2f6fb; flex: 0 0 auto; }
.ffpk-sheet .ffpk-thumb--big { width: 72px; height: 72px; object-fit: contain; fill: var(--ffpk-ink); }
.ffpk-sheet__figname { display: block; font-size: 16px; margin-bottom: 6px; }
.ffpk-sheet .ffpk-sheet__swap { padding: 8px 14px; min-height: 38px; border: 1px solid var(--ffpk-primary); border-radius: 999px; background: #fff; color: var(--ffpk-primary); font-size: 14px; font-weight: 600; cursor: pointer; }
.ffpk-sheet__label { display: block; margin: 6px 0 6px; font-size: 14px; font-weight: 600; }
.ffpk-sheet .ffpk-sheet__input { display: block; width: 100%; box-sizing: border-box; min-height: 54px; padding: 12px 14px; border: 2px solid var(--ffpk-primary); border-radius: 12px; font-size: 20px; font-weight: 600; color: var(--ffpk-ink); background: #fff; }
.ffpk-sheet .ffpk-sheet__input:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ffpk-primary) 20%, transparent); }
.ffpk-sheet .ffpk-sheet__input[aria-invalid="true"] { border-color: #b32d2e; }
.ffpk-sheet .ffpk-err { color: #b32d2e; font-size: 14px; margin: 6px 0 0; min-height: 0; }
.ffpk-sheet__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ffpk-sheet .ffpk-sheet__tool { flex: 1 1 auto; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ffpk-line); border-radius: 10px; background: #fff; color: var(--ffpk-ink); font-size: 14px; font-weight: 500; cursor: pointer; }
.ffpk-sheet .ffpk-sheet__tool:disabled { opacity: .35; cursor: default; }
.ffpk-sheet .ffpk-sheet__tool--del { color: #b32d2e; border-color: #f0c8c8; }
.ffpk-sheet .ffpk-sheet__back { margin-top: 12px; padding: 10px 0; border: 0; background: none; color: var(--ffpk-primary); font-size: 15px; font-weight: 600; cursor: pointer; }
.ffpk-sheet__foot { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid #eef1f4; background: #fff; }
.ffpk-sheet .ffpk-sheet__nav { min-height: 48px; border: 1px solid var(--ffpk-line); border-radius: 12px; background: #fff; color: var(--ffpk-ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.ffpk-sheet .ffpk-sheet__nav:disabled { opacity: .35; cursor: default; }
.ffpk-sheet .ffpk-sheet__done { min-height: 48px; border: 0; border-radius: 12px; background: var(--ffpk-primary); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
/* Figurvælgeren, når den ligger i arket (skift figur) */
.ffpk-sheet .ffpk-picker__grid--scroll { max-height: none; }
.ffpk-sheet .ffpk-picker { margin-top: 4px; }
.ffpk-size__price { font-weight: 700; color: var(--ffpk-ink); font-size: 14px; }
.ffpk-size__price:empty { display: none; }

/* Træk og slip */
.ffpk-item__row, .ffpk-item__row img, .ffpk-stage svg { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.ffpk-list.is-sorting { cursor: grabbing; }
.ffpk-item.is-dragging { position: relative; z-index: 5; }
.ffpk-item.is-dragging .ffpk-item__row { border-color: var(--ffpk-primary); box-shadow: 0 10px 28px rgba(15, 23, 42, .22); transform: scale(1.02); background: #fff; }
.ffpk-list.is-sorting .ffpk-item:not(.is-dragging) { transition: transform .12s; }
.ffpk-stage svg.is-dragging { cursor: grabbing; }
.ffpk-stage .is-lifted { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
@media (hover: hover) { .ffpk-stage .ffpk-hit rect[data-role="figure"], .ffpk-stage .ffpk-hit rect[data-role="name"] { cursor: grab; } }

/* Målebånd under forhåndsvisningen */
.ffpk-measure { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px; justify-content: flex-start; padding: 0 10px; pointer-events: none; }
.ffpk-measure .ffpk-measure__chip { pointer-events: auto; }
.ffpk-measure:empty { display: none; }
.ffpk .ffpk-measure__chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; margin: 0; padding: 5px 10px; min-height: 0; border: 0; border-radius: 7px 7px 0 0; background: var(--ffpk-primary); color: #fff; font-size: 12.5px; line-height: 1.25; cursor: pointer; text-transform: none; letter-spacing: 0; box-shadow: none; opacity: .85; transition: opacity .12s, background .12s; }
/* Kun den del, der vises lige nu (hover eller valgt), folder målet ud. Et fastholdt mål,
   der ikke vises, markeres med en diskret ring – det bliver aldrig hængende "oppe". */
.ffpk .ffpk-measure__chip:hover, .ffpk .ffpk-measure__chip.is-active { opacity: 1; background: var(--ffpk-primary-h); color: #fff; }
.ffpk .ffpk-measure__chip[aria-pressed="true"]:not(.is-active) { opacity: .85; background: var(--ffpk-primary); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.ffpk .ffpk-measure__chip:focus-visible { outline: 3px solid var(--ffpk-primary); outline-offset: 2px; }
.ffpk-measure__label { font-weight: 600; }
.ffpk-measure__dims { display: none; font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 700; margin-top: 1px; }
.ffpk .ffpk-measure__chip.is-active .ffpk-measure__dims { display: block; }

/* Skrifttypekort: navnet skrevet i skrifttypen selv */
.ffpk .ffpk-font { align-items: flex-start; justify-content: center; min-height: 52px; }
.ffpk-font .ffpk-font__sample { height: 22px; width: auto; max-width: 100%; fill: var(--ffpk-ink); }
.ffpk .ffpk-font[aria-checked="true"] .ffpk-font__sample { fill: var(--ffpk-primary); }

/* Mange bredder: kompakte knapper */
.ffpk-sizes.ffpk-sizes--many { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.ffpk-sizes--many .ffpk-size { padding: 8px 10px; }
.ffpk-sizes--many .ffpk-size__label { font-size: 16px; font-weight: 700; }
.ffpk-sizes--many .ffpk-size__dims { font-size: 12px; color: #5b6b6f; }
.ffpk .ffpk-size.is-locked { opacity: .45; }

/* Størrelse som skyder */
.ffpk-slider { --lock: 0%; padding: 4px 0 2px; }
.ffpk-slider__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ffpk-slider__w { font-size: 22px; font-weight: 800; color: var(--ffpk-ink); font-variant-numeric: tabular-nums; }
.ffpk-slider__dims { font-size: 14px; color: #5b6b6f; }
.ffpk-slider__row { display: flex; align-items: center; gap: 10px; }
.ffpk .ffpk-slider__step { flex: 0 0 auto; width: 44px; height: 44px; min-height: 0; padding: 0; border: 1px solid var(--ffpk-line); border-radius: 50%; background: #fff; color: var(--ffpk-ink); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: none; }
.ffpk .ffpk-slider__step:hover { border-color: var(--ffpk-primary); color: var(--ffpk-primary); background: #fff; }
.ffpk-slider__track { position: relative; flex: 1 1 auto; height: 44px; display: flex; align-items: center; }
.ffpk-slider__track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: linear-gradient(90deg, transparent 0, transparent var(--lock), #dbe3ec var(--lock)); }
.ffpk-slider.has-lock .ffpk-slider__track::after { content: ""; position: absolute; left: 0; width: var(--lock); top: 50%; height: 8px; margin-top: -4px; border-radius: 4px 0 0 4px; background: repeating-linear-gradient(135deg, #f3c4bf 0 4px, #fbe7e5 4px 8px); }
.ffpk .ffpk-slider__range { position: relative; z-index: 1; width: 100%; height: 44px; margin: 0; padding: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-y; }
.ffpk-slider__range:focus { outline: none; }
.ffpk-slider__range::-webkit-slider-runnable-track { height: 8px; background: transparent; }
.ffpk-slider__range::-moz-range-track { height: 8px; background: transparent; }
.ffpk-slider__range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--ffpk-primary); border: 4px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .35); }
.ffpk-slider__range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--ffpk-primary); border: 4px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .35); }
.ffpk-slider__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ffpk-primary) 35%, transparent); }
.ffpk-slider__ends { display: flex; justify-content: space-between; padding: 0 54px; font-size: 12px; color: #6b7785; }
.ffpk-slider__msg { margin: 6px 0 0; font-size: 13.5px; color: #b42318; }
.ffpk-slider__msg:empty { display: none; }

/* Målet for den valgte del vises under stickeren, uden for motivet. */

/* Figurbibliotek som vindue. Midt på skærmen på pc, fuld skærm på telefon. */
.ffpk-modal { position: fixed; inset: 0; z-index: 100000; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ffpk-modal[hidden] { display: none; }
.ffpk-modal__panel { background: #fff; border-radius: var(--ffpk-radius); width: 100%; max-width: 720px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.ffpk-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--ffpk-line); }
.ffpk-modal__title { margin: 0; font-size: 17px; color: var(--ffpk-ink); }
.ffpk-modal__close { border: 0; background: transparent; font-size: 26px; line-height: 1; padding: 4px 8px; cursor: pointer; color: var(--ffpk-ink); min-height: 44px; min-width: 44px; }
.ffpk-modal__body { overflow: auto; padding: 12px 16px 20px; }
.ffpk-modal__body .ffpk-pickwrap { border: 0; padding: 0; }
@media (max-width: 640px) {
  .ffpk-modal { padding: 0; }
  .ffpk-modal__panel { max-width: none; max-height: none; height: 100%; border-radius: 0; }
}

/* Fold-ud til skrifttype under Tilføj tekst. */
.ffpk .ffpk-fold { margin-top: 14px; border: 1px solid var(--ffpk-line); border-radius: 10px; background: #fff; }
.ffpk .ffpk-fold__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--ffpk-ink); list-style: none; }
.ffpk .ffpk-fold__head::-webkit-details-marker { display: none; }
.ffpk .ffpk-fold__head::after { content: '▾'; color: var(--ffpk-primary); transition: transform .15s; }
.ffpk .ffpk-fold[open] .ffpk-fold__head::after { transform: rotate(180deg); }
.ffpk .ffpk-fold__pick { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--ffpk-text); }
.ffpk .ffpk-fold > .ffpk-fonts, .ffpk .ffpk-fold > .ffpk-fontvar, .ffpk .ffpk-fold > .ffpk-err { padding: 0 14px 12px; }

/* ------------------------------------------------------------------ */
/* Målechips og mål-mærke må ALDRIG dække designet.                     */
/* Desktop: der reserveres plads nederst i stagen, så tegningen altid   */
/* slutter over chipsene. Telefon: chips og mærke flytter helt ud af    */
/* billedet og ligger som en scrollbar række under previewet.           */
/* ------------------------------------------------------------------ */
.ffpk-stage-wrap:has(.ffpk-measure:not(:empty)) .ffpk-stage { box-sizing: border-box; padding-bottom: 54px; }

@media (max-width: 760px) {
	.ffpk-stage-wrap { display: flex; flex-direction: column; overflow: visible; }
	.ffpk-stage-wrap:has(.ffpk-measure:not(:empty)) .ffpk-stage { padding-bottom: 0; }
	.ffpk-stage { order: 1; }
	.ffpk-measure { order: 2; position: static; border-radius: 0; left: auto; right: auto; bottom: auto; margin: 8px 0 0; padding: 0 8px 8px; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
	.ffpk-measure::-webkit-scrollbar { display: none; }
	.ffpk-measure .ffpk-measure__chip { flex: 0 0 auto; }
}

/* ---------- Bekræftelse efter "Læg i kurv" med tilbud på skraber ---------- */
.ffpk-modal { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.ffpk-modal__backdrop { position: absolute; inset: 0; background: rgba(11, 31, 53, .48); }
.ffpk-modal__dialog { position: relative; width: 100%; max-width: 24rem; max-height: 92vh; overflow: auto; padding: 1.75rem 1.5rem 1.4rem; border-radius: 16px; background: #fff; box-shadow: 0 18px 48px rgba(11, 31, 53, .22); text-align: center; color: #0b1f35; }
.ffpk-modal__close { position: absolute; top: .65rem; right: .65rem; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #64748b; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.ffpk-modal__close:hover, .ffpk-modal__close:focus-visible { background: #f1f5f9; color: #0b1f35; outline: none; }
.ffpk-modal__check { display: inline-flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; margin: 0 auto .85rem; border-radius: 999px; background: #ecfdf3; color: #166534; font-size: 1.65rem; font-weight: 700; }
.ffpk-modal__title { margin: 0 0 1.25rem; font-size: 1.125rem; font-weight: 700; line-height: 1.35; }
.ffpk-modal__up { margin: 0 0 1.15rem; padding: .75rem; border: 1px solid #dbe7f5; border-radius: 12px; background: var(--ffpk-soft, #f3f8ff); text-align: left; display: grid; grid-template-columns: 1fr auto; gap: .5rem .75rem; align-items: center; }
.ffpk-modal__uplink { display: flex; gap: .75rem; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.ffpk-modal__upimg img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.ffpk-modal__upbody { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.ffpk-modal__uptitle { font-weight: 700; font-size: .95rem; }
.ffpk-modal__uptext { font-size: .82rem; color: #475569; }
.ffpk-modal__upprice { font-size: .85rem; font-weight: 600; }
.ffpk-modal__upadd { padding: .5rem .85rem; border: 1px solid var(--ffpk-primary, #0067ff); border-radius: 10px; background: #fff; color: var(--ffpk-primary, #0067ff); font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.ffpk-modal__upadd:hover:not(:disabled) { background: var(--ffpk-primary, #0067ff); color: #fff; }
.ffpk-modal__upadd.is-done { border-color: #166534; color: #166534; background: #ecfdf3; cursor: default; }
.ffpk-modal__upadd:disabled { opacity: .85; }
.ffpk-modal__upmsg { grid-column: 1 / -1; font-size: .8rem; color: #b42318; }
.ffpk-modal__upmsg:empty { display: none; }
.ffpk-modal__actions { display: flex; flex-direction: column; gap: .65rem; }
.ffpk-modal__btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 2.85rem; padding: .75rem 1.1rem; border-radius: 12px; border: 1px solid transparent; font-size: .95rem; font-weight: 700; text-decoration: none; box-sizing: border-box; }
.ffpk-modal__btn--primary { background: var(--ffpk-primary, #0067ff); color: #fff; }
.ffpk-modal__btn--primary:hover { filter: brightness(.93); color: #fff; }
.ffpk-modal__btn--secondary { background: #fff; border-color: #cbd5e1; color: #0b1f35; }
.ffpk-modal__btn--secondary:hover { background: #f1f5f9; color: #0b1f35; }
body.ffpk-modal-open { overflow: hidden; }
