/* ==========================================================================
   DLGH KIYMETLİ METAL & DÖVİZ - Modern Lüks Finans Terminali Stili
   ========================================================================== */

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d121c;
  --bg-card: rgba(16, 23, 38, 0.78);
  --bg-card-hover: rgba(22, 32, 53, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(56, 189, 248, 0.35);
  
  /* Silver & Gold Accents */
  /* Koyu zeminde saf beyaz parlıyor; kontrast ~14:1'de tutulur */
  --text-strong: #e2e8f0;
  --silver-light: #cbd5e1;
  --silver-mid: #b4c0cf;
  --silver-dark: #64748b;
  --metallic-gradient: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 50%, #94a3b8 100%);
  --gold-primary: #f59e0b;
  --gold-light: #fbbf24;
  --gold-gradient: linear-gradient(135deg, #fef3c7 0%, #f59e0b 50%, #d97706 100%);
  
  /* Indicators */
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.25);
  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.15);
  --accent-red: #f43f5e;
  --accent-red-bg: rgba(244, 63, 94, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.15);
  --accent-purple: #a855f7;
  
  /* Typography */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Dinamik ölçekleme: boşluklar ekran genişliğine, grafik ekran yüksekliğine bağlı */
  --gutter: clamp(10px, 1.6vw, 32px);
  --gap: clamp(10px, 1.1vw, 22px);
  --card-pad: clamp(14px, 1.4vw, 28px);
  --chart-h: clamp(300px, calc(100svh - 260px), 860px);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.03);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);
}

/* ==========================================================================
   THEME PALETTES
   ========================================================================== */

/* 1. Platin Aydınlık (Light Theme) */
[data-theme="light"] {
  --bg-primary: #f4f6fa;
  --bg-secondary: #e5e9f2;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --border-subtle: rgba(15, 23, 42, 0.1);
  --border-accent: rgba(2, 132, 199, 0.4);
  
  /* Yazılar koyulaştırıldı: gri tonlar ve vurgu renkleri iki kademe koyu */
  --text-strong: #020617;
  --silver-light: #020617;
  --silver-mid: #1e293b;
  --silver-dark: #334155;
  --metallic-gradient: linear-gradient(135deg, #020617 0%, #1e293b 50%, #334155 100%);
  --gold-primary: #b45309;
  --gold-light: #b45309;

  --accent-cyan: #075985;
  --accent-green: #047857;
  --accent-red: #be123c;
  --accent-amber: #b45309;
  --accent-cyan-glow: rgba(2, 132, 199, 0.2);
  --accent-green-bg: rgba(16, 185, 129, 0.12);
  --accent-red-bg: rgba(244, 63, 94, 0.12);
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.15);
}

[data-theme="light"] body {
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(2, 132, 199, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(217, 119, 6, 0.05) 0%, transparent 40%),
    linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
}

[data-theme="light"] .field-group input,
[data-theme="light"] .styled-select,
[data-theme="light"] .result-box,
[data-theme="light"] .rate-row,
[data-theme="light"] .tv-embed-box,
[data-theme="light"] .step-card,
[data-theme="light"] .region-card,
[data-theme="light"] .level-box,
[data-theme="light"] .gauge-container {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  color: #020617;
}

[data-theme="light"] .res-val {
  color: #075985;
}

[data-theme="light"] .highlights-box,
[data-theme="light"] .tradingview-ticker-box {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .visual-scale,
[data-theme="light"] .step-marker {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.2);
}

