/* ==========================================================================
   FINANCIAL TRACKER — BEST WEBSITES AWARDS 2026 DESIGN SYSTEM
   Theme: Obsidian Minimalist Swiss Architecture & Quantum Glass
   Typography: Outfit (Display) + Inter (Editorial) + JetBrains Mono (Financial)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces & Canvas */
  --bg-canvas: #07090e;
  --bg-topbar: rgba(10, 14, 23, 0.75);
  --bg-surface: rgba(15, 20, 32, 0.7);
  --bg-surface-elevated: rgba(21, 28, 44, 0.85);
  --bg-surface-hover: rgba(28, 38, 60, 0.95);
  --bg-surface-active: rgba(35, 48, 75, 1);
  --bg-glass-pill: rgba(255, 255, 255, 0.04);
  --bg-input: rgba(9, 13, 21, 0.8);

  /* Hairline Borders & Structural Dividers */
  --border-hairline: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);
  --border-focus: rgba(56, 189, 248, 0.55);

  /* Inner Edge Highlights */
  --highlight-top: inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  --highlight-top-active: inset 0 1px 0 0 rgba(255, 255, 255, 0.16);

  /* Typography Colors */
  --text-pure: #ffffff;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-faint: #475569;

  /* Jewel Status Colors (HDR Palette) */
  --color-buy: #10b981;
  --color-buy-bg: rgba(16, 185, 129, 0.1);
  --color-buy-border: rgba(16, 185, 129, 0.3);
  --color-buy-glow: rgba(16, 185, 129, 0.16);

  --color-sell: #f43f5e;
  --color-sell-bg: rgba(244, 63, 94, 0.1);
  --color-sell-border: rgba(244, 63, 94, 0.3);
  --color-sell-glow: rgba(244, 63, 94, 0.16);

  --color-watchlist: #f59e0b;
  --color-watchlist-bg: rgba(245, 158, 11, 0.1);
  --color-watchlist-border: rgba(245, 158, 11, 0.3);
  --color-watchlist-glow: rgba(245, 158, 11, 0.16);

  --color-hold: #6366f1;
  --color-hold-bg: rgba(99, 102, 241, 0.1);
  --color-hold-border: rgba(99, 102, 241, 0.3);

  --color-wait: #a855f7;
  --color-wait-bg: rgba(168, 85, 247, 0.1);
  --color-wait-border: rgba(168, 85, 247, 0.3);

  --color-cyan: #38bdf8;
  --color-cyan-glow: rgba(56, 189, 248, 0.15);

  /* Typography Scales */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Concentric Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 9999px;

  /* Elevation Shadows */
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 36px -4px rgba(0, 0, 0, 0.65), 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-float: 0 20px 48px -8px rgba(0, 0, 0, 0.7);

  /* Motion Tokens */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 380ms;
}

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

html {
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Tabular Numerics across the entire app */
.tabular-nums,
.stat-val,
.telemetry-value,
.price-number,
.metric-data,
.card-price-value,
.company-ticker-badge,
.ticker-code {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* Ambient Lighting Gradients */
.ambient-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
}

.glow-top-left {
  width: 600px;
  height: 450px;
  top: -150px;
  left: -100px;
  background: radial-gradient(circle, #38bdf8 0%, #6366f1 60%, transparent 80%);
}

.glow-bottom-right {
  width: 700px;
  height: 500px;
  bottom: -200px;
  right: -150px;
  background: radial-gradient(circle, #6366f1 0%, #10b981 50%, transparent 80%);
}

.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   3. TOPBAR & NAVIGATION (Floating Glass)
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-hairline);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.topbar-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.topbar-brand:hover {
  opacity: 0.9;
}

.brand-monogram {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: var(--highlight-top), 0 0 16px rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

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

.brand-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-pure);
}

.brand-badge-version {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Telemetry Strip */
.telemetry-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-glass-pill);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.telemetry-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-buy);
  box-shadow: 0 0 8px var(--color-buy);
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.telemetry-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.telemetry-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-pure);
}

.telemetry-value.val-buy { color: var(--color-buy); }
.telemetry-value.val-watchlist { color: var(--color-watchlist); }
.telemetry-value.val-sell { color: var(--color-sell); }

.telemetry-divider {
  width: 1px;
  height: 12px;
  background: var(--border-hairline);
}

