/* Flnx web app. Brand palette and type from docs/brand/brand-guide.webp.
   Phones (< 900px): native-app shell with large collapsing titles, a floating pill tab bar,
   soft cards, slide and sheet transitions. Desktop (>= 900px): navy sidebar, list/detail for Family. */

:root {
    --navy: #0B1D3A;
    --navy-2: #13306A;
    --teal: #00B894;
    --teal-dark: #00866C;
    --blue: #2563EB;
    --slate: #7A869A;
    --bg: #F4F6FA;
    --surface: #FFFFFF;
    --fill: #F1F4F8;
    --pressed: #EEF1F6;
    --line: #EDF0F5;
    --bad: #D92D20;
    --brand-gradient: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
    --shadow-card: 0 1px 2px rgba(11, 29, 58, 0.04), 0 8px 24px rgba(11, 29, 58, 0.06);
    --shadow-float: 0 12px 32px rgba(11, 29, 58, 0.16), 0 2px 6px rgba(11, 29, 58, 0.08);
    --radius-lg: 22px;
    --radius-md: 16px;
    --bar-h: 56px;
    --tab-h: 64px;
    --gutter: 20px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --ease-out: cubic-bezier(0.22, 0.9, 0.24, 1);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--navy);
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }

/* Blazor moves focus to the page heading on navigation (for screen readers); don't draw a ring for it. */
h1:focus { outline: none; }

a, button, input, select, textarea, label { touch-action: manipulation; }

button { font: inherit; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.icon { width: 24px; height: 24px; flex-shrink: 0; }

.muted { color: var(--slate); }

.error { color: var(--bad); font-weight: 500; }

.pre { white-space: pre-line; }

.inset { padding: 8px var(--gutter); }

/* ===== Shell ===== */

.shell { min-height: 100dvh; }

.sidebar { display: none; }

.main { padding-bottom: calc(var(--tab-h) + 28px + var(--safe-bottom)); }

.shell.tabs-hidden .main { padding-bottom: calc(24px + var(--safe-bottom)); }

/* Floating pill tab bar. The active tab grows into a navy capsule with its label. */
.tabbar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(12px + var(--safe-bottom));
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--tab-h);
    padding: 0 8px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: var(--shadow-float);
    transition: transform 0.35s var(--ease-out), opacity 0.25s;
}

.shell.tabs-hidden .tabbar { transform: translateY(calc(100% + 40px)); opacity: 0; }

.tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    min-width: 48px;
    padding: 0 12px;
    border-radius: 24px;
    color: var(--slate);
    text-decoration: none;
    user-select: none;
    transition: background 0.25s var(--ease-out), color 0.25s, padding 0.25s var(--ease-out);
}

.tab .tab-label { display: none; font-size: 14px; font-weight: 600; white-space: nowrap; }

.tab.active { background: var(--navy); color: #FFFFFF; padding: 0 18px 0 14px; }

.tab.active .tab-label { display: inline; }

.tab:active { transform: scale(0.94); }

/* ===== App bar ===== */

.appbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: calc(var(--bar-h) + var(--safe-top));
    padding: var(--safe-top) 12px 0;
    background: transparent;
    transition: background 0.2s, box-shadow 0.2s;
    user-select: none;
}

.appbar.scrolled {
    background: rgba(244, 246, 250, 0.84);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 1px 0 rgba(11, 29, 58, 0.06);
}

.appbar-title {
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: opacity 0.2s, transform 0.2s;
}

.appbar-large:not(.scrolled) .appbar-title,
.appbar-transparent:not(.scrolled) .appbar-title { opacity: 0; transform: translateY(4px); }

.appbar-leading { justify-self: start; display: flex; }

.appbar-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }

.appbar-back, .round-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--navy);
    box-shadow: 0 1px 2px rgba(11, 29, 58, 0.08), 0 4px 12px rgba(11, 29, 58, 0.08);
    text-decoration: none;
    cursor: pointer;
}

.appbar-back .icon, .round-btn .icon { width: 22px; height: 22px; }

.appbar-back:active, .round-btn:active { transform: scale(0.92); }

.large-title-row { padding: 2px var(--gutter) 10px; }

.large-title { margin: 0; font-size: 32px; line-height: 1.15; letter-spacing: -0.025em; }

.large-subtitle { margin: 4px 0 0; color: var(--slate); font-size: 14.5px; }

