:root {
    color-scheme: dark;
    --bg-deep: #090b12;
    --bg-surface: #0f1526;
    --bg-surface-2: #161f35;
    --bg-elev: #202b46;
    --glass-surface: rgba(18, 25, 44, 0.92);
    --glass-border: rgba(141, 170, 255, 0.28);
    --glass-highlight: rgba(255, 255, 255, 0.08);
    --text-main: #edf2ff;
    --text-muted: #adbadf;
    --accent: #7c9cff;
    --accent-2: #63d2ff;
    --accent-gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
    --accent-glow: rgba(124, 156, 255, 0.38);
    --accent-contrast: #060914;
    --success: #41d38a;
    --danger: #ff6f7a;
    --warning: #ffbf5c;
    --purple: #b288ff;
    --border-show: #b288ff;
    --border-holiday: #ff9f5f;
    --border-special: #ffd166;
    --secondary: #2c3558;
    --secondary-hover: #394774;
    --radius-sm: 10px;
    --radius: 16px;
    --card-gap: 14px;
    --dur-fast: 0.16s;
    --dur-mid: 0.28s;
    --dur-slow: 0.42s;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-bouncy: cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-1: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 16px 40px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #131b33 0%, var(--bg-deep) 54%);
    color: var(--text-main);
}

button,
input,
select,
textarea {
    font-family: inherit;
}

h1, h2, h3, h4 {
    margin: 0;
}

p {
    color: var(--text-muted);
}

a {
    color: var(--accent-2);
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 10px 14px 12px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(7, 10, 19, 0.84);
    border-bottom: 1px solid rgba(124, 156, 255, 0.16);
}

.top-bar {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 8px;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(20, 27, 47, 0.92), rgba(14, 18, 31, 0.95));
    box-shadow: var(--shadow-1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.app-version {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(124, 156, 255, 0.4);
    background: rgba(124, 156, 255, 0.14);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
}

.update-splash {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12000;
    background: rgba(2, 4, 10, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.update-splash.hidden,
.update-notification-dialog.hidden {
    display: none;
}

.update-splash-content {
    width: min(92vw, 360px);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(20, 27, 47, 0.98), rgba(12, 16, 28, 0.98));
    color: var(--text-main);
    box-shadow: var(--shadow-2);
    padding: 22px 18px;
    text-align: center;
}

.loader-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(124, 156, 255, 0.28);
    border-top-color: var(--accent-2);
    margin: 0 auto 10px;
    animation: modalSpin 1s linear infinite;
}

@keyframes modalSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.update-notification-dialog {
    position: fixed;
    inset: 0;
    z-index: 12001;
    background: rgba(2, 4, 10, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.update-notification-dialog .update-notification-content {
    width: min(92vw, 520px);
    max-height: 84vh;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(20, 27, 47, 0.98), rgba(12, 16, 28, 0.98));
    color: var(--text-main);
    box-shadow: var(--shadow-2);
}

.update-notification-header,
.update-notification-body,
.update-notification-footer {
    padding: 16px 18px;
}

.update-notification-header {
    border-bottom: 1px solid rgba(141, 170, 255, 0.2);
    text-align: center;
}

.update-notification-header h2 {
    margin: 0 0 6px;
    font-size: 2rem;
    line-height: 1.08;
}

.update-notification-header p {
    margin: 0;
    color: var(--text-muted);
}

.update-notification-body {
    border-bottom: 1px solid rgba(141, 170, 255, 0.2);
}

.update-notification-body h3 {
    margin: 0 0 10px;
    color: var(--accent-2);
}

.update-features {
    display: grid;
    gap: 10px;
}

.feature-version-group h4 {
    margin: 0 0 6px;
    color: var(--accent-2);
}

.feature-bullet-list {
    margin: 0;
    padding-left: 18px;
}

.release-log-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 0;
}

.update-notification-footer {
    display: grid;
    gap: 12px;
}

.update-notification-footer .btn,
.update-notification-footer .btn-primary {
    width: 100%;
}

.tab-navigation {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: rgba(16, 21, 36, 0.92);
    box-shadow: var(--shadow-1);
}

.tab {
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
    padding: 12px 10px;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    user-select: none;
}

.tab:hover {
    color: var(--text-main);
    background: rgba(124, 156, 255, 0.12);
}

.tab.active {
    color: var(--accent-2);
    border-color: rgba(124, 156, 255, 0.56);
    background: rgba(124, 156, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(124, 156, 255, 0.28), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 12px;
    padding-right: 12px;
}

.pwa-install-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-top: 10px;
    margin-bottom: 8px;
}

.pwa-install-copy h4 {
    margin: 0 0 3px;
    font-size: 1rem;
}

.pwa-install-copy p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.25;
}

#pwaInstallBtn {
    white-space: nowrap;
}

.admin-controls-row {
    display: none;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 12px auto 8px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(16, 21, 36, 0.92);
}

.admin-controls-row.active {
    display: flex;
}

.admin-controls-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

#content-container {
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(16, 21, 36, 0.92);
    box-shadow: var(--shadow-1);
}

#content-slider {
    display: flex;
    width: 400%;
    transition: transform var(--dur-mid) var(--ease-out);
}

.content-panel,
#agendaContent {
    width: calc(100% / 4);
    flex-shrink: 0;
    padding: 10px 10px 16px;
    display: block !important;
}

.glass-panel {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}

.btn,
.btn-base {
    border: 1px solid rgba(124, 156, 255, 0.45);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(124, 156, 255, 0.32), rgba(92, 116, 192, 0.34));
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 700;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
}

.btn:hover,
.btn-base:hover {
    filter: brightness(1.1);
}

