:root {
    --background: #5edae3;
    --paper: #fff8e7;
    --ink: #102a43;
    --accent: #ffc93c;
    --muted: #0a5c8a;
    --radius: 28px;
    --font: Rubik, system-ui;
}
* {
    box-sizing: border-box;
}
[hidden] {
    display: none !important;
}
body {
    margin: 0;
    padding: 24px clamp(16px, 4vw, 60px);
    background: var(--background);
    color: var(--ink);
    font:
        18px/1.5 var(--font),
        sans-serif;
    min-height: 100dvh;
    overflow-wrap: anywhere;
}
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1100px;
    margin: auto;
}
#brand {
    font-weight: 800;
}
#brand img {
    max-width: 160px;
    max-height: 56px;
}
main {
    max-width: 720px;
    margin: 45px auto 24px;
    min-width: 0;
}
h1 {
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.12;
    letter-spacing: -0.04em;
    margin: 10px 0 26px;
}
h2 {
    font-size: clamp(25px, 4vw, 36px);
    line-height: 1.2;
    margin: 12px 0 18px;
}
p {
    margin: 12px 0 18px;
}
.eyebrow,
.muted,
small {
    color: var(--muted);
}
.eyebrow {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.paper {
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: var(--radius);
    padding: clamp(20px, 4vw, 34px);
    box-shadow: 6px 7px 0 var(--ink);
}
button,
.upload {
    font:
        700 16px var(--font),
        sans-serif;
    color: var(--ink);
    background: var(--accent);
    border: 2px solid var(--ink);
    border-radius: 14px;
    padding: 12px 16px;
    min-height: 48px;
    cursor: pointer;
}
button:disabled {
    opacity: 0.6;
    cursor: wait;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 4px;
}
.quiet {
    background: transparent;
    border-color: transparent;
    text-decoration: underline;
    padding: 8px;
    min-height: 44px;
}
input,
select,
textarea {
    font: inherit;
    color: var(--ink);
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 12px;
    padding: 12px;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
}
input[type='file'] {
    font-size: 16px;
}
label {
    display: block;
    font-weight: 750;
    margin: 18px 0 8px;
}
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.actions > * {
    flex: 1;
}
#onboarding label {
    font-size: 26px;
    line-height: 1.25;
}
#benefit {
    color: var(--muted);
}
small {
    display: block;
    font-size: 13px;
    margin-top: 16px;
}
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    font-size: 14px;
}
.toolbar #progress {
    margin-right: auto;
}
#card {
    min-height: 340px;
}
#art {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
}
#back {
    max-height: 480px;
    overflow: auto;
    scrollbar-width: thin;
}
#details h3 {
    font-size: 15px;
    margin: 24px 0 6px;
}
#details p {
    white-space: pre-wrap;
}
#details a {
    color: var(--ink);
}
#votes {
    font-size: 14px;
}
#saved {
    font-size: 14px;
    color: var(--muted);
}
.choices button {
    font-size: 18px;
}
.tools {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}
.tools label {
    margin: 0;
}
summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 15px;
    margin-top: 25px;
}
#error {
    background: var(--paper);
    border-left: 5px solid var(--ink);
    padding: 16px;
}
footer {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin: 35px auto 12px;
}
dialog {
    color: var(--ink);
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: 24px;
    max-width: min(620px, 94vw);
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 0px));
    font-family: var(--font), sans-serif;
}
dialog::backdrop {
    background: #102a4380;
}
.close {
    float: right;
}
dialog button {
    margin: 6px 0;
}
#qr {
    display: block;
    width: min(360px, 100%);
    margin: auto;
}
a {
    color: var(--ink);
}
iframe {
    display: block;
    width: 100%;
    height: 260px;
    border: 1px solid var(--ink);
    border-radius: 16px;
    margin-top: 20px;
}
#promptText {
    font:
        16px/1.45 ui-monospace,
        monospace;
}
#inputArea .date-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 520px) {
    body {
        font-size: 16px;
        padding: 18px;
    }
    main {
        margin-top: 24px;
    }
    header {
        align-items: start;
    }
    #brand {
        max-width: 58%;
    }
    #card {
        min-height: 300px;
    }
    .choices {
        gap: 7px;
    }
    .choices button {
        padding: 10px 5px;
        font-size: 15px;
    }
    #back {
        max-height: 380px;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.toolbar select {
    width: auto;
    max-width: 100%;
    font-size: 16px;
    min-height: 40px;
    padding: 8px;
}

