* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes highlight-flash {
    0% {
        outline-color: transparent;
        box-shadow: none;
    }
    10%, 80% {
        outline-color: var(--primary-color);
        box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
    }
    100% {
        outline-color: transparent;
        box-shadow: none;
    }
}

.task-highlight {
    outline: 3px solid transparent;
    outline-offset: 4px;
    animation: highlight-flash 4s ease-out;
    position: relative;
    z-index: 1;
    border-radius: 8px;
}

/* Deleted item toast message */
.deleted-item-toast {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.deleted-item-message {
    background: white;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.deleted-item-message .deleted-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.deleted-item-message p {
    color: var(--text-color);
    margin-bottom: 12px;
    line-height: 1.5;
}

.deleted-item-message .deleted-item-title {
    color: var(--primary-color);
    font-weight: 600;
    font-style: italic;
}

:root {
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --bg-color: #f8fafc;
    --sidebar-bg: #1e1b4b;
    --sidebar-text: #e2e8f0;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --hover-bg: rgba(255, 255, 255, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #312e81 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

.loading-screen.hidden {
    display: none;
}

.loading-spinner {
    font-size: 4rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #312e81 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.login-screen.hidden {
    display: none;
}

.login-container {
    background: var(--card-bg);
    padding: 20px 28px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.login-container h1 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-color);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-container h1 .login-icon {
    font-size: 2rem;
}

.login-container h1 .login-subtitle {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Login Logo */
.login-logo {
    text-align: center;
    margin-bottom: 12px;
}

.login-logo-img {
    max-width: 80px;
    max-height: 80px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-form input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
    background-color: #ffffff !important;
    color: #1e293b !important;
    -webkit-text-fill-color: #1e293b !important;
}

.auth-form input::placeholder {
    color: #94a3b8;
    -webkit-text-fill-color: #94a3b8;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Group name section - centered and prominent */
.group-name-section {
    text-align: center;
    margin-bottom: 8px;
}

.group-name-section label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.group-name-section input {
    font-size: 1.25rem;
    text-align: center;
    padding: 16px 20px;
    font-weight: 500;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

.group-name-preview {
    font-size: 0.9rem;
    color: #e2e8f0;
    margin-top: 12px;
    font-weight: 500;
    padding: 12px 16px;
    background: var(--sidebar-bg);
    border-radius: 8px;
    text-align: center;
}

/* User info section - left aligned */
.user-info-section {
    text-align: left;
}

.user-info-section .form-group {
    margin-bottom: 2px;
}

.optional-label {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Headshot upload in registration forms */
.headshot-upload-section {
    text-align: center;
    margin-bottom: 4px;
}

.headshot-upload-section label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

.registration-headshot-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: var(--bg-color);
    border: 2px dashed var(--border-color);
    transition: border-color 0.2s;
}

.registration-headshot-preview:hover,
.registration-headshot-preview.drag-over {
    border-color: var(--primary-color);
    border-style: solid;
}

.registration-headshot-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    pointer-events: none;
}

.registration-headshot-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 1;
}

.registration-headshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

.registration-headshot-preview:hover .registration-headshot-overlay,
.registration-headshot-preview.drag-over .registration-headshot-overlay {
    opacity: 1;
}

.registration-headshot-overlay span {
    color: white;
    font-size: 0.7rem;
    text-align: center;
}

.user-info-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Form row for side-by-side fields */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Primary button style */
.primary-btn {
    padding: 16px 24px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, var(--primary-color), #ec4899) !important;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 16px !important;
    width: 100%;
    text-align: center;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Registration success state */
.create-success {
    text-align: center;
    padding: 16px 0;
}

.create-success .success-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.5rem;
    color: white;
}

.create-success h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

.create-success .success-message {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.create-success .success-message span {
    font-weight: 600;
    color: var(--text-color);
}

.create-success .invite-link-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.create-success .invite-link-container input {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
}

.create-success .copy-feedback {
    font-size: 0.8rem;
    color: #10b981;
    margin-bottom: 8px;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 45px !important;
}

/* Override browser autofill styling */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
}

.toggle-password-btn {
    position: absolute;
    right: 8px;
    background: none !important;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: opacity 0.15s;
    padding: 4px 8px !important;
    width: auto !important;
    margin: 0 !important;
    transform: none !important;
    box-shadow: none !important;
}

.toggle-password-btn:hover {
    opacity: 1;
    transform: none !important;
    box-shadow: none !important;
}

/* Submit buttons only - not toggle buttons */
.auth-form > button[type="button"],
.user-info-section + button[type="button"] {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    letter-spacing: 0.5px;
    width: 100%;
    margin-top: 6px;
}

/* Submit button hover - exclude toggle buttons */
.auth-form > button[type="button"]:hover,
.user-info-section + button[type="button"]:hover,
#login-btn:hover,
#create-group-btn:hover,
#join-group-btn:hover {
    background: var(--primary-hover);
    color: #f5f3ff;
}

/* Form field grouping */
.auth-form .form-group {
    margin-bottom: 6px;
}

.auth-form .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.auth-form .form-divider {
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
    position: relative;
}

.auth-form .form-divider span {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    padding: 0 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    min-height: 20px;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: var(--bg-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab:hover {
    background: var(--border-color);
}

.auth-tab.active {
    background: var(--primary-color);
    color: white;
}

.auth-form.hidden {
    display: none;
}

.invite-message {
    text-align: center;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 16px;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.us-logo {
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    background: linear-gradient(135deg, #ec4899, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.us-logo-hearts {
    font-size: 1.3rem;
    line-height: 1;
}

.us-logo-text {
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.sidebar-subtitle {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
}



.header-photo-container {
    position: relative;
    margin-top: 0;
    cursor: pointer;
    width: 100%;
}

.header-photo {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.header-photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: white;
    font-size: 0.9rem;
}

.header-photo-container:hover .header-photo-overlay,
.header-photo-container.drag-over .header-photo-overlay {
    opacity: 1;
}

.lists-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.lists-section h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

#lists-container {
    list-style: none;
}

.list-item {
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.15s;
    margin-bottom: 2px;
}

.list-item:hover {
    background: var(--hover-bg);
}

.list-item.active {
    background: var(--primary-color);
}

.list-item.dragging {
    opacity: 0.5;
}

.list-item.drag-over-list {
    border-top: 2px solid var(--primary-color);
    margin-top: -2px;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    padding-right: 8px;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

/* List color dot */
.list-color-dot {
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1;
}

.list-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.add-list-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    align-items: flex-start;
    overflow: visible;
}

#new-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: flex-start;
    flex: 1;
    max-width: 350px;
    overflow: visible;
    position: relative;
}

.add-list-form input,
.add-list-form textarea {
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.875rem;
}

.add-list-form input::placeholder,
.add-list-form textarea::placeholder {
    color: var(--text-muted);
}

.add-list-form input:focus,
.add-list-form textarea:focus {
    outline: 2px solid var(--primary-color);
}

/* Auto-expanding text input for new list */
#new-list-input {
    height: 36px;
    max-height: 150px;
    resize: none;
    overflow-y: hidden;
    padding: 4px 8px;
    line-height: 1.4;
    box-sizing: border-box;
    font-family: inherit;
    width: 100%;
    border: 2px solid #7c3aed !important;
}

.add-list-form button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.15s;
    display: none;
}

.add-list-form button.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-list-form button:hover {
    background: var(--primary-hover);
}

/* Color select dropdown */
.color-select {
    padding: 6px 24px 6px 8px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E") no-repeat right 8px center;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    width: 52px;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.color-select:focus {
    outline: 2px solid var(--primary-color);
}

.color-select option {
    background: var(--sidebar-bg);
    color: white;
    font-size: 1rem;
}

.shape-select {
    padding: 6px 24px 6px 8px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E") no-repeat right 8px center;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    width: 52px;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.shape-select:focus {
    outline: 2px solid var(--primary-color);
}

.shape-select option {
    background: var(--sidebar-bg);
    color: white;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.import-btn {
    width: 100%;
    padding: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.import-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

/* User Menu */
.user-menu {
    position: relative;
    flex-shrink: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 140px;
}

.user-dropdown.hidden {
    display: none;
}

.dropdown-menu-btn {
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    border-radius: 6px;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.dropdown-menu-btn:hover {
    background: rgba(124, 58, 237, 0.1);
}

.dropdown-menu-btn#logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.import-status {
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.import-status.loading {
    color: var(--primary-color);
}

.import-status.success {
    color: var(--success-color);
}

.import-status.error {
    color: var(--danger-color);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sticky Header */
.main-sticky-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    gap: 12px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.main-sticky-header .list-header {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
}

.main-sticky-header .list-header h2 {
    font-size: 2.25rem;
    color: var(--text-color);
    display: inline-block;
    flex: 1;
    text-align: center;
}

.main-sticky-header .list-header-color {
    display: inline-block;
}

.main-sticky-header .add-item-form {
    width: 100%;
    margin-bottom: 0;
    order: 4;
}

.main-sticky-header .search-container {
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Scrollable Content */
.main-scrollable-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

/* Search Box */
.search-container {
    position: relative;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.15s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.clear-search-btn.hidden {
    display: none;
}

/* Search Results */
.search-results {
    margin-bottom: 24px;
}

.search-results.hidden {
    display: none;
}

.search-results-header {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.search-result-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.search-result-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.search-result-title mark {
    background: rgba(124, 58, 237, 0.2);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-list {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.search-result-subtask {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 4px 0;
    padding-left: 8px;
    border-left: 2px solid var(--secondary-color);
}

.search-result-comment {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 4px 0;
    padding-left: 8px;
    border-left: 2px solid var(--primary-color);
}

.search-result-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 4px 0;
    padding-left: 8px;
    border-left: 2px solid #10b981;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 1.125rem;
}

.list-view.hidden,
.hidden {
    display: none !important;
}

/* Back to lists button - hidden on desktop */
.back-to-lists-btn {
    display: none;
}

.list-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.list-header-color {
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.15s;
    font-size: 27px;
    line-height: 1;
}

.list-header-color:hover {
    transform: scale(1.2);
}

.list-header h2 {
    font-size: 2.25rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.list-header h2:hover {
    background: var(--border-color);
}

.delete-btn {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s;
    font-size: 1rem;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Sort Control */
.sort-control {
    position: relative;
    flex-shrink: 0;
}

.sort-btn {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: background-color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sort-btn:hover {
    background: var(--border-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.sort-btn .sort-label {
    font-size: 0.75rem;
}

.sort-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 150px;
    overflow: hidden;
}

.sort-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: background-color 0.1s;
}

.sort-option:hover {
    background: var(--border-color);
}

.sort-option.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Tasks Styles */
.tasks-container {
    margin-top: 0;
}

.task-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: box-shadow 0.15s;
    position: relative;
}

.task-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.task-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.task-checkbox:hover {
    border-color: var(--primary-color);
}

.task-checkbox.checked {
    background: var(--success-color);
    border-color: var(--success-color);
}

.task-checkbox.checked::after {
    content: "✓";
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Top 10 Lists */

/* Parent items (the list titles like "Pete & Carol's Top 10...") */
.top10-parent > .task-content > .task-title {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Subtasks container under Top 10 parents */
.top10-parent > .subtasks {
    padding-left: 32px;
    margin-left: 20px;
    border-left: 3px solid var(--primary-color);
    border-top: none;
    background: var(--bg-color);
    border-radius: 0 8px 8px 0;
    margin-top: 8px;
    margin-bottom: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.top10-parent > .subtasks .task-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.top10-parent > .subtasks .task-item:last-child {
    border-bottom: none;
}

/* Nested subtasks within Top 10 items (checklists, etc) */
.top10-parent > .subtasks .subtasks {
    padding-left: 24px;
    margin-left: 16px;
    border-left: 2px solid var(--primary-color);
    background: rgba(124, 58, 237, 0.05);
    border-radius: 0 6px 6px 0;
    margin-top: 4px;
    margin-bottom: 4px;
    padding-top: 4px;
    padding-bottom: 4px;
}

/* Hide checkbox for Top 10 child items */
.task-checkbox.top10-hidden {
    display: none;
}

/* Top 10 child items - normal weight */
.top10-child > .task-content > .task-title {
    font-weight: 400;
}

/* Checklist headers (e.g., "PETE'S TOP 10") */
.checklist-header > .task-content > .task-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.checklist-header > .task-content > .task-checkbox {
    display: none;
}

/* Ensure collapse button is visible for checklist headers */
.checklist-header > .task-content > .collapse-btn {
    visibility: visible !important;
    display: block !important;
}

/* Checklist header subtasks container */
.checklist-header > .subtasks {
    padding-left: 24px;
    margin-left: 16px;
    border-left: 2px solid var(--primary-color);
    border-top: none;
    margin-top: 4px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.collapse-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
}

.collapse-btn.collapsed {
    transform: rotate(-90deg);
}

.collapse-btn.hidden {
    visibility: hidden;
}

.task-title {
    flex: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.task-title:hover {
    background: var(--bg-color);
}

.task-title.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

.inline-task-edit {
    background: var(--card-bg);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: inherit;
    font-family: inherit;
    padding: 4px 8px;
    width: 100%;
    outline: none;
    resize: none;
    overflow: hidden;
    line-height: 1.4;
    min-height: 1.4em;
}

.inline-task-edit:focus {
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.task-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: auto;
    padding-right: 8px;
}

.task-date:hover {
    color: var(--primary-color);
}

.task-date.no-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.task-date.no-date:hover {
    opacity: 1;
    color: var(--primary-color);
}

.inline-date-picker {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.date-picker-input {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8rem;
}

.date-picker-save,
.date-picker-clear {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.date-picker-save {
    background: var(--primary-color);
    color: white;
}

.date-picker-clear {
    background: var(--border-color);
    color: var(--text-color);
}

/* Task Attachments */
.task-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px 12px;
}

.task-attachment-img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    object-fit: cover;
}

video.task-attachment-img {
    cursor: default;
    max-width: 320px;
    max-height: 240px;
}

.task-attachment-img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.attachment-container {
    position: relative;
    display: inline-block;
}

.attachment-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background-color 0.15s;
}

.attachment-container:hover .attachment-delete-btn {
    opacity: 1;
}

.attachment-delete-btn:hover {
    background: var(--danger-color);
}

.attachment-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.attachment-caption:hover {
    background: var(--bg-color);
}

.attachment-caption.placeholder {
    font-style: italic;
    opacity: 0.6;
}

.caption-input {
    font-size: 0.75rem;
    text-align: center;
    max-width: 200px;
    width: 100%;
    padding: 4px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    outline: none;
}

/* Comments */
.task-comments {
    padding: 8px 16px 12px;
}

.comment-item {
    display: block;
    padding: 12px 32px 12px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    position: relative;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    overflow: hidden;
    float: left;
    margin-right: 8px;
    margin-bottom: 4px;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Task creator avatar - small indicator of who added the task */
.task-creator-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.55rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.task-header {
    display: flex;
    align-items: center;
}

.task-header .task-content {
    flex: 1;
}

.task-creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-date {
    color: #999;
    font-size: 0.65rem;
    display: inline-block;
    margin-right: 8px;
    vertical-align: top;
}

.comment-text {
    font-size: 0.75rem;
    color: #333;
    display: inline-block;
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
    max-width: 80%;
}

.comment-attachments {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 100%;
    margin-top: 4px;
}

.comment-attachment-img {
    max-width: 120px;
    max-height: 100px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.15s;
}

.comment-attachment-img:hover {
    opacity: 0.8;
}

.comment-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 1;
    transition: background-color 0.2s;
}

.comment-delete-btn:hover {
    background: var(--danger-color);
}

.add-comment-btn {
    background: none;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    width: 100%;
    transition: all 0.15s;
}

.add-comment-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.add-comment-inline-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: transform 0.15s;
}

.add-comment-inline-btn:hover {
    transform: scale(1.3);
    background: rgba(124, 58, 237, 0.1);
}

.add-comment-form {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.add-comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.add-comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-form-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.comment-form-buttons button {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.task-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.task-content:hover .task-actions {
    opacity: 1;
}

.task-actions button {
    padding: 4px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: background-color 0.15s;
}

.task-actions button:hover {
    background: var(--bg-color);
}

.task-actions .add-subtask-btn:hover {
    background: rgba(124, 58, 237, 0.1);
}

.task-actions .delete-task-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.task-actions .add-photo-btn {
    font-size: 1rem;
    transition: transform 0.15s, background-color 0.15s;
}

.task-actions .add-photo-btn:hover {
    background: rgba(124, 58, 237, 0.1);
    transform: scale(1.5);
}

/* Drag and drop styles */
.task-item.drag-over {
    outline: 2px dashed var(--primary-color);
    outline-offset: -2px;
    background: rgba(124, 58, 237, 0.05);
}

.task-item.uploading {
    opacity: 0.7;
    pointer-events: none;
}

.task-item.uploading::after {
    content: 'Uploading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.875rem;
}

.add-item-form.drag-over {
    outline: 2px dashed var(--primary-color);
    outline-offset: 4px;
    background: rgba(124, 58, 237, 0.05);
    border-radius: 8px;
}

.add-subtask-inline.drag-over {
    outline: 2px dashed var(--primary-color);
    outline-offset: 2px;
    background: rgba(124, 58, 237, 0.05);
}

/* Subtasks */
.subtasks {
    padding-left: 32px;
    margin-left: 20px;
    border-left: 3px solid var(--primary-color);
    border-top: none;
    background: var(--bg-color);
    border-radius: 0 8px 8px 0;
    margin-top: 4px;
    margin-bottom: 4px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.subtasks.hidden {
    display: none;
}

.subtasks .task-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    margin-bottom: 0;
}

.subtasks .task-item:last-child {
    border-bottom: none;
}

/* Add Item Form */
.add-item-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.add-item-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.top10-btn {
    padding: 10px 14px;
    border: none;
    border-radius: 24px;
    background: #b45309;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s;
    flex-shrink: 0;
}

.top10-btn:hover {
    background: #92400e;
}

.top10-title-container {
    padding: 8px 0;
}

.top10-title-container label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.top10-title-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.top10-title-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
}

.top10-title-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.top10-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-color);
    min-width: 24px;
    flex-shrink: 0;
}

/* Drag handle for top10 sub-items */
.top10-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 0.8rem;
    user-select: none;
    flex-shrink: 0;
    padding: 0 2px;
}

.top10-drag-handle:active {
    cursor: grabbing;
}

/* Visible text entry outline for top10 sub-items */
.top10-child .task-title {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.top10-child .task-title:hover {
    border-color: var(--primary-color);
    background: white;
}

.top10-child .task-title:has(.inline-task-edit) {
    border-color: var(--primary-color);
    background: white;
}

.top10-child .inline-task-edit {
    border: none;
    padding: 0;
    min-height: 0;
    box-shadow: none;
    background: transparent;
}

/* Creator avatar inline for top10 children (between # and text) */
.top10-child .task-creator-avatar-inline {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.5rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.top10-child .task-creator-avatar-inline img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.add-item-form input[type="text"],
.add-item-form textarea#new-item-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 24px;
    font-size: 1rem;
    background: #1d4f91;
    color: white;
    transition: box-shadow 0.15s;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    overflow: hidden;
    min-height: 0;
}

.add-item-form input[type="text"]::placeholder,
.add-item-form textarea#new-item-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.add-item-form input:focus,
.add-item-form textarea#new-item-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 79, 145, 0.3);
}

.add-item-extras {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.add-item-extras input[type="date"] {
    padding: 6px 8px;
    font-size: 0.85rem;
    width: auto;
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.add-item-extras button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.add-item-extras button:hover {
    background: var(--primary-hover);
}

.add-item-extras .cancel-btn {
    background: var(--border-color);
    color: var(--text-color);
}

.add-item-extras .cancel-btn:hover {
    background: #ccc;
}

.item-date-input {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    background: var(--card-bg);
    cursor: pointer;
}

.task-date-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.file-input-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition: border-color 0.15s;
}

.file-input-label:hover {
    border-color: var(--primary-color);
}

.file-input-label input[type="file"] {
    display: none;
}

.file-input-icon {
    font-size: 1.2rem;
}

.file-count {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Inline Add Subtask */
.add-subtask-inline {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid var(--border-color);
}

.add-subtask-inline input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
}

.add-subtask-inline input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-subtask-inline button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.15s;
}

.add-subtask-inline .save-subtask-btn {
    background: var(--primary-color);
    color: white;
}

.add-subtask-inline .save-subtask-btn:hover {
    background: var(--primary-hover);
}

.add-subtask-inline .cancel-subtask-btn {
    background: var(--bg-color);
    color: var(--text-muted);
}

.subtask-date-input {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8rem;
}

.subtask-date-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.subtask-file-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.subtask-file-label:hover {
    border-color: var(--primary-color);
}

.subtask-file-label input[type="file"] {
    display: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Confirm modal needs higher z-index to appear above other modals */
#confirm-modal {
    z-index: 1100;
}

.modal-content {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 1.125rem;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1.4rem;
    margin-bottom: 16px;
    font-family: inherit;
}

.modal-content textarea {
    height: auto;
    max-height: 300px;
    resize: none;
    line-height: 1.3;
    overflow-y: auto;
    flex: 1;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Edit modal input wrapper with indicator */
.edit-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.selected-emoji-indicator {
    font-size: 32px;
    width: 50px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 12px;
    flex-shrink: 0;
}

/* Color picker in modal */
.color-picker-container {
    margin-bottom: 16px;
}

.color-picker-container label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: visible;
}

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--text-color);
}

.shape-picker {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.shape-picker-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.shape-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: var(--border-color);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

.shape-btn:hover {
    transform: scale(1.1);
}

.shape-btn.selected {
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--text-color);
}

/* Crop Modal */
.crop-modal-content {
    max-width: 500px;
}

.crop-instructions {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px !important;
    text-align: center;
}

.crop-viewport {
    width: 100%;
    aspect-ratio: 26 / 15;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    position: relative;
    cursor: grab;
    background: #000;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.crop-viewport:active {
    cursor: grabbing;
}

.crop-viewport img {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
    pointer-events: none;
    max-width: none;
}

.crop-zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 0 16px;
}

.crop-zoom-control span {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 600;
    user-select: none;
}

.crop-zoom-control input[type="range"] {
    flex: 1;
    accent-color: var(--primary-color);
    margin: 0;
    padding: 0;
    border: none;
}

/* Success toast */
.success-toast {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.success-toast-message {
    background: white;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.success-toast-message .success-toast-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: white;
}

.success-toast-message h4 {
    font-size: 1.15rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.success-toast-message p {
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Profile Setup Modal */
.profile-setup-content {
    text-align: center;
}

.profile-setup-content h3 {
    font-size: 1.25rem;
}

.profile-preview {
    width: 120px;
    height: 120px;
    margin: 24px auto;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border-color);
}

.profile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-placeholder {
    font-size: 3rem;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
}

.modal-actions-spacer {
    flex: 1;
}

.btn-hide-list {
    background: transparent;
    border: 2px solid #ef4444;
    color: #ef4444;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-hide-list:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-hide-list:active {
    transform: scale(0.98);
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.15s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.group-settings-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(236, 72, 153, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s;
    text-align: left;
}

.group-settings-btn:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(236, 72, 153, 0.45));
    border-color: rgba(255, 255, 255, 0.25);
}

/* Group Settings Modal */
.group-settings-content {
    max-width: 450px;
}

.group-settings-section {
    margin-bottom: 20px;
}

.group-settings-section label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* About / Privacy section */
.about-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.privacy-policy-btn {
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    border: none;
    background: none;
    text-decoration: underline;
}

.privacy-policy-btn:hover {
    color: var(--primary-color);
}

.about-content {
    background: rgba(124, 58, 237, 0.05);
    border-radius: 8px;
    padding: 16px;
}

.about-heading {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 8px !important;
}

.about-content p {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

#about-modal {
    z-index: 3100;
}

.about-modal-content {
    max-width: 420px;
}

/* Privacy link on login screen */
.privacy-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.privacy-link:hover {
    color: var(--primary-color);
}

.already-have-account {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.already-have-account span {
    color: var(--primary-color);
    font-weight: 500;
}

.already-have-account:hover span {
    text-decoration: underline;
}

/* Verification Screen */
.verification-content {
    text-align: center;
}

.verification-icon {
    font-size: 3rem;
    margin: 16px 0 8px;
}

.verification-heading {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.verification-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.verify-resend-btn {
    width: 100%;
    margin-top: 8px;
}

#verify-signout-link {
    display: block;
    margin-top: 16px;
}

.group-name-display {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.group-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: 8px;
}

.group-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.group-member-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.group-member-info {
    flex: 1;
    min-width: 0;
}

.group-member-name {
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-member-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.remove-member-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.remove-member-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* Profile Edit Section */
.profile-edit-section {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 12px;
}

.profile-edit-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.profile-value {
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.btn-small.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-small.btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
}

.profile-edit-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.profile-edit-form .form-group {
    margin-bottom: 12px;
}

.profile-edit-form label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.profile-edit-form input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.profile-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.section-header-row label {
    margin-bottom: 0;
}

.profile-headshot-preview,
.edit-headshot-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-color);
    flex-shrink: 0;
}

.profile-headshot-preview img,
.edit-headshot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-headshot-placeholder,
.edit-headshot-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.profile-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.headshot-edit-section {
    text-align: center;
    margin-bottom: 16px;
}

.edit-headshot-preview {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
    position: relative;
    cursor: pointer;
}

.edit-headshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
}

.edit-headshot-preview:hover .edit-headshot-overlay,
.edit-headshot-preview.drag-over .edit-headshot-overlay {
    opacity: 1;
}

.edit-headshot-preview.drag-over {
    border: 2px dashed var(--primary-color);
}

.edit-headshot-overlay span {
    font-size: 1.5rem;
}

.headshot-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Password Change Section */
.password-change-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--secondary-color);
}

.password-change-fields {
    margin-top: 12px;
}

.password-change-fields .form-group {
    margin-bottom: 12px;
}

.password-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin: 8px 0 0 0;
}

.password-success {
    color: var(--success-color);
    font-size: 0.875rem;
    margin: 8px 0 0 0;
}

.invite-instructions {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px !important;
}

.invite-link-container {
    display: flex;
    gap: 8px;
}

.invite-link-container input {
    flex: 1;
    margin-bottom: 0 !important;
    font-size: 0.875rem;
    background: var(--bg-color);
    color: var(--text-color);
}

.invite-link-container button {
    flex-shrink: 0;
    white-space: nowrap;
}

.copy-feedback {
    font-size: 0.875rem;
    color: var(--success-color);
    margin-top: 8px !important;
    margin-bottom: 0 !important;
}

.copy-feedback.hidden {
    display: none;
}

/* Image Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox.hidden {
    display: none;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

#lightbox-image {
    max-width: 75%;
    max-height: 75%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Walkthrough Overlay */
.walkthrough-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: auto;
    overflow: visible;
}

.walkthrough-overlay.hidden {
    display: none;
}

.walkthrough-title {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    z-index: 10002;
    pointer-events: none;
}

.walkthrough-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.walkthrough-title p {
    font-size: 1rem;
    margin: 0;
    opacity: 0.85;
}

.walkthrough-title.hidden {
    display: none;
}

.walkthrough-highlight {
    position: absolute;
    border: 3px solid #a855f7;
    border-radius: 12px;
    box-shadow: 0 0 20px #a855f7, 0 0 0 9999px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
    animation: walkthrough-pulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes walkthrough-pulse {
    0%, 100% {
        box-shadow: 0 0 15px #a855f7, 0 0 0 9999px rgba(0, 0, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 35px #a855f7, 0 0 0 9999px rgba(0, 0, 0, 0.7);
    }
}

.walkthrough-tooltip {
    position: absolute;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10001;
}

.walkthrough-step-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.walkthrough-step-indicator span {
    color: #a855f7;
    font-weight: 600;
}

.walkthrough-tooltip p {
    margin: 0 0 16px 0;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
}

.walkthrough-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Notifications status in settings */
.notifications-status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.btn-disabled {
    opacity: 0.5;
    cursor: default;
}

/* Branded App Message (cumulative notifications) */
.app-message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 360px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.app-message-box {
    background: white;
    border-radius: 12px;
    padding: 16px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #7c3aed;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.app-message-text {
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

.app-message-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.app-message-close:hover {
    color: #6b7280;
}

/* Legacy overlay style (kept for backward compatibility) */
.app-message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.app-message-ok {
    min-width: 100px;
}

/* Offline Bar */
.offline-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
    text-align: center;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 9999;
}

/* Push Notification Toast */
.push-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 360px;
    cursor: pointer;
    animation: toast-slide-in 0.3s ease-out;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.push-toast.hidden {
    display: none;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Avatar with 💕 overlay */
.toast-avatar-container {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.toast-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.toast-avatar-initial {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.toast-avatar-heart {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 1.4rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    line-height: 1.3;
}

.toast-body {
    font-size: 0.8rem;
    opacity: 0.85;
    line-height: 1.4;
    word-break: break-word;
}

/* Collapse button */
.toast-collapse {
    flex-shrink: 0;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-collapse:hover {
    opacity: 1;
}

/* Notification Permission Prompt */
.notification-prompt {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    max-width: 360px;
    width: calc(100% - 32px);
    text-align: center;
}

.notification-prompt-text {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 16px;
    line-height: 1.5;
}

.notification-prompt-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.notification-prompt .btn-enable {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.notification-prompt .btn-skip {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Responsive - Mobile exclusive views */
@media (max-width: 768px) {
    .crop-modal-content {
        margin: 8px;
        max-width: calc(100% - 16px);
    }

    .app-container {
        flex-direction: column;
    }

    /* Default mobile state: sidebar visible, main hidden */
    .sidebar {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        min-height: unset;
        display: flex;
        flex-direction: column;
    }

    .main-content {
        display: none;
        padding: 12px;
        padding-bottom: 80px;
    }

    /* When a list is selected: sidebar hidden, main visible */
    .app-container.mobile-list-selected .sidebar {
        display: none;
    }

    .app-container.mobile-list-selected .main-content {
        display: flex;
        flex-direction: column;
        height: 100vh;
    }

    /* Back button visible on mobile */
    .back-to-lists-btn {
        display: inline-flex;
        align-items: center;
        background: none;
        border: none;
        color: var(--primary-color);
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 6px;
        white-space: nowrap;
    }

    .back-to-lists-btn:hover {
        background: var(--border-color);
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        text-align: left;
    }

    .us-logo {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .us-logo-hearts {
        font-size: 1.1rem;
    }

    .us-logo-text {
        font-size: 0.85rem;
    }

    .sidebar-header h1 {
        font-size: 0.95rem;
        flex: 1;
        line-height: 1.3;
    }

    .header-photo-container {
        margin-top: 0;
        flex-shrink: 0;
        width: 50px;
        height: 50px;
    }

    .header-photo {
        width: 50px;
        height: 50px;
        max-height: 50px;
        border-radius: 50%;
        object-fit: cover;
    }

    .header-photo-overlay {
        border-radius: 50%;
        font-size: 0.6rem;
    }

    .header-photo-overlay span {
        display: none;
    }

    .lists-section {
        padding: 8px 12px;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        flex: 1;
    }

    /* Always show scrollbar on mobile */
    .lists-section::-webkit-scrollbar {
        width: 6px;
    }

    .lists-section::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }

    .lists-section::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.4);
        border-radius: 3px;
    }

    .lists-section h2 {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }

    .list-item {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .add-item-form {
        gap: 6px;
    }

    .add-item-extras {
        flex-wrap: wrap;
        gap: 6px;
    }

    .add-item-extras input[type="date"],
    .file-input-label,
    .add-item-extras button {
        flex: 1;
        min-width: 0;
    }

    /* Stack task content vertically on mobile */
    .task-content {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 6px;
    }

    .task-title {
        flex: 1 1 100%;
        order: 1;
        padding-left: 32px;
        margin-left: -32px;
    }

    .collapse-btn {
        order: 0;
        flex-shrink: 0;
        position: relative;
        z-index: 2;
    }

    .task-date {
        order: 2;
        margin-left: 0;
        padding-left: 32px;
    }

    .task-date.no-date {
        display: none;
    }

    .task-actions {
        order: 3;
        opacity: 1;
        margin-left: auto;
    }

    .task-actions button {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .task-comments {
        padding-left: 12px !important;
    }

    .search-container {
        max-width: 100%;
    }

    .list-header h2 {
        font-size: 1.2rem;
    }

    /* Sticky header on mobile - two rows:
       Row 1: back + list name + avatar
       Row 2: search (full width) */
    .main-sticky-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
        align-items: center;
    }

    .main-sticky-header .list-header {
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
    }

    .main-sticky-header .user-menu {
        order: 2;
        flex-shrink: 0;
    }

    .main-sticky-header .search-container {
        order: 3;
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
    }

    .main-sticky-header .list-header h2 {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 2px 4px;
    }

    .main-sticky-header .list-header-color {
        font-size: 21px;
    }

    .main-sticky-header .delete-btn {
        display: none;
    }

    .main-sticky-header .search-input {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .task-attachment-img {
        max-width: 150px;
        max-height: 120px;
    }

    .modal-content {
        margin: 16px;
        max-width: calc(100% - 32px);
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    #lightbox-image {
        max-width: 95%;
        max-height: 85%;
    }

    /* Login screen mobile */
    .login-container {
        margin: 16px;
        padding: 24px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .task-actions {
        opacity: 1;
    }

    .attachment-delete-btn {
        opacity: 0.8;
        width: 28px;
        height: 28px;
    }

    .list-item {
        padding: 12px;
    }

    .drag-handle {
        padding-right: 12px;
        font-size: 1.2rem;
    }
}

/* PWA Installation Prompt */
.install-prompt {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%) !important;
    color: white !important;
    z-index: 9999 !important;
    padding: 12px 16px !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3) !important;
    width: 100% !important;
    height: auto !important;
}

.install-prompt.hidden {
    display: none;
}

.install-prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}

.install-prompt-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.install-prompt-text {
    flex: 1;
    min-width: 0;
}

.install-prompt-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    padding: 0;
}

.install-prompt-description {
    font-size: 0.85rem;
    opacity: 0.95;
    margin: 2px 0 0 0;
    padding: 0;
}

.install-btn {
    background: white;
    color: #7c3aed;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.install-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.dismiss-install-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.dismiss-install-btn:active {
    opacity: 0.6;
}

/* Open in App Banner (Mobile) */
.open-in-app-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.open-in-app-banner.hidden {
    display: none;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.banner-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.banner-button {
    background: white;
    color: #7c3aed;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.banner-button:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.banner-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 8px;
    margin-left: 8px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.banner-close:active {
    opacity: 0.6;
}

/* ==========================================
   Emoji Grid Picker Styles
   ========================================== */

.emoji-grid-picker {
    background: #0f1119;
    border: 1px solid #2a2e42;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    bottom: 100%;
    left: 0;
    z-index: 10;
    width: 100%;
    margin-bottom: 8px;
}

.emoji-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.emoji-section-label {
    font-size: 10px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(3, 42px);
    gap: 8px;
    justify-content: center;
}

.emoji-tile {
    width: 42px;
    height: 42px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 21px;
    transition: all 150ms;
    padding: 0;
    font-family: inherit;
    outline: none;
}

.emoji-tile:hover {
    background: transparent;
}

.emoji-tile:active {
    transform: scale(0.95);
}

.emoji-tile.active {
    border-color: #7c3aed;
    background: transparent;
}

.emoji-section-divider {
    height: 1px;
    background: #2a2e42;
}

/* Hide List Button */
.btn-outline-danger {
    background: transparent;
    border: 2px solid #ef4444;
    color: #ef4444;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    margin-top: 8px;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-outline-danger:active {
    transform: scale(0.98);
}

/* Empty Lists State */
.empty-lists-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-lists-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-lists-state h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

.empty-lists-state p {
    font-size: 0.875rem;
}

/* Toast Notifications */
@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
}

/* Custom Confirmation Dialog */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.confirm-dialog {
    background: #1a1f3a;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.confirm-dialog-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
}

.confirm-dialog-message {
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 32px;
    line-height: 1.5;
}

.confirm-dialog-buttons {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
}

.confirm-dialog-btn {
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
}

.confirm-dialog-btn-cancel {
    background: #3a3f4a;
    color: #ffffff;
}

.confirm-dialog-btn-cancel:hover {
    background: #4a4f5a;
}

.confirm-dialog-btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.confirm-dialog-btn-danger:hover {
    background: #dc2626;
}

.confirm-dialog-btn:active {
    transform: scale(0.98);
}
