/* Crystal Dating App - Styles */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Crystal Color Palette - Based on official branding */
    --crystal-blue: #00BCD4;
    --crystal-light: #4DD0E1;
    --crystal-dark: #0288D1;
    --heart-red: #FF4081;
    --heart-dark: #C2185B;

    /* Legacy color names for compatibility */
    --crystal-primary: #00BCD4;
    --crystal-secondary: #4DD0E1;
    --crystal-accent: #FF4081;
    --crystal-success: #10b981;
    --crystal-warning: #f59e0b;
    --crystal-danger: #ef4444;

    --bg-primary: #0A0E27; /* Darker blue matching brand */
    --bg-secondary: #1a1a3e;
    --bg-card: #334155;
    --text-primary: #E8F4FD; /* Lighter text from brand */
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-radius: 16px;
    --spacing: 1rem;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Crystal Shimmer Overlay - Brand Enhancement */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background:
        linear-gradient(135deg, transparent 30%, rgba(77, 208, 225, 0.05) 50%, transparent 70%),
        linear-gradient(45deg, transparent 30%, rgba(0, 188, 212, 0.03) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Header */
header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.crystal-icon {
    font-size: 2rem;
    animation: crystal-float 4s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0, 188, 212, 0.4));
    transition: transform 0.3s ease;
}

.crystal-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

@keyframes crystal-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}

header h1 {
    font-size: 1.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--crystal-blue), var(--heart-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 3px rgba(0, 188, 212, 0.3));
    }
    to {
        filter: drop-shadow(0 0 8px rgba(255, 64, 129, 0.4));
    }
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Main Content */
main {
    padding: 2rem 0;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.mode-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--crystal-light);
    color: var(--crystal-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--crystal-blue), var(--crystal-dark));
    color: white;
    border-color: var(--crystal-blue);
    box-shadow: 0 5px 20px rgba(0, 188, 212, 0.4);
}

.mode-btn .icon {
    font-size: 1.2rem;
}

/* User Selector */
.user-selector {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.user-selector label {
    margin-right: 0.5rem;
    color: var(--text-secondary);
}

.user-selector select {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--crystal-primary);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Stats Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--crystal-primary);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--crystal-primary);
    margin-bottom: 0.25rem;
}

.stat-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Profile Container */
.profile-container {
    max-width: 500px;
    margin: 0 auto 2rem;
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 188, 212, 0.2);
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0, 188, 212, 0.3);
    border-color: var(--crystal-light);
}

.profile-image {
    height: 500px; /* Taller like Tinder */
    background: linear-gradient(135deg, var(--crystal-primary), var(--crystal-secondary));
    display: flex;
    align-items: flex-end; /* Align content to bottom like Tinder */
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

/* Gradient overlay for better text readability (Tinder style) */
.profile-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    pointer-events: none;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Name and location overlay on image (Tinder style) */
.profile-image-overlay {
    position: relative;
    z-index: 10;
    padding: 1.5rem;
    color: white;
    width: 100%;
}

.profile-image-overlay h2 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.profile-image-overlay h2 .age {
    font-weight: 400;
    font-size: 1.5rem;
}

.profile-image-overlay .location {
    font-size: 1rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.profile-info {
    padding: 1.5rem;
}

.profile-info h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.profile-details {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.profile-bio {
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    border-left: 3px solid var(--crystal-primary);
}

/* Info icons (Bumble style) */
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 10px;
    transition: var(--transition);
}

.info-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.info-icon {
    font-size: 1.5rem;
    min-width: 32px;
    text-align: center;
}

.info-text {
    flex: 1;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Compatibility Badge */
.compatibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--crystal-success), var(--crystal-primary));
    border-radius: 50px;
    margin-bottom: 1rem;
}

.compat-score {
    font-size: 1.5rem;
    font-weight: 700;
}