[data-theme="light"] .macro-table th {
  background: #e2e8f0;
  color: #1e293b;
  border-bottom-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .timeline-step.active-step .step-marker {
  background: var(--accent-cyan);
}

[data-theme="light"] .tab-btn:hover {
  background: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .theme-select option {
  background: #ffffff;
  color: #020617;
}

/* 2. Altın Varak (Gold Bullion Dark) */
[data-theme="gold"] {
  --bg-primary: #0a0804;
  --bg-secondary: #161208;
  --bg-card: rgba(26, 20, 10, 0.88);
  --bg-card-hover: rgba(36, 27, 14, 0.94);
  --border-subtle: rgba(245, 158, 11, 0.22);
  --border-accent: rgba(245, 158, 11, 0.5);
  
  --text-strong: #f3e9d2;
  --silver-light: #e8dcc0;
  --silver-mid: #cdbd96;
  --silver-dark: #b45309;
  --metallic-gradient: linear-gradient(135deg, #fef3c7 0%, #fbbf24 50%, #d97706 100%);
  
  --accent-cyan: #fbbf24;
  --accent-cyan-glow: rgba(251, 191, 36, 0.3);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.1);
}

/* 3. Zümrüt Terminal (Emerald Dark) */
[data-theme="emerald"] {
  --bg-primary: #040d08;
  --bg-secondary: #081a10;
  --bg-card: rgba(10, 28, 18, 0.86);
  --bg-card-hover: rgba(15, 38, 25, 0.94);
  --border-subtle: rgba(16, 185, 129, 0.22);
  --border-accent: rgba(16, 185, 129, 0.5);
  
  --text-strong: #d8eee2;
  --silver-light: #c5e3d3;
  --silver-mid: #9cc9b3;
  --silver-dark: #047857;
  --metallic-gradient: linear-gradient(135deg, #d1fae5 0%, #34d399 50%, #059669 100%);
  
  --accent-cyan: #34d399;
  --accent-cyan-glow: rgba(52, 211, 153, 0.3);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.7), 0 0 20px rgba(16, 185, 129, 0.1);
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(245, 158, 11, 0.05) 0%, transparent 40%),
    linear-gradient(to bottom, #07090e 0%, #0a0e17 100%);
  color: var(--silver-light);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-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: var(--accent-cyan);
}

/* App Wrapper */
.app-container {
  max-width: 2200px;
  margin: 0 auto;
  padding: clamp(10px, 1.2vw, 24px) var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Top Ribbon */
.top-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: clamp(10px, 1vw, 14px) clamp(12px, 1.6vw, 22px);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.brand-logo svg {
  width: 24px;
  height: 24px;
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: var(--metallic-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-text h1 span {
  color: var(--gold-light);
  -webkit-text-fill-color: var(--gold-light);
}

.sub-badge {
  font-size: 0.72rem;
  color: var(--silver-dark);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.top-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s, background 0.2s;
}

.theme-switch-wrapper:hover {
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.08);
}

.theme-icon {
  font-size: 1rem;
  line-height: 1;
}

.theme-select {
  background: transparent;
  border: none;
  color: var(--silver-light);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.theme-select option {
  background: var(--bg-secondary);
  color: var(--silver-light);
}

.top-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-indicator.partial {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}
.status-indicator.partial .pulse-dot {
  background-color: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}
.status-indicator.offline {
  color: var(--accent-red);
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
}
.status-indicator.offline .pulse-dot {
  background-color: var(--accent-red);
  box-shadow: none;
  animation: none;
}

.time-stamp {
  font-size: 0.75rem;
  color: var(--silver-dark);
  font-family: var(--font-mono);
}

/* TradingView Real-time Ticker Tape */
.tradingview-ticker-box {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(13, 18, 28, 0.6);
}

/* Horizontal Asset Pills Bar */
.asset-pills-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) {
  .asset-pills-bar { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .asset-pills-bar { grid-template-columns: repeat(2, 1fr); }
}

.asset-pill {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, border-color 0.2s;
}

.asset-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.silver-pill { border-top: 3px solid var(--accent-cyan); }
.gold-pill { border-top: 3px solid var(--gold-light); }
.fx-pill { border-top: 3px solid var(--accent-green); }
.ratio-pill { border-top: 3px solid var(--accent-purple); }

.pill-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.pill-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
}

.pill-badge.silver { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); }
.pill-badge.gold { background: rgba(245, 158, 11, 0.15); color: var(--gold-light); }
.pill-badge.fx { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.pill-badge.ratio { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

.pill-spot {
  font-size: 0.75rem;
  color: var(--silver-dark);
}

.pill-bottom {
  display: flex;
  flex-direction: column;
}

.pill-title {
  font-size: 0.72rem;
  color: var(--silver-dark);
}

.pill-note {
  opacity: 0.75;
  font-size: 0.66rem;
  cursor: help;
}

.pill-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-strong);
}

/* Main Dashboard Grid */
.dashboard-grid {
  display: grid;
  /* minmax(0, …) sütunun içerikle şişip ekrandan taşmasını önler */
  grid-template-columns: clamp(340px, 28%, 520px) minmax(0, 1fr);
  gap: var(--gap);
}

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}

.left-panel, .right-panel { min-width: 0; }

/* Glass Card Base */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--card-pad);
  position: relative;
  transition: border-color 0.3s ease;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.3px;
}

.card-header .subtitle {
  font-size: 0.8rem;
  color: var(--silver-dark);
  margin-top: 3px;
}

.badge-accent {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  font-weight: 700;
}

.live-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
}

/* Rates Matrix */
.rates-matrix {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rate-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s;
}

.rate-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.rate-row.highlight-silver {
  border-left: 3px solid var(--accent-cyan);
}

.rate-row.highlight-gold {
  border-left: 3px solid var(--gold-light);
}

.r-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.r-icon {
  font-size: 1.25rem;
}

.r-info strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-strong);
}

