/* Foto-Upload für die-geschenkidee.de. iPhone-style photo screen; the layout follows the available width only. */
:root {
  color-scheme: light;
  --brand: rgb(251, 160, 50);
  --brand-hover: rgb(240, 145, 30);
  --brand-soft: #fff4e5;
  --ink: #2b2b2b;
  --text: #525252;
  --muted: #6b6b6b;
  --line: #e3e3e3;
  --err: #b90000;
  --err-soft: #fdecec;
  --f-accent: #a85b06;
  --f-soft: #f1f2f4;
  --f-glass: rgba(255, 255, 255, .94);
  --f-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Open Sans", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--text); font: 16px/1.55 var(--f-font); }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #1a5fb4; outline-offset: 2px; }
.f-noscript { padding: 24px; text-align: center; }

.stage { container-type: inline-size; min-height: 100dvh; background: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; background: var(--brand); color: #1d1405; font-weight: 700; padding: 12px 22px; border-radius: 6px; min-height: 48px; text-decoration: none; }
.btn:hover { background: var(--brand-hover); }
.btn[disabled] { background: #e4e4e4; color: #6a6a6a; cursor: not-allowed; }
.btn.big { font-size: 1.15rem; min-height: 60px; padding: 14px 24px; width: 100%; }
.btn.ghost { background: #fff; border: 1px solid #bdbdbd; color: var(--ink); }
.btn svg { width: 24px; height: 24px; flex: none; }

.f-page { position: relative; display: flex; flex-direction: column; min-height: 100dvh; font-family: var(--f-font); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
.f-page.over::after { content: ""; position: absolute; inset: 6px; z-index: 30; border: 3px dashed var(--f-accent); border-radius: 16px; background: rgba(251, 160, 50, .16); pointer-events: none; }
.f-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.f-page button { -webkit-tap-highlight-color: transparent; }
.f-loading { flex: 1; display: grid; place-items: center; }
.f-spinner { width: 28px; height: 28px; border: 3px solid var(--f-soft); border-top-color: var(--brand); border-radius: 50%; animation: f-spin .8s linear infinite; }
@keyframes f-spin { to { transform: rotate(360deg); } }

/* Top bar */
.f-top { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; align-items: center; min-height: 52px; padding: env(safe-area-inset-top) 8px 0; background: var(--f-glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.f-title { text-align: center; line-height: 1.15; min-width: 0; }
.f-title strong { display: block; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.f-title small { display: block; margin-top: 1px; font-size: .72rem; color: var(--muted); }
.f-text-btn { position: relative; isolation: isolate; border: 0; background: none; color: var(--ink); font-size: 1rem; font-weight: 500; min-height: 44px; min-width: 44px; padding: 0 14px; }
.f-top .f-text-btn::before { content: ""; position: absolute; inset: 6px 0; z-index: -1; border-radius: 16px; background: var(--f-soft); }
.f-top [data-all], .f-top [data-none] { justify-self: start; }
.f-add { justify-self: end; width: 44px; padding: 0; font-size: 1.5rem; font-weight: 400; line-height: 1; }
.f-top .f-add::before { inset: 6px; border-radius: 50%; }
.f-load { height: 2px; margin-top: -2px; position: sticky; top: 50px; z-index: 11; }
.f-load i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }

/* Photos */
.f-body { flex: 1; display: flex; flex-direction: column; }
.f-photos { flex: 1; }
.f-msg { margin: 8px; padding: 10px 14px; border-radius: 12px; background: var(--err-soft); color: var(--err); font-size: .85rem; }
.f-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
/* Last card in the grid: add more photos */
.f-add-card { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.f-add-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--f-soft); }
.f-add-icon svg { width: 28px; height: 28px; }
.f-add-card:active .f-add-icon { background: #e4e6e9; }
.f-tile { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: #e9ebee; overflow: hidden; cursor: pointer; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.f-tile:focus-visible { outline-offset: -3px; }
.f-tile img, .f-tile .f-ph { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .6; pointer-events: none; transition: opacity .2s, transform .14s ease-out, border-radius .14s ease-out; }
.f-tile.done img, .f-tile.done .f-ph { opacity: 1; }
.f-ph { display: grid; place-items: center; width: 100%; height: 100%; color: #a4a8ae; background: #e9ebee; }
.f-ph svg { width: 30%; height: 30%; max-width: 40px; }
.f-tile[aria-pressed="true"] { background: var(--brand-soft); }
.f-tile[aria-pressed="true"] img, .f-tile[aria-pressed="true"] .f-ph { transform: scale(.88); border-radius: 8px; }
.f-check { display: none; position: absolute; right: 4px; bottom: 4px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--ink); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); place-items: center; }
.f-check svg { width: 13px; height: 13px; }
.f-tile[aria-pressed="true"] .f-check { display: grid; animation: f-pop .18s ease-out; }
@keyframes f-pop { from { transform: scale(.4); } 70% { transform: scale(1.12); } }
.f-dots { position: absolute; left: 5px; bottom: 5px; display: flex; gap: 3px; }
.f-dot { display: block; flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 3px rgba(0, 0, 0, .45); }
.f-tile .tbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .6); }
.f-tile .tbar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .15s; }
.f-tile.done .tbar { display: none; }

/* Empty start */
.f-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 20px calc(12px + env(safe-area-inset-bottom)); text-align: center; }
.f-logo { height: 40px; width: auto; }
.f-fan { position: relative; flex: none; width: 240px; height: 200px; }
.f-fan img { position: absolute; left: 30px; top: 30px; width: 180px; height: 135px; object-fit: cover; border: 6px solid #fff; border-radius: 4px; box-shadow: 0 8px 24px rgba(20, 24, 30, .22); }
.f-fan img:nth-child(1) { transform: rotate(-10deg) translate(-14px, 6px); }
.f-fan img:nth-child(2) { transform: rotate(8deg) translate(14px, 2px); }
.f-fan img:nth-child(3) { transform: rotate(-1deg); }
.f-empty-foot { width: 100%; max-width: 340px; }
.f-empty .f-msg { margin: 0 0 10px; }
.f-empty .btn { width: 100%; border-radius: 16px; font-weight: 600; box-shadow: 0 6px 18px rgba(240, 145, 30, .35); }
.f-tel { margin-top: 14px; font-size: .85rem; color: var(--muted); }
.f-tel a { color: var(--f-accent); font-weight: 600; text-decoration: none; }

/* Floating bar at the bottom */
.f-dock { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 10; margin: 8px 8px calc(8px + env(safe-area-inset-bottom)); padding: 8px 10px 10px; border-radius: 24px; background: rgba(255, 255, 255, .985); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: 0 8px 30px rgba(20, 24, 30, .18), 0 0 0 .5px rgba(0, 0, 0, .08); }
.f-tray { display: flex; }
.f-tray:empty { display: none; }
/* Phone: the formats as a grid, three per row; scrolls inside the dock when there are many */
.f-scroll { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 6px; flex: 1 1 auto; min-width: 0; max-height: 42dvh; overflow-y: auto; scrollbar-width: none; padding: 12px 2px 4px; -webkit-overflow-scrolling: touch; }
.f-scroll::-webkit-scrollbar { display: none; }
.f-cover, .f-more { min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: center; line-height: 1.2; cursor: pointer; transition: transform .14s ease-out; }
.f-cover:active, .f-more:active { transform: scale(.95); }
.f-more { position: sticky; right: 0; z-index: 2; flex-basis: 104px; padding-left: 8px; color: var(--muted); background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 8px); }
.f-pile { position: relative; display: block; width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 10px; background: var(--f-soft); transition: transform .14s ease-out; }
.f-cover.filled .f-pile { background: none; }
.f-print { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; border: 2px solid #fff; border-radius: 5px; background: #e9ebee; box-shadow: 0 1px 5px rgba(20, 24, 30, .35); }
span.f-print { display: block; }
.f-print-1 { transform: rotate(-7deg) translate(-1px, 1px); }
.f-print-2 { transform: rotate(7deg) translate(1px, 1px); }
.f-count { position: absolute; top: -8px; right: -8px; z-index: 1; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--ink); color: #fff; border: 1.5px solid #fff; font-size: .8rem; font-weight: 700; line-height: 21px; text-align: center; }
.f-plus { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.f-plus b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--ink); font-size: 1.25rem; font-weight: 500; line-height: 1; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.f-name { display: flex; justify-content: center; align-items: center; gap: 5px; font-size: .95rem; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.f-name .f-dot { width: 7px; height: 7px; border: 0; box-shadow: none; }
.f-cover small { display: block; margin-top: 2px; font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-more-box { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 5px; border: 1.5px dashed #a4a8ae; border-radius: 12px; color: var(--ink); background: rgba(255, 255, 255, .7); font-size: 1.6rem; font-weight: 300; line-height: 1; transition: background .14s, border-color .14s, transform .14s ease-out; }
.f-more.target .f-more-box { border-color: var(--f-accent); border-width: 2px; background: var(--brand-soft); color: var(--f-accent); animation: f-pop .18s ease-out; }
.f-more-name { display: block; font-size: .8rem; font-weight: 600; color: var(--f-accent); white-space: nowrap; }
.f-bump .f-pile { animation: f-bump .35s ease-out .3s; }
@keyframes f-bump { 40% { transform: scale(1.14); } }

/* The row keeps its height, so the photos never jump while selecting */
.f-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; margin-top: 2px; }
.f-tray:not(:empty) + .f-row { margin-top: 12px; }
.f-row-hint { flex: 1; padding-left: 6px; color: var(--muted); font-size: .95rem; }
.f-all-bar { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--brand-soft); color: var(--f-accent); font-size: .95rem; font-weight: 600; }
.f-row-count { flex: 1; text-align: center; font-size: 1rem; font-weight: 600; }
.f-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--f-soft); color: var(--ink); }
.f-icon svg { width: 20px; height: 20px; }
.f-cart { flex: 1; justify-content: space-between; gap: 10px; min-height: 52px; padding: 6px 16px; border-radius: 16px; line-height: 1.2; text-align: left; font-weight: 600; }
.f-cart-text { display: flex; flex-direction: column; min-width: 0; }
.f-cart-text small { font-size: .66rem; font-weight: 400; opacity: .85; }
.f-cart-sum { flex: none; font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; }

/* Undo */
.f-undo { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: rgba(31, 41, 51, .92); color: #fff; font-size: .9rem; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); animation: f-rise .2s ease-out; }
.f-undo svg { width: 15px; height: 15px; color: var(--brand); }
@keyframes f-rise { from { opacity: 0; transform: translate(-50%, 8px); } }
/* The round + (phone): floats above the dock, bottom right, like the main action in a phone app */
.f-fab { position: absolute; right: 4px; bottom: calc(100% + 14px); display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: var(--brand); color: #1d1405; box-shadow: 0 6px 20px rgba(240, 145, 30, .45), 0 2px 6px rgba(0, 0, 0, .15); animation: f-pop .2s ease-out; -webkit-tap-highlight-color: transparent; }
.f-fab svg { width: 28px; height: 28px; }
.f-fab:active { transform: scale(.93); }
.f-fab:disabled { background: #e3e5e8; color: #a3a8ae; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); cursor: default; }
.f-fab:disabled:active { transform: none; }
/* No box at the bottom while there is nothing to show in it */
.f-dock.f-dock-empty { padding: 0; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.f-dock.f-dock-empty .f-row { min-height: 0; margin: 0; }
@keyframes f-pop { from { opacity: 0; transform: scale(.6); } }
.f-add svg { width: 24px; height: 24px; vertical-align: middle; }

/* Sheets */
.f-backdrop { position: fixed; inset: 0; z-index: 40; padding: 0; border: 0; background: rgba(20, 24, 30, .4); cursor: default; touch-action: none; }
.f-open .f-backdrop { animation: f-fade .22s ease-out; }
@keyframes f-fade { from { opacity: 0; } }
.f-sheet { position: fixed; bottom: 0; z-index: 50; display: flex; flex-direction: column; max-height: 86dvh; overflow: hidden; padding-bottom: env(safe-area-inset-bottom); border-radius: 20px 20px 0 0; background: #fff; color: var(--ink); font-family: var(--f-font); -webkit-font-smoothing: antialiased; box-shadow: 0 -8px 30px rgba(20, 24, 30, .2); overscroll-behavior: contain; }
.f-sheet:focus { outline: 0; }
.f-open .f-sheet { animation: f-slide .24s cubic-bezier(.2, .8, .3, 1); }
@keyframes f-slide { from { transform: translateY(60px); opacity: 0; } }
.f-grab { flex: none; width: 36px; height: 5px; margin: 6px auto 0; border-radius: 3px; background: #d7d9dd; }
.f-sheet-nav { flex: none; display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px; align-items: center; min-height: 50px; padding: 0 4px; }
.f-sheet-nav h2 { font-family: inherit; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; text-align: center; line-height: 1.2; }
.f-sheet-nav .f-icon { margin-left: 4px; background: none; color: var(--err); }
.f-sheet-nav .f-text-btn { padding: 0 10px; color: var(--f-accent); }
.f-sheet-nav [data-cancel] { justify-self: start; }
.f-sheet-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 4px 16px 12px; overscroll-behavior: contain; }
.f-sheet-body > * { flex: none; }
/* Spare room, as with few formats, goes to the formats instead of leaving a gap */
.f-sheet-body > .f-papers { flex: 1 0 auto; }

/* The product switch: Kim missed the grey one, so it is coloured and the choice stands out */
.f-products { display: flex; gap: 3px; padding: 4px; margin-bottom: 12px; border-radius: 14px; background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px rgba(168, 91, 6, .35); }
.f-products button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 2px; border: 0; border-radius: 10px; background: none; color: var(--f-accent); font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .12s; }
.f-products button[aria-pressed="true"] { background: var(--brand); color: #1d1405; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.f-seg { display: flex; gap: 2px; padding: 3px; margin-bottom: 12px; border-radius: 12px; background: var(--f-soft); }
.f-seg button { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 0 4px; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: .9rem; font-weight: 500; transition: background .12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-seg button[aria-pressed="true"] { background: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .16); }

/* Few print formats, drawn to scale */
.f-papers { display: flex; justify-content: space-between; align-items: flex-end; gap: 4px; min-height: 196px; padding: 14px 8px 10px; margin-bottom: 12px; overflow-x: auto; border-radius: 14px; background: var(--f-soft); }
.f-paper { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 44px; padding: 0; border: 0; background: none; color: var(--ink); line-height: 1.2; }
.f-print-size { display: block; border: 2px solid #fff; border-radius: 3px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(20, 24, 30, .2); transition: box-shadow .12s; }
.f-print-size img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .4; transition: opacity .12s; }
.f-paper[aria-pressed="true"] .f-print-size { box-shadow: 0 0 0 3px var(--brand), 0 4px 12px rgba(20, 24, 30, .25); }
.f-paper[aria-pressed="true"] .f-print-size img { opacity: 1; }
.f-paper-name { font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.f-paper[aria-pressed="true"] .f-paper-name { font-weight: 700; }
.f-paper-name small { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; }

/* Many formats: a list with size and price, the common ones first */
.f-sizes { display: flex; flex-direction: column; gap: 2px; padding: 4px; margin-bottom: 12px; border-radius: 14px; background: var(--f-soft); }
.f-size { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 48px; padding: 4px 12px 4px 8px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; font-size: .95rem; line-height: 1.25; }
.f-size[aria-pressed="true"] { background: #fff; font-weight: 600; box-shadow: 0 0 0 2px var(--brand), 0 1px 4px rgba(0, 0, 0, .12); }
.f-size-mini { display: grid; place-items: center; width: 36px; height: 40px; }
.f-size-mini .f-print-size { background: #d9dce0; border-width: 1.5px; }
.f-size[aria-pressed="true"] .f-size-mini .f-print-size { background: var(--brand); }
.f-size-price { color: var(--muted); font-size: .875rem; font-weight: 500; white-space: nowrap; }
.f-size[aria-pressed="true"] .f-size-price { color: var(--ink); }
.f-sizes-sep { height: 1px; margin: 4px 10px; background: #d9dce0; }
.f-more-sizes { min-height: 44px; border: 0; border-radius: 10px; background: none; color: var(--f-accent); font-size: .95rem; font-weight: 600; }

/* Many canvas sizes: short side, then long side */
.f-two { padding: 10px 10px 12px; margin-bottom: 12px; border-radius: 14px; background: var(--f-soft); }
.f-two-label { margin: 0 2px 6px; color: var(--muted); font-size: .8rem; }
.f-two-label + .f-chips { margin-bottom: 12px; }
.f-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px; }
.f-chip { min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: #fff; color: var(--ink); font-size: .95rem; font-weight: 500; box-shadow: 0 0 0 1px var(--line); }
.f-chip[aria-pressed="true"] { background: var(--brand); color: #1d1405; font-weight: 700; box-shadow: none; }
.f-two-sum { display: flex; justify-content: space-between; gap: 12px; margin: 2px 2px 0; font-size: .95rem; font-weight: 600; }
.f-two-sum span:last-child { white-space: nowrap; }

.f-stepper { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; font-size: 1rem; }
.f-stepper > div { display: flex; align-items: center; gap: 4px; }
.f-stepper output { min-width: 32px; text-align: center; font-weight: 600; }
.f-stepper .f-icon { font-size: 1.3rem; line-height: 1; }
.f-stepper .f-icon[disabled] { color: #a9acb0; cursor: default; }
.f-sheet-step { flex: none; padding: 0 16px 4px; }
.f-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding-bottom: 12px; }
.f-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; background: var(--f-soft); overflow: hidden; }
.f-thumb-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.f-thumb-open img { display: block; width: 100%; height: 100%; object-fit: cover; }
.f-thumb-out { position: absolute; top: 0; right: 0; display: flex; justify-content: flex-end; align-items: flex-start; width: 44px; height: 44px; padding: 5px; border: 0; background: none; }
.f-thumb-out span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font-size: .9rem; line-height: 1; }
.f-sheet-foot { position: relative; flex: none; padding: 12px 16px 24px; border-top: 1px solid var(--line); }
.f-korb-head { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 12px; }
.f-korb-head .f-stepper { min-height: 44px; }
.f-korb-head + .f-sheet-body { padding: 0 16px 16px; }
.f-korb-head + .f-sheet-body .f-thumbs { padding-bottom: 0; }
.f-format-line { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 14px 8px 12px; border: 0; border-radius: 14px; background: var(--f-soft); color: var(--ink); text-align: left; }
.f-mini { flex: none; display: grid; place-items: center; width: 40px; height: 48px; }
.f-mini .f-print-size img { opacity: 1; }
.f-format-text { flex: 1; min-width: 0; line-height: 1.25; }
.f-format-text b { display: block; font-weight: 600; }
.f-format-text small { display: block; color: var(--muted); font-size: .8125rem; }
.f-format-change { flex: none; color: var(--f-accent); font-weight: 600; }
.f-no-photos { padding: 24px 0; color: var(--muted); text-align: center; }
.f-new-ok { width: 100%; justify-content: space-between; gap: 12px; min-height: 60px; padding: 6px 18px; border-radius: 16px; font-weight: 600; text-align: left; }
.f-foot-sum { line-height: 1.2; text-align: right; }
.f-foot-sum b { display: block; font-size: 1.125rem; font-weight: 700; }
.f-foot-sum small { font-size: .75rem; font-weight: 400; }
.f-action { padding: 20px 16px calc(10px + env(safe-area-inset-bottom)); text-align: center; }
.f-action h2 { font-family: inherit; font-size: 1.0625rem; font-weight: 600; margin-bottom: 16px; }
.f-action .btn { width: 100%; margin-bottom: 8px; border-radius: 16px; font-weight: 600; }
.f-action .btn.ghost { border: 0; background: var(--f-soft); }
.f-action .btn.danger { border: 0; background: var(--f-soft); color: var(--err); }
.f-action .f-text-btn { width: 100%; color: var(--f-accent); }
.f-back { justify-self: start; display: inline-flex; align-items: center; gap: 2px; padding-left: 4px; }
.f-back svg { width: 20px; height: 20px; }
.f-page-in { animation: f-page-in .2s ease-out; }
@keyframes f-page-in { from { transform: translateX(28px); opacity: 0; } }

/* Full screen: buttons, arrow keys and Esc. No swiping. */
.f-viewer { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: #000; color: #fff; font-family: var(--f-font); touch-action: pinch-zoom; overscroll-behavior: contain; -webkit-user-select: none; user-select: none; animation: f-fade .18s ease-out; }
.f-viewer:focus { outline: 0; }
.f-viewer-bar { flex: none; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; min-height: 56px; padding: env(safe-area-inset-top) 8px 0; text-align: center; }
.f-viewer-bar b { font-weight: 600; }
.f-viewer-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; }
.f-viewer-btn svg { width: 22px; height: 22px; }
.f-viewer-stage { position: relative; flex: 1; min-height: 0; }
.f-viewer-stage img { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 16px - env(safe-area-inset-bottom)); object-fit: contain; }
.f-viewer-stage .f-ph { position: absolute; inset: 0 0 16px; background: none; color: #555; }
.f-viewer-prev, .f-viewer-next { position: absolute; top: 50%; translate: 0 -50%; }
.f-viewer-prev { left: 12px; }
.f-viewer-next { right: 12px; }
.flyer { position: fixed; z-index: 60; border: 2px solid #fff; border-radius: 5px; object-fit: cover; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }

/* Everything below follows the available width only, so the device toolbar switches layouts live */
.f-desk { display: none; }
@container (min-width: 480px) { .f-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 680px) { .f-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Desktop: the phone layout in a centred column of 1000 px (design option A, Felix 2026-11-14). The round +,
   the formats and the cart bar sit at the edge of that column, not at the edge of the window. */
@container (min-width: 860px) {
  .f-phone { display: none; }
  .f-desk { display: inline; }
  /* "More photos" stays the icon, as on the phone */
  .f-add .f-phone { display: inline; }
  .f-add .f-desk { display: none; }

  .f-top, .f-body { padding-inline: max(16px, calc((100% - 1000px) / 2)); }
  .f-top { grid-template-columns: 200px minmax(0, 1fr) 200px; min-height: 64px; }
  .f-title strong { font-size: 1.25rem; }
  .f-top [data-all], .f-top [data-none] { padding: 0 18px; }
  .f-add { justify-self: end; }
  .f-load { top: 62px; }

  .f-photos { padding-top: 8px; }
  .f-msg { margin: 0 0 12px; }
  .f-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .f-tile, .f-add-card { border-radius: 8px; }

  /* Formats as bigger cards, "Zum Warenkorb" below them as on the phone */
  .f-dock { margin-inline: 0; padding: 12px 16px 16px; }
  .f-scroll { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; max-height: 36vh; padding: 12px 2px 4px; }
  .f-cover { padding: 18px 10px 14px; border-radius: 14px; }
  .f-pile { width: 112px; height: 112px; margin-bottom: 12px; }
  .f-name { font-size: 1.05rem; }
  .f-cover small { font-size: .82rem; }
  .f-cover-price { display: none; }
  .f-tray:not(:empty) + .f-row { margin-top: 14px; }
  .f-cart { min-height: 60px; }

  .f-empty { justify-content: center; gap: 20px; margin: 16px; padding: 40px 20px; border: 2px dashed var(--line); border-radius: 16px; }
  .f-drop-hint { display: block; margin-top: 10px; color: var(--muted); font-size: .9rem; }
  .f-tel { margin-top: 18px; }
}

/* A fixed height while choosing, so the sheet does not jump between products. With photos it grows with them. */
.f-sheet.f-new { height: 560px; }
.f-sheet.wide.f-new { height: 600px; }
.f-sheet.f-change { height: 416px; }
.f-sheet.f-change.f-list { height: 560px; }
.f-sheet.wide.f-change { height: 472px; }
.f-sheet.wide.f-change.f-list { height: 600px; }
.f-sheet.f-change .f-sheet-body { padding-bottom: 24px; }
.f-sheet.wide { top: 50%; bottom: auto; translate: 0 -50%; max-height: min(86dvh, 760px); overflow: hidden; border-radius: 20px; box-shadow: 0 20px 60px rgba(20, 24, 30, .3); }
.f-sheet.wide .f-papers { min-height: 240px; gap: 6px; padding: 16px 12px 12px; }
.f-sheet.wide .f-thumbs { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.f-sheet.wide .f-korb-head { padding: 4px 20px 12px; }
.f-sheet.wide .f-korb-head + .f-sheet-body { padding: 0 20px 16px; }
.f-sheet.wide .f-sheet-body { padding: 4px 20px 12px; }
.f-sheet.wide .f-sheet-step { padding: 0 20px 4px; }
.f-sheet.wide .f-sheet-foot { padding: 12px 20px 24px; }
.f-sheet.wide .f-grab { display: none; }
.f-sheet.wide .f-sheet-nav { padding-top: 6px; }

/* Only with a real mouse: a touch screen would keep these states stuck after a tap */
@media (hover: hover) and (pointer: fine) {
  .f-tile:hover img { filter: brightness(.92); }
  .f-tile:not([aria-pressed="true"]):hover .f-check { display: grid; background: rgba(255, 255, 255, .7); color: transparent; }
  .f-top .f-text-btn:hover::before, .f-icon:hover { background: #e4e6e9; }
  .f-seg button:not([aria-pressed="true"]):hover { background: #e4e6e9; }
  .f-products button:not([aria-pressed="true"]):hover { background: rgba(251, 160, 50, .22); }
  .f-paper:not([aria-pressed="true"]):hover .f-print-size img { opacity: .75; }
  .f-size:not([aria-pressed="true"]):hover, .f-more-sizes:hover { background: #e4e6e9; }
  .f-chip:not([aria-pressed="true"]):hover { background: #f7f7f8; }
  .f-format-line:hover { background: #e4e6e9; }
  .f-viewer-btn:hover { background: rgba(255, 255, 255, .28); }
  .f-sheet-nav .f-icon:hover { background: var(--err-soft); }
  @container (min-width: 860px) {
    .f-cover:hover, .f-more:hover { background: var(--f-soft); border-radius: 12px; }
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .f-bump .f-pile, .f-undo, .f-open .f-sheet, .f-open .f-backdrop, .f-tile[aria-pressed="true"] .f-check, .f-more.target .f-more-box, .f-page-in, .f-viewer, .f-fab { animation: none; }
}
