:root {
  --accent-dark: #ffcc52;
  --accent-2-dark: #5be3b4;
  --bg-dark: #0a0d16;
  --fg-dark: #eef2f9;
  --muted-dark: #8b96a7;
  --card-dark: #0f172a;
  --glass-dark: rgba(255,255,255,.08);
  --line-dark: rgba(255,255,255,.12);
  --line-strong-dark: rgba(255,255,255,.18);
  --header-bg-dark: rgba(10,13,22,.7);
  --header-bg2-dark: rgba(10,13,22,.2);
  --bg-grad-1-dark: rgba(91, 227, 180, .15);
  --bg-grad-2-dark: rgba(255, 204, 82, .16);
  --bg-grad-3-dark: #0a0d16;
  --bg-grad-4-dark: #0b0f1a;
  --overlay-dark: rgba(2,5,10,.7);

  --accent-light: #f5b942;
  --accent-2-light: #36b3a0;
  --bg-light: #f7f8fc;
  --fg-light: #0b0f1a;
  --muted-light: #4b5563;
  --card-light: #ffffff;
  --glass-light: rgba(15,23,42,.06);
  --line-light: rgba(15,23,42,.12);
  --line-strong-light: rgba(15,23,42,.18);
  --header-bg-light: rgba(248,250,252,.92);
  --header-bg2-light: rgba(248,250,252,.7);
  --bg-grad-1-light: rgba(255, 204, 82, .35);
  --bg-grad-2-light: rgba(91, 227, 180, .28);
  --bg-grad-3-light: #f7f8fc;
  --bg-grad-4-light: #eef1f7;
  --overlay-light: rgba(241,245,249,.78);

  --accent: var(--accent-dark);
  --accent-2: var(--accent-2-dark);
  --bg: var(--bg-dark);
  --fg: var(--fg-dark);
  --muted: var(--muted-dark);
  --card: var(--card-dark);
  --glass: var(--glass-dark);
  --line: var(--line-dark);
  --line-strong: var(--line-strong-dark);
  --header-bg: var(--header-bg-dark);
  --header-bg2: var(--header-bg2-dark);
  --bg-grad-1: var(--bg-grad-1-dark);
  --bg-grad-2: var(--bg-grad-2-dark);
  --bg-grad-3: var(--bg-grad-3-dark);
  --bg-grad-4: var(--bg-grad-4-dark);
  --overlay: var(--overlay-dark);
}
html[data-theme="light"] {
  --accent: var(--accent-light);
  --accent-2: var(--accent-2-light);
  --bg: var(--bg-light);
  --fg: var(--fg-light);
  --muted: var(--muted-light);
  --card: var(--card-light);
  --glass: var(--glass-light);
  --line: var(--line-light);
  --line-strong: var(--line-strong-light);
  --header-bg: var(--header-bg-light);
  --header-bg2: var(--header-bg2-light);
  --bg-grad-1: var(--bg-grad-1-light);
  --bg-grad-2: var(--bg-grad-2-light);
  --bg-grad-3: var(--bg-grad-3-light);
  --bg-grad-4: var(--bg-grad-4-light);
  --overlay: var(--overlay-light);
}
html[data-theme="dark"] {
  --accent: var(--accent-dark);
  --accent-2: var(--accent-2-dark);
  --bg: var(--bg-dark);
  --fg: var(--fg-dark);
  --muted: var(--muted-dark);
  --card: var(--card-dark);
  --glass: var(--glass-dark);
  --line: var(--line-dark);
  --line-strong: var(--line-strong-dark);
  --header-bg: var(--header-bg-dark);
  --header-bg2: var(--header-bg2-dark);
  --bg-grad-1: var(--bg-grad-1-dark);
  --bg-grad-2: var(--bg-grad-2-dark);
  --bg-grad-3: var(--bg-grad-3-dark);
  --bg-grad-4: var(--bg-grad-4-dark);
  --overlay: var(--overlay-dark);
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--fg);
  background-color: var(--bg);
  background:
    radial-gradient(60% 40% at 70% -10%, var(--bg-grad-1), transparent 60%),
    radial-gradient(60% 40% at 10% -20%, var(--bg-grad-2), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-3) 0%, var(--bg-grad-4) 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
