/* Brand fonts, served locally (SIL OFL 1.1, see fonts/licenses) */
@font-face { font-family: 'Outfit'; src: url('fonts/outfit-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Outfit'; src: url('fonts/outfit-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; src: url('fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; src: url('fonts/barlow-condensed-latin-ext-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; src: url('fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; src: url('fonts/barlow-condensed-latin-ext-600-normal.woff2') format('woff2'); font-weight: 600 700; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-latin-ext-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1E9F; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* HEXART brand tokens (brandbook.hexart.io) */
    --hx-onyx: #0A0A0C;
    --hx-carbon: #050507;
    --hx-graphite: #141418;
    --hx-slate: #24242A;
    --hx-gold: #D1AE53;
    --hx-gold-light: #EBD065;
    --hx-bronze: #7A5F1C;
    --hx-ivory: #F6F3EC;
    --hx-mist: #B0B8C4;
    --hx-signal: #FF4B4B;
    --hx-font-body: 'Outfit', 'Segoe UI', Arial, sans-serif;
    --hx-font-label: 'Barlow Condensed', 'Bahnschrift SemiCondensed', 'Segoe UI', sans-serif;
    --hx-font-mono: 'JetBrains Mono', Consolas, monospace;
    --hx-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    --primary-gradient: linear-gradient(135deg, #0A0A0C 0%, #141418 100%);
    --accent-gradient: linear-gradient(135deg, rgba(209, 174, 83, 0.10) 0%, rgba(209, 174, 83, 0.04) 100%);
    --primary-color: #F6F3EC;
    --secondary-color: #B0B8C4;
    --text-dark: #F6F3EC;
    --text-light: #B0B8C4;
    --bg-dark: #0A0A0C;
    --bg-card: #141418;
    --bg-elevated: #24242A;
    --border-color: #24242A;
    --success-color: #888888;
    --warning-color: #999999;
    --error-color: #aaaaaa;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.7);
}

/* Animated time-based gradient background */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 75%;
    }
    50% {
        background-position: 100% 50%;
    }
    75% {
        background-position: 50% 25%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body {
    font-family: var(--hx-font-body);
    /* Dynamic gradient controlled by JavaScript - very subtle */
    background: linear-gradient(
        135deg,
        rgba(10, 10, 12, 1) 0%,
        rgba(14, 13, 12, 1) 35%,
        rgba(10, 10, 12, 1) 50%,
        rgba(16, 14, 11, 1) 75%,
        rgba(10, 10, 12, 1) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 180s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-dark);
    transition: background 2s ease;
}

/* Form controls don't inherit the font by default */
button, input, select, textarea, optgroup {
    font-family: var(--hx-font-body);
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100vw;
    overflow: hidden;
}

/* Header */
.app-header {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    box-shadow: var(--shadow);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
}

.app-header h1 {
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 300;
    letter-spacing: 0.1em;
}

/* Energy Display */
.energy-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(209, 174, 83, 0.1);
    padding: 6px 10px;
    border-radius: 0;
    border: 1px solid rgba(209, 174, 83, 0.3);
    transition: all 0.3s ease;
    z-index: 100000; /* Always on top, even above modals */
    cursor: pointer;
}

.energy-display:hover {
    background: rgba(209, 174, 83, 0.15);
    border-color: rgba(209, 174, 83, 0.5);
    box-shadow: 0 0 15px rgba(209, 174, 83, 0.2);
}

.energy-icon {
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.energy-value {
    font-size: 1rem;
    font-weight: 600;
    color: #D1AE53;
    text-align: right;
    white-space: nowrap;
}

.energy-label {
    font-size: 0.75rem;
    color: #D1AE53;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.energy-display.low {
    background: rgba(255, 75, 75, 0.1);
    border-color: rgba(255, 75, 75, 0.3);
}

.energy-display.low .energy-value {
    color: #FF4B4B;
}

.energy-display.low .energy-label {
    color: #FF4B4B;
}

/* Negative balance indicator */
.energy-display.negative {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.15), rgba(255, 75, 75, 0.1));
    border: 1px solid rgba(255, 75, 75, 0.3);
    animation: pulse-red 2s ease-in-out infinite;
}

.energy-display.negative .energy-icon {
    color: #FF4B4B;
    animation: shake 0.5s ease-in-out infinite;
}

.energy-display.negative .energy-value {
    color: #FF4B4B;
    font-weight: 700;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 75, 75, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 75, 75, 0.4); }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Energy deduction animation */
.energy-deduction {
    position: absolute;
    top: 120%;
    right: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 75, 75, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    animation: energy-fade-up 2s ease-out forwards;
    white-space: nowrap;
    z-index: 100001;
}

@keyframes energy-fade-up {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 10px 12px;
    }
    
    .app-header h1 {
        font-size: 1.2rem;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .energy-display {
        padding: 4px 8px;
        gap: 4px;
    }
    
    .energy-icon {
        font-size: 1rem;
        line-height: 1;
    }
    
    .energy-value {
        font-size: 0.9rem;
    }
    
    .energy-label {
        display: none; /* Hide label on mobile to save space */
    }
    
    .user-display {
        padding: 6px 8px;
        gap: 8px;
    }
    
    .user-name {
        font-size: 0.85rem;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Main Content */
.app-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 20px 100px 20px;
    -webkit-overflow-scrolling: touch;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 20, 24, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(59, 60, 70, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-light);
    position: relative;
    border-radius: 0;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    border-radius: 0;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.8);
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item:hover {
    color: var(--text-dark);
}

.nav-item:hover .nav-icon {
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.4)) drop-shadow(0 4px 8px rgba(255, 255, 255, 0.2));
}

.nav-item:hover .nav-label {
    opacity: 1;
}

.nav-item.active {
    color: var(--text-dark);
}

.nav-item.active::before {
    opacity: 0.6;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06));
}

.nav-icon {
    font-size: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    opacity: 0.8;
}

/* RealTime Tab */
.realtime-container {
    max-width: 100%;
    margin: 0 auto;
}

/* Dashboard Grid Layout for larger screens */
.realtime-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 1024px) {
    .realtime-container {
        max-width: 95%;
    }
    
    .realtime-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Clock header spans full width */
    .clock-header {
        grid-column: 1 / -1;
    }
    
    /* Daily insights spans full width */
    .daily-insights-module {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1400px) {
    .realtime-container {
        max-width: 96%;
    }
    
    .realtime-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
    
    /* Clock header spans full width */
    .clock-header {
        grid-column: 1 / -1;
    }
    
    /* Daily insights spans full width */
    .daily-insights-module {
        grid-column: 1 / -1;
    }
    
    /* All sections get equal width - 50% each */
    .energy-overview,
    .transit-flow-container,
    .center-activation,
    .planetary-influence {
        grid-column: auto;
    }
}

@media (min-width: 1800px) {
    .realtime-container {
        max-width: 96%;
    }
    
    .realtime-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px;
    }
    
    /* Clock header spans full width */
    .clock-header {
        grid-column: 1 / -1;
    }
    
    /* Daily insights spans full width */
    .daily-insights-module {
        grid-column: 1 / -1;
    }
}

.clock-header {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(35, 35, 35, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 2px 8px rgba(255, 255, 255, 0.05) inset;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.clock-with-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.btn-day-nav {
    background: rgba(176, 184, 196, 0.15);
    border: 1px solid rgba(176, 184, 196, 0.3);
    color: rgba(176, 184, 196, 0.9);
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-day-nav:hover {
    background: rgba(176, 184, 196, 0.25);
    border-color: rgba(176, 184, 196, 0.5);
    box-shadow: 0 0 20px rgba(176, 184, 196, 0.3);
}

.btn-day-nav:active {
    transform: scale(0.95);
}

.clock-display {
    text-align: center;
    flex: 1;
    min-width: 250px;
}

.clock-display .time {
    font-size: 2.5rem;
    font-weight: 300;
    font-family: var(--hx-font-mono);
    color: var(--text-dark);
    letter-spacing: 3px;
}

.clock-display .date {
    font-size: 1rem;
    color: var(--text-light);
    margin-top: 4px;
}

.time-controls {
    display: flex;
    gap: 12px;
}

.btn-mode {
    flex: 1;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: var(--bg-elevated);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-mode.active {
    background: var(--accent-gradient);
    color: var(--text-dark);
    border-color: var(--text-light);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FF4B4B;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Notification Controls */
.notification-controls {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.btn-notification {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(209, 174, 83, 0.08) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #D1AE53;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-notification:hover {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(209, 174, 83, 0.12) 100%);
    border-color: rgba(209, 174, 83, 0.5);
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.3);
}

.btn-notification:active {
    transform: translateY(0);
}

.notification-icon {
    font-size: 1.2rem;
    animation: bell-ring 2s ease-in-out infinite;
}

@keyframes bell-ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-10deg);
    }
    20%, 40% {
        transform: rotate(10deg);
    }
    50%, 90% {
        transform: rotate(0deg);
    }
}

.notification-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(209, 174, 83, 0.1) 100%);
    border: 1px solid rgba(209, 174, 83, 0.4);
    border-radius: 0;
    color: #D1AE53;
    font-size: 0.85rem;
    font-weight: 500;
}

.notification-status .status-icon {
    font-size: 1rem;
    color: #D1AE53;
}

