[hidden] {
    display: none !important;
}

.soft-nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--accent, #2b7a78);
    z-index: 9999;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.15s ease;
    pointer-events: none;
}

.gesture-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    max-width: 90vw;
    background: var(--text);
    color: var(--surface);
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.gesture-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.soft-nav-progress.active {
    width: 70%;
    opacity: 1;
    transition: width 4s cubic-bezier(0.1, 0.7, 0.3, 1), opacity 0.15s ease;
}

:root {
    --bg: #f7f5f0;
    --surface: #ffffff;
    --text: #23303a;
    --muted: #6b7a85;
    --border: #e2ddd2;
    --accent: #1d7a8c;
    --accent-dark: #145a68;
    --accent-soft: #dff0f0;
    --danger: #b3413a;
    --radius: 10px;
    font-size: 16px;
}

/* Sunset: warm coral/orange accents over a warm sand background. */
[data-theme="sunset"] {
    --bg: #fbf1e6;
    --accent: #e07a4f;
    --accent-dark: #b8532c;
    --accent-soft: #fbe3d3;
    --border: #ecd9c4;
}

/* Seafoam: cool mint/teal-green, lighter and airier than the ocean default. */
[data-theme="seafoam"] {
    --bg: #f2f7f3;
    --accent: #3a9188;
    --accent-dark: #276b64;
    --accent-soft: #dcefe9;
    --border: #dbe8e1;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    position: relative;
}

/* When a custom background photo is set, keep content legible over it by
   scrimming the page in a translucent version of the current theme's
   background color, rather than showing the photo at full strength behind
   text and form fields. */
.bg-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    opacity: 0.88;
    z-index: 0;
    pointer-events: none;
}

.site-header, .wave-divider, .page, .login-wrap { position: relative; z-index: 1; }

a { color: var(--accent-dark); }

.wave-divider {
    line-height: 0;
    margin-top: -1px;
}

.wave-divider svg {
    width: 100%;
    height: 16px;
    display: block;
}

.wave-divider path { fill: var(--accent-soft); }

.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 5.5rem;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
    font-size: 1.1rem;
}

.nav-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

.main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}

.main-nav.open { display: flex; }

.main-nav a {
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text);
}

.main-nav a:hover { background: var(--bg); }

@media (min-width: 640px) {
    .nav-toggle { display: none; }
    .main-nav {
        display: flex;
        flex-direction: row;
        position: static;
        border: none;
        padding: 0;
        gap: 0.25rem;
    }
    .main-nav a { padding: 0.5rem 0.75rem; }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

h1, h2, h3 { line-height: 1.25; }

.field-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.field-row:last-child { border-bottom: none; }

.payment-due-entry {
    padding: 0.6rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, black 10%);
}

.payment-due-entry:last-child { border-bottom: none; }

.contact-entry {
    padding: 0.6rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, black 10%);
}

.contact-entry:last-child { border-bottom: none; }

.field-label {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.field-value {
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

form.stacked label {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0.75rem 0 0.25rem;
}

input[type=text], input[type=email], input[type=password], textarea, select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
}

textarea { resize: vertical; min-height: 4rem; }

button, .btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    margin-top: 0.75rem;
}

button:hover, .btn:hover { background: var(--accent-dark); }
.btn.secondary.active { background: var(--accent); color: #fff; }

button.secondary, .btn.secondary {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--accent-dark);
}

button.danger { background: var(--danger); }

