:root {
    --bg-primary: #1d1616;
    --bg-secondary: #271616;
    --bg-tertiary: #8e1616;
    --bg-card: rgba(29, 22, 22, 0.85);
    --text-primary: #eeeeee;
    --text-secondary: #f2caca;
    --text-muted: #b98686;
    --accent-cyan: #d84040;
    --accent-purple: #8e1616;
    --accent-green: #22c55e;
    --accent-red: #d84040;
    --accent-orange: #f06a6a;
    --accent-gold: #eeeeee;
    --gradient-main: linear-gradient(135deg, #8e1616 0%, #d84040 60%, #eeeeee 100%);
    --gradient-card: linear-gradient(145deg, rgba(142, 22, 22, 0.2), rgba(216, 64, 64, 0.08));
    --border-color: rgba(216, 64, 64, 0.25);
    --shadow-glow: 0 0 60px rgba(216, 64, 64, 0.25);
}

body.light-mode {
    --bg-primary: #F5F4EB;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecf5;
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-primary: #0f172a;
    --text-secondary: #475467;
    --text-muted: #98a2b3;
    --border-color: rgba(14, 116, 144, 0.2);
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);
}

/* Return Calculator Color Scheme */
#return-calculator-panel {
    --calc-kraft: #D4A27F;
    --calc-manilla: #EBDBBC;
    --calc-ivory: #E5E4DF;
    --calc-kraft-dark: #B8886A;
    --calc-kraft-light: #E5C5A8;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: 'Instrument Serif', serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -10s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-orange) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -5s;
    opacity: 0.2;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(-30px, -20px) scale(1.02); }
}

/* Grid Pattern Overlay */
.grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(216, 64, 64, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(216, 64, 64, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
}

body.light-mode .grid-pattern {
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
}

/* Header */
header {
    padding: 2rem 4rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-main);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(216, 64, 64, 0.3);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

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

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--accent-green);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Instrument Serif', serif;
    font-size: 0.9rem;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent-purple);
}

.theme-icon {
    font-size: 1.1rem;
}

body.light-mode .status-badge {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: #15803d;
}

body.light-mode .theme-toggle {
    background: #ffffff;
    color: #1f2937;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 4rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h2 span {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
    font-family: 'Instrument Serif', serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(216, 64, 64, 0.12);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(142, 22, 22, 0.3), rgba(216, 64, 64, 0.2));
    border-color: var(--accent-purple);
    color: var(--text-primary);
    box-shadow: 0 4px 30px rgba(216, 64, 64, 0.25);
}

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

.tab-icon {
    font-size: 1.5rem;
}

/* Analysis Panels */
.analysis-panel {
    display: none;
    animation: fadeIn 0.5s ease;
}

.analysis-panel.active {
    display: block;
}

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

/* Input Card */
.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow);
}

.input-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stock-icon {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
}

.macro-icon {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-gold));
}

.input-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

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

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input,
.input-wrapper textarea {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-family: 'Instrument Serif', serif;
    font-size: 1.125rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(216, 64, 64, 0.2);
}

.input-wrapper input::placeholder,
.input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.input-wrapper textarea {
    min-height: 120px;
    resize: vertical;
}