.time-selector {
    background: var(--bg-elevated);
    padding: 20px;
    border-radius: 0;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

/* Section Cards */
.energy-overview,
.active-transits,
.center-activation,
.planetary-influence {
    background: linear-gradient(135deg, rgba(20, 20, 24, 0.95) 0%, rgba(36, 36, 42, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 2px 8px rgba(255, 255, 255, 0.05) inset;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.energy-overview h3,
.active-transits h3,
.center-activation h3,
.planetary-influence h3 {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin-bottom: 16px;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* Expandable Headers */
.expandable-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.expandable-header:hover {
    color: var(--accent-color);
}

.expand-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.8em;
    opacity: 0.7;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.expandable-content {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Daily Insights Module */
.daily-insights-module {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.1) 0%, rgba(176, 184, 196, 0.1) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 2px 8px rgba(209, 174, 83, 0.1) inset;
    border: 1px solid rgba(209, 174, 83, 0.2);
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.insights-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-dark);
    letter-spacing: 0.05em;
}

.insights-icon {
    font-size: 1.2em;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.btn-insight-new {
    background: linear-gradient(135deg, #D1AE53, #D1AE53);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(209, 174, 83, 0.3);
}

.btn-insight-new:hover {
    background: linear-gradient(135deg, #D1AE53, #D1AE53);
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.5);
}

.btn-insight-new:active {
    transform: translateY(0);
}

.btn-insight-new:disabled {
    background: rgba(209, 174, 83, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.insights-container {
    min-height: 80px;
    position: relative;
}

.insight-placeholder {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.95rem;
    opacity: 0.7;
}

.insight-item {
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: fadeIn 0.5s ease;
    line-height: 1.7;
    color: var(--text-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 16px;
}

.insight-item .insight-emoji {
    font-size: 1.3em;
    margin-right: 8px;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.insight-item .insight-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 10px;
    color: #D1AE53;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-item .insight-text {
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
}

.insight-item .insight-highlight {
    font-weight: 600;
    color: #D1AE53;
    text-shadow: 0 0 10px rgba(209, 174, 83, 0.3);
}

.insight-item .insight-action {
    display: inline-block;
    background: rgba(209, 174, 83, 0.2);
    padding: 2px 8px;
    border-radius: 0;
    font-weight: 500;
    color: #D1AE53;
    margin: 2px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.insight-item.loading {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

.insights-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.btn-nav-insight {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-dark);
    width: 36px;
    height: 36px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.btn-nav-insight:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.btn-nav-insight:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Next button (generate) - always active */
.btn-generate-next {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2), rgba(209, 174, 83, 0.1));
    border: 1px solid rgba(209, 174, 83, 0.4);
    color: #D1AE53;
    opacity: 1 !important;
    cursor: pointer !important;
}

.btn-generate-next:hover {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.3), rgba(209, 174, 83, 0.15));
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.3);
}

.btn-generate-next.loading {
    pointer-events: none;
}

/* Star badge on generate button */
.star-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.7em;
    animation: sparkle 2s ease-in-out infinite;
    pointer-events: none;
}

/* Loading spinner for insight generation */
.insight-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 100px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(209, 174, 83, 0.2);
    border-top-color: #D1AE53;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.insight-counter {
    font-size: 0.9rem;
    color: var(--text-light);
    min-width: 60px;
    text-align: center;
}

.btn-clear-insights {
    background: rgba(255, 75, 75, 0.15);
    border: 1px solid rgba(255, 75, 75, 0.3);
    color: #FF4B4B;
    width: 36px;
    height: 36px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
}

.btn-clear-insights:hover {
    background: rgba(255, 75, 75, 0.25);
    box-shadow: 0 4px 12px rgba(255, 75, 75, 0.3);
}

.btn-clear-insights:active {
    transform: translateY(0);
}

/* Energy Gauge */
.energy-gauge {
    margin-bottom: 16px;
}

.gauge-label {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.gauge-container {
    position: relative;
    height: 32px;
    background: linear-gradient(90deg, rgba(20, 20, 20, 0.8) 0%, rgba(30, 30, 30, 0.6) 100%);
    border-radius: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.gauge-fill {
    height: 100%;
    border-radius: 0;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.gauge-value {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.05em;
}

/* Transit Impact Cards */
.impact-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, rgba(36, 36, 42, 0.6) 0%, rgba(36, 36, 42, 0.4) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0;
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.impact-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.impact-card.clickable {
    cursor: pointer;
    user-select: none;
}

.impact-card.clickable:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.impact-card.clickable.badge-active {
    border-color: rgba(255, 75, 75, 0.5);
    box-shadow: 0 0 20px rgba(255, 75, 75, 0.4);
}

.impact-card.high {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(254, 167, 83, 0.08) 100%);
    border: 1px solid rgba(209, 174, 83, 0.3);
}

.impact-card.high .impact-icon {
    color: #D1AE53;
    text-shadow: 0 0 10px rgba(209, 174, 83, 0.5);
}

.impact-card.medium {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.12) 0%, rgba(176, 184, 196, 0.06) 100%);
    border: 1px solid rgba(176, 184, 196, 0.25);
}

.impact-card.medium .impact-icon {
    color: #B0B8C4;
    text-shadow: 0 0 8px rgba(176, 184, 196, 0.4);
}

.impact-card.low {
    background: linear-gradient(135deg, rgba(160, 174, 192, 0.08) 0%, rgba(160, 174, 192, 0.04) 100%);
    border: 1px solid rgba(160, 174, 192, 0.2);
}

.impact-card.upcoming {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(209, 174, 83, 0.08) 100%);
    border: 1px solid rgba(209, 174, 83, 0.3);
    position: relative;
    overflow: hidden;
}

.impact-card.upcoming::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(209, 174, 83, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.impact-card.upcoming .impact-icon {
    color: #D1AE53;
    font-size: 2rem;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.impact-card.upcoming.urgent {
    background: linear-gradient(135deg, rgba(254, 167, 83, 0.2) 0%, rgba(254, 167, 83, 0.12) 100%);
    border: 1px solid rgba(254, 167, 83, 0.4);
    animation: pulse-urgent 2s ease-in-out infinite;
}

@keyframes pulse-urgent {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(254, 167, 83, 0.4);
    }
}

.impact-card.upcoming.urgent .impact-icon {
    color: #FEA753;
}

.impact-card.upcoming.active-now {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(254, 167, 83, 0.15) 100%);
    border: 1px solid rgba(209, 174, 83, 0.5);
}

.impact-card.upcoming.active-now .impact-icon {
    color: #D1AE53;
}

.countdown-timer {
    font-size: 1.1rem;
    font-weight: 700;
    color: #D1AE53;
    margin-top: 6px;
    font-family: var(--hx-font-mono);
    letter-spacing: 0.05em;
}

.impact-card.upcoming.urgent .countdown-timer {
    color: #FEA753;
}

.impact-card.upcoming.active-now .countdown-timer {
    color: #D1AE53;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

.countdown-date {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
    opacity: 0.8;
}

.impact-icon {
    font-size: 1.8rem;
    font-weight: bold;
    line-height: 1;
    flex-shrink: 0;
}

.impact-content {
    flex: 1;
}

.impact-title {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.impact-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Center Bars */
.center-bar-wrapper {
    margin-bottom: 24px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(36, 36, 42, 0.5) 0%, rgba(20, 20, 24, 0.3) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.center-bar-wrapper:hover {
    background: linear-gradient(135deg, rgba(36, 36, 42, 0.6) 0%, rgba(36, 36, 42, 0.4) 100%);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.center-bar-wrapper.clickable {
    cursor: pointer;
    user-select: none;
}

.center-bar-wrapper.clickable:hover {
    background: linear-gradient(135deg, rgba(59, 60, 70, 0.7) 0%, rgba(36, 36, 42, 0.5) 100%);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.center-bar-wrapper.clickable.badge-active {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.15) 0%, rgba(255, 75, 75, 0.08) 100%);
    border-color: rgba(255, 75, 75, 0.4);
    box-shadow: 0 6px 20px rgba(255, 75, 75, 0.35);
}

.center-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.center-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.02em;
}

.center-total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.center-visual {
    position: relative;
    height: 28px;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 8px;
}

.center-track {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(15, 15, 15, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
}

.user-bar {
    position: absolute;
    height: 100%;
    border-radius: 0 0 0 0;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                0 0 15px currentColor;
    opacity: 0.95;
}

.transit-bar {
    position: absolute;
    height: 100%;
    border-radius: 0 0 0 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
                0 0 10px currentColor;
    opacity: 0.85;
}

.center-legend {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Planet Circles */
.planet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}

.planet-circle {
    text-align: center;
    padding: 18px 12px;
    border-radius: 0;
    background: linear-gradient(135deg, rgba(36, 36, 42, 0.6) 0%, rgba(20, 20, 24, 0.4) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 180px;
}

.planet-circle:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.12);
}

.planet-circle:active {
    transform: translateY(-1px) scale(0.98);
}

.planet-circle-wrapper {
    display: contents;
}

.planet-circle.clickable {
    cursor: pointer;
    user-select: none;
}

.planet-circle.clickable:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.planet-circle.clickable.badge-active {
    transform: translateY(-6px) scale(1.08);
    box-shadow: 0 8px 28px rgba(255, 75, 75, 0.5);
    border-color: rgba(255, 75, 75, 0.5);
}

.planet-circle.clickable.badge-active .planet-name {
    color: #FF4B4B;
    text-shadow: 0 0 12px rgba(255, 75, 75, 0.7);
}

.planet-name {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.3;
    min-height: 2.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.planet-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    position: relative;
}

.planet-orb {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.planet-orb:hover {
    filter: brightness(1.2);
}

.planet-symbol {
    font-size: 2.2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6),
                 0 0 10px rgba(255, 255, 255, 0.3);
    margin-bottom: 3px;
    font-weight: bold;
    filter: drop-shadow(0 0 8px currentColor);
    line-height: 1;
}

.planet-gate-number {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 7px;
    border-radius: 0;
    backdrop-filter: blur(4px);
    line-height: 1;
}

.planet-percentage {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    min-height: 1.4em;
}

/* Warning Card */
.warning-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 16px;
    text-align: center;
}

.warning-card p {
    color: var(--text-light);
    font-weight: 400;
}

/* Chart Container */
.chart-container,
.ai-container,
.data-container {
    max-width: 100%;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 0;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

@media (min-width: 1024px) {
    .ai-container,
    .data-container {
        max-width: 95%;
    }
}

@media (min-width: 1400px) {
    .ai-container,
    .data-container {
        max-width: 96%;
    }
}

.chart-container h2,
.ai-container h2,
.data-container h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: -12px;
    margin-bottom: 16px;
}

/* Result Section */
.result-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.result-section:last-child {
    border-bottom: none;
}

.result-section h3 {
    color: var(--text-dark);
    margin-bottom: 12px;
    font-size: 1.2rem;
    font-weight: 300;
}

.result-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.result-section strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent-gradient);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 0.85rem;
    margin: 4px;
    font-weight: 400;
}

.gate-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gate {
    display: inline-block;
    padding: 10px 16px;
    background: var(--accent-gradient);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-weight: 400;
    font-size: 0.9rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--bg-elevated);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--text-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Date and Time Input Groups */
.date-inputs,
.time-inputs {
    display: flex;
    gap: 12px;
    align-items: center;
}

.date-inputs select,
.time-inputs select {
    flex: 1;
    min-width: 0;
}

.date-inputs select:first-child {
    flex: 1.2; /* Year gets slightly more space */
}

.time-separator {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0 4px;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:active {
    background: var(--bg-card);
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--text-dark);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error */
.error {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 12px;
    color: var(--text-light);
    margin-top: 16px;
    font-size: 0.9rem;
}

/* AI Tab Fullscreen Layout */
.ai-tab-fullscreen {
    padding: 0 !important;
}

.ai-tab-fullscreen.active {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Voice Tab Fullscreen Layout */
.voice-tab-fullscreen {
    padding: 0 !important;
}

.voice-tab-fullscreen.active {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.ai-container-fullscreen {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
}

.ai-header {
    display: none; /* Hidden as per user request */
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
}

.ai-header h2 {
    font-size: 1.3rem;
    margin: 0 0 4px 0;
    color: var(--text-dark);
    font-weight: 300;
}

.ai-header .subtitle {
    margin: 0;
    font-size: 0.85rem;
}

.ai-header-actions {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.btn-save-conversation {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.2), rgba(176, 184, 196, 0.2));
    border: 1px solid rgba(176, 184, 196, 0.3);
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: 0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-save-conversation:hover {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.3), rgba(176, 184, 196, 0.3));
    border-color: rgba(176, 184, 196, 0.5);
    box-shadow: 0 4px 12px rgba(176, 184, 196, 0.2);
}

.btn-save-conversation:active {
    transform: translateY(0);
}

.chat-messages-fullscreen {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border: none;
    margin-bottom: 0;
    min-height: auto;
    max-height: none;
}

.chat-input-wrapper {
    flex-shrink: 0;
    padding: 12px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

/* AI Actions Bar */
.ai-actions-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: flex-end;
}

.btn-save-conversation-inline,
.btn-clear-history {
    background: rgba(176, 184, 196, 0.1);
    border: 1px solid rgba(176, 184, 196, 0.3);
    color: rgba(176, 184, 196, 0.9);
    padding: 10px 16px;
    border-radius: 0;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-save-conversation-inline:hover {
    background: rgba(176, 184, 196, 0.2);
    border-color: rgba(176, 184, 196, 0.5);
}

.btn-clear-history {
    background: rgba(255, 75, 75, 0.1);
    border-color: rgba(255, 75, 75, 0.3);
    color: rgba(255, 75, 75, 0.9);
}

.btn-clear-history:hover {
    background: rgba(255, 75, 75, 0.2);
    border-color: rgba(255, 75, 75, 0.5);
}

/* Chat Styles */
.chat-messages {
    background: var(--bg-dark);
    border-radius: 0;
    padding: 16px;
    margin-bottom: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
}

.chat-message {
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-message.user {
    text-align: right;
}

.chat-message.assistant {
    text-align: left;
}

.chat-bubble {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 0;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 0.95rem;
}

.chat-message.user .chat-bubble {
    background: var(--accent-gradient);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.chat-message.assistant .chat-bubble {
    background: var(--bg-elevated);
    color: var(--text-dark);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* Markdown in chat */
.chat-message.assistant .chat-bubble h2,
.chat-message.assistant .chat-bubble h3,
.chat-message.assistant .chat-bubble h4 {
    color: var(--text-dark);
    margin-top: 12px;
    margin-bottom: 8px;
    font-weight: 300;
}

.chat-message.assistant .chat-bubble p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.chat-message.assistant .chat-bubble ul {
    margin: 10px 0;
    padding-left: 25px;
}

.chat-message.assistant .chat-bubble li {
    margin-bottom: 5px;
}

.chat-message.assistant .chat-bubble strong {
    font-weight: 500;
    color: var(--text-dark);
}

/* Suggested Questions */
.suggested-questions {
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

#suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-btn {
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-light);
}

.suggestion-btn:active {
    background: var(--accent-gradient);
    color: var(--text-dark);
    border-color: var(--text-light);
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.chat-input-container input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    background: var(--bg-elevated);
    color: var(--text-dark);
    transition: all 0.2s;
}

.chat-input-container input:focus {
    outline: none;
    border-color: var(--text-light);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.chat-input-container button {
    padding: 14px 24px;
    white-space: nowrap;
    border-radius: 0;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar,
.chat-messages-fullscreen::-webkit-scrollbar,
.app-main::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-messages-fullscreen::-webkit-scrollbar-track,
.app-main::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 0;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-messages-fullscreen::-webkit-scrollbar-thumb,
.app-main::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 0;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-messages-fullscreen::-webkit-scrollbar-thumb:hover,
.app-main::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Responsive Design */
@media (min-width: 768px) {
    .app-header h1 {
        font-size: 2rem;
    }
    
    .clock-display .time {
        font-size: 3rem;
    }
    
    .bottom-nav {
        padding: 12px 0;
    }
    
    .nav-icon {
        font-size: 1.75rem;
    }
    
    .nav-label {
        font-size: 0.85rem;
    }
}

@media (min-width: 1024px) {
    .app-main {
        padding: 24px 16px 100px 16px;
    }
    
    .planet-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Safe area for iOS devices */
@supports (padding: max(0px)) {
    .app-main {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    
    .app-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Can be implemented later */
}

/* Prevent zoom on input focus for iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select,
    textarea,
    input {
        font-size: 16px !important;
    }
}

/* Map Modal */
.map-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.map-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.map-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(35, 35, 35, 0.95) 100%);
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.map-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-dark);
}

.map-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
    border-radius: 0;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.map-search-container {
    padding: 16px 20px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#map-search-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: var(--text-dark);
    font-size: 0.95rem;
}

#map-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.btn-map-search,
.btn-use-location {
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.2) 0%, rgba(176, 184, 196, 0.1) 100%);
    border: 1px solid rgba(176, 184, 196, 0.3);
    border-radius: 0;
    color: #B0B8C4;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-map-search:hover,
.btn-use-location:hover {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.3) 0%, rgba(176, 184, 196, 0.15) 100%);
    border-color: rgba(176, 184, 196, 0.5);
}

.map-container {
    flex: 1;
    min-height: 400px;
    position: relative;
    border-radius: 0;
}

.map-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selected-coords {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.coord-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.coord-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.coord-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    font-family: var(--hx-font-mono);
}

.btn-open-map {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.2) 0%, rgba(176, 184, 196, 0.1) 100%);
    border: 1px solid rgba(176, 184, 196, 0.3);
    border-radius: 0;
    color: #B0B8C4;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-open-map:hover {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.3) 0%, rgba(176, 184, 196, 0.15) 100%);
    border-color: rgba(176, 184, 196, 0.5);
    box-shadow: 0 4px 12px rgba(176, 184, 196, 0.3);
}

/* Leaflet marker custom style */
.custom-marker {
    background: linear-gradient(135deg, #B0B8C4 0%, #B0B8C4 100%);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .map-modal {
        padding: 0;
    }
    
    .map-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .map-container {
        min-height: 300px;
    }
    
    .map-search-container {
        flex-wrap: wrap;
    }
    
    .btn-use-location {
        flex: 1;
        min-width: 140px;
    }
}

/* ============================================
   MODERN CHART TAB STYLES
   ============================================ */

.chart-container-modern {
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 20px;
}

@media (min-width: 1024px) {
    .chart-container-modern {
        max-width: 95%;
    }
}

@media (min-width: 1400px) {
    .chart-container-modern {
        max-width: 96%;
    }
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h2 {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-dark);
    margin: 0;
}

.btn-download {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.2) 0%, rgba(176, 184, 196, 0.1) 100%);
    border: 1px solid rgba(176, 184, 196, 0.3);
    border-radius: 0;
    color: #B0B8C4;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-download:hover {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.3) 0%, rgba(176, 184, 196, 0.15) 100%);
}

/* Hero Cards Grid */
.hero-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.hero-card {
    background: linear-gradient(135deg, rgba(36, 36, 42, 0.6) 0%, rgba(20, 20, 24, 0.4) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.6;
}

.hero-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
}

.type-card { color: #D1AE53; }
.authority-card { color: #FEA753; }
.profile-card { color: #D1AE53; }

.hero-card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.9;
}

.hero-card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 600;
}

.hero-card-content {
    min-height: 80px;
}

.hero-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.hero-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.hero-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
}

.profile-lines {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.profile-line {
    background: rgba(176, 184, 196, 0.04);
    padding: 10px;
    border-radius: 0;
    text-align: center;
    border: 1px solid rgba(176, 184, 196, 0.06);
}

.line-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.line-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Data Cards */
.data-card {
    background: linear-gradient(135deg, rgba(20, 20, 24, 0.95) 0%, rgba(36, 36, 42, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
                0 2px 8px rgba(255, 255, 255, 0.05) inset;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s;
}

.data-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.data-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.data-card-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.data-card-header h3 {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-dark);
    margin: 0;
}

.data-card-content {
    color: var(--text-dark);
}

/* Dual Grid */
.dual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* Cross Card */
.cross-info {
    margin-bottom: 16px;
}

.cross-type {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 6px;
}

.cross-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.cross-gates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gate-pair {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.gate-item.personality {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.1) 0%, rgba(209, 174, 83, 0.05) 100%);
}

.gate-item.design {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.1) 0%, rgba(255, 75, 75, 0.05) 100%);
}