.r-sub {
  font-size: 0.7rem;
  color: var(--silver-dark);
  font-family: var(--font-mono);
}

.r-values {
  text-align: right;
}

.r-primary {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-strong);
}

.r-secondary {
  font-size: 0.72rem;
  color: var(--silver-dark);
}

.tag-up {
  color: var(--accent-green);
  font-weight: 700;
}

.tag-down {
  color: var(--accent-red);
  font-weight: 700;
}

/* Universal Converter */
.chip-sm {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--silver-mid);
}

.calc-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.field-group label {
  font-size: 0.75rem;
  color: var(--silver-dark);
  font-weight: 600;
}

.field-group input, .styled-select {
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-strong);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-group input:focus, .styled-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.styled-select optgroup {
  background: #0d121c;
  color: var(--accent-cyan);
  font-weight: 700;
}

.styled-select option {
  background: #090e17;
  color: var(--text-strong);
}

.result-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-around;
}

.res-item {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.res-label {
  font-size: 0.72rem;
  color: var(--silver-dark);
  margin-bottom: 4px;
}

.res-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.res-divider {
  width: 1px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
}

.calc-sub-results {
  font-size: 0.74rem;
  color: var(--silver-dark);
  text-align: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

/* Info Card */
.info-card {
  border-left: 3px solid var(--accent-cyan);
}

.deficit-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.warning-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
}

.stat-highlight {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-strong);
}

.desc-text {
  font-size: 0.83rem;
  color: var(--silver-mid);
  line-height: 1.6;
}

/* Right Panel */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--silver-mid);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(56, 189, 248, 0.15) 100%);
  color: var(--text-strong);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.tab-content.active {
  display: block;
}

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

/* Live Chart Container */
.chart-container-card {
  padding: 18px;
}

.chart-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-title-area { min-width: 0; }

.symbol-switchers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sym-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--silver-light);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sym-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-strong);
}

.sym-btn.active {
  background: var(--gold-light);
  color: #07090e;
  border-color: var(--gold-light);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.tv-embed-box {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #090e17;
  /* Grafik ekran yüksekliğine göre büyür/küçülür */
  height: var(--chart-h);
}

.tv-fallback {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--silver-dark);
  font-size: 0.9rem;
}

/* Momentum etiketi */
.badge-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.badge-status.neutral { background: rgba(56, 189, 248, 0.12); color: var(--accent-cyan); border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-status.bullish { background: var(--accent-green-bg); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-status.bearish { background: var(--accent-red-bg); color: var(--accent-red); border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-status.warn { background: var(--accent-amber-bg); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }

.tech-meta { font-size: 0.72rem; opacity: 0.9; }

.zone.zone-narrow span { display: none; }

/* Gauge Visualizer */
.gauge-container {
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 20px;
}

.gauge-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.label-min { color: var(--accent-green); }
.label-mid { color: var(--accent-cyan); font-weight: 700; }
.label-max { color: var(--accent-red); }

.visual-scale {
  height: 24px;
  background: #090e17;
  border-radius: 12px;
  position: relative;
  display: flex;
  overflow: visible;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.zone {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 8px;
  position: relative;
}

.support-zone { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.neutral-zone { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); }
.resistance-zone { background: rgba(244, 63, 94, 0.2); color: var(--accent-red); }

.needle {
  position: absolute;
  top: -10px;
  bottom: -10px;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 20px var(--accent-cyan);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.needle-head {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  margin-top: -6px;
  border: 2px solid var(--accent-cyan);
}

.needle-text {
  position: absolute;
  top: 36px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: #090e17;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--accent-cyan);
  white-space: nowrap;
}

/* Levels Grid */
.levels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .levels-grid { grid-template-columns: 1fr; }
}

.level-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 16px;
}

.level-box.support { border-top: 3px solid var(--accent-cyan); }
.level-box.resistance { border-top: 3px solid var(--gold-light); }

.level-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.indicator-dot.green { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }
.indicator-dot.red { background: var(--gold-light); box-shadow: 0 0 8px var(--gold-light); }

.level-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-strong);
}

.level-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.level-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 0.82rem;
}

.level-list .l-name { color: var(--silver-dark); }
.level-list .l-val { color: var(--silver-light); }
.level-list .l-val.bold { color: var(--text-strong); font-weight: 700; }

/* Indicators Summary */
.indicators-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .indicators-summary { grid-template-columns: 1fr; }
}

.ind-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.ind-title {
  font-size: 0.72rem;
  color: var(--silver-dark);
  font-weight: 600;
  margin-bottom: 4px;
}

.ind-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 4px;
}

.ind-desc {
  font-size: 0.74rem;
  color: var(--silver-mid);
  line-height: 1.4;
}

/* Macro Table */
.macro-table-wrapper {
  overflow-x: auto;
}