/* Quick Select Chips */
.quick-select {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.quick-select-actions {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.quick-chip {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-chip:hover {
    background: rgba(216, 64, 64, 0.12);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.quick-chip-action {
    font-family: 'Instrument Serif', serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    background: transparent;
}

.quick-chip-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.suggestions-panel {
    margin-top: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 16px;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.suggestions-panel.visible {
    display: block;
}

.suggestion-item {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 0.9rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: 'Instrument Serif', serif;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.suggestion-item + .suggestion-item {
    border-top: 1px solid var(--border-color);
}

.suggestion-item:hover {
    background: rgba(216, 64, 64, 0.18);
}

.suggestion-item.selected {
    background: rgba(216, 64, 64, 0.28);
    outline: 1px solid var(--accent-purple);
}

.suggestion-ticker {
    font-family: 'Instrument Serif', serif;
    font-size: 0.85rem;
    color: var(--accent-cyan);
}

body.light-mode .suggestions-panel {
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

body.light-mode .suggestion-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

body.light-mode .suggestion-item.selected {
    background: rgba(99, 102, 241, 0.25);
    outline: 1px solid var(--accent-purple);
}

/* Analyze Button */
.analyze-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    background: var(--gradient-main);
    border: none;
    border-radius: 16px;
    color: white;
    font-family: 'Instrument Serif', serif;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(216, 64, 64, 0.4);
}

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

.analyze-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Results Card */
.results-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    display: none;
}

.results-card.visible {
    display: block;
    animation: slideUp 0.5s ease;
}

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

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.results-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-title h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

.results-badge {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

/* Version Toggle Buttons */
.version-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.version-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Instrument Serif', serif;
}

.version-btn:hover {
    background: rgba(216, 64, 64, 0.12);
    color: var(--text-primary);
}

.version-btn.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: #ffffff;
    font-weight: 600;
}

.version-btn:active {
    transform: scale(0.95);
}

.results-content {
    font-family: 'Instrument Serif', serif;
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: normal;
}

.results-content strong,
.results-content b {
    color: var(--accent-cyan);
}

.results-content h1,
.results-content h2,
.results-content h3,
.results-content h4 {
    color: var(--text-primary);
    line-height: 1.35;
    margin: 1.1rem 0 0.45rem;
}

.results-content h1 { font-size: 1.7rem; }
.results-content h2 { font-size: 1.55rem; text-align: left; }
.results-content h3 { font-size: 1.4rem; }
.results-content h4 { font-size: 1.25rem; }

.results-content p {
    margin: 0.65rem 0;
}

.results-content ul {
    margin: 0.5rem 0 0.85rem 1.1rem;
    padding: 0;
}

.results-content li {
    margin: 0.2rem 0;
}

.results-content hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

.results-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.86em;
    background: rgba(216, 64, 64, 0.12);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.08rem 0.35rem;
    color: var(--text-primary);
}

.analysis-emoji {
    font-size: 1.1em;
    vertical-align: -0.04em;
}

.analysis-table-wrap {
    margin: 0.9rem 0 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: auto;
    background: var(--bg-secondary);
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

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

.analysis-table th {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    z-index: 1;
}

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

/* TradingView Chart Styles */
.chart-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.chart-price-info {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.chart-current-price {
    font-family: 'Instrument Serif', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-price-change {
    font-family: 'Instrument Serif', serif;
    font-size: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
}

.chart-price-change.positive {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.chart-price-change.negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.chart-period-selector {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Instrument Serif', serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.period-btn.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.chart-container {
    width: 100%;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.chart-volume-container {
    width: 100%;
    height: 80px;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    margin-top: -1px;
}

.chart-attribution {
    text-align: right;
    margin-top: 0.75rem;
}

.chart-attribution a {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.chart-attribution a:hover {
    color: var(--accent-cyan);
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px;
    color: var(--text-muted);
}

/* Light mode chart adjustments */
.light-mode .chart-container,
.light-mode .chart-volume-container {
    background: #f8f9fa;
}

/* Quick Stats Grid */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 3rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
    box-shadow: 0 8px 30px rgba(216, 64, 64, 0.2);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: 'Instrument Serif', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.5rem;
}

/* Correlation Section */
.correlation-section {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.section-header h3 {
    font-size: 1.4rem;
    margin-bottom: 0.35rem;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 720px;
}

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

.correlation-period {
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Instrument Serif', serif;
}

.correlation-card {
    margin-bottom: 0;
}

.correlation-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hint-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.9rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.hint-chip:hover {
    color: var(--text-primary);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.correlation-results {
    padding: 1.5rem;
}

.correlation-grid {
    margin-top: 1rem;
    overflow-x: auto;
}

.correlation-grid.empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem 0;
}

.correlation-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.correlation-table th,
.correlation-table td {
    padding: 0.65rem 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    min-width: 70px;
}

.correlation-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.correlation-table td.diag {
    background: var(--bg-primary) !important;
    color: transparent;
}

.correlation-warning {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(249, 115, 22, 0.1);
}

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

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

footer a {
    color: var(--accent-purple);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1.5rem;
    }

    main {
        padding: 2rem 1.5rem;
    }

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

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

    .tab-navigation {
        flex-direction: column;
    }

    .tab-btn {
        justify-content: center;
    }

    .input-card,
    .results-card {
        padding: 1.5rem;
    }

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

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

    .correlation-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .version-toggle {
        order: 3;
        width: 100%;
    }

    .version-btn {
        flex: 1;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .results-timestamp {
        order: 2;
    }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.toast {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-color: var(--accent-green); }
.toast.error { border-color: var(--accent-red); }
.toast.warning { border-color: var(--accent-orange); }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* ============================================ */
/* RETURN CALCULATOR STYLES */
/* ============================================ */

/* Calculator Card Styling */
.calculator-card {
    background: linear-gradient(145deg, rgba(212, 162, 127, 0.05), rgba(235, 219, 188, 0.05));
    border-color: var(--calc-kraft);
}

.calculator-icon {
    background: linear-gradient(135deg, var(--calc-kraft), var(--calc-manilla));
}

/* Input Row (Side-by-side inputs) */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Date Input Styling */
.date-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--calc-kraft);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Instrument Serif', serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.date-input:focus {
    outline: none;
    border-color: var(--calc-kraft-light);
    box-shadow: 0 0 0 3px rgba(212, 162, 127, 0.2);
}

/* Quantity Dropdown */
.quantity-select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--calc-kraft);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Instrument Serif', serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-select:focus {
    outline: none;
    border-color: var(--calc-kraft-light);
    box-shadow: 0 0 0 3px rgba(212, 162, 127, 0.2);
}

/* Price Input with Indicator */
.price-input-wrapper {
    position: relative;
}

.price-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--calc-kraft);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Instrument Serif', serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.price-input:focus {
    outline: none;
    border-color: var(--calc-kraft-light);
    box-shadow: 0 0 0 3px rgba(212, 162, 127, 0.2);
}

.price-indicator {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

/* FX Input */
.fx-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--calc-kraft);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Instrument Serif', serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.fx-input:focus {
    outline: none;
    border-color: var(--calc-kraft-light);
    box-shadow: 0 0 0 3px rgba(212, 162, 127, 0.2);
}

/* Calculator Button */
.calculator-btn {
    background: linear-gradient(135deg, var(--calc-kraft), var(--calc-kraft-dark));
}

.calculator-btn:hover {
    background: linear-gradient(135deg, var(--calc-kraft-light), var(--calc-kraft));
    transform: translateY(-2px);
}

/* Calculator Results */
.calculator-results {
    background: linear-gradient(145deg, rgba(235, 219, 188, 0.05), rgba(229, 228, 223, 0.05));
    border-color: var(--calc-manilla);
}

.calculator-badge {
    background: linear-gradient(135deg, var(--calc-kraft), var(--calc-manilla));
    color: var(--bg-primary);
}

/* Results Content */
.calc-summary {
    padding: 1.5rem;
    background: rgba(235, 219, 188, 0.1);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--calc-kraft);
}

.calc-summary h5 {
    color: var(--calc-kraft);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.calc-summary p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

/* Values Table */
.calc-values-table {
    margin: 1.5rem 0;
}

.calc-values-table table {
    width: 100%;
    border-collapse: collapse;
}

.calc-values-table th,
.calc-values-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(212, 162, 127, 0.2);
}

.calc-values-table th {
    background: rgba(235, 219, 188, 0.1);
    color: var(--calc-kraft);
    font-weight: 600;
}

.calc-values-table td {
    color: var(--text-secondary);
    font-family: 'Instrument Serif', serif;
}

/* Returns Display */
.calc-returns {
    padding: 1.5rem;
    background: rgba(229, 228, 223, 0.05);
    border-radius: 8px;
    margin-top: 1.5rem;
}

.calc-returns h5 {
    color: var(--calc-kraft);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.return-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(212, 162, 127, 0.1);
}

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

.return-item span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.return-item strong {
    font-family: 'Instrument Serif', serif;
    font-size: 1.1rem;
}

.return-item strong.positive {
    color: var(--accent-green);
}

.return-item strong.negative {
    color: var(--accent-red);
}

.return-item.fx-impact {
    background: rgba(212, 162, 127, 0.1);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

/* Price Override Note */
.price-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(249, 115, 22, 0.1);
    border-left: 3px solid var(--accent-orange);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Calculator Chart Section */
.calc-chart-section {
    margin-top: 2rem;
    border-top: 1px solid rgba(212, 162, 127, 0.2);
    padding-top: 1.5rem;
}

.calc-chart-title {
    color: var(--calc-kraft);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.calc-chart-container {
    width: 100%;
    height: 320px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(18, 18, 26, 0.5);
    border: 1px solid rgba(212, 162, 127, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .input-row {
        grid-template-columns: 1fr;
    }
}