.gate-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.gate-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Center Badges */
.center-badge-wrapper {
    margin: 4px;
}

.center-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(209, 174, 83, 0.1) 100%);
    border: 1px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #D1AE53;
    transition: all 0.3s ease;
}

.center-badge.clickable {
    cursor: pointer;
    user-select: none;
}

.center-badge.clickable:hover {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.35) 0%, rgba(209, 174, 83, 0.2) 100%);
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.3);
    border-color: rgba(209, 174, 83, 0.5);
}

.center-badge.clickable.badge-active {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.3) 0%, rgba(255, 75, 75, 0.15) 100%);
    border-color: rgba(255, 75, 75, 0.5);
    color: #FF4B4B;
    box-shadow: 0 4px 12px rgba(255, 75, 75, 0.3);
}

/* Channel Items */
.channel-item {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(176, 184, 196, 0.04);
    border-radius: 0;
    border: 1px solid rgba(176, 184, 196, 0.06);
    transition: all 0.2s;
}

.channel-item:hover {
    background: rgba(176, 184, 196, 0.08);
    border-color: rgba(176, 184, 196, 0.12);
}

.channel-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.channel-gates {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Gates Grid */
.gates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
}

.gate-badge-wrapper {
    display: contents;
}

.gate-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.2) 0%, rgba(176, 184, 196, 0.1) 100%);
    border: 1px solid rgba(176, 184, 196, 0.3);
    border-radius: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #B0B8C4;
    transition: all 0.3s ease;
}

.gate-badge.clickable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.gate-badge.clickable::after {
    content: 'âś¨';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.6em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gate-badge.clickable:hover {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.35) 0%, rgba(176, 184, 196, 0.2) 100%);
    box-shadow: 0 6px 16px rgba(176, 184, 196, 0.4);
    border-color: rgba(176, 184, 196, 0.5);
}

.gate-badge.clickable:hover::after {
    opacity: 1;
}

.gate-badge.clickable.badge-active {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.3) 0%, rgba(255, 75, 75, 0.15) 100%);
    border-color: rgba(255, 75, 75, 0.5);
    color: #FF4B4B;
    box-shadow: 0 6px 16px rgba(255, 75, 75, 0.4);
}

.gate-badge.clickable.badge-active::after {
    content: '▼';
    opacity: 1;
}

/* Variables */
.variable-item {
    padding: 16px;
    margin-bottom: 12px;
    background: rgba(176, 184, 196, 0.04);
    border-radius: 0;
    border: 1px solid rgba(176, 184, 196, 0.06);
    transition: all 0.2s;
}

.variable-item:hover {
    background: rgba(176, 184, 196, 0.08);
    border-color: rgba(176, 184, 196, 0.12);
}

.variable-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 600;
}

.variable-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.variable-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.8;
}

.empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-style: italic;
}

@media (max-width: 768px) {
    .hero-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .dual-grid {
        grid-template-columns: 1fr;
    }
    
    .cross-gates {
        grid-template-columns: 1fr;
    }
    
    .gates-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    }
}

/* ============================================
   AI EXPLANATION BUTTONS & CONTAINERS
   ============================================ */

.ai-explain-btn {
    margin-top: 12px;
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.2) 0%, rgba(176, 184, 196, 0.1) 100%);
    border: 1px solid rgba(176, 184, 196, 0.3);
    border-radius: 0;
    color: #B0B8C4;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-explain-btn:hover {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.3) 0%, rgba(176, 184, 196, 0.15) 100%);
    box-shadow: 0 4px 12px rgba(176, 184, 196, 0.2);
}

.ai-explain-btn.active {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.2) 0%, rgba(255, 75, 75, 0.1) 100%);
    border-color: rgba(255, 75, 75, 0.3);
    color: #FF4B4B;
}

.ai-explanation-container {
    margin-top: 12px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.08) 0%, rgba(176, 184, 196, 0.05) 100%);
    border-left: 4px solid #B0B8C4;
    border-radius: 0;
    line-height: 1.8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        max-height: 2000px;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}

.streaming-content {
    min-height: 20px;
}

.ai-explanation-container p {
    margin: 0.8em 0;
    color: var(--text-dark);
}

.ai-explanation-container p:first-child {
    margin-top: 0;
}

.ai-explanation-container p:last-child {
    margin-bottom: 0;
}

.ai-explanation-container strong {
    color: #B0B8C4;
    font-weight: 700;
}

.ai-explanation-container em {
    color: #D1AE53;
    font-style: italic;
}

.ai-explanation-container h1,
.ai-explanation-container h2,
.ai-explanation-container h3 {
    color: #B0B8C4;
    margin: 1em 0 0.5em 0;
    font-weight: 600;
}

.ai-explanation-container h1 {
    font-size: 1.3em;
}

.ai-explanation-container h2 {
    font-size: 1.2em;
}

.ai-explanation-container h3 {
    font-size: 1.1em;
}

.ai-explanation-container ul,
.ai-explanation-container ol {
    margin: 0.8em 0;
    padding-left: 1.8em;
}

.ai-explanation-container li {
    margin: 0.5em 0;
    color: var(--text-dark);
}

.ai-explanation-container li::marker {
    color: #B0B8C4;
}

.ai-explanation-container code {
    background: rgba(176, 184, 196, 0.15);
    padding: 2px 6px;
    border-radius: 0;
    font-family: var(--hx-font-mono);
    font-size: 0.9em;
    color: #B0B8C4;
}

.ai-explanation-container blockquote {
    border-left: 3px solid #D1AE53;
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-light);
    font-style: italic;
}

.ai-explanation-loading {
    color: #B0B8C4;
    padding: 16px;
    text-align: center;
    font-style: italic;
    animation: pulse 1.5s ease-in-out infinite;
    font-size: 0.95em;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.ai-explanation-error {
    color: #FF4B4B;
    padding: 16px;
    text-align: center;
    font-style: italic;
    background: rgba(255, 75, 75, 0.1);
    border-radius: 0;
    border: 1px solid rgba(255, 75, 75, 0.3);
}

/* ============================================
   AUTO-FILL NOTIFICATION ANIMATIONS
   ============================================ */

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ============================================
   PRINT PDF FUNCTIONALITY
   ============================================ */

/* Chart Header */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-header h2 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 200px;
}

/* Chart Actions */
.chart-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-reset {
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.2) 0%, rgba(255, 75, 75, 0.1) 100%);
    color: #FF4B4B;
    border: 1px solid rgba(255, 75, 75, 0.3);
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.3) 0%, rgba(255, 75, 75, 0.15) 100%);
    border-color: rgba(255, 75, 75, 0.5);
    box-shadow: 0 4px 12px rgba(255, 75, 75, 0.3);
}

/* Realtime Actions */
.bottom-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.bottom-controls .btn-reset-small {
    flex-shrink: 0;
}

.btn-reset-small {
    width: 40px;
    height: 40px;
    padding: 0;
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.2) 0%, rgba(255, 75, 75, 0.1) 100%);
    color: #FF4B4B;
    border: 1px solid rgba(255, 75, 75, 0.3);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-reset-small:hover {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.3) 0%, rgba(255, 75, 75, 0.15) 100%);
    border-color: rgba(255, 75, 75, 0.5);
    box-shadow: 0 4px 12px rgba(255, 75, 75, 0.3);
}

/* Print Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.modal-dialog {
    background: linear-gradient(135deg, rgba(36, 36, 42, 0.98) 0%, rgba(20, 20, 24, 0.98) 100%);
    border-radius: 0;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideDown 0.4s ease-out;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 24px;
}

.modal-description {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.missing-list {
    background: rgba(209, 174, 83, 0.1);
    border-left: 4px solid #D1AE53;
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 0;
}

.missing-list ul {
    margin: 12px 0 0 0;
    padding-left: 24px;
    color: var(--text-light);
}

.missing-list li {
    margin: 6px 0;
}

.modal-question {
    margin: 24px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-danger {
    background: linear-gradient(135deg, #FF4B4B 0%, #FF4B4B 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #FF4B4B 0%, #FF4B4B 100%);
    box-shadow: 0 4px 12px rgba(255, 75, 75, 0.4);
}

.reset-warning {
    background: rgba(255, 75, 75, 0.1);
    border-left: 4px solid #FF4B4B;
    padding: 16px;
    margin: 20px 0;
    border-radius: 0;
    color: var(--text-light);
    line-height: 1.6;
}

.reset-warning strong {
    color: #FF4B4B;
}

.reset-modal-dialog {
    max-width: 500px;
}

/* Generation Progress */
.generation-progress {
    margin: 24px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #D1AE53 0%, #7A5F1C 100%);
    transition: width 0.5s ease;
    border-radius: 0;
}

.progress-text {
    text-align: center;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 16px;
}

.streaming-preview {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
    padding: 16px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
}

.streaming-item {
    color: #D1AE53;
    font-weight: 600;
    margin-bottom: 8px;
}