html[data-theme="light"] body {
  background: var(--bg);
}
header { position: sticky; top:0; z-index: 20; display:flex; gap:12px; align-items:center; padding: 12px 16px; backdrop-filter: blur(8px); background: linear-gradient(to bottom, var(--header-bg), var(--header-bg2)); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: .4px; text-transform: none; }
.brand-logo {
  height: 26px;
  width: auto;
  max-width: min(40vw, 220px);
  object-fit: contain;
  display: block;
}
.icon-img { width: 22px; height: 22px; display:block; }
.icon-mask {
  width: 20px;
  height: 20px;
  display: block;
  background: var(--accent);
  -webkit-mask: var(--icon) center / 20px 20px no-repeat;
  mask: var(--icon) center / 20px 20px no-repeat;
}
.icon-menu { --icon: url('/public/icons/ui-menu-line.svg'); }
.icon-bell { --icon: url('/public/icons/ui-bell-line.svg'); }
.icon-camera { --icon: url('/public/icons/ui-camera-line.svg'); }
.icon-shop { --icon: url('/public/icons/ui-shop-line.svg'); }
.icon-btn { background: var(--glass); border: 1px solid var(--line-strong); color: var(--fg); border-radius: 10px; padding: 6px 10px; cursor:pointer; }
.icon-only {
  width: 44px;
  height: 34px;
  min-width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.badge-dot {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
/* Shop specific */
.line { display:grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.line .controls { justify-content: flex-end; }
.stack.mini { width: 160px; height: 120px; }
.stack.mini .layer { border-radius: 12px; }
.stack.mini .title { font-size: 14px; }
.controls { display:flex; align-items:center; gap: 10px; }
.round { width: 36px; height: 36px; border-radius: 999px; display:inline-flex; align-items:center; justify-content:center; background: #fff; color:#111; border: 1px solid rgba(0,0,0,.1); box-shadow: 0 6px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.6); cursor:pointer; }
.round .face { font-weight: 900; }
.qty { width: 64px; text-align:center; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(0,0,0,.1); background: #fff; color: #111; font-weight: 800; transform-origin: 50% 50%; backface-visibility: hidden; }
.qty.flip { animation: hFlip .28s ease; }
.line .line-sum { font-weight: 800; opacity: .9; color: var(--fg); }

/* Full-page chip area for shop */
.shop-space { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.shop-space .chip { pointer-events: auto; }
.shop-space, .shop-space .chip { touch-action: none; }

/* Receipt list */
.receipt-row { display:flex; align-items:center; justify-content: space-between; gap: 8px; }
.receipt-row .l { color: var(--muted); }
.receipt-row .r { font-weight: 800; }
.divider { height: 1px; background: var(--line); margin: 6px 0; }
.divider.white { background: var(--line-strong); height: 1px; }
.cta.full { display:block; width: 100%; }
/* controls */
.pill { background: var(--glass); border: 1px solid var(--line-strong); color: var(--fg); border-radius: 999px; padding: 6px 12px; cursor:pointer; }
/* Theme toggle follows accent language from the active tenant theme */
#themeToggle {
  min-width: 44px;
  width: 44px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--glass);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}
#themeToggle .theme-glyph {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
#themeToggle .theme-glyph svg {
  width: 20px;
  height: 20px;
  display: block;
  color: inherit;
}
html[data-theme="dark"] #themeToggle .theme-glyph {
  color: color-mix(in srgb, var(--accent) 72%, #fff 28%);
}
#themeToggle .theme-glyph .stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#themeToggle .theme-glyph .fill {
  fill: currentColor;
}
#themeToggle:hover { filter: brightness(1.05); }
#themeToggle:active { transform: translateY(1px); }
/* Prevent iOS double-tap zoom on interactive controls */
button, .pill, .cta, .key, .summary-item .count-badge {
  font-size: 16px; /* iOS avoids double-tap zoom >=16px */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* Avoid iOS zoom on form fields */
input, select, textarea { font-size: 16px; -webkit-user-select: text; user-select: text; }
.btn-accent { background: var(--accent); color: #111; border: none; box-shadow: 0 8px 22px rgba(255,204,82,.35); font-weight: 900; }
.btn-accent:hover { filter: brightness(0.98); }
.select-accent { background: var(--accent); color: #111; border: none; box-shadow: 0 6px 18px rgba(255,204,82,.28); font-weight: 800; }
.select-accent:focus { outline: none; box-shadow: 0 0 0 2px rgba(255,204,82,.45); }
.spacer { flex: 1 1 auto; min-width: 0; }
main { height: calc(100dvh - 56px); display:flex; flex-direction: column; }
#stage { flex: 1; position: relative; display:flex; flex-direction: column; align-items:center; justify-content:flex-start; padding-top: 6px; gap: 6px; }
.tray-summary { display:flex; gap: 8px; align-items:center; width: min(820px, calc(100vw - 16px)); padding: 0 6px; overflow-x: auto; user-select: none; touch-action: pan-x; }
.tray-summary .label { color: var(--muted); margin-right: 6px; white-space: nowrap; font-size: 12px; }
.summary-item { display:flex; align-items:center; gap: 8px; padding: 4px 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); white-space: nowrap; font-weight: 700; cursor: grab; transition: transform .18s ease; font-size: 13px; }
.summary-item .count-badge { position: relative; display:inline-flex; align-items:center; justify-content:center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #111; font-weight: 900; box-shadow: 0 6px 18px rgba(255,204,82,.35); backface-visibility: hidden; transform-style: preserve-3d; }
.summary-item .count-badge.flip { animation: flipY .5s ease; }
@keyframes flipY { 0% { transform: rotateY(0deg) } 49% { transform: rotateY(90deg) } 51% { transform: rotateY(270deg) } 100% { transform: rotateY(360deg) } }
.summary-item .name { opacity: .95; }
/* legacy bump removed; now on badge */
.summary-item.dragging { cursor: grabbing; background: var(--glass); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
@keyframes bump { 0% { opacity: 0; transform: translateY(-6px) scale(.9)} 25% { opacity:1; transform: translateY(-10px) scale(1)} 100% { opacity:0; transform: translateY(-16px) scale(1.1)} }

/* Tray / Ausgabe oben */
.tray-zone { position: relative; min-height: 280px; width: min(820px, calc(100vw - 16px)); border-radius: 20px; border: 1px dashed var(--line); background: var(--glass); display:flex; align-items:center; justify-content:center; padding: 12px; }
.tray-pile { position: relative; width: 100%; height: 260px; pointer-events: none; overflow: visible; }
.tray-zone, .tray-pile { touch-action: none; }
.tray-count { position: absolute; bottom: 10px; left: 12px; background: var(--accent); color: #111; padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.tray-controls { display:flex; gap: 10px; align-items:center; justify-content:center; width: min(820px, calc(100vw - 16px)); }
.tray-controls { position: relative; z-index: 5; pointer-events: auto; }
.tray-controls /* controls */
.pill { min-width: auto; padding: 6px 10px; }
.tray-controls .cta { padding: 8px 12px; }
.cta {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 84%, #fff 16%) 0%,
    color-mix(in srgb, var(--accent-2) 78%, #fff 22%) 100%
  );
  color: #111;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.38);
}
.cta[disabled]{ opacity: .58; filter: saturate(.58); cursor:not-allowed; }
/* Subtle breathing for give button; base scale via --scale */
.cta.pulse { animation: btnPulse 2.6s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes btnPulse { 0%,100% { transform: scale(var(--scale, 1)); } 50% { transform: scale(calc(var(--scale, 1) + 0.02)); } }
/* QR fade hint in last second */
#qr.fade { opacity:.3; transition: opacity .35s ease; }
/* Subtle breathing for give button; base scale via --scale */
.cta.pulse { animation: btnPulse 2.6s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes btnPulse { 0%,100% { transform: scale(var(--scale, 1)); } 50% { transform: scale(calc(var(--scale, 1) + 0.02)); } }

/* Dock unten mit Carousel */
#dock {
  position: relative;
  padding: 16px 0 calc(96px + env(safe-area-inset-bottom, 0px));
  overflow: visible;
}
.carousel {
  display:flex;
  gap: 13px;
  align-items: flex-end;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: visible;
  padding: 24px 16px 52px;
  scroll-snap-type: x proximity;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}
.carousel .stack { flex: 0 0 auto; }
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.stack { position: relative; width: 160px; height: 190px; perspective: 800px; cursor: grab; scroll-snap-align: start; touch-action: pan-x; user-select: none; }
.stack.has-name { margin-bottom: 31px; }
.stack .layer { position: absolute; inset: 0; border-radius: 14px; transform-origin: 50% 80%; border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.45); overflow: hidden; }
.stack .layer:nth-child(1){ background: var(--card); transform: translateY(8px) rotate(-2deg); opacity: .7; z-index: 1; }
.stack .layer:nth-child(2){ background: var(--card); transform: translateY(4px) rotate(1.2deg); opacity: .85; z-index: 2; }
.stack .layer:nth-child(3){ background: transparent; transform: translateY(0px) rotate(-.5deg); opacity: 1; z-index: 3; }
.stack .media { display: none; }
.media-bg { position:absolute; inset:0; background-size: cover; background-position: center; background-repeat: no-repeat; pointer-events: none; border-radius: 14px; }
/* In the wallet stacks show the entire motif without cropping and give it a light backdrop */
.stack .media-bg { background-size: contain; background-color: #fff; }
/* Chips in the tray can stay immersive */
.chip .media-bg { background-size: cover; }
.stack-name {
  position: absolute;
  top: calc(100% + 11px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 100%;
  padding: 0 6px;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(255,255,255,.12), 0 2px 4px rgba(0,0,0,.12);
  pointer-events: none;
}
.stack.voided .stack-name { opacity: .9; }
.stack .badge { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #111; padding: 4px 10px; border-radius: 999px; font-weight: 900; box-shadow: 0 8px 24px rgba(255,204,82,.35); text-shadow: 0 1px 0 rgba(255,255,255,.5), 0 2px 6px rgba(0,0,0,.2); backface-visibility: hidden; transform-style: preserve-3d; }
.stack .badge.flip { animation: flipX .5s ease; }
@keyframes flipX { 0% { transform: translateX(-50%) rotateX(0deg) } 49% { transform: translateX(-50%) rotateX(90deg) } 51% { transform: translateX(-50%) rotateX(270deg) } 100% { transform: translateX(-50%) rotateX(360deg) } }
.line .line-sum { transform-origin: 50% 50%; backface-visibility: hidden; }
@keyframes hFlip { 0% { transform: rotateY(0deg) } 49% { transform: rotateY(90deg) } 51% { transform: rotateY(270deg) } 100% { transform: rotateY(360deg) } }
.stack .badge.tick { animation: tick .5s ease; }
@keyframes tick { 0% { transform: translateX(-50%) scale(1.05); filter: brightness(1.05) } 50% { transform: translateX(-50%) scale(.95) } 100% { transform: translateX(-50%) scale(1) } }
.stack:active { cursor: grabbing; }

/* Drag ghost */
.ghost { position: fixed; width: 160px; height: 190px; border-radius: 14px; pointer-events: none; will-change: transform, opacity; box-shadow: 0 18px 60px rgba(0,0,0,.5); overflow: hidden; z-index: 50; transform: translate(0,0); }
.ghost .media, .ghost video, .ghost img { display: none !important; }
.ghost .media-bg {
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fff;
  border-radius: 14px;
}

/* physics chips inside tray */
.chip { position: absolute; width: 120px; height: 160px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); overflow: hidden; transform-origin: 50% 50%; }
.chip .media-bg { border-radius: 12px; background-size: contain; background-color: #fff; }

/* Number keypad modal */
.num-modal { background: var(--card); border: 1px solid var(--line); padding: 16px; border-radius: 14px; width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.num-title { font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.num-display {
  text-align: right;
  font-weight: 900;
  font-size: 28px;
  line-height: 1;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.num-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.key { background: var(--glass); border: 1px solid var(--line); border-radius: 8px; padding: 10px 0; font-weight: 800; color: var(--fg); box-shadow: 0 6px 20px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06); transform: translateZ(0); line-height: 1; }
.key:active { transform: translateY(1px) scale(.98); box-shadow: 0 3px 12px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04); }
.key.wide { grid-column: span 2; }
.key.del { background: linear-gradient(180deg, rgba(255,120,120,.18), rgba(255,255,255,.02)); }

/* keypad modal animations */
.num-modal.anim-in { animation: modalIn .24s cubic-bezier(.2,.8,.2,1) both; }
.num-modal.anim-out { animation: modalOut .18s cubic-bezier(.2,.8,.2,1) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes modalOut { from { opacity: 1; transform: none } to { opacity: 0; transform: translateY(6px) scale(.98) } }

/* Overlay / QR */
.overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(8px); display:flex; align-items:center; justify-content:center; z-index: 1000; }
.hidden { display: none; }
.modal { background: var(--card); border: 1px solid var(--line); padding: 18px; border-radius: 14px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal img { width: 260px; height: 260px; display: block; margin: 12px auto; background: #fff; border-radius: 10px; box-shadow: inset 0 0 0 6px rgba(255,204,82,.6), 0 10px 30px rgba(0,0,0,.25); }
.modal.large { width: 90vw; max-width: 720px; }
/* Scanner video */
.scan-video { width: 100%; max-height: 60vh; background: #000; border-radius: 0; display:block; margin-top: 8px; object-fit: cover; }

/* Fancy on/off switch */
.switch { position: relative; display:inline-block; width: 48px; height: 28px; }
.switch input { display:none; }
.switch .track { position:absolute; inset:0; background: var(--glass); border:1px solid var(--line); border-radius:999px; transition: all .22s ease; }
.switch .thumb { position:absolute; left:3px; top:3px; width:22px; height:22px; border-radius:50%; background: var(--fg); box-shadow: 0 2px 8px rgba(0,0,0,.35); transition: transform .22s ease; }
.switch input:checked + .track { background: linear-gradient(135deg,#34d399,#10b981); border-color: transparent; }
.switch input:checked + .track .thumb { transform: translateX(20px); }
.row { display:flex; gap: 8px; justify-content: space-between; }
input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); color: var(--fg); margin: 6px 0; font-size: 16px; }

/* Subtle enter motion */
.fade-in { animation: fadeIn .5s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px)} to { opacity:1; transform: none } }

/* Transfer modal layout */
.modal-title { margin: 0 0 8px; }
.transfer-intro { margin: 6px 0 10px; color: var(--muted); }
.transfer-intro .who { font-weight: 700; margin-bottom: 2px; color: var(--fg); }
.transfer-list { list-style: none; padding: 0; margin: 0; }
.transfer-list li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.transfer-list li:last-child { border-bottom: 0; }
.transfer-steps { margin: 12px 0 8px; display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.step .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); position: relative; }
.step.done .dot { border-color: transparent; background: linear-gradient(135deg,#34d399,#10b981); box-shadow: 0 8px 24px rgba(16,185,129,.35); }
.step .dot::after { content: ''; position: absolute; inset: 0; display: block; }
.step.done .dot::before { content: 'ok'; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-54%); font-weight: 900; font-size: 14px; color: #062; mix-blend-mode: normal; }
.step .text { color: var(--muted); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  header {
    gap: 8px;
    padding: 10px 12px;
  }
  .brand-logo {
    height: 25px;
    max-width: min(44vw, 240px);
  }
}

@media (max-width: 640px) {
  header {
    gap: 6px;
    padding: 8px 8px;
  }
  .icon-btn {
    width: 44px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .brand-logo {
    height: 22px;
    max-width: min(42vw, 220px);
  }
  .icon-img {
    width: 20px;
    height: 20px;
  }
  header.actions-reduced {
    position: sticky;
  }
  header.actions-reduced .brand-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 25px;
    max-width: min(58vw, 290px);
    z-index: 1;
    pointer-events: none;
  }
  header.actions-reduced > :not(.brand-logo) {
    position: relative;
    z-index: 2;
  }
  #dock {
    padding: 48px 0 calc(106px + env(safe-area-inset-bottom, 0px));
  }
  .carousel {
    padding-top: 20px;
    padding-bottom: 56px;
  }
}