.link-btn {
    border: 0;
    background: none;
    padding: 4px 0;
    color: var(--blue);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

/* ===== Pages and transitions ===== */

.page-body { max-width: 760px; margin: 0 auto; padding: 4px var(--gutter) 32px; }

.split-list { display: none; }

@keyframes push-in {
    from { transform: translateX(28%); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes pop-in {
    from { transform: translateX(-16%); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes sheet-up {
    from { transform: translateY(18%); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.page.slide-forward { animation: push-in 0.34s var(--ease-out); }

.page.slide-back { animation: pop-in 0.34s var(--ease-out); }

.page.slide-forward:has(.appbar-modal) { animation: sheet-up 0.38s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
    .page.slide-forward, .page.slide-back, .page.slide-forward:has(.appbar-modal) { animation: none; }
}

.desktop-only { display: none; }

/* ===== Sections and cards ===== */

.section { margin-top: 28px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }

.section-title { margin: 0 0 10px; font-size: 18px; font-weight: 600; }

.section-head .section-title { margin: 0; }

.page-body > .section-title { margin-top: 28px; }

.section-title .count {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #E6EAF1;
    color: var(--slate);
    font-size: 12px;
    font-weight: 600;
    vertical-align: 2px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-card);
}

.card h2 { margin: 0 0 8px; font-size: 16px; }

.card dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0; }

.card dt { color: var(--slate); }

.card dd { margin: 0; }

.status.good { color: var(--teal-dark); font-weight: 600; }

.status.bad { color: var(--bad); font-weight: 600; }

.card-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-list > li + li { box-shadow: inset 0 1px 0 var(--line); }

.row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 64px;
    padding: 10px 16px;
    border: 0;
    background: transparent;
    color: var(--navy);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.row:active { background: var(--pressed); }

.row:disabled { opacity: 0.6; }

.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.row-title { font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-title.pre { white-space: pre-line; }

.meta { font-size: 13.5px; color: var(--slate); }

.row-chevron { width: 18px; height: 18px; color: #C2C9D4; }

.row-icon, .family-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex-shrink: 0;
}

.row-icon { background: #EAF0FD; color: var(--blue); }

.family-badge { background: var(--brand-gradient); color: #FFFFFF; }

.row-icon .icon, .family-badge .icon { width: 22px; height: 22px; }

.row-with-action { display: flex; align-items: center; }

.row-with-action .row { flex: 1; min-width: 0; }

.row-with-action > .link-btn { margin-right: 16px; }

.add-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1.5px dashed rgba(37, 99, 235, 0.35);
    border-radius: var(--radius-lg);
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}

.add-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #EAF0FD;
    color: var(--blue);
}

.add-circle .icon { width: 20px; height: 20px; }

/* ===== Avatars ===== */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--avatar-bg);
    color: var(--avatar-fg);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.avatar-sm { width: 44px; height: 44px; font-size: 15px; }

.avatar-md { width: 64px; height: 64px; font-size: 21px; }

.avatar-lg { width: 108px; height: 108px; font-size: 38px; }

/* ===== People list (Family tab) ===== */

.searchbox {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    margin: 4px var(--gutter) 6px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--slate);
}

.searchbox .icon { width: 19px; height: 19px; }

.searchbox input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: var(--navy);
}

.searchbox input::placeholder { color: #9AA4B5; }

.list-group { padding: 0 var(--gutter); margin-top: 22px; }

.list-group .section-title { font-size: 15px; color: var(--slate); }

.empty-card {
    margin: 16px var(--gutter);
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.empty-card h2 { margin: 16px 0 6px; font-size: 20px; }

.empty-card p { margin: 0 0 20px; color: var(--slate); }

.empty-icon, .coming-soon-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: var(--brand-gradient);
    color: #FFFFFF;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.empty-icon .icon, .coming-soon-icon .icon { width: 38px; height: 38px; }

.picker-list { margin-top: 10px; }

/* ===== Person profile ===== */

.hero {
    position: relative;
    margin-top: calc(-1 * (var(--bar-h) + var(--safe-top)));
    padding: calc(var(--bar-h) + var(--safe-top) + 8px) var(--gutter) 64px;
    overflow: hidden;
    text-align: center;
    color: #FFFFFF;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.18) 0, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(11, 29, 58, 0.25) 0, transparent 45%),
        linear-gradient(140deg, var(--teal) 0%, #14A3A8 35%, var(--blue) 100%);
    border-radius: 0 0 32px 32px;
}

.hero-loading { min-height: 240px; }

.hero .avatar-lg {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95), 0 14px 32px rgba(11, 29, 58, 0.28);
}

.hero-name { margin: 16px 0 8px; font-size: 26px; line-height: 1.2; }

.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

.hero-chip {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 500;
}

.hero-body { position: relative; margin-top: -40px; }

.hero-body > .card + .card { margin-top: 16px; }

/* Add/edit sheets reuse the profile header. */
.hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95);
    color: #FFFFFF;
}

.hero-icon .icon { width: 44px; height: 44px; }

.card .card-title { margin: 0 0 14px; font-size: 18px; }

/* The full-width submit button at the base of a form. */
.form-submit { gap: 8px; width: 100%; min-height: 54px; margin-top: 6px; border-radius: 16px; font-size: 16px; }

.form-submit .icon { width: 20px; height: 20px; }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 14px 8px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--navy);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
}

.quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #EAF0FD;
    color: var(--blue);
}

.quick-icon .icon { width: 21px; height: 21px; }

.quick-action:active .quick-icon { transform: scale(0.92); }

.quick-action.off { opacity: 0.35; pointer-events: none; }

.people-strip {
    display: flex;
    gap: 14px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.people-strip::-webkit-scrollbar { display: none; }

.person-chip { position: relative; flex: none; width: 78px; scroll-snap-align: start; }

.person-chip > a, .add-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--navy);
    text-decoration: none;
}

.person-chip .avatar-md { box-shadow: 0 0 0 3px var(--surface), 0 6px 16px rgba(11, 29, 58, 0.1); }

.chip-name { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }

.chip-meta { margin-top: -6px; font-size: 12px; color: var(--slate); }

.add-chip .add-circle {
    width: 64px;
    height: 64px;
    border: 1.5px dashed rgba(37, 99, 235, 0.45);
    background: transparent;
}

.add-chip .add-circle .icon { width: 24px; height: 24px; }

.add-chip .chip-name { color: var(--blue); font-weight: 600; }

.chip-remove {
    position: absolute;
    top: -4px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 2px solid var(--bg);
    border-radius: 50%;
    background: var(--bad);
    color: #FFFFFF;
    cursor: pointer;
}

.chip-remove .icon { width: 13px; height: 13px; }

/* ===== Home ===== */

