/* Calm interface, colourful cover. One accent; black buttons. No inline
   styles anywhere: the CSP allows only this file. */
:root {
  --bg: #fafaf8; --card: #fff; --fg: #161616; --muted: #6b6b6b; --line: #e8e7e3;
  --field: #d6d5d0; --soft: #f4f3ef; --accent: #c8351f; --danger: #b3261e; --danger-fg: #fff;
  --btn: #161616; --btn-fg: #fff; --btn-hover: #000;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141413; --card: #1c1c1a; --fg: #f1f0ec; --muted: #a3a29c; --line: #2e2d2a;
    --field: #4a4945; --soft: #232320; --accent: #ff6a52; --danger: #ff8a80; --danger-fg: #141413;
    --btn: #f1f0ec; --btn-fg: #141413; --btn-hover: #fff; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

/* Frame */
.top, main, .foot { max-width: 66rem; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
main.narrow { max-width: 36rem; }
.top { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; text-decoration: none; margin-right: auto; }
/* The wordmark: "Fest" circled in red pen, as a date in a calendar. */
.brand .fest { position: relative; display: inline-block; }
.brand .fest::after { content: ""; position: absolute; left: -0.5em; right: -0.42em; top: -0.55em; bottom: -0.5em;
  background: url(/static/loop.svg) no-repeat center / 100% 100%; pointer-events: none; }
.top { padding-top: 18px; }
.top .my { font-size: .95rem; text-decoration: none; padding: 10px 0; }
.lang { display: flex; }
.lang button { background: none; border: 0; color: var(--muted); font: inherit; font-size: .9rem; padding: 10px 6px; min-height: 44px; cursor: pointer; }
.lang button[aria-current], .lang a[aria-current] { color: var(--fg); font-weight: 600; }
.lang a { color: var(--muted); font-size: .9rem; padding: 10px 6px; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.chooser { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.guide h1 { margin-top: 0; }
.guide table { border-collapse: collapse; margin: 16px 0; max-width: 100%; display: block; overflow-x: auto; }
.guide th, .guide td { border-bottom: 1px solid var(--soft); padding: 6px 10px; text-align: left; }
.guide .byline { color: var(--muted); font-size: .9rem; }
.guide-cta { margin: 24px 0; }
.guide-list { padding-left: 1.1rem; }
.foot { color: var(--muted); font-size: .85rem; padding-top: 32px; padding-bottom: 40px; text-align: center; }
.foot a { color: var(--muted); }

/* Type */
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.1; letter-spacing: -0.025em; margin: 28px 0 14px; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 20px 0 8px; }
.lead { color: var(--muted); font-size: 1.1rem; }
.hint { color: var(--muted); font-size: .88rem; margin: 4px 0 14px; }
.error { color: var(--danger); margin: -6px 0 0; font-size: .9rem; }
.warning { border-left: 3px solid var(--accent); padding: 8px 12px; margin: 8px 0 14px; overflow-wrap: anywhere; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; }
address { font-style: normal; margin: 8px 0 16px; }

/* Controls */
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: .92rem; font-weight: 600; }
input, textarea, select { font: inherit; font-weight: 400; color: var(--fg); background: var(--card); border: 1px solid var(--field);
  border-radius: 12px; padding: 12px 14px; width: 100%; min-width: 0; min-height: 48px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--fg); outline-offset: -1px; }
input[readonly] { background: var(--soft); font-size: .9rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--btn); color: var(--btn-fg);
  border: 1px solid var(--btn); border-radius: 12px; padding: 12px 22px; font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; min-height: 52px; text-align: center; }
.button:hover { background: var(--btn-hover); color: var(--btn-fg); }
.button.secondary { background: var(--card); color: var(--fg); border-color: var(--field); }
.button.secondary:hover { border-color: var(--fg); color: var(--fg); }
.button.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-fg); }
.button.small { min-height: 44px; padding: 8px 16px; font-size: .95rem; }
.button.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--fg); font: inherit; font-size: .92rem; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.link:hover { color: var(--accent); }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.row input { flex: 1 1 11rem; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .95rem; }
.choice input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--fg); }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details > summary { list-style: none; text-decoration: underline; text-underline-offset: 3px; font-size: .95rem; }
details > summary::-webkit-details-marker { display: none; }