/* The vote buttons sit straight under the card; the vote count, reveal and settle follow them. */
.moment {
    margin-top: 12px;
}
.settled {
    white-space: pre-line;
    box-shadow: none;
    font-size: 16px;
    padding: 14px 18px;
    margin: 12px 0;
}
.link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.theme-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.theme-choice[aria-pressed='true'] {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}
fieldset {
    border: 2px solid var(--ink);
    border-radius: 12px;
    padding: 4px 12px 12px;
    margin: 0;
}
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
    font-weight: 600;
}
.check input {
    width: 24px;
    min-height: 24px;
    padding: 0;
}
#settleStatus {
    color: var(--ink);
    font-size: 14px;
}
@media (max-width: 520px) {
    .moment button {
        padding: 10px 8px;
        font-size: 15px;
    }
}
#organizerTools {
    max-width: 720px;
    margin: 8px auto 0;
}
#organizerTools[hidden] {
    display: none;
}
#organizerTools summary {
    margin-top: 0;
}
.option-list {
    display: grid;
    gap: 10px;
}
.option-choice[aria-pressed='true'] {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}
#themePickStatus:empty {
    display: none;
}
.reminders {
    margin-top: 18px;
}
.reminder-row {
    display: grid;
    grid-template-columns: auto minmax(60px, 1fr) auto minmax(60px, 1fr);
    align-items: center;
    gap: 8px;
}
.reminder-row input {
    padding: 12px 6px;
    text-align: center;
}
.reminder-row label {
    margin: 0;
    font-weight: 600;
}
#settleForm > button {
    position: sticky;
    bottom: calc(-1 * env(safe-area-inset-bottom, 0px));
    width: 100%;
    margin-top: 12px;
    background: var(--paper);
    box-shadow: 0 -10px 0 var(--paper);
    z-index: 1;
}

/* ---- Lines never end on one lonely word: balance short lines, smooth long ones. ---- */
h1, h2, h3, label, legend, summary, button, .eyebrow, #progress, #brand {
    text-wrap: balance;
}
p, li, small, #details, .settled {
    text-wrap: pretty;
}

/* ---- Phone, keep the vote in reach (decision 4c). ---- */
/* (a) The vote row stays pinned to the bottom of the screen on every card, above Safari's toolbar. */
.choices {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: 18px calc(-1 * clamp(16px, 4vw, 60px)) 0;
    padding: 10px clamp(16px, 4vw, 60px) calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--background);
}
/* (b) While reviewing, the trip title shows once (in the header), the guidance folds into a "?" button,
   and the card counter sits on the same line as Previous and Next. */
body.reviewing #headline,
body.reviewing #eyebrow {
    display: none;
}
body.reviewing main {
    margin-top: 14px;
}
#help .word {
    display: none;
}
#help {
    min-width: 44px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 900;
}
.toolbar {
    flex-wrap: nowrap;
}
.toolbar select {
    flex: 1 1 auto;
    min-width: 0;
}
.toolbar #progress {
    margin: 0;
    white-space: nowrap;
    order: 2;
}
.toolbar #previous { order: 1; }
.toolbar #next { order: 3; }
.toolbar #nextTogether { order: 4; }
.toolbar #previous,
.toolbar #next {
    min-width: 44px;
    text-decoration: none;
    font-size: 20px;
    padding: 4px 8px;
}
@media (max-width: 520px) {
    .toolbar { flex-wrap: wrap; }
    .toolbar #nextTogether { flex: 1 0 100%; }
    #organizerTools summary { font-size: 15px; }
}