.countdown-card {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 22px;
    border-radius: 26px;
    color: #FFFFFF;
    background:
        radial-gradient(circle at 100% 0%, rgba(0, 184, 148, 0.45) 0, transparent 50%),
        linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 60%, var(--blue) 140%);
    box-shadow: 0 14px 34px rgba(11, 29, 58, 0.22);
}

.countdown-text { display: flex; flex-direction: column; }

.eyebrow { color: #6FE7CF; font-size: 13px; font-weight: 600; }

.countdown-number { margin-top: 4px; font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; }

.countdown-label { color: rgba(255, 255, 255, 0.75); font-size: 15px; }

.countdown-art { position: absolute; top: 12px; right: -12px; color: rgba(255, 255, 255, 0.12); }

.countdown-art .icon { width: 150px; height: 150px; }

.countdown-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 18px;
    padding: 10px 12px 10px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.countdown-cta .icon { width: 18px; height: 18px; }

.family-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--navy);
    text-decoration: none;
}

/* Each avatar sits on top of the one to its right (z-index set in markup) and only covers its edge. */
.avatar-stack { display: flex; padding-left: 6px; }

.stack-item { position: relative; margin-left: -6px; border-radius: 50%; }

.stack-item .avatar { font-size: 12px; box-shadow: 0 0 0 3px var(--surface); }

.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tile {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--navy);
    text-decoration: none;
}

/* "Your family": the signed-in person's household, everyone named. */
.household {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 16px 18px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--navy);
    text-decoration: none;
}

.household-name { font-size: 15px; font-weight: 600; }

.household-people { display: flex; flex-wrap: wrap; gap: 14px 10px; }

.household-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 68px;
    font-size: 13.5px;
    font-weight: 500;
    text-align: center;
}

.household-person > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.household-person .avatar { width: 56px; height: 56px; font-size: 19px; }

/* Secret Santa on Home: answer, or who you've got. */
.santa-home {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #0F7A64 0%, var(--teal) 60%, #2BC9A6 100%);
    color: #FFFFFF;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(0, 134, 108, 0.25);
}

.santa-home .avatar { flex: none; width: 52px; height: 52px; font-size: 18px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85); }

.santa-home-eyebrow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, 0.8); }

.santa-home-title { font-size: 18px; font-weight: 600; line-height: 1.25; }

.santa-home .meta { color: rgba(255, 255, 255, 0.85); }

.santa-home .row-chevron { color: rgba(255, 255, 255, 0.8); }

.tile:active, .family-summary:active, .household:active, .santa-home:active { transform: scale(0.985); }

.tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
}

.tile-blue { background: #E0EAFD; color: var(--blue); }

.tile-teal { background: #D9F5EE; color: var(--teal-dark); }

.tile-title { margin-top: 14px; font-size: 16px; font-weight: 600; }

/* ===== Coming soon ===== */

.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 24px 16px;
    text-align: center;
}

.coming-soon .pill { margin-top: 22px; }

.coming-soon h2 { margin: 12px 0 8px; font-size: 22px; }

.coming-soon p { margin: 0; color: var(--slate); }

.pill {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: #D9F5EE;
    color: var(--teal-dark);
    font-size: 13px;
    font-weight: 600;
}

/* ===== Forms ===== */

.form { display: flex; flex-direction: column; gap: 16px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 420px) {
    .field-row { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--slate); }

.field input, .field select, .field textarea {
    font: inherit;
    font-size: 16px; /* 16px stops iOS zooming into the field */
    font-weight: 400;
    color: var(--navy);
    min-height: 52px;
    padding: 12px 14px;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: var(--fill);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, background 0.15s;
}

.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A869A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); background-color: var(--surface); }

/* Toggle switch rows: label left, switch right. */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 44px;
    font-size: 15.5px;
    color: var(--navy);
    cursor: pointer;
}

.switch-row.card { padding: 12px 18px; }

.switch {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: none;
    width: 50px;
    height: 30px;
    margin: 0;
    border-radius: 15px;
    background: #DCE1EA;
    cursor: pointer;
    transition: background 0.2s;
}

.switch::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(11, 29, 58, 0.2);
    transition: transform 0.22s var(--ease-out);
}

.switch:checked { background: var(--teal); }

/* A switch inside a .field mustn't pick up the filled text-input styling. */
.field .switch { min-height: 0; height: 30px; padding: 0; border: 0; border-radius: 15px; background: #DCE1EA; }

.field .switch:checked { background: var(--teal); }

.field .switch-row { font-size: 15.5px; font-weight: 400; color: var(--navy); }

.switch:checked::before { transform: translateX(20px); }

.switch:focus-visible { outline: 2px solid rgba(37, 99, 235, 0.4); outline-offset: 2px; }

.contact { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; border-top: 1px solid var(--line); }

.contact summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    padding: 12px 0 4px;
    font-weight: 600;
    font-size: 15.5px;
    color: var(--navy);
    cursor: pointer;
}

.contact summary::-webkit-details-marker { display: none; }

.summary-chevron { width: 18px; height: 18px; color: var(--slate); transition: transform 0.2s; }

.contact[open] .summary-chevron { transform: rotate(90deg); }

