/* Holiday Huddle: mobile-first, no framework. Light and dark follow the system setting. */

/* Brand typeface of the Holiday Huddle logo (SIL OFL, see /fonts/OFL-Bricolage-Grotesque.txt) */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-800-normal.woff2) format('woff2'); }

:root {
    /* Holiday Huddle brand defaults (lake teal + sunflower); instances override via /theme.css */
    --bg: #f2f6f5;
    --surface: #ffffff;
    --surface-2: #e4eeec;
    --text: #12272b;
    --muted: #4f6467;
    --border: #cfddda;
    --primary: #0e7c7b;
    --primary-ink: #ffffff;
    --primary-soft: #d5ece9;
    --accent: #b8780a;
    --accent-soft: #fff1c2;
    --sun: #f5b700;
    --danger: #b3261e;
    --mine: #0e7c7b;
    --mine-ink: #ffffff;
    --radius: 14px;
    --radius-small: 10px;
    --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 2px 8px rgb(0 0 0 / 4%);
    --tap: 44px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1a1d;
        --surface: #10252a;
        --surface-2: #16323a;
        --text: #e8f2f0;
        --muted: #9db5b3;
        --border: #23434a;
        --primary: #3cc2be;
        --primary-ink: #062022;
        --primary-soft: #143b3e;
        --accent: #ffc94d;
        --accent-soft: #3a3115;
        --sun: #ffc94d;
        --danger: #f2877f;
        --mine: #146b69;
        --mine-ink: #f1f7f3;
        --shadow: none;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-family: var(--font-display, inherit); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; margin-top: 1.75rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--primary-text, var(--primary)); }
code { font-size: .85em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
blockquote { margin: .5rem 0; padding: .5rem .75rem; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; white-space: pre-wrap; }

.container { max-width: 760px; margin: 0 auto; padding: 1rem 1rem calc(2rem + var(--safe-bottom)); }
.container.narrow { max-width: 520px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .25rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.empty { color: var(--muted); padding: 1rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.footer-links { margin-top: 2rem; text-align: center; font-size: .9rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; }
.row-2 > * { min-width: 0; }

/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(.5rem + env(safe-area-inset-top, 0px)) 1rem .5rem;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.lang-menu { position: relative; }
.lang-menu summary {
    list-style: none; cursor: pointer; min-width: var(--tap); min-height: var(--tap);
    display: grid; place-items: center; font-weight: 600; font-size: .85rem; color: var(--muted);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu .menu {
    position: absolute; right: 0; top: calc(100% + 4px); min-width: 160px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small);
    box-shadow: var(--shadow); padding: .25rem; display: flex; flex-direction: column;
}
.lang-menu .menu a { padding: .65rem .75rem; text-decoration: none; color: var(--text); border-radius: 8px; }
.lang-menu .menu a:hover { background: var(--surface-2); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; flex: none;
    display: grid; place-items: center; text-decoration: none;
    background: var(--primary-soft); color: var(--primary-text, var(--primary)); font-weight: 700;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: var(--tap); padding: .6rem 1.1rem;
    border: 1px solid var(--primary); border-radius: 999px;
    background: var(--primary); color: var(--primary-ink);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    touch-action: manipulation; transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-block { display: flex; width: 100%; }
.btn-small { min-height: 36px; padding: .35rem .85rem; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--primary-text, var(--primary)); }
.btn-danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.btn-ghost.btn-danger { background: transparent; color: var(--danger); }
.icon-btn {
    min-width: var(--tap); min-height: var(--tap); display: grid; place-items: center;
    font-size: 1.8rem; text-decoration: none; color: var(--text); line-height: 1;
}

/* ---------- forms ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .6rem; }
legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.field { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; }
.field > span { font-size: .9rem; }
input[type=text], input[type=email], input[type=date], input[type=datetime-local], select, textarea {
    width: 100%; min-height: var(--tap);
    font: inherit; font-size: 16px; /* 16px stops iOS from zooming in on focus */
    color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-small);
    padding: .6rem .75rem; appearance: none; -webkit-appearance: none;
}
input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px;
}
.hint { color: var(--muted); font-weight: 400; font-size: .85rem; }
.error { color: var(--danger); font-size: .85rem; font-weight: 500; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.choice, .chip { position: relative; cursor: pointer; }
.choice input, .chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 52px; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius-small);
    background: var(--surface); font-weight: 600;
}
.choice input:checked + span { border-color: var(--primary-text, var(--primary)); background: var(--primary-soft); color: var(--primary-text, var(--primary)); box-shadow: inset 0 0 0 1px var(--primary); }
.choice input:focus-visible + span, .chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip span {
    display: inline-flex; align-items: center; min-height: 40px; padding: .35rem .9rem;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .95rem;
}
.chip input:checked + span { background: var(--primary); border-color: var(--primary-text, var(--primary)); color: var(--primary-ink); }
.chip input:disabled + span { opacity: .45; }
.toggle { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small); }
.toggle input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--primary-text, var(--primary)); flex: none; }
.toggle span { display: flex; flex-direction: column; }
.toggle small { color: var(--muted); }

