* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #1a1a2e;
    --bg-light: #16213e;
    --bg-card: #0f3460;
    --accent: #e94560;
    --text: #eee;
    --text-muted: #aaa;
    --text-dim: #888;
    --border: #333;
    --success: #4ade80;
    --edited: #f59e0b;
}

*:focus { outline: none; }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}

/* Surgical user-select: none on interactive elements only */
.nav-dots, .calendar-nav, .fab, .btn-upload, .btn-send,
.btn-rsvp, .btn-rsvp-sm, .btn-edit-event, .btn-delete-event, .btn-primary,
.event-form-actions button, .day-events-header button,
.event-detail-header button, .reply-bar button, .cal-day, .profile-btn {
    -webkit-user-select: none;
    user-select: none;
}

/* Login screen */
.login-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 2rem;
    text-align: center;
}

.login-card h1 {
    color: var(--accent);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Pull to refresh */
.pull-to-refresh {
    position: absolute;
    top: -48px;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
    will-change: transform, opacity;
    opacity: 0;
}

.pull-to-refresh.visible {
    opacity: 1;
}

.pull-to-refresh.resetting {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pull-to-refresh.settling {
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ptr-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    will-change: transform, opacity;
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.pull-to-refresh.visible .ptr-spinner {
    opacity: 1;
    transform: scale(1);
}

.pull-to-refresh.refreshing .ptr-spinner {
    opacity: 1;
    transform: scale(1);
    animation: spin 0.65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Main app layout */
#app {
    height: 100%;
}

#main-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.pages-container {
    flex: 1;
    display: flex;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 200vw;
    min-height: 0;
    overflow: hidden;
}

.page {
    width: 100vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(0.75rem, env(safe-area-inset-top)) 1rem 0.75rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.page-header h2 {
    font-size: 1.2rem;
    color: var(--accent);
}

/* Navigation dots */
.nav-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: inherit;
    font-size: 0;
}

.dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background 0.3s;
}

.dot.active::after {
    background: var(--accent);
}

/* Chat */
.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overscroll-behavior: contain;
}

.message {
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    max-width: 85%;
    background: var(--bg-card);
    word-wrap: break-word;
    cursor: pointer;
}

.message.own {
    align-self: flex-end;
    background: var(--accent);
}

.message .msg-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.message.own .msg-author {
    color: rgba(255,255,255,0.7);
}

.message .msg-text {
    font-size: 0.9rem;
    line-height: 1.3;
    user-select: text;
    -webkit-user-select: text;
}

.message .msg-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 2px;
}

.message.own .msg-time {
    color: rgba(255,255,255,0.6);
}

.message .msg-reply {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 4px;
    border-left: 2px solid var(--accent);
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

.message .msg-media img,
.message .msg-media video {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 4px;
}

.message .msg-media audio {
    max-width: 100%;
    margin-top: 4px;
}

/* Reply bar */
.reply-bar {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.reply-bar button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.5rem;
}

/* Chat input bar */
.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.5rem max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input-bar textarea {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--text);
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.chat-input-bar textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.chat-input-bar textarea::placeholder {
    color: var(--text-dim);
}

.btn-upload, .btn-send {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    transition: background 0.15s, transform 0.1s;
}

/* Calendar */
.calendar-container {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-nav button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}

#cal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-grid.slide-out-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.15s ease-in, transform 0.15s ease-in;
}

.calendar-grid.slide-out-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.15s ease-in, transform 0.15s ease-in;
}

.calendar-grid.slide-in-left {
    opacity: 0;
    transform: translateX(40px);
    transition: none;
}

.calendar-grid.slide-in-right {
    opacity: 0;
    transform: translateX(-40px);
    transition: none;
}

.calendar-grid.slide-in-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .calendar-grid.slide-out-left,
    .calendar-grid.slide-out-right,
    .calendar-grid.slide-in-left,
    .calendar-grid.slide-in-right,
    .calendar-grid.slide-in-active {
        transition: none;
        transform: none;
    }
}

.cal-header {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.3rem;
    font-weight: 600;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    font-size: 0.9rem;
}