/* Topbar Actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-command-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 0 12px 0 10px;
  height: 38px;
  width: 250px;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--highlight-top);
}

.search-command-box:focus-within {
  width: 300px;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--color-cyan-glow), var(--highlight-top);
  background: rgba(14, 19, 31, 0.95);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 8px;
}

.search-command-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-pure);
  font-size: 0.82rem;
  width: 100%;
}

.search-command-box input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xs);
  padding: 1px 6px;
  color: var(--text-secondary);
  pointer-events: none;
}

.action-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.action-btn:hover {
  color: var(--text-pure);
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   4. MAIN CONTAINER & VIEW PANELS
   -------------------------------------------------------------------------- */
.main-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 28px 64px;
  width: 100%;
  flex: 1;
}

.hidden {
  display: none !important;
}

.view-panel {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.view-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   5. DASHBOARD VIEW — HERO & CONTROLS
   -------------------------------------------------------------------------- */
.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-hairline);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--color-cyan);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.eyebrow-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-cyan);
  box-shadow: 0 0 6px var(--color-cyan);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-pure);
  margin-bottom: 6px;
  text-wrap: balance;
}

.hero-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 760px;
  line-height: 1.6;
  text-wrap: pretty;
}

.system-status-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: var(--highlight-top), 0 0 16px rgba(16, 185, 129, 0.08);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.pulse-beacon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-buy);
  box-shadow: 0 0 10px var(--color-buy);
  position: relative;
}

.pulse-beacon::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--color-buy);
  animation: ripple 2s infinite;
}

@keyframes ripple {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; }
}

.status-texts {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-buy);
}

.status-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Controls Bar */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
}

.filter-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-fast) var(--ease-out);
}

.filter-pill:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.05);
}

.filter-pill.active {
  background: var(--bg-surface-elevated);
  color: var(--text-pure);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), var(--highlight-top);
  border: 1px solid var(--border-subtle);
}

.filter-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
}

.filter-pill.active .filter-count {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-pure);
}

.layout-switch-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
}

.layout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.layout-btn:hover {
  color: var(--text-pure);
}

.layout-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--text-pure);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), var(--highlight-top);
  border: 1px solid var(--border-hairline);
}

/* --------------------------------------------------------------------------
   6. STOCKS GRID & CARDS (Masterpiece Layout)
   -------------------------------------------------------------------------- */
.stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

.stock-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card), var(--highlight-top);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.stock-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.stock-card:hover {
  transform: translateY(-3px);
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-hover), 0 0 20px rgba(56, 189, 248, 0.08), var(--highlight-top-active);
}

.stock-card:hover::before {
  opacity: 1;
}

.stock-card:active {
  transform: scale(0.99);
}

/* Card Top Row */
.stock-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.ticker-display {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ticker-code {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-pure);
  line-height: 1.1;
}

.company-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 3px;
  text-wrap: balance;
}

.price-box-card {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.card-price-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-pure);
  line-height: 1.1;
}

.change-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
}

.change-pill.pos {
  background: var(--color-buy-bg);
  border: 1px solid var(--color-buy-border);
  color: var(--color-buy);
}

.change-pill.neg {
  background: var(--color-sell-bg);
  border: 1px solid var(--color-sell-border);
  color: var(--color-sell);
}

/* Dual Advice Pod in Card */
.card-dual-advice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-hairline);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 18px;
}

.advice-subslot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.advice-slot-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Rating Badges */
.rating-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  text-align: center;
  display: inline-block;
  width: fit-content;
}

.rating-tag.BUY {
  background: var(--color-buy-bg);
  border: 1px solid var(--color-buy-border);
  color: var(--color-buy);
  box-shadow: 0 0 12px var(--color-buy-glow);
}

.rating-tag.SELL {
  background: var(--color-sell-bg);
  border: 1px solid var(--color-sell-border);
  color: var(--color-sell);
  box-shadow: 0 0 12px var(--color-sell-glow);
}

.rating-tag.WATCHLIST {
  background: var(--color-watchlist-bg);
  border: 1px solid var(--color-watchlist-border);
  color: var(--color-watchlist);
  box-shadow: 0 0 12px var(--color-watchlist-glow);
}

.rating-tag.HOLD {
  background: var(--color-hold-bg);
  border: 1px solid var(--color-hold-border);
  color: var(--color-hold);
}