.editor { display: flex; flex-direction: column; gap: 14px; padding: 6px 16px 18px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    background: var(--blue);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.btn:active { transform: scale(0.97); }

.btn:disabled { opacity: 0.5; cursor: default; }

.btn-secondary { background: var(--fill); color: var(--navy); box-shadow: none; }

.btn-danger { background: #FDECEA; color: var(--bad); box-shadow: none; }

.valid.modified:not([type=checkbox]) { border-color: rgba(0, 184, 148, 0.5); }

.invalid { border-color: var(--bad) !important; }

.validation-message { color: var(--bad); font-size: 13px; }

/* ===== Desktop ===== */

@media (min-width: 900px) {
    :root { --gutter: 32px; }

    .shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

    .tabbar { display: none; }

    .main, .shell.tabs-hidden .main { padding-bottom: 0; min-width: 0; }

    .sidebar {
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 0;
        height: 100vh;
        padding: 24px 16px 18px;
        background:
            radial-gradient(circle at 0% 100%, rgba(0, 184, 148, 0.22) 0, transparent 45%),
            var(--navy);
        color: #FFFFFF;
    }

    .sidebar-brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 12px 32px; text-decoration: none; }

    .sidebar-brand img { height: 30px; width: auto; align-self: flex-start; }

    .sidebar-brand span { color: var(--slate); font-size: 12px; letter-spacing: 0.08em; }

    .sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

    .sidebar-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 14px;
        border-radius: 14px;
        color: rgba(255, 255, 255, 0.68);
        text-decoration: none;
        font-weight: 500;
        transition: background 0.15s, color 0.15s;
    }

    .sidebar-item .icon { width: 21px; height: 21px; }

    .sidebar-item:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }

    .sidebar-item.active { background: #FFFFFF; color: var(--navy); font-weight: 600; }

    .sidebar-footer { margin-top: auto; padding: 10px 14px; color: var(--slate); font-size: 12px; }

    .appbar {
        position: static;
        height: auto;
        min-height: 72px;
        padding: 16px var(--gutter) 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }

    .appbar.scrolled, .appbar-modal { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }

    .appbar { max-width: 760px; margin: 0 auto; }

    .appbar-large .appbar-title, .appbar-transparent .appbar-title { visibility: hidden; }

    .appbar-large { min-height: 0; padding-top: 24px; }

    .large-title-row { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter) 16px; }

    .large-title { font-size: 34px; }

    .page.slide-forward, .page.slide-back, .page.slide-forward:has(.appbar-modal) { animation: none; }

    .phone-only { display: none; }

    .desktop-only { display: block; }

    .split { display: grid; grid-template-columns: 360px 1fr; min-height: 100vh; }

    .split-list {
        display: block;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        padding-bottom: 24px;
        background: #FBFCFE;
        border-right: 1px solid var(--line);
    }

    .split-list-head { display: flex; align-items: center; justify-content: space-between; padding: 26px 16px 10px 20px; }

    .split-list-head h2 { margin: 0; font-size: 24px; }

    .split-list .icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: var(--blue);
        color: #FFFFFF;
    }

    .split-list .icon-btn .icon { width: 20px; height: 20px; }

    .split-list { --gutter: 16px; }

    .split-list .list-group { margin-top: 16px; }

    .split-detail { min-width: 0; }

    .row:hover { background: #F6F8FB; }

    .row.active, .row.active:hover { background: #EAF0FD; }

    /* Full-bleed banner across the whole detail area, flush with the top. */
    .hero {
        margin: -72px 0 0;
        padding: 88px var(--gutter) 72px;
        border-radius: 0;
    }

    .appbar-transparent { position: relative; z-index: 2; }

    .empty-detail {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 86vh;
        padding: 24px;
        text-align: center;
    }

    .empty-detail h2 { margin: 18px 0 0; font-size: 22px; }

    .empty-detail p { max-width: 320px; margin: 0 0 18px; color: var(--slate); }
}

/* ===== Startup splash and Blazor plumbing ===== */

.splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: var(--bg);
}

.splash img { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 14px 32px rgba(11, 29, 58, 0.2); }

.splash-bar { width: 120px; height: 4px; border-radius: 2px; background: rgba(11, 29, 58, 0.1); overflow: hidden; }

.splash-bar::after {
    content: "";
    display: block;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: var(--brand-gradient);
    transition: width 0.1s ease-out;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #FFF7E6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem calc(0.7rem + var(--safe-bottom));
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary { background: #B32121; padding: 1rem; color: white; }

.blazor-error-boundary::after { content: "An error has occurred."; }

/* ===== Signed-out screens (sign in, join, setup) ===== */

.auth-screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(48px + var(--safe-top)) var(--gutter) calc(24px + var(--safe-bottom));
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.18) 0, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(11, 29, 58, 0.35) 0, transparent 50%),
        linear-gradient(150deg, var(--teal) 0%, #14A3A8 30%, var(--blue) 75%, var(--navy-2) 100%);
}

.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 28px; }

.auth-brand img { height: 44px; width: auto; }

.auth-brand span { color: rgba(255, 255, 255, 0.85); font-size: 13px; letter-spacing: 0.12em; }

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 22px 24px;
    border-radius: 28px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(11, 29, 58, 0.3);
}

.auth-title { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; }

.auth-lead { margin: 0 0 22px; color: var(--slate); }

.auth-footer { margin-top: auto; padding-top: 28px; color: rgba(255, 255, 255, 0.75); font-size: 13px; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--slate); font-size: 13px; }

.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-wide { width: 100%; min-height: 50px; margin-top: 10px; border-radius: 16px; }

.auth-note { margin: 18px 0 0; color: var(--slate); font-size: 14px; text-align: center; }

.auth-note a { color: var(--blue); font-weight: 600; text-decoration: none; }

.hint { margin: -6px 0 0; color: var(--slate); font-size: 13px; }

.hint.center { margin-top: 14px; text-align: center; }

.code-input { text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; text-align: center; font-size: 22px !important; }

.confirm-person { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }

.confirm-person .avatar-lg { margin-bottom: 14px; }