.streaming-item-complete {
    color: #D1AE53;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Print View (Hidden) */
.print-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: -1;
    opacity: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    /* Force white background for EVERYTHING */
    body {
        background: white !important;
        background-color: white !important;
    }
    
    /* Hide everything except print view */
    body > *:not(#print-view):not(#match-print-container) {
        display: none !important;
    }
    
    #print-view, #match-print-container {
        display: block !important;
        position: static !important;
        z-index: auto !important;
        opacity: 1 !important;
        background: white !important;
    }
    
    /* NUCLEAR: Force white background for EVERYTHING */
    * {
        background-color: white !important;
        background-image: none !important;
    }
    
    /* Allow ONLY light gradients/colors for specific elements */
    
    /* Human Design PDF elements */
    .print-cover {
        background: linear-gradient(135deg, #F6F3EC 0%, #F6F3EC 50%, #F6F3EC 100%) !important;
    }
    
    .print-cover::before {
        background: radial-gradient(circle, rgba(209, 174, 83, 0.05) 0%, transparent 70%) !important;
    }
    
    .print-gate-item {
        background: linear-gradient(135deg, #D1AE53 0%, #7A5F1C 100%) !important;
    }
    
    .print-section {
        background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%) !important;
    }
    
    .print-section-compact {
        background: #f9fafb !important;
    }
    
    .print-cover-info {
        background: white !important;
    }
    
    /* Match PDF elements */
    .match-title-page {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    }
    
    .match-person-block {
        background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(209, 174, 83, 0.08) 100%) !important;
    }
    
    .match-person-tag {
        background: linear-gradient(135deg, rgba(209, 174, 83, 0.25) 0%, rgba(209, 174, 83, 0.15) 100%) !important;
    }
    
    .match-insight-box {
        background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(209, 174, 83, 0.1) 100%) !important;
    }
    
    .match-warning-box {
        background: linear-gradient(135deg, rgba(254, 167, 83, 0.2) 0%, rgba(254, 167, 83, 0.1) 100%) !important;
    }
    
    .match-tip-box {
        background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(209, 174, 83, 0.1) 100%) !important;
    }
    
    .match-quote-box {
        background: linear-gradient(135deg, rgba(122, 95, 28, 0.15) 0%, rgba(122, 95, 28, 0.08) 100%) !important;
    }
    
    /* Print page setup */
    @page {
        size: A4;
        margin: 15mm;
    }
    
    /* Print pages */
    .print-page {
        page-break-after: always;
        page-break-inside: avoid;
        padding: 40px;
        background: white !important;
        color: #1a1a1a;
        min-height: auto;
        position: relative;
        font-family: var(--hx-font-body);
    }
    
    .print-page:last-child {
        page-break-after: auto;
    }
    
    /* Cover page */
    .print-cover {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        text-align: center;
        background: linear-gradient(135deg, #F6F3EC 0%, #F6F3EC 50%, #F6F3EC 100%);
        position: relative;
        overflow: hidden;
    }
    
    .print-cover::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(209, 174, 83, 0.05) 0%, transparent 70%);
        animation: rotate 60s linear infinite;
    }
    
    @keyframes rotate {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }
    
    .print-header h1 {
        font-size: 3rem;
        margin: 0 0 12px 0;
        color: #D1AE53;
        font-weight: 700;
        font-family: var(--hx-font-body);
        letter-spacing: 0.02em;
    }
    
    .print-subtitle {
        font-size: 1.5rem;
        color: #666;
        margin-bottom: 60px;
        font-family: var(--hx-font-body);
        font-weight: 300;
    }
    
    .print-cover-info {
        background: white;
        padding: 40px;
        border-radius: 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        text-align: left;
    }
    
    .print-info-row {
        display: flex;
        justify-content: space-between;
        padding: 12px 0;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .print-info-row:last-child {
        border-bottom: none;
    }
    
    .print-label {
        font-weight: 600;
        color: #666;
        font-family: var(--hx-font-body);
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .print-value {
        color: #1a1a1a;
        font-weight: 500;
        font-family: var(--hx-font-body);
    }
    
    /* Page title */
    .print-page-title {
        font-size: 2rem;
        color: #D1AE53;
        margin: 0 0 24px 0;
        padding-bottom: 12px;
        border-bottom: 3px solid #D1AE53;
        font-family: var(--hx-font-body);
        font-weight: 600;
        letter-spacing: 0.01em;
    }
    
    /* Sections */
    .print-section {
        margin-bottom: 32px;
        padding: 20px;
        background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
        border-radius: 0;
        border-left: 4px solid #D1AE53;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .print-section-title {
        font-size: 1.5rem;
        color: #D1AE53;
        margin: 0 0 16px 0;
        font-weight: 600;
        font-family: var(--hx-font-body);
        letter-spacing: 0.03em;
    }
    
    .print-content {
        color: #1a1a1a;
        line-height: 1.8;
        font-family: var(--hx-font-body);
    }
    
    .print-big-text {
        font-size: 1.9rem;
        font-weight: 800;
        color: #1a1a1a;
        margin-bottom: 8px;
        font-family: var(--hx-font-body);
        letter-spacing: 0.01em;
    }
    
    .print-strategy {
        font-size: 1.15rem;
        color: #D1AE53;
        margin-bottom: 16px;
        font-style: italic;
        font-family: var(--hx-font-body);
        font-weight: 400;
    }
    
    .print-description {
        color: #444;
        line-height: 1.7;
        margin-bottom: 16px;
        font-family: var(--hx-font-body);
        font-weight: 300;
    }
    
    .print-lines {
        display: flex;
        gap: 24px;
        margin: 12px 0;
        font-size: 1.05rem;
        color: #666;
        font-weight: 400;
        font-family: var(--hx-font-body);
    }
    
    .print-lines span {
        font-weight: 400;
    }
    
    /* Compact sections */
    .print-section-compact {
        margin-bottom: 20px;
        padding: 16px;
        background: #f9fafb;
        border-radius: 0;
        border-left: 3px solid #7A5F1C;
        page-break-inside: avoid;
        break-inside: avoid;
        orphans: 3;
        widows: 3;
    }
    
    .print-item-title {
        font-size: 1.2rem;
        color: #7A5F1C;
        margin: 0 0 12px 0;
        font-weight: 600;
        font-family: var(--hx-font-body);
        letter-spacing: 0.02em;
    }
    
    .print-gates {
        color: #666;
        margin-bottom: 12px;
        font-size: 0.95rem;
    }
    
    /* AI Explanations */
    .print-ai-explanation {
        margin-top: 12px;
        padding: 12px;
        background: white;
        border-radius: 0;
        color: #333;
        line-height: 1.7;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        font-family: var(--hx-font-body);
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .print-ai-explanation p {
        margin: 8px 0;
        orphans: 2;
        widows: 2;
    }
    
    .print-ai-explanation strong {
        color: #D1AE53;
        font-weight: 700;
        font-family: var(--hx-font-body);
    }
    
    .print-ai-explanation em {
        color: #7A5F1C;
        font-style: italic;
        font-weight: 400;
        font-family: var(--hx-font-body);
    }
    
    .print-ai-explanation h3,
    .print-ai-explanation h4,
    .print-ai-explanation h5 {
        font-family: var(--hx-font-body);
        font-weight: 600;
        color: #D1AE53;
        margin-top: 16px;
        margin-bottom: 8px;
    }
    
    .print-ai-explanation h3 {
        font-size: 1.3rem;
        font-weight: 700;
    }
    
    .print-ai-explanation h4 {
        font-size: 1.15rem;
        font-weight: 600;
    }
    
    .print-ai-explanation h5 {
        font-size: 1.05rem;
        font-weight: 600;
        color: #7A5F1C;
    }
    
    .print-ai-explanation ul {
        margin: 12px 0;
        padding-left: 28px;
        font-weight: 300;
    }
    
    .print-ai-explanation li {
        margin: 6px 0;
        line-height: 1.6;
    }
    
    .print-ai-explanation li strong {
        font-weight: 600;
    }
    
    .print-no-explanation {
        color: #999;
        font-style: italic;
        padding: 8px;
        font-family: var(--hx-font-body);
    }
    
    /* Gates grid */
    .print-gates-grid {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        gap: 8px;
        margin-bottom: 24px;
    }
    
    .print-gate-item {
        background: linear-gradient(135deg, #D1AE53 0%, #7A5F1C 100%);
        color: white;
        padding: 12px;
        border-radius: 0;
        text-align: center;
        font-weight: 700;
        font-size: 1.1rem;
        font-family: var(--hx-font-body);
    }
    
    .print-gate-number {
        font-family: var(--hx-font-body);
        font-weight: 700;
    }
    
    .print-gates-explanations {
        margin-top: 24px;
    }
    
    /* Footer */
    .print-footer {
        position: fixed;
        bottom: 10mm;
        left: 15mm;
        right: 15mm;
        display: flex;
        justify-content: space-between;
        color: #999;
        font-size: 0.85rem;
        padding-top: 12px;
        border-top: 1px solid #e0e0e0;
    }
    
    /* ==================== MATCH PDF STYLES ==================== */
    
    .match-print-page {
        page-break-after: always;
        page-break-inside: avoid;
        padding: 40px;
        background: white !important;
        color: #1a1a1a;
        min-height: auto;
        position: relative;
        font-family: var(--hx-font-body);
    }
    
    /* Match Title Page */
    .match-title-page {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        color: #3B3C46;
    }
    
    .match-title-content {
        width: 100%;
        max-width: 600px;
    }
    
    .match-title-logo {
        margin-bottom: 60px;
    }
    
    .match-title-persons {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        margin: 50px 0;
        padding: 40px 0;
        border-top: 1px solid rgba(209, 174, 83, 0.3);
        border-bottom: 1px solid rgba(209, 174, 83, 0.3);
    }
    
    .match-title-person {
        text-align: center;
        flex: 1;
    }
    
    .match-person-initial {
        width: 80px;
        height: 80px;
        margin: 0 auto 16px;
        border-radius: 50%;
        background: #ffffff;
        border: 3px solid #D1AE53;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        font-weight: 600;
        color: #D1AE53;
    }
    
    .match-person-name {
        font-size: 1.3rem;
        font-weight: 400;
        margin-bottom: 8px;
        color: #3B3C46;
    }
    
    .match-person-type {
        font-size: 0.9rem;
        color: #5a6c7d;
        font-weight: 300;
    }
    
    .match-title-relation {
        font-size: 1.5rem;
        font-weight: 400;
        color: #D1AE53;
        margin: 40px 0;
        letter-spacing: 1px;
    }
    
    .match-title-footer {
        margin-top: 80px;
        padding-top: 32px;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        text-align: center;
    }
    
    /* Match Print Section */
    .match-print-section {
        margin-bottom: 40px;
    }
    
    .match-print-heading {
        font-size: 1.8rem;
        font-weight: 400;
        color: #1a1a1a;
        margin-bottom: 24px;
        padding-bottom: 12px;
        border-bottom: 2px solid rgba(209, 174, 83, 0.3);
        font-family: var(--hx-font-body);
    }
    
    .match-print-content {
        line-height: 1.8;
        color: #2d2d2d;
        font-size: 1rem;
    }
    
    .match-print-content p {
        margin-bottom: 16px;
    }
    
    .match-print-content strong {
        color: #1a1a1a;
        font-weight: 600;
    }
    
    /* Match Intro */
    .match-print-intro {
        padding: 0 20px;
    }
    
    /* Match Advice Cards in Print */
    .match-advice-card {
        page-break-inside: avoid;
        margin-bottom: 20px;
        padding: 20px;
        background: rgba(209, 174, 83, 0.08);
        border-left: 4px solid rgba(209, 174, 83, 0.8);
        border-radius: 0;
    }
    
    .match-advice-for {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        color: #D1AE53;
        margin-bottom: 8px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .match-advice-text {
        color: #2d2d2d;
        line-height: 1.7;
        font-size: 0.95rem;
    }
    
    /* Match Comparison Table in Print */
    .match-comparison-table {
        width: 100%;
        border-collapse: collapse;
        margin: 20px 0;
        page-break-inside: avoid;
    }
    
    .match-comparison-table th,
    .match-comparison-table td {
        padding: 12px;
        text-align: left;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .match-comparison-table th {
        background: rgba(209, 174, 83, 0.15);
        color: #1a1a1a;
        font-weight: 600;
        font-size: 0.95rem;
    }
    
    .match-comparison-table td {
        color: #2d2d2d;
        font-size: 0.9rem;
    }
    
    .match-comparison-table tr:hover {
        background: rgba(0, 0, 0, 0.02);
    }
    
    /* Match Closing Page */
    .match-print-closing {
        padding: 60px 40px;
    }
    
    /* Fix white text colors for PDF print */
    .metric-label {
        color: #3B3C46 !important;
    }
    
    .person-name {
        color: #3B3C46 !important;
    }
    
    .bar-value {
        color: #3B3C46 !important;
        text-shadow: none !important;
    }
    
    .overflow .bar-value {
        color: #FEA753 !important;
        text-shadow: none !important;
    }
    
    /* Simplify AI-generated content for PDF */
    .match-person-block {
        display: block !important;
        margin: 12px 0 !important;
        padding: 12px 16px !important;
        background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(209, 174, 83, 0.08) 100%) !important;
        border-left: 4px solid #D1AE53 !important;
        border-radius: 0 !important;
        page-break-inside: avoid !important;
    }
    
    .match-person-block .person-label {
        font-weight: 700 !important;
        color: #D1AE53 !important;
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
        display: block !important;
    }
    
    .match-person-block .person-content {
        color: #3B3C46 !important;
        line-height: 1.7 !important;
        display: block !important;
    }
    
    .match-person-tag {
        display: inline !important;
        padding: 2px 8px !important;
        background: linear-gradient(135deg, rgba(209, 174, 83, 0.25) 0%, rgba(209, 174, 83, 0.15) 100%) !important;
        border-radius: 0 !important;
        font-weight: 600 !important;
        color: #D1AE53 !important;
        white-space: nowrap !important;
    }
    
    .match-insight-box,
    .match-warning-box,
    .match-tip-box,
    .match-quote-box {
        display: block !important;
        margin: 16px 0 !important;
        padding: 12px 16px !important;
        border-radius: 0 !important;
        page-break-inside: avoid !important;
        line-height: 1.7 !important;
    }
    
    .match-insight-box {
        background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(209, 174, 83, 0.1) 100%) !important;
        border-left: 4px solid #D1AE53 !important;
        color: #3B3C46 !important;
    }
    
    .match-warning-box {
        background: linear-gradient(135deg, rgba(254, 167, 83, 0.2) 0%, rgba(254, 167, 83, 0.1) 100%) !important;
        border-left: 4px solid #FEA753 !important;
        color: #3B3C46 !important;
    }
    
    .match-tip-box {
        background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(209, 174, 83, 0.1) 100%) !important;
        border-left: 4px solid #D1AE53 !important;
        color: #3B3C46 !important;
    }
    
    .match-quote-box {
        background: linear-gradient(135deg, rgba(122, 95, 28, 0.15) 0%, rgba(122, 95, 28, 0.08) 100%) !important;
        border-left: 4px solid #7A5F1C !important;
        color: #3B3C46 !important;
        font-style: italic !important;
    }
    
    /* Remove all pseudo-element dark backgrounds */
    .match-print-page *::before,
    .match-print-page *::after,
    .print-page *::before,
    .print-page *::after {
        background-color: transparent !important;
        background-image: none !important;
    }
    
    /* All other backgrounds already handled by * rule above */
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablets and smaller */
@media screen and (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-header h2 {
        font-size: 1.5rem;
        width: 100%;
        margin-bottom: 12px;
    }
    
    .chart-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .btn-reset,
    .btn-download {
        flex: 1 1 auto;
        min-width: 80px;
        padding: 10px 12px;
        font-size: 0.85rem;
        text-align: center;
    }
    
    /* Clock header in Real-Time */
    .clock-header {
        padding: 16px;
    }
    
    .clock-with-nav {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .clock-display {
        flex: 1;
        min-width: 180px;
    }
    
    .clock-display .time {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .clock-display .date {
        font-size: 0.85rem;
    }
    
    .btn-day-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }
    
    .bottom-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .btn-reset-small {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .time-controls {
        gap: 6px;
    }
    
    .btn-mode {
        font-size: 0.85rem;
        padding: 10px;
    }
}

/* Mobile phones */
@media screen and (max-width: 480px) {
    .chart-header h2 {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    .chart-actions {
        gap: 8px;
    }
    
    .btn-reset,
    .btn-download {
        padding: 8px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    /* Stack buttons vertically if needed */
    .chart-actions.stacked {
        flex-direction: column;
        width: 100%;
    }
    
    .chart-actions.stacked .btn-reset,
    .chart-actions.stacked .btn-download {
        width: 100%;
    }
    
    /* Time controls in Real-Time */
    .time-controls {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .btn-mode {
        width: 100%;
        justify-content: center;
    }
    
    .notification-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-notification,
    .notification-status {
        width: 100%;
        justify-content: center;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        width: 95%;
        max-width: 95%;
        margin: 10px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* Very small screens */
@media screen and (max-width: 360px) {
    .chart-header h2 {
        font-size: 1.1rem;
    }
    
    .btn-reset,
    .btn-download {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
}

/* ============================================
   VOICE CHAT STYLES
   ============================================ */

.voice-chat-container {
    max-width: 95%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0; /* Allow flexbox to shrink */
    overflow: hidden;
}

@media (min-width: 1400px) {
    .voice-chat-container {
        max-width: 96%;
    }
}

@media (min-width: 1920px) {
    .voice-chat-container {
        max-width: 97%;
    }
}

/* Voice Visualizer - Fluid Circle (Fixed at top) */
.voice-visualizer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 20px;
    flex-shrink: 0;
}

.voice-circle {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-circle.clickable {
    cursor: pointer;
}

.voice-circle.clickable:hover .circle-inner {
    box-shadow: 
        0 0 50px rgba(100, 100, 150, 0.5),
        inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.voice-circle.clickable:active .circle-inner {
    transform: scale(0.98);
}

.circle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B3C46 0%, #24242A 100%);
    box-shadow: 
        0 0 40px rgba(100, 100, 150, 0.3),
        inset 0 0 40px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease-out;
}

.circle-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(176, 184, 196, 0.4);
    opacity: 0;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.circle-pulse.pulse-2 {
    animation-delay: 1s;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Circle States */
.voice-circle.idle .circle-inner {
    background: linear-gradient(135deg, #3B3C46 0%, #24242A 100%);
    box-shadow: 
        0 0 40px rgba(100, 100, 150, 0.3),
        inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.voice-circle.listening .circle-inner {
    background: linear-gradient(135deg, #B0B8C4 0%, #B0B8C4 100%);
    box-shadow: 
        0 0 60px rgba(176, 184, 196, 0.6),
        inset 0 0 40px rgba(176, 184, 196, 0.4);
    /* Removed breathing animation - controlled by VAD JS */
}

.voice-circle.thinking .circle-inner {
    background: linear-gradient(135deg, #D1AE53 0%, #FEA753 100%);
    box-shadow: 
        0 0 60px rgba(209, 174, 83, 0.6),
        inset 0 0 40px rgba(254, 167, 83, 0.4);
    animation: rotating 2s linear infinite;
}

.voice-circle.speaking .circle-inner {
    background: linear-gradient(135deg, #D1AE53 0%, #D1AE53 100%);
    box-shadow: 
        0 0 60px rgba(209, 174, 83, 0.6),
        inset 0 0 40px rgba(209, 174, 83, 0.4);
    animation: pulsating 0.6s ease-in-out infinite;
}

.voice-circle.error .circle-inner {
    background: linear-gradient(135deg, #FF4B4B 0%, #FF4B4B 100%);
    box-shadow: 
        0 0 60px rgba(255, 75, 75, 0.6),
        inset 0 0 40px rgba(255, 75, 75, 0.4);
}

@keyframes breathing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes rotating {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulsating {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }
}

/* Audio-reactive animations (applied via JS) */
.voice-circle.audio-active .circle-inner {
    transition: transform 0.05s ease-out, box-shadow 0.1s ease-out;
}

.voice-status {
    margin-top: 20px;
    font-size: 0.95rem;
    color: var(--text-light);
    text-align: center;
    min-height: 24px;
    animation: fadeIn 0.3s ease-in;
}

/* Voice Transcript - scrollable conversation area */
.voice-messages {
    flex: 1;
    min-height: 0; /* Allow scrolling within flex container */
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    /* Full height - scrollable independently */
}

/* Custom scrollbar for voice messages */
.voice-messages::-webkit-scrollbar {
    width: 8px;
}

.voice-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0;
}

.voice-messages::-webkit-scrollbar-thumb {
    background: rgba(176, 184, 196, 0.3);
    border-radius: 0;
}

.voice-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(176, 184, 196, 0.5);
}

.voice-message {
    display: flex;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 0;
    animation: fadeIn 0.4s ease-out;
    max-width: 85%;
    align-items: flex-start;
    position: relative;
    margin-bottom: 8px;
}

/* USER MESSAGES - RIGHT SIDE (chat bubble style) */
.voice-message.user {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.25) 0%, rgba(176, 184, 196, 0.15) 100%);
    border: 1px solid rgba(176, 184, 196, 0.4);
    margin-left: auto;
    margin-right: 0;
    flex-direction: row-reverse; /* Icon on right */
    border-radius: 0 0 0 0;
}

/* ASSISTANT MESSAGES - LEFT SIDE (chat bubble style) */
.voice-message.assistant {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 0;
    margin-right: auto;
    flex-direction: row; /* Icon on left */
    border-radius: 0 0 0 0;
}

/* MINIMALISTIC HUMAN ICONS */
.message-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 8px;
}

.voice-message.user .message-icon {
    background: linear-gradient(135deg, rgba(176, 184, 196, 1) 0%, rgba(176, 184, 196, 0.7) 100%);
    box-shadow: 0 0 8px rgba(176, 184, 196, 0.6);
}

.voice-message.assistant .message-icon {
    background: linear-gradient(135deg, rgba(200, 200, 200, 1) 0%, rgba(150, 150, 150, 0.7) 100%);
    box-shadow: 0 0 8px rgba(200, 200, 200, 0.4);
}

.message-text {
    flex: 1;
    line-height: 1.6;
    color: var(--text-dark);
}

.voice-message.user .message-text {
    text-align: right;
}

.voice-message.assistant .message-text {
    text-align: left;
}

/* Sentence highlighting for TTS */
.sentence-fragment {
    display: inline;
    transition: all 0.3s ease;
    border-radius: 0;
    padding: 2px 0;
}

.sentence-fragment.speaking {
    background: rgba(209, 174, 83, 0.25);
    box-shadow: 0 0 10px rgba(209, 174, 83, 0.3);
    font-weight: 500;
}

.message-streaming {
    opacity: 0.7;
}

/* Empty state */
.voice-messages:empty::before {
    content: '';
    display: block;
}

/* Conversation History Styles */
.conversation-history-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.conversation-history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.conversation-history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(176, 184, 196, 0.3);
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    user-select: none;
}

.conversation-header:hover {
    background: rgba(176, 184, 196, 0.1);
}

.conversation-info {
    flex: 1;
}

.conversation-title {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.conversation-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.conversation-date {
    color: rgba(176, 184, 196, 0.8);
}

.conversation-count {
    color: var(--text-light);
}

.conversation-toggle {
    font-size: 1.2rem;
    color: var(--text-light);
    transition: transform 0.3s ease;
    margin-left: 12px;
}

.conversation-history-item:not(.collapsed) .conversation-toggle {
    transform: rotate(180deg);
}

.conversation-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    padding-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideDown 0.3s ease;
    max-height: 400px;
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Ensure all expanded conversation messages have scroll */
.conversation-history-item:not(.collapsed) .conversation-messages {
    display: flex !important;
    overflow-y: auto !important;
}

/* Custom scrollbar for conversation messages */
.conversation-messages::-webkit-scrollbar {
    width: 6px;
}

.conversation-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
}

.conversation-messages::-webkit-scrollbar-thumb {
    background: rgba(176, 184, 196, 0.4);
    border-radius: 0;
}

.conversation-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(176, 184, 196, 0.6);
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.history-message {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 0;
    max-width: 90%;
    align-items: flex-start;
}

.history-message.user {
    background: rgba(176, 184, 196, 0.15);
    border: 1px solid rgba(176, 184, 196, 0.3);
    margin-left: auto;
    flex-direction: row-reverse;
    border-radius: 0 0 0 0;
}

.history-message.assistant {
    background: rgba(209, 174, 83, 0.12);
    border: 1px solid rgba(209, 174, 83, 0.3);
    margin-right: auto;
    border-radius: 0 0 0 0;
}

.history-message .message-icon {
    font-size: 1rem;
    line-height: 1;
}

.history-message .message-text {
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.5;
}

.conversation-history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

/* Responsive Voice Chat */
@media screen and (max-width: 768px) {
    .voice-circle {
        width: 220px;
        height: 220px;
    }
    
    .voice-visualizer {
        padding: 40px 20px 30px;
    }
    
    .voice-messages {
        padding: 15px 10px;
    }
    
    .voice-message {
        padding: 10px 14px;
        max-width: 90%; /* Slightly wider on mobile */
    }
    
    .message-text {
        font-size: 0.95rem;
    }
}

@media screen and (max-width: 480px) {
    .voice-circle {
        width: 180px;
        height: 180px;
    }
    
    .voice-visualizer {
        padding: 30px 15px 20px;
    }
    
    .voice-status {
        font-size: 0.85rem;
    }
    
    .voice-messages {
        padding: 12px 8px;
        gap: 8px;
    }
    
    .voice-message {
        padding: 8px 12px;
        max-width: 92%;
        border-radius: 0;
    }
    
    .voice-message.user {
        border-radius: 0 0 0 0;
    }
    
    .voice-message.assistant {
        border-radius: 0 0 0 0;
    }
    
    .message-icon {
        width: 6px;
        height: 6px;
        margin-top: 6px;
    }
    
    .message-text {
        font-size: 0.9rem;
    }
}

/* ============================================ */
/* HIGH RESOLUTION DISPLAYS (FullHD & 4K)      */
/* ============================================ */

/* Large Desktop - 1440px+ (HD+) */
@media screen and (min-width: 1440px) {
    :root {
        font-size: 17px; /* Slightly larger base font */
    }

    .app-header h1 {
        font-size: 2.2rem;
        letter-spacing: 0.15em;
    }

    .app-main {
        padding: 32px 20px 120px 20px;
    }

    /* Wider containers for more content */
    .chart-container-modern,
    .ai-container,
    .data-container,
    .realtime-container,
    .voice-chat-container {
        max-width: 1200px;
    }

    /* Map modal larger */
    .map-modal {
        max-width: 1100px;
    }

    /* Better grid layouts */
    .hero-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 24px;
    }

    /* Voice chat - bigger circle */
    .voice-circle {
        width: 280px;
        height: 280px;
    }

    .voice-messages {
        font-size: 1rem;
        padding: 20px 16px;
    }
    
    .voice-message {
        max-width: 80%;
        padding: 14px 20px;
    }
}
/* ==================== MATCH MODULE ==================== */

.match-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.match-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.match-header h2 {
    color: var(--text-dark);
    font-size: 2rem;
    margin-bottom: 12px;
    font-weight: 300;
    letter-spacing: 2px;
}

.match-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 300;
}

.match-step {
    margin-bottom: 40px;
}

.match-step h3 {
    color: var(--text-dark);
    font-size: 1.3rem;
    margin-bottom: 24px;
    font-weight: 400;
}

/* Upload Grid */
.match-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.match-person-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 24px;
    transition: all 0.3s ease;
}

.match-person-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.match-person-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-person-icon {
    font-size: 2rem;
}

.match-person-header h4 {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}

.match-person-info {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(209, 174, 83, 0.1);
    border: 1px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
}

.match-person-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.match-person-detail:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.match-label {
    color: var(--text-light);
    font-weight: 300;
}

.match-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 0;
    transition: all 0.3s ease;
}

.match-upload-area:hover {
    border-color: rgba(209, 174, 83, 0.5);
    background: rgba(209, 174, 83, 0.05);
}

.match-upload-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Manual Input Form */
.match-manual-form {
    margin-top: 16px;
    padding: 20px;
    background: rgba(209, 174, 83, 0.08);
    border: 1px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
}

.match-manual-form h5 {
    color: #D1AE53;
    font-size: 1.1rem;
    margin: 0 0 16px 0;
    font-weight: 500;
}

.match-manual-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.match-manual-input {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.match-manual-input:focus {
    outline: none;
    border-color: #D1AE53;
    background: rgba(0, 0, 0, 0.3);
}

.match-manual-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.btn-upload {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2), rgba(209, 174, 83, 0.1));
    border: 1px solid rgba(209, 174, 83, 0.4);
    color: #D1AE53;
    padding: 12px 24px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-upload:hover {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.3), rgba(209, 174, 83, 0.15));
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.3);
}

/* Relationship Type Selection */
.match-relationship-select {
    margin-top: 40px;
}

.match-relationship-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.match-relation-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.match-relation-btn:hover {
    border-color: rgba(209, 174, 83, 0.5);
    background: rgba(209, 174, 83, 0.1);
    box-shadow: 0 8px 24px rgba(209, 174, 83, 0.2);
}

.match-relation-btn.selected {
    border-color: rgba(209, 174, 83, 0.8);
    background: rgba(209, 174, 83, 0.2);
    box-shadow: 0 0 20px rgba(209, 174, 83, 0.3);
}

.match-relation-icon {
    font-size: 2.5rem;
}

.match-relation-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
}

.match-relation-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 300;
}

/* Match Results */
.match-results {
    margin-top: 40px;
}

.match-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(209, 174, 83, 0.05) 100%);
    border: 1px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
    margin-bottom: 32px;
}

.match-results-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.match-results-title h3 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin: 0;
    font-weight: 400;
}

