/* ============================================
   ORDONOESIS - Combined Stylesheet
   Version: 8.1 (Cleaned - Dead Code Removed)
   ============================================ */

/* ============================================
   1. CSS VARIABLES
   ============================================ */
:root {
    /* Primary Accent */
    --primary-accent: #707070;
    --accent-subtle: rgba(112, 112, 112, 0.15);
    
    /* AI Blue - Main Interactive Color */
    --ai-blue: #00A3FF;
    --ai-blue-soft: rgba(0, 163, 255, 0.7);
    --ai-blue-glow: rgba(0, 163, 255, 0.3);
    
    /* Status Colors */
    --teal-success: #1ABC9C;
    --amber-warning: #F5A623;
    --red-error: #EF4444;
    
    /* Foundation - Pure Black Base */
    --bg-primary: #000;
    --bg-secondary: rgba(255, 255, 255, 0.03);
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    /* Borders - White Based */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.15);
    --border-strong: rgba(255, 255, 255, 0.25);
    
    /* Surfaces */
    --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    --card-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    --glow-soft: rgba(255, 255, 255, 0.08);
    
    /* Shadows */
    --shadow-sm: 0 0 8px rgba(255, 255, 255, 0.02);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
    
    /* Easing */
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   2. GLOBAL RESET
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ============================================
   3. PAGE LAYOUT & STATES
   ============================================ */
.page {
    width: 100%;
    min-height: 100vh;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page.active {
    display: block;
    opacity: 1;
}

#domainPage,
#appPage {
    background: var(--bg-primary);
}

.domain-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.app-main {
    margin-bottom: 90px;
    min-height: calc(100vh - 90px);
    width: 100%;
}

.app-content-wrapper {
    max-width: 1800px;
    margin: 0 auto;
    padding: 40px 60px;
    width: 100%;
}

/* ============================================
   4. MENU BUTTON
   ============================================ */
.menu-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.menu-button:hover {
    background: var(--glass-bg);
    border-color: var(--ai-blue);
    transform: translateY(-1px);
}

.menu-button svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   5. VIEW CONTROLS
   ============================================ */
.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.view-toggles {
    display: flex;
    gap: 10px;
}