.confirm-person .auth-lead { margin: 0 0 2px; }

.confirm-person .auth-title { margin: 0; }

.choice-list { list-style: none; margin: -6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: var(--fill);
    color: var(--navy);
    font-size: 15.5px;
    text-align: left;
    cursor: pointer;
}

.choice.selected { border-color: var(--blue); background: #EAF0FD; }

.choice .icon { width: 20px; height: 20px; color: var(--blue); }

/* ===== Me and account ===== */

.me-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--navy);
    text-decoration: none;
}

.sign-out { width: 100%; min-height: 52px; margin-top: 28px; border-radius: 16px; }

.account-card { display: flex; flex-direction: column; gap: 16px; }

.account-status { display: flex; align-items: center; gap: 12px; }

.status-dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: #C2C9D4; }

.status-dot.active { background: var(--teal); box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.18); }

.status-dot.invited { background: #F5A524; box-shadow: 0 0 0 4px rgba(245, 165, 36, 0.18); }

.code-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 16px;
    border-radius: 18px;
    background: var(--fill);
    text-align: center;
}

.code { font-size: 32px; font-weight: 600; letter-spacing: 0.12em; color: var(--navy); user-select: all; }

.code-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 8px; }

.code-actions .btn { gap: 8px; }

.code-actions .icon { width: 18px; height: 18px; }

.code-box .hint { margin: 6px 0 0; }


/* ===== Gifts ===== */

.shopping-banner, .empty-list-card, .list-card, .add-idea {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--navy);
    text-decoration: none;
}

.shopping-banner { color: #FFFFFF; background: linear-gradient(140deg, var(--navy) 0%, var(--navy-2) 70%, var(--blue) 140%); }

.shopping-banner .meta { color: rgba(255, 255, 255, 0.75); }

.shopping-banner .row-chevron { color: rgba(255, 255, 255, 0.6); }

.shopping-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
}

.shopping-icon .icon { width: 22px; height: 22px; }

.empty-list-card .empty-icon { width: 52px; height: 52px; border-radius: 16px; flex: none; }

.empty-list-card .empty-icon .icon { width: 26px; height: 26px; }

.empty-list-card .row-title { white-space: normal; }

.list-cards, .gift-cards { display: flex; flex-direction: column; gap: 12px; }

.list-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 15px;
    background: #D9F5EE;
    color: var(--teal-dark);
}

.list-card-icon.birthday { background: #E0EAFD; color: var(--blue); }

.list-card-icon .icon { width: 23px; height: 23px; }

.list-card .avatar { width: 36px; height: 36px; font-size: 13px; }

.list-card:active, .add-idea:active, .shopping-banner:active { transform: scale(0.985); }

.add-idea { margin-bottom: 14px; }

.add-idea .add-circle { width: 44px; height: 44px; flex: none; background: var(--blue); color: #FFFFFF; }

.hero-gifts {
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.18) 0, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(11, 29, 58, 0.3) 0, transparent 45%),
        linear-gradient(140deg, #13A37F 0%, var(--teal) 30%, #1A8FC0 70%, var(--blue) 100%);
}

.gift-card {
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.gift-card.taken { opacity: 0.6; }

.gift-head { display: flex; align-items: flex-start; gap: 8px; }

.gift-title { flex: 1; margin: 0; font-size: 17px; line-height: 1.3; }

.must-have { color: #F5A524; }

.must-have .icon { width: 20px; height: 20px; fill: #F5A524; }

.gift-edit { color: var(--slate); margin: -4px -6px 0 0; padding: 4px 6px; }

.gift-edit .icon { width: 20px; height: 20px; }

.gift-details { margin: 6px 0 0; color: #3B4A63; white-space: pre-line; }

.gift-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; color: var(--slate); font-size: 14px; }

.gift-meta span { display: inline-flex; align-items: center; gap: 6px; }

.gift-meta .icon { width: 16px; height: 16px; }

.gift-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }

.gift-actions .btn { min-height: 42px; gap: 8px; padding: 0 16px; font-size: 14.5px; }

.gift-actions .icon { width: 17px; height: 17px; }

.gift-link { max-width: 60%; overflow: hidden; }

.gift-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.claim-btn { background: var(--teal); box-shadow: 0 6px 16px rgba(0, 184, 148, 0.3); }

.claimed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ECEEF2;
    color: var(--slate);
    font-size: 14px;
    font-weight: 600;
}

.claimed.mine { background: #D9F5EE; color: var(--teal-dark); }

.claimed .icon { width: 16px; height: 16px; }

.no-peeking { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }

.no-peeking .icon { width: 18px; height: 18px; }

.shared-with { margin: 14px 0 0; color: var(--slate); font-size: 13px; text-align: center; }

.section-title.with-avatar { display: flex; align-items: center; gap: 10px; }

.section-title.with-avatar .avatar { width: 32px; height: 32px; font-size: 12px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--fill); }

.segmented button {
    min-height: 42px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--slate);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.segmented button.selected { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(11, 29, 58, 0.12); }

.inline-star { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; color: #F5A524; fill: #F5A524; }

/* ===== Events ===== */

.event-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--navy);
    text-decoration: none;
}

.event-card.past { opacity: 0.6; }

.event-card:active { transform: scale(0.985); }

.event-card .row-text { gap: 1px; }

.date-block, .hero-date {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 56px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #FFFFFF;
    line-height: 1.05;
}

.date-month { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #6FE7CF; }

.date-day { font-size: 24px; font-weight: 600; }

.hero-event {
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.16) 0, transparent 40%),
        radial-gradient(circle at 90% 85%, rgba(0, 184, 148, 0.35) 0, transparent 45%),
        linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 55%, var(--blue) 130%);
}

