:root {
  --lime: #e0f79a;
  --lavender: #aba6cf;
  --sky: #c5d8e6;
  --white: #ffffff;
  --ink: #1d1b2e;
  --ink-soft: #4a4763;
  --shade: #7d78a8;      /* bevel shadow */
  --error: #b3261e;
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --taskbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--sky);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
@media (min-width: 601px) { .narrow-only { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Board ---------- */

.board {
  position: fixed;
  inset: 0 0 var(--taskbar-h) 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  background: linear-gradient(180deg, #a9c8e4 0%, #c5d8e6 55%, #e3ecf4 100%);
}
.board.dragging { cursor: grabbing; }
.sky { position: absolute; inset: -50px; pointer-events: none; }
/* Two cloud layers drifting at different speeds; translating (not repainting) keeps it smooth. */
.clouds {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(100% + 1600px);
  background: url("/img/clouds.svg") 0 0 / 1600px 1000px repeat;
  animation: drift 160s linear infinite;
}
.clouds-far {
  width: calc(100% + 2400px);
  background-size: 2400px 1500px;
  background-position: 700px 300px;
  opacity: .55;
  animation-duration: 600s;
  --drift: -2400px;
}
@keyframes drift { to { transform: translateX(var(--drift, -1600px)); } }

/* Vines are drawn on canvases behind the board (board.js drawVines / fxLoop) */
.vine-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* While dragging/zooming, move the board as one image */
.board.interacting .world { will-change: transform; }
.world {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}

/* Centre title */
.title {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.title-sprout {
  display: block;
  width: 176px;
  height: 176px;
  margin: 0 auto 6px;
  image-rendering: pixelated;
}
.title-kicker {
  margin: 0 0 -34px;
  font-size: 92px;
  font-weight: 700;
  letter-spacing: -.035em;
  color: var(--ink);
  text-shadow: 0 0 18px rgba(255, 255, 255, .9), 0 0 4px rgba(255, 255, 255, .9);
}
.title-word {
  margin: 0;
  font-size: 300px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.055em;
  color: var(--lime);
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
}
.title-sub {
  margin: 22px 0 0;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  text-shadow: 0 0 14px rgba(255, 255, 255, .95), 0 0 4px rgba(255, 255, 255, .95);
}
.btn.title-add {
  margin-top: 30px;
  padding: 22px 44px 24px;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -.02em;
  border-width: 4px;
  pointer-events: auto;
  box-shadow: inset -6px -6px 0 #b9d36a, 6px 6px 0 var(--ink);
}
.btn.title-add:active { box-shadow: inset 6px 6px 0 #b9d36a; transform: translate(6px, 6px); }

/* One fan's ecosystem: label + three polaroids */
.eco {
  position: absolute;
  width: 480px;
  height: 360px;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.eco-label {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 4;
  transform: translate(-50%, 0) rotate(var(--label-r, -2deg));
  padding: 8px 14px 9px;
  background: var(--lime);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  text-align: center;
  white-space: nowrap;
  line-height: 1.1;
}
.eco-name { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.eco-city { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }

.polaroid {
  position: absolute;
  margin: 0;
  width: 168px;
  padding: 9px 9px 0;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 10px 24px rgba(29, 27, 46, .18);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  transition: transform .2s ease;
}
.polaroid-img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  background: var(--sky);
}
.polaroid figcaption {
  height: 36px;
  padding: 7px 2px 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.eco:hover .polaroid { transform: translate(-50%, -52%) rotate(calc(var(--r, 0deg) * .5)); }
.eco.is-new .eco-label { animation: pop 1.2s ease 2; }
@keyframes pop { 50% { transform: translate(-50%, 0) rotate(2deg) scale(1.15); } }

/* Level of detail: zoomed far out, drop the small text */
.lod-far .polaroid figcaption { visibility: hidden; }
.lod-far .eco-city { display: none; }
.lod-far .polaroid { box-shadow: 0 6px 14px rgba(29, 27, 46, .15); }

/* ---------- Retro UI ---------- */

.btn {
  appearance: none;
  border: 2px solid var(--ink);
  background: var(--white);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: inset -3px -3px 0 var(--sky), 2px 2px 0 var(--ink);
  white-space: nowrap;
}
.btn:active { transform: translate(2px, 2px); box-shadow: inset 3px 3px 0 var(--sky); }
.btn:focus-visible, .field:focus-visible, .win-x:focus-visible { outline: 3px dashed var(--ink); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary, .btn-add { background: var(--lime); box-shadow: inset -3px -3px 0 #b9d36a, 2px 2px 0 var(--ink); }
.btn-icon { width: 40px; padding: 6px 0; font-size: 20px; line-height: 1; }

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--taskbar-h) + env(safe-area-inset-bottom));
  padding: 0 10px env(safe-area-inset-bottom);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--lavender);
  border-top: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 #cdc9ea;
  z-index: 10;
}
.btn-add { font-size: 16px; padding: 9px 16px; }
.taskbar-count {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.taskbar-tools { display: flex; gap: 6px; }

/* Your own ecosystem */
.eco.is-mine .eco-label::after {
  content: "you ✿";
  position: absolute;
  top: -14px;
  right: -16px;
  padding: 2px 8px 3px;
  background: var(--lavender);
  border: 2px solid var(--ink);
  font-size: 13px;
  font-weight: 800;
  transform: rotate(6deg);
}
.eco.is-moving { cursor: grab; z-index: 5; }
.eco.is-moving::before {
  content: "";
  position: absolute;
  inset: -16px;
  border: 4px dashed var(--ink);
  background: rgba(224, 247, 154, .25);
  animation: march 1s linear infinite;
}
.board.dragging .eco.is-moving { cursor: grabbing; }
@keyframes march { 50% { border-color: var(--lavender); } }

.movebar {
  position: fixed;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.btn-small { padding: 5px 10px; font-size: 14px; }

/* Account button + menu */
.btn-account { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
.btn-account.is-signed-in { background: var(--lavender); box-shadow: inset -3px -3px 0 #8c86b8, 2px 2px 0 var(--ink); }
.menu {
  position: fixed;
  z-index: 15;
  min-width: 220px;
  padding: 6px;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.menu-who { margin: 2px 6px 6px; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.menu-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: none;
  text-align: left;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--lime); outline: none; }

/* ---------- An ecosystem, opened (deliberately unlike the other windows) ---------- */
.eco-card {
  position: relative;
  width: min(820px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px 30px 26px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, .85) 1.2px, transparent 1.7px) 0 0 / 22px 22px,
    linear-gradient(170deg, #dfeaf3 0%, var(--sky) 45%, #cfcbe8 100%);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--ink), 0 30px 60px rgba(29, 27, 46, .35);
  animation: card-in .35s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes card-in { from { transform: translateY(24px) scale(.94) rotate(-1deg); opacity: 0; } }
.eco-card-x {
  position: sticky;
  top: 0;
  float: right;
  margin: -14px -14px 0 0;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
.eco-card-x:active { transform: translate(2px, 2px); box-shadow: none; }
.eco-card-x:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
.eco-card-head { text-align: center; margin-bottom: 18px; }
.eco-card-title { margin: 0; line-height: .9; }
.eco-card-name { display: block; font-size: clamp(30px, 6vw, 48px); font-weight: 800; letter-spacing: -.04em; color: var(--ink); overflow-wrap: anywhere; }
.eco-card-word {
  display: block;
  margin-top: -2px;
  font-size: clamp(54px, 13vw, 104px);
  font-weight: 800;
  letter-spacing: -.055em;
  color: var(--lime);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
}
.eco-card-meta {
  display: inline-block;
  margin: 12px 0 0;
  padding: 5px 12px 6px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.eco-card-head .btn { display: block; margin: 10px auto 0; }

/* Photos: a pinned-up collage, all visible at once */
.eco-card-photos { display: flex; justify-content: center; align-items: flex-start; padding: 14px 4px 6px; }
.eco-card-photo {
  position: relative;
  flex: 0 1 230px;
  min-width: 0;
  margin: 0 -10px;
  padding: 9px 9px 0;
  border: 0;
  background: var(--white);
  font: inherit;
  color: var(--ink);
  cursor: zoom-in;
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 10px 22px rgba(29, 27, 46, .25);
  transition: transform .18s ease;
}
.eco-card-photo:nth-child(2) { margin-top: 18px; z-index: 1; }
.eco-card-photo:hover, .eco-card-photo:focus-visible { transform: rotate(0deg) scale(1.04); z-index: 2; outline: none; }
.eco-card-photo::before { /* tape */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 64px;
  height: 20px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(224, 247, 154, .85);
  border: 1px solid rgba(29, 27, 46, .15);
}
.eco-card-photo .polaroid-img { width: 100%; height: auto; aspect-ratio: 1; }
.polaroid-caption { display: block; padding: 8px 2px 10px; font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.eco-card-photos[data-count="1"] .eco-card-photo { flex-basis: 300px; }
.eco-card-hint { margin: 6px 0 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); }

/* Tap-to-zoom */
.eco-zoom { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(29, 27, 46, .7); cursor: zoom-out; }
.eco-zoom[hidden] { display: none; }
.eco-zoom-photo { position: static; transform: rotate(-1.5deg); width: min(560px, 100%); padding: 12px 12px 0; margin: 0; }
.eco-zoom-photo img { display: block; width: 100%; max-height: 70dvh; object-fit: contain; background: #f4f3fb; }
.eco-zoom-photo figcaption { height: auto; padding: 12px 4px 16px; font-size: 18px; font-weight: 700; text-align: center; display: block; }

/* Guestbook on lined notebook paper */
.eco-card-paper {
  margin-top: 22px;
  padding: 18px 18px 16px 34px;
  background:
    linear-gradient(90deg, transparent 22px, #f2a8a3 22px, #f2a8a3 24px, transparent 24px),
    repeating-linear-gradient(#fff 0 27px, #dfe7f2 27px 28px);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink);
}
.eco-card-paper .guestbook { margin: 0; padding: 0; border: 0; }
.eco-card-paper .gb-item { background: rgba(255, 255, 255, .9); }

/* Guestbook */
.eco-comments {
  position: absolute;
  bottom: -14px;
  right: -18px;
  padding: 1px 7px 2px;
  background: var(--white);
  border: 2px solid var(--ink);
  font-size: 13px;
  font-weight: 800;
  transform: rotate(-4deg);
}
.lod-far .eco-comments { font-size: 22px; padding: 2px 10px; }
.guestbook { margin-top: 18px; padding-top: 14px; border-top: 2px dashed #cfcce3; }
.guestbook-title { margin: 0 0 10px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.guestbook-title span { color: var(--ink-soft); font-weight: 600; }
.guestbook-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guestbook-list:empty::before { content: "No messages yet. Be the first ✿"; color: var(--ink-soft); font-size: 14px; }
.gb-item { padding: 8px 10px; background: #f6f5fc; border: 1px solid #dcdaea; }
.gb-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13px; color: var(--ink-soft); }
.gb-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-color: var(--lavender); text-underline-offset: 2px; }
.gb-text { margin: 4px 0 0; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.gb-delete { margin-left: auto; border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.guestbook-form { margin-top: 12px; }
.guestbook-text { resize: vertical; min-height: 56px; font-size: 16px; line-height: 1.35; }
.guestbook-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.guestbook-left { font-size: 12px; color: var(--ink-soft); }
.guestbook-join { margin: 12px 0 0; font-size: 14px; color: var(--ink-soft); }

.win-signin { width: min(440px, 100%); }
.field-code { font-size: 28px; font-weight: 800; letter-spacing: .3em; text-align: center; }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 700; text-decoration: underline; cursor: pointer; }
.step-help.signin-new { margin: 24px 0 0; font-size: 14px; }
[data-signin="code"] .link-btn { margin-top: 10px; font-size: 14px; }

/* Listen / pre-save pop-up: floats bottom-right, doesn't block the board */
.listen {
  position: fixed;
  right: 16px;
  bottom: calc(var(--taskbar-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 12;
  width: min(360px, calc(100% - 32px));
  animation: pop-in .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop-in { from { transform: translateY(30px) scale(.9); opacity: 0; } }
.listen-body { display: grid; grid-template-columns: 52px 1fr; gap: 6px 14px; align-items: start; }
.listen-sprout { width: 52px; height: 52px; image-rendering: pixelated; }
.listen-text { margin: 0; font-size: 15px; line-height: 1.4; }
.listen-player { grid-column: 1 / -1; width: 100%; height: 152px; border: 2px solid var(--ink); border-radius: 0; }
.listen-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 0; }
.btn-spotify { text-decoration: none; color: var(--ink); display: inline-block; }

.recentre {
  position: fixed;
  left: 50%;
  bottom: calc(var(--taskbar-h) + env(safe-area-inset-bottom) + 14px);
  transform: translateX(-50%);
  z-index: 6;
  background: var(--white);
  box-shadow: inset -3px -3px 0 var(--sky), 3px 3px 0 var(--ink);
}
.recentre:active { transform: translate(-50%, 0) translate(2px, 2px); }
.hint {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--white);
  border: 2px solid var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .6s ease;
  z-index: 5;
}
.hint.gone { opacity: 0; }

/* Windows */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 16px;
  background: rgba(29, 27, 46, .35);
}
.modal[hidden] { display: none; }
.modal > .win { min-width: 0; }
.win {
  width: min(640px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.win-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  background: linear-gradient(90deg, var(--lavender), var(--sky));
  border-bottom: 2px solid var(--ink);
}
.win-title { flex: 1; font-weight: 800; font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-x {
  width: 30px;
  height: 28px;
  border: 2px solid var(--ink);
  background: var(--white);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset -2px -2px 0 var(--sky);
}
.win-body { padding: 18px; overflow: auto; }
.win-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 2px solid var(--ink);
  background: #f4f3fb;
}

/* Submit flow */
.step-count { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.step-title { margin: 0 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.step-help { margin: 0 0 16px; color: var(--ink-soft); font-size: 15px; }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.slot { display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--white); box-shadow: 0 6px 16px rgba(29, 27, 46, .16); border: 1px solid #e3e1f0; }
.slot-photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--sky);
  border: 2px dashed var(--ink-soft);
  cursor: pointer;
  overflow: hidden;
}
.slot-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot-photo.filled { border-style: solid; border-color: transparent; }
/* "*" on the required photo, "optional" on the others; hidden once a photo is chosen */
.slot-tag { position: absolute; top: 6px; right: 7px; font-size: 11px; font-weight: 700; color: var(--ink-soft); letter-spacing: .02em; }
.slot-required { top: 2px; right: 8px; font-size: 26px; line-height: 1; color: #d6332a; }
.slot-photo.filled .slot-tag { display: none; }
.slot-empty { font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.slot-photo.busy .slot-empty::after { content: "…"; }
.slot-photo:focus-within { outline: 3px dashed var(--ink); outline-offset: 2px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.field {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 2px solid var(--ink);
  background: var(--white);
  font-size: 16px; /* 16px stops iOS zooming in */
  font-weight: 500;
  border-radius: 0;
  box-shadow: inset 2px 2px 0 var(--sky);
}
.slot-caption { padding: 7px 8px; font-size: 16px; font-weight: 600; text-align: center; }
.field[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 2px 2px 0 #f6d5d2; }
.consent { margin: 14px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.preview { position: relative; height: 380px; overflow: hidden; background: var(--sky); border: 2px solid var(--ink); }
.preview .eco { left: 50%; top: 50%; cursor: default; }
.form-error { min-height: 1.3em; margin: 12px 0 0; color: var(--error); font-weight: 700; font-size: 14px; }
.form-error:empty { margin: 0; min-height: 0; }
.done { text-align: center; padding: 20px 0 8px; }
.done-mark { margin: 0; font-size: 64px; line-height: 1; color: var(--lavender); -webkit-text-stroke: 2px var(--ink); }

/* ---------- Small screens ---------- */

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  :root { --taskbar-h: 60px; }
  .taskbar { justify-content: space-between; }
  .taskbar-count, .wide-only { display: none; }
  .btn-add { padding: 10px 12px; font-size: 15px; }
  .btn-icon { width: 36px; }
  .taskbar-tools [data-zoom="out"], .taskbar-tools [data-zoom="in"] { display: none; } /* pinch instead */

  /* Windows: a card a little in from the edges, centred on screen */
  .modal { padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); align-items: center; }
  .win { width: 100%; max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); box-shadow: 4px 4px 0 var(--ink); }
  .win-bar { padding: 5px 5px 5px 12px; }
  .win-title { font-size: 15px; }
  .win-x { width: 34px; height: 32px; }
  .win-body { padding: 14px; }
  .win-foot { padding: 10px 14px; }
  .step-count { font-size: 12px; }
  .step-title { font-size: 21px; }
  .step-help { font-size: 14px; margin-bottom: 12px; }

  .slots { gap: 8px; }
  .slot { padding: 5px; gap: 6px; }
  .slot-caption { font-size: 16px; padding: 6px 4px; } /* 16px stops iOS zooming in */
  .slot-empty { font-size: 13px; }

  .fields { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fields .label:nth-child(n + 3) { grid-column: 1 / -1; } /* email and phone full width */
  .label { font-size: 13px; }
  .field { padding: 8px 9px; }

  .preview { height: 250px; }
  .preview .eco { transform: translate(-50%, -50%) scale(.6); }


  .listen { right: 8px; left: 8px; width: auto; bottom: calc(var(--taskbar-h) + env(safe-area-inset-bottom) + 8px); }
  .listen-body { grid-template-columns: 40px 1fr; }
  .listen-sprout { width: 40px; height: 40px; }
  .listen-text { font-size: 14px; }

  .movebar { top: 10px; padding: 6px 6px 6px 10px; font-size: 13px; }
  .hint { top: 10px; font-size: 12px; }
  .menu { min-width: 200px; }
}
@media (max-width: 600px) {
  .modal-eco { padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)); }
  .eco-card { padding: 22px 14px 16px; border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .eco-card-x { margin: -10px -6px 0 0; width: 40px; height: 40px; }
  .eco-card-word { -webkit-text-stroke-width: 2.5px; font-size: clamp(42px, 13vw, 64px); }
  .eco-card-head { padding: 0 26px; }
  .eco-card-meta { font-size: 12px; }
  .eco-card-photos { padding: 12px 0 4px; }
  .eco-card-photo { margin: 0 -6px; padding: 5px 5px 0; }
  .eco-card-photo::before { width: 40px; height: 14px; top: -7px; }
  .eco-card-photos[data-count="1"] .eco-card-photo { flex-basis: 66%; }
  .eco-card-photos[data-count="2"] .eco-card-photo { flex-basis: 46%; }
  .polaroid-caption { font-size: 11px; padding: 5px 1px 7px; }
  .eco-card-paper { padding: 14px 12px 12px 28px; margin-top: 16px; }
}
@media (max-width: 380px) {
  .preview { height: 220px; }
  .preview .eco { transform: translate(-50%, -50%) scale(.5); }
  .slots { gap: 6px; }
  .slot-empty { font-size: 12px; }
  .step-title { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
