@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600&display=swap');

:root {
  --fs-label: clamp(14px, 0.3vw + 12.8px, 15px);
  --fs-small: clamp(15px, 0.3vw + 13.8px, 16px);
  --fs-body: clamp(17px, 0.5vw + 15px, 19px);
}

/* Minimal reset (replaces Tailwind's preflight) */
h1, h2, p, figure { margin: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
button { padding: 0; border: 0 solid; background: none; color: inherit; cursor: pointer; }
em { font-style: normal; }
html { -webkit-text-size-adjust: 100%; }

:root {
  --wine: #780116;
  --gold: #f7b538;
  --orange: #db7c26;
  --coral: #d8572a;
  --red: #c32f27;
  --cream: #fff8e9;
  --paper: #f9e7bf;
  --ink: #451414;
  --white: #fffdf8;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 50% -20%, rgba(247, 181, 56, 0.22), transparent 35%),
    linear-gradient(180deg, #fffaf0 0%, var(--cream) 60%, #fceccc 100%);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E");
  z-index: 20;
  mix-blend-mode: multiply;
}

.sunburst {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  opacity: 0.12;
  background: repeating-conic-gradient(var(--gold) 0deg 8deg, transparent 8deg 17deg);
  pointer-events: none;
}

.sunburst-left {
  left: -290px;
  top: 180px;
}

.sunburst-right {
  right: -300px;
  bottom: 20px;
}

.topbar {
  height: 86px;
  padding: 0 clamp(24px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  background: var(--wine);
  border-bottom: 5px solid var(--gold);
  position: relative;
  z-index: 2;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background: repeating-linear-gradient(120deg, transparent 0 32px, var(--white) 33px 34px);
}

.brand,
.event-stamp {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.brand {
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
}

.brand strong,
.brand span,
.event-stamp strong,
.event-stamp small {
  display: block;
}

.brand strong {
  font-family: "Fraunces", serif;
  font-size: 19px;
  line-height: 1.15;
}

.brand span {
  margin-top: 3px;
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.68);
}

.event-stamp {
  gap: 10px;
}

.event-stamp > span {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--gold);
  color: var(--wine);
  font-family: "Fraunces", serif;
  font-size: 21px;
  font-weight: 800;
  transform: rotate(-3deg);
}

.event-stamp strong {
  font-size: 14px;
  letter-spacing: 0.14em;
}

.event-stamp small {
  margin-top: 1px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.17em;
}

.progress {
  width: min(430px, calc(100% - 48px));
  margin: 30px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.progress::before {
  content: "";
  height: 1px;
  position: absolute;
  left: 39px;
  right: 39px;
  top: 15px;
  background: rgba(120, 1, 22, 0.18);
}

.progress-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: rgba(69, 20, 20, 0.42);
  position: relative;
  z-index: 1;
}

.progress-item > span {
  width: 31px;
  height: 31px;
  border: 1px solid rgba(120, 1, 22, 0.18);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--fs-small);
  font-weight: 700;
  background: var(--cream);
}

.progress-item b {
  font-size: var(--fs-label);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.progress-item.active {
  color: var(--wine);
}

.progress-item.active > span {
  color: var(--white);
  background: var(--wine);
  border-color: var(--wine);
  box-shadow: 0 0 0 4px var(--paper);
}

.workspace {
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100vh - 238px);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.stage {
  padding: 38px 0 56px;
  animation: stage-in 0.48s ease both;
}

@keyframes stage-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-layout {
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--coral);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 8px;
  color: var(--wine);
  font-family: "Fraunces", serif;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1;
  letter-spacing: -0.045em;
}

h1 em {
  color: var(--coral);
  font-weight: inherit;
}

.intro {
  margin: 0 auto;
  max-width: 570px;
  color: rgba(69, 20, 20, 0.67);
  font-size: var(--fs-body);
  line-height: 1.65;
}

.layout-options {
  margin: 32px auto 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.layout-card {
  min-width: 0;
  padding: 10px 10px 15px;
  border: 1px solid rgba(120, 1, 22, 0.12);
  border-radius: 15px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.76);
  box-shadow: 0 9px 30px rgba(120, 1, 22, 0.06);
  cursor: pointer;
  position: relative;
  transition: 0.22s ease;
}

.layout-card:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 87, 42, 0.45);
  box-shadow: 0 14px 35px rgba(120, 1, 22, 0.1);
}

.layout-card.selected {
  border: 2px solid var(--coral);
  padding: 9px 9px 14px;
  background: var(--white);
  box-shadow: 0 12px 34px rgba(216, 87, 42, 0.14);
}

.layout-preview {
  height: 150px;
  padding: 17px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background:
    linear-gradient(rgba(120, 1, 22, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 1, 22, 0.04) 1px, transparent 1px),
    #f9edcf;
  background-size: 15px 15px;
}

.layout-glyph {
  height: 100%;
  aspect-ratio: 0.86;
  padding: 6px;
  display: grid;
  gap: 5px;
  background: var(--white);
  box-shadow: 0 6px 16px rgba(69, 20, 20, 0.13);
  transform: rotate(-1.5deg);
}

