:root {
    /* Color Palette - Clean Editorial (from GitHub project) */
    --color-bg: #FFFDF9;
    --color-text: #2C3E2D;
    --color-text-muted: #5C6B5D;
    --color-text-light: #8C8A82;
    --color-green: #4a7c59;
    --color-green-dark: #3d6849;
    --color-green-light: #5d9a6e;
    --color-terracotta: #b7472a;
    --color-border: #E8E5DD;
    --color-border-light: #D4D1C7;
    --color-surface: #F5F3EE;
    --color-surface-light: #FAFAF8;
    --color-dark: #2C3E2D;

    --font-heading: Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

.app-container {
    width: 100%;
    min-height: 100vh;
}

/* Header */
.site-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: bold;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.logo-wordmark {
    height: 36px;
    width: auto;
}

/* Hero Section */
.hero-section {
    padding: 80px 32px 60px;
    max-width: 720px;
    margin: 0 auto;
}

.hero-label {
    font-size: 14px;
    font-weight: bold;
    color: var(--color-terracotta);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: normal;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--color-text);
}

.hero-title em {
    font-style: italic;
}

.hero-subtitle {
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* Stat Section */
.stat-section {
    padding: 48px 32px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.stat-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 56px;
    color: var(--color-green);
    line-height: 1;
}

.stat-text {
    font-size: 17px;
    color: var(--color-text-muted);
}

.stat-source {
    display: block;
    font-size: 13px;
    color: var(--color-text-light);
    margin-top: 4px;
}

/* Problem Section */
.problem-section {
    padding: 64px 32px;
    max-width: 720px;
    margin: 0 auto;
}

.problem-section h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 20px;
    color: var(--color-text);
}

.problem-section p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.problem-section em {
    font-style: italic;
}

/* Demo Section */
.demo-section {
    padding: 0 32px 80px;
    max-width: 900px;
    margin: 0 auto;
}

.demo-container {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(44, 62, 45, 0.06);
}

.demo-note {
    margin-top: 16px;
    font-size: 14px;
    color: var(--color-text-light);
    text-align: center;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-light);
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-light);
    border-bottom: 2px solid transparent;
    font-family: var(--font-body);
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: var(--color-text-muted);
}

.tab-btn.active {
    color: var(--color-text);
    border-bottom-color: var(--color-green);
}

/* Panels */
.panel {
    display: none;
}

.panel.active {
    display: flex;
    flex-direction: column;
}

/* Chat Panel */
#chat-panel {
    height: 520px;
}

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

.message {
    max-width: 80%;
    display: flex;
}

.message .bubble {
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.55;
}

.message.bot {
    align-self: flex-start;
}

.message.bot .bubble {
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 18px 18px 18px 4px;
}

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

.message.user .bubble {
    background: var(--color-green);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.chat-input-area {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid var(--color-border-light);
    border-radius: 28px;
    font-size: 15px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--color-green);
}

.send-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--color-border-light);
    color: white;
    border-radius: 50%;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.send-btn.active {
    background: var(--color-green);
    cursor: pointer;
}

.send-btn.active:hover {
    background: var(--color-green-dark);
}

/* Budget Panel */
#budget-panel.active {
    display: block;
}

.budget-content {
    padding: 32px;
    max-height: 520px;
    overflow-y: auto;
}

/* Period Selector */
.period-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.period-label {
    font-size: 14px;
    color: var(--color-text-muted);
}

.period-selector select {
    padding: 8px 28px 8px 12px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-body);
    background: white;
    color: var(--color-text);
    cursor: pointer;
    outline: none;
}

.period-selector select:focus {
    border-color: var(--color-green);
}

.budget-group {
    margin-bottom: 32px;
}

.budget-group-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.income-title {
    color: var(--color-green);
}

.expense-title {
    color: var(--color-terracotta);
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.budget-item {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.budget-item input[type="text"],
.budget-item input[type="number"] {
    padding: 14px 16px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    font-size: 15px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
}

.budget-item input:focus {
    border-color: var(--color-green);
}

.budget-item .source-input {
    flex: 1;
    min-width: 140px;
}

.budget-item .amount-input {
    width: 90px;
    text-align: right;
    padding: 14px 16px 14px 24px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    font-size: 15px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
}

.budget-item .amount-input:focus {
    border-color: var(--color-green);
}

.amount-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.dollar-sign {
    position: absolute;
    left: 12px;
    color: var(--color-text-light);
    font-size: 15px;
    pointer-events: none;
}

.budget-item select {
    padding: 14px 40px 14px 16px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    font-size: 15px;
    font-family: var(--font-body);
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238C8A82' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 14px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    width: 150px;
    flex-shrink: 0;
    outline: none;
}

.budget-item select:focus {
    border-color: var(--color-green);
}

.remove-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    font-size: 20px;
    transition: color 0.2s;
}

.remove-btn:hover {
    color: var(--color-terracotta);
}

.add-btn {
    padding: 12px 20px;
    border: 1px dashed var(--color-border-light);
    background: transparent;
    color: var(--color-green);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-body);
    transition: background 0.2s;
}