.hero-date {
    width: 96px;
    height: 104px;
    border-radius: 26px;
    background: #FFFFFF;
    color: var(--navy);
    box-shadow: 0 14px 32px rgba(11, 29, 58, 0.35);
}

.hero-date .date-month { font-size: 15px; color: var(--teal-dark); }

.hero-date .date-day { font-size: 44px; }

.rsvp-pill {
    flex: none;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    background: #ECEEF2;
    color: var(--slate);
}

.rsvp-pill.going { background: #D9F5EE; color: var(--teal-dark); }

.rsvp-pill.maybe { background: #FEF3DC; color: #A26A00; }

.rsvp-pill.cant { background: #FDECEA; color: var(--bad); }

.rsvp-pill.waiting { background: #E0EAFD; color: var(--blue); }

.event-facts { display: flex; flex-direction: column; gap: 14px; }

.fact { display: flex; align-items: flex-start; gap: 14px; color: var(--navy); text-decoration: none; }

.fact .row-icon { width: 40px; height: 40px; }

.fact-text { font-size: 15.5px; font-weight: 500; }

.rsvp-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; }

.rsvp-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }

.rsvp-row + .rsvp-row { border-top: 1px solid var(--line); }

.rsvp-row .avatar { width: 38px; height: 38px; font-size: 13px; }

.rsvp-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rsvp-choices { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--fill); }

.rsvp-choice {
    min-width: 54px;
    height: 34px;
    padding: 0 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--slate);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.rsvp-choice.selected.going { background: var(--teal); color: #FFFFFF; }

.rsvp-choice.selected.maybe { background: #F5A524; color: #FFFFFF; }

.rsvp-choice.selected.cant { background: var(--bad); color: #FFFFFF; }

.everyone-going { align-self: center; margin-top: 6px; }

.bring-card { display: flex; flex-direction: column; gap: 14px; }

.bring-input { display: flex; gap: 8px; }

.bring-input input {
    flex: 1;
    min-width: 0;
    min-height: 52px;
    padding: 12px 14px;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: var(--fill);
    color: var(--navy);
    font: inherit;
    font-size: 16px;
}

.bring-input input:focus { outline: none; border-color: var(--blue); background: var(--surface); }

.bring-input .btn { min-height: 52px; gap: 6px; padding: 0 18px; box-shadow: none; }

.bring-input .btn .icon { width: 18px; height: 18px; }

.bring-list li .icon-btn { margin-left: auto; width: 34px; height: 34px; }

.bring-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.bring-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 15.5px; font-weight: 500; }

.bring-list li > .icon { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--teal-dark); }

.bring-family { font-size: 13px; font-weight: 400; color: var(--slate); }

.bring-summary { margin: 0; font-size: 13.5px; color: var(--slate); }

.bring-waiting summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--blue); }

.bring-waiting p { margin: 6px 0 0; font-size: 13.5px; }

.rsvp-tally { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; font-size: 13.5px; color: var(--slate); }

.rsvp-tally i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }

.rsvp-tally strong { color: var(--navy); }

.rsvp-tally .going strong { color: var(--teal-dark); }


.countdown-host { margin-top: 2px; color: rgba(255, 255, 255, 0.85); font-size: 14px; font-weight: 500; }

a.countdown-card { text-decoration: none; }

.rule-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.rule-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 6px 6px 12px;
    border-radius: 999px;
    background: #EAF0FD;
    color: var(--blue);
    font-size: 13.5px;
    font-weight: 600;
}

.rule-chip.exclude { background: #FDECEA; color: var(--bad); }

.rule-chip button { display: inline-flex; border: 0; background: none; color: inherit; padding: 2px; cursor: pointer; }

.rule-chip .icon { width: 14px; height: 14px; }

.add-rule-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.add-rule-buttons .btn { flex: 1 0 auto; min-height: 44px; padding: 0 12px; gap: 6px; font-size: 13.5px; white-space: nowrap; }

.add-rule-buttons .icon { width: 16px; height: 16px; }

.add-rule { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; background: var(--fill); }

.add-rule .field input, .add-rule .field select { background: var(--surface); }

.guest-preview { border-top: 1px solid var(--line); padding-top: 4px; }

.guest-preview summary { display: flex; align-items: center; justify-content: space-between; list-style: none; padding: 10px 0; cursor: pointer; font-size: 15.5px; }

.guest-preview summary::-webkit-details-marker { display: none; }

.guest-preview[open] .summary-chevron { transform: rotate(90deg); }

.guest-preview p { margin: 0 0 6px; font-size: 14px; }

.switch-row.disabled { opacity: 0.55; cursor: default; }

.hero-body > .card.form + .card.form, .hero-body > .card + .form-submit { margin-top: 16px; }

/* ===== Secret Santa ===== */

.money-input { display: flex; align-items: center; gap: 8px; }

.money-input > span { font-size: 18px; font-weight: 600; color: var(--navy); }

.money-input input { flex: 1; min-width: 0; }

.icon-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: var(--fill);
    color: var(--navy);
    cursor: pointer;
}

.icon-btn .icon { width: 18px; height: 18px; }

.icon-btn:active { transform: scale(0.95); }

/* Event page: the guest's way in, and the host's controls. */
.santa-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #0F7A64 0%, var(--teal) 55%, #2BC9A6 100%);
    color: #FFFFFF;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(0, 134, 108, 0.28);
}

.santa-banner .meta { color: rgba(255, 255, 255, 0.85); }

.santa-banner .row-title { font-weight: 600; white-space: normal; }

