/* CSS Reset & Variables */
:root {
    --bg-app: #08080a;
    --bg-sidebar: #0f0f11;
    --bg-card: rgba(22, 22, 26, 0.7);
    --bg-card-hover: rgba(30, 30, 35, 0.85);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-active: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    
    --color-violet: #a1a1aa;
    --color-violet-glow: rgba(161, 161, 170, 0.15);
    --color-emerald: #10b981;
    --color-emerald-glow: rgba(16, 185, 129, 0.2);
    --color-rose: #f43f5e;
    --color-amber: #f59e0b;
    --color-blue: #71717a;

    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'Space Grotesk', sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-sans);
}

/* App Layout */
.app-container {
    display: flex;
    height: 100%;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
    flex-shrink: 0;
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 16px 24px;
}

.logo-container {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-violet);
    border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
    animation: waveRotate 8s linear infinite;
    box-shadow: 0 0 12px var(--color-violet-glow);
}

.logo-core {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--color-violet), #c084fc);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--color-violet);
}

@keyframes waveRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

.brand-title {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 24px;
}

.value-prop-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.value-prop-card:hover {
    border-color: var(--border-active);
    background-color: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1);
}

.prompts-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 4px;
}

.prompts-section-header h3 {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: var(--font-mono);
    font-weight: 600;
}

.prompts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prompt-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.78rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.4;
}

.prompt-card:hover {
    border-color: var(--border-active);
    background-color: var(--bg-card-hover);
    transform: translateX(4px);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.prompt-card i {
    color: var(--color-violet);
    flex-shrink: 0;
    margin-top: 2px;
    width: 14px;
    height: 14px;
}

#refresh-prompts-btn:hover {
    color: var(--color-violet) !important;
}

#refresh-prompts-btn:active {
    transform: scale(0.95);
}

.value-prop-card.featured {
    border-color: rgba(139, 92, 246, 0.45);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(20, 22, 45, 0.85));
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

.value-prop-card.featured:hover {
    border-color: var(--color-violet);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(28, 30, 62, 0.95));
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.card-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

.icon-violet {
    color: var(--color-violet);
    width: 20px;
    height: 20px;
}

.value-prop-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pitch-container {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(192, 132, 252, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
}

.pitch-container h4 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-violet);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.pitch-text {
    font-size: 0.8rem;
    color: #ffffff;
    font-style: italic;
    line-height: 1.5;
}

.sidebar-footer {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pulse-dot.green {
    background-color: var(--color-emerald);
    box-shadow: 0 0 10px var(--color-emerald);
    animation: pulseGlow 2s infinite;
}

.pulse-dot.orange {
    background-color: var(--color-amber);
    box-shadow: 0 0 10px var(--color-amber);
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* Main Area Layout */
.main-content {
    display: flex;
    flex-grow: 1;
    height: 100%;
    height: 100dvh;
    min-width: 0;
}

/* Chat Section Styling */
.chat-section {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-app);
    min-width: 0;
}

.section-header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(8, 8, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.section-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
}

.section-header p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear:hover {
    color: var(--color-rose);
    background-color: rgba(244, 63, 94, 0.1);
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Message styling */
.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: messageFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.system {
    align-self: flex-start;
    max-width: 90%;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--color-blue), #60a5fa);
    color: white;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--color-violet), #c084fc);
    color: white;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.message.system .message-avatar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.message-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.message.user .message-content {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.message.system .message-content {
    background-color: rgba(255, 255, 255, 0.02);
    border-style: dashed;
}

.message-content p {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Chat Input Bar */
.chat-input-container {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(8, 8, 10, 0.8);
    backdrop-filter: blur(10px);
}

.chat-form {
    display: flex;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-form:focus-within {
    border-color: var(--border-active);
    box-shadow: 0 0 12px var(--color-violet-glow);
}

.chat-form textarea {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    resize: none;
    outline: none;
    max-height: 150px;
    line-height: 1.5;
    padding: 6px 0;
}

.chat-form button {
    background: var(--color-violet);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.chat-form button:hover:not(:disabled) {
    background: #7c3aed;
    transform: scale(1.05);
}

.chat-form button:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* Metrics Section Styling */
.metrics-section {
    flex: 1;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    min-width: 0;
}

.metrics-section .section-header {
    border-bottom: 1px solid var(--border-color);
    background-color: transparent;
}

.badge {
    background-color: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.2s, background-color 0.2s;
}

.metric-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background-color: var(--bg-card-hover);
}

.metric-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon-wrapper.blue {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-blue);
}

.metric-icon-wrapper.green {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-emerald);
}

.metric-icon-wrapper.red {
    background-color: rgba(244, 63, 94, 0.1);
    color: var(--color-rose);
}

.metric-icon-wrapper.gold {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-amber);
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.metric-value .unit {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.metric-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

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

.red-text {
    color: var(--color-rose) !important;
}

.gold-text {
    color: var(--color-amber) !important;
}

.highlight-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(20, 22, 45, 0.6));
    border-color: rgba(245, 158, 11, 0.15);
}

/* Cost Comparison Card */
.cost-comparison-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    margin: 0 24px 24px 24px;
}