.match-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(209, 174, 83, 0.2);
    border: 1px solid rgba(209, 174, 83, 0.4);
    border-radius: 0;
    font-size: 1.2rem;
    font-weight: 500;
    color: #D1AE53;
}

.match-section {
    margin-bottom: 32px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
}

.match-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-section-header.collapsible {
    cursor: pointer;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.08) 0%, rgba(209, 174, 83, 0.03) 100%);
    border-radius: 0;
    border: 2px solid rgba(209, 174, 83, 0.2);
    transition: all 0.3s ease;
    margin-bottom: 0;
    padding-bottom: 16px;
}

.match-section-header.collapsible:hover {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(209, 174, 83, 0.08) 100%);
    border-color: rgba(209, 174, 83, 0.5);
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.15);
}

.section-arrow {
    color: rgba(209, 174, 83, 0.8);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    display: inline-block;
    font-weight: bold;
}

.match-section-icon {
    font-size: 1.5rem;
}

.match-section-title {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}

.match-section-content {
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 1rem;
}

/* Match Comparison Tables */
.match-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.match-comparison-table th,
.match-comparison-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-comparison-table th {
    background: rgba(209, 174, 83, 0.1);
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
}

.match-comparison-table td {
    color: var(--text-dark);
    font-size: 0.9rem;
}

.match-comparison-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Match Advice Cards */
.match-advice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.match-advice-card {
    padding: 20px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.08) 0%, rgba(209, 174, 83, 0.03) 100%);
    border-left: 4px solid rgba(209, 174, 83, 0.6);
    border-radius: 0;
}

.match-advice-for {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #D1AE53;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.match-advice-text {
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Match Comparison Grid (New Visual Style) */
.match-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.comparison-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 20px;
    transition: all 0.3s ease;
}

.comparison-card:hover {
    border-color: rgba(209, 174, 83, 0.4);
    box-shadow: 0 8px 24px rgba(209, 174, 83, 0.15);
}

.comparison-header {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(209, 174, 83, 0.3);
    font-weight: 500;
}

.comparison-values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.comparison-person {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.person-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 300;
}

.person-value {
    font-size: 1.05rem;
    color: var(--text-dark);
    font-weight: 500;
    text-align: center;
    padding: 8px 12px;
    background: rgba(209, 174, 83, 0.1);
    border-radius: 0;
    min-width: 100px;
}

.comparison-vs {
    font-size: 1.5rem;
    color: rgba(209, 174, 83, 0.6);
    font-weight: 300;
}

.comparison-note {
    margin-top: 12px;
    padding: 12px;
    background: rgba(209, 174, 83, 0.08);
    border-radius: 0;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.6;
    border-left: 3px solid rgba(209, 174, 83, 0.5);
}

/* Enhanced Match Section Content Styling */
.match-section-content h2 {
    color: var(--text-dark);
    font-size: 1.4rem;
    font-weight: 500;
    margin-top: 24px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(209, 174, 83, 0.3);
}

.match-section-content h3 {
    color: var(--text-dark);
    font-size: 1.15rem;
    font-weight: 500;
    margin-top: 20px;
    margin-bottom: 12px;
}

.match-section-content strong {
    color: #D1AE53;
    font-weight: 600;
}

.match-section-content ul, 
.match-section-content ol {
    padding-left: 24px;
    margin: 12px 0;
}

.match-section-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.match-section-content p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.match-section-content blockquote {
    border-left: 4px solid rgba(209, 174, 83, 0.6);
    padding-left: 20px;
    margin: 24px 0;
    padding: 20px 24px;
    background: rgba(209, 174, 83, 0.08);
    border-radius: 0 0 0 0;
    font-style: italic;
    color: var(--text-light);
    position: relative;
}

.match-section-content blockquote::before {
    content: '"';
    font-size: 3rem;
    color: rgba(209, 174, 83, 0.3);
    position: absolute;
    left: 8px;
    top: -8px;
    font-family: var(--hx-font-body);
}

/* Custom Match Formatting Blocks */
.match-person-block {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.1) 0%, rgba(209, 174, 83, 0.05) 100%);
    border-left: 4px solid #D1AE53;
    border-radius: 0 0 0 0;
    position: relative;
    overflow: hidden;
}

.match-person-block::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at center, rgba(209, 174, 83, 0.2) 0%, transparent 70%);
}

.match-person-block .person-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #D1AE53;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-person-block .person-label::before {
    content: '◐';
    font-size: 1.2rem;
}

.match-person-block .person-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
}

/* Inline Person Tag (standalone [PERSON:Name]) */
.match-person-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 8px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(209, 174, 83, 0.1) 100%);
    border: 1px solid rgba(209, 174, 83, 0.4);
    border-radius: 0;
    color: #D1AE53;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 4px;
    box-shadow: 0 2px 8px rgba(209, 174, 83, 0.15);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.match-person-tag:hover {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.3) 0%, rgba(209, 174, 83, 0.15) 100%);
    border-color: rgba(209, 174, 83, 0.6);
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.25);
}

.person-tag-icon {
    font-size: 1rem;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(209, 174, 83, 0.4));
}

.person-tag-name {
    color: #D1AE53;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.02em;
}

.match-insight-box {
    margin: 24px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(209, 174, 83, 0.05) 100%);
    border: 2px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.1);
    position: relative;
    overflow: hidden;
}

