.stocking-rewards {
  position: absolute;
  z-index: 2;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 44px));
}
#stocking-trigger {
  display: grid;
  justify-items: center;
  padding: 0;
  width: 76px;
  min-height: 88px;
  border: 0;
  background: transparent;
  color: var(--ink);
}
#stocking-trigger img { display: block; width: 72px; height: 80px; object-fit: contain; filter: drop-shadow(0 3px 3px #46251928); }
#stocking-trigger span { margin-top: -3px; padding: 3px 8px; border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); font-size: 10px; font-weight: 800; }
#stocking-trigger:active img { opacity: .8; }
.stocking-panel {
  position: fixed;
  inset: auto max(20px, env(safe-area-inset-right)) max(170px, calc(env(safe-area-inset-bottom) + 142px)) auto;
  width: 336px;
  max-height: min(540px, calc(100dvh - 280px));
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 28px 20px 18px;
  border: 1px solid #d8cbb9;
  border-radius: 16px;
  background: #fff8e9;
  color: var(--ink);
  box-shadow: 0 12px 36px #26372b29, inset 0 0 0 4px #fffcf4;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.stocking-panel::backdrop { background: transparent; }
.stocking-envelope-seam { position: absolute; inset: 0 0 auto; height: 12px; border-bottom: 1px solid #d8cbb9; background: linear-gradient(175deg, #f1e5cf 49%, #fff8e9 51%); }
.stocking-close { position: absolute; top: 12px; right: 7px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #705d50; font-size: 25px; line-height: 1; }
.stocking-panel h2 { margin: 0 30px 12px 0; font-size: 21px; line-height: 1.25; letter-spacing: -.5px; }
.stocking-panel p { margin: 10px 0; }
.stocking-panel .stocking-eyebrow { margin-right: 28px; color: #796651; font-size: 12px; line-height: 1.45; font-weight: 600; }
.stocking-code-label { display: grid; gap: 6px; margin-top: 12px; color: #6b5c4d; font-size: 11px; }
.stocking-code { box-sizing: border-box; width: 100%; min-width: 0; padding: 11px 9px; border: 1px dashed #a38156; border-radius: 8px; background: #fffdf7; color: #752139; font-family: ui-monospace, monospace; font-size: 12px; font-weight: 700; }
.stocking-copy, .stocking-retry { width: 100%; min-height: 44px; margin: 6px 0; padding: 10px; border: 0; border-radius: 10px; background: #752139; color: #fff8e9; font-weight: 700; }
.stocking-copy:active, .stocking-retry:active { background: #551729; }
.stocking-copy-feedback { min-height: 0; color: #386048; font-size: 11px; }
.stocking-copy-feedback:empty { display: none; }
.stocking-countdown { display: grid; gap: 3px; padding: 12px 14px; border-radius: 12px; background: #7521390a; color: #752139; }
.stocking-countdown-label { font-size: 11px; font-weight: 700; }
.stocking-countdown-value { font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: .6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stocking-panel a { color: #752139; overflow-wrap: anywhere; }
@media (max-width: 1000px) {
  .stocking-rewards { right: max(12px, env(safe-area-inset-right)); }
  .stocking-panel { right: max(72px, calc(env(safe-area-inset-right) + 60px)); width: min(300px, calc(100vw - 88px)); max-height: calc(100dvh - 352px); padding: 25px 16px 15px; }
  .stocking-panel h2 { font-size: 19px; }
}
@media (max-height: 500px) and (min-width: 500px) {
  .stocking-rewards { left: auto; right: max(12px, env(safe-area-inset-right)); }
  .stocking-panel { top: 12px; bottom: auto; left: auto; right: max(12px, env(safe-area-inset-right)); width: min(340px, 48vw); max-height: calc(100dvh - 38px); }
}
@media (prefers-reduced-motion: no-preference) {
  .stocking-panel:popover-open { animation: stocking-envelope-in 180ms var(--ease); transform-origin: bottom right; }
  .stocking-rewards { animation: stocking-arrival 200ms var(--ease); }
  @keyframes stocking-envelope-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
  @keyframes stocking-arrival { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