.btn.secondary,
.btn-base.secondary {
    background: rgba(68, 83, 127, 0.4);
    border-color: rgba(139, 166, 255, 0.3);
}

.btn.danger,
.btn-base.danger {
    background: rgba(255, 111, 122, 0.2);
    border-color: rgba(255, 111, 122, 0.46);
    color: #ffdce0;
}

.btn.success,
.btn-base.success {
    background: rgba(65, 211, 138, 0.2);
    border-color: rgba(65, 211, 138, 0.44);
    color: #d9ffe9;
}

.btn.warning,
.btn-base.warning {
    background: rgba(255, 191, 92, 0.2);
    border-color: rgba(255, 191, 92, 0.44);
    color: #fff4d8;
}

.btn-icon-admin,
.action-btn,
.grocery-action-btn,
.btn-icon-mini,
.floating-btn-agenda,
.btn-ctl {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(139, 166, 255, 0.32);
    background: rgba(68, 83, 127, 0.35);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
}

.btn-icon-admin:hover,
.action-btn:hover,
.grocery-action-btn:hover,
.btn-icon-mini:hover,
.floating-btn-agenda:hover,
.btn-ctl:hover {
    background: rgba(124, 156, 255, 0.24);
    border-color: rgba(124, 156, 255, 0.56);
}

.btn-icon-admin.accent,
.action-btn.pay-button-public,
.action-btn.audio-play.is-playing,
.btn-ctl.active {
    background: rgba(124, 156, 255, 0.34);
    border-color: rgba(124, 156, 255, 0.66);
}

.action-btn.admin-delete-btn,
.grocery-action-btn.danger,
.action-btn[data-action="delete"] {
    border-color: rgba(255, 111, 122, 0.5);
    background: rgba(255, 111, 122, 0.2);
    color: #ffdce0;
}

.action-btn.admin-pay-btn,
.grocery-action-btn.success,
.action-btn.audio-share-whatsapp {
    border-color: rgba(65, 211, 138, 0.5);
    background: rgba(65, 211, 138, 0.2);
    color: #d9ffe9;
}

.action-btn.audio-download,
.action-btn.admin-history-btn,
.action-btn.history-btn {
    border-color: rgba(99, 210, 255, 0.5);
    background: rgba(99, 210, 255, 0.2);
    color: #ddf7ff;
}

.modal-input-base,
textarea.modal-input-base,
select.modal-input-base {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgba(139, 166, 255, 0.36);
    background: rgba(13, 18, 31, 0.95);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
    margin-bottom: 12px;
}

.modal-input-base:focus {
    border-color: rgba(124, 156, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.18);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 4, 10, 0.74);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow-y: auto;
}

.modal-overlay.scrollable {
    align-items: flex-start;
    padding-top: 56px;
    padding-bottom: 56px;
}

#iconPickerModal {
    z-index: 10001;
}

#iconGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
}

.icon-category-header {
    grid-column: 1 / -1;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    margin: 10px 0 2px;
}

.icon-grid-item {
    height: 56px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.icon-grid-item:hover {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.18);
    transform: translateY(-1px);
}

#customConfirmModal {
    z-index: 10002;
}

#updateNotificationPopup.modal-overlay {
    z-index: 10000;
}

#updateNotificationPopup .popup-content {
    margin: 0 auto;
}

.update-progress-container {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-progress-bar-bg {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
}

.update-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.update-percentage {
    min-width: 42px;
    text-align: right;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
}

.update-loader-container {
    position: relative;
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 10px auto;
}

.update-loader-container svg {
    width: 100%;
    height: 100%;
}

.update-note {
    position: absolute;
    font-size: 22px;
    color: #fbbf24;
    opacity: 0;
    user-select: none;
    pointer-events: none;
}

.update-note-1 { animation: float-note 2s infinite ease-out; top: 20%; left: 30%; }
.update-note-2 { animation: float-note 2.3s infinite 0.5s ease-out; top: 15%; right: 30%; }
.update-note-3 { animation: float-note 1.8s infinite 1.2s ease-out; top: 25%; left: 45%; }

@keyframes float-note {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(20deg); opacity: 0; }
}

.kick-drum { transform-origin: bottom center; animation: kick 0.6s infinite ease-in-out; }
@keyframes kick {
    0%, 100% { transform: scale(1); }
    10% { transform: scale(1.05, 0.95); }
}

.snare-drum { transform-origin: center; animation: snare-hit 0.6s infinite 0.3s ease-out; }
@keyframes snare-hit {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(0, 2px); }
    20% { transform: translate(0, -1px); }
}

.stick-left { transform-origin: 80px 140px; animation: stick-left-swing 0.6s infinite ease-in; }
@keyframes stick-left-swing {
    0%, 100% { transform: rotate(-20deg); }
    50% { transform: rotate(15deg); }
}

.stick-right { transform-origin: 220px 140px; animation: stick-right-swing 0.6s infinite 0.3s ease-in; }
@keyframes stick-right-swing {
    0%, 100% { transform: rotate(20deg); }
    50% { transform: rotate(-15deg); }
}

.hi-hat-top { transform-origin: center; animation: hi-hat-clash 0.6s infinite 0.1s ease-in-out; }
@keyframes hi-hat-clash {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.popup-content {
    width: min(92vw, 560px);
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(20, 27, 47, 0.98), rgba(12, 16, 28, 0.98));
    color: var(--text-main);
    box-shadow: var(--shadow-2);
    padding: 18px;
    position: relative;
}