.santa-banner .row-chevron { color: rgba(255, 255, 255, 0.8); }

.santa-banner-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
}

.santa-banner-icon .icon { width: 26px; height: 26px; }

.santa-host-title { margin: 18px 0 10px; font-size: 15px; font-weight: 600; color: var(--slate); }

.santa-host { display: flex; flex-direction: column; gap: 12px; }

.santa-tally { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: var(--slate); }

.santa-tally strong { color: var(--navy); }

.santa-tally .going strong { color: var(--teal-dark); }

.santa-tally .cant strong { color: var(--bad); }

.santa-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.santa-actions .btn { flex: 1 0 auto; gap: 8px; }

.santa-actions .btn .icon { width: 18px; height: 18px; }

.santa-notice { margin: 0; padding: 10px 14px; border-radius: 12px; background: #D9F5EE; color: var(--teal-dark); font-size: 14px; font-weight: 500; }

.santa-notice.muted-notice { background: var(--fill); color: var(--slate); }

.santa-people { list-style: none; margin: 0; padding: 0; }

.santa-person { display: flex; align-items: center; gap: 10px; padding: 8px 0; }

.santa-person + .santa-person { border-top: 1px solid var(--line); }

.santa-person .avatar { width: 38px; height: 38px; font-size: 13px; }

.santa-person .row-title { font-size: 15px; }

.santa-person .rsvp-choice { min-width: 44px; }

/* The personal link page (no sign-in, no tabs). */
.link-screen { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }

.link-main { flex: 1; }

.link-main .hero { margin-top: 0; padding-top: calc(var(--safe-top) + 36px); }

.link-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px var(--gutter) calc(28px + var(--safe-bottom));
    color: var(--slate);
    font-size: 12.5px;
}

.link-footer img { height: 22px; width: auto; opacity: 0.8; }

.hero-santa {
    background:
        radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.18) 0, transparent 40%),
        radial-gradient(circle at 92% 85%, rgba(37, 99, 235, 0.35) 0, transparent 45%),
        linear-gradient(150deg, #0F7A64 0%, var(--teal) 45%, #14A3A8 100%);
}

.hero-santa .hero-icon { background: rgba(255, 255, 255, 0.18); }

.hero-body > .card + .card, .hero-body > .card + .section, .hero-body > .card + .error { margin-top: 16px; }

.santa-ask p { margin: 0 0 16px; }

.santa-answer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

.answer-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 96px;
    border: 2px solid transparent;
    border-radius: 18px;
    background: var(--fill);
    color: var(--navy);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.answer-btn .icon { width: 28px; height: 28px; }

.answer-btn:active { transform: scale(0.97); }

.answer-btn.in .icon { color: var(--teal); }

.answer-btn.out .icon { color: var(--slate); }

.answer-btn.in.selected { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }

.answer-btn.in.selected .icon { color: #FFFFFF; }

.answer-btn.out.selected { background: #FFFFFF; border-color: var(--slate); }

.santa-recipient { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }

.santa-recipient .eyebrow { color: var(--teal-dark); }

.santa-recipient-name { margin: 0; font-size: 22px; }

.santa-subtitle { align-self: stretch; margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--slate); text-align: left; }

.santa-ideas { align-self: stretch; list-style: none; margin: 0; padding: 0; text-align: left; }

.santa-ideas li { padding: 10px 0; font-size: 15.5px; }

.santa-ideas li + li { border-top: 1px solid var(--line); }

.santa-ideas a { color: var(--blue); font-weight: 500; text-decoration: none; }

.santa-ideas a .icon { width: 14px; height: 14px; vertical-align: -2px; }

.santa-recipient .santa-actions, .santa-recipient .santa-notice { align-self: stretch; margin-top: 8px; }

.santa-pick-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; align-self: stretch; }

