/* Consent Navigator - Mobile-First Stylesheet */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --secondary: #94a3b8;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #f8fafc;
    --text-muted: #cbd5e1;
    --border: #475569;
    --radius: 8px;

    /* Level colors - high contrast versions */
    --level-enthusiastic: #f87171;
    --level-willing: #4ade80;
    --level-curious: #fbbf24;
    --level-soft-limit: #fb923c;
    --level-hard-limit: #ef4444;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.logo-img {
    height: 54px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: none;
}

@media (min-width: 768px) {
    .logo-text {
        display: inline;
    }
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.nav-links a:hover {
    background-color: var(--border);
}

.nav-messages {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.unread-count-badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

/* Main content */
main {
    flex: 1;
    padding: 2rem 1rem;
}

/* Hero */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Background Logo */
.has-logo-bg {
    position: relative;
}

.has-logo-bg::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    max-width: 400px;
    aspect-ratio: 1;
    background-image: url('../assets/images/ConsentNavigatorLogo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

.has-logo-bg > * {
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px; /* Touch-friendly */
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Feature grid */
.features {
    margin-top: 3rem;
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.feature-grid {
    display: grid;
    gap: 1rem;
}

.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2rem 1rem;
    text-align: center;
    margin-top: auto;
}

.footer-note {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-page h1 {
    font-size: 4rem;
    color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg);
    color: var(--text);
    min-height: 44px; /* Touch-friendly */
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Tablet and up */
@media (min-width: 768px) {
    .nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .cta-buttons {
        flex-direction: row;
        justify-content: center;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.alert ul {
    margin: 0;
    padding-left: 1.25rem;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.auth-container h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form {
    margin-top: 1.5rem;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.form-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: normal;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links a,
.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

.auth-links a:hover,
.auth-footer a:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* Dashboard */
.dashboard {
    max-width: 1000px;
    margin: 0 auto;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.dashboard-header .subtitle {
    color: var(--text-muted);
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-card .card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.dashboard-card h3 {
    font-size: 1.1rem;
    margin: 0;
}

.dashboard-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    flex-grow: 1;
}

.dashboard-card .btn {
    align-self: flex-start;
}

.dashboard-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.dashboard-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Tablet and up */
@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .auth-container {
        padding: 2.5rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Preferences Page */
.preferences-page {
    max-width: 900px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    color: var(--text-muted);
}

.back-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

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

/* Stats Bar */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 2rem;
}

.stats-bar .stat {
    text-align: center;
    flex: 1;
    min-width: 60px;
}

.stats-bar .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.stats-bar .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-enthusiastic .stat-value { color: #22c55e; }
.stat-willing .stat-value { color: #3b82f6; }
.stat-curious .stat-value { color: #f59e0b; }
.stat-soft .stat-value { color: #f97316; }
.stat-hard .stat-value { color: #ef4444; }

/* Category Grid */
.category-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s;
}

.category-card:hover {
    border-color: var(--primary);
}

.category-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.category-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background-color: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Legend */
.legend {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.legend h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.legend-items {
    display: grid;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.level-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.level-dot.enthusiastic { background-color: var(--level-enthusiastic); box-shadow: 0 0 6px rgba(248, 113, 113, 0.5); }
.level-dot.willing { background-color: var(--level-willing); box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }
.level-dot.curious { background-color: var(--level-curious); box-shadow: 0 0 6px rgba(251, 191, 36, 0.5); }
.level-dot.soft_limit { background-color: var(--level-soft-limit); box-shadow: 0 0 6px rgba(251, 146, 60, 0.5); }
.level-dot.hard_limit { background-color: var(--level-hard-limit); box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }

/* Category Navigation */
.category-nav {
    margin-bottom: 1.5rem;
}

.category-nav select {
    max-width: 300px;
}

/* Preferences List */
.preferences-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preference-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.preference-header {
    margin-bottom: 0.75rem;
}

.preference-header h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.preference-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.preference-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preference-controls.single .direction-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.preference-controls.dual .direction-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.preference-controls.dual .direction-row:first-child {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.direction-row .direction-label {
    min-width: 140px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.preference-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Level Legend */
.level-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.level-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Level Buttons */
.level-buttons {
    display: flex;
    gap: 0.25rem;
}

.level-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.level-btn:hover {
    border-color: var(--text-muted);
}

.level-btn.active {
    border-width: 3px;
}

.level-btn.enthusiastic.active { border-color: var(--level-enthusiastic); background: rgba(248, 113, 113, 0.2); filter: drop-shadow(0 0 4px rgba(248, 113, 113, 0.5)); }
.level-btn.willing.active { border-color: var(--level-willing); background: rgba(74, 222, 128, 0.2); filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.5)); }
.level-btn.curious.active { border-color: var(--level-curious); background: rgba(251, 191, 36, 0.2); filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5)); }
.level-btn.soft_limit.active { border-color: var(--level-soft-limit); background: rgba(251, 146, 60, 0.2); filter: drop-shadow(0 0 4px rgba(251, 146, 60, 0.5)); }
.level-btn.hard_limit.active { border-color: var(--level-hard-limit); background: rgba(239, 68, 68, 0.2); filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5)); }
.level-btn.clear.active { border-color: var(--text-muted); }

.level-icon {
    line-height: 1;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.toggle-details {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
}

.toggle-details:hover {
    border-color: var(--text-muted);
}

/* Preference Details */
.preference-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.details-row {
    margin-bottom: 0.75rem;
}

.details-row label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.details-row select,
.details-row textarea {
    width: 100%;
    max-width: 300px;
}

.details-row textarea {
    max-width: 100%;
    min-height: 60px;
    resize: vertical;
}

/* Save Indicator */
.save-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    pointer-events: none;
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.save-indicator .saving,
.save-indicator .saved {
    display: none;
}

.save-indicator.is-saving .saving { display: inline; }
.save-indicator.is-saved .saved { display: inline; color: var(--success); }

/* ============================================
   Redesigned Preference Cards
   ============================================ */

/* Preference Card - New Design */
.preference-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.pref-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.pref-title-area {
    flex: 1;
}

.pref-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--text);
}

.pref-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Direction Sections */
.pref-direction-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.direction-block {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.direction-block .direction-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.desire-row,
.experience-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.desire-row:last-child,
.experience-row:last-child {
    margin-bottom: 0;
}

.row-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

/* Experience Slider */
.experience-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.exp-label-left,
.exp-label-right {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.experience-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #f97316, #f59e0b, #eab308, #84cc16, #22c55e);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.experience-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--thumb-color, #eab308);
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
}

.experience-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.experience-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.experience-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--thumb-color, #eab308);
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
}

/* Visibility Control */
.visibility-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visibility-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.visibility-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.visibility-btn:hover {
    border-color: var(--primary);
    background: rgba(129, 140, 248, 0.1);
}

.visibility-btn-small {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
}

.visibility-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    min-width: 180px;
    display: none;
}

.visibility-dropdown.show {
    display: block;
}

.vis-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: background 0.15s;
}

.vis-option:hover {
    background: rgba(129, 140, 248, 0.15);
}

.vis-option:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.vis-option:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.vis-opt-icon {
    font-size: 1rem;
}

/* Notes Section */
.pref-notes-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.notes-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.notes-textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    font-size: 0.9rem;
}

/* Specific People Modal */
.specific-people-modal {
    max-width: 450px;
    width: 90%;
}

.specific-people-modal .modal-body {
    max-height: 400px;
    overflow-y: auto;
}

.current-people-section,
.add-people-section {
    margin-bottom: 1.5rem;
}

.current-people-section h4,
.add-people-section h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.current-people-list,
.friends-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.person-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.person-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.person-name {
    flex: 1;
    font-size: 0.9rem;
}

.btn-remove-person {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.15s;
}

.btn-remove-person:hover {
    background: var(--danger);
    color: white;
}

.btn-add-person {
    padding: 0.35rem 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-add-person:hover {
    background: var(--primary-dark);
}

.empty-state {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

.error {
    padding: 1rem;
    text-align: center;
    color: var(--danger);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* Responsive adjustments for preference cards */
@media (max-width: 600px) {
    .desire-row,
    .experience-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .row-label {
        min-width: auto;
    }

    .experience-slider-wrapper {
        width: 100%;
    }

    .level-buttons {
        flex-wrap: wrap;
    }
}

/* Tablet */
@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .legend-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .legend-items {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Friends Page */
.friends-page {
    max-width: 800px;
    margin: 0 auto;
}

.friends-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.friends-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.friends-section h2 .badge {
    background-color: var(--danger);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

.friends-section h2 .count {
    color: var(--text-muted);
    font-weight: normal;
}

/* Invite Section */
.invite-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.invite-card {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.invite-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.invite-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.code-input-group {
    display: flex;
    gap: 0.5rem;
}

.code-input {
    font-family: monospace;
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
    max-width: 150px;
}

.generate-options {
    margin-bottom: 1rem;
}

.generate-options label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.generate-options select {
    max-width: 150px;
}

/* Active Codes */
.active-codes h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.codes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.code-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

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

.code-value {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    color: var(--primary);
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
}

.copy-btn:hover {
    opacity: 1;
}

.code-meta {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.revoke-btn {
    color: var(--text-muted);
}

.revoke-btn:hover {
    color: var(--danger);
}

/* Friends List */
.friends-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.friend-card.pending {
    border-left: 3px solid var(--warning);
}

.friend-card.blocked {
    opacity: 0.7;
}

.friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
}

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

.friend-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.friend-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    min-height: auto;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    border-color: var(--text-muted);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 150px;
    padding: 0.5rem 0;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
}

.dropdown-menu button:hover {
    background-color: var(--border);
}

.dropdown-menu button.danger {
    color: var(--danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 0.5rem;
}

/* Friends Footer */
.friends-footer {
    text-align: center;
    padding: 1rem;
}

.friends-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.friends-footer a:hover {
    color: var(--text);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.5rem;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

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

/* Tablet */
@media (min-width: 768px) {
    .invite-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Compare Page */
.compare-page {
    max-width: 900px;
    margin: 0 auto;
}

/* Compatibility Card */
.compatibility-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #1a1f35 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.compat-score {
    margin-bottom: 1.5rem;
}

.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid var(--border);
}

.score-circle.high {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
}

.score-circle.medium {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.score-circle.low {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.15);
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.2);
}

.score-value {
    font-size: 2.5rem;
    font-weight: bold;
}

.score-circle.high .score-value { color: #4ade80; }
.score-circle.medium .score-value { color: #fbbf24; }
.score-circle.low .score-value { color: #f87171; }

.score-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.compat-breakdown {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.compat-stat {
    text-align: center;
    min-width: 80px;
}

.compat-stat .stat-count {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.compat-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.compat-stat.perfect .stat-count { color: #4ade80; }
.compat-stat.good .stat-count { color: #60a5fa; }
.compat-stat.potential .stat-count { color: #fbbf24; }
.compat-stat.mismatch .stat-count { color: #fb923c; }
.compat-stat.conflict .stat-count { color: #f87171; }

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

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-bar label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.filter-bar select {
    max-width: 250px;
}

/* Legend */
.compare-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-item.perfect .dot { background: #4ade80; box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }
.legend-item.good .dot { background: #60a5fa; box-shadow: 0 0 6px rgba(96, 165, 250, 0.5); }
.legend-item.potential .dot { background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, 0.5); }
.legend-item.mismatch .dot { background: #fb923c; box-shadow: 0 0 6px rgba(251, 146, 60, 0.5); }
.legend-item.conflict .dot { background: #f87171; box-shadow: 0 0 6px rgba(248, 113, 113, 0.5); }

/* Compare Sections */
.compare-section {
    margin-bottom: 1.5rem;
}

.compare-section.collapsed .compare-grid,
.compare-section.collapsed .section-desc {
    display: none;
}

.compare-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.section-title .icon {
    font-size: 1.25rem;
}

.section-title .count {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 0.9rem;
}

.section-title .toggle-icon {
    margin-left: auto;
    transition: transform 0.2s;
    color: var(--text-muted);
}

.section-title.perfect { color: #4ade80; }
.section-title.good { color: #60a5fa; }
.section-title.potential { color: #fbbf24; }
.section-title.mismatch { color: #fb923c; }
.section-title.conflict { color: #f87171; }
.section-title.one-sided { color: var(--text-muted); }

.section-title .icon {
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Compare Grid */
.compare-grid {
    display: grid;
    gap: 0.5rem;
}

.compare-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-left: 3px solid var(--border);
}

.compare-item.perfect { border-left-color: #22c55e; }
.compare-item.good { border-left-color: #3b82f6; }
.compare-item.potential { border-left-color: #f59e0b; }
.compare-item.mismatch { border-left-color: #f97316; }
.compare-item.conflict { border-left-color: #ef4444; background-color: rgba(239, 68, 68, 0.05); }
.compare-item.one-sided { opacity: 0.7; }

.item-name {
    font-weight: 500;
}

.item-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
}

.item-match-info {
    font-size: 0.75rem;
    color: var(--primary);
    font-style: italic;
    margin-top: 0.25rem;
}

.item-levels {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.1rem;
}

.level-divider {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* Multi-match cards */
.item-matches {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.match-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 4px;
    background: var(--bg);
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.match-row.perfect_match {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.3);
}
.match-row.good_match {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.3);
}
.match-row.potential {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
}
.match-row.mismatch {
    background: rgba(251, 146, 60, 0.15);
    border-color: rgba(251, 146, 60, 0.3);
}
.match-row.conflict {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
}
.match-row.one_sided {
    background: var(--bg);
    border-color: var(--border);
    opacity: 0.8;
}

.level-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.level-icon.me {
    /* My level icon on the left */
}

.level-icon.them {
    /* Their level icon on the right */
}

.match-direction {
    flex: 1;
    text-align: center;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
}

/* View Toggle */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.view-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--bg-hover);
}

.view-btn.active {
    background: var(--primary);
    color: white;
}

/* Detailed Comparison Table */
.compare-detailed {
    margin-top: 1rem;
}

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

.detailed-legend p {
    margin: 0 0 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.legend-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
}

.detailed-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.detailed-table th,
.detailed-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.detailed-table th {
    background: var(--bg-elevated);
    font-weight: 600;
    font-size: 0.9rem;
}

.detailed-table tr.subheader th {
    font-weight: normal;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
}

.detailed-table .pref-name {
    text-align: left;
    font-weight: 500;
}

.detailed-table .pref-category {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: normal;
}

.detailed-table .level-cell,
.detailed-table .mutual-cell {
    font-size: 1.2rem;
}

.detailed-table tbody tr:hover {
    background: var(--bg-hover);
}

.detailed-table tbody tr:last-child td {
    border-bottom: none;
}

/* Mutual Page */
.mutual-summary {
    text-align: center;
    margin-bottom: 2rem;
}

.mutual-summary .stat-value {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
}

.mutual-summary .stat-label {
    color: var(--text-muted);
}

.category-header {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.category-header:first-of-type {
    margin-top: 0;
}

.mutual-grid {
    display: grid;
    gap: 0.75rem;
}

.mutual-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    border-left: 3px solid #3b82f6;
}

.mutual-item.perfect {
    border-left-color: #22c55e;
}

.mutual-item .item-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.mutual-item .item-name {
    font-weight: 500;
}

.match-badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background-color: var(--bg);
    border-radius: 4px;
}

.mutual-item .item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.mutual-item .item-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
}

.direction-label {
    display: block;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Conflicts Page */
.conflict-warning {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.conflicts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.conflict-item {
    background-color: var(--bg-card);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 1rem;
}

.conflict-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.conflict-item .item-name {
    font-weight: 500;
}

.category-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background-color: var(--bg);
    border-radius: 4px;
    color: var(--text-muted);
}

.conflict-item .item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.conflict-levels {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.level-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.level-row.has-limit {
    background-color: rgba(239, 68, 68, 0.1);
}

.empty-state.success {
    color: #22c55e;
}

/* Page Actions */
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
    justify-content: center;
}

/* Tablet */
@media (min-width: 768px) {
    .compare-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mutual-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================
   MESSAGING SYSTEM
   =================== */

/* Messages Index (Inbox) */
.messages-page .page-header {
    margin-bottom: 1.5rem;
}

/* Messages Search */
.messages-search {
    margin-bottom: 1rem;
}

.messages-search .search-form {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* Filter Tabs */
.messages-filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius) var(--radius) 0 0;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.filter-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.filter-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    font-weight: 500;
}

.archive-count {
    display: inline-block;
    background: var(--text-muted);
    color: var(--bg);
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.3rem;
}

.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Conversation Row (wrapper for item + archive button) */
.conversation-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    transition: opacity 0.3s, transform 0.3s;
}

.conversation-row .conversation-item {
    flex: 1;
}

.archive-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.archive-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(129, 140, 248, 0.1);
}

.archive-btn svg {
    width: 18px;
    height: 18px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.conversation-item:hover {
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.conversation-item.unread {
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.1);
}

.convo-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.convo-details {
    flex: 1;
    min-width: 0;
}

.convo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.convo-name {
    font-weight: 600;
    color: var(--text);
}

.convo-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.convo-preview {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    background-color: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Unread messages divider */
.unread-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
}

.unread-divider::before,
.unread-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--primary);
    opacity: 0.5;
}

.unread-divider span {
    white-space: nowrap;
}

/* Conversation Page */
.conversation-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
}

.conversation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    color: var(--text);
    text-decoration: none;
    font-size: 1.5rem;
    padding: 0.25rem;
}

.convo-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.user-name {
    font-weight: 600;
}

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

.action-btn {
    padding: 0.5rem;
    color: var(--text-muted);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.action-btn:hover {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.1);
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-messages {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.message {
    display: flex;
    max-width: 80%;
}

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 100%;
}

.message.sent .message-bubble {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message.received .message-bubble {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 0.25rem;
}

.message-content {
    word-wrap: break-word;
    line-height: 1.4;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    text-align: right;
}

/* Message Form */
.message-form {
    padding: 1rem;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.message-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 0.5rem 0.75rem;
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1rem;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
}

.message-input:focus {
    outline: none;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    color: var(--primary-dark);
}

.send-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Formatting Toolbar */
.format-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
    flex-wrap: wrap;
}

.format-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.format-btn:hover {
    background-color: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
}

.format-btn:active {
    background-color: var(--primary);
    color: white;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border);
    margin: 0 0.25rem;
}

.color-picker {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    cursor: pointer;
    background: none;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Message form with toolbar */
.message-form .message-input-wrapper {
    border-radius: 0 0 1.5rem 1.5rem;
}

.message-form:has(.format-toolbar) .message-input-wrapper {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Image Preview */
.image-preview-container {
    padding: 0.5rem;
    background-color: var(--bg);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.image-preview {
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 150px;
    max-height: 100px;
    border-radius: 0.5rem;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: 2px solid var(--bg);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-image-btn:hover {
    background: #dc2626;
}

/* Message Content Formatting */
.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

.message-content .msg-heading {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 0.25em;
    display: block;
}

.message-content .msg-color {
    /* color set inline */
}

.message-content .msg-checkbox {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 3px;
    margin-right: 0.35em;
    vertical-align: middle;
    position: relative;
}

.message-content .msg-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    font-size: 12px;
}

.message-content ul.msg-list,
.message-content ol.msg-list {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.message-content ul.msg-list li,
.message-content ol.msg-list li {
    margin: 0.25em 0;
}

/* Message Image */
.message-image {
    margin-bottom: 0.5rem;
}

.message-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image img:hover {
    transform: scale(1.02);
}

/* Preference Comparison Cards in Messages */
.preference-card {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.pref-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--primary);
}

.pref-comparison {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pref-user {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.pref-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.pref-levels {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
}

.pref-level {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}

.pref-level.level-enthusiastic {
    background: rgba(248, 113, 113, 0.2);
    color: var(--level-enthusiastic);
}

.pref-level.level-curious {
    background: rgba(251, 191, 36, 0.2);
    color: var(--level-curious);
}

.pref-level.level-willing {
    background: rgba(74, 222, 128, 0.2);
    color: var(--level-willing);
}

.pref-level.level-soft_limit,
.pref-level.level-soft-limit {
    background: rgba(251, 146, 60, 0.2);
    color: var(--level-soft-limit);
}

.pref-level.level-hard_limit,
.pref-level.level-hard-limit {
    background: rgba(239, 68, 68, 0.2);
    color: var(--level-hard-limit);
}

.pref-vs {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

/* Preference Picker */
.pref-picker-content {
    max-height: 70vh;
}

.pref-group {
    margin-bottom: 1.5rem;
}

.pref-group h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pref-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pref-picker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: border-color 0.2s, background-color 0.2s;
}

.pref-picker-item:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.pref-item-name {
    font-weight: 500;
    flex: 1;
}

.pref-item-levels {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
}

.pref-item-levels .level-tag {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.pref-item-levels .vs {
    color: var(--text-muted);
    margin: 0 0.25rem;
}

/* Attached Preference */
.attached-preference {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.attached-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--primary);
}

.remove-attached {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.remove-attached:hover {
    color: var(--danger);
}

/* Attach button */
.attach-pref-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-pref-btn:hover {
    color: var(--primary);
}

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

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Preference tags in messages */
.pref-tag {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Picker hint */
.picker-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
    font-style: italic;
}

/* Selected state for picker items */
.pref-picker-item.selected {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--success);
}

/* Inline preference cards */
.preference-card.inline-card {
    display: block;
    margin: 0.5rem 0;
}

.message-content {
    word-wrap: break-word;
}

/* Better contrast for inline cards */
.preference-card.inline-card {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    color: var(--text);
}

.preference-card .pref-name {
    color: var(--text);
}

.preference-card .pref-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    opacity: 0.8;
}

.preference-card .pref-label {
    color: var(--text);
}

.preference-card .pref-levels {
    color: var(--text);
}

/* Make cards stand out in both sent and received messages */
.message.sent .preference-card,
.message.received .preference-card {
    background: var(--bg);
    border: 1px solid var(--primary);
}

/* Force colors on all preference levels */
.preference-card .pref-level {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.1rem;
    cursor: help;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

/* Direction labels - hidden in compact mode */
.dir-label {
    display: none;
}

/* Ensure level colors work properly with high contrast */
.preference-card .pref-level.level-enthusiastic {
    background: rgba(248, 113, 113, 0.25);
    color: var(--level-enthusiastic);
    filter: drop-shadow(0 0 3px rgba(248, 113, 113, 0.4));
}

.preference-card .pref-level.level-willing {
    background: rgba(74, 222, 128, 0.25);
    color: var(--level-willing);
    filter: drop-shadow(0 0 3px rgba(74, 222, 128, 0.4));
}

.preference-card .pref-level.level-curious {
    background: rgba(251, 191, 36, 0.25);
    color: var(--level-curious);
    filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.4));
}

.preference-card .pref-level.level-soft_limit {
    background: rgba(251, 146, 60, 0.25);
    color: var(--level-soft-limit);
    filter: drop-shadow(0 0 3px rgba(251, 146, 60, 0.4));
}

.preference-card .pref-level.level-hard_limit {
    background: rgba(239, 68, 68, 0.25);
    color: var(--level-hard-limit);
    filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.4));
}

/* Modal search box */
.modal-search {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-search input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
}

.modal-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.more-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.autocomplete-item {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(99, 102, 241, 0.15);
}

.ac-name {
    font-weight: 500;
    color: var(--text);
}

.ac-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Consent Checklist Page */
.checklist-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.checklist-header {
    margin-bottom: 2rem;
}

.checklist-header h1 {
    font-size: 1.5rem;
    margin: 1rem 0 0.5rem;
}

.checklist-header .subtitle {
    color: var(--text-muted);
}

/* Summary Stats */
.consent-summary {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat {
    padding: 0.5rem 1rem;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat.complete .stat-number {
    color: var(--success);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.all-consented {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--success);
    border-radius: var(--radius);
    text-align: center;
    color: var(--success);
    font-weight: 500;
}

.all-consented .checkmark {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Legend */
.checklist-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid var(--border);
}

.legend-box.unchecked {
    background: transparent;
}

.legend-box.partial {
    background: rgba(245, 158, 11, 0.3);
    border-color: var(--warning);
}

.legend-box.full {
    background: rgba(34, 197, 94, 0.3);
    border-color: var(--success);
}

/* Checklist Table */
.checklist-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.checklist-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.9rem;
}

.consent-col {
    width: 100px;
    text-align: center !important;
}

.status-col {
    width: 100px;
    text-align: center !important;
}

.user-label {
    font-size: 0.8rem;
}

/* Consent Checkbox */
.consent-checkbox {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--success);
    transition: all 0.2s;
}

.consent-checkbox:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.consent-checkbox.checked {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.2);
}

.consent-indicator {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.consent-indicator.checked {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

/* Row Status */
.checklist-row.mutual {
    background: rgba(34, 197, 94, 0.05);
}

.checklist-row.partial {
    background: rgba(245, 158, 11, 0.05);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.ready {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.status-badge.waiting {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.status-badge.action {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.status-badge.pending {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

/* Actions */
.checklist-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Checklist link in messages */
.checklist-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    color: var(--primary);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
}

.checklist-link:hover {
    background: rgba(99, 102, 241, 0.25);
}

/* Shared Preference Card Styling */
.preference-card.shared-pref {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.shared-pref-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.add-pref-btn {
    font-size: 0.85rem !important;
    padding: 0.5rem 1rem !important;
}

.pref-level.level-none {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
    font-style: italic;
}

/* Add Preference Modal */
.add-pref-content {
    max-width: 450px;
}

.add-pref-intro {
    margin-bottom: 1.5rem;
    color: var(--text);
}

.add-pref-intro strong {
    color: var(--primary);
}

.rating-section {
    margin-bottom: 1.25rem;
}

.rating-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.rating-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rating-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.rating-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.rating-btn.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.visibility-note {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.visibility-note p {
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Message Images */
.message-image {
    margin-bottom: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.message-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    cursor: pointer;
}

.message-image img:hover {
    opacity: 0.9;
}

/* Image lightbox */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.image-lightbox img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

/* Conversation title in message list */
.convo-title {
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-style: italic;
}

/* Conversation header title */
.convo-user .user-info {
    display: flex;
    flex-direction: column;
}

.convo-user .convo-title-header {
    font-size: 0.75rem;
    color: var(--primary);
    font-style: italic;
    opacity: 0.9;
}

/* Dashboard notification badges */
.dashboard-card.has-notification {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.dashboard-card .card-icon {
    position: relative;
}

.dashboard-card .notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

/* Friends page message badges */
.friend-card.has-unread {
    border-left: 3px solid var(--primary);
}

.friend-actions .message-btn {
    position: relative;
}

.friend-actions .message-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Nav unread message badge */
.nav-messages {
    position: relative;
}

.unread-count-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ========================================
   GROUP CONVERSATIONS
   ======================================== */

/* Avatar Stack */
.avatar-stack {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.user-avatar.stacked {
    margin-right: -12px;
    border: 2px solid var(--bg-card);
}

.user-avatar.stacked:last-child {
    margin-right: 0;
}

.user-avatar.more-count {
    background-color: var(--secondary);
    font-size: 0.7rem;
}

/* Small/Tiny Avatars */
.user-avatar.small {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.user-avatar.tiny {
    width: 20px;
    height: 20px;
    font-size: 0.6rem;
}

/* Group Conversation Header */
.group-header .convo-user {
    flex: 1;
}

.group-header .group-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.participant-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

/* Group Warning Banner */
.group-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning);
    color: var(--warning);
    padding: 0.5rem 1rem;
    margin: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
}

/* Pending Requests Banner */
.pending-requests-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    margin: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.pending-requests-banner a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Participants Side Panel */
.participants-panel {
    display: none; /* Hidden by default on mobile */
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 1rem;
    width: 200px;
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 80px;
    overflow-y: auto;
    z-index: 50;
}

.participants-panel h4 {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

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

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

.participant-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.participant-name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.you-badge {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 0.8em;
}

/* Group Messages - Sender Info */
.group-conversation-page .message.received {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.message-sender-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.message-content-wrapper {
    max-width: 75%;
}

.message-sender-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    margin-left: 0.5rem;
}

/* ========================================
   GROUP CONSENT / CHECKLIST
   ======================================== */

.group-checklist-page .checklist-header {
    padding: 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.checklist-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Participant Legend */
.participant-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}

/* Group Summary */
.group-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    margin-bottom: 1rem;
    border-radius: var(--radius);
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    min-width: 60px;
}

.summary-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-stat .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.summary-stat.agreed .stat-value { color: var(--success); }
.summary-stat.conflict .stat-value { color: var(--danger); }
.summary-stat.negotiating .stat-value { color: var(--warning); }
.summary-stat.pending .stat-value { color: var(--text-muted); }

/* Add Item Section */
.add-item-section {
    padding: 0 1rem 1rem;
    text-align: center;
}

/* Group Consent Item */
.group-consent-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0 1rem 1rem;
    border-left: 4px solid var(--border);
}

.group-consent-item.pending { border-left-color: var(--text-muted); }
.group-consent-item.negotiating { border-left-color: var(--warning); }
.group-consent-item.conflict { border-left-color: var(--danger); }
.group-consent-item.agreed { border-left-color: var(--success); }
.group-consent-item.finalized {
    border-left-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.consent-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.preference-name {
    font-weight: 600;
    font-size: 1rem;
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.status-badge.status-pending { background: var(--secondary); color: white; }
.status-badge.status-negotiating { background: var(--warning); color: #000; }
.status-badge.status-conflict { background: var(--danger); color: white; }
.status-badge.status-agreed { background: var(--success); color: white; }

/* Participant Responses Row */
.participant-responses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.participant-response {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.response-icon {
    font-size: 0.9rem;
}

.response-icon.yes { color: var(--success); }
.response-icon.no { color: var(--danger); }
.response-icon.negotiate { color: var(--warning); }
.response-icon.pending { color: var(--text-muted); }

/* My Response Section */
.my-response-section {
    margin-bottom: 1rem;
}

.my-response-section label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.response-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.response-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.response-btn:hover {
    border-color: var(--primary);
}

.response-btn.active[data-response="yes"] {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.response-btn.active[data-response="negotiate"] {
    background: var(--warning);
    border-color: var(--warning);
    color: #000;
}

.response-btn.active[data-response="no"] {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Note Section */
.note-section {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.note-input {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    min-height: 60px;
    resize: vertical;
}

/* Other Notes */
.other-notes {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.other-notes label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.other-note {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.other-note:last-child {
    margin-bottom: 0;
}

/* Discussion Section */
.discussion-section {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.toggle-discussion {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
}

.toggle-discussion:hover {
    text-decoration: underline;
}

.discussion-thread {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.comments-list {
    margin-bottom: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.comment {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.comment-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.add-comment {
    display: flex;
    gap: 0.5rem;
}

.comment-input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
}

/* Unlock Section */
.unlock-section {
    margin-top: 0.75rem;
    text-align: center;
}

/* ========================================
   GROUP MANAGEMENT PAGE
   ======================================== */

.group-manage-page {
    padding: 1rem;
}

.group-manage-page .page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.group-info-section {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.group-info-section h2 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.group-info-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.manage-section {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.manage-section h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.manage-section h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Participants List */
.participants-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.participant-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.participant-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.participant-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

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

.role-select {
    padding: 0.25rem 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.8rem;
}

/* Invite Section */
.invite-subsection {
    margin-bottom: 1.5rem;
}

.invite-subsection:last-child {
    margin-bottom: 0;
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.muted {
    color: var(--text-muted);
    font-style: italic;
}

.friend-invite-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.friend-invite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.generate-code-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.generate-code-form label {
    font-size: 0.85rem;
}

.generate-code-form select {
    padding: 0.35rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    margin-left: 0.5rem;
}

/* Active Codes */
.active-codes {
    margin-top: 1rem;
}

.active-codes h5 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

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

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

.invite-code {
    font-family: monospace;
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.code-info {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Requests List */
.requests-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.request-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.request-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.request-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.request-time {
    font-size: 0.7rem !important;
}

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

/* Use Code Form */
.use-code-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.use-code-form input {
    flex: 1;
    max-width: 200px;
}

/* ========================================
   NEW GROUP PAGE
   ======================================== */

.new-group-page {
    padding: 1rem;
}

.new-group-page .page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.group-form {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
}

.friends-select-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.friend-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.friend-checkbox:hover {
    background: var(--border);
}

.friend-checkbox input {
    display: none;
}

.friend-checkbox .friend-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.friend-checkbox .checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.friend-checkbox input:checked + .friend-info + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.friend-checkbox input:checked + .friend-info + .checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
}

.selected-count {
    text-align: center;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.selected-count #count-value {
    font-weight: 700;
    color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
}

.search-result-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover {
    background: var(--border);
}

.result-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.no-results {
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ========================================
   INBOX GROUP CONVERSATION ITEMS
   ======================================== */

.convo-item.group-convo .convo-avatar-section {
    position: relative;
}

.convo-item .mini-avatar-stack {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.convo-item .mini-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--bg-card);
    margin-right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.5rem;
    font-weight: 600;
}

.convo-item .group-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--primary);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convo-item .group-indicator svg {
    width: 10px;
    height: 10px;
    color: white;
}

/* Messages Actions */
.messages-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.messages-actions .btn {
    display: inline-flex;
    align-items: center;
}

.participant-count-inline {
    font-size: 0.8em;
    color: var(--text-muted);
    font-weight: normal;
}

/* Conversation item with group avatar */
.convo-avatar-section {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (min-width: 768px) {
    .participants-panel {
        display: block;
    }

    .group-conversation-page .messages-container {
        margin-right: 200px;
    }
}

/* ========================================
   PREFERENCE PICKER MODAL
   ======================================== */

.preference-picker-modal {
    max-width: 500px;
    width: 95%;
    max-height: 80vh;
}

.preference-picker-modal .modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preference-search {
    margin-bottom: 0.75rem;
}

.preference-search input {
    width: 100%;
}

.preference-results {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.search-hint,
.search-error {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.search-error {
    color: var(--danger);
}

/* Preference Card in picker */
.pref-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pref-card:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.pref-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.pref-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.pref-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

/* Participant levels in picker */
.pref-participant-levels {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pref-participant-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.pref-participant-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.7rem;
}

.pref-participant-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pref-levels-display {
    display: flex;
    gap: 0.25rem;
}

.pref-level {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
}

.pref-level.none {
    background: var(--border);
    color: var(--text-muted);
}

.pref-level.giving {
    /* Color set inline based on level */
}

.pref-level.receiving {
    /* Color set inline based on level */
}

/* Search results with preference cards in modal */
.modal .search-results {
    position: relative;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.modal .search-results .pref-card {
    margin-bottom: 0.75rem;
}

.modal .search-results .pref-card:last-child {
    margin-bottom: 0;
}

/* Tiny avatar for response indicators */
.user-avatar.tiny {
    width: 20px;
    height: 20px;
    min-width: 20px;
    font-size: 0.6rem;
}

/* Preference card embedded in messages */
.msg-preference-card {
    display: block;
    background: var(--bg);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin: 0.5rem 0;
    max-width: 300px;
}

.msg-preference-card .pref-card-loading {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.msg-preference-card .pref-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.msg-preference-card .pref-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
}

.msg-preference-card .pref-category {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.msg-preference-card .pref-participant-levels {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.msg-preference-card .pref-participant-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.msg-preference-card .pref-participant-avatar {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.6rem;
}

.msg-preference-card .pref-participant-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-preference-card .pref-levels-display {
    display: flex;
    gap: 0.2rem;
}

.msg-preference-card .pref-level {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: white;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.msg-preference-card .pref-level.none {
    background: var(--border);
    color: var(--text-muted);
}

/* ==========================================
   PROFILE PAGE STYLES
   ========================================== */

.profile-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.profile-avatar-section {
    flex-shrink: 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.profile-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.profile-meta .pronouns {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.profile-status {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

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

.profile-section h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.profile-bio,
.profile-looking-for {
    line-height: 1.6;
    color: var(--text);
}

.visibility-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 4px;
}

.profile-preferences {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pref-category h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
    color: var(--primary);
}

.pref-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pref-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text);
}

.pref-levels-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.pref-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pref-level {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.pref-level.level-enthusiastic {
    color: var(--level-enthusiastic);
    filter: drop-shadow(0 0 3px rgba(248, 113, 113, 0.4));
}
.pref-level.level-willing {
    color: var(--level-willing);
    filter: drop-shadow(0 0 3px rgba(74, 222, 128, 0.4));
}
.pref-level.level-curious {
    color: var(--level-curious);
    filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.4));
}
.pref-level.level-soft-limit,
.pref-level.level-soft_limit {
    color: var(--level-soft-limit);
    filter: drop-shadow(0 0 3px rgba(251, 146, 60, 0.4));
}
.pref-level.level-hard-limit,
.pref-level.level-hard_limit {
    color: var(--level-hard-limit);
    filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.4));
}

.pref-name {
    color: var(--text);
}

.pref-direction {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.profile-visibility-info {
    background: rgba(99, 102, 241, 0.05);
}

.profile-visibility-info p {
    margin: 0 0 0.75rem 0;
}

/* Profile Edit Page */
.profile-edit-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.profile-edit-page .page-header {
    margin-bottom: 1.5rem;
}

.profile-edit-page .back-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.25rem;
}

.profile-edit-page h1 {
    margin: 0.5rem 0 0 0;
}

.profile-form .form-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.profile-form .form-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.profile-form .form-group label {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.profile-form .help-text {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.profile-form .help-text a {
    color: var(--primary);
}

.profile-form .form-control {
    color: var(--text);
    background-color: var(--bg);
    border-color: var(--border);
}

.profile-form .form-control::placeholder {
    color: #64748b;
}

.profile-form select.form-control option {
    background-color: var(--bg-card);
    color: var(--text);
}

.avatar-upload {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.current-avatar .avatar-img,
.current-avatar .avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.current-avatar .avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 2rem;
}

.avatar-status {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.avatar-controls .help-text {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0.5rem 0 0 0;
}

.avatar-controls .btn {
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-form .form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-actions {
        width: 100%;
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .avatar-upload {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================
   BROWSE PROFILES PAGE
   ========================================== */

.browse-profiles-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

.browse-profiles-page .page-header {
    margin-bottom: 1.5rem;
}

.browse-profiles-page .page-header h1 {
    margin: 0 0 0.25rem 0;
}

.browse-profiles-page .subtitle {
    color: var(--text-muted);
    margin: 0;
}

.search-section {
    margin-bottom: 1.5rem;
}

.search-form .search-input-group {
    display: flex;
    gap: 0.5rem;
}

.search-form .form-control {
    flex: 1;
}

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

.profile-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.1s;
    overflow: hidden;
}

.profile-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.profile-card-header {
    position: relative;
    padding: 1rem;
    display: flex;
    justify-content: center;
    background: rgba(99, 102, 241, 0.05);
}

.profile-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-card-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 1.75rem;
    font-weight: 600;
}

.profile-card .friend-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--success);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.profile-card-body {
    padding: 1rem;
    flex: 1;
}

.profile-card-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.profile-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.profile-card-meta .meta-pronouns {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.profile-card-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.profile-card-bio {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.profile-card-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.view-profile-link {
    font-size: 0.85rem;
    color: var(--primary);
}

/* Friend name link in friends list */
.friend-name-link {
    color: var(--text);
    text-decoration: none;
}

.friend-name-link:hover {
    color: var(--primary);
}

@media (max-width: 600px) {
    .search-form .search-input-group {
        flex-direction: column;
    }

    .profiles-grid {
        grid-template-columns: 1fr;
    }
}

/* AI Scene Generation Section */
.ai-generation-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.ai-generation-section h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: 1.1rem;
}

.ai-generation-section .hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.generation-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.generation-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.generation-buttons .btn svg {
    flex-shrink: 0;
}

.generation-buttons .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* AI Content Modal */
.ai-content-modal {
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.ai-content-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.ai-content-modal .ai-model-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: var(--radius);
    text-align: center;
}

.ai-content-modal .ai-generated-content {
    line-height: 1.7;
    color: var(--text);
}

.ai-content-modal .ai-generated-content h2 {
    margin: 1.5rem 0 1rem;
    color: var(--primary);
    font-size: 1.3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.ai-content-modal .ai-generated-content h3 {
    margin: 1.2rem 0 0.8rem;
    color: var(--text);
    font-size: 1.1rem;
}

.ai-content-modal .ai-generated-content h4 {
    margin: 1rem 0 0.6rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.ai-content-modal .ai-generated-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.ai-content-modal .ai-generated-content li {
    margin: 0.3rem 0;
}

.ai-content-modal .ai-generated-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.ai-content-modal .ai-generated-content .checkbox {
    font-family: monospace;
    color: var(--warning);
}

.ai-content-modal .ai-generated-content .checkbox.checked {
    color: var(--success);
}

.ai-content-modal .ai-generated-content strong {
    color: var(--primary);
}

.ai-content-modal .ai-generated-content em {
    font-style: italic;
    color: var(--text-muted);
}

.ai-content-modal .modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
    .generation-buttons {
        flex-direction: column;
    }

    .generation-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .ai-content-modal {
        max-width: 100%;
        margin: 0.5rem;
    }
}

/* Model selector styling */
.generation-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.model-selector label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.model-selector select {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.model-selector select:focus {
    outline: none;
    border-color: var(--primary);
}

@media (min-width: 600px) {
    .generation-controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Profile Message Section */
.profile-message-section {
    margin: 1.5rem 0;
}

.message-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.message-form-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

.message-form-card .hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.message-form-card .form-group {
    margin-bottom: 1rem;
}

.message-form-card label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
}

.message-form-card input,
.message-form-card textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
}

.message-form-card input:focus,
.message-form-card textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.message-form-card textarea {
    resize: vertical;
    min-height: 100px;
}

.message-form-card .char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.message-form-card .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.message-form-card .success-message {
    text-align: center;
    padding: 2rem;
}

.message-form-card .success-message .checkmark {
    display: block;
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 1rem;
}

.message-form-card .success-message p {
    color: var(--text);
    font-size: 1.1rem;
}

/* ==========================================
   CONSENT SHEETS PAGE
   ========================================== */

.consent-sheets-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.consent-sheets-page .page-header {
    margin-bottom: 2rem;
}

.consent-sheets-page .page-header h1 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

.consent-sheets-page .subtitle {
    color: #e2e8f0;
    margin: 0;
}

.start-new-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.start-new-section h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    color: var(--text);
}

.start-sheet-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.start-sheet-form .form-group {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.start-sheet-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.existing-sheets-section h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    color: var(--text);
}

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

.sheet-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    display: block;
}

.sheet-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.sheet-card.complete {
    border-color: var(--success);
}

.sheet-card.has-declined {
    border-color: var(--warning);
}

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

.partner-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.partner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.partner-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.partner-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
}

.sheet-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.sheet-status.pending {
    background: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

.sheet-status.in-progress {
    background: rgba(96, 165, 250, 0.25);
    color: #93c5fd;
}

.sheet-status.complete {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.sheet-status.has-declined {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.sheet-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sheet-stats .stat-row {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sheet-stats .stat-label {
    font-size: 0.75rem;
    color: #cbd5e1;
}

.sheet-stats .stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.sheet-stats .stat-row.agreed .stat-value {
    color: #4ade80;
}

.sheet-stats .stat-row.declined .stat-value {
    color: #f87171;
}

.sheet-stats .stat-row.finalized .stat-value {
    color: var(--primary);
}

.sheet-card .progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.sheet-card .progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.3s;
}

.sheet-card .progress-text {
    font-size: 0.8rem;
    color: #cbd5e1;
    text-align: center;
    margin-bottom: 0.75rem;
}

.sheet-footer {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.last-activity {
    font-size: 0.8rem;
    color: #cbd5e1;
}

.no-sheets {
    text-align: center;
    padding: 3rem 1rem;
}

.no-sheets p {
    color: var(--text);
}

.no-sheets .hint {
    color: #cbd5e1;
    margin-top: 0.5rem;
}

.consent-sheets-page .empty-state {
    color: var(--text);
}

.consent-sheets-page .empty-state p {
    color: #e2e8f0;
    margin-bottom: 1rem;
}

/* ========== Wardrobe Picker Modal ========== */
.wardrobe-picker-content {
    max-width: 600px;
    max-height: 85vh;
}

.wardrobe-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
}

.wardrobe-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.wardrobe-tab:hover {
    color: var(--text);
}

.wardrobe-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.wardrobe-section {
    margin-bottom: 1.5rem;
}

.wardrobe-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wardrobe-section-title .section-icon {
    font-size: 1rem;
}

.wardrobe-section-title .section-count {
    font-weight: normal;
    opacity: 0.7;
}

.wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.wardrobe-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.wardrobe-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.wardrobe-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.3);
}

.wardrobe-card-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.wardrobe-card-placeholder {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    font-size: 2rem;
}

.wardrobe-card-info {
    padding: 0.5rem;
}

.wardrobe-card-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wardrobe-card-subtitle {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.wardrobe-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: rgba(99, 102, 241, 0.1);
}

.selection-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selection-icon {
    font-size: 1.25rem;
}

.selection-name {
    font-weight: 500;
}

.empty-wardrobe {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ========== Wardrobe Embed in Messages ========== */
.wardrobe-embed {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    margin: 0.25rem 0;
    transition: background-color 0.2s;
}

.wardrobe-embed:hover {
    background: rgba(99, 102, 241, 0.25);
    text-decoration: none;
    color: var(--text);
}

.wardrobe-embed-icon {
    font-size: 1.1rem;
}

.wardrobe-embed-photo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.wardrobe-embed-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wardrobe-embed-name {
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.2;
}

.wardrobe-embed-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
