/* Quorum.ai Web Interface Styles */

/* CSS Variables */
:root {
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;

    --color-success: #10b981;
    --color-success-bg: #d1fae5;
    --color-error: #ef4444;
    --color-error-bg: #fee2e2;
    --color-warning: #f59e0b;

    --color-bg: #f8fafc;
    --color-bg-card: #ffffff;
    --color-bg-secondary: #f1f5f9;

    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;

    --color-border: #e2e8f0;
    --color-border-focus: var(--color-primary);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    --transition: 150ms ease;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f172a;
        --color-bg-card: #1e293b;
        --color-bg-secondary: #334155;

        --color-text: #f1f5f9;
        --color-text-secondary: #94a3b8;
        --color-text-muted: #64748b;

        --color-border: #334155;

        --color-success-bg: #064e3b;
        --color-error-bg: #7f1d1d;
    }
}

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

/* Base */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

.logo-text-container {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.logo-tagline {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-top: -0.125rem;
}

.version {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    background: var(--color-bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

/* Credits Badge */
.credits-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
}

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

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

.credits-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-success);
}

.credits-value.error {
    color: var(--color-error);
}

.credits-value.low-balance {
    color: var(--color-warning);
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Q-Bucks Badge */
.q-bucks-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(99, 102, 241, 0.3);
}

.q-bucks-badge:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: var(--color-primary);
}

/* Credit Summary Title */
.credit-summary-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    grid-column: 1 / -1;
}

/* Main Content */
.main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Section Titles */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

/* Query Section */
.query-section {
    margin-bottom: 2rem;
}

.query-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

/* Input Groups */
.input-group {
    margin-bottom: 1.25rem;
}