.add-btn:hover {
    background: var(--color-surface-light);
}

/* Budget Summary */
.budget-summary {
    background: var(--color-surface-light);
    padding: 24px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    font-size: 28px;
    font-weight: 600;
}

.income-value {
    color: var(--color-green);
}

.expense-value {
    color: var(--color-terracotta);
}

.remaining-value {
    color: var(--color-green);
}

.remaining-value.negative {
    color: var(--color-terracotta);
}

.remaining-value.zero {
    color: var(--color-text-light);
}

/* Category Breakdown */
.category-breakdown {
    display: none;
}

.category-breakdown.visible {
    display: block;
}

/* Income vs Expense Bar */
.income-expense-bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--color-border);
    margin-bottom: 8px;
}

.bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.income-segment {
    background: var(--color-green);
}

.expense-segment {
    background: var(--color-terracotta);
}

.bar-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.bar-label {
    font-size: 13px;
    font-weight: 500;
}

.income-label {
    color: var(--color-green);
}

.expense-label {
    color: var(--color-terracotta);
}

/* Category Section */
.category-section {
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.category-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--color-border);
    margin-bottom: 12px;
}

.category-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.category-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.category-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.category-amount {
    color: var(--color-text-light);
}

/* What's Different Section */
.different-section {
    padding: 64px 32px;
    background: var(--color-dark);
    color: #E8E5DD;
}

.different-container {
    max-width: 720px;
    margin: 0 auto;
}

.different-section h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 32px;
    color: #F5F3EE;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-item {
    display: flex;
    gap: 16px;
}

.feature-dot {
    width: 8px;
    height: 8px;
    background: var(--color-green);
    border-radius: 50%;
    margin-top: 8px;
    flex-shrink: 0;
}

.feature-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #F5F3EE;
}

.feature-content p {
    font-size: 15px;
    line-height: 1.6;
    color: #A8B5A9;
}

/* Waitlist Section */
.waitlist-section {
    padding: 64px 32px;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.waitlist-container {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.waitlist-section h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 12px;
}

.waitlist-section p {
    font-size: 15px;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.waitlist-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.waitlist-form input {
    padding: 14px 18px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    font-size: 15px;
    width: 260px;
    background: white;
    outline: none;
    font-family: var(--font-body);
}

.waitlist-form input:focus {
    border-color: var(--color-green);
}

.waitlist-btn {
    padding: 14px 28px;
    background: var(--color-green);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.2s;
}

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

/* Footer */
.site-footer {
    padding: 32px;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.site-footer p {
    font-size: 14px;
    color: var(--color-text-light);
}

/* Loading indicator */
.loading-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px !important;
}

.loading-leaf {
    animation: leafPulse 1.2s ease-in-out infinite;
}

@keyframes leafPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

/* Budget Update Notification */
.tab-btn.budget-updated {
    animation: budgetPulse 0.5s ease-out forwards;
}

@keyframes budgetPulse {
    0% {
        background: rgba(74, 124, 89, 0.4);
        color: var(--color-green-dark);
    }
    100% {
        background: transparent;
        color: var(--color-text-light);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 24px 40px;
    }

    .hero-title {
        font-size: 32px;
    }

    .stat-number {
        font-size: 42px;
    }

    .demo-section {
        padding: 0 16px 60px;
    }

    #chat-panel {
        height: 450px;
    }

    .budget-content {
        padding: 24px 16px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .summary-value {
        font-size: 24px;
    }

    .budget-item {
        flex-direction: column;
        align-items: stretch;
    }

    .budget-item .source-input,
    .budget-item select,
    .budget-item .amount-wrapper {
        width: 100%;
    }

    .budget-item .amount-input {
        width: 100%;
    }

    .waitlist-form {
        flex-direction: column;
        align-items: center;
    }

    .waitlist-form input {
        width: 100%;
        max-width: 300px;
    }
}