.macro-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
}

.macro-table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 14px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--silver-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.macro-table td {
  padding: 14px;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.macro-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.tag-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.tag-badge.bullish {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-badge.strong-bullish {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(56, 189, 248, 0.2) 100%);
  color: var(--text-strong);
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.tag-badge.neutral {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Timeline */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 20px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 15px;
  bottom: 25px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(245, 158, 11, 0.2), rgba(56, 189, 248, 0.6), rgba(56, 189, 248, 0.9));
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  position: relative;
}

.step-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #090e17;
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: var(--silver-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 2;
  flex-shrink: 0;
}

.timeline-step.highlight-step .step-marker {
  border-color: var(--gold-light);
  color: var(--gold-light);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.timeline-step.active-step .step-marker {
  border-color: var(--accent-cyan);
  color: #fff;
  background: var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan);
}

.step-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 16px;
  flex: 1;
}

.step-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.step-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.step-card p {
  font-size: 0.84rem;
  color: var(--silver-mid);
  line-height: 1.5;
}

/* Regional Grid */
.regions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 800px) {
  .regions-grid { grid-template-columns: 1fr; }
}

.region-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.region-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.region-header .flag { font-size: 1.8rem; line-height: 1; }
.region-header h4 { font-size: 0.98rem; font-weight: 700; color: var(--text-strong); }
.region-role { font-size: 0.72rem; color: var(--accent-cyan); }
.region-body { font-size: 0.83rem; color: var(--silver-mid); line-height: 1.5; margin-bottom: 14px; }

.region-tag {
  font-size: 0.72rem;
  color: var(--silver-light);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 4px;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Featured Highlights Box */
.highlights-box {
  background: linear-gradient(135deg, rgba(16, 23, 38, 0.8) 0%, rgba(22, 34, 56, 0.8) 100%);
  border-left: 3px solid var(--gold-light);
}

.hl-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold-light);
  margin-bottom: 12px;
}

.hl-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .hl-content { grid-template-columns: 1fr; }
}

.hl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.hl-bullet { font-size: 1.2rem; line-height: 1; }
.hl-item p { font-size: 0.84rem; color: var(--silver-mid); line-height: 1.5; }
.hl-item strong { color: var(--text-strong); }

/* Footer */
.app-footer { margin-top: 10px; }

.disclaimer-banner {
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.alert-icon { font-size: 1.3rem; line-height: 1; color: var(--accent-amber); }
.disclaimer-text { font-size: 0.8rem; color: var(--silver-mid); line-height: 1.5; }
.disclaimer-text strong { color: var(--accent-amber); }

.data-sources {
  font-size: 0.72rem;
  color: var(--silver-dark);
  line-height: 1.6;
  padding: 0 4px 12px;
}
.data-sources a,
.tv-attribution a {
  color: var(--accent-cyan);
  text-decoration: none;
}
.data-sources a:hover,
.tv-attribution a:hover { text-decoration: underline; }

.tv-attribution {
  font-size: 0.68rem;
  text-align: right;
  padding: 2px 10px 4px;
}
.tv-attribution-chart { padding-top: 6px; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--silver-dark);
  padding: 0 4px;
}

@media (max-width: 600px) {
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ==========================================================================
   DİNAMİK ÖLÇEKLEME
   Tüm rem tabanlı yazılar kök yazı boyutuyla birlikte ölçeklenir:
   360 px ≈ 14 px, 1366 px ≈ 16 px, 2560 px ≈ 18 px.
   ========================================================================== */
html {
  font-size: clamp(14px, 13.4px + 0.18vw, 18px);
}

/* Telefon ve dar pencere */
@media (max-width: 640px) {
  .brand { flex: 1 1 100%; }
  .brand-logo { width: 38px; height: 38px; }
  .top-controls { flex: 1 1 100%; justify-content: space-between; }
  .top-meta { align-items: flex-end; }
  .status-indicator { font-size: 0.66rem; }

  .zone span { display: none; }
  .gauge-label-row { font-size: 0.72rem; }

  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }

  .chart-header-bar { flex-direction: column; align-items: stretch; }
  .symbol-switchers { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .sym-btn { flex: 0 0 auto; }

  .result-box { justify-content: space-between; }
  .res-divider { display: none; }

  .timeline-container { padding-left: 0; }
  .timeline-container::before { left: 17px; }
  .timeline-step { gap: 12px; }
  .disclaimer-banner { padding: 12px 14px; }
}

/* Kısa yatay ekran (telefon yatay) */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --chart-h: clamp(240px, calc(100svh - 40px), 420px); }
  .top-ribbon { padding-block: 8px; }
  .brand-logo { width: 34px; height: 34px; }
  .asset-pills-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