/* Cards and lists */
.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.panel { margin: 24px 0; }
.card.main { border-color: var(--fg); }
.items, .guests, .events { list-style: none; padding: 0; margin: 0 0 12px; }
.items li, .guests li, .events li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.items li:first-child, .guests li:first-child, .events li:first-child { border-top: 0; }
.items .what, .guests .who { flex: 1 1 6rem; overflow-wrap: anywhere; }
.items .free .what::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: middle; }
.items .answer, .guests .answer, .guests .diet, .plus, .items .price { color: var(--muted); font-size: .92rem; }
.items .empty { color: var(--muted); }
.items details, .guests details { flex-basis: 100%; }
.items .stack input { margin-bottom: 4px; }
.items a { overflow-wrap: anywhere; }
.guests .declined .who { color: var(--muted); }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); font-weight: 600; font-size: .9rem; }
.guests .host .avatar { background: var(--fg); color: var(--bg); }
img.avatar { background: none; object-fit: cover; }
.avatars { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.avatars legend { padding: 0; margin-bottom: 6px; }
.avatar-choice { position: relative; cursor: pointer; }
.avatar-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.avatar-choice .avatar { outline-offset: 2px; }
.avatar-choice input:checked + .avatar { outline: 3px solid var(--fg); }
.avatar-choice input:focus-visible + .avatar { outline: 3px solid var(--accent); }
.badge { font-size: .8rem; color: var(--muted); }
.events a { font-weight: 600; overflow-wrap: anywhere; flex: 1 1 100%; }
.events .past a { font-weight: 400; color: var(--muted); }
.shares ul { list-style: none; padding: 0; margin: 4px 0; font-size: .9rem; color: var(--muted); }
.transfers .note { flex-basis: 100%; font-size: .9rem; }
section > h2 + .items { margin-top: 10px; }

/* Party page */
.cover { position: relative; overflow: hidden; border-radius: 20px; margin: 8px 0 0; padding: 124px 24px 28px;
  min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--c-bg); color: var(--c-fg); }