.cal-day.today {
    border: 1.5px solid var(--accent);
}

.cal-day.selected {
    background: var(--accent);
    color: #fff;
    transition: background 0.15s ease-out;
}

.cal-day.selected.today {
    border-color: #fff;
}

.cal-day.selected .event-dot {
    background: rgba(255, 255, 255, 0.7);
}

.cal-day.selected .event-dot.birthday {
    background: #fff;
}

.cal-day.selected .event-dot.edited {
    background: #fff;
}

.cal-day .event-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    position: absolute;
    bottom: 4px;
}

.cal-day .event-dot + .event-dot {
    bottom: 4px;
    margin-left: 7px;
}

.cal-day .event-dot.edited {
    background: var(--edited);
}

.cal-day .event-dot.birthday {
    background: #f472b6;
}

/* Month events list */
.month-events-list {
    margin-top: 1.5rem;
    padding-bottom: 4rem;
}

.month-events-heading {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.month-event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    gap: 0.75rem;
}

.month-event-item.birthday {
    border-left: 3px solid #f472b6;
}

.month-event-item:not(.birthday) {
    border-left: 3px solid var(--accent);
}

.month-event-left {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.month-event-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.month-event-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-event-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.btn-rsvp-sm {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--success);
    background: transparent;
    color: var(--success);
    transition: background 0.15s, color 0.15s, transform 0.1s;
    min-width: 44px;
    min-height: 44px;
}

.btn-rsvp-sm.going {
    background: var(--success);
    color: #000;
}

.btn-rsvp-sm:active {
    transform: scale(0.94);
}

.month-events-empty {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Day events list (inline below calendar grid, inside calendar-container) */
.day-events {
    margin-top: 1.5rem;
    padding-bottom: 4rem;
}

.day-events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.day-events-header h3 {
    font-size: 1rem;
    color: var(--text);
}

.day-events-header button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s;
}

.event-card {
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    border-left: 3px solid var(--accent);
    transition: background 0.15s, transform 0.1s;
}

.event-card.edited {
    border-left-color: var(--edited);
}

.event-card.birthday {
    border-left-color: #f472b6;
    cursor: default;
}

.event-card .event-card-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.event-card .event-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Event detail */
.event-detail {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.event-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.event-detail-header button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s;
}

.event-detail h3 {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.event-detail .event-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.event-detail .event-desc {
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.edited-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--edited);
    color: #000;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.rsvp-section h4 {
    margin-bottom: 0.5rem;
}

.rsvp-list {
    margin-bottom: 1rem;
}

.rsvp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-rsvp {
    background: var(--success);
    color: #000;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.15s;
}

.btn-rsvp.going {
    background: var(--text-dim);
    color: var(--text);
}

.btn-edit-event {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 0.5rem;
}