.match-insight-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(209, 174, 83, 0.1) 0%, transparent 50%);
}

.match-warning-box {
    margin: 24px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(254, 167, 83, 0.15) 0%, rgba(254, 167, 83, 0.05) 100%);
    border: 2px solid rgba(254, 167, 83, 0.4);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(254, 167, 83, 0.1);
}

.match-tip-box {
    margin: 24px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(209, 174, 83, 0.05) 100%);
    border: 2px solid rgba(209, 174, 83, 0.4);
    border-left: 6px solid #D1AE53;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.15);
}

.match-quote-box {
    margin: 32px 0;
    padding: 24px 32px;
    background: linear-gradient(135deg, rgba(122, 95, 28, 0.12) 0%, rgba(122, 95, 28, 0.05) 100%);
    border-left: 6px solid rgba(122, 95, 28, 0.6);
    border-radius: 0 0 0 0;
    font-style: italic;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    position: relative;
    box-shadow: 0 6px 20px rgba(122, 95, 28, 0.1);
}

.match-quote-box::after {
    content: 'âś¨';
    position: absolute;
    right: 24px;
    bottom: 16px;
    font-size: 2rem;
    opacity: 0.3;
}

/* Compatibility Diagram */
.compatibility-diagram-container {
    margin: 32px 0 48px 0;
    padding: 32px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.08) 0%, rgba(209, 174, 83, 0.02) 100%);
    border: 2px solid rgba(209, 174, 83, 0.2);
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.diagram-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: #D1AE53;
    margin: 0 0 8px 0;
    text-align: center;
}

.diagram-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    text-align: center;
    margin: 0 0 32px 0;
}

/* New Comparison Grid Layout */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.comparison-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 24px;
    transition: all 0.3s ease;
}

.comparison-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(209, 174, 83, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.comparison-card.overflow {
    background: rgba(254, 167, 83, 0.08);
    border-color: rgba(254, 167, 83, 0.4);
    box-shadow: 0 0 24px rgba(254, 167, 83, 0.2), inset 0 0 20px rgba(254, 167, 83, 0.05);
}

.comparison-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.comparison-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    flex: 1;
}

.overflow-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(254, 167, 83, 0.3), rgba(255, 75, 75, 0.3));
    border: 1px solid rgba(254, 167, 83, 0.5);
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #FEA753;
    white-space: nowrap;
}

.comparison-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 8px 0;
}

.comparison-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.person-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.3), rgba(209, 174, 83, 0.6));
    border: 3px solid rgba(209, 174, 83, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.person-b .person-avatar {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.3), rgba(176, 184, 196, 0.6));
    border-color: rgba(176, 184, 196, 0.8);
}

.person-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.person-label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

.person-circle {
    flex-shrink: 0;
}

.person-circle svg {
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.4));
}

.person-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
}

.progress-ring {
    transition: stroke-dasharray 1s ease-out;
}

/* Detailed Analysis Layout */
.comparison-detailed-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 8px 0;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 8px;
}

.person-a-color {
    color: #D1AE53;
}

.person-b-color {
    color: #B0B8C4;
}

.detail-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.detail-tag:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.detail-tag.common {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2), rgba(209, 174, 83, 0.1));
    border: 1px solid rgba(209, 174, 83, 0.4);
    color: #D1AE53;
}

.detail-tag.unique-a {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2), rgba(209, 174, 83, 0.1));
    border: 1px solid rgba(209, 174, 83, 0.4);
    color: #D1AE53;
}

.detail-tag.unique-b {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.2), rgba(176, 184, 196, 0.1));
    border: 1px solid rgba(176, 184, 196, 0.4);
    color: #B0B8C4;
}

.detail-empty {
    font-size: 0.85rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.4);
}

.common-section {
    padding: 16px;
    background: rgba(209, 174, 83, 0.05);
    border: 1px solid rgba(209, 174, 83, 0.2);
    border-radius: 0;
}

.unique-section {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
}

.compatibility-bars {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.compatibility-metric {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 0;
    transition: all 0.3s ease;
}

.compatibility-metric.overflow {
    background: linear-gradient(135deg, rgba(254, 167, 83, 0.05), rgba(255, 75, 75, 0.05));
    border: 1px solid rgba(254, 167, 83, 0.2);
    box-shadow: 0 0 24px rgba(254, 167, 83, 0.15), inset 0 0 20px rgba(254, 167, 83, 0.05);
    animation: overflowPulse 3s ease-in-out infinite;
}

@keyframes overflowPulse {
    0%, 100% {
        box-shadow: 0 0 24px rgba(254, 167, 83, 0.15), inset 0 0 20px rgba(254, 167, 83, 0.05);
    }
    50% {
        box-shadow: 0 0 32px rgba(254, 167, 83, 0.25), inset 0 0 28px rgba(254, 167, 83, 0.08);
    }
}

.metric-label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.overflow-indicator {
    display: inline-block;
    margin-left: 12px;
    padding: 4px 14px;
    background: linear-gradient(135deg, rgba(254, 167, 83, 0.3), rgba(255, 75, 75, 0.3));
    border: 1px solid rgba(254, 167, 83, 0.5);
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #FEA753;
    text-shadow: 0 0 8px rgba(254, 167, 83, 0.5);
    box-shadow: 0 0 16px rgba(254, 167, 83, 0.4), inset 0 0 8px rgba(254, 167, 83, 0.2);
    animation: overflowIndicatorPulse 2s ease-in-out infinite;
    letter-spacing: 0.5px;
    text-transform: none;
}

@keyframes overflowIndicatorPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 16px rgba(254, 167, 83, 0.4), inset 0 0 8px rgba(254, 167, 83, 0.2);
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 0 24px rgba(254, 167, 83, 0.6), inset 0 0 12px rgba(254, 167, 83, 0.3);
        transform: scale(1.05);
    }
}

.metric-bars {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.metric-icon {
    font-size: 2rem;
    text-align: center;
    min-width: 60px;
    transition: all 0.3s ease;
}

.metric-icon.overflow {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 12px rgba(254, 167, 83, 0.8)) 
            drop-shadow(0 0 20px rgba(255, 75, 75, 0.6));
    animation: overflowIconPulse 2s ease-in-out infinite;
}

@keyframes overflowIconPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 12px rgba(254, 167, 83, 0.8)) 
                drop-shadow(0 0 20px rgba(255, 75, 75, 0.6));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 20px rgba(254, 167, 83, 1)) 
                drop-shadow(0 0 32px rgba(255, 75, 75, 0.9));
    }
}

.metric-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.metric-bar-container.left {
    flex-direction: row;
    justify-content: flex-end;
}

.metric-bar-container.right {
    flex-direction: row;
    justify-content: flex-start;
}

.person-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    min-width: 80px;
    text-align: center;
}

.bar-wrapper {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 1s ease-out;
    position: relative;
    font-weight: 600;
    font-size: 0.85rem;
}

.progress-bar.left {
    background: linear-gradient(90deg, rgba(209, 174, 83, 0.3) 0%, rgba(209, 174, 83, 0.8) 100%);
    margin-left: auto;
    border-radius: 0 0 0 0;
    justify-content: flex-end;
    padding-right: 12px;
}

.progress-bar.right {
    background: linear-gradient(90deg, rgba(176, 184, 196, 0.8) 0%, rgba(176, 184, 196, 0.3) 100%);
    border-radius: 0 0 0 0;
    justify-content: flex-start;
    padding-left: 12px;
}

/* Overflow state for progress bars */
.progress-bar.left.overflow {
    background: linear-gradient(90deg, 
        rgba(254, 167, 83, 0.4) 0%, 
        rgba(254, 167, 83, 0.9) 60%,
        rgba(255, 75, 75, 0.9) 100%);
    box-shadow: inset 0 0 20px rgba(254, 167, 83, 0.3), 0 0 16px rgba(254, 167, 83, 0.4);
    animation: overflowBarPulse 2s ease-in-out infinite;
}

.progress-bar.right.overflow {
    background: linear-gradient(90deg, 
        rgba(255, 75, 75, 0.9) 0%,
        rgba(254, 167, 83, 0.9) 40%, 
        rgba(254, 167, 83, 0.4) 100%);
    box-shadow: inset 0 0 20px rgba(254, 167, 83, 0.3), 0 0 16px rgba(254, 167, 83, 0.4);
    animation: overflowBarPulse 2s ease-in-out infinite 0.1s;
}

@keyframes overflowBarPulse {
    0%, 100% {
        box-shadow: inset 0 0 20px rgba(254, 167, 83, 0.3), 0 0 16px rgba(254, 167, 83, 0.4);
    }
    50% {
        box-shadow: inset 0 0 28px rgba(254, 167, 83, 0.5), 0 0 24px rgba(254, 167, 83, 0.6);
    }
}

.bar-value {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.overflow .bar-value {
    color: #FFF;
    text-shadow: 0 0 8px rgba(254, 167, 83, 0.8), 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

@media (max-width: 768px) {
    .metric-bars {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .metric-icon {
        order: -1;
    }
    
    .metric-bar-container.left {
        flex-direction: row-reverse;
    }
    
    .bar-wrapper {
        max-width: 100%;
    }
}

/* Custom Match Box in Grid */
.match-custom-box {
    cursor: pointer;
    position: relative;
    min-height: 140px;
    border: 2px dashed rgba(209, 174, 83, 0.3) !important;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.05) 0%, rgba(209, 174, 83, 0.02) 100%) !important;
    transition: all 0.3s ease;
}

.match-custom-box:hover {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.1) 0%, rgba(209, 174, 83, 0.05) 100%) !important;
    border-color: rgba(209, 174, 83, 0.5) !important;
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.2);
}

.match-custom-box.focused {
    border-color: rgba(209, 174, 83, 0.8) !important;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.15) 0%, rgba(209, 174, 83, 0.08) 100%) !important;
    box-shadow: 0 0 0 4px rgba(209, 174, 83, 0.2), 0 4px 12px rgba(209, 174, 83, 0.3);
}

.match-custom-box.selected {
    border-color: rgba(209, 174, 83, 0.9) !important;
    border-style: solid !important;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.25) 0%, rgba(209, 174, 83, 0.15) 100%) !important;
    box-shadow: 0 6px 20px rgba(209, 174, 83, 0.4);
    transform: translateY(-2px);
}

.match-custom-box.selected .match-relation-icon {
    transform: scale(1.1);
}

.match-custom-box.selected .match-relation-name {
    color: #D1AE53;
    font-weight: 600;
}

.match-custom-grid-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-family: var(--hx-font-body);
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 8px;
    cursor: text;
}

.match-custom-grid-input:hover {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(209, 174, 83, 0.4);
}

.match-custom-grid-input:focus {
    outline: none;
    border-color: rgba(209, 174, 83, 0.8);
    background: rgba(0, 0, 0, 0.35);
    color: #D1AE53;
    font-weight: 500;
    box-shadow: 0 0 0 3px rgba(209, 174, 83, 0.15);
}

.match-custom-grid-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    font-size: 0.9rem;
}

.match-custom-box.selected .match-custom-grid-input {
    border-color: rgba(209, 174, 83, 0.6);
    background: rgba(0, 0, 0, 0.3);
}

/* Match Loading Screen */
.match-loading {
    padding: 60px 20px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.match-loading-content {
    max-width: 600px;
    margin: 0 auto;
}

.match-loading-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
}

.spinner-orbit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: rgba(209, 174, 83, 0.6);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.spinner-orbit:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: rgba(209, 174, 83, 0.4);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.spinner-orbit:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: rgba(209, 174, 83, 0.2);
    animation-duration: 1s;
}

.spinner-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #D1AE53;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.match-loading-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.match-loading-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.match-loading-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
    opacity: 0.5;
    transition: all 0.5s ease;
}

