/* ============================================
   EPISODE | Institutional Terminal
   Corporate Design System
   ============================================ */

:root {
    /* Corporate Colors */
    --bg-color: #030305;
    --surface-color: #0E0E10;
    --surface-hover: #161619;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);
    
    /* Text Colors */
    --text-main: #ffffff;
    --text-muted: #9CA3AF;
    --text-tertiary: #6B7280;
    
    /* Accent Colors */
    --accent-cyan: #00f2ea;
    --accent-purple: #b066fe;
    --gradient-primary: linear-gradient(135deg, #b066fe 0%, #00f2ea 100%);
    --glow-btn: 0 0 20px rgba(176, 102, 254, 0.4);
    --glow-cyan: 0 0 15px rgba(0, 242, 234, 0.3);
    
    /* Market Colors */
    --bullish: #00f2ea;
    --bearish: #ff3d00;
    
    /* Typography */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
    --bg-color: #f5f5f7;
    --surface-color: #ffffff;
    --surface-hover: #f0f0f2;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-highlight: rgba(0, 0, 0, 0.2);
    --text-main: #1a1a1a;
    --text-muted: #6B7280;
    --text-tertiary: #9CA3AF;
    --accent-cyan: #00CBA9;
    --accent-purple: #8b4fcf;
    --gradient-primary: linear-gradient(135deg, #8b4fcf 0%, #00CBA9 100%);
    --glow-btn: 0 0 20px rgba(139, 79, 207, 0.3);
    --glow-cyan: 0 0 15px rgba(0, 203, 169, 0.28);
    --bullish: #00CBA9;
    --bearish: #e63900;
}

.indicator-selector .ind-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.indicator-selector .ind-btn:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-highlight);
    color: var(--text-main);
}

.indicator-selector .ind-btn.active {
    background-color: rgba(0, 203, 169, 0.08);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 0 1px rgba(0, 203, 169, 0.16);
}

[data-theme="light"] .indicator-selector .ind-btn {
    background: transparent;
    color: var(--text-main);
}

[data-theme="light"] .indicator-selector .ind-btn.active {
    background-color: rgba(0, 203, 169, 0.1);
    color: #006e5b;
}

[data-theme="light"] .modal-content,
[data-theme="light"] .modal-body,
[data-theme="light"] .support-container,
[data-theme="light"] .guide-container,
[data-theme="light"] .support-text,
[data-theme="light"] .guide-text,
[data-theme="light"] .package-card,
[data-theme="light"] .credit-package,
[data-theme="light"] .btn-lines,
[data-theme="light"] .btn-box,
[data-theme="light"] .trade-view-btn,
[data-theme="light"] .mode-btn,
[data-theme="light"] p,
[data-theme="light"] span:not(.accent),
[data-theme="light"] div:not(.accent-bg) {
    color: #000000 !important;
}

[data-theme="light"] .menu-item,
[data-theme="light"] .package-title,
[data-theme="light"] .package-price {
    color: #111111 !important;
}

[data-theme="light"] .credit-package:not(.active),
[data-theme="light"] .mode-btn:not(.active) {
    color: #333333 !important;
    border-color: #cccccc !important;
}

/* PERP/SPOT и другие segment-btn в светлой теме */
[data-theme="light"] .segment-btn {
    color: #333333 !important;
}

[data-theme="light"] .segment-btn:not(.active):hover {
    color: #111111 !important;
}

[data-theme="light"] .segment-btn.active {
    color: var(--accent-cyan) !important;
}

/* Кнопки таймфрейма в светлой теме */
[data-theme="light"] .timeframe-btn {
    color: #333333 !important;
}

[data-theme="light"] .timeframe-btn.active {
    color: var(--accent-cyan) !important;
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-ui);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--bg-color);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   App Container
   ============================================ */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-lg);
    padding-top: var(--space-md);
    gap: var(--space-xl);
}

