/* Studio Mynz Moments — guest page (web/assets/guest.css)
   The album page: masthead, the current view, and the thumb dock. Tokens and shared
   components (buttons, prints, sheets, banners, the From field) live in styles.css. */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ─── Layout: masthead · view · dock ─────────────────────────────────────── */
/* The dock is part of the column (never fixed), so it can't cover anything. When
   space runs out, the hero (fan or print) shrinks or hides; the dock never moves. */

.shell {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  background: radial-gradient(130% 55% at 50% -10%, #2b2825 0%, rgba(26, 24, 22, 0) 62%), var(--album);
}
.g-mast, .g-main, .g-dock { width: 100%; max-width: 480px; margin-inline: auto; }
.g-mast {
  flex: none; display: flex; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 4px;
}
.g-mast .lockup { --logo-h: var(--logo-mast); }
.g-main {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  padding: 10px var(--gutter) 0;
  overflow: hidden auto; overscroll-behavior: contain;  /* Larger Text: the view scrolls, the dock stays */
}
.g-main > section { flex: 1 0 auto; display: flex; flex-direction: column; }
.g-dock {
  flex: none; display: grid; grid-template-columns: minmax(0, 1fr);
  padding: 12px var(--gutter) max(14px, calc(env(safe-area-inset-bottom) + 8px));
}
/* One column that never grows past the dock (a long one-line label would widen every button) */
.g-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.g-panel > .btn-text { justify-self: center; }
.g-foot { margin-top: 2px; text-align: center; font: 400 13px/1.35 var(--font-ui); color: var(--text-2); text-wrap: balance; }
.g-foot a { padding-block: 12px; } /* bigger tap area without moving the line */

.g-title {
  font: 400 28px/1.12 var(--font-display); letter-spacing: -0.01em;
  text-wrap: balance; text-align: center; overflow-wrap: anywhere;
}
.g-title .to { display: block; }
/* Titles focused by script (tabindex="-1") for screen readers: not controls, so no ring */
#thanks:focus, #sum-main:focus, .event-message:focus { outline: none; }
.g-sub {
  margin-top: 8px; text-align: center; font: 400 15px/1.45 var(--font-ui);
  color: var(--text-2); text-wrap: balance; overflow-wrap: anywhere;
}

/* Prints on the album page: the ampersand on paper reads in graphite */
.print .amp { color: var(--graphite); }
/* Hero prints narrowed by fitHero()/fitSending() keep more of the caption (Young Serif stays ≥ 15px) */
#up-print, #done-print, .msg-print { container-type: inline-size; }
@container (max-width: 170px) { .print-from, .title-print .print-from { font-size: 16px; } }
.print-mark { margin-left: auto; }
.print-glyph { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; color: var(--graphite); }
.print-glyph svg { width: 38px; height: 38px; }

/* ─── Loading ────────────────────────────────────────────────────────────── */
.g-loading { align-items: center; justify-content: center; gap: 16px; padding-bottom: 48px; font: 400 15px/1.4 var(--font-ui); color: var(--text-2); }
.loading-mark { width: 52px; height: 52px; animation: spin 2.4s linear infinite; }

/* ─── Welcome ────────────────────────────────────────────────────────────── */
.lede { font: 500 15px/1.3 var(--font-ui); color: var(--text-2); }
.event-name {
  margin-top: 4px; font: 400 clamp(34px, 11vw, 44px)/1.02 var(--font-display);
  letter-spacing: -0.015em; text-wrap: balance; overflow-wrap: anywhere;
}
/* With an occasion under them, the client's names get a little more room and the occasion sits smaller */
.event-name:has(+ .event-occasion:not([hidden])) { font-size: clamp(38px, 12.5vw, 52px); }
.event-occasion {
  margin-top: 6px; font: 400 clamp(24px, 7.6vw, 32px)/1.08 var(--font-display);
  letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: anywhere; color: var(--text);
}
.event-date { margin-top: 8px; font: 500 16px/1.3 var(--font-ui); color: var(--text); }
.event-message {
  margin-top: 8px; font: 400 16px/1.45 var(--font-ui); color: var(--text-body); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.event-message.is-open { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
.event-more { align-self: flex-start; margin-left: -12px; }
/* No in-page camera (so no fan): the welcome sits in the middle instead of leaving an empty album */
.g-welcome:has(> #start-note[hidden]) { justify-content: center; padding-bottom: 6vh; }

/* Fan of three sample prints: Hearts · Keepsake (this event) · Golden hour */
.start-note {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: center;
  overflow-y: clip; overflow-clip-margin: 0px;  /* a squeezed fan leaves a half-pixel the page could scroll by */
  container-type: size;  /* so the caption can leave with the art (below) */
}
.fan {
  position: relative; flex: 1 1 0; min-height: 0; max-height: 236px; margin-top: 12px;
  container-type: size;
  --w: min(144px, calc((100cqh - 54px) / 1.25), calc(100cqw * .46));
}
.fan .print { position: absolute; left: 50%; bottom: 6px; --print-pad: 5px; --lip: 30px; }
.fan .print .print-lip { padding: 4px 3px 5px; }
.fan .print-photo img { width: 100%; height: 100%; object-fit: cover; }
.fan .f1 { width: calc(var(--w) * .8); transform: translateX(calc(var(--w) * -1.18)) rotate(-9deg); }
.fan .f2 { width: var(--w); transform: translateX(-50%) rotate(-1.5deg); z-index: 1; bottom: 12px; --lip: 38px; }
.fan .f3 { width: calc(var(--w) * .8); transform: translateX(calc(var(--w) * .42)) rotate(8deg); }
/* The decorative type scales with the fan, so "Golden hour" clears the Keepsake lip and short names stay whole */
.fan .lab { display: block; width: 100%; font-size: clamp(6.5px, calc(var(--w) * .059), 8.5px); line-height: 1; letter-spacing: .12em; color: #3d3935; white-space: nowrap; overflow: hidden; }
.fan .f1 .lab { text-align: left; padding-left: 6px; }
.fan .f3 .lab { text-align: right; padding-right: 5px; }
.fan .ks-names { display: block; font: 400 clamp(9px, calc(var(--w) * .087), 12.5px)/1.05 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fan .print-row + .print-row, .fan .ks-names + .print-row { margin-top: 3px; }
.fan .ks-date { font: 500 7.5px/1 var(--font-ui); color: var(--graphite); white-space: nowrap; }
.fan .ks-mark { flex: none; height: 9px; width: auto; margin-left: auto; }
.fan-mini { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 10px; }
.fan-mini span {
  width: 40px; height: 48px; border: 3px solid var(--print); border-bottom-width: 8px; border-radius: 2px;
  background: #d9d4cd center / cover no-repeat; box-shadow: var(--sh-print);
}
.fan-mini span:nth-child(1) { transform: rotate(-6deg); }
.fan-mini span:nth-child(3) { transform: rotate(5deg); }
@container (max-height: 130px) { .fan .print { display: none; } .fan .fan-mini { display: flex; } }
@container (max-height: 56px) { .fan .fan-mini { display: none; } }
@supports not (container-type: size) { .fan .print { display: none; } .fan .fan-mini { display: flex; } }
.fan-cap { flex: none; margin-top: 8px; text-align: center; font: 400 14px/1.3 var(--font-ui); color: var(--text-2); }
/* Too little room for even the mini row (long names on a small phone): no caption for an empty space */
@container (max-height: 94px) { .fan-cap { display: none; } }

/* First welcome: the prints deal out from a stacked pile */
.start-note.is-dealing .fan .print { animation: fan-deal 520ms var(--ease-pop) both; }
.start-note.is-dealing .fan .f2 { animation-delay: 70ms; }
.start-note.is-dealing .fan .f3 { animation-delay: 140ms; }
@keyframes fan-deal { from { transform: translateX(-50%) translateY(18px) rotate(0); opacity: 0; } }

/* The dock's secondary buttons keep their own size for the label span */
#btn-gallery.btn-secondary .btn-label, #btn-photo .btn-label { font: inherit; }

/* ─── Sending: the developing print ──────────────────────────────────────── */
/* Tighter than the other views (6px under the masthead, 4px over "Stop sending"),
   so print, title, ETA and banner all fit 375×664 like the mockup. */
.g-progress { position: relative; margin-top: -4px; }
#btn-cancel { margin-top: -8px; }
#up-print {
  flex: none; align-self: center; margin-top: 4px;
  width: var(--fit-w, clamp(160px, 29vh, 200px)); --tilt: -2.2deg; --lip: 52px;
  animation: hero-in var(--d-2) var(--ease-out) both;
  transition: transform var(--d-3) var(--ease-out), width var(--d-2) var(--ease-out);  /* fitSending() eases, never snaps */
}
@keyframes hero-in { from { opacity: 0; transform: translateY(8px) rotate(var(--tilt)); } }
.lipbar-row { margin-top: 8px; }
.lipbar { flex: 1; height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.lipbar > span { display: block; width: 0; height: 100%; border-radius: 5px; background: var(--ink); transition: width var(--d-tick) linear; }
.pct { flex: none; min-width: 3.2ch; text-align: right; font: 600 17px/1 var(--font-ui); font-variant-numeric: tabular-nums lining-nums; }

/* Status chip (#osd): empty at rest, only speaks when the network struggles */
.osd {
  align-self: center; display: inline-flex; align-items: center; gap: 8px;
  min-height: 32px; margin-top: 18px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
  font: 600 14px/1 var(--font-ui); color: var(--text); white-space: nowrap;
}
.osd:empty { display: none; }
.osd svg { width: 18px; height: 18px; flex: none; }

.upload-summary { margin-top: 20px; }
.osd:not(:empty) + .upload-summary { margin-top: 12px; }
.eta { margin-top: 8px; text-align: center; font: 600 17px/1.3 var(--font-ui); font-variant-numeric: tabular-nums lining-nums; text-wrap: balance; }
.eta span { font-weight: 400; font-size: 15px; color: var(--text-2); }
.eta .eta-time { font: inherit; color: inherit; white-space: nowrap; }
.eta .eta-time + span { display: inline-block; margin-left: .28em; }  /* narrow screens: "· 15 of 40 MB" moves down whole, never a dangling "·" */
.eta .note { display: block; font: 400 15px/1.45 var(--font-ui); color: var(--text-body); }
#keep-open { margin-top: 16px; }
#keep-open strong, #keep-open span { text-wrap: balance; }
/* While the chip and its note show, or when the view runs short of room (fitSending: "cramped"),
   the banner keeps only its first line: the second ("it carries on by itself") is what the note says. */
.g-progress.is-trouble #keep-open span, .g-progress.is-cramped #keep-open span { display: none; }
/* Cramped: the gaps tighten too, before the print gives up any more room */
.g-progress.is-cramped #up-print { margin-top: 0; }
.g-progress.is-cramped .osd { margin-top: 8px; }
.g-progress.is-cramped .upload-summary, .g-progress.is-cramped .osd:not(:empty) + .upload-summary { margin-top: 8px; }
.g-progress.is-cramped .eta { margin-top: 6px; }
.g-progress.is-cramped #keep-open { margin-top: 8px; padding-block: 10px; }

/* Rows: several moments while sending, and the "some didn't send" list */
.rows {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1.5px solid var(--leaf-2); border-radius: var(--r-btn); background: var(--surface);
}
.rows:empty { display: none; }
/* One moment: rendered off-screen (not display: none) so its thumbnail decodes for the print */
.rows.is-single { position: absolute; left: -10000px; top: 0; width: 320px; margin: 0; }
li.file {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 4px 12px; align-items: center; padding: 12px 14px; box-shadow: 0 -1px 0 var(--leaf-2);
}
li.file.done { order: -1; } /* saved first */
li.file .thumb {
  display: block; width: 44px; height: 52px; padding: 3px 3px 7px; border-radius: 2px;
  background: linear-gradient(#d9d4cd, #d9d4cd) content-box, var(--print); object-fit: cover;
}
li.file img.thumb, li.file video.thumb { background: var(--print); }
li.file.failed .thumb { background: linear-gradient(#3a3632, #3a3632) content-box, #4a4540; }
li.file.failed img.thumb, li.file.failed video.thumb { background: #4a4540; opacity: .45; }
li.file.done::after {
  content: ''; position: absolute; left: 44px; top: 50px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--print) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%231a1816' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: 0 0 0 2px var(--surface);
}
.file-info { min-width: 0; }
.file-name { font: 600 15px/1.25 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { margin-top: 2px; font: 400 13px/1.3 var(--font-ui); color: var(--text-2); font-variant-numeric: tabular-nums lining-nums; }
.file-state { font: 600 14px/1 var(--font-ui); white-space: nowrap; }
li.file:not(.done):not(.failed) .file-state { font-weight: 500; color: var(--text-2); }
.file-error { grid-column: 2 / -1; display: flex; gap: 8px; font: 400 14px/1.4 var(--font-ui); color: var(--text-body); }
.file-error::before { content: ''; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--tally); }
li.file .bar { grid-column: 2 / -1; height: 3px; border-radius: 2px; background: var(--leaf-2); overflow: hidden; }
li.file .bar > span { display: block; width: 0; height: 100%; background: var(--print); transition: width var(--d-tick) linear; }
li.file.done .bar, li.file.failed .bar { display: none; }

/* "Some didn't send": words instead of the print */
.is-summary #up-print, .is-summary li.file .bar { display: none; }
.is-summary .upload-summary { margin-top: 8px; }
.is-summary #sum-main { text-align: left; font-size: 30px; }
.is-summary #sum-bytes { margin-top: 6px; text-align: left; font: 400 15px/1.45 var(--font-ui); color: var(--text-2); text-wrap: pretty; }

/* ─── Saved ──────────────────────────────────────────────────────────────── */
.g-done { position: relative; align-items: center; }

/* Saving switched off for the event: no long-press menu on pictures, and a watermark across every print */
.no-save img, .no-save canvas, .no-save video { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.no-save .print-photo::before {
  content: 'Studio Mynz'; position: absolute; inset: 0; z-index: 1; display: grid; place-items: center;
  font: 600 clamp(13px, 7vw, 26px)/1 var(--font-ui); letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255, 255, 255, .3); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); transform: rotate(-24deg); pointer-events: none;
}
.no-save .fan .print-photo::before { display: none; }  /* the welcome fan's samples aren't anyone's photo */
/* --fit-w: set by fitHero() only when the screen runs long, so the dock never moves */
#done-print { flex: none; margin-top: 8px; width: var(--fit-w, clamp(180px, 33vh, 230px)); }
/* On a narrower print the names keep their room: the logo scales down first, then the names ellipsize */
#done-print .print-mark { flex: 0 100 auto; min-width: 44px; object-fit: contain; object-position: right center; }
/* The names never share the shrink (any share at all cuts them with "…"); they stop where the logo's 44px begins */
#done-print .print-meta { flex-shrink: 0; max-width: calc(100% - 54px); }
/* A narrow print (small phone, long thank-you) drops the signature mark (the masthead shows the logo) so the names fit */
@container (max-width: 170px) {
  #done-print .print-mark { display: none; }
  #done-print .print-meta { max-width: 100%; }
}
/* A Keepsake capture already is a print, with its own paper and lip: it's shown whole, at its own
   shape (guest.js sets --ks-ratio, --ks-a and --ks-scale), with no second print or lip around it.
   A portrait one is about as tall as the plain print; the thank-you below carries the name. */
#view-done.is-keepsake #done-print { padding: 0; background: none; width: var(--fit-w, calc(clamp(180px, 33vh, 230px) * var(--ks-scale, 1))); }
#view-done.is-keepsake #done-print .print-photo { aspect-ratio: var(--ks-ratio, 9 / 16); border-radius: inherit; background: #2c2926; }
#view-done.is-keepsake #done-print .print-photo::after,
#view-done.is-keepsake #done-print .print-lip { display: none; }
#done-print .corners i:nth-child(2) { --rot: 90deg; }
#done-print .corners i:nth-child(3) { --rot: 180deg; }
#done-print .corners i:nth-child(4) { --rot: 270deg; }
#thanks { margin-top: 22px; font-size: 34px; }
#thanks-sub { font-size: 16px; color: var(--text-body); }
#ig-link { padding-inline: 4px; white-space: normal; text-wrap: balance; text-align: center; }  /* one line at 375; wraps rather than widening the dock */

/* Arrival: the print straightens, the corners snap on, the pill fades in, flecks fall once */
#view-done.is-arriving #done-print { animation: done-straighten var(--d-3) var(--ease-out) both; }
#view-done.is-arriving .corners i { animation: corner-snap 220ms var(--ease-pop) 300ms both; }
#view-done.is-arriving .corners i:nth-child(2) { animation-delay: 370ms; }
#view-done.is-arriving .corners i:nth-child(3) { animation-delay: 440ms; }
#view-done.is-arriving .corners i:nth-child(4) { animation-delay: 510ms; }
#view-done.is-arriving .saved-pill { animation: pill-in 200ms ease 600ms both; }
@keyframes done-straighten { from { transform: rotate(-2.2deg); } }
@keyframes corner-snap { from { transform: rotate(var(--rot, 0deg)) scale(1.4); opacity: 0; } }
@keyframes pill-in { from { opacity: 0; transform: scale(.92); } }

.flecks { position: absolute; left: 50%; top: calc(var(--fit-w, clamp(180px, 33vh, 230px)) * .62); width: 0; height: 0; z-index: 3; pointer-events: none; }
.flecks i { position: absolute; left: -3px; top: -4px; width: 6px; height: 9px; border-radius: 1px; background: var(--print); opacity: 0; }
.flecks i:nth-child(even) { width: 5px; height: 7px; background: var(--pencil); }
#view-done.is-keepsake .flecks { top: calc(var(--fit-w, calc(clamp(180px, 33vh, 230px) * var(--ks-scale, 1))) * var(--ks-a, 1.25) * .5); }
#view-done.is-arriving .flecks i { animation: fleck 900ms cubic-bezier(.2, .6, .4, 1) calc(380ms + var(--d, 0ms)) both; }
@keyframes fleck {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  8% { opacity: 1; }
  45% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
  100% { opacity: 0; transform: translate(calc(var(--x) * 1.15), calc(var(--y) + 140px)) rotate(calc(var(--r) * 2)); }
}

/* ─── Messages: closed, invalid, network, setup, landing ─────────────────── */
.g-message { align-items: center; text-align: center; padding-top: 12px; }
#message-art { display: flex; flex-direction: column; align-items: center; }
#message-art:empty { display: none; }
#message-title { margin-top: 26px; }
#message-body { font-size: 16px; color: var(--text-body); }

.msg-print, .blank-print { margin-top: 4px; }
.msg-print { flex: none; width: var(--fit-w, clamp(170px, 30vh, 200px)); --lip: 50px; text-align: left; }
.title-print .print-photo { --ratio: 1 / 1; display: grid; place-items: center; background: radial-gradient(90% 70% at 50% 35%, #6a645e, #2c2926 72%); }
.title-print .print-from { font-size: 18px; }
/* The date is never cut short; on a narrow print the logo (a signature mark) scales down instead */
.title-print .print-meta { flex: none; overflow: visible; }
.title-print .print-mark { flex: 0 1 auto; min-width: 0; object-fit: contain; object-position: right center; }
.mono-gram { font: 400 54px/1 var(--font-display); color: var(--print); letter-spacing: -0.02em; }
.mono-gram .amp { color: var(--pencil); font-size: .6em; }
.blank-print { flex: none; width: var(--fit-w, clamp(140px, 25vh, 168px)); --lip: 40px; }
.blank-print .print-photo { background: #d9d4cd; }
.blank-print.is-milky .print-photo { background: linear-gradient(160deg, #f1ede7, #ddd7cf); }
.blank-print.is-dashed .print-photo { background: #f3f1ed; outline: 1.5px dashed var(--graphite); outline-offset: -1.5px; }
.blank-print.is-dashed .print-photo::after { display: none; }

/* Landing (no event code): the masthead steps aside for a centred logo */
.shell.is-landing .g-mast { display: none; }
.shell.is-landing .g-main { padding-top: calc(34px + env(safe-area-inset-top)); }
.shell.is-landing .g-message { padding-top: 0; }
.landing-art { display: flex; flex-direction: column; align-items: center; }
.landing-art .logo { --logo-h: var(--logo-landing); }
.landing-word { margin-top: 14px; font: 400 30px/1 var(--font-display); letter-spacing: -0.01em; }
.landing-caps { margin-top: 8px; color: var(--text-2); }
.land-card {
  position: relative; margin-top: 22px; width: 96px; padding: 9px 9px 10px;
  display: grid; justify-items: center; gap: 4px;
  background: var(--print); border-radius: 3px; box-shadow: var(--sh-print); transform: rotate(-4deg);
}
.land-logo { height: 9px; width: auto; }
.land-names { font: 400 9px/1 var(--font-display); color: var(--ink); }
.land-qr { position: relative; width: 62px; padding: 3px; }
.land-qr svg { width: 100%; height: auto; }
.land-qr .corners { inset: -1px; --corner-leg: 9px; }
.g-message[data-kind="landing"] #message-title { margin-top: 22px; }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.steps li { display: grid; justify-items: center; align-content: start; gap: 8px; font: 500 14px/1.25 var(--font-ui); text-wrap: balance; }
.step-ico { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.step-ico svg { width: 24px; height: 24px; }
.step-ico b { position: absolute; left: -7px; top: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--print); color: var(--ink); font: 700 12px/22px var(--font-ui); text-align: center; }

/* ─── Gallery send sheet ─────────────────────────────────────────────────── */
#send-lead { margin-top: 4px; }
#send-sheet { --send-w: 92px; }  /* a mini print's width */
.send-prints { list-style: none; margin: 16px 0 0; padding: 0 0 0 4px; display: flex; align-items: flex-start; gap: 14px; }
.send-prints:empty { display: none; }
/* Every mini print is --send-w wide; its card is as wide as its words where they're wider ("Video · 0:06"
   beside a 56–72px print on the smallest phones), so a video's length isn't cut short while the row has
   room. A full row shrinks the cards (and their prints) evenly, and names ellipsize as before. */
.send-print { flex: 0 1 auto; min-width: 0; }
.send-print .print { --print-pad: 4px; --lip: 12px; width: var(--send-w); max-width: 100%; }
.send-print .print-lip { padding: 0; }
.send-print:nth-child(1) .print { --tilt: -3deg; }
.send-print:nth-child(2) .print { --tilt: 2deg; }
.send-print:nth-child(3) .print { --tilt: -1deg; }
.send-print.is-bad .print { background: #4a4540; box-shadow: none; }
.send-print.is-bad .print-photo { display: grid; place-items: center; background: #3a3632; color: var(--tally); }
.send-print.is-bad .print-photo::after { display: none; }
.send-print .alert { width: 26px; height: 26px; }
.send-name { margin-top: 10px; font: 600 14px/1.25 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-meta { margin-top: 2px; font: 400 13px/1.3 var(--font-ui); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
/* "Won’t be sent" is never cut short and never wraps: a file that can't go keeps its print the
   same size as the others, and its card is as wide as that line (its name still ellipsizes) */
.send-print.is-bad { flex: none; }
.send-print.is-bad .send-name { width: 0; min-width: 100%; }
.send-print.is-bad .send-meta { overflow: visible; }
.send-more {
  flex: none; align-self: center; margin: -30px 0 0 -2px; padding: 9px 10px 10px;
  border-radius: 3px; background: var(--print); color: var(--ink); box-shadow: var(--sh-print);
  font: 600 15px/1 var(--font-ui); transform: rotate(3deg);
}
#send-warn { display: grid; gap: 4px; margin-top: 14px; padding: 12px 14px; font: 400 14.5px/1.4 var(--font-ui); color: var(--text); overflow-wrap: anywhere; }
.send-msg { margin-top: 16px; }
.send-ks { margin-top: 12px; }
.send-ks-label { font: 500 13px/1.2 var(--font-ui); color: var(--text-2); }
.send-ks-styles {
  display: flex; gap: 6px; margin: 8px calc(var(--gutter) * -1) 0; padding: 2px var(--gutter);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.send-ks-styles::-webkit-scrollbar { display: none; }
.send-from { margin-top: 12px; }
#send-sheet .sheet-actions { margin-top: 12px; gap: 4px; }
#send-sheet .sheet-actions .btn-text { justify-self: center; }

/* ─── Send sheet on shorter phones (375×664 and down) ───────────────────── */
/* Everything down to "Choose again" fits without scrolling the sheet, with a file that can't go
   too: slightly smaller previews, the count beside the message's label, a slimmer From field and
   Send button, tighter gaps, and the sheet up to 8px from the top. 320×568 also gets square previews (below).
   Two or more files that can't go (two reasons of two lines each) scroll the sheet about 30–40px at
   375×664 and 320×568; Send is still reached by scrolling, and each file keeps its reason. */
@media (max-height: 700px) {
  #send-sheet .sheet-panel { max-height: calc(100dvh - 8px); padding-top: 8px; padding-bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px)); }
  #send-sheet .sheet-grabber { margin-bottom: 8px; }
  #send-sheet .sheet-title { font-size: 22px; }
  #send-sheet { --send-w: 84px; }
  .send-prints { margin-top: 10px; gap: 10px; }
  .send-name { margin-top: 6px; }
  #send-warn { margin-top: 10px; padding: 8px 12px; font-size: 14px; line-height: 1.35; }
  .send-msg { margin-top: 10px; padding: 9px 14px 8px; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
  .send-msg .ks-field-label { grid-area: 1 / 1; }
  .send-msg .ks-count { grid-area: 1 / 2; align-self: center; }
  .send-msg .ks-text { grid-area: 2 / 1 / 3 / 3; }
  .send-ks { margin-top: 8px; }
  .send-ks-styles { margin-top: 6px; }
  .send-from { margin-top: 8px; min-height: 48px; }
  .send-from .from-input { height: 44px; }
  #send-sheet .sheet-actions { margin-top: 8px; }
  #btn-send { min-height: 56px; }
}

/* ─── Short screens (iPhone SE, small Androids) ──────────────────────────── */
@media (max-height: 600px) {
  .lede { display: none; }
  .event-message { -webkit-line-clamp: 1; line-clamp: 1; }
  .g-mast { --logo-mast: 32px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .g-mast .lockup-word { font-size: 19px; }
  .land-card { display: none; }
  #thanks { margin-top: 18px; font-size: 28px; }
  /* Send sheet, smallest phones (320×568): square previews; with a file that can't go, the
     warning needs room too: smaller previews, a one-line message box (it still takes 80
     characters) and the last few pixels of the gaps */
  #send-sheet { --send-w: 72px; }
  .send-print .print-photo { --ratio: 1 / 1; }
  #send-sheet:has(#send-warn:not([hidden])) { --send-w: 56px; }
  #send-sheet:has(#send-warn:not([hidden])) .sheet-panel { max-height: calc(100dvh - 4px); }
  #send-sheet:has(#send-warn:not([hidden])) .sheet-grabber { margin-bottom: 6px; }
  #send-sheet:has(#send-warn:not([hidden])) :is(.send-prints, #send-warn, .send-msg) { margin-top: 8px; }
  #send-sheet:has(#send-warn:not([hidden])) :is(.send-ks, .send-from, .sheet-actions) { margin-top: 6px; }
  #send-sheet:has(#send-warn:not([hidden])) #send-warn { padding-block: 7px; }
  #send-sheet:has(#send-warn:not([hidden])) .send-msg .ks-text { height: 24px; min-height: 0; }
  .g-progress.is-cramped #sum-main { font-size: 26px; }  /* sending, offline, on a 320×568 phone */
  /* "Some didn't send": the failed row's reason stays above the dock */
  .is-summary #sum-main { font-size: 26px; }
  .is-summary #sum-bytes { margin-top: 4px; }
  .is-summary .rows { margin-top: 12px; }
  .is-summary li.file { padding: 9px 12px; gap: 2px 10px; grid-template-columns: 38px minmax(0, 1fr) auto; }
  .is-summary li.file .thumb { width: 38px; height: 46px; }
  .is-summary li.file.done::after { left: 36px; top: 41px; }
}

/* Smaller phones: the Instagram line fits one line where it can, and wraps evenly where it can't */
@media (max-width: 374.98px) {
  #ig-link { font-size: 14px; }
}

/* Narrow phones (320 px): dock labels like "Studio Mynz on Instagram" stay on one line */
@media (max-width: 340px) {
  .g-dock .btn { padding-inline: 12px; }
  .g-dock .btn-md { font-size: 16px; gap: 8px; }
  .g-dock .btn-text { padding-inline: 4px; font-size: 14px; }
  #ig-link svg { display: none; }  /* the words already say Instagram; this keeps them on one line */
}

/* Desktop: the sheet is a centred dialog, so no drag handle */
@media (min-width: 720px) {
  .sheet .sheet-grabber { display: none; }
  .sheet .sheet-panel, #send-sheet .sheet-panel { padding-top: 24px; }
}

/* ─── Reduced motion: final states, no movement ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .loading-mark, #up-print, .start-note.is-dealing .fan .print, #view-done.is-arriving #done-print { animation: none; }
  /* The corners and the Saved pill are simply there (no staggered delays holding them invisible) */
  #view-done.is-arriving .corners i, #view-done.is-arriving .saved-pill { animation: none; }
  .flecks { display: none; }
}
