/* starlines: one quiet, warm interface around a glowing piece of art.
   Only the artwork glows. The UI stays flat: ivory on warm black, hairlines,
   one candle-amber accent, and one typeface (Instrument Sans) set at a few weights. */

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #0e0d0c;
  --raised: #171513;
  --sunken: #0a0908;
  --line: rgba(239, 231, 216, 0.1);
  --line-strong: rgba(239, 231, 216, 0.2);
  --text: #efe7d8;
  --muted: #a8a196;
  --faint: #716b62;
  --accent: #e9b45a;
  --accent-ink: #1d1609;
  --err: #f08a84;
  --warn: #e9b45a;
  --radius: 8px;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --header: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(233, 180, 90, 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 8;
  height: var(--header);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(14, 13, 12, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.mark { flex: none; }
.brand-name { font-size: 19px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.top-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nav-link {
  background: none; border: 0; cursor: pointer; padding: 8px 12px; border-radius: 6px;
  color: var(--muted); font-size: 14.5px; font-weight: 500;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(239, 231, 216, 0.06); }
#topMake { display: none; }
body.hero-visible #topMake { display: inline-flex; }
body.hero-visible .nav-link { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: transparent;
  font-weight: 600; font-size: 15px; letter-spacing: 0.005em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: rgba(239, 231, 216, 0.06); border-color: rgba(239, 231, 216, 0.32); }
.btn.small { padding: 7px 13px; font-size: 14px; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #f1c271; border-color: #f1c271; }
.btn.big { width: 100%; padding: 15px 24px; font-size: 16.5px; }
.btn:disabled { opacity: 0.7; cursor: progress; }
.btn:disabled:not(#exportBtn):not(#mbExport) { opacity: 0.45; cursor: not-allowed; }
.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); font-size: 14px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px;
}
.link:hover { color: var(--text); text-decoration-color: currentColor; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
}
.icon-btn:hover { background: rgba(239, 231, 216, 0.06); }
.icon-btn .i-pause { display: none; }
body.playing #playBtn .i-play { display: none; }
body.playing #playBtn .i-pause { display: block; }
.icon-btn.tiny { width: 28px; height: 28px; border-radius: 6px; border-color: transparent; color: var(--faint); }
.icon-btn.tiny:hover { color: var(--text); background: rgba(239, 231, 216, 0.06); }
.icon-btn.tiny.danger:hover { color: var(--err); }

/* ---------- landing hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: calc(100svh - var(--header));
  display: grid; grid-template-rows: 1fr auto;
  padding: clamp(40px, 8vh, 96px) clamp(20px, 6vw, 96px) 0;
  border-bottom: 1px solid var(--line);
}
.hero[hidden] { display: none; }
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(14, 13, 12, 0.94) 0%, rgba(14, 13, 12, 0.78) 34%, rgba(14, 13, 12, 0) 66%),
    linear-gradient(0deg, rgba(14, 13, 12, 0.9) 0%, rgba(14, 13, 12, 0) 26%);
}
.hero-copy { position: relative; align-self: center; max-width: 640px; }
.hero h1 {
  margin: 0; font-weight: 600;
  font-size: clamp(44px, 6.4vw, 88px); line-height: 1; letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero h1 em { display: block; font-style: normal; color: var(--accent); }
.lede { margin: 28px 0 36px; max-width: 30em; color: #cfc7b9; font-size: clamp(16px, 1.45vw, 18.5px); line-height: 1.6; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.hero-cta .btn.big { width: auto; padding: 15px 34px; }
.hero-note { color: var(--muted); font-size: 14.5px; }
.hero-foot {
  position: relative; margin-top: 48px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px;
  padding: 22px 0 26px; border-top: 1px solid var(--line);
}
.how { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 36px; font-size: 14.5px; color: #cfc7b9; }
.how span { color: var(--accent); font-variant-numeric: tabular-nums; margin-right: 10px; font-size: 13px; }

/* the public counter (hero + footer) */
.counter { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 14px; }
.counter b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 2px; }
.counter[hidden] { display: none; }

/* ---------- editor layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(400px, 600px) minmax(340px, 1fr);
  gap: clamp(28px, 5vw, 80px);
  max-width: 1240px; margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 48px);
  scroll-margin-top: var(--header);
}
.editor { order: 1; min-width: 0; display: grid; align-content: start; }
.stage {
  order: 2; min-width: 0;
  position: sticky; top: calc(var(--header) + 24px); align-self: start;
  display: grid; gap: 14px; justify-items: center;
}

/* sections: separated by hairlines, not boxed */
.card { padding: 0 0 36px; margin: 0 0 36px; border-bottom: 1px solid var(--line); }
.card:last-child { border-bottom: 0; margin-bottom: 0; }
.card h2 {
  margin: 0 0 8px; font-weight: 600;
  font-size: clamp(24px, 2.2vw, 28px); line-height: 1.15; letter-spacing: -0.025em;
}
.step { display: block; margin-bottom: 10px; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 14.5px; margin: 6px 0 18px; max-width: 46em; }
.hint strong { color: var(--text); font-weight: 600; }
.hint em, .field em { font-style: normal; color: var(--faint); font-weight: 400; }
#youHint { margin-bottom: 0; }
#youHint.active { color: #c9d8b4; }

/* ---------- fields ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.grid2 .field { margin-bottom: 0; }
.field > span { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.field > span strong { color: var(--text); margin-left: 6px; font-weight: 600; }
input[type=text], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 6px;
  background: var(--sunken); border: 1px solid var(--line-strong);
  outline: none; transition: border-color 0.15s;
}
input[type=text]:hover, input[type=number]:hover, select:hover, textarea:hover { border-color: rgba(239, 231, 216, 0.3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 50px; line-height: 1.45; padding: 10px 12px; }
select {
  appearance: none; padding-right: 26px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 10px) 55%; background-size: 4px 4px; background-repeat: no-repeat;
}
select option { background: var(--raised); }
input[type=color] { width: 100%; height: 42px; padding: 4px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--sunken); cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }
input[type=color]::-moz-color-swatch { border: 0; border-radius: 4px; }
input[type=range] { accent-color: var(--accent); }

/* ---------- people ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 7px 12px 7px 10px; border-radius: 6px; border: 1px solid var(--line-strong); background: transparent;
  font-size: 14px; font-weight: 500; color: #ddd5c6;
}
.chip:hover { border-color: rgba(239, 231, 216, 0.36); color: var(--text); background: rgba(239, 231, 216, 0.04); }
.chip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chips.invite .chip:nth-child(-n+3) { border-color: rgba(233, 180, 90, 0.6); color: var(--text); }

.people-head, .person {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 96px 58px 84px 84px;
  gap: 8px; align-items: center;
}
.people-head { font-size: 12.5px; color: var(--faint); padding: 0 0 8px; font-weight: 500; border-bottom: 1px solid var(--line); }
.people { list-style: none; margin: 0; padding: 0; }
.person { padding: 8px 0; border-bottom: 1px solid var(--line); }
.person .swatch { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; justify-self: center; }
.person .swatch::-webkit-color-swatch { border-radius: 50%; border: 0; }
.person .swatch::-moz-color-swatch { border-radius: 50%; border: 0; }
.person input[type=text], .person select { padding: 8px 10px; }
.person .age { text-align: center; font-variant-numeric: tabular-nums; }
.person .tools { display: flex; justify-content: flex-end; }
.person.has-error .age { border-color: rgba(240, 138, 132, 0.7); }
.row-hint { grid-column: 2 / -1; font-size: 13px; color: var(--faint); margin-top: -2px; }
.row-hint:empty { display: none; }
.row-hint.err { color: var(--err); }
.row-hint.warn { color: var(--warn); }
.person.is-me { background: linear-gradient(90deg, rgba(233, 180, 90, 0.07), transparent 70%); }
.swatch-static { width: 14px; height: 14px; border-radius: 50%; justify-self: center; }
.me-name { font-weight: 600; padding-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-badge { font-size: 13px; color: var(--accent); font-weight: 500; padding-left: 10px; }
.me-badge::before { content: "this is "; color: var(--faint); }
.me-note { grid-column: span 2; color: var(--faint); font-size: 13px; text-align: center; }
.people-empty { margin: 14px 0 0; padding: 14px 16px; border-radius: 6px; font-size: 14.5px; color: #cfc7b9; background: var(--raised); }
.people-empty strong { color: var(--text); font-weight: 600; }
.row-actions { display: flex; align-items: center; gap: 18px; margin-top: 16px; }
.spacer { flex: 1; }
.cell { display: block; min-width: 0; }
.cell .mini { display: none; }
.cell select, .cell input { width: 100%; }

/* about you + more options (disclosures) */
.about, .more { margin-top: 26px; }
.about summary, .more summary { list-style: none; cursor: pointer; }
.about summary::-webkit-details-marker, .more summary::-webkit-details-marker { display: none; }
.about summary {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 6px; background: var(--raised);
}
.about summary:hover { background: #1d1a17; }
.about-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.about summary > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.about summary b { font-weight: 600; }
.about-sum { color: var(--muted); margin-left: 8px; }
.about-edit { color: var(--muted); font-size: 14px; }
.about[open] .about-edit { visibility: hidden; }
.about .grid2 { margin-top: 18px; }
.about #youHint { margin-top: 14px; }
.more summary { display: inline-flex; color: var(--muted); font-size: 14px; font-weight: 500; }
.more summary:hover { color: var(--text); }
.more summary::after { content: "+"; margin-left: 8px; color: var(--faint); }
.more[open] summary { margin-bottom: 18px; }
.more[open] summary::after { content: "−"; }

/* toggles, choice cards */
.toggles { display: grid; gap: 10px; margin-top: 2px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; }
.toggle.small { font-size: 13px; color: var(--muted); gap: 7px; white-space: nowrap; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.pills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
#formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pill {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; align-content: start;
  text-align: left; padding: 12px 14px; border-radius: 6px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong);
}
.pill strong { font-size: 14.5px; font-weight: 600; grid-column: -2 / -1; }
.pill small { color: var(--muted); font-size: 12.5px; grid-column: -2 / -1; }
.pill-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(239, 231, 216, 0.25); grid-row: span 2; align-self: center; }
.pill:hover { border-color: rgba(239, 231, 216, 0.36); }
.pill.on { border-color: var(--text); background: rgba(239, 231, 216, 0.05); }
.music { display: flex; align-items: center; gap: 16px; }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- preview ---------- */
.frame-wrap { width: 100%; display: flex; justify-content: center; }
.frame {
  position: relative; aspect-ratio: 9 / 16;
  height: min(calc(100vh - var(--header) - 300px), 700px); min-height: 320px; max-width: 100%;
  border-radius: 10px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}
.frame.landscape { height: auto; width: 100%; }
.frame canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
.bigplay {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%;
  border: 1px solid rgba(239, 231, 216, 0.4); background: rgba(14, 13, 12, 0.6);
  display: grid; place-items: center; cursor: pointer; transition: opacity 0.2s;
}
.bigplay svg { margin-left: 4px; }
body.playing .bigplay, body.started .bigplay, body.exporting .bigplay { opacity: 0; pointer-events: none; }
.transport { width: min(100%, 520px); display: flex; align-items: center; gap: 12px; }
.transport input[type=range] { flex: 1; min-width: 60px; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- export + result ---------- */
.export { width: min(100%, 520px); display: grid; gap: 10px; justify-items: center; }
.export-meta { color: var(--faint); font-size: 13px; text-align: center; }
.stage-actions { display: flex; gap: 8px; justify-content: center; }
.progress { width: 100%; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s; }
.progress-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.result { width: 100%; padding: 18px; border-radius: var(--radius); background: var(--raised); font-size: 14.5px; }
.result p { margin: 0 0 6px; }
.result .ok a { color: var(--text); }
.result .warn { color: var(--warn); }
.post { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.post h3 { margin: 0 0 12px; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.post .field { margin-bottom: 14px; }
.post textarea { font-size: 16px; }
.plats { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.post .hint { margin-bottom: 0; font-size: 13.5px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); }
.foot-inner {
  max-width: 1240px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 48px) 48px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px 40px; align-items: baseline;
}
.foot-brand { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.privacy { margin: 0; color: var(--faint); font-size: 13.5px; max-width: 46em; }

/* ---------- dialogs ---------- */
.sheet {
  width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 760px); padding: 0;
  border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--text); box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6); overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(8, 7, 6, 0.72); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px 24px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-weight: 600; font-size: 21px; letter-spacing: -0.02em; }
.sheet-body { padding: 20px 24px 28px; overflow-y: auto; }
.sheet .hint { margin-top: 0; }
.sheet h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 28px 0 10px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.inline-actions { display: flex; gap: 20px; align-items: center; margin-top: 12px; }
.inline-actions.wrap { flex-wrap: wrap; gap: 8px; }
.share-row input { font-variant-numeric: tabular-nums; font-size: 16px; }
.share-to { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.share-to [hidden] { display: none; }
.lib-list { list-style: none; margin: 0; padding: 0; }
.lib-item { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.lib-item.open .lib-info strong::after { content: "  open"; color: var(--accent); font-weight: 500; font-size: 13px; }
.lib-info {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px;
  text-align: left; background: none; border: 0; padding: 12px 6px; cursor: pointer; border-radius: 6px;
}
.lib-info:hover { background: rgba(239, 231, 216, 0.04); }
.lib-info strong { grid-column: 2; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-info small { grid-column: 2; color: var(--muted); font-size: 13px; }
.lib-dots { grid-row: 1 / 3; align-self: center; display: flex; flex-wrap: wrap; gap: 3px; }
.lib-dots i { width: 8px; height: 8px; border-radius: 50%; }
.lib-item .tools { display: flex; }
.lib-item .icon-btn.tiny { width: 36px; height: 36px; }

/* ---------- toast, drop overlay, mobile bar ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 10;
  display: flex; gap: 16px; align-items: center; max-width: calc(100vw - 32px);
  padding: 12px 16px; border-radius: var(--radius); font-size: 14px;
  background: var(--text); color: #1a1714; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .link { color: #1a1714; font-weight: 600; text-decoration-color: currentColor; }
.dropzone {
  position: fixed; inset: 12px; z-index: 20; display: grid; place-items: center;
  border: 1px dashed var(--accent); border-radius: 12px; background: rgba(14, 13, 12, 0.92);
  font-size: 24px; font-weight: 500; letter-spacing: -0.02em; opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.dropzone strong { font-weight: 700; color: var(--accent); }
body.dragging .dropzone { opacity: 1; }
.mobilebar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 110px; }
  .stage { order: 0; position: static; scroll-margin-top: var(--header); }
  .frame { height: min(60vh, 600px); }
  .hero { padding-top: 0; }
  .hero-copy { align-self: end; }
  .hero-shade { background: linear-gradient(180deg, rgba(14, 13, 12, 0) 0%, rgba(14, 13, 12, 0.2) 30%, rgba(14, 13, 12, 0.92) 58%, var(--bg) 100%); }
  .hero-foot { margin-top: 32px; }
  .foot-inner { grid-template-columns: 1fr; }
  .mobilebar {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(14, 13, 12, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); transition: transform 0.2s;
  }
  .mobilebar .btn { flex: 1; padding: 13px 14px; font-size: 16px; }
  .mobilebar .btn.primary { flex: 1.7; }
  body.stage-visible .mobilebar, body.hero-visible .mobilebar { transform: translateY(110%); }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  :root { --header: 58px; }
  .top { padding: 0 14px; }
  .nav-link { padding: 8px 8px; font-size: 14px; max-width: 120px; }
  .hero { padding: 0 20px; }
  .hero h1 { font-size: clamp(40px, 11.5vw, 54px); }
  .lede { margin: 18px 0 26px; font-size: 16px; }
  .hero-cta .btn.big { width: 100%; }
  .hero-note { width: 100%; text-align: center; }
  .how { gap: 6px 18px; font-size: 14px; }
  .layout { padding: 16px 16px 110px; gap: 28px; }
  .card { padding-bottom: 28px; margin-bottom: 28px; }
  input[type=text], input[type=number], select, textarea { font-size: 16px; padding: 11px 12px; } /* 16px: no iOS zoom */
  .grid2 { gap: 14px 10px; }
  .people-head { display: none; }
  .person { grid-template-columns: 34px repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px 0; }
  .person .swatch { grid-column: 1; grid-row: 1; width: 30px; height: 30px; align-self: center; }
  .person .name { grid-column: 2 / 4; grid-row: 1; }
  .person .tools { grid-column: 4; grid-row: 1; }
  .person .tools .icon-btn.tiny { width: 30px; height: 42px; }
  .person .c-kind { grid-column: 1 / 3; grid-row: 2; }
  .person .c-from { grid-column: 3; grid-row: 2; }
  .person .c-until { grid-column: 4; grid-row: 2; }
  .person .row-hint { grid-column: 1 / -1; grid-row: 3; }
  .person input[type=text], .person select { padding: 10px 11px; }
  .person .age { padding-left: 4px; padding-right: 4px; }
  .person .age::placeholder { font-size: 13px; }
  .cell .mini { display: block; font-size: 12px; color: var(--faint); margin: 0 0 5px 2px; white-space: nowrap; }
  .person.is-me { grid-template-columns: 34px minmax(0, 1fr) auto auto; padding: 12px 0; }
  .person.is-me .me-note { display: none; }
  .chip { padding: 8px 12px 8px 10px; }
  .transport { flex-wrap: wrap; gap: 10px; }
  .pills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #themes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 14px 14px 0 0; border-bottom: 0; }
  .sheet-body { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .share-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