.flash {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.flash-success { background: #dff3e3; color: #1e5e2f; }
.flash-error { background: #fbe2e0; color: #8a2c24; }

.note {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.note:last-child { border-bottom: none; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--border);
}

.note-body-wrap { flex: 1; min-width: 0; }

.note-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.15rem;
}

.note-text { white-space: pre-wrap; word-break: break-word; }

.list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.list-item:last-child { border-bottom: none; }

.list-item.done .item-label {
    text-decoration: line-through;
    color: var(--muted);
}

.item-label { flex: 1; }

.item-meta { font-size: 0.75rem; color: var(--muted); }

.role-badge {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
}

.login-wrap {
    max-width: 380px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.muted { color: var(--muted); }
.text-right { text-align: right; }

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.admin-table th, table.admin-table td {
    text-align: left;
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 480px) {
    table.admin-table thead { display: none; }
    table.admin-table, table.admin-table tbody, table.admin-table tr, table.admin-table td {
        display: block;
        width: 100%;
    }
    table.admin-table tr {
        border-bottom: 2px solid var(--border);
        padding: 0.5rem 0;
    }
    table.admin-table td {
        border-bottom: none;
        padding: 0.2rem 0;
    }
    table.admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        min-width: 100px;
        color: var(--muted);
    }
}

.mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    z-index: 20;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.mini-player-info {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    min-width: 0;
}

.mini-player-label { color: var(--muted); }
.mini-player-title { font-weight: 600; }

.mini-player audio {
    flex: 1;
    min-width: 180px;
    height: 32px;
}

.song-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.song-row:last-child { border-bottom: none; }
.song-row.current { background: rgba(29,122,140,0.06); border-radius: 8px; padding: 0.75rem; }

.song-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 200px;
}

.song-info audio { width: 100%; height: 34px; }

.song-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.song-actions form button { margin: 0; }

.itin-date {
    margin: 1.25rem 0 0.5rem;
    color: var(--accent-dark);
}

.itin-date:first-of-type { margin-top: 0; }

.itin-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.itin-item:last-child { border-bottom: none; }

.itin-time {
    width: 4.5rem;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--muted);
    padding-top: 0.1rem;
}

.itin-body { flex: 1; min-width: 0; }
.itin-title { font-weight: 600; margin-bottom: 0.2rem; }

.itin-link {
    display: block;
    font-size: 0.9rem;
    text-decoration: none;
    margin-top: 0.15rem;
}

.itin-link:hover { text-decoration: underline; }

.itin-notes {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.3rem;
    white-space: pre-wrap;
}

.section-heading {
    margin: 0 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-dark);
}

.autocomplete-wrap { position: relative; }

/* address-autocomplete.js wraps the <input> in this div the first time it's
   focused, so it's no longer a direct flex child of .input-icon/field-pair
   containers — without this, the wrapper (unstyled) shrinks to the
   input's default intrinsic size instead of filling the space the input
   had a moment before, which looked like the field suddenly shrinking. */
.input-icon .autocomplete-wrap {
    flex: 1;
    min-width: 0;
}

.autocomplete-wrap input {
    width: 100%;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 30;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.autocomplete-list div {
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.autocomplete-list div:hover,
.autocomplete-list div.active {
    background: var(--bg);
}

.role-help summary {
    cursor: pointer;
    color: var(--accent-dark);
    font-weight: 600;
    display: inline-block;
    margin: 0.25rem 0 0.75rem;
    list-style: none;
}

.role-help summary::-webkit-details-marker { display: none; }
.role-help summary::before { content: "❓ "; }

.role-help-body {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.role-help-body dt { font-weight: 700; margin-top: 0.5rem; }
.role-help-body dt:first-child { margin-top: 0; }
.role-help-body dd { margin: 0.1rem 0 0; color: var(--muted); }

.field-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
}

.field-half {
    flex: 1 1 200px;
    min-width: 180px;
}

.field-icon {
    margin-right: 0.4rem;
    display: inline-block;
}

/* In a side-by-side pair, the second field's icon is redundant — it only
   reappears once field-pairs.js detects the pair has wrapped to its own row. */
.field-pair .field-half:nth-child(2) .second-icon {
    display: none;
}

.field-pair.wrapped .field-half:nth-child(2) .second-icon {
    display: inline-block;
}

.input-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-icon-btn {
    flex-shrink: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
    margin-top: 0;
    padding: 0;
    color: var(--text);
}

.nav-icon-btn:hover { background: var(--border); }

.field-row .nav-icon-btn {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
    vertical-align: middle;
    margin-left: 0.3rem;
}

/* Standardized "Add to Contacts" icon placement, immediately right of a
   location entity's title, wherever that title lives outside a .field-row. */
.itin-title .nav-icon-btn {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.9rem;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.picker-icon {
    cursor: pointer;
    user-select: none;
}

.copy-btn { font-size: 1rem; }

.copy-toast {
    position: fixed;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--text);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 40;
    pointer-events: none;
}

.copy-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.import-warning {
    background: #fbe2e0;
    color: #6b1f18;
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.import-warning ul {
    margin: 0.5rem 0 0.25rem;
    padding-left: 1.25rem;
}

.import-warning li { margin-bottom: 0.3rem; }

.house-header { text-align: center; }

.house-photo-frame {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0 auto;
}

.house-photo {
    max-width: 100%;
    max-height: 320px;
    border-radius: var(--radius);
    display: block;
    cursor: pointer;
}

.photo-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.4rem;
}

.photo-controls form { margin: 0; }

.photo-control-btn {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.photo-control-btn:hover { background: rgba(0,0,0,0.75); }

.photo-upload-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.photo-upload-icon { font-size: 2rem; }

.photo-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.photo-modal.open { display: flex; }

.photo-modal img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.photo-modal-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay[hidden] { display: none; }

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 24rem;
    width: 100%;
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--muted);
}

.avatar-card-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.switch-entry-form {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.switch-entry-form select { width: auto; flex: 1; min-width: 160px; }
.switch-entry-form button { margin-top: 0; }

.poi-tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.poi-tag-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text);
    margin: 0;
}