.layout-glyph-2 {
  grid-template-rows: repeat(2, 1fr);
}

.layout-glyph-3 {
  grid-template-rows: repeat(3, 1fr);
}

.layout-glyph span {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--gold), var(--coral));
}

.layout-glyph span::before {
  content: "";
  width: 32%;
  aspect-ratio: 1;
  border-radius: 50%;
  position: absolute;
  top: 18%;
  left: 34%;
  background: var(--paper);
}

.layout-glyph i {
  width: 58%;
  height: 45%;
  border-radius: 60px 60px 0 0;
  position: absolute;
  bottom: 0;
  left: 21%;
  background: var(--wine);
}

.layout-copy {
  padding: 13px 9px 0;
}

.layout-copy span,
.layout-copy small {
  display: block;
}

.layout-copy span {
  font-family: "Fraunces", serif;
  color: var(--wine);
  font-size: clamp(19px, 0.6vw + 16px, 22px);
  font-weight: 700;
}

.layout-copy small {
  margin-top: 4px;
  color: rgba(69, 20, 20, 0.5);
  font-size: var(--fs-small);
}

.selection-check {
  width: 23px;
  height: 23px;
  display: none;
  place-items: center;
  position: absolute;
  right: 13px;
  bottom: 17px;
  border-radius: 50%;
  color: var(--white);
  background: var(--coral);
}

.layout-card.selected .selection-check {
  display: grid;
}

.button {
  min-height: 47px;
  padding: 0 23px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  font-size: var(--fs-body);
  font-weight: 700;
  letter-spacing: 0.045em;
  cursor: pointer;
  transition: 0.2s ease;
}

.button-primary {
  color: var(--white);
  background: var(--wine);
  box-shadow: 0 8px 18px rgba(120, 1, 22, 0.22);
}

.button-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--red);
  box-shadow: 0 11px 24px rgba(120, 1, 22, 0.25);
}

.button-secondary {
  color: var(--wine);
  border: 1px solid rgba(120, 1, 22, 0.24);
  background: var(--white);
}