/* ============================================
   Header
   ============================================ */

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

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-right {
    margin-left: auto;
    justify-content: flex-end;
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding-top: 3px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo.connected .logo-icon {
    animation: pulse 1.4s ease-in-out infinite;
    color: var(--accent-cyan);
    background: none;
    -webkit-text-fill-color: initial;
}

.logo.connected .logo-text {
    color: var(--text-main);
}

.logo.disconnected .logo-icon,
.logo.disconnected .logo-text {
    color: var(--text-tertiary);
    background: none;
    -webkit-text-fill-color: initial;
}

.logo-icon {
    font-size: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.logo-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.brand-primary {
    color: inherit;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.brand-secondary {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.1px;
}

.brand-status-line {
    min-height: 12px;
    padding-left: 28px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.brand-status-line.visible {
    opacity: 1;
}

.brand-status-line.connected {
    color: var(--accent-cyan);
}

.brand-status-line.disconnected {
    color: var(--text-tertiary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
/* Language Toggle Button */
.lang-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs) var(--space-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-purple);
    background: transparent;
    border: 1px solid var(--accent-purple);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.5px;
}

.lang-toggle-btn:hover {
    background-color: rgba(176, 102, 254, 0.1);
    box-shadow: 0 0 10px rgba(176, 102, 254, 0.2);
}

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

/* Theme Toggle Button */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    font-size: 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    border-color: var(--accent-cyan);
    background-color: rgba(0, 242, 234, 0.05);
}

.theme-toggle-btn:active {
    transform: scale(0.9);
}

.profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: var(--text-main);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
}

.profile-btn:hover {
    border-color: var(--border-highlight);
    background-color: rgba(255, 255, 255, 0.04);
}

/* Share Button */
.share-section {
    padding: 0 var(--space-lg);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.share-btn:hover {
    border-color: var(--accent-cyan);
    background-color: rgba(0, 242, 234, 0.05);
    box-shadow: 0 0 15px rgba(0, 242, 234, 0.1);
}

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

.share-icon {
    font-size: 18px;
}

/* Disclaimer */
.disclaimer {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    margin-top: var(--space-lg);
    background-color: rgba(255, 61, 0, 0.05);
    border: 1px solid rgba(255, 61, 0, 0.15);
    border-radius: var(--radius-md);
}

.disclaimer-icon {
    font-size: 16px;
    color: var(--bearish);
    flex-shrink: 0;
}

.disclaimer-text {
    font-size: 11px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ============================================
   Controls Panel
   ============================================ */

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

/* Control Group */
.control-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.control-label,
.chart-title,
.indicator-label,
.narrative-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.control-label {
    line-height: 1.2;
}

/* Ticker Input */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix,
.input-suffix {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    pointer-events: none;
}

.input-prefix {
    left: var(--space-md);
}

.input-suffix {
    right: var(--space-md);
}

.ticker-input {
    width: 100%;
    height: 48px;
    padding: 0 var(--space-2xl);
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.ticker-input::placeholder {
    color: var(--text-tertiary);
}

.ticker-input:focus {
    border-color: var(--accent-cyan);
    background-color: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 2px rgba(0, 242, 234, 0.1);
}

.ticker-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Segmented Control (Mode Selector) */
.segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.uniform-btn {
    flex: 1;
    height: 46px;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.segment-btn.uniform-btn,
.timeframe-btn.uniform-btn {
    flex: 1 !important;
    height: 46px !important;
    border-radius: 8px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.segment-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-sm);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.segment-btn:hover {
    background-color: var(--surface-hover);
    color: var(--text-main);
}

.segment-btn.active {
    background-color: rgba(0, 242, 234, 0.05);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 0 1px rgba(0, 242, 234, 0.1);
}

.segment-label {
    font-weight: 600;
}

.segment-sublabel {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.8;
}

#market-type-toggle {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 10px;
}

#market-type-toggle .segment-btn {
    flex: 1;
}

/* Timeframe Selector */
.timeframe-selector {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    margin-bottom: 15px;
}

.timeframe-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: var(--space-md) var(--space-sm);
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-muted);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.timeframe-btn:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-highlight);
    color: var(--text-main);
}

.timeframe-btn.active {
    background-color: rgba(0, 242, 234, 0.05);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 0 1px rgba(0, 242, 234, 0.1);
}

.tf-name {
    font-weight: 600;
    font-size: 13px;
}

.tf-range {
    font-size: 10px;
    color: var(--text-tertiary);
}

.timeframe-btn.active .tf-range {
    color: var(--accent-cyan);
}

.timeframe-selector.spot-mode {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 10px;
}

.timeframe-selector.spot-mode .timeframe-btn[data-type="mid-term"],
.timeframe-selector.spot-mode .timeframe-btn[data-type="long-term"] {
    flex: 1;
}

body[data-market-mode="perp"] .spot-tf {
    display: none !important;
}

body[data-market-mode="perp"] .perp-tf {
    display: flex !important;
}

body[data-market-mode="spot"] .perp-tf {
    display: none !important;
}

body[data-market-mode="spot"] .spot-tf {
    display: flex !important;
}

.timeframe-btn.uniform-btn {
    gap: 0;
}

.timeframe-btn.uniform-btn .tf-range {
    display: none;
}

/* Action Button */
.action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    margin-top: var(--space-sm);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--glow-btn);
    transition: all var(--transition-base);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(176, 102, 254, 0.5);
}

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

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: grayscale(100%);
}