.loading-step.active {
    opacity: 1;
    border-left-color: rgba(209, 174, 83, 0.8);
    background: rgba(209, 174, 83, 0.08);
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.loading-step .step-icon {
    font-size: 1.5rem;
    min-width: 32px;
}

.loading-step.active .step-icon {
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.loading-step .step-text {
    font-size: 1rem;
    color: var(--text-light);
    text-align: left;
}

/* Progress Checklist - New */
.match-loading-header {
    text-align: center;
    margin-bottom: 40px;
}

.match-progress-checklist {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 16px 20px;
    transition: all 0.4s ease;
}

.progress-item.pending {
    opacity: 0.5;
}

.progress-item.active {
    opacity: 1;
    border-color: rgba(209, 174, 83, 0.4);
    background: rgba(209, 174, 83, 0.05);
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.15);
    animation: slideInScale 0.4s ease-out;
}

.progress-item.complete {
    opacity: 1;
    border-color: rgba(209, 174, 83, 0.6);
    background: rgba(209, 174, 83, 0.08);
}

@keyframes slideInScale {
    from {
        transform: translateX(-10px) scale(0.98);
        opacity: 0.5;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.progress-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.progress-icon {
    font-size: 1.3rem;
    min-width: 28px;
    text-align: center;
    transition: transform 0.3s ease;
}

.progress-item.active .progress-icon {
    animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.progress-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
}

.progress-status {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.progress-item.complete .progress-status {
    animation: checkmarkPop 0.5s ease-out;
}

@keyframes checkmarkPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #D1AE53, #D1AE53);
    border-radius: 0;
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 0 0 10px rgba(209, 174, 83, 0.5);
}

.progress-item.active .progress-bar-fill {
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { box-shadow: 0 0 5px rgba(209, 174, 83, 0.3); }
    50% { box-shadow: 0 0 15px rgba(209, 174, 83, 0.6); }
    100% { box-shadow: 0 0 5px rgba(209, 174, 83, 0.3); }
}

.progress-item.complete .progress-bar-fill {
    background: linear-gradient(90deg, #D1AE53, #D1AE53);
}

.loading-step.active .step-text {
    color: var(--text-dark);
    font-weight: 500;
}

/* Match Export Section in Data Tab */
.match-export-section {
    padding: 24px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.08) 0%, rgba(209, 174, 83, 0.03) 100%);
    border: 1px solid rgba(209, 174, 83, 0.2);
    border-radius: 0;
}

/* Match Name Input */
.match-name-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: var(--text-dark);
    font-size: 1rem;
    font-family: var(--hx-font-body);
    transition: all 0.3s ease;
}

.match-name-input:focus {
    outline: none;
    border-color: rgba(209, 174, 83, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(209, 174, 83, 0.1);
}

.match-name-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

/* Responsive */
@media (max-width: 768px) {
    .match-upload-grid {
        grid-template-columns: 1fr;
    }
    
    .match-relationship-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .match-advice-grid {
        grid-template-columns: 1fr;
    }
    
    .match-comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-values {
        flex-direction: column;
        gap: 12px;
    }
    
    .comparison-vs {
        transform: rotate(90deg);
        font-size: 1.2rem;
    }
    
    .person-value {
        min-width: 80px;
        font-size: 0.95rem;
    }
    
    /* Compatibility Diagram - Mobile Responsive */
    .compatibility-diagram-container {
        padding: 20px 16px;
        margin: 24px 0;
    }
    
    .diagram-title {
        font-size: 1.4rem;
    }
    
    .diagram-subtitle {
        font-size: 0.85rem;
        margin-bottom: 24px;
    }
    
    /* New mobile layout for comparison cards */
    .comparison-card {
        padding: 16px;
    }
    
    .comparison-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .comparison-icon {
        font-size: 1.5rem;
    }
    
    .comparison-title {
        font-size: 1rem;
    }
    
    .overflow-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
        width: 100%;
        justify-content: center;
    }
    
    .comparison-body {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .person-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .person-label {
        font-size: 0.9rem;
    }
    
    .person-value {
        font-size: 1.3rem;
    }
    
    .person-circle svg {
        width: 100px;
        height: 100px;
    }
    
    /* Detailed analysis mobile */
    .detail-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .detail-section-title {
        font-size: 0.85rem;
    }
    
    .detail-tag {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    .common-section,
    .unique-section {
        padding: 12px;
    }
}

/* Full HD - 1920px+ */
@media screen and (min-width: 1920px) {
    :root {
        font-size: 18px; /* Larger base font for readability */
    }

    .app-header {
        padding: 16px 24px;
    }

    .app-header h1 {
        font-size: 2.5rem;
        letter-spacing: 0.2em;
    }

    .app-main {
        padding: 40px 24px 140px 24px;
    }
    
    /* RealTime Dashboard - better spacing for Full HD */
    .realtime-container {
        max-width: 97%;
    }
    
    .realtime-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    /* Clock header spans full width */
    .clock-header {
        grid-column: 1 / -1;
    }
    
    /* Daily insights spans full width */
    .daily-insights-module {
        grid-column: 1 / -1;
    }
    
    /* Bigger planets for Full HD */
    .planet-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 24px;
    }
    
    .planet-circle {
        min-height: 200px;
    }
    
    .planet-orb {
        width: 95px;
        height: 95px;
    }
    
    .planet-symbol {
        font-size: 2.6rem;
    }
    
    .planet-gate-number {
        font-size: 1.1rem;
    }

    /* Much wider containers - utilize screen space */
    .chart-container-modern {
        max-width: 97%;
    }

    .ai-container,
    .data-container {
        max-width: 97%;
    }

    .voice-chat-container {
        max-width: 97%;
    }

    /* Map modal full size */
    .map-modal {
        max-width: 97%;
        max-height: 95vh;
    }

    /* Enhanced grid layouts */
    .hero-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
        gap: 32px;
    }

    /* Chart sections - 2 columns on large screens */
    .chart-header,
    .basic-info-modern,
    .centers-modern,
    .channels-modern,
    .gates-modern,
    .variables-modern {
        font-size: 1.05rem;
    }

    /* Voice chat - maximum size */
    .voice-circle {
        width: 320px;
        height: 320px;
    }

    .voice-messages {
        padding: 24px 20px;
        gap: 16px;
        font-size: 1.1rem;
    }

    .voice-message {
        padding: 16px 22px;
        max-width: 75%;
        border-radius: 0;
    }
    
    .voice-message.user {
        border-radius: 0 0 0 0;
    }
    
    .voice-message.assistant {
        border-radius: 0 0 0 0;
    }
    
    .message-icon {
        width: 10px;
        height: 10px;
        margin-top: 9px;
    }

    /* Tabs more spacious */
    .tab-btn {
        padding: 14px 28px;
        font-size: 1rem;
    }

    /* Energy display larger */
    .energy-display {
        padding: 8px 14px;
        gap: 8px;
    }

    .energy-icon {
        font-size: 1.4rem;
        line-height: 1;
    }

    .energy-value {
        font-size: 1.15rem;
    }

    .energy-label {
        font-size: 0.85rem;
        display: inline; /* Show label on large screens */
    }
}

/* 2K/WQHD - 2560px+ */
@media screen and (min-width: 2560px) {
    :root {
        font-size: 20px; /* Even larger for 2K displays */
    }

    .app-header h1 {
        font-size: 3rem;
    }

    .app-main {
        padding: 48px 32px 160px 32px;
    }
    
    /* RealTime Dashboard - better spacing for 2K */
    .realtime-container {
        max-width: 97%;
    }
    
    .realtime-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 44px;
    }
    
    /* Clock header spans full width */
    .clock-header {
        grid-column: 1 / -1;
    }
    
    /* Daily insights spans full width */
    .daily-insights-module {
        grid-column: 1 / -1;
    }
    
    /* Even bigger planets for 2K */
    .planet-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 28px;
    }
    
    .planet-circle {
        min-height: 220px;
    }
    
    .planet-orb {
        width: 105px;
        height: 105px;
    }
    
    .planet-symbol {
        font-size: 3rem;
    }
    
    .planet-gate-number {
        font-size: 1.2rem;
    }

    /* Maximum width utilization */
    .chart-container-modern {
        max-width: 97%;
    }

    .ai-container,
    .data-container {
        max-width: 97%;
    }

    .voice-chat-container {
        max-width: 97%;
    }

    .map-modal {
        max-width: 97%;
    }

    /* 3-column grid for cards */
    .hero-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }

    /* Voice chat - ultra size */
    .voice-circle {
        width: 360px;
        height: 360px;
    }

    .voice-messages {
        padding: 28px 24px;
        gap: 20px;
        font-size: 1.2rem;
    }

    .voice-message {
        padding: 18px 26px;
        max-width: 70%;
        border-radius: 0;
    }
    
    .voice-message.user {
        border-radius: 0 0 0 0;
    }
    
    .voice-message.assistant {
        border-radius: 0 0 0 0;
    }
    
    .message-icon {
        width: 12px;
        height: 12px;
        margin-top: 10px;
    }

    /* Tabs extra spacious */
    .tab-btn {
        padding: 16px 32px;
        font-size: 1.1rem;
    }

    /* Energy display extra large */
    .energy-display {
        padding: 10px 16px;
        gap: 10px;
    }

    .energy-icon {
        font-size: 1.6rem;
        line-height: 1;
    }

    .energy-value {
        font-size: 1.3rem;
    }

    .energy-label {
        font-size: 0.95rem;
    }
}

/* Explanation Modal System */
.explanation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.explanation-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.explanation-modal-content {
    position: relative;
    background: linear-gradient(135deg, #24242A 0%, #24242A 100%);
    border: 2px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.explanation-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.explanation-back-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.explanation-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(209, 174, 83, 0.5);
    color: #D1AE53;
}

.explanation-breadcrumbs {
    flex: 1;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    padding: 4px 8px;
    border-radius: 0;
    transition: all 0.2s;
    white-space: nowrap;
}

.breadcrumb-item.clickable {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
}

.breadcrumb-item.clickable:hover {
    color: #D1AE53;
    background: rgba(209, 174, 83, 0.15);
}

.breadcrumb-item.active {
    color: #D1AE53;
    font-weight: 600;
    background: rgba(209, 174, 83, 0.1);
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1rem;
    user-select: none;
}

.explanation-close-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.explanation-close-btn:hover {
    color: #FF4B4B;
}

.explanation-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
}

/* Markdown formatting in modal */
.explanation-modal-body h1,
.explanation-modal-body h2,
.explanation-modal-body h3 {
    color: rgba(255, 255, 255, 0.95);
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.explanation-modal-body h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid rgba(209, 174, 83, 0.3);
    padding-bottom: 8px;
}

.explanation-modal-body h2 {
    font-size: 1.4rem;
    color: #D1AE53;
}

.explanation-modal-body h3 {
    font-size: 1.2rem;
    color: #D1AE53;
}

.explanation-modal-body p {
    margin-bottom: 12px;
}

.explanation-modal-body strong,
.explanation-modal-body b {
    color: #D1AE53;
    font-weight: 600;
}

.explanation-modal-body em,
.explanation-modal-body i {
    color: #D1AE53;
    font-style: italic;
}

.explanation-modal-body ul,
.explanation-modal-body ol {
    margin: 16px 0;
    padding-left: 24px;
}

.explanation-modal-body li {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.85);
}

.explanation-modal-body li::marker {
    color: #D1AE53;
}

.explanation-modal-body code {
    background: rgba(209, 174, 83, 0.1);
    border: 1px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
    padding: 2px 6px;
    font-family: var(--hx-font-mono);
    font-size: 0.9em;
    color: #D1AE53;
}

.explanation-modal-body blockquote {
    border-left: 4px solid #D1AE53;
    padding-left: 16px;
    margin: 16px 0;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
    background: rgba(209, 174, 83, 0.05);
    padding: 12px 16px;
    border-radius: 0;
}

.explanation-modal-body a {
    color: #D1AE53;
    text-decoration: underline;
    transition: color 0.2s;
}

.explanation-modal-body a:hover {
    color: #D1AE53;
}

.explanation-modal-body hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

/* TTS Button in modal */
.explanation-tts-btn {
    padding: 8px 12px;
    background: rgba(209, 174, 83, 0.1);
    border: 1px solid rgba(209, 174, 83, 0.3);
    border-radius: 0;
    color: #D1AE53;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.explanation-tts-btn:hover {
    background: rgba(209, 174, 83, 0.2);
    border-color: rgba(209, 174, 83, 0.5);
}

.explanation-tts-btn.playing {
    background: rgba(254, 167, 83, 0.2);
    border-color: rgba(254, 167, 83, 0.5);
    color: #FEA753;
    animation: pulse-tts 1.5s ease-in-out infinite;
}

@keyframes pulse-tts {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Hint keyword system (expandable keywords instead of ?) */
.explanation-hint-keyword {
    display: inline;
    padding: 3px 8px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.25), rgba(209, 174, 83, 0.35));
    border-bottom: 3px solid rgba(209, 174, 83, 0.8);
    color: #D1AE53;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(209, 174, 83, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    text-decoration: none;
    animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(209, 174, 83, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 2px 8px rgba(209, 174, 83, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

.explanation-hint-keyword::before {
    content: '›';
    font-size: 0.8em;
    margin-right: 4px;
    opacity: 0.7;
}

.explanation-hint-keyword::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #D1AE53, transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.explanation-hint-keyword:hover {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.4), rgba(209, 174, 83, 0.5));
    border-bottom-color: #D1AE53;
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: #D1AE53;
}

.explanation-hint-keyword:hover::after {
    opacity: 1;
}

.explanation-hint-keyword:hover::before {
    opacity: 1;
}

.explanation-hint-keyword.generated {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.25), rgba(209, 174, 83, 0.35));
    border-bottom-color: rgba(209, 174, 83, 0.8);
    color: #D1AE53;
    animation: none;
}

.explanation-hint-keyword.generated::before {
    content: '✓';
}

.explanation-hint-keyword.generated::after {
    background: linear-gradient(90deg, transparent, #D1AE53, transparent);
}

.explanation-hint-keyword.generated:hover {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.4), rgba(209, 174, 83, 0.5));
    border-bottom-color: #D1AE53;
    box-shadow: 0 4px 12px rgba(209, 174, 83, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: #D1AE53;
}

/* Currently reading sentence highlight */
.explanation-modal-body .reading-now {
    background: linear-gradient(90deg, 
        rgba(209, 174, 83, 0.2) 0%, 
        rgba(209, 174, 83, 0.3) 50%, 
        rgba(209, 174, 83, 0.2) 100%);
    padding: 4px 0;
    border-radius: 0;
    animation: reading-highlight 2s ease-in-out infinite;
}

@keyframes reading-highlight {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.explanation-loading {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
}

.explanation-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Mobile breadcrumbs and hints adjustments */
@media (max-width: 768px) {
    .explanation-breadcrumbs {
        font-size: 0.75rem;
        gap: 4px;
    }
    
    .breadcrumb-item {
        padding: 3px 6px;
        font-size: 0.75rem;
    }
    
    .breadcrumb-separator {
        font-size: 0.85rem;
    }
    
    .explanation-hint-keyword {
        padding: 2px 6px;
        font-size: 0.9em;
    }
    
    .explanation-hint-keyword::before {
        font-size: 0.7em;
        margin-right: 2px;
    }
}

/* 4K/UHD - 3840px+ */
@media screen and (min-width: 3840px) {
    :root {
        font-size: 24px; /* Large for 4K readability */
    }

    .app-header {
        padding: 24px 32px;
    }

    .app-header h1 {
        font-size: 3.5rem;
    }

    .app-main {
        padding: 64px 40px 200px 40px;
    }
    
    /* RealTime Dashboard - maximum for 4K */
    .realtime-container {
        max-width: 98%;
    }
    
    .realtime-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 52px;
    }
    
    /* Clock header spans full width */
    .clock-header {
        grid-column: 1 / -1;
    }
    
    /* Daily insights spans full width */
    .daily-insights-module {
        grid-column: 1 / -1;
    }
    
    /* Maximum size planets for 4K */
    .planet-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 32px;
    }
    
    .planet-circle {
        min-height: 260px;
        padding: 24px 16px;
    }
    
    .planet-orb {
        width: 120px;
        height: 120px;
    }
    
    .planet-symbol {
        font-size: 3.5rem;
    }
    
    .planet-gate-number {
        font-size: 1.4rem;
        padding: 5px 9px;
    }
    
    .planet-name {
        font-size: 0.95rem;
        min-height: 3em;
    }
    
    .planet-percentage {
        font-size: 1rem;
    }

    /* Full 4K width utilization */
    .chart-container-modern {
        max-width: 98%;
    }

    .ai-container,
    .data-container {
        max-width: 98%;
    }

    .voice-chat-container {
        max-width: 98%;
    }

    .map-modal {
        max-width: 98%;
    }

    /* 4-column grid for ultimate space */
    .hero-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 48px;
    }

    /* Voice chat - maximum for 4K */
    .voice-circle {
        width: 450px;
        height: 450px;
    }

    .voice-messages {
        padding: 36px 32px;
        gap: 28px;
        font-size: 1.4rem;
    }

    .voice-message {
        padding: 22px 32px;
        max-width: 65%;
        border-radius: 0;
    }
    
    .voice-message.user {
        border-radius: 0 0 0 0;
    }
    
    .voice-message.assistant {
        border-radius: 0 0 0 0;
    }
    
    .message-icon {
        width: 14px;
        height: 14px;
        margin-top: 12px;
    }

    /* Tabs maximum size */
    .tab-btn {
        padding: 20px 40px;
        font-size: 1.3rem;
    }

    /* Energy display 4K size */
    .energy-display {
        padding: 12px 18px;
        gap: 12px;
    }

    .energy-icon {
        font-size: 2rem;
        line-height: 1;
    }

    .energy-value {
        font-size: 1.6rem;
    }

    .energy-label {
        font-size: 1.1rem;
    }

    /* Bodygraph SVG scaling */
    #bodygraph-svg {
        transform: scale(1.3);
        transform-origin: center top;
    }
}