.compat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Preference Indicators */
.preference-indicators {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pref-badge, .fringe-badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pref-badge {
    background: var(--crystal-primary);
}

.fringe-badge {
    background: var(--crystal-secondary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Profile Tags */
.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Swipe Buttons */
.swipe-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
}

.swipe-btn {
    padding: 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.swipe-btn .btn-icon {
    font-size: 2rem;
}

.swipe-btn.pass {
    background: var(--danger);
    color: white;
}

.swipe-btn.pass:hover {
    background: #dc2626;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}

.swipe-btn.like {
    background: linear-gradient(135deg, var(--heart-red), var(--heart-dark));
    color: white;
}

.swipe-btn.like:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 64, 129, 0.5);
    transform: scale(1.05);
}

/* No More Profiles */
.no-more-profiles {
    text-align: center;
    padding: 3rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.refresh-btn {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: var(--crystal-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.refresh-btn:hover {
    background: var(--crystal-secondary);
    transform: translateY(-2px);
}

/* Match Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.match-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.match-users {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.match-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--crystal-primary);
}

.match-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.match-heart {
    font-size: 2rem;
    animation: heartbeat 1s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.primary-btn {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: var(--crystal-accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.primary-btn:hover {
    background: #db2777;
    transform: translateY(-2px);
}

/* Algorithm Info */
.algorithm-info {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.algorithm-info h3 {
    margin-bottom: 1.5rem;
    color: var(--crystal-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border-left: 4px solid var(--crystal-primary);
}

.info-card h4 {
    margin-bottom: 0.75rem;
    color: var(--crystal-accent);
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-card em {
    color: var(--crystal-primary);
    font-style: normal;
    font-weight: 600;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid rgba(99, 102, 241, 0.3);
}

footer p {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .mode-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-image {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .stats-dashboard {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Modular Crystal shell
   ------------------------------------------------------------
   New app UI layer for index.html. Legacy login/onboarding pages
   still use the older selectors above.
   ============================================================ */

body:has(.app-shell) {
    background:
        linear-gradient(180deg, rgba(10, 14, 39, 0.98), rgba(18, 24, 49, 0.98)),
        linear-gradient(90deg, rgba(0, 188, 212, 0.18), rgba(255, 64, 129, 0.12));
    color: #eef7fb;
    overflow: hidden;
}

body:has(.app-shell)::before {
    display: none;
}

button,
select,
input,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

.crystal-shell-root {
    min-height: 100vh;
}

.app-loading {
    min-height: 100vh;
    display: grid;
    place-items: center;
    gap: 16px;
    text-align: center;
}

.app-loading-logo {
    width: 88px;
    height: 88px;
}

.app-loading span {
    display: block;
    color: #a9c8d4;
    font-size: 0.92rem;
    margin-top: 4px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-width: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(0, 188, 212, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 64, 129, 0.15) 0%, transparent 40%),
        linear-gradient(120deg, rgba(0, 188, 212, 0.05), transparent 34%),
        linear-gradient(300deg, rgba(255, 64, 129, 0.05), transparent 30%);
    backdrop-filter: blur(10px);
}

.app-sidebar {
    min-height: 100vh;
    min-width: 0;
    padding: 18px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 14, 39, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    z-index: 10;
}

.brand-lockup {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    min-height: 52px;
}

.brand-logo {
    width: 44px;
    height: 44px;
}

.brand-lockup strong,
.brand-lockup small {
    display: block;
}

.brand-lockup strong {
    font-size: 1.08rem;
    letter-spacing: 0;
}

.brand-lockup small {
    color: #a9c8d4;
    font-size: 0.78rem;
}

.side-nav {
    display: grid;
    gap: 7px;
}

.side-nav-item {
    min-height: 42px;
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 9px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #bdd5df;
    cursor: pointer;
    text-align: left;
}

.side-nav-item:hover,
.side-nav-item.active {
    border-color: rgba(0, 188, 212, 0.36);
    background: rgba(0, 188, 212, 0.10);
    color: #ffffff;
}

.side-nav-key {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #7be4ef;
    font-size: 0.8rem;
}

.principle-stack {
    margin-top: auto;
    display: grid;
    gap: 7px;
}

.principle-stack span {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #cfe6ee;
    font-size: 0.78rem;
}

.app-main {
    height: 100vh;
    min-width: 0;
    overflow: auto;
    padding: 18px;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 0 0 14px;
}

.eyebrow {
    margin: 0 0 4px;
    color: #7be4ef;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-topbar h1,
.panel-heading h2,
.onboarding-hero h2 {
    margin: 0;
    color: #ffffff;
    letter-spacing: 0;
}

.app-topbar h1 {
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.topbar-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.user-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #bdd5df;
    font-size: 0.84rem;
}

.user-switcher select,
.field-row select,
.field-row input,
.field-row textarea,
.message-compose input {
    min-height: 38px;
    border: 1px solid rgba(232, 244, 253, 0.16);
    border-radius: 8px;
    background: rgba(4, 9, 24, 0.78);
    color: #ffffff;
    padding: 8px 10px;
}

.field-row textarea {
    resize: vertical;
}

.status-pill {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(75, 222, 128, 0.34);
    background: rgba(34, 197, 94, 0.12);
    color: #a7f3d0;
    font-size: 0.78rem;
    font-weight: 800;
}

.status-pill.offline {
    border-color: rgba(245, 158, 11, 0.40);
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
}

.icon-command,
.round-command,
.primary-command,
.secondary-command,
.text-command,
.path-card,
.mode-chip,
.queue-item,
.conversation-item,
.mini-person {
    border: 0;
    cursor: pointer;
}

.icon-command {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.mode-rail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.mode-chip {
    min-height: 76px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(232, 244, 253, 0.12);
    text-align: left;
}

.mode-chip strong,
.mode-chip span {
    display: block;
}

.mode-chip strong {
    color: #ffffff;
    margin-bottom: 4px;
}

.mode-chip span {
    color: #adc6d1;
    font-size: 0.78rem;
    line-height: 1.35;
}

.mode-chip.active {
    border-color: var(--mode-accent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--mode-accent) 24%, transparent), rgba(255, 255, 255, 0.07));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mode-accent) 34%, transparent);
}

.metrics-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.metric-tile,
.panel-block,
.explain-panel,
.queue-panel,
.profile-stage,
.person-tile,
.match-tile,
.thread-panel,
.conversation-list,
.profile-editor,
.feature-tile,
.takeover-card {
    min-width: 0;
    border: 1px solid rgba(232, 244, 253, 0.13);
    border-radius: 8px;
    background: rgba(10, 18, 42, 0.74);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.metric-tile {
    min-height: 88px;
    padding: 12px;
}

.metric-tile span,
.metric-tile small {
    display: block;
    color: #a9c8d4;
}

.metric-tile strong {
    display: block;
    color: #ffffff;
    font-size: 1.45rem;
    margin: 2px 0;
}

.workspace {
    width: 100%;
    min-width: 0;
}

.discover-layout {
    display: grid;
    grid-template-columns: minmax(340px, 0.95fr) minmax(300px, 0.75fr) minmax(260px, 0.55fr);
    gap: 14px;
    align-items: start;
}

.profile-stage {
    overflow: hidden;
}

.profile-hero {
    height: min(52vh, 560px);
    min-height: 430px;
    position: relative;
    overflow: hidden;
    background: #102033;
}

.profile-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-hero::after {
    content: "";
    position: absolute;
    inset: 40% 0 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
}

.profile-hero-overlay {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    padding: 18px;
}

.profile-hero-overlay h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.65rem, 3vw, 2.5rem);
}

.profile-hero-overlay h2 span {
    color: #d3e8ef;
    font-weight: 500;
}

.profile-hero-overlay p {
    margin: 4px 0 0;
    color: #bdd5df;
}

.profile-hero-overlay > strong {
    min-width: 80px;
    min-height: 58px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(0, 188, 212, 0.22);
    border: 1px solid rgba(123, 228, 239, 0.42);
    font-size: 1.35rem;
}

.profile-copy,
.explain-panel,
.queue-panel,
.panel-block,
.profile-editor,
.thread-panel {
    padding: 16px;
}

.badge-row,
.tag-cloud,
.mode-checks,
.form-actions,
.safety-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mini-badge,
.tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 7px;
    background: rgba(0, 188, 212, 0.12);
    color: #a5f3fc;
    font-size: 0.76rem;
}

.presence-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 22px;
    color: #a9c8d4;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.presence-chip i {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #64748b;
}

.presence-chip.online {
    color: #bbf7d0;
}

.presence-chip.online i {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.profile-hero-overlay .presence-chip {
    margin-top: 6px;
    color: #e8fbf0;
}

.conversation-item .presence-chip,
.mini-person .presence-chip {
    margin-top: 3px;
}

.profile-intent {
    margin: 14px 0 6px;
    color: #ffffff;
    font-weight: 700;
}

.profile-bio-text,
.muted,
.panel-heading p,
.feature-tile p,
.match-tile p,
.person-tile p,
.takeover-card p {
    color: #b7d0dc;
}

.profile-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.profile-facts div,
.control-list div,
.vote-list div {
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.profile-facts span,
.control-list p,
.vote-list p {
    display: block;
    color: #a9c8d4;
    font-size: 0.78rem;
}

.profile-facts strong,
.control-list strong,
.vote-list strong {
    color: #ffffff;
}

.prompt-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.prompt-row {
    padding: 10px;
    border-left: 3px solid #ff4081;
    background: rgba(255, 64, 129, 0.08);
    border-radius: 0 8px 8px 0;
}

.prompt-row span {
    color: #ffb1cc;
    font-size: 0.78rem;
    font-weight: 800;
}

.prompt-row p {
    margin: 4px 0 0;
    color: #ffffff;
}

.action-dock {
    display: grid;
    grid-template-columns: 64px 1fr 1fr 64px;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid rgba(232, 244, 253, 0.10);
    background: rgba(4, 9, 24, 0.56);
}

.round-command {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: 900;
    display: grid;
    place-items: center;
}

.round-command.pass {
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.45);
}

.round-command.like {
    background: linear-gradient(135deg, #ff4081, #c2185b);
    color: #ffffff;
}

.primary-command,
.secondary-command,
.text-command {
    min-height: 38px;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 800;
}

.primary-command {
    background: linear-gradient(135deg, #00bcd4, #ff4081);
    color: #ffffff;
}

.secondary-command {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(232, 244, 253, 0.14);
    color: #e8f4fd;
}

.text-command {
    background: transparent;
    color: #7be4ef;
}

.text-command.danger {
    color: #fecaca;
}

.score-ring {
    width: 150px;
    height: 150px;
    margin: 16px auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, #0a122a 55%, transparent 57%),
        conic-gradient(#00bcd4 calc(var(--score) * 1%), rgba(255, 255, 255, 0.10) 0);
}

.score-ring strong,
.score-ring span {
    grid-area: 1 / 1;
}

.score-ring strong {
    color: #ffffff;
    font-size: 2rem;
}

.score-ring span {
    align-self: end;
    margin-bottom: 28px;
    color: #a9c8d4;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.breakdown-list,
.explain-list,
.queue-list,
.control-list,
.vote-list,
.mini-list,
.message-stack {
    display: grid;
    gap: 9px;
}

.breakdown-row {
    display: grid;
    grid-template-columns: 98px 1fr 42px;
    gap: 8px;
    align-items: center;
    color: #cfe6ee;
    font-size: 0.82rem;
}

.breakdown-row div {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    overflow: hidden;
}

.breakdown-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #00bcd4, #ff4081);
}

.explain-list {
    padding-left: 18px;
    margin: 14px 0;
    color: #d8edf4;
}

.toggle-row,
.field-row {
    display: grid;
    gap: 6px;
    color: #cfe6ee;
    font-size: 0.86rem;
    margin-bottom: 10px;
}

.toggle-row {
    grid-template-columns: 18px 1fr;
    align-items: start;
}

.field-row.stacked {
    display: grid;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.queue-list {
    max-height: 420px;
    overflow: auto;
    padding-right: 4px;
}

.queue-item,
.conversation-item,
.mini-person {
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    text-align: left;
    min-width: 0;
}

.queue-item.active,
.conversation-item.active {
    background: rgba(0, 188, 212, 0.16);
    outline: 1px solid rgba(0, 188, 212, 0.36);
}

.queue-item img,
.conversation-item img,
.mini-person img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
}

.queue-item strong,
.queue-item small,
.conversation-item strong,
.conversation-item small,
.mini-person strong,
.mini-person small {
    display: block;
    min-width: 0;
}

.queue-item small,
.conversation-item small,
.mini-person small {
    color: #a9c8d4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.person-tile,
.takeover-card {
    padding: 12px;
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
}

.person-tile img,
.match-tile img,
.takeover-card img {
    width: 76px;
    height: 92px;
    border-radius: 8px;
    object-fit: cover;
}

.person-tile h3,
.match-tile h3,
.takeover-card h3 {
    margin: 0 0 4px;
    color: #ffffff;
}

.person-tile .secondary-command,
.takeover-card .primary-command {
    grid-column: 1 / -1;
}

.split-layout,
.profile-editor-layout,
.messages-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(360px, 1.22fr);
    gap: 14px;
    align-items: start;
}

.match-grid,
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.match-tile,
.feature-tile {
    padding: 12px;
}

.messages-layout {
    grid-template-columns: 320px minmax(0, 1fr);
}

.conversation-list {
    padding: 10px;
    display: grid;
    gap: 8px;
}

.conversation-item {
    grid-template-columns: 44px minmax(0, 1fr) 24px;
}

.conversation-item em {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ff4081;
    color: #ffffff;
    font-style: normal;
    font-size: 0.75rem;
}

.thread-heading {
    margin-bottom: 12px;
}

.thread-heading h2 {
    margin: 0 0 4px;
}

.thread-heading p {
    margin: 0;
    color: #a9c8d4;
}

.message-stack {
    min-height: 360px;
    max-height: 50vh;
    overflow: auto;
    align-content: start;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.message-bubble {
    max-width: min(78%, 640px);
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.message-bubble.from-me {
    justify-self: end;
    background: rgba(0, 188, 212, 0.18);
}

.message-bubble span {
    display: block;
    color: #7be4ef;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 3px;
}

.message-bubble p {
    margin: 0;
}

.typing-indicator {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: min(78%, 420px);
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #cfe6ee;
    font-size: 0.82rem;
}

.typing-indicator i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7be4ef;
    animation: typingPulse 1s infinite ease-in-out;
}

.typing-indicator i:nth-of-type(2) {
    animation-delay: 0.14s;
}

.typing-indicator i:nth-of-type(3) {
    animation-delay: 0.28s;
}

@keyframes typingPulse {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.message-compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 10px;
}

.profile-editor {
    min-width: 0;
    display: grid;
    gap: 10px;
}

.onboarding-step {
    min-width: 0;
    min-inline-size: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(232, 244, 253, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.onboarding-step legend {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
    color: #ffffff;
}

.onboarding-step legend span {
    width: 30px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(0, 188, 212, 0.18);
    color: #7be4ef;
    font-size: 0.76rem;
}

.schema-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.schema-field.wide {
    grid-column: 1 / -1;
}

.schema-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 7px;
}

.schema-check-grid label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.prompt-builder {
    display: grid;
    gap: 8px;
}

.prompt-builder > span {
    color: #cfe6ee;
    font-size: 0.86rem;
}

.prompt-builder-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.42fr) minmax(220px, 1fr);
    gap: 8px;
}

.prompt-builder-row select,
.prompt-builder-row textarea {
    border: 1px solid rgba(232, 244, 253, 0.16);
    border-radius: 8px;
    background: rgba(4, 9, 24, 0.78);
    color: #ffffff;
    padding: 8px 10px;
}

.mode-checks label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    min-height: 34px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.system-layout,
.onboarding-flow {
    display: grid;
    gap: 14px;
}

.status-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
}

.status-grid dt {
    color: #a9c8d4;
}

.status-grid dd {
    margin: 0;
    color: #ffffff;
}

.onboarding-hub {
    min-height: 62vh;
    display: grid;
    align-content: center;
    gap: 18px;
}

.onboarding-hero {
    max-width: 840px;
}

.onboarding-hero h2 {
    font-size: clamp(2rem, 4vw, 4rem);
}

.onboarding-hero p {
    max-width: 780px;
    color: #c9e0e8;
    font-size: 1.05rem;
}

.onboarding-paths {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 14px;
}

.path-card {
    min-height: 210px;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid rgba(232, 244, 253, 0.14);
    background:
        linear-gradient(135deg, rgba(0, 188, 212, 0.16), rgba(255, 64, 129, 0.10)),
        rgba(10, 18, 42, 0.82);
    text-align: left;
}

.path-card:hover {
    border-color: rgba(123, 228, 239, 0.56);
}

.path-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    font-size: 1.5rem;
}

.path-card strong {
    color: #ffffff;
    font-size: 1.25rem;
}

.path-card p {
    margin: 0;
    color: #bdd5df;
}

.onboarding-footer {
    display: flex;
    justify-content: flex-start;
}

.takeover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.takeover-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.takeover-stats span {
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
    font-size: 0.74rem;
}

.empty-state,
.notice-band {
    padding: 28px;
    border-radius: 8px;
    background: rgba(10, 18, 42, 0.78);
    border: 1px solid rgba(232, 244, 253, 0.13);
}

.notice-band.error {
    border-color: rgba(239, 68, 68, 0.42);
    color: #fecaca;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 60;
    max-width: min(420px, calc(100vw - 36px));
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(2, 8, 23, 0.94);
    border: 1px solid rgba(123, 228, 239, 0.40);
    color: #ffffff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

.loading-layer {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    background: rgba(2, 6, 23, 0.34);
    pointer-events: none;
}

.loading-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(2, 8, 23, 0.92);
    border: 1px solid rgba(123, 228, 239, 0.36);
}

.loading-card img {
    width: 34px;
    height: 34px;
}

@media (max-width: 1180px) {
    body:has(.app-shell) {
        overflow: auto;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        min-height: auto;
        position: sticky;
        top: 0;
        z-index: 20;
        border-right: 0;
        border-bottom: 1px solid rgba(232, 244, 253, 0.12);
    }

    .side-nav {
        display: flex;
        overflow-x: auto;
        max-width: 100%;
    }

    .side-nav-item {
        flex: 0 0 118px;
    }

    .principle-stack {
        display: none;
    }

    .app-main {
        height: auto;
        overflow: visible;
    }

    .discover-layout,
    .split-layout,
    .profile-editor-layout,
    .messages-layout {
        grid-template-columns: 1fr;
    }

    .profile-hero {
        height: 520px;
    }
}

@media (max-width: 760px) {
    .app-main,
    .app-sidebar {
        padding: 12px;
    }

    .app-topbar,
    .topbar-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .mode-rail,
    .metrics-strip,
    .onboarding-paths,
    .field-grid,
    .schema-field-grid,
    .prompt-builder-row {
        grid-template-columns: 1fr;
    }

    .profile-hero {
        height: 410px;
        min-height: 360px;
    }

    .action-dock {
        grid-template-columns: 58px 1fr 1fr 58px;
        gap: 7px;
    }

    .side-nav-item {
        flex-basis: 92px;
        grid-template-columns: 22px 1fr;
        gap: 6px;
        padding: 7px 8px;
        font-size: 0.82rem;
    }

    .message-compose {
        grid-template-columns: 1fr;
    }

    .toast {
        position: static;
        grid-column: 1;
        margin: 12px;
        max-width: none;
        text-align: center;
    }

    .takeover-grid,
    .roster-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================================================
   TINDER/FETLIFE IMMERSIVE DECK OVERHAUL
   ============================================================== */

/* View as Phone toggle styling */
.topbar-controls .secondary-command[data-action="toggleMobileView"] {
    margin-right: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--primary);
}

.is-mobile-view .app-main {
    max-width: 480px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--surface-1);
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    height: 100vh;
    overflow-y: auto;
}
.is-mobile-view .app-sidebar {
    display: none;
}

/* Tinder-style Profile Stage */
.tinder-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.gallery-hero {
    height: 75vh;
    min-height: 600px;
    position: relative;
    background: #000;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gallery-bars {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.gallery-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: background 0.2s ease;
}

.gallery-bar.active {
    background: #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

/* Tap zones */
.gallery-tap-left {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 30%;
    width: 50%;
    z-index: 5;
    cursor: pointer;
}
.gallery-tap-right {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 30%;
    width: 50%;
    z-index: 5;
    cursor: pointer;
}

/* Immersive bottom overlay */
.immersive-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 120px 20px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 40%, rgba(0,0,0,0) 100%);
    color: #fff;
    pointer-events: none;
}

.hero-header-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: end; gap: 10px; margin-bottom: 4px; }

.hero-header-row h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 2.2rem; font-weight: 800; line-height: 0.96; margin: 0; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.hero-header-row span {
    font-size: 1.8rem;
    font-weight: 400;
    opacity: 0.9;
}

.compat-score {
    font-size: 1.4rem;
    color: var(--primary);
    background: rgba(0,0,0,0.5);
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid var(--primary);
    backdrop-filter: blur(4px);
}

.hero-location {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hero-location::before {
    content: '';
    display: none;
    font-size: 0.9rem;
}

.hero-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.hero-meta-row .hero-location {
    margin: 0;
    min-width: 0;
}

.hero-meta-row .presence-chip {
    margin: 0;
    white-space: nowrap;
}

.hero-bio {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 12px 0;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Action dock styling */
.immersive-dock {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 24px;
    background: var(--surface-1);
    border-top: 1px solid var(--border);
}

.round-command.giant {
    width: 72px;
    height: 72px;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.round-command.giant:hover {
    transform: scale(1.1);
}
.round-command.giant:active {
    transform: scale(0.95);
}

.round-command.pass.giant {
    color: #ff4b4b;
    border: 2px solid #ff4b4b;
}
.round-command.like.giant {
    color: #2eeda8;
    border: 2px solid #2eeda8;
}

/* Make it look like a piece of art */
body {
    font-family: 'Inter', -apple-system, sans-serif;
}

/* ==============================================================
   DESIGN SPEC V3 - GLASS RING & PEEK SHEET
   ============================================================== */

/* Glass Ring Compatibility Score */
.glass-ring-container {
    position: relative;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.glass-ring-container:hover {
    transform: scale(1.05);
}

.glass-ring-svg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    transform: rotate(-90deg);
}

.glass-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 4;
}

.glass-ring-fill {
    fill: none;
    stroke: var(--crystal);
    stroke-width: 4;
    stroke-dasharray: 100;
    stroke-linecap: round;
    /* transition is handled in inline style */
}

.glass-ring-score {
    position: relative;
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Peek Sheet */
.peek-sheet {
    background: var(--bg-card);
    padding: 24px;
    padding-bottom: 120px; /* space for action dock */
    color: var(--ink);
    border-top: 1px solid var(--glass-line);
}

.hero-bio-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
    font-style: italic;
    opacity: 0.9;
    margin: 8px 0;
}

/* Tokens mapping */
:root {
    --bg-void: #06081A;
    --bg-card: #0A0E27;
    --crystal: #00BCD4;
    --crystal-hot: #7DF9FF;
    --heart: #FF4081;
    --glass-line: rgba(125,249,255,.14);
    --ink: #F4F6FF;
    --ink-dim: rgba(244,246,255,.62);
}

body {
    background: var(--bg-void);
    color: var(--ink);
}

/* Phone Viewport Wrapper */
.phone-viewport-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.phone-viewport-frame {
    width: 390px;
    height: 844px;
    background: var(--bg-void);
    border-radius: 48px;
    border: 12px solid #222;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), inset 0 0 0 2px #444;
    overflow: hidden;
    position: relative;
}
.phone-viewport-notch {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 30px;
    background: #222;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 100;
}
.phone-viewport-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-void);
}
.phone-viewport-close {
    position: absolute;
    top: 20px; right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-line);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    z-index: 10000;
}

/* Codex readiness pass: make design v3 land as a phone-first dating surface. */
:root {
    --surface-1: rgba(10, 14, 39, 0.94);
    --surface-2: rgba(14, 19, 48, 0.92);
    --border: var(--glass-line);
    --primary: var(--crystal);
}

.phone-preview-content [data-action="toggleMobileView"] {
    display: none;
}

.gallery-hero.low-res-portrait {
    isolation: isolate;
}

.gallery-image-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(18px) brightness(0.46) saturate(1.08);
    transform: scale(1.1);
}

.gallery-hero.low-res-portrait .gallery-image {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 42%;
    width: min(72%, 340px);
    height: min(68%, 470px);
    transform: translate(-50%, -50%);
    border-radius: 22px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.64);
    outline: 1px solid rgba(255, 255, 255, 0.16);
}

.gallery-hero.low-res-portrait .gallery-bars,
.gallery-hero.low-res-portrait .photo-caption,
.gallery-hero.low-res-portrait .gallery-tap-left,
.gallery-hero.low-res-portrait .gallery-tap-right,
.gallery-hero.low-res-portrait .immersive-overlay {
    z-index: 6;
}

.gallery-hero.low-res-portrait .immersive-overlay {
    z-index: 8;
}

@media (max-width: 760px) {
    .app-shell.section-discover {
        min-height: 100svh;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .app-shell.section-discover .app-sidebar {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 40;
        min-height: 58px;
        padding: 6px;
        border: 0;
        border-top: 1px solid rgba(125, 249, 255, 0.16);
        background: rgba(6, 8, 26, 0.92);
        box-shadow: 0 -14px 42px rgba(0, 0, 0, 0.38);
    }

    .app-shell.section-discover .brand-lockup,
    .app-shell.section-discover .principle-stack {
        display: none;
    }

    .app-shell.section-discover .side-nav {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
        overflow: hidden;
    }

    .app-shell.section-discover .side-nav-item {
        min-height: 46px;
        display: grid;
        grid-template-columns: 1fr;
        place-items: center;
        padding: 4px;
        font-size: 0;
    }

    .app-shell.section-discover .side-nav-item span:not(.side-nav-key) {
        display: none;
    }

    .app-shell.section-discover .side-nav-key {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }

    .app-shell.section-discover .app-main {
        padding: 8px 8px 132px;
    }

    .app-shell.section-discover .app-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding: 0 0 8px;
    }

    .app-shell.section-discover .app-topbar .eyebrow {
        display: none;
    }

    .app-shell.section-discover .app-topbar h1 {
        font-size: 1.05rem;
        line-height: 1.05;
    }

    .app-shell.section-discover .topbar-controls {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
    }

    .app-shell.section-discover .user-switcher,
    .app-shell.section-discover .icon-command,
    .app-shell.section-discover .status-pill,
    .app-shell.section-discover .mode-rail,
    .app-shell.section-discover .discover-controls-below {
        display: none;
    }

    .app-shell.section-discover .discover-layout {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .app-shell.section-discover .profile-stage {
        margin-bottom: 0;
        border-radius: 14px;
    }

    .app-shell.section-discover .gallery-hero {
        height: calc(100svh - 178px);
        min-height: 500px;
    }

    .app-shell.section-discover .gallery-hero.low-res-portrait .gallery-image {
        width: min(66%, 252px);
        height: min(62%, 390px);
        top: 40%;
    }

    .app-shell.section-discover .immersive-overlay {
        bottom: 88px;
        padding: 88px 14px 16px;
    }

    

    

    .app-shell.section-discover .hero-header-row h2 span {
        font-size: 0.72em;
    }

    .app-shell.section-discover .glass-ring-container {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }

    .app-shell.section-discover .hero-meta-row {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 10px;
        margin-top: 5px;
    }

    .app-shell.section-discover .hero-location {
        max-width: calc(100% - 94px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.86rem;
    }

    .app-shell.section-discover .profile-hero-overlay .presence-chip {
        max-width: 88px;
        flex: 0 0 auto;
        justify-content: flex-end;
        text-align: right;
        font-size: 0.7rem;
    }

    .app-shell.section-discover .badge-row {
        gap: 6px;
        max-height: 64px;
        overflow: hidden;
    }

    .app-shell.section-discover .mini-badge:nth-child(n+5) {
        display: none;
    }

    .app-shell.section-discover .peek-sheet {
        padding: 13px 14px 16px;
        border-radius: 0 0 14px 14px;
    }

    .app-shell.section-discover .profile-intent,
    .app-shell.section-discover .hero-bio {
        font-size: 0.94rem;
        line-height: 1.35;
    }

    .app-shell.section-discover .profile-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin: 10px 0;
    }

    .app-shell.section-discover .profile-facts div {
        padding: 8px;
    }

    .app-shell.section-discover .prompt-list {
        gap: 6px;
    }

    .app-shell.section-discover .prompt-row {
        padding: 8px;
    }

    .app-shell.section-discover .immersive-dock {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 58px;
        z-index: 38;
        justify-content: center;
        gap: 28px;
        padding: 10px 12px;
        border-top: 1px solid rgba(125, 249, 255, 0.16);
        background: rgba(6, 8, 26, 0.98);
        box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.46);
        backdrop-filter: blur(14px);
    }

    .app-shell.section-discover .round-command.giant {
        width: 56px;
        height: 56px;
        font-size: 1.55rem;
    }

    .phone-preview-content .app-main {
        padding-bottom: 120px;
    }

    .app-shell.section-discover .toast {
        display: none;
    }
}

@media (max-width: 420px) {
    .app-shell.section-discover .gallery-hero {
        min-height: 470px;
    }
}

/* Photo caption */
.photo-caption {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    color: white;
    z-index: 10;
    border: 1px solid var(--glass-line);
}



.explain-panel .metrics-strip {
    grid-template-columns: 1fr 1fr;
    margin: 16px 0;
}
.mode-compact-select {
    display: inline-flex !important;
}

.profile-hero-overlay.immersive-overlay {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 6px;
}

.hero-header-row,
.hero-meta-row,
.hero-bio,
.badge-row {
    width: 100%;
}

.hero-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.hero-bio-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 4px 0 8px 0 !important;
}