.cost-comparison-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.cost-comparison-card .subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Interactive Pricing controls styling */
.pricing-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 16px;
}

.pricing-control-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricing-control-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    font-weight: 500;
}

.pricing-control-value {
    color: var(--color-emerald);
    font-family: var(--font-mono);
    font-weight: bold;
}

/* Range input styling */
.pricing-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.3s;
}

.pricing-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-emerald);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    transition: transform 0.1s, background-color 0.2s;
}

.pricing-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.tier-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tier-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.tier-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.tier-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--color-emerald);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.tier-btn .tier-desc {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.tier-btn.active .tier-desc {
    color: rgba(16, 185, 129, 0.8);
}

.chart-container {
    position: relative;
    height: 180px;
    width: 100%;
    margin-bottom: 20px;
}

.cost-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.cost-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.cost-item.highlighting {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.flex-break {
    flex-basis: 100%;
    height: 0;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.gpt4 { background-color: #3b82f6; }
.dot.claude { background-color: #f43f5e; }
.dot.gemini { background-color: #f59e0b; }
.dot.gos { background-color: #10b981; }

.cost-item .name {
    color: var(--text-secondary);
}

.cost-info-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cost-item .token-rate {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: normal;
}

.cost-item .value {
    font-family: var(--font-mono);
    color: #ffffff;
    margin-left: 6px;
}

/* Ecological Impact Widget */
.eco-impact-widget {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(20, 22, 45, 0.6));
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 14px;
    padding: 24px;
    margin: 0 24px 24px 24px;
}

.eco-impact-widget h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.eco-impact-widget p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 16px;
}

.eco-stats {
    display: flex;
    gap: 24px;
}

.eco-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.eco-val {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-emerald);
}

.eco-val .unit {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.eco-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Streaming dynamic dot indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* TAM SAM SOM Widget Styling */
.market-opportunity-widget {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.04), rgba(20, 22, 45, 0.6));
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 14px;
    padding: 20px;
    margin: 0 24px 24px 24px;
}

.market-opportunity-widget h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.market-opportunity-widget .subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.market-stats {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.market-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 12px 6px;
    border-radius: 10px;
}

.market-val {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
}

.market-val.tam {
    color: #3b82f6;
}

.market-val.sam {
    color: #a78bfa;
}

.market-val.som {
    color: #10b981;
}

.market-lbl {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Modals Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 9, 19, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-sidebar);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 36px;
    max-width: 600px;
    width: 90%;
    max-height: 82vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 92, 246, 0.12);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar for Modal Content */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.6);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s, transform 0.2s;
}

.modal-close:hover {
    color: #ffffff;
    transform: scale(1.12);
}

/* Chat Input CTAs Styling */
.chat-ctas {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 12px;
}

.cta-link-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s, transform 0.2s;
    padding: 4px 8px;
    border-radius: 6px;
}

.cta-link-btn:hover {
    color: var(--color-violet);
    background-color: rgba(139, 92, 246, 0.06);
}