.poi-tag-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.icon-picker-btn {
    flex-shrink: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 2.4rem;
    font-size: 1.1rem;
    cursor: pointer;
}

.icon-picker-panel {
    position: absolute;
    z-index: 20;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 18rem;
    max-height: 16rem;
    overflow-y: auto;
}

.icon-picker-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.6;
    margin: 0.4rem 0 0.15rem;
}

.icon-picker-category:first-child {
    margin-top: 0;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1.8rem);
    gap: 0.2rem;
}

.icon-picker-emoji {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    padding: 0.15rem;
    line-height: 1.4;
}

.icon-picker-emoji:hover {
    background: var(--border);
}

.poi-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.poi-card:last-child { border-bottom: none; }

.poi-info { flex: 1; min-width: 0; }

.poi-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.3rem 0;
}

.house-name {
    margin: 0 0 1rem;
}

.edit-toggle {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.edit-toggle summary {
    cursor: pointer;
    color: var(--accent-dark);
    font-weight: 600;
    list-style: none;
    display: inline-block;
}

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

.edit-toggle-body {
    margin-top: 0.75rem;
}

.house-edit-toggle {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.house-edit-toggle .floating-edit-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.house-edit-toggle .floating-edit-btn:hover { background: var(--border); }

/* Deliberately stays position:absolute even when open, so the button
   never jumps to a different spot — it just tracks the (now taller)
   card's corner, letting the user click the same spot again to close. */

.item-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.2rem 0.4rem;
    margin: 0;
    color: var(--muted);
}

.item-edit-btn:hover { color: var(--accent-dark); }

.item-actions {
    display: flex;
    gap: 0.25rem;
    align-items: flex-start;
}

.inline-edit-form {
    display: none;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border);
    width: 100%;
    flex-basis: 100%;
}

.inline-edit-form.open { display: block; }

.payment-amount {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    border: 2px solid;
    font-weight: 700;
}

.payment-amount.unpaid {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(179,65,58,0.08);
}

.payment-amount.paid {
    border-color: #2f9e44;
    color: #2f9e44;
    background: rgba(47,158,68,0.08);
}

.default-highlight {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.card-collapsible > summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

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

.card-collapsible > summary::after {
    content: "▾";
    float: right;
    color: var(--muted);
    transition: transform 0.15s ease;
}

.card-collapsible[open] > summary::after {
    transform: rotate(180deg);
}

.card-collapsible-body {
    margin-top: 0.5rem;
}

.section-sort-toolbar {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.drag-handle {
    cursor: grab;
    color: var(--muted);
    margin-right: 0.5rem;
    touch-action: none;
    user-select: none;
}

.sortable-sections > [data-sort-id].dragging {
    opacity: 0.5;
}

.sortable-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns, 2), 1fr);
    gap: 1rem;
}