.modal-overlay:not(#adminMessageModal):not(#cancelMessageModal) .popup-content > h2,
.modal-overlay:not(#adminMessageModal):not(#cancelMessageModal) .popup-content > h3 {
    margin: 0 0 12px !important;
    text-align: center !important;
}

.modal-overlay:not(#adminMessageModal):not(#cancelMessageModal) .popup-content > h2 i,
.modal-overlay:not(#adminMessageModal):not(#cancelMessageModal) .popup-content > h3 i {
    display: none !important;
}

.admin-balance-popup {
    width: min(92vw, 540px);
}

.admin-balance-title {
    margin: 0 0 4px;
}

.admin-balance-subtitle {
    margin: 0 0 14px;
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.admin-balance-fields {
    display: grid;
    gap: 12px;
}

.admin-balance-field {
    border: 1px solid rgba(124, 156, 255, 0.2);
    border-radius: 12px;
    background: rgba(12, 17, 31, 0.65);
    padding: 12px;
}

.admin-balance-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.admin-balance-money {
    position: relative;
}

.admin-balance-hint {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 8px 0 0;
}

.admin-balance-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.admin-payment-popup {
    width: min(92vw, 540px);
}

.admin-payment-title {
    margin: 0 0 4px;
}

.admin-payment-name {
    margin: 0 0 14px;
    color: var(--accent);
    font-weight: 600;
    font-size: 1.2rem;
}

.admin-payment-fields {
    display: grid;
    gap: 12px;
}

.admin-payment-field {
    border: 1px solid rgba(124, 156, 255, 0.2);
    border-radius: 12px;
    background: rgba(12, 17, 31, 0.65);
    padding: 12px;
}

.admin-payment-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.admin-payment-money {
    position: relative;
}

.admin-payment-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.close-modal-btn {
    appearance: none;
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid rgba(139, 166, 255, 0.34);
    background: rgba(68, 83, 127, 0.35);
    color: var(--text-main);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
}

.accordion {
    display: grid;
    gap: 8px;
}

.acc-section {
    border: 1px solid rgba(139, 166, 255, 0.24);
    border-radius: 10px;
    background: rgba(13, 18, 31, 0.7);
    overflow: hidden;
}

.acc-header {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.acc-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 12px;
    transition: max-height var(--dur-mid) var(--ease-out);
}

.acc-section.open .acc-content {
    max-height: 75vh;
    padding: 10px 12px 12px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.note-toggle-main {
    margin: 8px 0 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(124, 156, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

.note-settings-panel {
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(124, 156, 255, 0.18);
    background: rgba(255, 255, 255, 0.02);
}

.note-settings-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.new-event-step-title {
    margin: 0;
}

.new-event-panel {
    border: 1px solid rgba(124, 156, 255, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    margin: 10px 0;
}

.new-event-step .modal-input-base {
    margin-bottom: 10px;
}

.new-event-panel .modal-input-base:last-child {
    margin-bottom: 0;
}

.new-event-actions {
    margin-top: 10px;
}

.new-event-note-settings {
    margin-top: 14px;
}

.new-event-agenda-panel {
    margin-top: 12px;
}

.wizard-option {
    width: 100%;
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(139, 166, 255, 0.44);
    background: rgba(70, 88, 139, 0.28);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.wizard-option i {
    font-size: 1.25rem !important;
    line-height: 1;
}

.wizard-option:hover {
    border-color: rgba(124, 156, 255, 0.72);
    background: rgba(84, 104, 162, 0.38);
    transform: translateY(-1px);
}

.wizard-option:active {
    transform: translateY(0);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    border-radius: 999px;
    background: rgba(99, 110, 150, 0.7);
    transition: .2s;
}

.slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #dfe8ff;
    transition: .2s;
}

.switch input:checked + .slider {
    background: rgba(124, 156, 255, 0.9);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

.user-info-bar {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(99, 210, 255, 0.3);
    background: rgba(16, 31, 44, 0.78);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.filter-status-bar {
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid rgba(124, 156, 255, 0.25);
    background: rgba(13, 18, 31, 0.75);
    padding: 8px 10px;
    opacity: 0;
    transform: translateY(-6px);
    transition: all var(--dur-mid) var(--ease-out);
}

.filter-status-bar.show {
    opacity: 1;
    transform: translateY(0);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    border: 1px solid rgba(124, 156, 255, 0.38);
    background: rgba(124, 156, 255, 0.18);
    color: var(--text-main);
}

.filter-dropdown-container {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    z-index: 115;
}

.filter-dropdown-btn {
    border-radius: 999px;
    border: 1px solid rgba(124, 156, 255, 0.42);
    background: rgba(17, 24, 42, 0.98);
    color: var(--accent-2);
    padding: 11px 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-dropdown-btn.open i { transform: rotate(180deg); }
.filter-dropdown-btn.is-back-button { border-color: rgba(255,111,122,.56); color: #ffdce0; }

.filter-dropdown-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    bottom: 58px;
    opacity: 0;
    pointer-events: none;
    transition: all var(--dur-mid) var(--ease-out);
}

.filter-dropdown-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.filter-menu-items {
    display: grid;
    gap: 6px;
}

.filter-menu-item {
    border-radius: 999px;
    border: 1px solid rgba(124, 156, 255, 0.35);
    background: rgba(20, 27, 47, 0.95);
    color: var(--text-main);
    padding: 10px 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.gooey-blob { display: none; }

#agendaContent {
    perspective: 1200px;
}

.flip-agenda-container,
.flip-bar-container {
    position: relative;
    width: 100%;
    min-height: 420px;
    overflow: hidden;
}

.agenda-front,
.agenda-back,
.bar-front,
.bar-back {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out);
    transform: translateY(8px) scale(.99);
}

.flip-agenda-container.show-front .agenda-front,
.flip-agenda-container.show-back .agenda-back,
.flip-bar-container.show-front .bar-front,
.flip-bar-container.show-back .bar-back {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.flip-agenda-container:not(.show-back) .agenda-front,
.flip-bar-container:not(.show-back) .bar-front {
    position: relative;
    inset: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.agenda-back,
.bar-back {
    border: 1px solid rgba(139, 166, 255, 0.24);
    border-radius: 12px;
    background: rgba(13, 18, 31, 0.86);
    padding: 12px;
    overflow-y: auto;
}

#eventsList,
#rowContainer,
#audioListContainer,
#groceriesList {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--card-gap);
    padding: 8px 8px 96px;
}

#rowContainer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 1060px) {
    #eventsList,
    #audioListContainer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #rowContainer {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    #audioListContainer .audio-group {
        grid-column: 1 / -1;
    }
}

.event,
.person-row,
.audio-row,
.grocery-list-item {
    border-radius: 14px;
    border: 1px solid rgba(139, 166, 255, 0.22);
    background: linear-gradient(180deg, rgba(19, 27, 47, 0.95), rgba(12, 17, 31, 0.96));
    box-shadow: var(--shadow-1);
}

.grocery-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
}

.grocery-list-item .grocery-info {
    min-width: 0;
}

.grocery-list-item .actions {
    flex-shrink: 0;
    display: inline-flex;
}

.event {
    position: relative;
    padding: 10px 16px;
    overflow: hidden;
    border: 2px solid transparent;
    --event-border-color: rgba(141, 170, 255, 0.42);
}

.event::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: var(--event-border-color);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.event.regular { --event-border-color: var(--success); }
.event.extra { --event-border-color: var(--warning); }
.event.show { --event-border-color: var(--border-show); }
.event.cancelled { --event-border-color: var(--danger); }
.event.holiday { --event-border-color: var(--border-holiday); }
.event.special { --event-border-color: var(--border-special); }
.event.birthday {
    --event-border-color: conic-gradient(from 0deg, #ff58a5, #ffa85b, #7be7ff, #b288ff, #ff58a5);
}

.event.compact { min-height: 118px; }
.event.holiday.compact,
.event.special.compact,
.event.birthday.compact {
    min-height: auto;
}
.event.absent { border-color: rgba(255,111,122,.58); }
.event.attending { border-color: rgba(65,211,138,.58); }
.event.availability-yes { box-shadow: 0 0 0 1px rgba(65,211,138,.34), var(--shadow-1); }
.event.availability-no { box-shadow: 0 0 0 1px rgba(255,111,122,.34), var(--shadow-1); }

.event.user-attendance {
    --event-border-color: rgba(124, 156, 255, 0.42);
}

.event.user-attendance.availability-yes {
    --event-border-color: var(--success);
    box-shadow: var(--shadow-1);
}

.event.user-attendance.availability-no {
    --event-border-color: var(--danger);
    box-shadow: var(--shadow-1);
}

.event-flipper { width: 100%; }
.event-front { width: 100%; }
.event-back { display: none; }

.agenda-month-header {
    grid-column: 1 / -1;
    margin: 6px 2px 4px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(124, 156, 255, 0.24);
    background: rgba(10, 20, 40, 0.45);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.agenda-month-header:hover {
    border-color: rgba(124, 156, 255, 0.42);
    background: rgba(14, 28, 52, 0.55);
}

.agenda-month-header i {
    font-size: 0.8rem;
    opacity: 0.85;
}

.agenda-month-header.collapsed {
    opacity: 0.95;
}

.month-collapsed-item {
    display: none !important;
}

.event-body {
    position: relative;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
        "header date"
        "meta meta"
        "actions actions"
        "agenda agenda";
    gap: 8px;
    column-gap: 6px;
    align-items: start;
}

.date-box {
    grid-area: date;
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 0;
    width: fit-content;
    align-self: flex-start;
    justify-self: end;
    background: transparent;
    border: none;
    min-height: auto;
    min-width: 74px;
}

.date-box-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.date-content {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
}

.date-day {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: .88;
    letter-spacing: -.03em;
}

.date-month {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--accent-2);
    font-weight: 800;
}

.date-badges {
    margin-top: 2px;
    display: grid;
    gap: 4px;
    width: 100%;
    justify-items: stretch;
}

.event-title {
    font-size: 1.16rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 10px;
}

.info-column {
    grid-area: header;
    min-width: 0;
}

.meta-section {
    grid-area: meta;
    display: grid;
    gap: 6px;
}

.meta {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 9px;
    font-size: .93rem;
    color: var(--text-muted);
    line-height: 1.36;
}

.meta-section .meta + .meta {
    margin-top: 2px;
    padding-top: 7px;
    border-top: 1px solid rgba(124, 156, 255, 0.16);
}

.meta.note { color: #c8d4ff; }
.meta.meta-no-icon { grid-template-columns: 1fr; }
.meta .meta-text { min-width: 0; overflow-wrap: anywhere; }

.actions-column,
.agenda-row {
    grid-column: 1 / -1;
    margin-top: 12px;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
}

.actions-column {
    grid-area: actions;
}

.agenda-row {
    grid-area: agenda;
}

.actions-column button,
.agenda-row button {
    flex: 1;
    min-height: 36px;
    justify-content: center;
}

.event-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.badge.regular { color: var(--success); border-color: var(--success); background: rgba(65,211,138,.12); }
.badge.extra { color: var(--warning); border-color: var(--warning); background: rgba(255,191,92,.12); }
.badge.show { color: var(--border-show); border-color: var(--border-show); background: rgba(178,136,255,.14); }
.badge.cancelled { color: var(--danger); border-color: var(--danger); background: rgba(255,111,122,.12); }
.badge.holiday { color: var(--border-holiday); border-color: var(--border-holiday); background: rgba(255,159,95,.12); }
.badge.special { color: var(--border-special); border-color: var(--border-special); background: rgba(255,209,102,.12); }
.badge.birthday { color: #ff66b7; border-color: #ff66b7; background: rgba(255,102,183,.12); }

.btn-compact,
.btn-availability,
.btn-songs,
.btn-notes {
    border: 1px solid rgba(139, 166, 255, 0.44);
    background: rgba(70, 88, 139, 0.34);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 11px;
    font-size: .88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: clamp(0.76rem, 1.75vw, 0.88rem);
    min-width: 0;
}

.btn-compact:hover,
.btn-availability:hover,
.btn-songs:hover,
.btn-notes:hover {
    border-color: rgba(124, 156, 255, 0.72);
    background: rgba(84, 104, 162, 0.38);
}

.btn-availability {
    font-weight: 800;
}

.agenda-row .btn-compact {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.event-admin-actions {
    display: flex;
    gap: 6px;
    width: 100%;
    align-items: center;
    min-width: 0;
}

.event-admin-attendance {
    flex: 0 0 auto;
    min-width: auto;
    min-height: 36px;
    padding: 10px 12px;
    font-size: .88rem;
}

.event-admin-btn {
    flex: 1;
    min-width: 0;
    min-height: 36px;
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-admin-btn.event-admin-edit {
    border-color: rgba(139, 166, 255, 0.44);
    background: rgba(70, 88, 139, 0.34);
    color: var(--text-main);
}

.event-admin-btn.event-admin-cancel {
    border-color: rgba(255, 111, 122, 0.5);
    background: rgba(255, 111, 122, 0.2);
    color: var(--danger);
}

.event-admin-btn.event-admin-keep {
    border-color: rgba(65, 211, 138, 0.5);
    background: rgba(65, 211, 138, 0.2);
    color: var(--success);
}

.btn-notes .btn-text-scroll { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.event.holiday .event-body,
.event.special .event-body {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    grid-template-areas: "star header date";
    align-items: center;
    column-gap: 12px;
}

.event.birthday .event-body {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    grid-template-areas: "cake header date";
    align-items: center;
    column-gap: 12px;
}

.event.holiday .meta-section,
.event.special .meta-section,
.event.holiday .actions-column,
.event.special .actions-column,
.event.holiday .agenda-row,
.event.special .agenda-row,
.event.birthday .meta-section,
.event.birthday .actions-column,
.event.birthday .agenda-row {
    display: none;
}

.event.compact .event-body {
    min-height: 48px;
    align-content: center;
}

.holiday-star-container {
    grid-area: star;
    width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.holiday-star i {
    font-size: 1.55rem;
}

.event.holiday .holiday-star i {
    color: var(--border-holiday);
}

.event.special .holiday-star i {
    color: var(--border-special);
}

.birthday-cake-container {
    grid-area: cake;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.event.birthday .info-column,
.event.holiday .info-column,
.event.special .info-column {
    text-align: center;
}

.event.holiday .event-title,
.event.special .event-title,
.event.birthday .event-title {
    margin-bottom: 0;
}

.event.holiday .date-box,
.event.special .date-box,
.event.birthday .date-box {
    align-self: center;
}

.flash-green { animation: flashGreen .6s var(--ease-out); }
.flash-red { animation: flashRed .6s var(--ease-out); }

@keyframes flashGreen {
    0% { box-shadow: 0 0 0 0 rgba(65,211,138,.8); }
    100% { box-shadow: 0 0 0 10px rgba(65,211,138,0); }
}

@keyframes flashRed {
    0% { box-shadow: 0 0 0 0 rgba(255,111,122,.8); }
    100% { box-shadow: 0 0 0 10px rgba(255,111,122,0); }
}

.confetti-container,
.balloon,
.cake,
.candle,
.flame,
.birthday-gradient-text {
    display: none;
}

.birthday-gradient-text {
    display: inline;
    color: var(--text-main);
}

.birthday-cake-container::before {
    content: '🎉';
    font-size: 1.4rem;
    line-height: 1;
}

.drum-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(178,136,255,.24);
    color: #f0e5ff;
    margin-bottom: 6px;
}

.person-row {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
}

.person-row.debt { border-color: rgba(255,111,122,.55); }

.person-info { min-width: 0; }
.person-name { font-weight: 700; margin-bottom: 4px; }
.person-name-button {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-main);
    padding: 0;
    text-align: left;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font: inherit;
    font-weight: 700;
    margin-bottom: 4px;
}

.person-name-button:hover {
    color: var(--accent-2);
}

.person-row.consumption-mode {
    --person-border-angle: 0turn;
    --person-main-bg: linear-gradient(180deg, rgb(19, 27, 47), rgb(12, 17, 31));
    --person-gradient-border: conic-gradient(
        from var(--person-border-angle),
        transparent 18%,
        rgba(99, 210, 255, 0.32),
        rgba(99, 210, 255, 0.72) 45%,
        rgba(99, 210, 255, 0.28) 64%,
        transparent 80%
    );
    border: 2px solid transparent;
    background:
        var(--person-main-bg) padding-box,
        var(--person-gradient-border) border-box,
        var(--person-main-bg) border-box;
    box-shadow: 0 0 0 1px rgba(99, 210, 255, 0.30), 0 0 12px rgba(99, 210, 255, 0.16), var(--shadow-1);
    animation: personBorderSpin 6s linear infinite;
    animation-delay: var(--consumption-spin-delay, 0s);
}

@keyframes personBorderSpin {
    to { --person-border-angle: 1turn; }
}

@property --person-border-angle {
    syntax: "<angle>";
    inherits: true;
    initial-value: 0turn;
}

.person-name-button.consumption-name-active {
    color: var(--accent-2);
}

.person-name-button.consumption-name-active:hover {
    color: #b8ecff;
}

.person-row-clickable { cursor: pointer; }
.person-balance { font-weight: 800; }

.actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.person-row.person-row-admin {
    flex-direction: column;
    align-items: stretch;
}

.person-row.person-row-admin .person-info {
    width: 100%;
    padding-right: 44px;
}

.person-row.person-row-admin .actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
    margin-top: 6px;
}

.person-row.person-row-admin .actions .action-btn {
    width: 100%;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 9px;
}

.person-row.person-row-admin .person-name {
    margin-bottom: 2px;
}

.person-row.person-row-admin .admin-delete-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 8px;
    z-index: 2;
}

.consumption-added-animation {
    animation: pulseConsumption .8s var(--ease-out);
}

@keyframes pulseConsumption {
    0% { transform: scale(1); }
    45% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.groceries-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.groceries-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(139, 166, 255, 0.25);
    background: rgba(13, 18, 31, 0.72);
}

.grocery-list-item-enter { animation: fadeInUp .3s var(--ease-out); }

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.calendar-header h3 {
    color: var(--accent-2);
    font-size: 1rem;
}

.calendar-header button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(139, 166, 255, 0.34);
    background: rgba(68, 83, 127, 0.38);
    color: var(--text-main);
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.calendar-grid.day-names { margin-bottom: 6px; }

.calendar-day-name {
    text-align: center;
    font-size: .74rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.calendar-day {
    min-height: 58px;
    border-radius: 8px;
    border: 1px solid rgba(139, 166, 255, 0.2);
    background: rgba(13, 18, 31, 0.72);
    padding: 5px;
    color: var(--text-muted);
}

.calendar-day.current-month { color: var(--text-main); }
.calendar-day.today { border-color: rgba(99,210,255,.6); background: rgba(99,210,255,.16); }
.calendar-day-selected { box-shadow: 0 0 0 1px rgba(124,156,255,.6), var(--shadow-1); }
.calendar-day-number { font-size: .82rem; font-weight: 700; }

.calendar-event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 3px;
}

.dot-regular { background: #63d2ff; }
.dot-extra { background: #ffbf5c; }
.dot-show { background: #b288ff; }
.dot-cancelled { background: #ff6f7a; }
.dot-holiday { background: #41d38a; }
.dot-special { background: #7c9cff; }

.calendar-event-title { font-weight: 800; margin-bottom: 4px; }
.calendar-event-sub { font-size: .84rem; color: var(--text-muted); }
.calendar-detail-row { display: grid; grid-template-columns: 16px 1fr; gap: 8px; margin-top: 6px; font-size: .86rem; }
.calendar-detail-row .note-text { white-space: pre-wrap; }

.audio-tab-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(139, 166, 255, 0.25);
    background: rgba(13, 18, 31, 0.7);
}

.audio-tab-btn {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
}

.audio-tab-btn.active {
    color: var(--accent-2);
    border-color: rgba(124,156,255,.45);
    background: rgba(124,156,255,.2);
}

.audio-row {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: none;
    background: transparent;
    box-shadow: none;
}

.audio-info { min-width: 0; }
.audio-title { font-weight: 700; overflow-wrap: anywhere; }
.audio-sub { color: var(--text-muted); font-size: .78rem; }

.audio-group {
    border-radius: 12px;
    border: 1px solid rgba(139,166,255,.22);
    background: rgba(13,18,31,.66);
    padding: 8px;
    display: grid;
    gap: 8px;
}

.audio-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(68,83,127,.3);
    cursor: pointer;
}

.audio-group.collapsed .audio-row { display: none; }
.audio-group.collapsed .chev { transform: rotate(-90deg); }
.audio-group-tools { display: inline-flex; gap: 6px; }

.audio-waveform {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
}

.audio-waveform-bar {
    width: 3px;
    height: 8px;
    border-radius: 2px;
    background: var(--accent-2);
    animation: wave 0.9s ease-in-out infinite;
}

.audio-waveform-bar:nth-child(2) { animation-delay: .08s; }
.audio-waveform-bar:nth-child(3) { animation-delay: .16s; }
.audio-waveform-bar:nth-child(4) { animation-delay: .24s; }
.audio-waveform-bar:nth-child(5) { animation-delay: .32s; }

.audio-waveform.paused .audio-waveform-bar { animation-play-state: paused; opacity: .5; }

@keyframes wave {
    0%, 100% { height: 6px; }
    50% { height: 20px; }
}

.audio-footer {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 12px;
    z-index: 120;
    width: min(980px, calc(100% - 22px));
    border-radius: 12px;
    border: 1px solid rgba(139,166,255,.28);
    background: rgba(16,21,36,.96);
    box-shadow: var(--shadow-2);
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.audio-footer .title {
    font-weight: 700;
    font-size: .96rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-footer .progress-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.audio-footer .time {
    font-size: .78rem;
    color: var(--text-muted);
}

.audio-footer .controls-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.audio-footer input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.passcode-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(139,166,255,.5);
    background: rgba(68,83,127,.35);
}

.passcode-dot.filled {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(124,156,255,.2);
}

.keypad-btn {
    border: 1px solid rgba(139,166,255,.34);
    border-radius: 10px;
    background: rgba(68,83,127,.32);
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 14px;
    cursor: pointer;
}

.songs-modal .song-item,
.songs-modal .song-item.category {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(139,166,255,.25);
    background: rgba(68,83,127,.28);
    cursor: pointer;
    margin-bottom: 8px;
}

.song-number { font-weight: 800; color: var(--accent-2); }
.song-name { overflow-wrap: anywhere; }
.song-icon { color: var(--accent); }

.songs-block {
    border: 1px solid rgba(139,166,255,.24);
    border-radius: 10px;
    background: rgba(13,18,31,.72);
    padding: 10px;
}

.songs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.songs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.song-chip {
    border-radius: 999px;
    border: 1px solid rgba(139,166,255,.3);
    background: rgba(124,156,255,.2);
    padding: 5px 10px;
    font-size: .78rem;
    font-weight: 600;
}

.song-cat-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.song-cat-btn {
    border: 1px solid rgba(139,166,255,.36);
    border-radius: 10px;
    background: rgba(68,83,127,.34);
    color: var(--text-main);
    padding: 10px;
    font-weight: 700;
    cursor: pointer;
}

.song-cat-btn.active {
    border-color: rgba(124,156,255,.64);
    background: rgba(124,156,255,.26);
    color: var(--accent-2);
}

.floating-btn-agenda {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 110;
}

#scrollToTopBtn {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease-out);
}

#scrollToTopBtn.show {
    opacity: 1;
    pointer-events: auto;
}

.agenda-sticky-controls {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 108;
}

.app-version.clickable-version-badge,
.clickable-version-badge {
    cursor: pointer;
}

.dropdown-opening { animation: fadeInUp .24s var(--ease-out); }
.dropdown-closing { animation: fadeOutDown .2s var(--ease-out); }

.public-payment-header {
    text-align: center;
    margin-bottom: 18px;
}

.public-payment-title {
    margin: 0 0 6px;
    font-size: 2.2rem;
    line-height: 1.06;
    word-break: break-word;
}

.public-payment-info {
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
}

.public-payment-summary {
    background: linear-gradient(180deg, rgba(10, 40, 68, 0.52), rgba(10, 34, 58, 0.38));
    border: 1px solid rgba(6, 182, 212, 0.28);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    text-align: center;
}

.public-payment-amount-line {
    margin: 0 0 12px;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-main);
}

.public-payment-amount-line span {
    color: var(--accent);
    font-weight: 700;
}

.public-payment-confirm {
    background: var(--success);
    color: #000;
    border-color: var(--success);
    padding: 12px 26px !important;
    white-space: nowrap;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(65, 211, 138, 0.24);
}

.public-payment-suggested-section {
    margin-bottom: 10px;
}

.public-payment-section-label {
    font-size: 0.82rem;
    margin: 0 0 10px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.public-payment-suggested-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.public-payment-secondary {
    width: 100%;
    background: linear-gradient(180deg, rgba(124, 156, 255, 0.32), rgba(92, 116, 192, 0.34));
    color: var(--text-main);
    font-size: 0.95rem;
    padding: 11px 16px !important;
    border-radius: 11px !important;
    font-weight: 700;
    border: 1px solid rgba(124, 156, 255, 0.45);
}

#anderBedragButton {
    margin-bottom: 10px;
}

.public-payment-transactions {
    width: 100%;
    background: rgba(124, 156, 255, 0.14);
    border: 1px solid rgba(124, 156, 255, 0.62);
    color: var(--accent-2);
    font-size: 0.95rem;
    padding: 11px 16px !important;
    border-radius: 10px !important;
    font-weight: 700;
}

.public-payment-transactions:hover {
    background: rgba(124, 156, 255, 0.24);
    border-color: rgba(124, 156, 255, 0.78);
}

.payment-suggested-btn {
    background: linear-gradient(180deg, rgba(124, 156, 255, 0.24), rgba(92, 116, 192, 0.28));
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid rgba(124, 156, 255, 0.45);
    border-radius: 11px;
    min-height: 58px;
}

.payment-suggested-btn-label {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}

.payment-suggested-btn-amount {
    font-size: 1rem;
    font-weight: 700;
}

#publicPaymentModal .popup-content.payment-modal-compact {
    width: min(92vw, 560px) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(124, 156, 255, 0.30) !important;
    background: linear-gradient(180deg, rgba(20, 27, 47, 0.98), rgba(10, 16, 30, 0.98)) !important;
    box-shadow: 0 20px 48px rgba(3, 6, 18, 0.6) !important;
    padding: 18px !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#publicPaymentModal .public-payment-header {
    text-align: center !important;
    margin: 0 !important;
}

#publicPaymentModal .public-payment-suggested-section,
#publicPaymentModal #anderBedragButton,
#publicPaymentModal #customPaymentSection,
#publicPaymentModal .public-payment-transactions {
    margin: 0 !important;
}

#publicPaymentModal .public-payment-section-label {
    text-align: center !important;
    margin: 0 0 12px !important;
}

#publicPaymentModal .public-payment-title {
    margin: 0 0 6px !important;
    font-size: 2.2rem !important;
    line-height: 1.06 !important;
    text-align: center !important;
}

#publicPaymentModal .public-payment-info {
    margin: 0 !important;
    text-align: center !important;
    color: var(--text-muted) !important;
}

#publicPaymentModal #customPaymentSection.public-payment-summary {
    background: rgba(6, 182, 212, 0.08) !important;
    border: 1px solid rgba(6, 182, 212, 0.2) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 14px !important;
    text-align: center !important;
}

#publicPaymentModal .public-payment-amount-line {
    margin: 0 0 12px !important;
    font-size: 1.08rem !important;
    font-weight: 600 !important;
}

#publicPaymentModal .public-payment-confirm {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #000 !important;
    font-weight: 800 !important;
}

#publicPaymentModal .public-payment-suggested-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
}

#publicPaymentModal .public-payment-secondary {
    width: 100% !important;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutDown {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(8px); }
}

@keyframes calendarPop {
    from { opacity: 0; transform: scale(.92); }
    to { opacity: 1; transform: scale(1); }
}

.calendar-day.pop-in { animation: calendarPop .25s var(--ease-out); }

.hidden { display: none !important; }

@media (max-width: 900px) {
    .tab { font-size: .82rem; padding: 10px 8px; }
    .audio-tab-btn { font-size: .8rem; }
    .event-body { grid-template-columns: 1fr auto; }
    .admin-controls-row {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 8px 6px;
    }
}

@media (max-width: 640px) {
    header { padding: 8px 8px 10px; }
    .top-bar {
        padding: 8px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
    }
    .top-bar > div:first-child {
        gap: 8px !important;
        min-width: 0;
    }
    .top-bar > div:first-child img {
        height: 38px !important;
    }
    .top-bar > div:last-child {
        position: static !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        gap: 6px !important;
        display: flex !important;
        align-items: center;
        flex-wrap: nowrap;
    }
    .top-bar > div:last-child .btn-icon-admin {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 12px;
    }
    .top-bar > div:last-child #userActionBtn {
        min-height: 40px;
        padding: 8px 12px;
        font-size: .92rem;
        border-radius: 12px;
        white-space: nowrap;
    }
    .app-version {
        font-size: .7rem;
        padding: 3px 8px;
    }
    .container { padding-left: 8px; padding-right: 8px; }
    .content-panel, #agendaContent { padding: 8px 6px 14px; }
    .pwa-install-banner {
        padding: 10px 12px;
        gap: 10px;
        margin-top: 8px;
    }
    .pwa-install-copy h4 {
        font-size: 0.95rem;
    }
    .pwa-install-copy p {
        font-size: 0.8rem;
    }
    .event { padding: 10px 16px 10px; }
    .event-body { grid-template-columns: 1fr auto; gap: 10px; }
    .event-body > .info-column { order: 1; }
    .event-body > .date-box { order: 2; }
    .event-body > .actions-column { order: 3; }
    .event-body > .agenda-row { order: 4; }
    .date-day { font-size: 2rem; }
    .date-month { font-size: .72rem; }
    .event-title { font-size: 1.06rem; margin-bottom: 8px; }
    .meta { font-size: .9rem; }
    .actions-column,
    .agenda-row {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
    }

    .event:not(.user-attendance) .actions-column {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .event:not(.user-attendance) .agenda-row {
        margin-top: 0;
    }

    .event:not(.user-attendance) .actions-column > button {
        width: 100%;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: clamp(0.78rem, 3.1vw, 0.92rem);
    }

    .event:not(.user-attendance) .actions-column > button:nth-child(3):last-child {
        grid-column: 1 / -1;
    }

    .btn-compact,
    .btn-availability,
    .btn-songs,
    .btn-notes {
        width: auto;
        min-height: 40px;
        justify-content: center;
    }

    .event-admin-actions {
        gap: 5px;
    }

    .event-admin-attendance {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .event-admin-btn {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 0.82rem;
        gap: 4px;
    }

    .filter-dropdown-container {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
        z-index: 130;
    }
    #scrollToTopBtn,
    .agenda-sticky-controls {
        right: 10px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
        z-index: 129;
    }

    .btn, .btn-base { padding: 9px 12px; }
    .btn-icon-admin,
    .action-btn,
    .grocery-action-btn,
    .btn-icon-mini,
    .floating-btn-agenda,
    .btn-ctl { width: 44px; height: 44px; }
    .audio-footer {
        width: calc(100% - 12px);
        left: 6px;
        transform: none;
        bottom: 6px;
    }

    #publicPaymentModal {
        padding: 10px;
    }
    #publicPaymentModal .popup-content {
        width: min(96vw, 560px);
        max-height: 90vh;
        overflow-x: hidden;
        padding: 18px 14px 14px;
    }
    #publicPaymentTitle {
        font-size: 2rem !important;
        line-height: 1.05;
        margin-right: 0 !important;
        text-align: center !important;
        word-break: break-word;
    }
    #publicPaymentInfo {
        font-size: 0.92rem !important;
        margin-right: 0 !important;
        text-align: center !important;
    }
    #customPaymentSection {
        padding: 12px !important;
    }
    #customPaymentSection p,
    #publicPaymentModal .public-payment-amount-line {
        font-size: 0.95rem !important;
        line-height: 1.28;
    }
    #suggestedAmountsContainer {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 8px !important;
        width: 100%;
        overflow: hidden;
    }
    #suggestedAmountsContainer > button {
        min-width: 0;
        max-width: 100%;
        padding: 10px 8px !important;
    }
    #suggestedAmountsContainer > button span:first-child,
    #suggestedAmountsContainer > button .payment-suggested-btn-label {
        white-space: normal !important;
        overflow-wrap: anywhere;
        text-align: center;
        font-size: 0.72rem !important;
        line-height: 1.18;
    }
    #suggestedAmountsContainer > button span:last-child,
    #suggestedAmountsContainer > button .payment-suggested-btn-amount {
        font-size: 0.84rem !important;
        line-height: 1.15;
    }

    #eventsList,
    #rowContainer,
    #audioListContainer,
    #groceriesList {
        padding-bottom: 146px;
    }

    #updateNotificationDialog .update-notification-header h2 {
        font-size: 1.65rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