.btn-delete-event {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* Event form */
.event-form {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-light);
    padding: 1.5rem 1.5rem max(1.5rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    z-index: 10;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.event-form.open {
    transform: translateY(0);
}

.event-form h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.event-form input,
.event-form textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem;
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.event-form input:focus,
.event-form textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.event-form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.event-form-actions button {
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.event-form-actions button:first-child {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-primary {
    background: var(--accent) !important;
    color: #fff !important;
    font-weight: 600;
}

/* FAB */
.fab {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 5;
    transition: transform 0.15s, box-shadow 0.15s;
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Page position relative for FAB */
.page-events {
    position: relative;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border-radius: 2px;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
    width: 90%;
    max-width: 360px;
}

.toast {
    background: var(--bg-card);
    color: var(--text);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: auto;
    text-align: center;
    width: 100%;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error { border-left: 3px solid var(--accent); }
.toast.success { border-left: 3px solid var(--success); }
.toast.info { border-left: 3px solid var(--text-muted); }

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

.modal-box {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 320px;
    width: 100%;
    text-align: center;
}

.modal-box p {
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.modal-actions button {
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 80px;
}

.modal-actions .modal-cancel {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.modal-actions .modal-confirm {
    background: var(--accent);
    color: #fff;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading-spinner::after {
    content: '';
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* WebSocket reconnect banner */
.ws-reconnecting {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--edited);
    color: #000;
    text-align: center;
    padding: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.3s;
}

.ws-reconnecting.visible {
    transform: translateY(0);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

.empty-state p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Avatar component */
.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar--sm {
    width: 24px;
    height: 24px;
    font-size: 0.6rem;
    border-width: 1px;
}

.avatar--lg {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
    border-width: 2px;
}

/* Chat message row: avatar + bubble layout */
.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 88%;
}

.msg-row.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-row .avatar {
    margin-bottom: 2px;
}

.msg-row .message {
    max-width: 100%;
    flex: 1;
    min-width: 0;
}

/* Profile button in header */
.profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
}

/* Profile modal */
.profile-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-out, visibility 0.2s;
}

.profile-modal.open {
    opacity: 1;
    visibility: visible;
}

.profile-modal-card {
    background: var(--bg-light);
    border-radius: 16px;
    padding: 2rem 1.5rem 1.5rem;
    max-width: 300px;
    width: 100%;
    text-align: center;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.profile-modal.open .profile-modal-card {
    transform: scale(1) translateY(0);
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-bottom: 1rem;
}

.profile-avatar-wrapper .avatar--lg {
    transition: opacity 0.15s;
}

.profile-avatar-wrapper:hover .avatar--lg {
    opacity: 0.8;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-light);
}

.profile-avatar-edit svg {
    width: 11px;
    height: 11px;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.profile-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-actions button {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s;
}

.profile-btn-remove {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent) !important;
}

.profile-btn-close {
    background: var(--bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

.profile-uploading {
    display: inline-block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    animation: spin 0.7s linear infinite;
}

/* Event meta with avatar */
.event-creator-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Hover states (pointer devices only) */
@media (hover: hover) {
    .cal-day:not(.empty):not(.selected):hover {
        background: var(--bg-card);
    }

    .cal-day.selected:hover {
        background: #d63a54;
    }

    .btn-upload:hover, .btn-send:hover {
        background: rgba(233, 69, 96, 0.1);
    }

    .fab:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    }

    .event-card:not(.birthday):hover {
        background: rgba(15, 52, 96, 0.8);
    }

    .calendar-nav button:hover {
        background: var(--bg-card);
    }

    .btn-rsvp:hover {
        opacity: 0.9;
    }

    .btn-edit-event:hover {
        background: rgba(15, 52, 96, 0.8);
    }

    .btn-delete-event:hover {
        background: rgba(233, 69, 96, 0.1);
    }

    .btn-primary:hover {
        opacity: 0.9;
    }

    .btn-rsvp-sm:hover {
        background: rgba(74, 222, 128, 0.1);
    }

    .btn-rsvp-sm.going:hover {
        background: var(--success);
        opacity: 0.9;
    }

    .month-event-left:hover .month-event-name {
        color: var(--accent);
    }

    .modal-actions .modal-confirm:hover {
        opacity: 0.9;
    }

    .modal-actions .modal-cancel:hover {
        background: var(--bg-card);
    }

    .day-events-header button:hover,
    .event-detail-header button:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .profile-btn:hover {
        opacity: 0.85;
    }

    .profile-btn-remove:hover {
        background: rgba(233, 69, 96, 0.1) !important;
    }

    .profile-btn-close:hover {
        background: var(--bg-card) !important;
    }
}

/* Active / tap feedback */
.btn-upload:active, .btn-send:active {
    transform: scale(0.9);
}

.fab:active {
    transform: scale(0.92);
}

.event-card:not(.birthday):active {
    transform: scale(0.98);
}

.calendar-nav button:active {
    transform: scale(0.92);
}

.cal-day:not(.empty):active {
    transform: scale(0.9);
    transition: transform 0.1s;
}

.btn-rsvp:active, .btn-edit-event:active, .btn-delete-event:active {
    transform: scale(0.96);
}

.modal-actions button:active {
    transform: scale(0.96);
}

.day-events-header button:active,
.event-detail-header button:active {
    transform: scale(0.92);
}

.profile-btn:active {
    transform: scale(0.9);
}

.profile-actions button:active {
    transform: scale(0.96);
}