.cover > * { position: relative; }
.cover .when { margin: 0 0 10px; font-size: .9rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.cover h1 { margin: 0; font-size: clamp(2.1rem, 7vw, 4rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 800; }
.cover .where { margin: 12px 0 0; font-size: 1.05rem; font-weight: 500; overflow-wrap: anywhere; }
.cover .where strong { font-weight: 700; }
/* A picture fills the cover under a flat tint of the theme colour, so the
   text on it keeps its contrast; the shapes would only fight with it. */
.cover > .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover > .tint { position: absolute; inset: 0; background: var(--c-bg); opacity: .72; }
.has-photo .shapes { display: none; }
.cover-form input[type="file"] { max-width: 100%; }
.cover-form input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.shapes { position: absolute; inset: 0; pointer-events: none; }
.shapes i { position: absolute; display: block; border-radius: 999px; }
/* Shapes stay in a band above the text, so they never cover it. */
.shapes i:nth-child(1) { width: 64px; height: 64px; right: 8%; top: 18px; background: var(--c1); }
.shapes i:nth-child(2) { width: 16px; height: 42px; right: 30%; top: 16px; background: var(--c2); transform: rotate(30deg); }
.shapes i:nth-child(3) { width: 18px; height: 18px; right: 3%; top: 92px; background: var(--c3); }
.shapes i:nth-child(4) { width: 12px; height: 12px; right: 44%; top: 40px; background: var(--c3); }
.shapes i:nth-child(5) { width: 40px; height: 14px; right: 20%; top: 72px; background: var(--c1); }
.shapes i:nth-child(6) { width: 34px; height: 34px; left: 24px; top: 22px; background: var(--c2); }
.theme-tomato { --c-bg: #d63a26; --c-fg: #fff; --c1: #ff8a6b; --c2: #ffc531; --c3: #fff; }
.theme-sun { --c-bg: #ffc531; --c-fg: #161616; --c1: #ffe07a; --c2: #e8432e; --c3: #161616; }
.theme-forest { --c-bg: #1f5c46; --c-fg: #fff; --c1: #2e7a5e; --c2: #f2c94c; --c3: #a8e6c6; }
.theme-night { --c-bg: #17203b; --c-fg: #fff; --c1: #2a3660; --c2: #f2c94c; --c3: #ff8a6b; }
.theme-sky { --c-bg: #2a62cc; --c-fg: #fff; --c1: #5c8ff0; --c2: #ffc531; --c3: #fff; }
.theme-pistachio { --c-bg: #bfe08f; --c-fg: #161616; --c1: #d7edb5; --c2: #1f5c46; --c3: #e8432e; }
.party-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px 0 4px; }
.party-meta .note { flex: 1 1 16rem; margin: 0; }
.party-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; margin-top: 20px; }
.party-main { flex: 999 1 34rem; min-width: 0; display: grid; gap: 20px; }
.party-side { flex: 1 1 17rem; min-width: 0; display: grid; gap: 20px; }
.party-main > .panel, .party-side > .panel { margin: 0; }
@media (max-width: 52rem) {
  /* On a phone the guest list follows the reply, not the end of the page. */
  .party-grid { display: grid; }
  .party-main { display: contents; }
  .party-main > * { order: 3; }
  .party-main > #reply { order: 1; }
  .party-side { order: 2; }
}

/* Theme picker */
.swatch { position: relative; display: block; width: 56px; height: 56px; border-radius: 14px; cursor: pointer; background: var(--c-bg); border: 1px solid var(--line); }
.swatch:has(input:checked) { outline: 3px solid var(--fg); outline-offset: 2px; }

/* Landing */
.hero { padding: 48px 0 56px; }
.hero h1 { font-size: clamp(2.6rem, 9vw, 5.2rem); line-height: 1; letter-spacing: -0.035em; margin: 0; max-width: 14ch; }
.hero .lead { margin: 24px 0 32px; max-width: 34rem; font-size: clamp(1.1rem, 2.4vw, 1.35rem); }
.steps { list-style: none; margin: 0; padding: 40px 0 8px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before { content: "0" counter(step); display: block; color: var(--accent); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.steps strong { display: block; font-size: 1.15rem; margin-bottom: 4px; }
.steps span { color: var(--muted); }

#install p { margin: 4px 0; }
#gift-setup { margin: 12px 0; }

/* Reply: two answers first; the rest appears once one is chosen. */
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-btn { position: relative; display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px 12px;
  border: 1px solid var(--field); border-radius: 12px; background: var(--card); font-size: 1rem; font-weight: 600; text-align: center; cursor: pointer; }
.swatch input, .answer-btn input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.answer-btn:hover { border-color: var(--fg); }
.answer-btn:has(input:checked) { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }
.swatch:has(input:focus-visible), .answer-btn:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
@supports selector(:has(*)) {
  .reply:not(:has(input[name="coming"]:checked)) .reply-more { display: none; }
  .reply:has(input[name="coming"][value="no"]:checked) .if-coming { display: none; }
}
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper input { width: 5rem; flex: none; text-align: center; }
.step-btn { width: 48px; height: 48px; flex: none; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid var(--field); background: var(--card); color: var(--fg); font: inherit; font-size: 1.3rem; cursor: pointer; }

/* Create flow */
.create { display: grid; gap: 28px; padding-top: 12px; }
.create .step { display: grid; gap: 12px; }
.create .q { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; padding: 0; margin: 0 0 2px; }
.create .hint { margin: 0 0 8px; }
.create input:not([type=radio]) { font-size: 1.15rem; min-height: 56px; }
.create .skip { justify-self: center; }
.step-head { align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.js .step-head { display: flex; }
.themes legend { font-size: .92rem; font-weight: 600; margin-bottom: 6px; }
.step-head #step-label { margin-left: auto; }
.step-head progress { flex-basis: 100%; height: 3px; appearance: none; border: 0; background: var(--line); border-radius: 2px; }
.step-head progress::-webkit-progress-bar { background: var(--line); border-radius: 2px; }
.step-head progress::-webkit-progress-value { background: var(--fg); border-radius: 2px; }
.step-head progress::-moz-progress-bar { background: var(--fg); }
.stepping .step[hidden] { display: none; }

/* Ready screen and sharing */
.eyebrow { margin: 28px 0 0; color: var(--accent); font-weight: 600; font-size: .95rem; }
.eyebrow + h1 { margin-top: 8px; }
.mini-cover { display: grid; gap: 2px; padding: 18px 20px; border-radius: 14px; margin: 24px 0 16px; background: var(--c-bg); color: var(--c-fg); }
.mini-cover strong { font-size: 1.15rem; overflow-wrap: anywhere; }
.mini-cover span { font-size: .9rem; }
.share { display: grid; gap: 10px; }
.share-more { display: flex; flex-wrap: wrap; gap: 8px; }
.share-more .button { flex: 1 1 8rem; }
.next-steps { margin: 36px 0 20px; }
.next-steps a { display: flex; justify-content: space-between; align-items: center; min-height: 56px; border-top: 1px solid var(--line); text-decoration: none; font-size: 1.05rem; }
.next-steps a:last-child { border-bottom: 1px solid var(--line); }
.next-steps a span { color: var(--muted); }
.host-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 4px 0 8px; }
.host-links a { min-height: 44px; display: inline-flex; align-items: center; }
#host-panel form, #host-panel details { margin: 0; }
#install { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 16px 0 0; padding: 14px 18px; }
#install[hidden] { display: none; }
.save-link { margin: 14px 0 0; font-size: .95rem; }

/* Groups */
.hero .button + .button { margin-left: 8px; }
.taken ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .92rem; }
.kinds { grid-template-columns: repeat(3, 1fr); }
.kinds legend { font-size: .92rem; font-weight: 600; margin-bottom: 6px; }
.group-cover { min-height: 200px; }
#feed-url { margin: 8px 0; }
#calendar .events .hint { margin: 0; margin-left: auto; }
.address-list { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--soft); border-radius: 8px; background: var(--bg); max-width: 100%; }
.address-list li { padding: 10px 12px; cursor: pointer; overflow-wrap: anywhere; }
.address-list li[aria-selected="true"], .address-list li:hover { background: var(--soft); }
.address-credit { font-size: .8rem; }