.santa-pick {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-radius: 16px;
    background: var(--fill);
    color: var(--navy);
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.santa-pick > span:not(.avatar) { flex: 1; }

.santa-pick .avatar { flex: none; width: 40px; height: 40px; font-size: 14px; }

.santa-pick:active { background: var(--pressed); }




.santa-ideas-card { display: flex; flex-direction: column; gap: 10px; }

.santa-ideas-card p { margin: 0; }

.santa-idea-edit { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

.santa-idea-edit input {
    font: inherit;
    font-size: 16px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    background: var(--fill);
    color: var(--navy);
}

.santa-idea-edit input:focus { outline: none; border-color: var(--blue); background: var(--surface); }

.santa-idea-edit input:nth-child(2) { grid-column: 1; font-size: 14px; min-height: 40px; }

.santa-idea-edit .icon-btn { grid-row: 1; grid-column: 2; align-self: center; }

.santa-swap-ask { border: 2px solid var(--teal); }

.santa-swap-ask p { margin: 0 0 12px; }

.santa-player { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }

.santa-player .row-title { flex: 1; min-width: 0; }

.santa-player .avatar { width: 38px; height: 38px; font-size: 13px; }




.pill .icon { width: 13px; height: 13px; margin-right: 2px; vertical-align: -2px; }

/* Guest list: one bar for the event, one collapsible line per family, a dot per person. */
.tally-bar { display: flex; gap: 3px; height: 10px; margin: 0 0 8px; overflow: hidden; border-radius: 999px; }

.tally-bar span { min-width: 6px; }

.tally-bar .going, .rsvp-tally .going i, .unit-dots .going { background: var(--teal); }

.tally-bar .maybe, .rsvp-tally .maybe i, .unit-dots .maybe { background: #F5A524; }

.tally-bar .cant, .rsvp-tally .cant i, .unit-dots .cant { background: #F0A39C; }

.tally-bar .waiting, .rsvp-tally .waiting i, .unit-dots .waiting { background: #DCE1EA; }

.guest-unit summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; list-style: none; cursor: pointer; }

.guest-unit summary::-webkit-details-marker { display: none; }

.guest-unit .row-title { font-size: 15px; }

.guest-unit .row-chevron { flex: none; transition: transform 0.2s var(--ease-out); }

.guest-unit[open] .row-chevron { transform: rotate(90deg); }

.unit-dots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 76px; }

.unit-dots i { width: 9px; height: 9px; border-radius: 50%; }

.unit-people { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 14px; }

.unit-person { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }

.unit-person .avatar { width: 32px; height: 32px; font-size: 12px; }

/* Relatives who have passed away: small angel wings instead of the word. */
.avatar.deceased { position: relative; }

.avatar-wings {
    position: absolute;
    right: -3px;
    bottom: -3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46%;
    height: 46%;
    min-width: 16px;
    min-height: 16px;
    border-radius: 50%;
    background: var(--surface);
    color: #9AA6B8;
    box-shadow: 0 1px 3px rgba(11, 29, 58, 0.15);
}

.avatar-wings .icon { width: 72%; height: 72%; }

.meta .wings, .wings-chip { display: inline-flex; align-items: center; gap: 4px; }

.meta .wings .icon { width: 16px; height: 16px; color: #9AA6B8; vertical-align: -3px; }

.meta > span + span { margin-left: 6px; }

.wings-chip .icon { width: 16px; height: 16px; }

/* ===== Family news (announcements) ===== */

.announcement-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--navy);
    text-decoration: none;
}

.announcement-card:active { transform: scale(0.985); }

.announcement-card.unseen { box-shadow: 0 0 0 2px var(--teal), var(--shadow-card); }

.announcement-card.important.unseen { box-shadow: 0 0 0 2px #F5A524, var(--shadow-card); }

.announcement-head { display: flex; align-items: center; gap: 12px; }

.announcement-head .avatar { width: 40px; height: 40px; font-size: 14px; }

.announcement-head .row-title { font-size: 15px; }

.unseen-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }

.important .unseen-dot { background: #F5A524; }

.announcement-body { margin: 0; font-size: 15.5px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }

.announcement-body.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.announcement-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }

.reaction-count { font-size: 14px; }

.pinned-news { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.share-news {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--navy);
    text-decoration: none;
}

.announcement-full { display: flex; flex-direction: column; gap: 14px; }

.announcement-full .announcement-body { font-size: 17px; }

.important-pill { background: #FEF3DC; color: #A26A00; }

.reactions { display: flex; flex-wrap: wrap; gap: 8px; }

.reaction {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 12px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    background: var(--fill);
    font: inherit;
    font-size: 17px;
    cursor: pointer;
}

.reaction.mine { border-color: var(--teal); background: #D9F5EE; }

.reaction-number { font-size: 13.5px; font-weight: 600; color: var(--navy); }

.reach-card summary { display: flex; align-items: center; gap: 14px; list-style: none; cursor: pointer; }

.reach-card summary::-webkit-details-marker { display: none; }

.reach-card p { margin: 12px 0 0; font-size: 14px; }

.comments-card { display: flex; flex-direction: column; gap: 14px; }

.comment { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }

.comment .avatar { width: 32px; height: 32px; font-size: 12px; }

.comment .icon-btn { margin-left: auto; width: 32px; height: 32px; }

/* ===== Notifications ===== */

.notifications-card { display: flex; align-items: center; gap: 14px; }

.notifications-card .btn { flex: none; min-height: 40px; padding: 0 16px; box-shadow: none; }

.install-steps { margin: 12px 0 0; padding-left: 22px; color: var(--slate); font-size: 14px; line-height: 1.7; }

.install-steps .icon { width: 15px; height: 15px; vertical-align: -2px; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 12px; text-align: center; }

.empty-state h2 { margin: 6px 0 0; font-size: 20px; }

.empty-state p { margin: 0 0 8px; max-width: 320px; }

.empty-state .btn { gap: 8px; }

.hero-icon.small { width: 72px; height: 72px; background: var(--brand-gradient); color: #FFFFFF; }

.hero-icon.small .icon { width: 34px; height: 34px; }

.reacted-by { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--slate); }

.reacted-emoji { display: inline-block; width: 24px; }

/* ===== Refresh and offline ===== */

/* Rebuilt on refresh; takes no space of its own. */
.page-host { display: contents; }

.ptr {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 50%;
    z-index: 60;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--slate);
    box-shadow: var(--shadow-float);
    opacity: 0;
    transform: translate(-50%, -56px);
    pointer-events: none;
}

.ptr svg { width: 20px; height: 20px; transition: transform 0.2s var(--ease-out); }

.ptr.ready { color: var(--teal-dark); }

.ptr.ready svg { transform: rotate(180deg); }

.ptr.loading svg { animation: ptr-spin 0.8s linear infinite; }

@keyframes ptr-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .ptr.loading svg { animation: none; }
}

.offline-banner {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tab-h) + var(--safe-bottom) + 24px);
    z-index: 55;
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--navy);
    color: #FFFFFF;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-float);
    transform: translateX(-50%);
}

.offline-banner .icon { flex: none; width: 16px; height: 16px; }

.tabs-hidden .offline-banner { bottom: calc(var(--safe-bottom) + 16px); }

@media (min-width: 900px) {
    .offline-banner { bottom: 24px; left: calc(50% + 130px); }
}