.app-shell.section-discover .badge-row {
    flex-wrap: wrap;
}

/* =============================================================
   Chris interview onboarding - conversational, voice-capable flow
   ============================================================= */

.onboarding-v4-flow {
    display: grid;
    gap: 16px;
}

.assistant-onboarding {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 16px;
    align-items: stretch;
}

.assistant-stage {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(260px, 0.68fr) minmax(340px, 1fr);
    gap: 16px;
}

.assistant-hero-panel,
.assistant-chat-card,
.assistant-ledger {
    min-width: 0;
    border: 1px solid rgba(125, 249, 255, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(0, 188, 212, 0.06) 38%, rgba(255, 64, 129, 0.07)),
        rgba(8, 14, 34, 0.88);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.assistant-hero-panel {
    padding: 20px;
    display: grid;
    align-content: space-between;
    gap: 18px;
    overflow: hidden;
    position: relative;
}

.assistant-hero-panel::before,
.assistant-chat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(122deg, transparent 0 28%, rgba(255, 255, 255, 0.16) 29%, transparent 30% 100%),
        linear-gradient(33deg, transparent 0 63%, rgba(125, 249, 255, 0.16) 64%, transparent 65% 100%);
    opacity: 0.65;
}

.assistant-hero-panel h2 {
    margin: 0;
    font-size: clamp(1.8rem, 2.8vw, 3.25rem);
    line-height: 0.98;
    color: #ffffff;
    overflow-wrap: break-word;
}