/* Kids' ages only for families (progressive: always visible where :has() is unsupported). */
@supports selector(:has(*)) {
    .stay-form .kids { display: none; }
    .stay-form:has(input[name=travelType][value=FAMILY]:checked) .kids { display: flex; }
}

.danger-zone { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ---------- notices ---------- */
.notice { padding: .75rem 1rem; border-radius: var(--radius-small); background: var(--primary-soft); color: var(--text); margin: .5rem 0 1rem; }
.notice-warn { background: var(--accent-soft); }
.notice p { margin: 0; }
.dev-box { margin-top: 1.5rem; padding: 1rem; border: 2px dashed var(--accent); border-radius: var(--radius); text-align: left; }
.big-icon { font-size: 3rem; margin: 1.5rem 0 .5rem; color: var(--primary-text, var(--primary)); }

/* ---------- landing ---------- */
.hero { padding: 1.5rem 0 .5rem; }
.hero h1 { font-size: 2rem; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1rem 0 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.steps li { counter-increment: step; display: flex; flex-direction: column; padding: .9rem 1rem .9rem 3.4rem; position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li::before {
    content: counter(step); position: absolute; left: 1rem; top: .9rem; width: 1.8rem; height: 1.8rem;
    border-radius: 50%; background: var(--sun, var(--accent)); color: #12272b; display: grid; place-items: center; font-weight: 700;
}
.steps span { color: var(--muted); font-size: .95rem; }
.checklist { padding: 0; list-style: none; display: flex; flex-direction: column; gap: .4rem; margin: 1rem 0 1.5rem; }
.checklist li { padding-left: 1.6rem; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--primary-text, var(--primary)); font-weight: 700; }
.admin-links { display: flex; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }

/* ---------- cards ---------- */
.cards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.card > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.card-link { position: relative; text-decoration: none; color: var(--text); padding-right: 2.5rem; }
.card-link:active { background: var(--surface-2); }
.card-title { font-weight: 700; font-size: 1.05rem; margin: 0; }
.card-meta { color: var(--muted); font-size: .9rem; margin: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.chev { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--muted); }
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 700; vertical-align: middle; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); font-size: .8rem; }
.tag-kids { background: var(--accent-soft); }
.tag-interest { background: var(--primary-soft); }
.person-head { display: flex; gap: .75rem; align-items: center; }
.contact { margin: .25rem 0 0; font-size: .9rem; word-break: break-all; }
.week-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.copy-row { display: flex; gap: .5rem; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font-size: 14px; }
.meetup-when { color: var(--accent); font-weight: 700; font-size: .9rem; }