.button-secondary:hover {
  border-color: var(--wine);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.microcopy {
  margin: 13px 0 0;
  color: rgba(69, 20, 20, 0.44);
  font-size: var(--fs-small);
  letter-spacing: 0.03em;
  text-align: center;
}

.stage-capture {
  --cam-w: min(75vw, 1180px, max(480px, calc((100vh - 250px) * 1.3333)));
  padding-top: 16px;
}

body[data-stage="capture"] .workspace { width: min(1400px, calc(100% - 40px)); }

.capture-heading {
  width: var(--cam-w);
  max-width: 100%;
  margin: 0 auto 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.capture-heading .intro {
  margin: 0;
}

.capture-heading h1 {
  margin: 6px 0 0;
  font-size: clamp(30px, 3.2vw, 44px);
}

.shot-counter {
  min-width: 95px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--wine);
}

.shot-counter strong {
  font-family: "Fraunces", serif;
  font-size: 37px;
  line-height: 1;
}

.shot-counter span {
  padding-left: 9px;
  border-left: 1px solid rgba(120, 1, 22, 0.2);
  font-size: var(--fs-label);
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.camera-frame {
  width: var(--cam-w, 810px);
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  border: 9px solid var(--wine);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: #2d1718;
  box-shadow: 0 18px 45px rgba(120, 1, 22, 0.18);
}

.camera-frame video,
.demo-view {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.demo-view {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 58%, var(--paper) 0 8%, transparent 8.5%),
    radial-gradient(circle at 50% 42%, var(--paper) 0 12%, transparent 12.5%),
    linear-gradient(135deg, var(--orange), var(--red));
}

.demo-view span {
  position: absolute;
  bottom: 18px;
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--fs-label);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transform: scaleX(-1);
}

.viewfinder-corner {
  width: 31px;
  height: 31px;
  position: absolute;
  border-color: rgba(255, 255, 255, 0.75);
}

.corner-tl { left: 19px; top: 19px; border-left: 2px solid; border-top: 2px solid; }
.corner-tr { right: 19px; top: 19px; border-right: 2px solid; border-top: 2px solid; }
.corner-bl { left: 19px; bottom: 19px; border-left: 2px solid; border-bottom: 2px solid; }
.corner-br { right: 19px; bottom: 19px; border-right: 2px solid; border-bottom: 2px solid; }

.countdown-overlay,
.capture-complete {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: rgba(120, 1, 22, 0.38);
  backdrop-filter: blur(2px);
}

.countdown-overlay span {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50px;
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.countdown-overlay strong {
  margin: 2px 0 -4px;
  font-family: "Fraunces", serif;
  font-size: clamp(92px, 14vw, 150px);
  line-height: 1;
  text-shadow: 0 8px 30px rgba(120, 1, 22, 0.25);
  animation: count-pop 0.35s ease;
}

@keyframes count-pop {
  from { transform: scale(1.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.countdown-overlay small {
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.capture-complete {
  background: rgba(120, 1, 22, 0.78);
}

.capture-complete > span {
  width: 51px;
  height: 51px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--wine);
  background: var(--gold);
}

.capture-complete strong {
  font-family: "Fraunces", serif;
  font-size: 36px;
}

.capture-complete small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.75);
}

.camera-error {
  width: var(--cam-w, 810px);
  margin: 14px auto 0;
  padding: 10px 10px 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(195, 47, 39, 0.2);
  border-radius: 8px;
  color: var(--red);
  background: rgba(255, 253, 248, 0.9);
  font-size: var(--fs-small);
}

.camera-error {
  flex-direction: column;
  align-items: stretch;
  line-height: 1.55;
}

.camera-error small { opacity: 0.7; }

.camera-error-actions {
  display: flex;
  gap: 8px;
}

.camera-error .button {
  min-height: 37px;
  padding: 0 14px;
}

.camera-note {
  width: var(--cam-w, 810px);
  margin: 12px auto 0;
  color: rgba(69, 20, 20, 0.6);
  font-size: var(--fs-small);
  text-align: center;
}

.crop-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 3px dashed var(--gold);
  box-shadow: 0 0 0 100vmax rgba(45, 0, 8, 0.32);
  pointer-events: none;
}

.crop-guide span {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 50px;
  color: var(--wine);
  background: var(--gold);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.operator-banner {
  max-width: 620px;
  margin: 0 auto 22px;
  padding: 10px 14px;
  border: 1px solid rgba(195, 47, 39, 0.3);
  border-radius: 8px;
  color: var(--red);
  background: rgba(255, 253, 248, 0.95);
  font-size: var(--fs-small);
  line-height: 1.55;
  text-align: left;
}

.capture-actions {
  min-height: 47px;
  margin-top: 20px;
  text-align: center;
}

.no-retake {
  color: var(--coral);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stage-filter {
  max-width: 930px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: clamp(50px, 8vw, 90px);
  align-items: flex-start;
}

.filter-copy h1 {
  font-size: clamp(42px, 5vw, 58px);
}

.filter-copy .intro {
  margin: 0;
}

.filter-options {
  margin: 24px 0 25px;
  display: grid;
  gap: 7px;
}

.filter-option {
  min-height: 47px;
  padding: 6px 12px 6px 7px;
  display: grid;
  grid-template-columns: 35px 1fr 20px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(120, 1, 22, 0.11);
  border-radius: 7px;
  color: rgba(69, 20, 20, 0.68);
  background: rgba(255, 253, 248, 0.68);
  font-size: var(--fs-body);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.filter-option.selected {
  color: var(--wine);
  border-color: var(--coral);
  background: var(--white);
  box-shadow: 0 6px 18px rgba(120, 1, 22, 0.08);
}

.filter-swatch {
  width: 35px;
  height: 35px;
  border-radius: 4px;
}

.filter-option i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(120, 1, 22, 0.16);
  border-radius: 50%;
  color: transparent;
}

.filter-option.selected i {
  color: var(--white);
  border-color: var(--coral);
  background: var(--coral);
}

.align-left {
  text-align: left;
}

.keepsake-wrap {
  position: sticky;
  top: 18px;
  width: min(100%, 360px);
  margin: 0 auto;
  text-align: center;
  transform: rotate(1.1deg);
}

.keepsake-sheet {
  padding: 0;
  aspect-ratio: 2 / 3;
  position: relative;
}

.keepsake-sheet.is-landscape { aspect-ratio: 3 / 2; }

.keepsake-wrap.is-landscape { width: min(100%, 500px); }

.slot-layer { position: absolute; inset: 0; pointer-events: none; }

.slot-hit {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.slot-hit:focus-visible,
.slot-hit.selected {
  box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 0 5px var(--wine);
  background: rgba(69, 20, 20, 0.32);
}

.retake-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 8px;
  border-radius: 50px;
  color: var(--wine);
  background: rgba(255, 253, 248, 0.88);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s;
}

.slot-hit:hover .retake-badge,
.slot-hit:focus-visible .retake-badge { opacity: 1; }

@media (hover: none) { .retake-badge { opacity: 1; } }

.slot-hit.used .retake-badge { color: rgba(69, 20, 20, 0.7); }

.slot-hit.selected .retake-badge.final {
  position: static;
  opacity: 1;
  font-size: var(--fs-small);
  padding: 7px 14px;
}

.retake-pill {
  min-height: 42px;
  padding: 0 22px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--wine);
  background: var(--gold);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: count-pop 0.25s ease;
}

.retake-pill:hover { background: #ffc85a; }

.retake-note {
  margin: 12px 0 0;
  color: var(--coral);
  font-size: var(--fs-small);
  line-height: 1.55;
}

.retake-note b { color: var(--wine); }

.keepsake-sheet canvas,
.keepsake-sheet img {
  width: 100%;
  height: 100%;
}

.keepsake-wrap > p {
  color: rgba(69, 20, 20, 0.42);
  font-size: var(--fs-label);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.keepsake {
  padding: 18px;
  color: var(--wine);
  background: var(--white);
  box-shadow: 0 24px 55px rgba(120, 1, 22, 0.2);
}

.keepsake-top {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
}

.keepsake-top span {
  font-family: "Fraunces", serif;
  font-size: 14px;
  font-weight: 800;
}

.keepsake-top small {
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--coral);
}

.keepsake-top b {
  width: 27px;
  height: 27px;
  margin-left: auto;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--wine);
  font-family: "Fraunces", serif;
  font-size: 12px;
}

.photo-composition {
  aspect-ratio: 1.5;
  display: grid;
  gap: 5px;
  padding: 5px;
  background: var(--wine);
  overflow: hidden;
}

.composition-2 {
  grid-template-columns: repeat(2, 1fr);
}

.composition-3 {
  grid-template-columns: repeat(3, 1fr);
}

.photo-slot {
  overflow: hidden;
  background: var(--paper);
}

.photo-slot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: filter 0.3s ease;
}

.empty-photo {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(120, 1, 22, 0.35);
  font-size: var(--fs-label);
}

.tape {
  width: 82px;
  height: 22px;
  position: absolute;
  z-index: 2;
  top: -5px;
  background: rgba(247, 181, 56, 0.65);
  box-shadow: 0 1px 2px rgba(120, 1, 22, 0.08);
}

.tape-left {
  left: -20px;
  transform: rotate(-35deg);
}

.tape-right {
  right: -20px;
  transform: rotate(35deg);
}

footer {
  min-height: 42px;
  padding: 0 6vw;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: rgba(120, 1, 22, 0.55);
  border-top: 1px solid rgba(120, 1, 22, 0.1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

footer i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(63, 0, 11, 0.76);
  backdrop-filter: blur(7px);
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.printing-modal {
  width: min(430px, 100%);
  padding: 38px 42px 35px;
  border: 1px solid rgba(247, 181, 56, 0.55);
  border-radius: 16px;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0, rgba(247, 181, 56, 0.2), transparent 45%),
    var(--cream);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  animation: modal-in 0.4s cubic-bezier(0.2, 0.9, 0.25, 1.1);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.9) translateY(15px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.printer-animation {
  height: 128px;
  position: relative;
}

.printer-top {
  width: 96px;
  height: 70px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--gold);
  background: var(--wine);
  position: relative;
  z-index: 2;
}

.paper {
  width: 72px;
  height: 82px;
  padding: 6px;
  position: absolute;
  left: calc(50% - 36px);
  top: 51px;
  background: var(--white);
  box-shadow: 0 5px 12px rgba(120, 1, 22, 0.13);
  animation: print-paper 2.2s ease-in-out infinite;
}

.paper-photo {
  height: 50px;
  background: linear-gradient(135deg, var(--gold), var(--coral), var(--wine));
}

.paper span {
  color: var(--wine);
  font-size: 4px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

@keyframes print-paper {
  0%, 15% { transform: translateY(-32px); opacity: 0; }
  35% { opacity: 1; }
  75%, 100% { transform: translateY(4px); opacity: 1; }
}

.printing-status {
  margin: 11px 0 12px;
  display: flex;
  justify-content: center;
  gap: 5px;
}

.printing-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
  animation: dot 1s ease infinite;
}

.printing-status i:nth-child(2) { animation-delay: 0.16s; }
.printing-status i:nth-child(3) { animation-delay: 0.32s; }

.printing-modal h2 {
  margin: 0;
  color: var(--wine);
  font-family: "Fraunces", serif;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.printing-modal p {
  max-width: 305px;
  margin: 10px auto 23px;
  color: rgba(69, 20, 20, 0.62);
  font-size: var(--fs-body);
  line-height: 1.6;
}

@media (max-width: 720px) {
  .topbar {
    height: 72px;
    padding: 0 18px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand span,
  .event-stamp div {
    display: none;
  }

  .event-stamp > span {
    width: 37px;
    height: 37px;
  }

  .progress {
    margin-top: 23px;
  }

  .workspace {
    width: min(100% - 28px, 540px);
  }

  .stage {
    padding-top: 30px;
  }

  .layout-options {
    margin-top: 25px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .layout-card {
    padding: 8px;
    display: grid;
    grid-template-columns: 112px 1fr;
    align-items: center;
  }

  .layout-card.selected {
    padding: 7px;
  }

  .layout-preview {
    height: 82px;
    padding: 10px;
  }

  .layout-copy {
    padding: 0 13px;
  }

  .selection-check {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  .capture-heading {
    align-items: flex-start;
  }

  .capture-heading .intro {
    padding-right: 15px;
  }

  .shot-counter {
    min-width: auto;
    margin-top: 18px;
  }

  .shot-counter span {
    display: none;
  }

  .camera-frame {
    aspect-ratio: 3 / 4;
  }

  .stage-filter {
    display: flex;
    flex-direction: column-reverse;
    gap: 36px;
    align-items: stretch;
  }

  .keepsake-wrap {
    width: min(400px, calc(100% - 16px));
    margin: 0 auto;
  }

  .filter-copy {
    text-align: center;
  }

  .filter-copy .intro {
    margin: 0 auto;
  }

  .align-left {
    text-align: center;
  }

  .printing-modal {
    padding: 33px 24px 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.qr-box {
  width: 74px;
  height: 74px;
  padding: 5px;
  border: 2px solid var(--wine);
  background: #fff;
}

.qr-box svg {
  width: 100%;
  height: 100%;
}


/* ---------- Printing modal states ---------- */
.printing-modal .button + .button { margin-left: 8px; }

.modal-error {
  margin: 0 auto 20px;
  max-width: 320px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--red);
  background: rgba(195, 47, 39, 0.07);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.printing-modal.is-error .printing-status,
.printing-modal.is-error .printer-animation { display: none; }

/* Hidden image the browser prints */
#print-root { display: none; }

@page { size: 4in 6in; margin: 0; }

/* Print: the keepsake is fitted INSIDE whatever page box the printer gives us (never larger),
   centred, with an equal safe margin on every side (--pm) and optional shift (--px / --py).
   Paper stays 4 x 6 in. Staff adjust the margin/shift in the Print station panel. */
@media print {
  html, body {
    width: 100% !important; height: 100% !important; min-height: 0 !important; min-width: 0 !important;
    margin: 0 !important; padding: 0 !important; overflow: hidden !important;
    background: #fff !important; background-image: none !important;
  }
  body::before, body::after { display: none !important; }
  .app-shell { display: none !important; }
  #print-root {
    display: block !important;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    margin: 0; padding: 0; overflow: hidden; background: #fff;
  }
  #print-root img {
    display: block; position: absolute; left: 50%; top: 50%;
    width: calc(100% - 2 * var(--pm, 0mm)); height: calc(100% - 2 * var(--pm, 0mm));
    max-width: none; object-fit: contain;
    transform: translate(calc(-50% + var(--px, 0mm)), calc(-50% + var(--py, 0mm)));
  }
}

/* ---------- QR landing page (Gallery.html) ---------- */
.gallery-stage {
  max-width: 560px;
  margin: 0 auto;
  padding: 34px 0 56px;
  text-align: center;
}

.gallery-stage .keepsake-wrap {
  position: static; /* no sticky pinning on the gallery page; shots sit below */
  margin-top: 28px;
}

.gallery-stage .keepsake { padding: 10px; }

.gallery-stage .keepsake img { width: 100%; height: auto; }

.gallery-actions {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.gallery-actions a { text-decoration: none; }

/* ---------- Message Options ---------- */
.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px;
}

.message-header h2 {
  font-family: "Fraunces", serif;
  font-size: clamp(21px, 0.6vw + 18px, 24px);
  color: var(--wine);
  margin: 0;
  letter-spacing: -0.02em;
}

.message-header span {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--coral);
  background: rgba(216, 87, 42, 0.12);
  padding: 4px 8px;
  border-radius: 4px;
}

.message-options {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-options::-webkit-scrollbar {
  width: 6px;
}

.message-options::-webkit-scrollbar-track {
  background: rgba(219, 124, 38, 0.1);
  border-radius: 10px;
}

.message-options::-webkit-scrollbar-thumb {
  background: var(--orange);
  border-radius: 10px;
}

.message-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(120, 1, 22, 0.11);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.68);
  text-align: left;
  cursor: pointer;
  transition: 0.2s;
}

.message-option.selected {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 6px 16px rgba(219, 124, 38, 0.12);
}

.message-option i {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(120, 1, 22, 0.22);
  display: grid;
  place-items: center;
  color: transparent;
  margin-top: 1px;
}

.message-option.selected i {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.message-option div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-option strong {
  font-size: var(--fs-body);
  color: var(--wine);
  font-weight: 700;
}

.message-option span {
  font-size: var(--fs-small);
  color: rgba(69, 20, 20, 0.6);
  line-height: 1.45;
}

/* Updates to keepsake bottom to hold the new text */
.keepsake-bottom {
  min-height: 86px;
  padding-top: 12px;
  gap: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
}

.keepsake-bottom-text {
  flex: 1;
  padding-right: 15px; /* Keeps text from touching the QR section */
}

.keepsake-bottom-text strong {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 15px;
}

.keepsake-bottom-text span {
  display: block;
  margin-top: 2px;
  color: var(--coral);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#keepsake-message-preview {
  margin-top: 14px;
  color: var(--orange); /* Vibrant, themed orange */
  font-family: 'Caveat', cursive; /* Cute handwriting font */
  font-size: 20px; 
  font-weight: 600;
  line-height: 1.2;
}

.qr-slot {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.qr-slot p {
  margin: 0;
  color: rgba(69, 20, 20, 0.62);
  font-size: 7.5px;
  line-height: 1.3;
}

.gallery-stage .keepsake-sheet { aspect-ratio: auto; }

.gallery-actions .button { min-width: 220px; }

.gallery-status {
  min-height: 16px;
  color: rgba(69, 20, 20, 0.6);
  font-size: var(--fs-small);
}

.gallery-shots { margin-top: 44px; }

.gallery-shots h2 {
  margin: 0 0 16px;
  color: var(--wine);
  font-family: "Fraunces", serif;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.shot-card {
  padding: 8px 8px 12px;
  border: 1px solid rgba(120, 1, 22, 0.12);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.85);
}

.shot-card img { width: 100%; height: auto; border-radius: 4px; }

.shot-card .button { min-height: 36px; margin-top: 10px; padding: 0 14px; font-size: var(--fs-small); }

/* ---------- Sticky header + logo tab ---------- */
.app-shell { overflow: clip; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
}

.logo-tab {
  height: calc(100% + 5px);
  padding: 0 18px 4px;
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  border-radius: 0 0 24px 24px;
  background: var(--cream);
  box-shadow: 0 8px 18px rgba(69, 0, 10, 0.3);
  transform: translate(-50%, -105%);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.logo-tab img {
  width: auto;
  height: 76px;
}

body.logo-in-header .logo-tab { transform: translate(-50%, 0); }

.hero-logo {
  width: auto;
  height: clamp(190px, 30vh, 270px);
  margin: 0 auto 10px;
  filter: drop-shadow(0 12px 22px rgba(120, 1, 22, 0.2));
  transition: opacity 0.3s ease;
}

body.logo-in-header .hero-logo { opacity: 0; }

@media (max-width: 640px) {
  .brand strong, .brand span, .event-stamp strong, .event-stamp small { display: none; }
  .logo-tab img { height: 62px; }
  .hero-logo { height: 180px; }
}

/* ---------- Landscape layout glyph ---------- */
.layout-glyph-landscape {
  aspect-ratio: 1.5;
  grid-template-rows: none;
  grid-template-columns: 1fr 0.3fr;
}

.layout-glyph-landscape b {
  position: relative;
  background: var(--paper);
}

.layout-glyph-landscape b::before {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 8%;
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, var(--wine) 0 35%, transparent 35% 50%, var(--wine) 50% 100%);
}

.layout-glyph-landscape b::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  top: 12%;
  height: 22%;
  background: var(--coral);
  opacity: 0.55;
}

.camera-frame .capture-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 6;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

.camera-frame .capture-actions .microcopy { margin: 0; color: var(--white); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }

/* ---------- Custom message ---------- */
.custom-message {
  display: none;
  margin: -2px 0 2px;
  padding: 14px;
  border: 1px solid rgba(219, 124, 38, 0.35);
  border-radius: 8px;
  background: rgba(247, 181, 56, 0.1);
}

.message-option.selected + .custom-message { display: block; }

.custom-message label {
  display: block;
  margin-bottom: 8px;
  color: var(--wine);
  font-size: var(--fs-small);
  font-weight: 700;
}

.custom-message textarea {
  width: 100%;
  min-height: 92px;
  padding: 12px;
  resize: vertical;
  color: var(--wine);
  font: inherit;
  font-size: var(--fs-body);
  line-height: 1.5;
  border: 2px solid var(--orange);
  border-radius: 8px;
  background: var(--white);
  outline: none;
  box-sizing: border-box;
}

.custom-count {
  margin-top: 6px;
  text-align: right;
  color: rgba(69, 20, 20, 0.5);
  font-size: var(--fs-small);
}

.custom-hint {
  margin: 4px 0 0;
  color: rgba(69, 20, 20, 0.55);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.message-options { max-height: 360px; }

body[data-stage="capture"] .progress { margin-top: 14px; }

/* =====================================================================
   READABLE + RESPONSIVE LAYER  (phones 360px  ->  laptop/kiosk)
   Paper size is NOT touched here: @page stays 4in x 6in (see @media print).
   ===================================================================== */
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100vh; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }

.eyebrow, .progress-item b, .brand span, .message-header span, .no-retake, .shot-counter span { letter-spacing: 0.06em; }
.progress-item b { font-size: var(--fs-label); }
.progress-item > span { width: 36px; height: 36px; font-size: var(--fs-small); }
.progress::before { top: 18px; }
.intro { max-width: 620px; line-height: 1.55; color: rgba(69, 20, 20, 0.82); }

.button { min-height: 56px; padding: 0 28px; border-radius: 10px; letter-spacing: 0.01em; }
.camera-error .button { min-height: 48px; }
.shot-card .button { min-height: 48px; font-size: var(--fs-small); }
.layout-card { padding: 12px 12px 18px; }
.layout-copy small { color: rgba(69, 20, 20, 0.72); }
.filter-option { min-height: 56px; grid-template-columns: 40px 1fr 24px; }
.filter-swatch { width: 40px; height: 40px; }
.filter-option i { width: 22px; height: 22px; }
.message-option { padding: 16px; }
.message-option span { line-height: 1.45; color: rgba(69, 20, 20, 0.78); }
.microcopy, .custom-hint, .custom-count { color: rgba(69, 20, 20, 0.68); }
.camera-error, .camera-note { line-height: 1.5; }
.custom-message textarea { min-height: 110px; }
.retake-pill { min-height: 44px; padding: 0 16px; }

/* flip-camera + native-camera fallback */
.flip-camera {
  position: absolute; top: 14px; right: 14px; z-index: 7;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--white); background: rgba(63, 0, 11, 0.62);
  font-size: var(--fs-small); font-weight: 700;
}
.camera-frame[data-facing="environment"] video { transform: none; }
.native-shot { text-align: center; }

/* ---------- tablets and phones ---------- */
@media (max-width: 720px) {
  .workspace { width: min(100% - 28px, 560px); min-height: 0; }
  .stage { padding: 22px 0 36px; }
  h1 { font-size: clamp(34px, 9.5vw, 44px); }
  .topbar { height: 68px; }
  .progress { width: calc(100% - 32px); }
  .stage-layout > .button, .stage-filter .filter-copy > .button { width: 100%; }
  .layout-card { grid-template-columns: 120px 1fr; }
  .layout-preview { height: 92px; }

  /* camera uses the full width; frame ratio follows the capture ratio (set by script.js) */
  .stage-capture { --cam-w: 100%; padding-top: 10px; }
  .camera-frame { border-width: 6px; border-radius: 12px; }
  .camera-frame[data-ratio="landscape"] { aspect-ratio: 4 / 3; }
  .camera-frame[data-ratio="portrait"]  { aspect-ratio: 3 / 4; max-height: 70dvh; margin-inline: auto; width: auto; max-width: 100%; }
  .camera-frame .capture-actions { bottom: 14px; padding: 0 12px; }
  .camera-frame .capture-actions .button { width: 100%; max-width: 360px; }
  .capture-heading { align-items: center; }
  .shot-counter span { display: none; }
  .shot-counter { margin-top: 0; }
  .countdown-overlay strong { font-size: clamp(96px, 34vw, 150px); }

  /* filter stage: preview first, controls below, one tall scroll with no nested scroller */
  .stage-filter { gap: 26px; }
  .keepsake-wrap { position: relative; top: auto; transform: none; width: min(380px, 100%); margin-top: 14px; }
  .keepsake-wrap.is-landscape { width: 100%; }
  .filter-copy { text-align: left; }
  .message-options { max-height: none; overflow: visible; padding-right: 0; }
  .filter-options { grid-template-columns: 1fr; }
  .custom-message textarea { font-size: 17px; }
  .align-left { text-align: center; }
  .printing-modal { padding: 28px 20px 24px; }
  footer { padding: 10px 12px; flex-wrap: wrap; text-align: center; }
}

/* very small phones */
@media (max-width: 380px) {
  .workspace { width: calc(100% - 20px); }
  .layout-card { grid-template-columns: 96px 1fr; }
  .button { padding: 0 18px; }
}

/* big shared screens (laptop booth, 1366px and up) */
@media (min-width: 1100px) {
  .stage-filter { max-width: 1040px; }
  .layout-options { gap: 24px; }
}

@media (prefers-contrast: more) {
  .intro, .microcopy, .message-option span, .layout-copy small { color: var(--ink); }
}

.staff-link {
  margin-left: 12px; padding: 6px 12px; border-radius: 999px;
  color: rgba(120, 1, 22, 0.7); font: inherit; font-size: 12px; font-weight: 700;
  border: 1px solid rgba(120, 1, 22, 0.2); background: transparent; cursor: pointer;
}
.staff-link:hover { color: var(--wine); border-color: var(--wine); }

/* =====================================================================
   STAFF PANEL + PRINT STATION (only drawn after the password is accepted)
   ===================================================================== */
.station-pill {
  position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: none; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 18px; border-radius: 999px;
  color: var(--white); background: var(--wine); border: 2px solid var(--gold);
  font-size: var(--fs-small); font-weight: 700; box-shadow: 0 10px 26px rgba(63, 0, 11, 0.35);
}
.station-pill.on { display: inline-flex; }
.station-pill .dot { width: 12px; height: 12px; border-radius: 50%; background: #7bd88f; }
.station-pill.paused .dot { background: var(--gold); }
.station-pill.error .dot { background: #ff6b5e; }

.station-overlay {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto;
  padding: 18px; background: rgba(63, 0, 11, 0.86); backdrop-filter: blur(6px);
}
.station-card {
  width: min(1100px, 100%); margin: 0 auto; padding: clamp(18px, 3vw, 30px);
  border-radius: 16px; color: var(--ink); background: var(--cream);
  border: 1px solid rgba(247, 181, 56, 0.6);
}
.station-card h2 { margin: 0; color: var(--wine); font-family: "Fraunces", serif; font-size: clamp(24px, 3vw, 32px); }
.station-card h3 { margin: 0 0 10px; color: var(--wine); font-size: var(--fs-body); }
.station-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.station-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.station-actions .button { min-height: 48px; padding: 0 18px; font-size: var(--fs-small); }
.station-grid { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 800px) { .station-grid { grid-template-columns: 1fr; } }
.now-box { padding: 14px; border-radius: 12px; background: var(--white); border: 1px solid rgba(120, 1, 22, 0.14); text-align: center; }
.now-box .now-img { width: 100%; aspect-ratio: 2 / 3; border-radius: 8px; background: var(--paper); display: grid; place-items: center; overflow: hidden; color: rgba(69, 20, 20, 0.6); font-size: var(--fs-small); }
.now-box .now-img.is-landscape { aspect-ratio: 3 / 2; }
.now-box .now-img img { width: 100%; height: 100%; object-fit: contain; }
.now-box .now-meta { margin-top: 10px; font-size: var(--fs-small); line-height: 1.5; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { padding: 12px 8px; border-radius: 10px; text-align: center; background: var(--white); border: 1px solid rgba(120, 1, 22, 0.12); }
.stat strong { display: block; font-family: "Fraunces", serif; font-size: clamp(26px, 4vw, 38px); color: var(--wine); line-height: 1.1; }
.stat span { font-size: var(--fs-label); color: rgba(69, 20, 20, 0.75); }
.stat.hot strong { color: var(--coral); }
.queue-list { max-height: 46vh; overflow-y: auto; border: 1px solid rgba(120, 1, 22, 0.12); border-radius: 10px; background: var(--white); }
.queue-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid rgba(120, 1, 22, 0.08); font-size: var(--fs-small); }
.queue-item:last-child { border-bottom: 0; }
.queue-item small { display: block; color: rgba(69, 20, 20, 0.7); font-size: var(--fs-label); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-label); font-weight: 700; background: var(--paper); color: var(--wine); }
.tag.printing { background: var(--gold); }
.tag.printed { background: #d6efd9; color: #1d5a2a; }
.tag.failed { background: #ffd9d4; color: #9b1c12; }
.mini-btn { min-height: 40px; padding: 0 12px; border-radius: 8px; font-size: var(--fs-label); font-weight: 700; color: var(--wine); border: 1px solid rgba(120, 1, 22, 0.3); background: var(--white); }
.station-note { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: var(--fs-small); line-height: 1.5; background: rgba(247, 181, 56, 0.2); }
.station-note.bad { background: #ffd9d4; color: #7b140c; }
.station-field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; font-size: var(--fs-small); }
.station-field input[type="password"], .station-field input[type="number"] {
  min-height: 48px; padding: 0 12px; font: inherit; font-size: 17px; border-radius: 8px;
  border: 2px solid var(--orange); background: var(--white); color: var(--wine); width: 100%; max-width: 280px;
}
.station-field input[type="number"] { width: 100px; }

@media print {
  .station-pill, .station-overlay { display: none !important; }
}
.native-view { width: 100%; height: 100%; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--white); font-size: var(--fs-body); line-height: 1.5; background: linear-gradient(135deg, var(--orange), var(--red)); }

/* flash */
.screen-flash { position: fixed; inset: 0; z-index: 95; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.35s ease-out; }
.screen-flash.on { opacity: 1; transition: opacity 0.06s ease-in; }
.flash-toggle {
  position: absolute; top: 14px; left: 14px; z-index: 7;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  color: var(--white); background: rgba(63, 0, 11, 0.62);
  font-size: var(--fs-small); font-weight: 700; border: 2px solid transparent;
}
.flash-toggle.on { color: var(--wine); background: var(--gold); }
.fit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.fit-grid label { display: grid; gap: 4px; font-size: var(--fs-label); font-weight: 700; color: var(--wine); }
.fit-grid input { min-height: 48px; width: 100%; padding: 0 10px; font: inherit; font-size: 17px; border-radius: 8px; border: 2px solid var(--orange); background: var(--white); color: var(--wine); }
@media (max-width: 560px) { .fit-grid { grid-template-columns: 1fr; } }
.station-card .microcopy { text-align: left; }

/* print station: compact preview, independent scrolling lists, collapsible sections, viewer pop-up */
.station-grid { grid-template-columns: minmax(220px, 300px) 1fr; }
@media (max-width: 800px) { .station-grid { grid-template-columns: 1fr; } }
.queue-list { height: 320px; max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; }
.queue-item.is-click { cursor: pointer; }
.queue-item.is-click:hover, .queue-item.is-click:focus-visible { background: rgba(247, 181, 56, 0.16); outline: none; }
.st-sec { margin-top: 16px; border: 1px solid rgba(120, 1, 22, 0.16); border-radius: 10px; background: var(--white); }
.st-sec > summary {
  list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; color: var(--wine); font-weight: 700; font-size: var(--fs-body);
}
.st-sec > summary::-webkit-details-marker { display: none; }
.st-sec > summary::after { content: "+"; font-size: 26px; line-height: 1; color: var(--orange); }
.st-sec[open] > summary::after { content: "\2212"; }
.st-sec[open] > summary { border-bottom: 1px solid rgba(120, 1, 22, 0.12); }
.st-sec > :not(summary) { margin-left: 16px; margin-right: 16px; }
.st-sec > .fit-grid { margin-top: 12px; }
.st-sec > :last-child { margin-bottom: 16px; }
.station-viewer { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(30, 0, 6, 0.78); }
.viewer-card { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px; border-radius: 14px; background: var(--cream); border: 1px solid rgba(247, 181, 56, 0.6); text-align: center; }
.viewer-img { width: min(100%, 340px); margin: 0 auto 12px; aspect-ratio: 2 / 3; display: grid; place-items: center; background: var(--paper); border-radius: 6px; overflow: hidden; font-size: var(--fs-small); }
.viewer-img.is-landscape { width: 100%; aspect-ratio: 3 / 2; }
.viewer-img img { width: 100%; height: 100%; object-fit: contain; }
.viewer-meta { font-size: var(--fs-small); line-height: 1.5; margin-bottom: 12px; }
.viewer-actions { justify-content: center; }
@media print { .station-viewer { display: none !important; } }