.action-btn:not(:disabled)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.btn-text {
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: opacity var(--transition-fast);
}

.action-btn.loading .btn-text {
    display: none;
}

.btn-loader {
    position: absolute;
    display: none;
    align-items: center;
    gap: var(--space-xs);
}

.action-btn.loading .btn-loader {
    display: flex;
}

.loader-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-main);
    border-radius: 50%;
    animation: loaderBounce 1.4s ease-in-out infinite;
}

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

@keyframes loaderBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   Dashboard
   ============================================ */

.dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    animation: fadeIn var(--transition-base);
}

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

.dashboard.hidden {
    display: none;
}

/* Chart Section */
.chart-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

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

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title {
    line-height: 1.2;
}

.chart-controls {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.utc-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: var(--space-xs) var(--space-sm);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
}

.chart-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-display-btn {
    width: auto;
    min-width: 84px;
    height: 28px;
    padding: 0 12px;
    font-size: 10px;
    letter-spacing: 0;
    white-space: nowrap;
}

.chart-toggle-btn:hover {
    border-color: var(--border-highlight);
    color: var(--text-main);
}

.chart-toggle-btn.active {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background-color: rgba(0, 242, 234, 0.1);
}

.chart-toggle-btn.inactive {
    opacity: 0.3;
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* MACD Container */
.macd-container {
    margin-top: 4px;
    border-top: 1px solid var(--border-color);
    padding-top: 6px;
}

.indicator-selector-panel {
    margin-bottom: 4px;
}

.macd-header {
    display: none;
}

.macd-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.macd-toggle-btn {
    padding: var(--space-xs) var(--space-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.macd-toggle-btn:hover {
    border-color: var(--border-highlight);
    color: var(--text-main);
}

.macd-toggle-btn.active {
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    background-color: rgba(176, 102, 254, 0.1);
}

.macd-chart {
    position: relative;
    width: 100%;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    min-height: 300px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chart-attribution-overlay {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 30;
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 3px 5px;
    border-radius: 4px;
    background: rgba(3, 3, 5, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.chart-timeframe-overlay,
.indicator-timeframe-overlay {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 29;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 22px;
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(3, 3, 5, 0.55);
    pointer-events: none;
}

.setup-box-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.setup-box {
    position: absolute;
    border-radius: 4px;
    border: 1px solid transparent;
}

.setup-box.reward {
    background: rgba(0, 203, 169, 0.22);
    border-color: rgba(0, 203, 169, 0.65);
}

.setup-box.risk {
    background: rgba(255, 61, 0, 0.2);
    border-color: rgba(255, 61, 0, 0.58);
}

.setup-box-entry {
    position: absolute;
    height: 1px;
    border-top: 1px dashed rgba(255, 255, 255, 0.92);
}

.setup-box-side {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 0 8px rgba(3, 3, 5, 0.95);
    z-index: 21;
}

.setup-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.setup-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setup-summary-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.setup-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-sm);
}

.setup-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-md);
    background-color: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.setup-item-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.8px;
}

.setup-item-value {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.setup-item-danger .setup-item-value {
    color: var(--bearish);
}

/* ============================================
   Metrics Grid
   ============================================ */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.metric-card:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-highlight);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.metric-icon {
    font-size: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-content {
    font-family: var(--font-mono);
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    display: none;
}

.metric-value.visible {
    display: block;
}

.metric-value.bullish {
    color: var(--bullish);
    text-shadow: 0 0 10px rgba(0, 242, 234, 0.3);
}

.metric-value.bearish {
    color: var(--bearish);
}

/* ============================================
   Narrative Section
   ============================================ */

.narrative-section {
    padding: var(--space-lg);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.narrative-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.narrative-icon {
    font-size: 14px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.narrative-title {
    line-height: 1.2;
}

.narrative-content {
    position: relative;
    min-height: 80px;
}

.narrative-text {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
    display: none;
}

.narrative-text.visible {
    display: block;
}

/* ============================================
   Timestamp
   ============================================ */

.scan-timestamp {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.timestamp-label {
    font-size: 11px;
    color: var(--text-tertiary);
}

.timestamp-value {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    display: none;
}

.share-capture-root {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.share-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.timestamp-value.visible {
    display: block;
}

/* ============================================
   Skeleton Loading Animation
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-color) 0%,
        var(--surface-hover) 50%,
        var(--surface-color) 100%
    );
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: shimmer 1.5s ease-in-out infinite;
}

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

.skeleton-wrapper {
    position: relative;
}

.skeleton-wrapper .skeleton {
    position: absolute;
    inset: 0;
}

.skeleton-wrapper.loaded .skeleton {
    display: none;
}

.skeleton-wrapper.loaded ~ .metric-value,
.skeleton-wrapper.loaded ~ .narrative-text {
    display: block;
}

/* Skeleton Variants */
.skeleton-chart {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 14px;
}

.skeleton-metric-value {
    height: 22px;
    width: 80px;
}

.skeleton-narrative-line {
    margin-bottom: var(--space-sm);
    border-radius: 3px;
}

.skeleton-narrative-line:last-child {
    margin-bottom: 0;
}

.skeleton-short {
    width: 60%;
}

/* Loading State */
.dashboard.loading .skeleton {
    display: block;
}

.dashboard.loading .metric-value,
.dashboard.loading .narrative-text,
.dashboard.loading .timestamp-value {
    display: none;
}

.dashboard.loaded .skeleton {
    display: none;
}

.dashboard.loaded .metric-value,
.dashboard.loaded .narrative-text,
.dashboard.loaded .timestamp-value {
    display: block;
}

/* ============================================
   Utility Classes
   ============================================ */

.text-bullish { color: var(--bullish); }
.text-bearish { color: var(--bearish); }
.text-accent { 
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 360px) {
    .app-container {
        padding: var(--space-md);
    }
    
    .timeframe-selector {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }

    .setup-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-highlight);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Support Chat Modal
   ============================================ */

/* Typing animation dots */
.typing-dots span {
    display: inline-block;
    animation: typingDot 1.4s infinite;
    font-size: 16px;
    line-height: 1;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* Chat message bubbles */
.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    animation: chatFadeIn 0.2s ease;
}

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

.chat-message-user {
    align-self: flex-end;
    background: #1a73e8;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-message-bot {
    align-self: flex-start;
    background: var(--surface-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-message-system {
    align-self: center;
    background: rgba(255, 255, 255, 0.06);
    color: #888;
    font-size: 12px;
    text-align: center;
    max-width: 90%;
    border-radius: 12px;
    padding: 6px 12px;
}

/* Support chat input auto-resize */
#support-chat-input {
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

#support-chat-input::-webkit-scrollbar {
    width: 4px;
}

#support-chat-input::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
}

/* Send button hover */
#support-chat-send:hover {
    background: #1565c0;
}

#support-chat-send:active {
    transform: scale(0.92);
}

#support-chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

[data-theme="light"] .credit-package .package-title,
[data-theme="light"] .credit-package .package-price,
[data-theme="light"] .credit-package .package-stars {
    color: #111111 !important;
}