.label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.label.small {
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

.input, .textarea, .select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.textarea {
    resize: vertical;
    min-height: 80px;
}

.textarea.small {
    min-height: 60px;
}

.select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

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

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

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

.btn-text { }

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

.btn-icon {
    width: 18px;
    height: 18px;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner-inline {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-label.small {
    margin-top: 0.75rem;
}

.toggle-checkbox {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.toggle-switch.small {
    width: 36px;
    height: 20px;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.toggle-switch.small::after {
    width: 14px;
    height: 14px;
}

.toggle-checkbox:checked + .toggle-switch {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.toggle-checkbox:checked + .toggle-switch::after {
    left: calc(100% - 20px);
}

.toggle-checkbox:checked + .toggle-switch.small::after {
    left: calc(100% - 16px);
}

.toggle-text {
    font-size: 0.875rem;
    color: var(--color-text);
}

/* Chairman Section */
.chairman-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
}

.chairman-section.hidden {
    display: none;
}

/* File Upload / Drop Zone */
.drop-zone {
    position: relative;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    pointer-events: none;
}

.upload-icon {
    width: 32px;
    height: 32px;
}

.attachment-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

/* Attachments List */
.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
}

.attachment-icon {
    font-size: 1rem;
}

.attachment-name {
    color: var(--color-text);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

.attachment-remove:hover {
    color: var(--color-error);
}

/* Model Tags */
.selected-models {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 38px;
}

.model-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--color-primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.tag-remove {
    background: none;
    border: none;
    color: white;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    padding: 0;
    margin-left: 0.25rem;
}

.tag-remove:hover {
    opacity: 1;
}

/* Model Picker */
.model-picker {
    margin-top: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.model-picker.hidden {
    display: none;
}

.model-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.model-search .input {
    background: var(--color-bg-card);
}

.model-list {
    max-height: 300px;
    overflow-y: auto;
}

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

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

.model-item:hover {
    background: var(--color-bg-secondary);
}

.model-item.selected {
    background: rgba(99, 102, 241, 0.1);
}

.model-item-info {
    flex: 1;
}

.model-item-name {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.875rem;
}

.model-item-id {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.model-item-meta {
    text-align: right;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

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

/* Advanced Options */
.advanced-options {
    margin-bottom: 1.5rem;
}

.advanced-toggle {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.5rem 0;
}

.advanced-toggle:hover {
    color: var(--color-primary);
}

.options-grid {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.options-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Stats Panel */
.stats-panel {
    margin-bottom: 1.5rem;
}

.stats-panel.hidden {
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Results Section */
.results-section {
    animation: fadeIn 0.3s ease;
}

.results-section.hidden {
    display: none;
}

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

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

.results-summary {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

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

/* Response Card */
.response-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: cardAppear 0.3s ease;
}

@keyframes cardAppear {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.response-card.success {
    border-left: 4px solid var(--color-success);
}

.response-card.error {
    border-left: 4px solid var(--color-error);
}

.response-card.loading {
    border-left: 4px solid var(--color-primary);
}

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

.response-member {
    font-weight: 600;
    color: var(--color-text);
}

.response-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

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

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

.status-dot.success { background: var(--color-success); }
.status-dot.error { background: var(--color-error); }
.status-dot.loading { background: var(--color-primary); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.response-body {
    padding: 1.25rem;
}

.response-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text);
}

.response-error {
    color: var(--color-error);
    font-size: 0.875rem;
}

/* Response Timer */
.response-timer {
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    min-width: 40px;
    text-align: right;
}

/* Thinking Animation */
.thinking-animation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: thinkingBounce 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinkingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.thinking-text {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

/* Response Stats */
.response-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8125rem;
}

.response-stats.hidden {
    display: none;
}

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

.stat-key {
    color: var(--color-text-muted);
}

/* Option Hint */
.option-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    margin-left: 3.25rem;
}

/* Fact-Check Section */
.fact-check-section {
    margin-top: 1.5rem;
}

.fact-check-section.hidden {
    display: none;
}

.fact-check-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid var(--color-success);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.fact-check-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(16, 185, 129, 0.1);
    border-bottom: 1px solid var(--color-success);
}

.fact-check-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-success);
}

.fact-check-icon {
    width: 20px;
    height: 20px;
}

.fact-check-stats {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.fact-check-content {
    padding: 1.25rem;
}

.fact-check-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.fact-check-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

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

.fact-check-model {
    font-weight: 600;
    color: var(--color-text);
}

.fact-check-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.fact-check-item-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text);
}

/* Synthesis Section */
.synthesis-section {
    margin-top: 1.5rem;
}

.synthesis-section.hidden {
    display: none;
}

.synthesis-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid var(--color-primary-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.synthesis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid var(--color-primary-light);
}

.synthesis-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

.synthesis-icon {
    width: 20px;
    height: 20px;
}

.synthesis-stats {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.synthesis-content {
    padding: 1.25rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text);
}

.synthesis-waiting {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-muted);
}

.synthesis-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-primary-light);
    background: rgba(99, 102, 241, 0.05);
}

.synthesis-actions.hidden {
    display: none;
}

/* Credit Summary */
.credit-summary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.credit-summary.hidden {
    display: none;
}

.credit-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.credit-item span:first-child {
    color: var(--color-text-muted);
}

.credit-item span:last-child {
    font-weight: 600;
    color: var(--color-text);
}

.credit-item.highlight span:last-child {
    color: var(--color-primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.footer-version {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.8;
}

.env-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.env-development {
    background: #fef3c7;
    color: #92400e;
}

.env-testing {
    background: #dbeafe;
    color: #1e40af;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .header-content {
        padding: 0.875rem 1rem;
    }

    .header-right {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-end;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-tagline {
        font-size: 0.6875rem;
    }

    .main {
        padding: 1.25rem 1rem;
    }

    .query-card {
        padding: 1.25rem;
    }

    .options-row {
        grid-template-columns: 1fr;
    }

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

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .response-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .response-meta {
        width: 100%;
        justify-content: space-between;
    }

    .synthesis-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .credit-summary {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    .logo-tagline {
        display: none;
    }

    .version {
        font-size: 0.75rem;
        padding: 0.125rem 0.5rem;
    }

    .credits-badge {
        padding: 0.25rem 0.5rem;
    }

    .btn {
        padding: 0.75rem 1rem;
    }

    .model-tag {
        font-size: 0.8125rem;
        padding: 0.25rem 0.625rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .header-content {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }

    .main {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }

    .footer {
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
}

/* Console Log Section */
.console-log-section {
    margin-top: 1.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.console-log-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.console-log-section[open] .console-log-toggle {
    border-bottom-color: var(--color-border);
}

.console-log-toggle:hover {
    color: var(--color-primary);
}

.console-icon {
    width: 16px;
    height: 16px;
}

.console-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: var(--color-text-muted);
    border-radius: var(--radius-full);
}

.console-count.active {
    background: var(--color-primary);
}

.console-count.error {
    background: var(--color-error);
}

.console-log-content {
    max-height: 300px;
    overflow-y: auto;
    background: #1e1e2e;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.console-empty {
    padding: 1.5rem;
    text-align: center;
    color: #6c7086;
}

.console-entry {
    display: flex;
    gap: 0.75rem;
    padding: 0.375rem 1rem;
    border-bottom: 1px solid #313244;
}

.console-entry:last-child {
    border-bottom: none;
}

.console-entry:hover {
    background: rgba(255, 255, 255, 0.03);
}

.console-time {
    color: #6c7086;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.console-type {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 50px;
}

.console-type.info { color: #89b4fa; }
.console-type.success { color: #a6e3a1; }
.console-type.error { color: #f38ba8; }
.console-type.warn { color: #f9e2af; }
.console-type.debug { color: #cba6f7; }

.console-message {
    color: #cdd6f4;
    word-break: break-word;
}

.console-message .highlight {
    color: #f9e2af;
    font-weight: 500;
}

/* Model Assessment Section */
.model-assessment-section {
    margin-top: 1.5rem;
}

.model-assessment-section.hidden {
    display: none;
}

.assessment-card {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.1), rgba(245, 158, 11, 0.1));
    border: 1px solid #f59e0b;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.assessment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(245, 158, 11, 0.1);
    border-bottom: 1px solid #f59e0b;
}

.assessment-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #d97706;
}

.assessment-icon {
    width: 20px;
    height: 20px;
}

.assessment-content {
    padding: 0;
    overflow-x: auto;
}

.assessment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

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

.assessment-table th {
    background: var(--color-bg-secondary);
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.assessment-table tr:hover td {
    background: rgba(245, 158, 11, 0.05);
}

.assessment-table td {
    color: var(--color-text);
}

.assessment-vendor {
    font-weight: 500;
    color: var(--color-text-secondary);
}

.assessment-model {
    font-weight: 600;
}

.assessment-quality {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}

.assessment-quality.excellent {
    background: #d1fae5;
    color: #059669;
}

.assessment-quality.good {
    background: #dbeafe;
    color: #2563eb;
}

.assessment-quality.fair {
    background: #fef3c7;
    color: #d97706;
}

.assessment-quality.poor {
    background: #fee2e2;
    color: #dc2626;
}

.assessment-time {
    font-variant-numeric: tabular-nums;
}

.assessment-cost {
    font-variant-numeric: tabular-nums;
    color: var(--color-success);
}

.assessment-notes {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    max-width: 200px;
}

/* Dark mode adjustments for console */
@media (prefers-color-scheme: dark) {
    .console-log-content {
        background: #0d1117;
    }

    .console-entry {
        border-bottom-color: #21262d;
    }

    .console-time { color: #8b949e; }
    .console-message { color: #c9d1d9; }

    .assessment-quality.excellent {
        background: #064e3b;
        color: #34d399;
    }

    .assessment-quality.good {
        background: #1e3a5f;
        color: #60a5fa;
    }

    .assessment-quality.fair {
        background: #422006;
        color: #fbbf24;
    }

    .assessment-quality.poor {
        background: #450a0a;
        color: #f87171;
    }
}

/* Responsive for assessment table */
@media (max-width: 768px) {
    .assessment-table {
        font-size: 0.8125rem;
    }

    .assessment-table th,
    .assessment-table td {
        padding: 0.625rem 0.75rem;
    }

    .assessment-notes {
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .assessment-content {
        overflow-x: scroll;
    }

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

/* Vendor-organized Model Picker */
.model-list-vendors {
    display: flex;
    flex-direction: column;
}

.vendor-group {
    border-bottom: 1px solid var(--color-border);
}

.vendor-group:last-child {
    border-bottom: none;
}

.vendor-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-secondary);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.vendor-header:hover {
    background: rgba(99, 102, 241, 0.1);
}

.vendor-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text);
}

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

.vendor-toggle {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    transition: transform var(--transition);
}

.vendor-group.collapsed .vendor-toggle {
    transform: rotate(-90deg);
}

.vendor-models {
    display: block;
}

.vendor-group.collapsed .vendor-models {
    display: none;
}

/* Model item with checkbox */
.model-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

.model-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.model-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background var(--transition);
}

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

.model-item:hover {
    background: var(--color-bg-secondary);
}

.model-item.selected {
    background: rgba(99, 102, 241, 0.1);
}

.model-price {
    color: var(--color-success);
    font-weight: 500;
}

/* Multi-column layout for wide screens */
@media (min-width: 900px) {
    .model-list {
        max-height: 500px;
    }

    .model-list-vendors {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }

    .vendor-group {
        border-right: 1px solid var(--color-border);
    }

    .vendor-group:nth-child(2n) {
        border-right: none;
    }
}

@media (min-width: 1200px) {
    .model-list-vendors {
        grid-template-columns: repeat(3, 1fr);
    }

    .vendor-group:nth-child(2n) {
        border-right: 1px solid var(--color-border);
    }

    .vendor-group:nth-child(3n) {
        border-right: none;
    }
}

/* Progress Timeline Section */
.progress-section {
    margin-bottom: 1.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-md);
}

.progress-section.hidden {
    display: none;
}

.progress-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 1rem;
}

/* Connecting line between steps */
.progress-timeline::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--color-border);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    position: relative;
    z-index: 1;
}

.progress-step.disabled {
    opacity: 0.4;
}

.step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.progress-step.active .step-indicator {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.progress-step.complete .step-indicator {
    background: var(--color-success);
    border-color: var(--color-success);
}

.step-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0;
}

.progress-step.active .step-spinner {
    opacity: 1;
    animation: spin 0.8s linear infinite;
    border-color: white;
    border-top-color: transparent;
}

.step-spinner.hidden {
    display: none;
}

.step-check {
    width: 20px;
    height: 20px;
    color: white;
}

.step-check.hidden {
    display: none;
}

.step-content {
    text-align: center;
    max-width: 120px;
}

.step-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.125rem;
}

.progress-step.active .step-title {
    color: var(--color-primary);
}

.progress-step.complete .step-title {
    color: var(--color-success);
}

.step-detail {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.3;
}

.progress-step.active .step-detail {
    color: var(--color-text-secondary);
}

/* Live Status Bar */
.progress-live-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.progress-live-status.complete {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1));
    border-color: rgba(16, 185, 129, 0.2);
}

.live-indicator {
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

.progress-live-status.complete .live-indicator {
    background: var(--color-success);
    animation: none;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

#liveStatusText {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

/* Responsive progress timeline */
@media (max-width: 768px) {
    .progress-timeline {
        flex-direction: column;
        gap: 1rem;
    }

    .progress-timeline::before {
        display: none;
    }

    .progress-step {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
    }

    .step-indicator {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .step-content {
        text-align: left;
        max-width: none;
    }
}

/* Download Document Section */
.download-section {
    margin-top: 2rem;
    animation: slideUp 0.4s ease;
}

.download-section.hidden {
    display: none;
}

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

.download-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.download-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.download-icon-large {
    width: 32px;
    height: 32px;
    color: white;
}

.download-info {
    flex: 1;
}

.download-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.download-description {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.btn-download {
    flex-shrink: 0;
    background: white;
    color: #059669;
    padding: 1rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: auto;
}

.btn-download:hover {
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-download:active {
    transform: translateY(0);
}

/* Responsive download section */
@media (max-width: 768px) {
    .download-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1rem;
    }

    .download-info {
        order: 2;
    }

    .download-icon-wrapper {
        order: 1;
        width: 50px;
        height: 50px;
    }

    .download-icon-large {
        width: 28px;
        height: 28px;
    }

    .btn-download {
        order: 3;
        width: 100%;
    }

    .download-title {
        font-size: 1.125rem;
    }

    .download-description {
        font-size: 0.875rem;
    }
}

/* ===========================================
   LANDING PAGE STYLES
   =========================================== */

.landing-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #e0e7ff 50%, #c7d2fe 100%);
}

@media (prefers-color-scheme: dark) {
    .landing-app {
        background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    }
}

.landing-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .landing-header {
        background: rgba(15, 23, 42, 0.95);
        border-bottom: 1px solid rgba(51, 65, 85, 0.8);
    }
}

.landing-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #64748b;
    transition: all 0.2s ease;
    margin-right: 0.75rem;
}

.home-icon-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

@media (prefers-color-scheme: dark) {
    .home-icon-link {
        color: #94a3b8;
    }
    .home-icon-link:hover {
        background: rgba(129, 140, 248, 0.1);
        color: #818cf8;
    }
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.landing-logo-icon {
    width: 40px;
    height: 40px;
    color: #6366f1;
}

.landing-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover {
    color: #6366f1;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #6366f1;
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #64748b;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover:not(:disabled) {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (prefers-color-scheme: dark) {
    .nav-link {
        color: #94a3b8;
    }
    .nav-link:hover {
        color: #818cf8;
    }
    .btn-outline {
        border-color: #334155;
        color: #94a3b8;
    }
    .btn-outline:hover:not(:disabled) {
        border-color: #818cf8;
        color: #818cf8;
    }
}

.hero-section {
    padding: 2.5rem 2rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

@media (prefers-color-scheme: dark) {
    .hero-title {
        color: #f1f5f9;
    }
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

@media (prefers-color-scheme: dark) {
    .hero-subtitle {
        color: #94a3b8;
    }
}

.apps-section {
    padding: 1.5rem 2rem 4rem;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 3rem;
}

@media (prefers-color-scheme: dark) {
    .section-heading {
        color: #f1f5f9;
    }
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
}

.app-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border: none;
    border-top: 4px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .app-card {
        background: #1e293b;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
    }
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 20px;
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.app-card:hover::before {
    opacity: 1;
}

a.app-card:hover {
    text-decoration: none;
}

.app-card-quorum { border-top-color: #6366f1; }
.app-card-music { border-top-color: #ec4899; }
.app-card-assistant { border-top-color: #8b5cf6; }
.app-card-trading { border-top-color: #10b981; }
.app-card-calendar { border-top-color: #f59e0b; }
.app-card-travel { border-top-color: #3b82f6; }
.app-card-orson { border-top-color: #d97706; }

.app-card-quorum:hover { box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.35); }
.app-card-music:hover { box-shadow: 0 25px 50px -12px rgba(236, 72, 153, 0.35); }
.app-card-assistant:hover { box-shadow: 0 25px 50px -12px rgba(139, 92, 246, 0.35); }
.app-card-trading:hover { box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.35); }
.app-card-calendar:hover { box-shadow: 0 25px 50px -12px rgba(245, 158, 11, 0.35); }
.app-card-travel:hover { box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.35); }
.app-card-orson:hover { box-shadow: 0 25px 50px -12px rgba(217, 119, 6, 0.35); }

.app-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.app-card-quorum .app-card-icon { background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05)); color: #6366f1; }
.app-card-music .app-card-icon { background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.05)); color: #ec4899; }
.app-card-assistant .app-card-icon { background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05)); color: #8b5cf6; }
.app-card-trading .app-card-icon { background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05)); color: #10b981; }
.app-card-calendar .app-card-icon { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05)); color: #f59e0b; }
.app-card-travel .app-card-icon { background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05)); color: #3b82f6; }
.app-card-orson .app-card-icon { background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(217, 119, 6, 0.05)); color: #d97706; }

.app-card-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 1.5;
}

.app-card-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.app-card-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

@media (prefers-color-scheme: dark) {
    .app-card-title {
        color: #f1f5f9;
    }
}

.app-card-description {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.65;
    margin-bottom: 1.25rem;
}

@media (prefers-color-scheme: dark) {
    .app-card-description {
        color: #94a3b8;
    }
}

.app-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.app-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 100px;
    background: #f1f5f9;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

@media (prefers-color-scheme: dark) {
    .app-tag {
        background: #334155;
        color: #94a3b8;
    }
}

.app-card-status {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    border-radius: 100px;
    z-index: 2;
}

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

.status-live {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

@media (prefers-color-scheme: dark) {
    .status-live {
        color: #34d399;
    }
}

.status-live .status-dot {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.status-coming {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

@media (prefers-color-scheme: dark) {
    .status-coming {
        background: #334155;
        color: #94a3b8;
        border-color: #475569;
    }
}

.status-coming .status-dot {
    background: #94a3b8;
}

.about-section {
    padding: 5rem 2rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

@media (prefers-color-scheme: dark) {
    .about-section {
        background: #1e293b;
        border-top-color: #334155;
    }
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 1.125rem;
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 3rem;
}

@media (prefers-color-scheme: dark) {
    .about-text {
        color: #94a3b8;
    }
}

.about-features {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.about-feature:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
    .about-feature {
        color: #f1f5f9;
        background: #334155;
    }
    .about-feature:hover {
        background: #475569;
    }
}

.about-feature svg {
    width: 24px;
    height: 24px;
    color: #6366f1;
}

.landing-footer {
    padding: 2.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

@media (prefers-color-scheme: dark) {
    .landing-footer {
        background: #1e293b;
        border-top-color: #334155;
    }
}

.landing-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

@media (prefers-color-scheme: dark) {
    .footer-brand {
        color: #f1f5f9;
    }
}

.footer-logo-icon {
    width: 24px;
    height: 24px;
    color: #6366f1;
}

.footer-copy {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0;
}

.footer-version {
    font-size: 0.75rem;
    color: #94a3b8;
}

.env-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.env-development {
    background: #fef3c7;
    color: #92400e;
}

.env-staging {
    background: #dbeafe;
    color: #1e40af;
}

@media (max-width: 1024px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .landing-header-content {
        padding: 1rem 1.5rem;
    }

    .landing-nav {
        gap: 1rem;
    }

    .nav-link {
        display: none;
    }

    .hero-section {
        padding: 3rem 1.5rem 2.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.0625rem;
    }

    .apps-section {
        padding: 2rem 1.5rem 3rem;
    }

    .apps-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .app-card {
        min-height: auto;
        padding: 1.5rem;
    }

    .about-section {
        padding: 3rem 1.5rem;
    }

    .about-features {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .about-feature {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .landing-logo-text {
        font-size: 1.25rem;
    }

    .landing-logo-icon {
        width: 32px;
        height: 32px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-heading {
        font-size: 1.5rem;
    }

    .app-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .app-card-icon {
        width: 52px;
        height: 52px;
        border-radius: 12px;
    }

    .app-card-icon svg {
        width: 26px;
        height: 26px;
    }

    .app-card-title {
        font-size: 1.125rem;
    }

    .app-card-description {
        font-size: 0.875rem;
    }

    .app-card-status {
        top: 1rem;
        right: 1rem;
        padding: 0.25rem 0.625rem;
        font-size: 0.6875rem;
    }
}

/* ===========================================
   AUTHENTICATION STYLES
   =========================================== */

/* Google Sign-In Button */
.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-google:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-google svg {
    flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
    .btn-google {
        background: #1e293b;
        color: #f1f5f9;
        border-color: #475569;
    }

    .btn-google:hover {
        background: #334155;
        border-color: #64748b;
    }
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

.user-menu-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

@media (prefers-color-scheme: dark) {
    .user-menu-btn {
        border-color: #475569;
        color: #f1f5f9;
    }

    .user-menu-btn:hover {
        background: #334155;
        border-color: #64748b;
    }
}

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

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.hidden {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .user-dropdown {
        background: #1e293b;
        border-color: #334155;
    }
}

.user-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

@media (prefers-color-scheme: dark) {
    .user-dropdown-header {
        border-bottom-color: #334155;
    }
}

.user-dropdown-email {
    font-size: 0.8125rem;
    color: #64748b;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    font-size: 0.875rem;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.user-dropdown-item:hover {
    background: #f1f5f9;
}

@media (prefers-color-scheme: dark) {
    .user-dropdown-item {
        color: #f1f5f9;
    }

    .user-dropdown-item:hover {
        background: #334155;
    }
}

.user-dropdown-item svg {
    color: #64748b;
}

/* Auth container in nav */
#auth-container,
#auth-container-quorum {
    display: flex;
    align-items: center;
}

/* Compact Google button for quorum header */
.btn-google-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    gap: 0.5rem;
}

/* Compact user menu for quorum header */
.user-menu-compact {
    position: relative;
}

.user-menu-btn-compact {
    padding: 0.25rem 0.5rem;
    gap: 0.375rem;
}

.user-avatar-small {
    width: 24px;
    height: 24px;
}

.user-dropdown-name {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
    margin-bottom: 0.125rem;
}

@media (prefers-color-scheme: dark) {
    .user-dropdown-name {
        color: #f1f5f9;
    }
}

/* Sign-in required banner */
.signin-required-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 100px;
    color: #b45309;
    font-size: 0.9375rem;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .signin-required-banner {
        color: #fbbf24;
    }
}