.cta-link-btn svg {
    width: 14px;
    height: 14px;
}

/* Sustainability Modal Layout */
.sustainability-comparison {
    margin-top: 24px;
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(7, 9, 19, 0.4);
}

.comparison-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
    line-height: 1.4;
}

.comparison-row.header {
    background: rgba(139, 92, 246, 0.1);
    font-weight: 600;
    color: #ffffff;
    font-size: 0.88rem;
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-row span:first-child {
    font-weight: 500;
    color: #f3f4f6;
    flex: 2;
}

.comparison-row span:not(:first-child) {
    flex: 1;
    text-align: right;
    color: var(--text-secondary);
}

.comparison-row span.saving {
    color: var(--color-emerald);
    font-weight: 600;
}

.eco-equivalences {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
}

.eco-equivalences h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
}

.eco-eq-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eco-eq-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.eco-eq-item svg {
    width: 18px;
    height: 18px;
    color: var(--color-violet);
    margin-top: 2px;
    flex-shrink: 0;
}

.eco-eq-item strong {
    color: #ffffff;
}

/* Custom GOS Streaming Thought & Action styling */
.thought-container {
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.thought-header {
    background: rgba(139, 92, 246, 0.08);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: #a78bfa;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    cursor: pointer;
    user-select: none;
}

.thought-header svg {
    width: 14px;
    height: 14px;
}

.thought-status {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.7;
    background: rgba(139, 92, 246, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.thought-body {
    padding: 10px 12px;
    color: var(--text-secondary);
    line-height: 1.45;
    white-space: pre-wrap;
    font-style: italic;
}

/* Action Request styling */
.action-container {
    background: rgba(245, 158, 11, 0.03);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    margin-top: 12px;
    overflow: hidden;
}

.action-header {
    background: rgba(245, 158, 11, 0.08);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fbbf24;
    border-bottom: 1px solid rgba(245, 158, 11, 0.1);
}

.action-header svg {
    width: 14px;
    height: 14px;
}

.action-body {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
}

.action-body pre {
    margin: 0;
    font-family: monospace;
    font-size: 0.8rem;
    color: #fef08a;
    overflow-x: auto;
    white-space: pre-wrap;
}

.action-actions {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.02);
    border-top: 1px solid rgba(245, 158, 11, 0.1);
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

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

.btn-approve:hover {
    background: #059669;
    transform: scale(1.02);
}

.btn-deny {
    background: rgba(244, 63, 94, 0.1);
    color: var(--color-rose);
    border-color: rgba(244, 63, 94, 0.3);
}

.btn-deny:hover {
    background: rgba(244, 63, 94, 0.2);
    transform: scale(1.02);
}

.action-status-card {
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-emerald);
    border-top: 1px solid rgba(16, 185, 129, 0.2);
}

.status-denied {
    background: rgba(244, 63, 94, 0.1);
    color: var(--color-rose);
    border-top: 1px solid rgba(244, 63, 94, 0.2);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 8, 10, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.25s ease-out;
}

.modal-container {
    background-color: #0f0f11;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 90%;
    max-width: 1000px;
    height: 85%;
    height: 85dvh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.1);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0 4px;
}

.modal-close-btn:hover {
    color: #fff;
}

.modal-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

/* Modal metrics cards */
.modal-metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-metric-card .m-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.modal-metric-card .m-val {
    font-size: 1.8rem;
    font-family: var(--font-mono);
    font-weight: 700;
}

.modal-metric-card .m-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.results-box-sec {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 20px;
}

.results-table-container {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    background: rgba(8, 8, 10, 0.5);
    -webkit-overflow-scrolling: touch;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}

.results-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1;
}

.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.results-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Spinner Animations */
.loading-spinner-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Tooltip premium styles */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    z-index: 100;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s;
    margin-left: 6px;
}

.tooltip-icon:hover {
    color: #10b981;
}