.view-toggle {
    padding: 10px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.view-toggle:hover {
    background: var(--glass-bg);
    border-color: var(--text-primary);
}

.view-toggle.active {
    background: var(--ai-blue);
    color: var(--text-primary);
    border-color: var(--ai-blue);
    box-shadow: 0 0 15px var(--ai-blue-glow);
}

/* ============================================
   6. INPUT SYSTEM
   ============================================ */
.input-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label-text {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15rem;
    color: #fff;
    text-transform: uppercase;
}

.label-badge {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08rem;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.label-badge.required {
    color: var(--ai-blue);
    background: rgba(0, 163, 255, 0.15);
}

.label-badge.optional {
    color: var(--text-secondary);
    background: var(--glass-bg);
}

.char-counter {
    align-self: flex-end;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Base Input Styles */
.input-field {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.2s ease;
    outline: none;
}

.input-field::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.input-field:hover {
    border-color: var(--border-medium);
    background: var(--bg-secondary);
}

.input-field:focus {
    border-color: var(--ai-blue);
    box-shadow: 0 0 0 3px var(--ai-blue-glow);
}

/* ============================================
   7. CONSTRAINTS SECTION
   ============================================ */
.constraints-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.constraints-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.constraints-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
}

.constraints-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.constraint-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.constraint-label {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

.constraint-input,
.constraint-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.constraint-input:focus,
.constraint-select:focus {
    outline: none;
    border-color: var(--ai-blue);
}

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

.constraint-prefix,
.constraint-suffix {
    position: absolute;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.constraint-prefix { left: 12px; }
.constraint-suffix { right: 12px; }

.constraint-input.has-prefix { padding-left: 28px; }
.constraint-input.has-suffix { padding-right: 60px; }

.constraint-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.constraint-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.constraint-hint {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   8. OPTIONS SECTION
   ============================================ */
.options-section {
    margin-top: 24px;
}

.options-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 16px;
}

.options-title {
    display: none;
}

.add-option-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-option-btn:hover {
    border-color: var(--ai-blue);
    color: var(--ai-blue);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   9. OPTION CARDS
   ============================================ */
.option-card {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: border-color 0.2s;
}

.option-card:hover {
    border-color: var(--border-medium);
}

.option-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.option-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-number {
    display: none;
}

.remove-option-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-option-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--red-error);
    color: var(--red-error);
}

.option-name-group {
    margin-bottom: 16px;
}

.option-name-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    transition: border-color 0.2s;
}

.option-name-input:focus {
    outline: none;
    border-color: var(--ai-blue);
}

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

/* Option Fields Grid */
.option-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.option-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-field-label {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.required-badge {
    font-size: 9px;
    color: var(--ai-blue);
    background: rgba(0, 163, 255, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    letter-spacing: 0.5px;
}

.option-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.option-field-input,
.option-field-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.option-field-input:focus,
.option-field-select:focus {
    outline: none;
    border-color: var(--ai-blue);
}

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

.option-field-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.option-field-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.field-prefix,
.field-suffix {
    position: absolute;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.field-prefix { left: 12px; }
.field-suffix { right: 12px; }

.option-field-input.has-prefix { padding-left: 28px; }
.option-field-input.has-suffix { padding-right: 50px; }

.field-hint {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Field Section Colors - All white labels, colored focus only */
.option-field.field-section-economics .option-field-label { color: #fff; }
.option-field.field-section-economics .option-field-input:focus { border-color: var(--ai-blue); }

.option-field.field-section-forecast .option-field-label { color: #fff; }
.option-field.field-section-forecast .option-field-input:focus,
.option-field.field-section-forecast .option-field-select:focus { border-color: var(--ai-blue); }

.option-field.field-section-market .option-field-label { color: #fff; }
.option-field.field-section-market .option-field-input:focus { border-color: var(--ai-blue); }

.option-field.field-section-capital .option-field-label { color: #fff; }
.option-field.field-section-capital .option-field-input:focus { border-color: var(--ai-blue); }

.option-field.field-section-time .option-field-label { color: #fff; }
.option-field.field-section-time .option-field-input:focus { border-color: var(--ai-blue); }

.option-field.field-section-staging .option-field-label { color: #fff; }
.option-field.field-section-staging .option-field-input:focus { border-color: var(--ai-blue); }

.option-field.field-section-execution .option-field-label { color: #fff; }
.option-field.field-section-execution .option-field-input:focus { border-color: var(--ai-blue); }

.option-field.field-section-validation .option-field-label { color: #fff; }
.option-field.field-section-validation .option-field-input:focus { border-color: var(--ai-blue); }

/* Domain Select */
.option-domain-select {
    padding: 6px 28px 6px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: all 0.2s;
}

.option-domain-select:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.option-domain-select:focus {
    outline: none;
    border-color: var(--ai-blue);
    color: var(--ai-blue);
}

/* ============================================
   10. QUALITATIVE/CONTEXT SECTION
   ============================================ */
.qualitative-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qualitative-label {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.qualitative-select {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.qualitative-select:focus {
    outline: none;
    border-color: var(--ai-blue);
}

.option-context-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.option-context-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.option-context-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--ai-blue);
    letter-spacing: 0.5px;
}

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

@media (max-width: 900px) {
    .option-context-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .option-context-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   11. DECISION OUTPUT
   ============================================ */
.decision-output {
    width: 100%;
    padding: 40px;
    min-height: 400px;
}

.decision-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.decision-verdict-section {
    text-align: center;
    margin-bottom: 40px;
}

.decision-verdict {
    font-size: 14px;
    color: var(--ai-blue);
    letter-spacing: 3px;
    font-weight: 600;
    margin-bottom: 16px;
}

.decision-path-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.decision-path-description {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.6;
}

.ai-analysis-section {
    width: 100%;
    max-width: 700px;
}

.ai-analysis-content {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.8;
    text-align: left;
}

.ai-analysis-content p {
    margin: 0 0 20px 0;
}

.ai-analysis-content p:last-child {
    margin-bottom: 0;
}

/* Loading States */
.ai-loading {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-loading-shimmer {
    height: 16px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-primary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.ai-loading-shimmer:nth-child(1) { width: 100%; }
.ai-loading-shimmer:nth-child(2) { width: 95%; }
.ai-loading-shimmer:nth-child(3) { width: 90%; }
.ai-loading-shimmer:nth-child(4) { width: 85%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-text {
    font-size: 18px;
    color: var(--ai-blue);
    margin-bottom: 24px;
}

.loading-timer {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.timer-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 8px;
}

.loading-subtext {
    font-size: 12px;
    color: var(--text-muted);
}

.error-message {
    padding: 40px;
    text-align: center;
    color: var(--red-error);
    font-size: 16px;
}

/* Single Path Mode */
.single-path-mode .decision-verdict-section {
    padding: 24px;
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    background: var(--card-bg);
}

.single-path-metrics {
    width: 100%;
    max-width: 500px;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

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

.metric-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-value.positive { color: var(--teal-success); }
.metric-value.negative { color: var(--red-error); }
.metric-value.risk-highlight { color: var(--amber-warning); }

/* ============================================
   12. ACTION BAR
   ============================================ */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0 60px;
    z-index: 99;
}

.action-button {
    flex: 0 1 400px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    padding: 16px 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.08rem;
}

.action-button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.action-button.primary {
    background: var(--ai-blue);
    color: var(--text-primary);
    border-color: var(--ai-blue);
    box-shadow: 0 0 20px var(--ai-blue-glow);
}

.action-button.primary:hover {
    box-shadow: 0 0 30px var(--ai-blue-glow), 0 8px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(-3px);
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   13. MENU SYSTEM
   ============================================ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 85vw;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-medium);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2001;
    display: flex;
    flex-direction: column;
}

.menu-overlay.active .menu-panel {
    transform: translateX(0);
}

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

.menu-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--text-primary);
}

.menu-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: all 0.2s ease;
}

.menu-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.menu-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.menu-item {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 24px 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.menu-item:hover {
    background: var(--glass-bg);
}

.menu-item-text {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.menu-item-arrow {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.menu-item:hover .menu-item-arrow {
    color: var(--ai-blue);
    transform: translateX(4px);
}

.menu-item.menu-logout .menu-item-text {
    color: var(--red-error);
}

/* ============================================
   14. AUTH MODAL
   ============================================ */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    width: 90%;
    max-width: 450px;
    padding: 40px;
    position: relative;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--ai-blue);
    box-shadow: 0 0 0 3px var(--ai-blue-glow);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

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

.password-toggle .eye-icon {
    display: block;
}

.password-toggle .eye-icon.hidden {
    display: none;
}

.auth-button {
    width: 100%;
    padding: 16px;
    background: var(--ai-blue);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--ai-blue-glow);
}

.auth-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red-error);
    display: block;
}

/* ============================================
   15. SPLIT PANEL LAYOUT (Chat)
   ============================================ */
.split-container {
    display: flex;
    height: calc(100vh - 90px);
    overflow: hidden;
}

.form-panel {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 24px;
    border-right: 1px solid var(--border-subtle);
}

.chat-panel-inline {
    width: 420px;
    min-width: 320px;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-subtle);
}

.chat-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.chat-logo {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1);
    display: block;
    object-fit: contain;
}

.chat-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
}

.chat-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.chat-body-inline {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 95%;
}

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

.chat-message.assistant {
    align-self: flex-start;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: #000;
    border: 1.5px solid var(--ai-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    box-shadow: 0 0 10px var(--ai-blue-glow);
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.chat-message.assistant .chat-bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
    background: var(--ai-blue);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator .chat-bubble {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Quick Actions */
.chat-quick-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    overflow-x: auto;
    border-top: 1px solid var(--border-subtle);
}

.quick-action-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-action-btn:hover {
    border-color: var(--ai-blue);
    color: var(--ai-blue);
}

.quick-action-btn.end-discussion {
    border-color: var(--red-error);
    color: var(--red-error);
}

.quick-action-btn.end-discussion:hover {
    background: var(--red-error);
    color: var(--text-primary);
}

/* Chat Input */
.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-primary);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--ai-blue);
}

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

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: var(--ai-blue);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 0 10px var(--ai-blue-glow);
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Chat Upload Zone */
.chat-upload-zone {
    cursor: pointer;
    border: 2px dashed var(--border-medium) !important;
    background: var(--bg-primary) !important;
    transition: all 0.3s ease;
    text-align: center;
    padding: 24px !important;
}

.chat-upload-zone:hover,
.chat-upload-zone.dragover {
    border-color: var(--ai-blue) !important;
    background: rgba(0, 163, 255, 0.05) !important;
}

.chat-upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.chat-upload-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.chat-upload-hint {
    font-size: 10px;
    color: var(--text-muted);
}

.chat-file-input {
    display: none;
}

/* Mobile Chat FAB */
.chat-fab {
    display: none;
    position: fixed;
    bottom: 110px;
    right: 20px;
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.chat-fab:hover {
    transform: scale(1.05);
}

.chat-fab-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.05rem;
    text-align: center;
}

.chat-fab-button {
    width: 56px;
    height: 56px;
    background: #000;
    border: 2px solid var(--ai-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--ai-blue-glow);
}

.chat-fab-icon {
    width: 36px;
    height: 36px;
    background: url('public/print.png') center/contain no-repeat;
    filter: brightness(0) invert(1);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Mobile Chat Modal */
.chat-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: flex-end;
}

.chat-modal-overlay.active {
    display: flex;
}

.chat-modal {
    width: 100%;
    height: 85vh;
    background: var(--bg-primary);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
}

.chat-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.chat-modal-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
}

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

.chat-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

/* ============================================
   16. LANDING PAGE - BRAIN VISUAL
   ============================================ */
.brain-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 0;
}

.brain-svg {
    width: 100%;
    max-height: 55vh;
    display: block;
}

@media (max-width: 768px) {
    .brain-svg {
        max-height: 45vh;
    }
}

.brain-header {
    text-align: center;
    margin-bottom: 8px;
}

.brain-title {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: 0.6rem;
    color: #fff;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    margin: 0 0 12px 0;
}

@media (max-width: 768px) {
    .brain-title {
        font-size: 2.2rem;
        letter-spacing: 0.4rem;
    }
}

.brain-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Cortex Legend */
.cortex-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding: 0 20px;
}

.cortex-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.05rem;
}

.cortex-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cortex-legend {
        gap: 12px 16px;
    }
    
    .cortex-item {
        font-size: 10px;
    }
    
    .cortex-dot {
        width: 8px;
        height: 8px;
    }
}

/* Begin Button */
.begin-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.begin-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 14px 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.begin-button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.begin-text {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.15rem;
}

/* ============================================
   17. UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   18. SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

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

/* Chat scrollbar */
.chat-messages-inline::-webkit-scrollbar,
.chat-messages-mobile::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-inline::-webkit-scrollbar-track,
.chat-messages-mobile::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-inline::-webkit-scrollbar-thumb,
.chat-messages-mobile::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* ============================================
   19. RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1200px) {
    .app-content-wrapper {
        max-width: 100%;
        padding: 30px 40px;
    }
}

@media (max-width: 1024px) {
    .constraints-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .option-fields {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .split-container {
        flex-direction: column;
        height: auto;
    }
    
    .form-panel {
        border-right: none;
    }
    
    .chat-panel-inline {
        display: none;
    }
    
    .chat-fab {
        display: flex;
    }
}

/* ============================================
   20. RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .app-main {
        margin-bottom: 80px;
    }
    
    .app-content-wrapper {
        padding: 20px;
    }
    
    .input-container {
        gap: 25px;
    }
    
    .input-field {
        font-size: 16px;
        padding: 14px 16px;
    }
    
    .action-bar {
        height: 80px;
        padding: 0 20px;
        gap: 12px;
    }
    
    .action-button {
        flex: 1;
        font-size: 0.9rem;
        padding: 16px 20px;
    }
    
    /* Constraints & Options */
    .constraints-grid,
    .option-fields {
        grid-template-columns: 1fr;
    }
    
    .constraints-section {
        padding: 16px;
    }
    
    .constraint-input,
    .constraint-select,
    .option-field-input,
    .option-field-select,
    .option-name-input {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .option-card {
        padding: 16px;
    }
    
    .option-card-header {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .option-context-grid {
        grid-template-columns: 1fr;
    }
    
    /* Brain visual */
    .brain-container {
        padding: 0 16px;
    }
    
    .brain-svg {
        max-height: 40vh;
    }
    
    .brain-title {
        font-size: 1.8rem;
        letter-spacing: 0.3rem;
    }
    
    .brain-subtitle {
        font-size: 0.7rem;
    }
    
    /* Decision output */
    .decision-path-name {
        font-size: 24px;
    }
    
    .ai-analysis-content {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .option-field {
        margin-bottom: 10px;
    }
    
    .begin-button {
        padding: 12px 32px;
    }
    
    .begin-text {
        font-size: 12px;
        letter-spacing: 0.12rem;
    }
}

/* ============================================
   7b. INACTION BASELINE SECTION
   ============================================ */
.inaction-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.inaction-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
}

.inaction-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
}

.inaction-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.inaction-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.inaction-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inaction-label {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.inaction-select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    transition: border-color 0.2s;
}

.inaction-select:focus {
    outline: none;
    border-color: var(--ai-blue);
}

.inaction-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .inaction-fields {
        grid-template-columns: 1fr;
    }
    
    .inaction-section {
        padding: 16px;
    }
    
    .inaction-select {
        font-size: 16px;
    }

    .inaction-header {
        flex-direction: column;
        gap: 4px;
    }
}
.chat-header-logo {
    width: 200px;
    height: auto;
}