.assistant-hero-panel p {
    margin: 0;
    color: #d9f4ff;
    line-height: 1.5;
}

.assistant-progress {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: center;
    color: #ffffff;
    font-weight: 800;
}

.assistant-progress div,
.intake-track div {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}

.assistant-progress i,
.intake-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffffff, #7df9ff 42%, #ff4081 78%, #ffd66b);
    box-shadow: 0 0 18px rgba(125, 249, 255, 0.44);
}

.assistant-chat-card {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(320px, 1fr) auto auto;
    overflow: hidden;
}

.assistant-chat-head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid rgba(125, 249, 255, 0.18);
}

.assistant-avatar {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 26px rgba(125, 249, 255, 0.34);
}

.assistant-chat-head strong,
.assistant-chat-head span {
    display: block;
}

.assistant-chat-head strong {
    color: #ffffff;
    font-size: 1.08rem;
}

.assistant-chat-head span {
    color: #aeefff;
    font-size: 0.82rem;
}

.assistant-messages {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px;
    overflow: auto;
}

.assistant-message {
    max-width: min(82%, 620px);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(4, 9, 24, 0.74);
}

.assistant-message.from-user {
    justify-self: end;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.28), rgba(255, 64, 129, 0.22));
}

.assistant-message span {
    display: block;
    color: #7df9ff;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.assistant-message p {
    margin: 3px 0 0;
    color: #f6fbff;
    line-height: 1.46;
}