.rating-tag.WAIT {
  background: var(--color-wait-bg);
  border: 1px solid var(--color-wait-border);
  color: var(--color-wait);
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-hairline);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.view-detail-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-cyan);
  font-weight: 500;
  transition: transform var(--dur-fast) var(--ease-out);
}

.stock-card:hover .view-detail-link {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   7. STOCKS TABLE VIEW (Swiss Grid)
   -------------------------------------------------------------------------- */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card), var(--highlight-top);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.stocks-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.stocks-table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-hairline);
}

.stocks-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
}

.stocks-table tbody tr {
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.stocks-table tbody tr:hover {
  background: var(--bg-surface-elevated);
}

/* --------------------------------------------------------------------------
   8. STOCK DETAIL VIEW
   -------------------------------------------------------------------------- */
.detail-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.back-nav-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.back-nav-btn:hover {
  color: var(--text-pure);
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  transform: translateX(-2px);
}

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

.detail-breadcrumbs {
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bc-sep {
  color: var(--text-faint);
}

.bc-active {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-cyan);
}

/* Company Banner Card */
.company-banner-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card), var(--highlight-top);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.company-main-meta {
  display: flex;
  align-items: center;
  gap: 22px;
}

.company-ticker-badge {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: var(--highlight-top), 0 0 24px rgba(56, 189, 248, 0.12);
  color: var(--text-pure);
}

.company-naming {
  display: flex;
  flex-direction: column;
}

.company-name {
  font-family: var(--font-display);
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-pure);
  margin-bottom: 8px;
}

.company-subtags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subtag {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xs);
  padding: 2px 8px;
  color: var(--text-secondary);
}

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

.company-price-box {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.price-val-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.currency-symbol {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text-muted);
}

.price-number {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-pure);
  line-height: 1;
}

.change-badge {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  margin-left: 6px;
}

.change-badge.pos {
  background: var(--color-buy-bg);
  border: 1px solid var(--color-buy-border);
  color: var(--color-buy);
}

.change-badge.neg {
  background: var(--color-sell-bg);
  border: 1px solid var(--color-sell-border);
  color: var(--color-sell);
}

.dual-ratings-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-box-mini {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rating-caption {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   9. METRICS STRIP
   -------------------------------------------------------------------------- */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card), var(--highlight-top);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.metric-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-data {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-pure);
  line-height: 1.2;
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Range Meter */
.range-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
}

.range-bound {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.range-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  position: relative;
  overflow: hidden;
}

.range-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width var(--dur-slow) var(--ease-out);
}

/* --------------------------------------------------------------------------
   10. CHART SECTION
   -------------------------------------------------------------------------- */
.chart-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card), var(--highlight-top);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.chart-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-pure);
}

.section-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.timeframe-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
}

.tf-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.tf-btn:hover {
  color: var(--text-pure);
}

.tf-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--color-cyan);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), var(--highlight-top);
}

.chart-canvas-container {
  height: 340px;
  position: relative;
  width: 100%;
}

.chart-loader {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  z-index: 5;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--color-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --------------------------------------------------------------------------
   11. DUAL ADVICE SECTION
   -------------------------------------------------------------------------- */
.advice-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.advice-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card), var(--highlight-top);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.long-term-card {
  border-top: 2px solid var(--color-buy);
}

.short-term-card {
  border-top: 2px solid var(--color-wait);
}

.advice-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-hairline);
}

.advice-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.advice-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.long-icon {
  background: var(--color-buy-bg);
  border: 1px solid var(--color-buy-border);
  color: var(--color-buy);
}

.short-icon {
  background: var(--color-wait-bg);
  border: 1px solid var(--color-wait-border);
  color: var(--color-wait);
}

.advice-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-pure);
}

.advice-horizon {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.advice-rating-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-xs);
}

.advice-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.field-callout {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
}

.callout-target {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
}

.callout-barrier {
  background: rgba(56, 189, 248, 0.05);
  border-color: rgba(56, 189, 248, 0.2);
}

.callout-trigger {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.25);
}

.field-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.text-highlight {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-pure);
  font-size: 0.86rem;
}

.text-warning {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #fbbf24;
  font-size: 0.86rem;
}

/* --------------------------------------------------------------------------
   12. NEWS & TRANSCRIPTS
   -------------------------------------------------------------------------- */