/* ==========================================
   USER CONTEXT MODAL
   ========================================== */

.user-context-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.user-context-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
}

.modal-content-user-context {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #24242A 0%, #24242A 100%);
    border-radius: 0;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(209, 174, 83, 0.2);
    overflow: hidden;
    /* Zapobiegaj dziedziczeniu backdrop-filter */
    isolation: isolate;
    /* Wymuszenie własnego stacking context */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Wyłącz backdrop-filter dla tego elementu i dzieci */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.modal-header-user-context {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(209, 174, 83, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.1), rgba(209, 174, 83, 0.05));
}

.modal-header-user-context h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.modal-body-user-context {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
    /* Zapewnij że tekst nie dziedziczy blur */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    filter: none;
    -webkit-filter: none;
}

.context-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.context-loading .spinner {
    margin: 0 auto 20px;
}

/* Context Section */
.context-section {
    margin-bottom: 32px;
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.05), rgba(209, 174, 83, 0.02));
    border-radius: 0;
    padding: 24px;
    border: 1px solid rgba(209, 174, 83, 0.15);
}

.context-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.context-section-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-section-count {
    background: rgba(209, 174, 83, 0.2);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.context-empty {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Context Item */
.context-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0;
    padding: 16px 18px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    position: relative;
}

.context-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(209, 174, 83, 0.3);
}

.context-item-content {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.context-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-light);
}

.context-item-badge {
    padding: 4px 10px;
    border-radius: 0;
    font-weight: 500;
    font-size: 0.8rem;
}

.badge-active { background: rgba(209, 174, 83, 0.2); color: #D1AE53; }
.badge-completed { background: rgba(176, 184, 196, 0.2); color: #B0B8C4; }
.badge-paused { background: rgba(209, 174, 83, 0.2); color: #D1AE53; }
.badge-open { background: rgba(255, 75, 75, 0.2); color: #FF4B4B; }
.badge-addressed { background: rgba(209, 174, 83, 0.2); color: #D1AE53; }
.badge-resolved { background: rgba(209, 174, 83, 0.2); color: #D1AE53; }
.badge-low { background: rgba(176, 184, 196, 0.2); color: #B0B8C4; }
.badge-medium { background: rgba(209, 174, 83, 0.2); color: #D1AE53; }
.badge-high { background: rgba(255, 75, 75, 0.2); color: #FF4B4B; }
.badge-positive { background: rgba(209, 174, 83, 0.2); color: #D1AE53; }
.badge-negative { background: rgba(255, 75, 75, 0.2); color: #FF4B4B; }
.badge-neutral { background: rgba(176, 184, 196, 0.2); color: #B0B8C4; }

.context-item-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.context-item-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.context-item-btn:hover {
    background: rgba(209, 174, 83, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.context-item-btn.delete:hover {
    background: rgba(255, 75, 75, 0.2);
    border-color: #FF4B4B;
    color: #FF4B4B;
}

/* User Info Section */
.user-info-section {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.1), rgba(176, 184, 196, 0.05));
    border: 1px solid rgba(176, 184, 196, 0.2);
    border-radius: 0;
    padding: 24px;
    margin-bottom: 32px;
}

.user-info-name {
    font-size: 2rem;
    color: #B0B8C4;
    font-weight: 600;
    margin-bottom: 16px;
}

.user-info-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.user-stat {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-stat-value {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 4px;
}

.user-stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .modal-content-user-context {
        max-height: 90vh;
        max-width: 95vw;
        margin: 10px;
    }
    
    .modal-header-user-context {
        padding: 18px 20px;
    }
    
    .modal-header-user-context h2 {
        font-size: 1.4rem;
    }
    
    .modal-body-user-context {
        padding: 20px;
    }
    
    .context-section {
        padding: 16px;
    }
    
    .context-item-actions {
        position: static;
        margin-top: 12px;
        justify-content: flex-end;
    }
}

/* NEW: Badge styles for priorities, categories, and relationships */
.badge-priority-critical {
    background: rgba(255, 75, 75, 0.2);
    color: #FF4B4B;
    font-weight: 700;
}

.badge-priority-high {
    background: rgba(254, 167, 83, 0.2);
    color: #FEA753;
    font-weight: 600;
}

.badge-priority-medium {
    background: rgba(176, 184, 196, 0.2);
    color: #B0B8C4;
}

.badge-priority-low {
    background: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
}

.badge-significance-very_high {
    background: rgba(122, 95, 28, 0.2);
    color: #7A5F1C;
    font-weight: 700;
}

.badge-significance-high {
    background: rgba(209, 174, 83, 0.2);
    color: #D1AE53;
    font-weight: 600;
}

.badge-significance-medium {
    background: rgba(176, 184, 196, 0.2);
    color: #B0B8C4;
}

.badge-significance-low {
    background: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
}

.badge-rel-excellent {
    background: rgba(209, 174, 83, 0.25);
    color: #D1AE53;
    font-weight: 700;
}

.badge-rel-good {
    background: rgba(209, 174, 83, 0.25);
    color: #D1AE53;
    font-weight: 600;
}

.badge-rel-neutral {
    background: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
}

.badge-rel-difficult {
    background: rgba(254, 167, 83, 0.2);
    color: #FEA753;
    font-weight: 600;
}

.badge-rel-toxic {
    background: rgba(255, 75, 75, 0.25);
    color: #FF4B4B;
    font-weight: 700;
}

.badge-insight-pattern {
    background: rgba(176, 184, 196, 0.2);
    color: #B0B8C4;
}

.badge-insight-strength {
    background: rgba(209, 174, 83, 0.2);
    color: #D1AE53;
}

.badge-insight-challenge {
    background: rgba(254, 167, 83, 0.2);
    color: #FEA753;
}

.badge-insight-opportunity {
    background: rgba(122, 95, 28, 0.2);
    color: #7A5F1C;
}

.badge-insight-warning {
    background: rgba(255, 75, 75, 0.2);
    color: #FF4B4B;
}

.badge-very_positive {
    background: rgba(209, 174, 83, 0.25);
    color: #D1AE53;
    font-weight: 700;
}

.badge-very_negative {
    background: rgba(255, 75, 75, 0.25);
    color: #FF4B4B;
    font-weight: 700;
}

.badge-critical {
    background: rgba(255, 75, 75, 0.25);
    color: #FF4B4B;
    font-weight: 700;
}

.badge-recurring {
    background: rgba(254, 167, 83, 0.2);
    color: #FEA753;
    font-weight: 600;
}

.badge-abandoned {
    background: rgba(97, 97, 97, 0.2);
    color: #757575;
}

.badge-strained {
    background: rgba(254, 167, 83, 0.2);
    color: #FEA753;
}

.badge-broken {
    background: rgba(255, 75, 75, 0.2);
    color: #FF4B4B;
}

.badge-past {
    background: rgba(97, 97, 97, 0.2);
    color: #757575;
}

/* ========================================= */
/* CONTEXT UI V2 STYLES                      */
/* ========================================= */

.context-v2-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0;
    margin-bottom: 24px;
}

.context-v2-stat {
    text-align: center;
}

.context-v2-stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.context-v2-stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.context-v2-section {
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.context-v2-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease;
}

.context-v2-section-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.context-v2-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.context-v2-type-emoji {
    font-size: 1.4rem;
}

.context-v2-section-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.context-v2-section-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.context-v2-section.collapsed .context-v2-section-toggle {
    transform: rotate(-90deg);
}

.context-v2-section-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

/* Custom scrollbar for section content */
.context-v2-section-content::-webkit-scrollbar {
    width: 8px;
}

.context-v2-section-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
}

.context-v2-section-content::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-color-rgb, 102, 126, 234), 0.5);
    border-radius: 0;
}

.context-v2-section-content::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-color-rgb, 102, 126, 234), 0.7);
}

.context-v2-section.collapsed .context-v2-section-content {
    max-height: 0;
    opacity: 0;
    padding: 0 12px;
    overflow: hidden;
}

.context-v2-fact {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0;
    padding: 14px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.context-v2-fact:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.context-v2-fact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.context-v2-fact-importance {
    flex: 1;
    height: 24px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.context-v2-fact-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.context-v2-fact-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.context-v2-fact-btn:hover {
    background: rgba(255, 75, 75, 0.2);
    border-color: rgba(255, 75, 75, 0.4);
    color: #FF4B4B;
}

.context-v2-fact-content {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 10px;
    color: var(--text-color);
}

.context-v2-fact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.context-v2-fact-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 0;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.context-v2-temporal {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.2) 0%, rgba(122, 95, 28, 0.2) 100%);
    color: #D1AE53;
}

.context-v2-temporal.future {
    background: linear-gradient(135deg, rgba(209, 174, 83, 0.3) 0%, rgba(122, 95, 28, 0.3) 100%);
    color: #F6F3EC;
    font-weight: 600;
}

.context-v2-tag {
    background: rgba(var(--primary-color-rgb, 102, 126, 234), 0.15);
    color: var(--primary-color);
    border: 1px solid rgba(var(--primary-color-rgb, 102, 126, 234), 0.3);
}

.context-v2-fact-metadata {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0;
    padding: 10px;
    font-size: 0.85rem;
}

.context-v2-metadata-item {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.context-v2-metadata-item:last-child {
    margin-bottom: 0;
}

.context-v2-metadata-key {
    color: var(--text-light);
    font-weight: 600;
    min-width: 100px;
}

.context-v2-metadata-value {
    color: var(--text-color);
    flex: 1;
}

.context-error {
    color: #FF4B4B;
    text-align: center;
    padding: 20px;
    background: rgba(255, 75, 75, 0.1);
    border-radius: 0;
    border: 1px solid rgba(255, 75, 75, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .context-v2-stats {
        gap: 12px;
        padding: 16px;
    }
    
    .context-v2-stat-value {
        font-size: 1.5rem;
    }
    
    .context-v2-section-header {
        padding: 12px 16px;
    }
    
    .context-v2-section-title {
        font-size: 1rem;
        gap: 8px;
    }
    
    .context-v2-type-emoji {
        font-size: 1.2rem;
    }
    
    .context-v2-fact {
        padding: 12px;
    }
    
    .context-v2-section-content {
        max-height: 400px;
    }
}

/* ============================================
   AUTHENTICATION MODAL
   ============================================ */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000; /* Higher than login-required-overlay (999999) */
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInUp 0.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
    font-weight: 400;
}

.auth-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    width: 32px;
    height: 32px;
    border-radius: 0;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
}

.auth-modal-body {
    padding: 24px;
}

.auth-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#auth-form label {
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
}

#auth-form input[type="text"],
#auth-form input[type="password"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 12px 16px;
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#auth-form input[type="text"]:focus,
#auth-form input[type="password"]:focus {
    outline: none;
    border-color: rgba(176, 184, 196, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.auth-error {
    background: rgba(255, 75, 75, 0.1);
    border: 1px solid rgba(255, 75, 75, 0.3);
    border-radius: 0;
    padding: 12px;
    color: #FF4B4B;
    font-size: 0.9rem;
    margin-top: -8px;
}

#auth-submit-btn {
    margin-top: 8px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 500;
}

#auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-toggle {
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-toggle p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

.auth-toggle a {
    color: #B0B8C4;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-toggle a:hover {
    color: #B0B8C4;
    text-decoration: underline;
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .auth-modal-header {
        padding: 20px 16px 12px;
    }
    
    .auth-modal-body {
        padding: 20px 16px;
    }
}

/* ============================================
   USER DISPLAY (HEADER)
   ============================================ */

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 8px 12px;
}

.user-avatar-container {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, #D1AE53 0%, #7A5F1C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.user-avatar-container:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.user-avatar.has-avatar {
    display: block;
}

.user-avatar-placeholder {
    font-size: 1.5rem;
    color: white;
}

.user-avatar.has-avatar + .user-avatar-placeholder {
    display: none;
}

.user-icon {
    font-size: 1.2rem;
}

.user-name {
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 4px 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 75, 75, 0.2);
    border-color: rgba(255, 75, 75, 0.5);
}

.btn-login {
    background: linear-gradient(135deg, #B0B8C4, #D1AE53);
    border: none;
    border-radius: 0;
    padding: 8px 16px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(176, 184, 196, 0.3);
}

.btn-login:hover {
    box-shadow: 0 6px 16px rgba(176, 184, 196, 0.4);
}

/* ============================================
   ENERGY MODAL STYLES
   ============================================ */

.energy-modal {
    max-width: 500px;
}

.energy-warning {
    font-size: 1.1rem;
    color: #FF4B4B;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

.energy-balance-display {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.1), rgba(255, 75, 75, 0.05));
    border: 2px solid rgba(255, 75, 75, 0.3);
    border-radius: 0;
    padding: 24px;
    text-align: center;
    margin: 20px 0;
}

.energy-icon-big {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.energy-balance-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FF4B4B;
}

.energy-info {
    text-align: center;
    color: var(--text-muted);
    margin: 16px 0;
}

.auth-suggestion {
    background: linear-gradient(135deg, rgba(176, 184, 196, 0.1), rgba(176, 184, 196, 0.05));
    border-left: 3px solid #B0B8C4;
    padding: 12px 16px;
    border-radius: 0;
    margin: 16px 0;
    font-size: 0.95rem;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

/* ============================================
   FORM CHECKBOX STYLES
   ============================================ */

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.form-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--text-dark);
}

.form-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    accent-color: #B0B8C4;
}



/* ============================================
   AVATAR UPLOAD MODAL
   ============================================ */

.avatar-upload-preview {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #D1AE53 0%, #7A5F1C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.avatar-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-preview span {
    color: white;
    font-size: 1rem;
    opacity: 0.7;
}

.modal-small {
    max-width: 400px !important;
}

.modal-small .modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

/* ============================================
   Login Required Overlay (After Logout)
   ============================================ */

.login-required-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(36, 36, 42, 0.98) 0%, rgba(20, 20, 24, 0.98) 100%);
    backdrop-filter: blur(20px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.login-required-content {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 50px 40px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-required-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.login-required-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.login-required-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 10px;
}

.login-required-hint {
    font-size: 0.95rem;
    color: rgba(209, 174, 83, 0.8);
    font-style: italic;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* CRITICAL: When login overlay is visible, completely hide app UI to prevent initialization issues */
body:has(.login-required-overlay[style*="display: flex"]) .app-header,
body:has(.login-required-overlay[style*="display: flex"]) .app-main,
body:has(.login-required-overlay[style*="display: flex"]) .bottom-nav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