.tooltip-box {
    visibility: hidden;
    position: absolute;
    top: 130%;
    left: 0; /* Align to left so it extends to the right */
    width: 290px;
    background-color: #121214;
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #f4f4f5;
    text-align: left;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.7);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-5px);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.75rem;
    line-height: 1.4;
    pointer-events: none;
    box-sizing: border-box;
}

/* Upward pointing arrow matching the background */
.tooltip-box::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 6px; /* align with info icon */
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #121214 transparent;
}

/* Subtle border outline for the arrow */
.tooltip-box::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 5px;
    border-width: 7px;
    border-style: solid;
    border-color: transparent transparent rgba(16, 185, 129, 0.2) transparent;
    z-index: -1;
}

.tooltip-box strong {
    color: #10b981;
    font-weight: 600;
}

.tooltip-box hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.tooltip-container:hover .tooltip-box {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.test-tab-content {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    height: calc(100% - 60px);
    gap: 20px;
}

.test-results-screen {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.test-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.desktop-only {
    display: inline;
}

.mobile-only {
    display: none !important;
}

.mobile-only-tab {
    display: none !important;
}

.metrics-fab {
    display: none !important;
}

@keyframes bounceIn {
    from { transform: scale(0.3); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive media queries */
@media (max-width: 900px) {
    .metrics-fab {
        display: none !important;
        position: absolute;
        bottom: 85px;
        right: 20px;
        background: rgba(22, 22, 26, 0.85);
        backdrop-filter: blur(8px);
        color: #e4e4e7;
        border: 1px solid rgba(16, 185, 129, 0.35);
        padding: 8px 14px;
        border-radius: 20px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
        font-family: var(--font-mono);
        font-size: 0.72rem;
        font-weight: 600;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        z-index: 90;
        animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        transition: all 0.2s ease;
    }

    .metrics-fab:hover {
        border-color: rgba(16, 185, 129, 0.6);
        background: rgba(22, 22, 26, 0.95);
        color: #fff;
    }

    .metrics-fab.visible {
        display: flex !important;
    }
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: inline !important;
    }
    
    .mobile-only-tab {
        display: flex !important;
    }
    
    .mobile-only-btn {
        display: flex !important;
    }
    
    .app-container {
        flex-direction: column;
        height: 100%;
        height: 100dvh;
        overflow: hidden;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100%;
        z-index: 10000;
        transition: left 0.3s ease-in-out;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
        background-color: #0f0f11;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    #sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 9998;
        display: none;
    }
    
    #sidebar-backdrop.show {
        display: block;
    }
    
    .main-content {
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }
    
    .chat-section {
        height: 100%;
        width: 100%;
        border-right: none;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        flex-shrink: 0;
        transition: height 0.2s ease;
    }
    
    .section-header {
        height: 60px !important;
        padding: 0 16px !important;
    }
    
    /* When metrics is active, shrink the chat section so only the tab header is visible */
    .main-content.metrics-active .chat-section {
        height: 60px !important;
        flex: none !important;
        flex-grow: 0 !important;
        overflow: hidden !important;
    }
    
    .metrics-section {
        display: none !important;
        flex-direction: column;
        width: 100% !important;
        height: calc(100% - 60px) !important;
        flex-grow: 1;
        overflow-y: auto !important;
        background-color: var(--bg-app);
        border-left: none !important;
    }
    
    .metrics-section .section-header {
        display: none !important;
    }
    
    .main-content.metrics-active .metrics-section {
        display: flex !important;
    }
    
    .chat-messages {
        padding: 16px;
        gap: 16px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .results-box-sec {
        padding: 12px;
    }

    .test-tab-content {
        padding: 12px !important;
        gap: 16px !important;
    }
    
    .test-results-screen {
        gap: 16px !important;
    }

    .results-table {
        min-width: 600px;
    }
}

@media (max-width: 600px) {
    .capacity-savings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modal-metric-card .m-val {
        font-size: 1.1rem !important;
    }
    
    .modal-metric-card {
        padding: 8px !important;
    }
    
    .results-table th, .results-table td {
        padding: 6px 8px !important;
        font-size: 0.72rem !important;
    }

    .test-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}



