/* Merlin® 50 ingenieros: the page is the medicine box, standing on a pharmacy counter. */
@font-face { font-family: "Liberation Sans"; src: url("fonts/LiberationSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Liberation Sans"; src: url("fonts/LiberationSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("fonts/PermanentMarker.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ink: #16202e;
  --ink-2: #3b4658;
  --navy: #1b2a55;
  --blue: #1d4fb0;
  --blue-d: #163d88;
  --orange: #e8891c;
  --red: #b81f28;
  --paper: #f7f6f2;
  --paper-2: #ecebe5;
  --yellow: #f5e064;
  --marker: #1c2447;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --lift: 0 1px 1px rgb(22 32 46 / .2), 0 12px 26px -8px rgb(22 32 46 / .45);
  /* Desktop composes everything in a centred stage; the counter photo still fills the screen. */
  --stage: min(calc(100vw - 64px), clamp(680px, 60vw, 1080px));
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { background: #d9dcda; }
body {
  font-family: "Liberation Sans", Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  background: #d9dcda url("img/pharmacy-tall.webp") center bottom / cover no-repeat fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--yellow); color: var(--ink); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
img { display: block; max-width: 100%; }
h2, h3 { margin: 0; line-height: 1.15; }

/* ================= First screen: the box on the counter ================= */
.counter {
  position: relative;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom));
}
.claim {
  position: relative; z-index: 3;
  margin: 0; max-width: 17em;
  font-size: 22px; line-height: 1.18; letter-spacing: -.012em;
  text-wrap: balance;
}
.claim b { display: block; margin-top: 2px; font-size: 30px; letter-spacing: -.02em; }

.stage { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; justify-content: center; align-items: flex-end; padding-top: 14px; }
.box {
  --k: .3;
  position: relative;
  height: min(100%, 520px);
  aspect-ratio: 806 / 1426;
  translate: -4% 0;
  top: 0;
  transition: top .25s var(--ease);
}
/* The closed box is one big button; hovering lifts it off the counter a little. */
.box__lid { position: absolute; inset: 0; z-index: 1; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; }
.box:has(.box__lid:hover) { top: -6px; }
.box:has(.box__lid:hover) .box__shadow { opacity: .7; }
.box__shadow { /* contact shadow on the laminate, under the box */
  position: absolute; left: -4%; right: 2%; bottom: -1.5%; height: 7%;
  background: radial-gradient(50% 50% at 50% 50%, rgb(30 38 40 / .55), rgb(30 38 40 / 0));
  filter: blur(6px);
}
.box__img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(10px 4px 10px rgb(30 40 44 / .28)); transition: opacity .28s ease-out; }
.box__img--open, .box__img--front { opacity: 0; }
.box__img--front { clip-path: polygon(0 15.36%, 87.8% 15.92%, 100% 14.6%, 100% 100%, 0 100%); filter: none; }

/* Parody print laid on the photographed front face with a homography (app.js). */
.print { position: absolute; left: 0; top: 0; width: 806px; height: 1426px; transform-origin: 0 0; transform: scale(var(--k)); pointer-events: none; display: none; }
.js .print { display: block; }
.face { position: absolute; left: 0; top: 0; width: 700px; height: 1150px; transform-origin: 0 0; mix-blend-mode: multiply; }
.face--band { mix-blend-mode: normal; }
.face__lab { position: absolute; left: 44px; top: 58px; width: 200px; height: auto; opacity: .9; }
.face__route { position: absolute; left: 44px; top: 556px; margin: 0; font-size: 38px; line-height: 1.1; color: #4a505a; }
.face__route b { color: var(--navy); }
.coupon {
  position: absolute; left: 44px; top: 666px; width: 440px; margin: 0; padding: 16px 22px 18px;
  border: 3px dashed #7c838c; border-radius: 6px;
  display: grid; gap: 4px; color: #2b3240; font-size: 27px; line-height: 1.1;
}
.coupon b { display: block; font-size: 31px; line-height: 1.1; white-space: nowrap; color: var(--navy); letter-spacing: -.01em; }
.coupon__bars { display: block; height: 34px; margin: 4px 0 6px; width: 70%; background: repeating-linear-gradient(90deg, #2b3240 0 3px, transparent 3px 7px, #2b3240 7px 8px, transparent 8px 12px, #2b3240 12px 17px, transparent 17px 19px); }
.face__lot { position: absolute; left: 500px; top: 690px; margin: 0; font-size: 27px; line-height: 1.15; color: #555c66; }
.face__rx { position: absolute; left: 30px; top: 1060px; margin: 0; width: 700px; font-size: 27px; font-weight: 700; color: #fff; transform-origin: 0 0; transform: rotate(-23deg); white-space: nowrap; }
.marker { position: absolute; margin: 0; transition: opacity .25s; font-family: "Permanent Marker", "Liberation Sans", sans-serif; color: var(--marker); line-height: 1; opacity: .92; }
.marker--dose { left: 468px; top: 566px; font-size: 76px; transform: rotate(-9deg); white-space: nowrap; letter-spacing: .02em; }

/* What comes out of the box once it is open */
.peek { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; transition: transform 1s var(--ease), translate .25s var(--ease); }
.is-open .peek:hover, .is-open .peek:focus-visible { translate: 0 -5%; }
.is-open .peek:hover img { filter: drop-shadow(0 -2px 3px rgb(0 0 0 / .18)) drop-shadow(0 10px 14px rgb(0 0 0 / .22)); }
/* "toca": the pharmacist's marker again, circled on whatever you can pull out. */
.tap {
  position: absolute; pointer-events: none; white-space: nowrap; line-height: 1;
  font-family: "Permanent Marker", "Liberation Sans", sans-serif; color: var(--marker); font-size: max(15px, calc(var(--k) * 44px));
  padding: .2em .45em .1em; border: 1.5px solid currentColor; border-radius: 50% 46% 52% 44% / 56% 50% 48% 52%;
}
.peek .tap { opacity: 0; transition: opacity .35s ease-out 1s; }
.is-open .peek .tap { opacity: .95; }
.peek--blister .tap { left: 34%; top: 7%; transform: rotate(-6deg); background: rgb(247 246 242 / .72); }
.peek--leaflet .tap { right: -22%; top: 6%; transform: rotate(9deg); background: rgb(247 246 242 / .72); }
.peek img { width: 100%; height: auto; filter: drop-shadow(0 -2px 3px rgb(0 0 0 / .18)); }
.peek--blister { left: 9%; top: 22%; width: 58%; transform: rotate(-3deg); }
.peek--leaflet { left: 50%; top: 22%; width: 40%; transform: rotate(4deg); }
.is-open .box__img--open, .is-open .box__img--front { opacity: 1; }
.is-open .box__img--closed { opacity: 0; pointer-events: none; }
.is-open .peek--blister { transform: translateY(-46%) rotate(-7deg); transition-delay: .15s; }
.is-open .peek--leaflet { transform: translateY(-58%) translateX(12%) rotate(11deg); transition-delay: .3s; }
.is-open .marker { opacity: 0; }
.box.is-hop { animation: hop .45s var(--ease); }
@keyframes hop { 0% { transform: none; } 30% { transform: translateY(-3%) rotate(-1.4deg); } 60% { transform: translateY(.4%) rotate(.4deg); } 100% { transform: none; } }

/* What to do: a marker note, like the scribbles on the box. The box, blister and leaflet are the controls. */
.dock {
  position: relative; z-index: 4; margin: 0; padding: 12px 0 4px 4px; display: flex; align-items: center; gap: 8px;
  font-family: "Permanent Marker", "Liberation Sans", sans-serif; font-size: 18px; line-height: 1.15; color: var(--marker); transform: rotate(-2deg); max-width: 60%;
}
.dock__arrow { flex: none; width: 44px; height: 24px; fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; transform: rotate(120deg); }
.dock__open, [data-state=open] .dock__closed { display: none; }
[data-state=open] .dock__open { display: inline; }
[data-state=open] .dock { max-width: 50%; }
[data-state=open] .dock__arrow { display: none; } /* on the phone the "toca" marks on the objects do the pointing */
.ycard-peek {
  position: absolute; z-index: 5; right: -18px; bottom: 58px; width: 204px; min-height: 136px; padding: 16px 36px 46px 18px;
  background: var(--yellow) url("img/yellow-tile.webp"); color: var(--ink); text-decoration: none;
  box-shadow: 0 2px 3px rgb(40 36 10 / .25), 0 16px 26px -10px rgb(40 36 10 / .45);
  transform: rotate(-8deg); transition: transform .3s var(--ease);
  display: flex; flex-direction: column; justify-content: flex-start;
}
.ycard-peek::after { /* the printed form lines */
  content: ""; position: absolute; left: 18px; right: 30px; bottom: 16px; height: 22px;
  border-top: 2px solid rgb(22 32 46 / .55); border-bottom: 2px solid rgb(22 32 46 / .55);
}
.ycard-peek:hover { transform: rotate(-5deg) translateY(-6px); }
.ycard-peek__t { font-weight: 700; font-size: 21px; line-height: 1.05; letter-spacing: -.01em; }
.ycard-peek__s { font-size: 16px; margin-top: 4px; white-space: nowrap; }

.fine { position: relative; z-index: 4; margin: 0; display: flex; flex-wrap: wrap; gap: 0 14px; font-size: 15px; color: var(--ink-2); max-width: 56%; }
.fine a { font-weight: 700; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.fine span { flex-basis: 100%; font-size: 14px; }

/* ================= Views: blister, leaflet, yellow card ================= */
.view { display: none; }
.js .view { position: fixed; inset: 0; z-index: 20; flex-direction: column; overflow: hidden; }
.js .view.is-open { display: flex; animation: viewin .35s var(--ease); }
@keyframes viewin { from { opacity: 0; } to { opacity: 1; } }
.js .view::before { /* the same counter, out of focus: the object is now under your nose */
  content: ""; position: absolute; inset: -40px; z-index: -1;
  background: #cfd3d1 url("img/pharmacy-tall.webp") center / cover;
  filter: blur(16px) saturate(.8) brightness(1.02);
}
.view__bar { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 8px; }
.view__bar h2 { font-size: 22px; letter-spacing: -.01em; }
.tally { margin: 2px 0 0; font-size: 16px; color: var(--ink-2); }
.close { min-height: 46px; padding: 0 14px; border: 0; cursor: pointer; font-weight: 700; font-size: 16px; background: var(--paper) url("img/paper-tile.webp"); box-shadow: 0 1px 2px rgb(22 32 46 / .3); border-radius: 2px; white-space: nowrap; }

/* ---------- Blister ---------- */
.bstage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 16px max(14px, env(safe-area-inset-bottom)); }
.blister { position: relative; flex: none; width: min(100%, calc((100svh - 300px) * .633), 440px); aspect-ratio: 660 / 1042; filter: drop-shadow(8px 14px 12px rgb(20 28 30 / .35)); }
.blister__img { width: 100%; height: 100%; }
.blister__day { position: absolute; left: 1.2%; top: calc(4% + var(--r) * 19.4%); margin: 0; font-size: 12px; font-weight: 700; color: rgb(40 44 50 / .78); writing-mode: vertical-rl; transform: rotate(180deg); mix-blend-mode: multiply; }
.cell { position: absolute; width: 43%; height: 17%; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 40% / 50%; }
.cell__empty { position: absolute; inset: 0; border-radius: inherit; background: url("img/blister.webp") no-repeat; opacity: 0; transition: opacity .12s; }
.cell.is-popped { cursor: default; }
.cell.is-popped .cell__empty { opacity: 1; filter: brightness(.86) contrast(1.12); transform: scale(.965); box-shadow: inset 0 0 18px rgb(40 44 48 / .35); }
.cell:not(.is-popped):hover { background: radial-gradient(closest-side, rgb(255 255 255 / .3), transparent); }
.doses { display: none; }
.slip {
  position: relative; width: min(100%, 440px); flex: 1; min-height: 116px; max-height: 190px;
  display: grid; grid-template-columns: 116px 1fr; gap: 6px 14px; align-items: center; padding: 12px 16px 12px 12px;
  background: var(--paper) url("img/paper-tile.webp"); box-shadow: var(--lift);
}
.slip__obj { position: relative; width: 116px; height: 104px; }
.slip__obj img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(3px 6px 5px rgb(0 0 0 / .3)); }
.slip__text { margin: 0; font-size: 17px; line-height: 1.28; }
.slip__text b { display: block; font-size: 20px; line-height: 1.15; letter-spacing: -.01em; margin-bottom: 2px; }
.slip__cta { grid-column: 1 / -1; }
.redact { letter-spacing: -.12em; }
.flyer { position: fixed; z-index: 40; pointer-events: none; filter: drop-shadow(6px 12px 8px rgb(0 0 0 / .3)); }
.ybtn {
  display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 18px;
  background: var(--yellow) url("img/yellow-tile.webp"); color: var(--ink); font-weight: 700; font-size: 18px; text-decoration: none;
  box-shadow: 0 1px 2px rgb(40 36 10 / .35), 0 8px 16px -8px rgb(40 36 10 / .5); transform: rotate(-1deg);
}
.ybtn:hover { transform: rotate(-2deg) translateY(-2px); }

/* ---------- Leaflet: a sheet that really unfolds, panel by panel ---------- */
.lstage {
  --pw: min(calc(100vw - 72px), 380px);
  --ph: min(calc(100% - 64px), 640px);
  position: relative; flex: 1; min-height: 0; overflow: hidden; perspective: 2200px; perspective-origin: 50% 40%; touch-action: pan-y; outline: none;
}
/* The sheet is the control: right half forward, left half back. */
.lstage[data-hover=next][data-next="1"], .lstage[data-hover=prev][data-prev="1"] { cursor: pointer; }
.lhint { position: absolute; z-index: 2; left: 50%; top: 50%; width: calc(var(--pw) * var(--n, 1)); height: var(--ph); transform: translate(-50%, -50%); pointer-events: none; transition: width .9s var(--ease); }
.lstage:focus-visible .lhint { outline: 3px solid var(--orange); outline-offset: 6px; }
/* Dog-eared corners: the next page peeks from the bottom right, the previous one from the bottom left. */
.lhint__next, .lhint__prev { position: absolute; bottom: 0; width: 22px; height: 22px; transition: width .2s var(--ease), height .2s var(--ease), opacity .2s; filter: drop-shadow(0 -1px 2px rgb(22 32 46 / .3)); }
.lhint__next { right: 0; background: linear-gradient(to top left, transparent 50%, var(--paper-2) 50%); }
.lhint__prev { left: 0; background: linear-gradient(to top right, transparent 50%, var(--paper-2) 50%); filter: drop-shadow(0 -1px 2px rgb(22 32 46 / .3)); }
.lstage:not([data-next="1"]) .lhint__next, .lstage:not([data-prev="1"]) .lhint__prev { opacity: 0; }
.lstage[data-hover=next] .lhint__next, .lstage[data-hover=prev] .lhint__prev { width: 40px; height: 40px; }
.lhint .tap { right: 6px; top: calc(100% + 12px); font-size: 20px; transform: rotate(-4deg); }
.lstage[data-hover=next] .lhint .tap { background: rgb(247 246 242 / .8); }
.strip {
  position: absolute; left: 0; top: 50%; width: var(--pw); height: var(--ph);
  transform: translate(var(--x, 22px), -50%); transform-style: preserve-3d;
  transition: transform .9s var(--ease);
}
.fold { position: absolute; left: 0; top: 0; width: var(--pw); height: 100%; transform-style: preserve-3d; transform-origin: 0 50%; transition: transform 1.05s var(--ease); }
.fold .fold { left: 100%; }
.fold.is-folded { transform: rotateY(178deg); }
.fold.is-flat { transform: rotateY(var(--crease, 0deg)); }
.fold.is-hidden { visibility: hidden; }
.fold::before { /* back of the paper */
  content: ""; position: absolute; inset: 0; transform: rotateY(180deg); backface-visibility: hidden;
  background: var(--paper-2) url("img/paper-tile.webp");
}
.panel {
  position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden;
  display: flex; flex-direction: column; gap: 10px; padding: 22px 20px 20px;
  background: var(--paper) url("img/paper-tile.webp");
  box-shadow: 0 1px 1px rgb(22 32 46 / .12), 0 18px 30px -18px rgb(22 32 46 / .5);
}
.panel::after { /* crease shading, alternating like an accordion fold */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / .07), transparent 22%, transparent 80%, rgb(255 255 255 / .25));
}
.fold.is-alt > .panel::after { background: linear-gradient(90deg, rgb(255 255 255 / .3), transparent 20%, transparent 78%, rgb(0 0 0 / .06)); }
.panel h3 { font-size: 20px; letter-spacing: -.01em; padding-bottom: 8px; border-bottom: 1.5px solid var(--ink); }
.panel p { margin: 0; }
.panel .big { font-size: 23px; line-height: 1.12; font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
.panel .small { font-size: 16px; color: var(--ink-2); }
.pic { width: 100%; height: auto; max-height: 50%; object-fit: contain; mix-blend-mode: multiply; margin: auto 0; }
.panel__kind { font-size: 16px; font-weight: 700; }
.panel__name span { display: block; margin-top: 6px; font-size: 20px; font-weight: 400; letter-spacing: 0; color: var(--ink-2); }
.panel__name { font-size: 36px; line-height: 1.05; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }
.panel__box { border: 2px solid var(--ink); padding: 12px 14px; display: grid; gap: 8px; font-size: 17px; }
.panel__index { font-size: 16px; line-height: 1.55; color: var(--ink-2); margin-top: auto !important; }
.contra { margin: auto 0; }
.contra .pic { max-height: none; }
.contra figcaption { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; font-size: 15px; font-weight: 700; line-height: 1.15; }
.warn { font-size: 18px; padding-top: 10px; border-top: 1px solid rgb(22 32 46 / .3); }
.freq { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.18; flex: 1; }
.freq tbody { display: grid; height: 100%; grid-template-rows: repeat(5, 1fr); }
.freq tr { display: grid; grid-template-columns: 1fr 44%; grid-template-rows: auto 1fr; column-gap: 8px; align-items: center; padding: 4px 0; }
.freq tr + tr { border-top: 1px solid rgb(22 32 46 / .28); }
.freq th { grid-column: 1; grid-row: 1; align-self: end; text-align: left; font-size: 15px; text-transform: none; color: var(--ink-2); }
.freq th small { font-weight: 400; }
.freq td { grid-column: 1; grid-row: 2; align-self: start; font-weight: 700; font-size: 16px; }
.freq td:last-child { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.freq tr:first-child td:nth-child(2) { font-size: 19px; color: var(--navy); }
.vig { width: 100%; height: auto; max-height: 92px; object-fit: contain; mix-blend-mode: multiply; }
.pic--sign { max-height: 22%; margin: 0; }
.panel--owner .ybtn { margin-top: 2px; }

/* ---------- Yellow card ---------- */
.view--card { overflow-y: auto; }
.view__bar--card { position: sticky; top: 0; }
.ycard {
  position: relative; width: min(calc(100% - 24px), 520px); margin: 0 auto 28px; padding: 18px 18px 20px;
  background: var(--yellow) url("img/yellow-tile.webp");
  box-shadow: 0 2px 3px rgb(40 36 10 / .25), 0 26px 40px -18px rgb(40 36 10 / .5);
  display: grid; gap: 10px;
}
.ycard__head { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding-bottom: 10px; border-bottom: 3px solid var(--ink); }
.ycard__t { font-size: 32px; letter-spacing: -.02em; }
.ycard__s { grid-column: 1; margin: 0; font-weight: 700; font-size: 17px; }
.ycard__post { grid-column: 2; grid-row: 1 / 3; align-self: start; margin: 0; width: 76px; height: 86px; display: grid; place-items: center; text-align: center; border: 2px solid var(--ink); font-size: 12px; font-weight: 700; line-height: 1.15; transform: rotate(3deg); }
.ycard fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ycard legend, .ycard__label { padding: 0; font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.ycard__label span { font-weight: 400; }
.ycard__sus { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.ycard__sus legend { grid-column: 1 / -1; }
.ycard__who { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.ycard fieldset label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 1.5px solid var(--ink); background: rgb(255 255 255 / .35); cursor: pointer; font-size: 16px; }
.ycard fieldset label:has(input:checked) { background: var(--ink); color: var(--yellow); }
.ycard input[type=checkbox], .ycard input[type=radio] { width: 20px; height: 20px; margin: 0; accent-color: var(--yellow); flex: none; }
.ycard textarea, .ycard input[type=email] {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink); border: 2px solid var(--ink); border-radius: 0; padding: 10px 12px;
  background: rgb(255 255 255 / .55); resize: vertical;
}
.ycard textarea { min-height: 88px; }
.ycard textarea::placeholder { color: #5f5a3a; }
.ycard [aria-invalid=true] { border-color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.ycard__err { margin: -4px 0 0; color: var(--red); font-weight: 700; font-size: 16px; }
.ycard__fail { display: grid; gap: 8px; padding: 12px 14px; border: 2px solid var(--red); background: rgb(255 255 255 / .45); font-size: 17px; }
.ycard__fail p { margin: 0; font-weight: 700; }
.ycard__mail { justify-self: start; color: var(--ink); font-weight: 700; font-size: 18px; }
.ycard__send:disabled { cursor: progress; opacity: .8; }
.ycard__send { min-height: 54px; border: 0; cursor: pointer; background: var(--ink); color: var(--yellow); font-weight: 700; font-size: 19px; }
.ycard__send:hover { background: #253247; }
.ycard.is-sent > :not(.ycard__head, .ycard__done) { display: none; }
.ycard__done { display: grid; gap: 8px; font-size: 17px; animation: viewin .4s ease-out; }
.ycard__done p { margin: 0; }
.ycard__ref { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.ycard__ref span { display: inline-block; padding: 2px 8px; border: 3px solid var(--red); color: var(--red); transform: rotate(-4deg); animation: stamp .45s .1s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes stamp { from { opacity: 0; transform: rotate(-4deg) scale(1.05); } }

/* ================= Without JS: a plain stack, message and email first ================= */
.nojs .counter { height: auto; min-height: 100svh; }
.nojs .box { height: min(62svh, 480px); }
.nojs .dock, .nojs .box__lid, .nojs .peek, .nojs .close, .nojs .lhint, .nojs .tally, .nojs .ycard-peek { display: none; }
.nojs .view { display: block; padding: 24px 16px; }
.nojs .bstage, .nojs .blister, .nojs .slip { display: none; }
.nojs .doses { display: grid; gap: 8px; max-width: 34em; margin: 0 auto; padding: 16px 20px 16px 36px; background: var(--paper); }
.nojs .strip, .nojs .fold, .nojs .panel { position: static; width: auto; height: auto; transform: none; max-width: 30em; margin: 0 auto; }
.nojs .lstage { overflow: visible; }
.nojs .panel { margin-bottom: 8px; }
.nojs .fold::before, .nojs .panel::after { display: none; }

/* ================= Wider screens ================= */
@media (min-width: 700px) {
  body { background-image: url("img/pharmacy-wide.webp"); }
  .js .view::before { background-image: url("img/pharmacy-wide.webp"); }
  .counter { width: var(--stage); margin: 0 auto; padding: 36px 0 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: 1fr auto auto 1fr auto; grid-template-areas: "stage ." "stage claim" "stage dock" "stage ." "fine fine"; column-gap: 36px; }
  .stage { grid-area: stage; padding: 0; justify-content: flex-end; }
  .box { height: min(100%, 700px); translate: 0 -2%; }
  .claim { grid-area: claim; font-size: 30px; max-width: 13em; align-self: end; }
  .claim b { font-size: 50px; margin-top: 6px; }
  .dock { grid-area: dock; align-self: start; padding-top: 28px; font-size: 24px; max-width: 18em; }
  [data-state=open] .dock { max-width: 18em; }
  .dock__arrow, [data-state=open] .dock__arrow { display: block; width: 64px; height: 32px; transform: none; }
  .fine { grid-area: fine; max-width: none; }
  .fine span { flex-basis: auto; font-size: 14px; align-self: center; }
  .ycard-peek { right: 2%; bottom: 9%; width: 230px; min-height: 156px; padding: 20px 26px 48px; }
  .ycard-peek__t { font-size: 27px; }
  .ycard-peek__s { font-size: 18px; }

  .view__bar, .bstage, .lstage { width: var(--stage); margin-inline: auto; }
  .view__bar { padding: 22px 0 8px; }
  .bstage { flex-direction: row; justify-content: center; align-items: center; gap: 40px; padding: 0 0 32px; }
  .blister { width: min(calc((100vh - 140px) * .633), calc(var(--stage) * .5), 460px); }
  .slip { flex: 0 1 360px; width: auto; max-height: none; min-height: 0; grid-template-columns: 1fr; padding: 26px 28px 28px; transform: rotate(1.5deg); }
  .slip__obj { width: 100%; height: 220px; }
  .slip__text { font-size: 21px; }
  .slip__text b { font-size: 30px; }
  .lstage { --pw: min(380px, calc((var(--stage) - 96px) / 2)); --ph: min(calc(100% - 72px), 680px); }
  /* Folds that slide past the stage edge fade out instead of being cut. */
  .lstage { -webkit-mask-image: linear-gradient(90deg, transparent, #000 72px, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(90deg, transparent, #000 72px, #000 calc(100% - 72px), transparent); }
  .vig { max-height: 104px; }
}
@media (min-width: 1700px) {
  .claim { font-size: 36px; }
  .claim b { font-size: 60px; }
}
@media (max-height: 700px) and (max-width: 699px) {
  .claim { font-size: 19px; }
  .claim b { font-size: 25px; }
  .ycard-peek { bottom: 50px; }
}

/* Reduced motion: every key moment still happens, as a dissolve instead of travel.
   Box: slow crossfade to the open photo, then blister and leaflet fade in already standing out of it.
   Leaflet: each new panel fades in flat in place (no 180deg swing); moving along the strip is a quick dip to paper and back (app.js).
   Blister: the popped object and its slip dissolve in (app.js); no flying pill. */
@media (prefers-reduced-motion: reduce) {
  .box__img { transition-duration: .6s; }
  .peek { opacity: 0; transition: opacity .6s ease-out; }
  .peek--blister, .is-open .peek--blister { transform: translateY(-46%) rotate(-7deg); }
  .peek--leaflet, .is-open .peek--leaflet { transform: translateY(-58%) translateX(12%) rotate(11deg); }
  .is-open .peek { opacity: 1; }
  .is-open .peek--blister { transition-delay: .35s; }
  .is-open .peek--leaflet { transition-delay: .6s; }
  .box:not(.is-open) .peek { visibility: hidden; }
  .box, .ycard-peek, .ybtn, .lhint, .lhint__next, .lhint__prev { transition: none; }
  .ycard-peek:hover { transform: rotate(-8deg); }
  .ybtn:hover { transform: rotate(-1deg); }
  .ycard__ref span { animation-name: viewin; }
  .strip { transition: none; }
  .fold { transition: none; }
  .fold.is-folded { transform: rotateY(var(--crease, 0deg)); }
  .fold.is-folded::before { display: none; }
  .fold > .panel { transition: opacity .7s ease-out; }
  .fold.is-folded > .panel { opacity: 0; }
}