.assistant-compose {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    padding: 12px 14px;
    border-top: 1px solid rgba(125, 249, 255, 0.16);
}

.assistant-compose textarea {
    min-height: 54px;
    resize: vertical;
    border: 1px solid rgba(125, 249, 255, 0.24);
    border-radius: 8px;
    background: rgba(3, 8, 20, 0.88);
    color: #ffffff;
    padding: 10px 12px;
}

.voice-orb {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(125, 249, 255, 0.42);
    background: radial-gradient(circle at 35% 25%, #ffffff, #7df9ff 22%, #006dff 68%, #06122b 100%);
    color: #06122b;
    font-size: 0.72rem;
    font-weight: 950;
    box-shadow: 0 0 26px rgba(0, 188, 212, 0.34);
}

.voice-orb.recording {
    background: radial-gradient(circle at 35% 25%, #ffffff, #ff9ac0 24%, #ff4081 62%, #2a0717 100%);
    color: #ffffff;
    animation: voicePulse 1.1s infinite ease-in-out;
}

@keyframes voicePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 64, 129, 0); }
    50% { transform: scale(1.06); box-shadow: 0 0 34px rgba(255, 64, 129, 0.54); }
}

.assistant-chat-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 14px 14px;
}

.assistant-ledger {
    padding: 14px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.intake-tracks,
.ledger-list {
    display: grid;
    gap: 8px;
}

.intake-track {
    display: grid;
    grid-template-columns: 92px minmax(70px, 1fr) 42px;
    gap: 8px;
    align-items: center;
    color: #ccefff;
    font-size: 0.78rem;
}

.ledger-list {
    max-height: 420px;
    overflow: auto;
    padding-right: 4px;
}

.ledger-row {
    padding: 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
}

.ledger-row span,
.ledger-row strong,
.ledger-row p {
    display: block;
}

.ledger-row span {
    color: #7df9ff;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.ledger-row strong {
    color: #ffffff;
}

.ledger-row p {
    margin: 3px 0 0;
    color: #cfefff;
    font-size: 0.84rem;
    line-height: 1.4;
}

/* V4 hook: luminous crystal maximalism while the base route remains intact. */
.app-shell.design-v4 {
    background:
        linear-gradient(122deg, rgba(255, 255, 255, 0.92), rgba(196, 246, 255, 0.78) 18%, rgba(0, 105, 255, 0.22) 42%, rgba(255, 64, 129, 0.24) 74%, rgba(255, 255, 255, 0.82)),
        linear-gradient(34deg, #ffffff 0 8%, #00bcd4 9% 18%, #ffffff 19% 30%, #1455ff 31% 43%, #ff4081 44% 54%, #ffffff 55% 100%);
}

.app-shell.design-v4 .app-sidebar,
.app-shell.design-v4 .app-topbar,
.app-shell.design-v4 .metric-tile,
.app-shell.design-v4 .explain-panel,
.app-shell.design-v4 .queue-panel,
.app-shell.design-v4 .profile-stage,
.app-shell.design-v4 .panel-block,
.app-shell.design-v4 .profile-editor,
.app-shell.design-v4 .takeover-card,
.app-shell.design-v4 .assistant-hero-panel,
.app-shell.design-v4 .assistant-chat-card,
.app-shell.design-v4 .assistant-ledger {
    border-color: rgba(0, 105, 255, 0.34);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(216, 250, 255, 0.46) 36%, rgba(255, 64, 129, 0.16)),
        rgba(8, 29, 80, 0.72);
    box-shadow: 0 24px 80px rgba(0, 105, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.app-shell.design-v4 .brand-lockup strong,
.app-shell.design-v4 .app-topbar h1,
.app-shell.design-v4 .panel-heading h2,
.app-shell.design-v4 .assistant-hero-panel h2 {
    color: #03143e;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.88), 0 0 18px rgba(125, 249, 255, 0.56);
}

.app-shell.design-v4 .eyebrow,
.app-shell.design-v4 .side-nav-key,
.app-shell.design-v4 .assistant-message span,
.app-shell.design-v4 .ledger-row span {
    color: #003dff;
}

.app-shell.design-v4 .gallery-hero {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 0 0 1px rgba(0, 105, 255, 0.32), 0 24px 90px rgba(0, 105, 255, 0.34);
}

.app-shell.design-v4 .immersive-overlay {
    background:
        linear-gradient(to top, rgba(4, 13, 48, 0.98), rgba(0, 105, 255, 0.52) 38%, rgba(255, 255, 255, 0) 100%),
        linear-gradient(38deg, rgba(255, 255, 255, 0.18), transparent 42%, rgba(255, 64, 129, 0.22));
}

@media (max-width: 1000px) {
    .assistant-onboarding,
    .assistant-stage {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .assistant-onboarding {
        gap: 10px;
    }

    .assistant-hero-panel {
        padding: 14px;
    }

    .assistant-hero-panel h2 {
        font-size: 2rem;
        line-height: 0.98;
    }

    .assistant-chat-card {
        grid-template-rows: auto minmax(280px, 56vh) auto auto;
    }

    .assistant-compose {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .assistant-compose .primary-command {
        grid-column: 1 / -1;
    }

    .voice-orb {
        width: 48px;
        height: 48px;
    }
}
