/* ===== DOSE OF SPIRIT: heartbreak clinic + cart delivery mode ===== */

/* ---------- Section ---------- */
.clinic-sec { padding: var(--sec-pad, clamp(40px, 6vh, 72px)) 0; overflow-x: clip; }
.clinic-grid {
  max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 36px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px; align-items: start;
}
.clinic-left, .clinic-right { display: grid; gap: 14px; min-width: 0; }

/* ---------- Route picker ---------- */
.routes { display: grid; gap: 8px; }
.route {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 14px;
  width: 100%; min-height: 76px; padding: 12px 18px; border-radius: 14px; text-align: left;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--line);
  transition: background .25s, color .25s, box-shadow .25s, transform .25s var(--ease);
}
.route:hover { background: var(--glass-hover); transform: translateY(-2px); }
.route[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.r-code { font-family: var(--f-mono); font-weight: 700; font-size: 34px; letter-spacing: -.04em; line-height: 1; }
.r-body { display: grid; gap: 2px; min-width: 0; }
.r-joke { font-size: 17px; line-height: 1.25; font-weight: 700; }
.r-full[hidden] { display: none; }
.r-full { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .6; }
.r-def { font-family: var(--f-mono); font-size: 11px; line-height: 1.45; opacity: .7; }

/* ---------- Stage: medicine is drawn OUT of the vial, flowing up ---------- */
.cl-stage {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 12px 16px 36px; border-radius: 14px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
/* 260 x 300 canvas: the svg art sits on top of the vial overlay (vial = x 100..160, y 150..280) */
.cl-scene { position: relative; width: min(220px, 100%); aspect-ratio: 260 / 300; }
.cl-art { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.cl-svg { width: 100%; height: 100%; overflow: visible; }
.cl-vial { position: absolute; left: 38.4615%; top: 50%; width: 23.0769%; z-index: 1; }
.cl-vial .vial { width: 100%; }
.cl-vial .vial .liq { transition-duration: 1.6s; transition-timing-function: ease-in-out; }
.cl-stage[data-kind="drip"] .cl-vial .vial .liq { transition-duration: 3.4s; }
.cl-read {
  position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; padding: 0 8px; text-align: center;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; color: var(--mute);
}
.cl-read b { color: var(--ink); font-weight: 600; display: inline-block; min-width: 2ch; text-align: right; }

.cl-line { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.cl-solid { fill: var(--ink); }
.cl-tick { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .5; }
.cl-tube { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.cl-flow { fill: none; stroke: var(--surface); stroke-width: 1.2; stroke-dasharray: 2 8; opacity: 0; }

/* IV: the bag fills from the bottom while the vial drains */
.cl-bag { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(.08); transition: transform 3.2s ease-in-out; }
.cl-stage.go .cl-bag { transform: scaleY(1); }
.cl-stage.run .cl-flow { opacity: 1; animation: cl-flow .5s linear infinite; }
@keyframes cl-flow { from { stroke-dashoffset: 10; } to { stroke-dashoffset: 0; } }

/* syringe: needle slides down into the vial, the plunger pulls back, then it lifts a little */
.cl-syr { transform: translateX(var(--ret, -90px)); opacity: 0; transition: transform .9s var(--ease), opacity .4s; }
.cl-stage.run .cl-syr, .cl-stage.go .cl-syr { transform: translateX(0); opacity: 1; }
.cl-stage.lift .cl-syr { transform: translateX(-12px); }
.cl-pl { transform: translateX(70px); transition: transform 1.6s ease-in-out; }
.cl-stage.go .cl-pl { transform: translateX(0); }
.cl-sl { transform-box: fill-box; transform-origin: 100% 50%; transform: scaleX(0); transition: transform 1.6s ease-in-out; }
.cl-stage.go .cl-sl { transform: scaleX(1); }

/* droplets and bubbles travelling up */
.cl-d { opacity: 0; }
.cl-stage.run .cl-d { animation: cl-up 1.1s linear infinite; }
.cl-stage.run .cl-d-b { animation-delay: .37s; }
.cl-stage.run .cl-d-c { animation-delay: .74s; }
@keyframes cl-up {
  0% { opacity: 0; transform: translate(130px, 146px); }
  15% { opacity: 1; }
  60% { opacity: 1; transform: translate(130px, 126px); }
  100% { opacity: 0; transform: translate(130px, 108px); }
}
.cl-bub { opacity: 0; }
.cl-stage.run.go .cl-bub { animation: cl-bub 1s linear infinite; }
@keyframes cl-bub { 0% { opacity: 0; transform: translateX(0); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(var(--bx, -80px)); } }

/* ---------- Quote card (printed slip: stays paper white in every theme) ---------- */
.clinic-card {
  --ink: #111111; --ink-2: #3a3a3a; --mute: #7a7a78; --line: rgba(17,17,17,.14);
  position: relative; overflow: hidden;
  background: #fff; color: #111;
  border-radius: 8px; padding: 26px clamp(18px, 3vw, 26px) 18px;
  box-shadow: 0 40px 80px -45px rgb(0 0 0 / calc(.3 * var(--sh))), 0 1px 0 var(--hair);
}
.clinic-card::before { /* perforation */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px;
  background: radial-gradient(circle at 8px -2px, var(--wall) 5px, transparent 5.5px) 0 0 / 16px 10px repeat-x;
}
.cc-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.cc-mark { font-family: "Inter Tight", serif; font-weight: 800; font-size: 40px; line-height: 1; font-style: italic; letter-spacing: -.06em; }
.cc-title { display: grid; gap: 1px; min-width: 0; flex: 1; }
.cc-title b { font-size: 15px; line-height: 1.25; }
.cc-title small { font-family: var(--f-mono); font-size: 11px; color: var(--mute); letter-spacing: .04em; }
.cc-route { font-family: var(--f-mono); font-weight: 700; font-size: 13px; padding: 4px 10px; border: 1.5px solid var(--ink); border-radius: 6px; letter-spacing: .06em; }
.cc-patient { margin: 12px 0 0; font-family: var(--f-mono); font-size: 12px; color: var(--mute); }
.cc-quote {
  margin: 8px 0 14px; padding: 0; min-height: 4.4em;
  font-size: clamp(19px, 2.4vw, 25px); line-height: 1.45; font-weight: 600; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.cc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cc-caret { display: none; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -.2em; background: var(--ink); animation: cl-caret .7s steps(1) infinite; }
.clinic-card.typing .cc-caret { display: inline-block; }
@keyframes cl-caret { 50% { opacity: 0; } }
.cc-vialinfo { display: grid; gap: 2px; padding-top: 14px; border-top: 1px dashed var(--line); }
.cc-lbl { font-family: var(--f-mono); font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
.cc-vialinfo b { font-size: 16px; line-height: 1.3; }
.cc-mean { font-size: 14px; color: var(--ink-2); }
.cc-vialinfo small { font-family: var(--f-mono); font-size: 11px; color: var(--mute); }
.cc-bc { height: 22px; margin-top: 12px; background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px, #111 8px 11px, transparent 11px 12px); opacity: .85; }

.cl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-actions .btn { flex: 1 1 auto; white-space: normal; text-align: center; min-height: 46px; height: auto; padding-top: 8px; padding-bottom: 8px; line-height: 1.25; }
.cl-actions .btn-ink { flex-basis: 100%; }
.cl-caps-h { margin: 0 0 10px; font-family: var(--f-mono); font-size: 12px; color: var(--mute); letter-spacing: .06em; text-transform: uppercase; }
.cl-caps .chip { height: auto; min-height: 36px; padding: 6px 15px; text-align: left; line-height: 1.35; }

.clinic-fine {
  max-width: 1320px; margin: 20px auto 0; padding: 0 clamp(16px, 3vw, 36px);
  font-size: 12px; line-height: 1.6; color: var(--mute);
}
.clinic-fine a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 820px) {
  .clinic-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .clinic-left, .clinic-right { gap: 12px; }
}
@media (max-width: 560px) {
  .route { grid-template-columns: 56px minmax(0, 1fr); padding: 10px 14px; min-height: 68px; }
  .cl-stage { padding: 10px 12px 34px; }
  .cl-scene { width: min(150px, 100%); }
  .cl-read { font-size: 11px; }
  .r-code { font-size: 28px; }
  .r-joke { font-size: 16px; }
  .cl-actions .btn { flex: 1 1 calc(50% - 5px); padding-left: 12px; padding-right: 12px; }
}

/* ---------- Cart: quote line under an item ---------- */
.ci-note {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px; font-size: 12px; line-height: 1.4; font-style: italic; color: var(--mute);
}

/* ---------- Cart: delivery mode ---------- */
.cart-foot { max-height: 64vh; overflow-y: auto; }
.deliv { display: grid; gap: 10px; margin-bottom: 14px; }
.deliv[hidden], .deliv [hidden] { display: none; }
.deliv-h { margin: 0; font-family: var(--f-mono); font-size: 11px; color: var(--mute); letter-spacing: .08em; text-transform: uppercase; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--track); }
.seg button {
  display: grid; gap: 1px; align-content: center; min-height: 52px; padding: 6px 8px; border-radius: 10px; text-align: center;
  transition: background .25s, color .25s;
}
.seg button b { font-size: 13px; line-height: 1.2; font-weight: 700; }
.seg button small { font-size: 11px; line-height: 1.25; opacity: .7; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.deliv-ex { margin: 0; font-family: var(--f-mono); font-size: 11px; line-height: 1.5; color: var(--mute); }
.deliv-rate { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.deliv-rate select {
  flex: 0 1 200px; min-width: 0; height: 38px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line);
  font: inherit; font-size: 16px; /* 16px or iOS Safari zooms the page on focus */
}
.deliv-rate input {
  flex: 0 1 200px; min-width: 0; height: 38px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line);
  font: inherit; font-size: 16px; /* 16px or iOS Safari zooms the page on focus */
}
.deliv-rate input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px #c0392b; }
.deliv-err { margin: -4px 0 0; font-size: 12px; line-height: 1.4; color: #c0392b; }
.deliv-calc, .deliv-hint, .deliv-joke { margin: 0; font-family: var(--f-mono); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.deliv-calc { color: var(--ink); }
.deliv-dim { color: var(--mute); opacity: .7; }
.deliv-hint, .deliv-joke { color: var(--mute); }
@media (max-width: 480px) {
  .deliv-rate { flex-direction: column; align-items: stretch; gap: 6px; }
  .deliv-rate input, .deliv-rate select { flex: 1 1 auto; width: 100%; }
}
.deliv-lines { display: grid; gap: 4px; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.deliv-lines div { display: flex; justify-content: space-between; gap: 10px; }
.deliv-lines .disc { color: var(--ink); font-weight: 600; }

/* ---------- Receipt: quote + delivery lines (receipt stays paper white) ---------- */
.rc-note { margin: -2px 0 8px 18px; font-size: 12px; line-height: 1.45; font-style: italic; color: #666; }
.rc-r { text-align: right; max-width: 60%; }