.news-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card), var(--highlight-top);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.news-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.news-counter-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-hairline);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
}

.news-filter-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 40px;
  margin-bottom: 18px;
  box-shadow: var(--highlight-top);
}

.news-filter-icon {
  color: var(--text-muted);
  margin-right: 10px;
  flex-shrink: 0;
}

.news-filter-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-pure);
  font-size: 0.84rem;
  width: 100%;
}

.news-filter-box input::placeholder {
  color: var(--text-muted);
}

.news-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.news-item-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: all var(--dur-fast) var(--ease-out);
}

.news-item-card:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  transform: translateX(2px);
}

.news-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.news-source {
  color: var(--color-cyan);
}

.news-item-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-pure);
  line-height: 1.45;
  margin-bottom: 10px;
}

.news-item-actions {
  display: flex;
  align-items: center;
}

.news-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-cyan);
  text-decoration: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.news-link-btn:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   13. RESEARCH REPORTS READER (Editorial Swiss Typography)
   -------------------------------------------------------------------------- */
.reports-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card), var(--highlight-top);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.reports-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-hairline);
}

.reports-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
}

.report-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.report-tab:hover {
  color: var(--text-pure);
}

.report-tab.active {
  background: var(--bg-surface-elevated);
  color: var(--text-pure);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4), var(--highlight-top);
  border: 1px solid var(--border-subtle);
}

.copy-action-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--highlight-top);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.copy-action-btn:hover {
  color: var(--text-pure);
  border-color: var(--border-subtle);
}

.copy-action-btn:active {
  transform: scale(0.96);
}

/* Markdown Reader Content */
.report-render-content {
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--text-primary);
  max-width: 900px;
}

.report-render-content h1,
.report-render-content h2,
.report-render-content h3,
.report-render-content h4 {
  font-family: var(--font-display);
  color: var(--text-pure);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  letter-spacing: -0.02em;
}

.report-render-content h1 { font-size: 1.6rem; border-bottom: 1px solid var(--border-hairline); padding-bottom: 0.4em; }
.report-render-content h2 { font-size: 1.3rem; }
.report-render-content h3 { font-size: 1.1rem; }

.report-render-content p {
  margin-bottom: 1.1em;
  text-wrap: pretty;
}

.report-render-content ul,
.report-render-content ol {
  margin-bottom: 1.2em;
  padding-left: 1.4em;
}

.report-render-content li {
  margin-bottom: 0.4em;
}

.report-render-content blockquote {
  border-left: 3px solid var(--color-cyan);
  background: rgba(56, 189, 248, 0.05);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.4em 0;
  color: var(--text-secondary);
  font-style: italic;
}

.report-render-content code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-hairline);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: #38bdf8;
}

.report-render-content pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-hairline);
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.2em 0;
}

.report-render-content pre code {
  background: transparent;
  border: none;
  padding: 0;
}

.report-render-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.88rem;
}

.report-render-content th {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: left;
}

.report-render-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-hairline);
}

.report-render-content tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* --------------------------------------------------------------------------
   14. FOOTER & TOAST
   -------------------------------------------------------------------------- */
.app-footer {
  border-top: 1px solid var(--border-hairline);
  background: rgba(6, 8, 14, 0.85);
  backdrop-filter: blur(16px);
  padding: 20px 28px;
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-buy);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-float), var(--highlight-top);
  color: var(--text-pure);
  font-size: 0.84rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toast-in 0.24s var(--ease-out) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   15. RESPONSIVE DESIGN (Breakpoints: 1024px, 768px, 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .metrics-strip {
    grid-template-columns: 1fr 1fr;
  }
  .advice-section-grid {
    grid-template-columns: 1fr;
  }
  .company-banner-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .company-price-box {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .topbar-inner {
    padding: 0 16px;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap;
  }
  .telemetry-bar {
    order: 3;
    width: 100%;
    justify-content: space-around;
  }
  .search-command-box {
    width: 180px;
  }
  .search-command-box:focus-within {
    width: 220px;
  }
  .main-container {
    padding: 20px 16px 40px;
  }
  .stocks-grid {
    grid-template-columns: 1fr;
  }
  .controls-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .filter-pills {
    width: 100%;
    overflow-x: auto;
  }
  .metrics-strip {
    grid-template-columns: 1fr;
  }
}