/* ---- The built-in look: Three Little Birds (direction.html, kids.html, quiz.html). ---- */
@font-face { font-family: Shrikhand; src: url(/fonts/shrikhand.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Marker; src: url(/fonts/marker.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Rubik; src: url(/fonts/rubik-700.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Rubik; src: url(/fonts/rubik-900.woff2) format('woff2'); font-weight: 800 900; font-display: swap; }
/* The built-in look wins over colours an older trip saved under the same reserved id. */
body.birds {
    --background: #5edae3;
    --paper: #fff8e7;
    --ink: #102a43;
    --accent: #ffc93c;
    --muted: #0a5c8a;
    --font: Rubik, system-ui;
    --sea: #10b6c8;
    --deep: #0a5c8a;
    --sun: #ffc93c;
    --coral: #ff5a4e;
    --cream: #fff8e7;
    --green: #176e4c;
    font-weight: 700;
    line-height: 1.45;
}
.scene { display: none; }
body.birds .scene {
    display: block;
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
body.birds .scene .sun { position: absolute; width: clamp(170px, 25vw, 360px); height: clamp(170px, 25vw, 360px); background: var(--sun); border-radius: 50%; top: 11%; right: -4%; }
body.birds .scene .wave { position: absolute; width: 220%; height: 140px; left: -30%; }
body.birds .scene .w1 { bottom: 5%; }
body.birds .scene .w2 { bottom: -38px; }
body.birds header,
body.birds main,
body.birds footer,
body.birds #organizerTools {
    position: relative;
    z-index: 1;
}
body.birds #brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 400 clamp(17px, 2vw, 22px)/1.1 Marker, cursive;
}
body.birds .brand-bird { width: 42px; height: 42px; flex: none; transform: rotate(-8deg); }
body.birds h1 {
    font: 400 clamp(30px, 5vw, 52px)/1.12 Shrikhand, serif;
    letter-spacing: 0;
    text-shadow: 2px 3px var(--sun), 4px 5px var(--coral);
    transform: rotate(-2deg);
}
body.birds h2 {
    font: 400 clamp(27px, 4.5vw, 46px)/1.12 Shrikhand, serif;
}
body.birds dialog h2 { font-size: clamp(25px, 4vw, 34px); }
body.birds .eyebrow,
body.birds #kind,
body.birds .toolbar #progress {
    font: 400 17px Marker, cursive;
    letter-spacing: 0;
    text-transform: none;
    color: var(--deep);
}
body.birds .paper {
    background: var(--cream);
    border: 8px solid #fff;
    border-radius: 34px;
    box-shadow: 10px 12px 0 #102a4333;
}
body.birds #card { transform: rotate(-1deg); }
body.birds button,
body.birds .upload {
    font-family: Rubik, sans-serif;
    font-weight: 900;
    border-radius: 999px;
    box-shadow: 2px 3px 0 var(--ink);
}
body.birds .quiet { box-shadow: none; }
body.birds #flip {
    display: block;
    margin: 18px 0 0 auto;
    background: var(--sun);
    border: 2px solid var(--ink);
    border-radius: 999px;
    text-decoration: none;
    padding: 10px 16px;
    min-height: 46px;
    font-size: 14px;
    box-shadow: 2px 3px 0 var(--ink);
}
/* The pinned vote row sits on a deep-sea band, so card text never shows between the buttons. */
body.birds .choices {
    background: var(--deep);
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -4px 0 #ffffff;
}
body.birds .choices button {
    border: 4px solid #fff;
    border-radius: 23px;
    min-height: 60px;
    font-size: clamp(17px, 2vw, 23px);
    box-shadow: 4px 6px 0 #102a433d;
    transition: transform 0.14s, box-shadow 0.14s;
}
body.birds .choices button:active { transform: translateY(2px); box-shadow: 2px 3px 0 #102a433d; }
body.birds [data-choice='keep'] { background: var(--green); color: #fff; }
body.birds [data-choice='drop'] { background: var(--coral); color: var(--ink); }
body.birds [data-choice='later'] { background: var(--sun); color: var(--ink); }
body.birds input,
body.birds select,
body.birds textarea { border-radius: 16px; }
body.birds footer {
    width: fit-content;
    max-width: 100%;
    padding: 9px 16px;
    border-radius: 16px;
    color: var(--cream);
    background: var(--deep);
}
body.birds #organizerTools summary,
body.birds #groupVotes summary { color: var(--ink); }
body.birds dialog {
    background: var(--cream);
    border: 8px solid #fff;
    border-radius: 30px;
    box-shadow: 10px 12px 0 #102a4333;
}
@media (max-width: 520px) {
    body.birds .brand-bird { width: 35px; height: 35px; }
    body.birds .choices button { min-height: 54px; font-size: 16px; padding: 8px 4px; }
}

/* Phone review, usability first: the card, its flip button and the votes always fit one screen.
   A long card scrolls inside itself, so nothing is cut off and "The full story" never hides. */
@media (max-width: 600px) {
    body.reviewing { padding-top: 10px; }
    body.reviewing main { margin-top: 6px; }
    body.reviewing #card {
        max-height: calc(100svh - 350px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    body.reviewing #front,
    body.reviewing #back {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    body.reviewing #flip {
        flex: 0 0 auto;
        margin: 10px 0 0 auto;
    }
    body.birds.reviewing h2 { font-size: 25px; }
    body.reviewing #card { position: relative; }
    body.reviewing #card.has-more #front {
        -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
        mask-image: linear-gradient(to bottom, #000 72%, transparent);
    }
    body.reviewing #card.has-more::after {
        content: 'More below ↓';
        position: absolute;
        left: clamp(20px, 4vw, 34px);
        bottom: clamp(20px, 4vw, 34px);
        line-height: 46px;
        font-size: 14px;
        font-weight: 800;
        color: var(--ink);
        pointer-events: none;
    }
    /* The dropdown gives up width first, so ←, the counter and → stay on one row. */
    .toolbar select { flex: 1 1 0; }
    .toolbar #previous,
    .toolbar #next {
        flex: 0 0 auto;
        min-width: 52px;
        min-height: 44px;
        border: 2px solid var(--ink);
        border-radius: 999px;
        background: var(--paper);
        color: var(--ink);
    }
    .choices button {
        white-space: nowrap;
        font-size: 15px;
        padding-left: 6px;
        padding-right: 6px;
    }
    body.birds .scene .sun { top: auto; bottom: 18%; }
}
/* Vote count and the "nothing is booked" note sit on the waves: give them a cream backing so they read. */
body.birds #saved:not(:empty),
body.birds #votes:not(:empty) {
    background: var(--cream);
    color: var(--ink);
    border-radius: 14px;
    padding: 6px 12px;
}