/* ---------- group screen: full-height app layout ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 760px; margin: 0 auto; }
.group-head {
    display: flex; align-items: center; gap: .25rem;
    padding: calc(.25rem + env(safe-area-inset-top, 0px)) .5rem .25rem .25rem;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.group-title { flex: 1; min-width: 0; }
.group-title h1 { font-size: 1.05rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-title p { margin: 0; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); margin-right: .5rem; flex: none; transition: background .3s; }
.app.is-live .live-dot { background: #3bb273; }
.tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--border); }
.tabs a {
    flex: 1; text-align: center; padding: .7rem .5rem; min-height: var(--tap);
    text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem;
    border-bottom: 3px solid transparent;
}
.tabs a.active { color: var(--primary-text, var(--primary)); border-bottom-color: var(--primary-text, var(--primary)); }
.app > .notice { margin: .5rem .75rem 0; }
.panel { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: .75rem .75rem calc(1.5rem + var(--safe-bottom)); }
.propose { margin-bottom: 1rem; }
.propose > summary { list-style: none; }
.propose > summary::-webkit-details-marker { display: none; }
.propose[open] > summary { margin-bottom: 1rem; background: transparent; color: var(--primary-text, var(--primary)); }
.filters { display: flex; gap: .5rem; margin-bottom: .75rem; }
.filters label { flex: 1; }

/* chat */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat > .notice { margin: .5rem .75rem 0; }
.messages {
    flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    padding: .75rem; display: flex; flex-direction: column; gap: .5rem;
}
.msg { max-width: 85%; align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 16px 16px 16px 4px; padding: .45rem .75rem .5rem; position: relative; }
.msg-mine { align-self: flex-end; background: var(--mine); color: var(--mine-ink); border-color: var(--mine); border-radius: 16px 16px 4px 16px; }
.msg-mine .msg-meta { color: color-mix(in srgb, var(--mine-ink) 75%, transparent); }
.msg-announcement { align-self: stretch; max-width: none; background: var(--accent-soft); border-color: var(--accent); border-radius: var(--radius-small); }
.msg-meta { display: flex; gap: .5rem; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.msg-author { font-weight: 700; }
.msg-who { display: inline-flex; align-items: center; gap: .35rem; }
.msg-who .avatar { width: 22px; height: 22px; font-size: .7rem; }
.msg-photo { display: block; margin: .35rem 0 .1rem; }
.msg-photo img { display: block; max-width: 100%; width: 260px; height: auto; border-radius: 10px; background: var(--surface-2); }
.msg-mine .msg-author { display: none; }
.msg-body { margin: .1rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-report { position: absolute; right: -2.2rem; top: 0; }
.msg-report > summary { list-style: none; cursor: pointer; width: 2rem; height: 2rem; display: grid; place-items: center; color: var(--muted); }
.msg-report > summary::-webkit-details-marker { display: none; }
.msg-report[open] { position: static; margin-top: .5rem; }
.msg-report[open] > summary { display: none; }
.msg:has(.msg-report) { margin-right: 2.2rem; }
.composer {
    display: flex; flex-direction: column; gap: .4rem;
    padding: .5rem .75rem calc(.5rem + var(--safe-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
}
.composer-row { display: flex; gap: .5rem; align-items: flex-end; }
.composer-preview { position: relative; align-self: flex-start; }
.composer-preview[hidden], .composer-hint[hidden] { display: none; }
.composer-preview img { display: block; max-height: 96px; max-width: 160px; border-radius: 10px; border: 1px solid var(--border); }
.preview-remove {
    position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%;
    border: 0; background: var(--text); color: var(--bg); cursor: pointer; font-size: .8rem;
}
.composer-hint { color: var(--muted); font-size: .8rem; }
.photo-btn {
    width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; cursor: pointer;
    border-radius: 50%; background: var(--surface-2); font-size: 1.15rem; position: relative; overflow: hidden;
}
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.composer textarea { flex: 1; min-height: var(--tap); max-height: 9rem; resize: none; border-radius: 22px; padding: .6rem 1rem; line-height: 1.35; }
.send {
    width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--primary); color: var(--primary-ink); font-size: 1.1rem; touch-action: manipulation;
}
.send:disabled { opacity: .5; }
.htmx-request .send, .send.htmx-request { opacity: .6; }

/* prose (privacy) */
.prose h2 { margin-top: 1.5rem; }

@media (min-width: 640px) {
    h1 { font-size: 1.9rem; }
    .choice-grid { grid-template-columns: repeat(4, 1fr); }
    .container { padding-top: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- white-label additions ---------- */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-link { text-decoration: none; display: inline-flex; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text, var(--primary)); font-weight: 700; font-size: 1.5rem; }
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-card { gap: .75rem; margin-bottom: 1rem; }
.photo-form { display: inline-flex; gap: .5rem; }
.photo-form .btn { position: relative; overflow: hidden; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-text { font-family: var(--brand-font, inherit); letter-spacing: var(--brand-tracking, 0); font-weight: 800; }
.brand img { width: 30px; height: 30px; }
.powered-by { display: inline-flex; align-items: center; gap: .35rem; }
.powered-by img { width: 18px; height: 18px; }
.powered-by b { font-family: 'Bricolage Grotesque', var(--font, system-ui), sans-serif; font-weight: 800; }
.hero-mark { width: 72px; height: 72px; display: block; margin-bottom: .75rem; }
.demo-banner {
    background: var(--text); color: var(--bg); text-align: center; font-size: .75rem; font-weight: 600; line-height: 1.3;
    padding: .3rem .75rem; padding-top: calc(.3rem + env(safe-area-inset-top, 0px));
}
.site-footer { margin-top: 2.5rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; font-size: .8rem; color: var(--muted); text-align: center; }
.parties dt { font-weight: 700; margin-top: .75rem; }
.parties dd { margin: .25rem 0 0; }

/* Group screen under a demo banner: the banner takes its own height, the app fills the rest. */
body:has(> #page.app) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
body:has(> #page.app) > #page.app { flex: 1; min-height: 0; height: auto; width: 100%; }