.sortable-grid .drag-handle {
    display: block;
    margin-bottom: 0.3rem;
}

@media (max-width: 640px) {
    .sortable-grid { grid-template-columns: 1fr; }
}

.member-status { font-weight: 600; }
.member-status.status-active { color: #2e7d32; }
.member-status.status-invited { color: #b8722c; }

.member-action-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.admin-tool-tile { border-left-width: 8px; }
.admin-tool-tile.tile-orange { border-left-color: #d99a5b; }
.admin-tool-tile.tile-yellow { border-left-color: #cbb454; }
.admin-tool-tile.tile-blue { border-left-color: #6f9bb8; }
.admin-tool-tile.tile-purple { border-left-color: #a488b8; }
.admin-tool-tile.tile-green { border-left-color: #7fab7f; }

.weather-strip {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.weather-day {
    text-align: center;
    flex: 1;
    min-width: 3.5rem;
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.2rem;
}

a.weather-day:hover {
    background: var(--border);
}

.weather-date {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
}

.weather-icon { font-size: 1.6rem; margin: 0.2rem 0; }
.weather-temps { font-size: 0.85rem; }

.avatar-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
}

.avatar-cloud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    animation-name: avatar-float;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.avatar-cloud-item .avatar {
    width: 4rem;
    height: 4rem;
}

.avatar-cloud-name {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

@keyframes avatar-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
    .avatar-cloud-item { animation: none; }
}

.countdown-banner {
    background: var(--accent);
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    white-space: pre-wrap;
    position: relative;
}

.countdown-banner-party {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    font-size: 1.5rem;
}

.countdown-banner-text {
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

.fireworks-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.firework-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    left: var(--fx, 50%);
    top: var(--fy, 50%);
    background: var(--fcolor, #fff);
    animation: firework-burst var(--fdur, 1.1s) ease-out forwards;
    box-shadow: 0 0 6px 1px var(--fcolor, #fff);
}

@keyframes firework-burst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--fdx, 0), var(--fdy, 0)) scale(0.3);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .firework-particle { animation: none; opacity: 0; }
}

.inline-label-edit {
    display: inline-block;
    width: auto;
    max-width: 8rem;
    border: none;
    border-bottom: 1px dashed var(--border);
    background: transparent;
    padding: 0 0.15rem;
    font: inherit;
    font-weight: 600;
    color: inherit;
}

.inline-label-edit:focus { border-bottom-color: var(--accent); outline: none; }

.impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #3d2a5c;
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.impersonation-banner .secondary {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
}

.dial-confirm-label {
    font-weight: 600;
    font-size: 1.05rem;
}

.dial-confirm-slider {
    width: 100%;
    margin-top: 1rem;
    accent-color: var(--danger, #c0392b);
    height: 2.25rem;
}

.emergency-contact-row {
    padding: 0.9rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.emergency-contact-row:last-of-type { border-bottom: none; margin-bottom: 0; }

.ec-line1 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    flex-wrap: wrap;
}

.ec-line2 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 0.3rem;
}

.ec-col-phone { min-width: 11rem; }
.ec-col-website { min-width: 8rem; }

.ec-line3 {
    margin-top: 0.3rem;
    font-size: 0.85rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 1rem;
}

.gallery-tile {
    text-align: center;
}

.gallery-tile img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.gallery-caption {
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.gallery-meta {
    font-size: 0.75rem;
}

.gallery-reactions {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.reaction-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.6;
}

.reaction-btn.active {
    opacity: 1;
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

.gallery-tile[data-is-my-fave="0"].fave-filter-hidden {
    display: none;
}

.gallery-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 6;
    overflow: hidden;
    border-radius: var(--radius);
}

.gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.gallery-slide.active {
    opacity: 1;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-slide-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

#favoriters-list .favoriter-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.checkbox-select-all-toolbar {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent, #0a6);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}

details.card-collapsible {
    position: relative;
}

.expand-collapse-all-btn {
    position: absolute;
    top: 0.6rem;
    right: 3.2rem;
    margin: 0;
    z-index: 2;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

#back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 500;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    cursor: pointer;
}