/* Laws of UX pass, 2026-11-02, measured at 390px.
   Fitts: every tap target is at least 44px and sits 8px or more from its neighbours.
   Similarity: "The full story" no longer wears the same sun yellow as "Maybe later",
   and the footer motto is plain text, not a dark pill that looks tappable. */
.toolbar select { min-height: 44px; }
@media (max-width: 600px) { .toolbar { margin-top: 8px; } }
#groupVotes summary,
#organizerTools summary { min-height: 44px; padding: 11px 0; box-sizing: border-box; }
.choices { gap: 10px; }
@media (max-width: 600px) { .choices { gap: 10px; } }
body.birds #flip { background: var(--paper); }
body.birds footer { background: none; padding: 0; color: var(--ink); }
/* Von Restorff: the vote row owns the colour. The organizer's reveal is a deep-sea button, not a fourth vote colour. */
body.birds #reveal { background: var(--deep); color: var(--cream); }

/* Landing video for visitors without a personal link. */
#landingVideo { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 0 0 24px; border-radius: 24px; border: 6px solid #fff; box-shadow: 8px 10px 0 #102a4333; background: var(--deep); }
#landingVideo[hidden] { display: none; }
#landingVideo.vertical { aspect-ratio: 9 / 16; width: auto; max-width: 100%; height: min(78svh, 720px); margin: 0 auto 24px; }

/* Finish screen after the last vote */
.done { text-align: center; padding: 32px 24px; }
.done h2 { margin: 8px 0 12px; font-size: 34px; }
.done p { margin: 0 0 12px; font-size: 18px; line-height: 1.4; }
.done .done-bird { width: 96px; height: 96px; }
.done button { min-height: 48px; margin-top: 8px; }
body.birds .done h2 { font-family: Shrikhand, serif; color: var(--ink); }
