/* Signal Desk Inspired Design System for WynTrade Analyzer */

:root {
  /* Primary Colors - Light Mode First (Signal Desk Style) */
  --bg-0: #f7f8fa;
  --bg-1: #ffffff;
  --bg-2: #f0f2f5;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.95);
  --panel-grad-start: #ffffff;
  --panel-grad-end: #fafbfc;
  --surface-soft: #ffffff;
  --input-bg: #ffffff;
  --button-ghost-bg: #f7f8fa;

  /* Borders */
  --line: #e4e7eb;
  --line-strong: #cbd2d9;

  /* Text Colors */
  --text: #1a202c;
  --text-secondary: #4a5568;
  --muted: #718096;

  /* Accent - Cyan/Turquoise from Signal */
  --accent: #00BCD4;
  --accent-hover: #00ACC1;
  --accent-light: #E0F7FA;
  --accent-2: #7c3aed;

  /* Status Colors */
  --bullish: #10b981;
  --bullish-bg: #d1fae5;
  --bearish: #ef4444;
  --bearish-bg: #fee2e2;
  --sideways: #f59e0b;
  --sideways-bg: #fef3c7;

  /* Green States */
  --green: #10b981;
  --green-text: #059669;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Border Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ticker-height: 38px;
  --top-nav-height: 130px;
}

.heatmap-cell-label.bullish,
.value-bullish {
  color: var(--bullish) !important;
  font-weight: 900;
}

.heatmap-cell-label.bearish,
.value-bearish {
  color: var(--bearish) !important;
  font-weight: 900;
}

.heatmap-cell-label.sideways,
.value-sideways {
  color: var(--sideways) !important;
  font-weight: 900;
}

.sentinel-mini-chart .row-mini-chart {
  width: 100%;
  height: 66px;
}

.oracle-provider-banner {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  margin-bottom: 2px;
}

.oracle-provider-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.oracle-provider-note.bullish strong,
.oracle-provider-note.bullish span {
  color: var(--bullish);
}

.oracle-provider-note.bearish strong,
.oracle-provider-note.bearish span {
  color: var(--bearish);
}

.level-stack {
  display: grid;
  gap: 4px;
}

.level-stack strong {
  display: block;
  font-weight: 900;
}

.instrument-news-details,
.calendar-news-detail {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--surface-soft);
}

.instrument-news-details summary,
.calendar-news-detail summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}

.instrument-news-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.instrument-news-list a {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.instrument-news-list span,
.instrument-news-list small,
.calendar-news-detail p,
.calendar-news-detail small {
  color: var(--muted);
}

.mosaic-detail-grid {
  margin-top: 16px;
}

html[data-theme="dark"] {
  --bg-0: #0a0e14;
  --bg-1: #111827;
  --bg-2: #1f2937;
  --panel: #1f2937;
  --panel-soft: rgba(31, 41, 55, 0.95);
  --panel-grad-start: #1f2937;
  --panel-grad-end: #111827;
  --surface-soft: #1f2937;
  --input-bg: #111827;
  --button-ghost-bg: #1f2937;

  --line: #374151;
  --line-strong: #4b5563;

  --text: #f9fafb;
  --text-secondary: #e5e7eb;
  --muted: #9ca3af;

  --accent: #22d3ee;
  --accent-hover: #06b6d4;
  --accent-light: #164e63;

  --bullish: #34d399;
  --bullish-bg: #064e3b;
  --bearish: #f87171;
  --bearish-bg: #7f1d1d;
  --sideways: #fbbf24;
  --sideways-bg: #78350f;

  --green: #34d399;
  --green-text: #6ee7b7;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.5), 0 1px 2px -1px rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-0);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Live Ticker Bar (Signal Desk Style) */
.live-ticker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  padding: 8px 20px;
  min-height: var(--ticker-height);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.live-ticker::-webkit-scrollbar {
  height: 4px;
}

.live-ticker::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 2px;
}

.ticker-content {
  display: flex;
  align-items: center;
  gap: 32px;
  min-width: min-content;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.ticker-symbol {
  color: var(--text-secondary);
}

.ticker-price {
  color: var(--text);
  font-weight: 600;
}

.ticker-change {
  font-size: 12px;
  font-weight: 600;
}

.ticker-change.positive {
  color: var(--bullish);
}

.ticker-change.negative {
  color: var(--bearish);
}

/* Screen glow effect (subtle in light mode) */
.screen-glow {
  display: none;
}

html[data-theme="dark"] .screen-glow {
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.05), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.05), transparent 40%);
}

.page-shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  height: 100vh;
  padding: calc(var(--ticker-height) + var(--top-nav-height)) 0 0 0;
  overflow: hidden;
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: var(--ticker-height);
  left: 0;
  right: 0;
  z-index: 25;
  min-height: var(--top-nav-height);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 28px 20px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}

.brand-lockup {
  display: grid;
  gap: 14px;
  align-items: start;
  justify-items: start;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Hamburger Menu */
.hamburger-button {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  transition: var(--transition);
}

.hamburger-button span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger-button:hover span {
  background: var(--accent);
}

.hamburger-button.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-button.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-button.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  display: block;
}

.brand {
  display: grid;
  gap: 2px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.brand strong {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

h1, h2, h3, h4, p {
  margin: 0;
}

.nav-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 8px;
}

.top-clock {
  display: grid;
  gap: 1px;
  align-items: center;
  min-width: 118px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--bg-2);
  color: var(--text);
}

.top-clock span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.top-clock strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.theme-icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-full);
  line-height: 1;
}

.theme-icon {
  display: none;
  width: 28px;
  height: 28px;
  line-height: 1;
}

.theme-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.theme-icon-ring,
.theme-icon-disc,
.theme-icon-hole,
.theme-icon-cut,
.theme-icon-fill {
  vector-effect: non-scaling-stroke;
}

.theme-icon-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
}

.theme-icon-fill,
.theme-icon-disc {
  fill: currentColor;
}

.theme-icon-hole,
.theme-icon-cut {
  fill: var(--button-ghost-bg);
}

html[data-theme="dark"] .theme-icon-sun {
  display: inline;
}

html[data-theme="light"] .theme-icon-moon {
  display: inline;
}

/* Status Indicators (like Signal) */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--green-text);
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Buttons - Pill Style (Signal Desk) */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--bg-1);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: var(--bg-2);
  border-color: var(--line-strong);
}

button:focus,
.button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button.primary,
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.button.primary:hover,
button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button.ghost {
  background: transparent;
  border-color: transparent;
}

.button.ghost:hover {
  background: var(--button-ghost-bg);
  border-color: var(--line);
}

.utility-button {
  min-width: 100px;
}

.utility-button-strong {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Chips & Pills */
.tiny-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-toggle {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.chip-toggle:hover {
  border-color: var(--line-strong);
  background: var(--bg-2);
}

.chip-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Cards & Panels - Clean Signal Style */
.hero-card,
.panel,
.card,
.news-card,
.login-card,
.overview-card,
.metric-card,
.analysis-card,
.signal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: none;
  transition: var(--transition);
}

html[data-theme="light"] .hero-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .card,
html[data-theme="light"] .overview-card,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .analysis-card,
html[data-theme="light"] .signal-card {
  background: #ffffff;
  border-color: #e4e7eb;
}

.panel,
.login-card {
  padding: 20px;
}

/* Auth pages keep the focused centered card layout. */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
}

.login-topbar {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 5;
}

.login-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(320px, 1fr);
  gap: 22px;
  align-items: stretch;
}

.login-layout-single {
  width: min(460px, 100%);
  grid-template-columns: 1fr;
}

html[data-theme="light"] .login-shell {
  background:
    radial-gradient(circle at 20% 18%, rgba(94, 232, 255, 0.12), transparent 0 20%),
    radial-gradient(circle at 80% 12%, rgba(125, 140, 255, 0.12), transparent 0 18%),
    linear-gradient(160deg, #f6f9ff, #ecf3ff 52%, #dde8fb);
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
}

.login-card-focused {
  padding: 28px;
}

.login-layout .login-card {
  width: 100%;
}

html[data-theme="light"] .login-card {
  border-color: rgba(34, 84, 140, 0.18);
}

.login-form,
.oauth-row {
  display: grid;
  gap: 14px;
}

.login-actions {
  justify-content: space-between;
}

.overview-card {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.overview-card-wide {
  align-content: start;
}

.workspace .panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0;
}

.workspace .panel-heading h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.panel-heading-subtle {
  align-items: flex-start;
  margin-bottom: 12px;
}

/* Module Upgrade Layouts */
#tab-summary .summary-timeframes.checkbox-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  margin: 8px 0 18px;
}

#tab-summary .summary-timeframes .check-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 112px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--bg-1);
  white-space: nowrap;
}

#tab-summary .summary-timeframes .check-chip input {
  width: auto;
  margin: 0;
}

.sentinel-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 18px;
}

.sentinel-detail-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  overflow: hidden;
}

.ta-box-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.ta-box {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  color: var(--text);
  text-align: center;
  box-shadow: none;
}

.ta-box strong {
  display: block;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ta-box span {
  display: block;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
}

.ta-box.bearish {
  border-color: rgba(255, 66, 83, 0.28);
  background: rgba(255, 66, 83, 0.08);
  color: var(--bearish);
}

.ta-box.bullish {
  border-color: rgba(0, 166, 118, 0.28);
  background: rgba(0, 166, 118, 0.08);
  color: var(--bullish);
}

.ta-box.sideways {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.flux-card {
  display: grid;
  gap: 14px;
}

.flux-orderflow-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.45fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.flux-orderflow-symbol {
  display: grid;
  gap: 3px;
}

.flux-orderflow-symbol strong {
  font-size: 15px;
  color: var(--text);
}

.flux-orderflow-symbol span {
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.flux-orderflow-bars {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.flux-orderflow-bars span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 100%;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.flux-orderflow-bars .flux-long {
  background: #7fd2f2;
  color: #0b5f90;
}

.flux-orderflow-bars .flux-short {
  background: #ffa3b4;
  color: #8b2438;
}

.flux-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
}

.flux-flow-chart {
  height: 86px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  overflow: hidden;
}

.flux-flow-chart {
  color: #64748b;
}

.flux-flow-chart.bullish {
  color: var(--bullish);
}

.flux-flow-chart.bearish {
  color: var(--bearish);
}

.flux-flow-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.oracle-analysis-card {
  align-content: start;
}

.module-instrument-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.metric-table-box {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.metric-table-row {
  display: grid;
  grid-template-columns: minmax(128px, 0.42fr) minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.metric-table-row:last-child {
  border-bottom: 0;
}

.metric-table-label {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-table-value {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: calc(100% - 20px);
  margin: 8px 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--text);
  background: var(--panel);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.metric-table-value.bullish {
  color: var(--bullish);
  background: rgba(0, 166, 118, 0.08);
  border-color: rgba(0, 166, 118, 0.24);
}

.metric-table-value.bearish {
  color: var(--bearish);
  background: rgba(255, 66, 83, 0.08);
  border-color: rgba(255, 66, 83, 0.24);
}

.metric-table-value.sideways {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.26);
}

.metric-table-value .value-bullish,
.flux-orderflow-symbol .value-bullish,
.live-engine-stats .value-bullish {
  color: var(--bullish) !important;
  font-weight: 900;
}

.metric-table-value .value-bearish,
.flux-orderflow-symbol .value-bearish,
.live-engine-stats .value-bearish {
  color: var(--bearish) !important;
  font-weight: 900;
}

.metric-table-value .value-sideways,
.flux-orderflow-symbol .value-sideways,
.live-engine-stats .value-sideways {
  color: var(--sideways) !important;
  font-weight: 900;
}

.mosaic-detail-card,
.oracle-analysis-card,
.macro-symbol-card,
.master-matrix-card {
  gap: 14px;
}

.oracle-analysis-card .muted,
.mosaic-detail-card .muted {
  line-height: 1.45;
}

.tempest-metric-table,
.architect-metric-table,
.flux-metric-table,
.macro-symbol-metric-table,
.master-signal-metric-table {
  margin-top: 4px;
}

.flux-card,
.architect-card,
.macro-symbol-card,
.master-matrix-card,
.analysis-card {
  min-width: 0;
}

#tab-calendar.tab-panel.active {
  display: grid;
  gap: 18px;
}

.macro-calendar-table {
  margin-top: 2px;
}

.architect-macro-table-wrap {
  margin: 0 0 18px;
}

.architect-driver-table {
  min-width: 980px;
}

.architect-driver-table th,
.architect-driver-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.architect-driver-table .badge {
  display: inline-flex;
  justify-content: center;
  min-width: 116px;
}

.macro-analysis-spacer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.macro-analysis-spacer h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

#tab-summary .table-wrap,
#tab-heatmap > .table-wrap {
  margin-top: 26px;
}

#tab-summary .mosaic-detail-grid,
#tab-heatmap .sentinel-detail-grid {
  margin-bottom: 10px;
}

.master-signal-grid {
  align-items: start;
}

.master-detail-panel {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.master-detail-panel strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.master-detail-panel span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.architect-pair-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.architect-pair-score strong {
  color: var(--bullish);
  font-size: 18px;
}

.architect-pair-score span {
  color: var(--bearish);
  font-weight: 800;
}

.live-engine-block {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.live-engine-heading,
.live-engine-meter,
.live-engine-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-engine-heading span,
.live-engine-meter span,
.live-engine-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-engine-heading strong {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.live-engine-heading strong.bullish {
  color: var(--bullish);
}

.live-engine-heading strong.bearish {
  color: var(--bearish);
}

.live-engine-heading strong.sideways {
  color: #f59e0b;
}

.live-engine-track {
  position: relative;
  flex: 1;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, rgba(255, 66, 83, 0.14), rgba(245, 158, 11, 0.12) 50%, rgba(0, 166, 118, 0.14));
}

.live-engine-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  transition: width 220ms ease;
}

.live-engine-fill.bullish {
  background: linear-gradient(90deg, rgba(0, 166, 118, 0.28), var(--bullish));
}

.live-engine-fill.bearish {
  background: linear-gradient(90deg, var(--bearish), rgba(255, 66, 83, 0.28));
}

.live-engine-fill.sideways {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.28), #f59e0b);
}

.live-engine-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  opacity: 0.6;
  transform: translateX(-120%);
  animation: live-engine-scan 1.8s linear infinite;
}

@keyframes live-engine-scan {
  to {
    transform: translateX(120%);
  }
}

/* Layout */
.layout-dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  align-items: start;
  height: calc(100vh - var(--ticker-height) - var(--top-nav-height));
  min-height: 0;
  overflow: hidden;
}

.dashboard-two-column {
  grid-template-columns: 240px 1fr;
}

.sidebar {
  position: fixed;
  left: 0;
  top: calc(var(--ticker-height) + var(--top-nav-height));
  bottom: 0;
  width: 240px;
  display: grid;
  gap: 0;
  min-width: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 20;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--line-strong);
}

.sidebar.collapsed {
  transform: translateX(-100%);
  position: absolute;
  z-index: 20;
}

.workspace {
  display: grid;
  gap: 20px;
  min-width: 0;
  grid-column: 2;
  margin-left: 0;
  padding: 24px 20px;
  height: calc(100vh - var(--ticker-height) - var(--top-nav-height));
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.workspace > .panel {
  min-width: 0;
}

.workspace::-webkit-scrollbar {
  width: 8px;
}

.workspace::-webkit-scrollbar-track {
  background: var(--bg-0);
}

.workspace::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

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

.module-sidebar {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 20px 0 0;
}

/* Sidebar Navigation (Clean Signal Style) */
.panel-heading {
  padding: 0 20px;
  margin-bottom: 8px;
}

.panel-heading h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.module-nav {
  display: grid;
  gap: 2px;
  padding: 0 12px;
}

.module-nav-button,
.tab-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
}

.module-nav-button:hover,
.tab-button:hover {
  background: var(--bg-2);
  color: var(--text);
}

.module-nav-button.active,
.tab-button.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  position: relative;
}

.module-nav-button.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

html[data-theme="dark"] .module-nav-button.active,
html[data-theme="dark"] .tab-button.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* Home Page Layout */
.home-page-layout {
  display: grid;
  gap: 20px;
}

.home-hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: none;
}

html[data-theme="light"] .home-hero-card {
  background: #ffffff;
  border-color: #e4e7eb;
}

.home-hero-card-compact {
  padding: 20px;
}

.home-hero-heading h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.home-connection-status {
  color: var(--muted);
  font-size: 14px;
}

.hero-stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: grid;
  gap: 4px;
}

.hero-stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-stat strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.home-hero-meta-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.home-symbol-breakdown {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  min-width: 0;
  overflow: hidden;
}

.home-symbol-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 34%);
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: var(--transition);
  cursor: pointer;
  text-align: left;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.home-symbol-row:hover {
  border-color: var(--accent);
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
  z-index: 2;
}

.home-symbol-row:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.home-symbol-row strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-symbol-row span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  pointer-events: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-symbol-score {
  display: grid;
  gap: 6px;
  justify-items: end;
  min-width: 0;
  max-width: 100%;
  pointer-events: none;
}

.home-symbol-score small {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  pointer-events: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-symbol-score .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-symbol-score .symbol-bull-bear-meter {
  width: min(120px, 100%);
  max-width: 100%;
}

/* Analysis Grid */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* Home Analysis Grid - 3 columns, 2 rows */
#homeAnalysisGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.analysis-card {
  padding: 20px;
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 160px;
  min-width: 0;
  overflow: hidden;
  transition: var(--transition);
}

.analysis-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.analysis-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.analysis-card .panel-heading {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.analysis-card .panel-heading h3 {
  margin: 0;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.badge.bullish {
  background: var(--bullish-bg);
  color: var(--green-text);
}

.badge.bearish {
  background: var(--bearish-bg);
  color: var(--bearish);
}

.badge.sideways {
  background: var(--sideways-bg);
  color: var(--sideways);
}

html[data-theme="dark"] .badge.bullish {
  background: var(--bullish-bg);
  color: var(--bullish);
}

html[data-theme="dark"] .badge.bearish {
  background: var(--bearish-bg);
  color: var(--bearish);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}

html[data-theme="light"] .table-wrap {
  background: #ffffff;
  border-color: #e4e7eb;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

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

th {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  background: var(--bg-2);
}

html[data-theme="light"] th {
  background: #f7f8fa;
}

tbody tr:hover {
  background: var(--bg-2);
}

html[data-theme="light"] tbody tr:hover {
  background: #f7f8fa;
}

.table-note {
  font-size: 13px;
  color: var(--muted);
}

/* Form Elements */
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.control-bar {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

/* Utility Classes */
.muted,
.helper {
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Tab System */
.tab-row {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.tab-row .tab-button {
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
}

.tab-row .tab-button.active {
  border-bottom-color: var(--accent);
  background: transparent;
}

.tab-panel {
  display: none;
}

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

/* Status Indicators */
.status-stack,
.diagnostics-list {
  display: grid;
  gap: 12px;
}

#diagnosticNotes.diagnostics-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(94, 232, 255, 0.28);
  border-radius: 8px;
  padding: 12px;
  background: #05070a;
  color: #d7fff4;
  font-family: Consolas, "Courier New", monospace;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.diagnostic-log-line {
  display: grid;
  grid-template-columns: 18px minmax(96px, max-content) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.86rem;
  line-height: 1.45;
}

.diagnostic-log-line:first-child {
  color: #ffffff;
}

.diagnostic-log-line:last-child {
  border-bottom: 0;
}

.diagnostic-prompt {
  color: #5ee8ff;
  font-weight: 800;
}

.diagnostic-module {
  color: #ffd166;
  font-weight: 700;
}

.diagnostic-message {
  overflow-wrap: anywhere;
}

.diagnostic-log-line.bullish .diagnostic-prompt {
  color: var(--bullish);
}

.diagnostic-log-line.bearish .diagnostic-prompt {
  color: var(--bearish);
}

html[data-theme="light"] #diagnosticNotes.diagnostics-list {
  background: #08111f;
  color: #e8fff8;
}

.diagnostic-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
  box-shadow: none;
  transition: var(--transition);
}

html[data-theme="light"] .diagnostic-card {
  background: #ffffff;
  border-color: #e4e7eb;
}

.diagnostic-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.diagnostic-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.diagnostic-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* Meters & Progress */
.symbol-bull-bear-meter {
  position: relative;
  display: block;
  width: 120px;
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.symbol-bull-bear-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  transition: width 0.5s ease;
}

.symbol-bull-bear-fill.bullish {
  background: var(--bullish);
}

.symbol-bull-bear-fill.bearish {
  background: var(--bearish);
}

.symbol-bull-bear-fill.sideways {
  background: var(--sideways);
}

/* Combined Analyzer */
.combined-analyzer {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.combined-analyzer-heading {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(240px, 1.45fr) minmax(170px, 1fr) minmax(140px, 0.95fr) minmax(130px, 0.85fr) minmax(110px, 0.7fr);
  gap: 16px;
  align-items: center;
  padding: 0 16px 12px;
  border-bottom: 2px solid var(--line);
}

.combined-analyzer-heading button {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: left;
}

.combined-analyzer-heading button:hover {
  color: var(--accent);
}

.combined-heading-modules,
.combined-heading-mini,
.combined-heading-volume {
  text-align: center;
}

.combined-analyzer-heading button:last-child {
  text-align: right;
}

.combined-analyzer-list {
  display: grid;
  gap: 6px;
}

.combined-analyzer-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(240px, 1.45fr) minmax(170px, 1fr) minmax(140px, 0.95fr) minmax(130px, 0.85fr) minmax(110px, 0.7fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: var(--transition);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  width: 100%;
  position: relative;
  z-index: 1;
}

html[data-theme="light"] .combined-analyzer-row {
  background: #ffffff;
  border-color: #e4e7eb;
}

.combined-analyzer-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  background: var(--bg-2);
  z-index: 2;
}

html[data-theme="light"] .combined-analyzer-row:hover {
  background: #f7f8fa;
  border-color: #cbd2d9;
}

.combined-analyzer-row:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.combined-analyzer-row strong {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  pointer-events: none;
}

.combined-symbol-cell {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
}

.composite-direction-arrow {
  display: inline-grid !important;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  font-size: 15px !important;
  font-weight: 900;
  line-height: 1;
  color: var(--muted);
  background: var(--bg-2);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
}

.composite-direction-arrow.bullish {
  color: var(--bullish);
  background: rgba(0, 166, 118, 0.1);
  border-color: rgba(0, 166, 118, 0.26);
}

.composite-direction-arrow.bearish {
  color: var(--bearish);
  background: rgba(255, 66, 83, 0.1);
  border-color: rgba(255, 66, 83, 0.26);
}

.composite-direction-arrow.sideways {
  color: var(--sideways);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.26);
}

.open-order-indicator {
  display: inline-grid !important;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  font-size: 15px !important;
  font-weight: 900;
  line-height: 1;
  animation: orderPulse 1.1s ease-in-out infinite;
}

.open-order-indicator.profit {
  color: #ffffff !important;
  background: var(--bullish);
  box-shadow: 0 0 0 0 rgba(0, 166, 118, 0.38), 0 0 18px rgba(0, 166, 118, 0.28);
}

.open-order-indicator.loss {
  color: #ffffff !important;
  background: var(--bearish);
  box-shadow: 0 0 0 0 rgba(255, 66, 83, 0.38), 0 0 18px rgba(255, 66, 83, 0.28);
}

@keyframes orderPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: translateY(-1px) scale(1.08);
    filter: brightness(1.25);
  }
}

.combined-analyzer-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}

.combined-analyzer-row .module-code-strip,
.combined-analyzer-row .row-mini-chart,
.combined-analyzer-row .row-volume-profile {
  align-self: center;
  justify-self: center;
}

.combined-analyzer-row em {
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: right;
  pointer-events: none;
}

.combined-analyzer-row em.bullish {
  color: var(--bullish);
}

.combined-analyzer-row em.bearish {
  color: var(--bearish);
}

.combined-analyzer-row em.sideways {
  color: var(--sideways);
}

/* Combined meter cell */
.combined-meter-cell {
  display: grid;
  align-items: center;
  justify-content: center;
  justify-items: stretch;
  gap: 8px;
  width: 100%;
  pointer-events: none;
}

.combined-row-meter {
  width: 100%;
  height: 10px;
}

.combined-meter-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  pointer-events: none;
}

.combined-meter-text b {
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.combined-analyzer-row.bullish .combined-meter-text .bull-word {
  color: var(--bullish);
  text-shadow: 0 0 14px rgba(0, 166, 118, 0.25);
}

.combined-analyzer-row.bearish .combined-meter-text .bear-word {
  color: var(--bearish);
  text-shadow: 0 0 14px rgba(255, 66, 83, 0.25);
}

.combined-analyzer-row.sideways .combined-meter-text b {
  color: var(--sideways);
}

.symbol-bull-bear-meter {
  pointer-events: none;
}

.symbol-bull-bear-fill {
  pointer-events: none;
}

.row-mini-chart {
  width: 100%;
  max-width: 130px;
  height: 40px;
  justify-self: center;
  pointer-events: none;
  overflow: visible;
  transition: filter 160ms ease, transform 160ms ease;
}

.row-mini-chart svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.row-mini-area {
  fill: rgba(100, 116, 139, 0.18);
  transition: d 120ms linear, fill 160ms ease;
}

.row-mini-line {
  fill: none;
  stroke: #64748b;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(15, 23, 42, 0.16));
  transition: d 120ms linear, stroke 160ms ease;
}

.row-mini-chart.bullish {
  filter: drop-shadow(0 0 10px rgba(0, 166, 118, 0.22));
}

.row-mini-chart.bullish .row-mini-area {
  fill: rgba(0, 166, 118, 0.18);
}

.row-mini-chart.bullish .row-mini-line {
  stroke: var(--bullish);
}

.row-mini-chart.bearish {
  filter: drop-shadow(0 0 10px rgba(255, 66, 83, 0.2));
}

.row-mini-chart.bearish .row-mini-area {
  fill: rgba(255, 66, 83, 0.16);
}

.row-mini-chart.bearish .row-mini-line {
  stroke: var(--bearish);
}

.row-mini-chart[data-mini-symbol] {
  animation: mini-chart-live-flash 500ms ease;
}

@keyframes mini-chart-live-flash {
  0% {
    transform: scale(1.015);
    filter: brightness(1.25) drop-shadow(0 0 14px rgba(94, 232, 255, 0.22));
  }
  100% {
    transform: scale(1);
  }
}

.row-volume-profile {
  width: 100%;
  max-width: 112px;
  height: 48px;
  justify-self: center;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  pointer-events: none;
}

.row-volume-profile i {
  display: block;
  height: 4px;
  justify-self: end;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, rgba(94, 232, 255, 0.35), rgba(57, 240, 177, 0.92));
  box-shadow: 0 0 10px rgba(57, 240, 177, 0.16);
  transition: width 160ms linear, filter 160ms ease;
}

.row-volume-profile[data-volume-symbol] i:last-child {
  filter: brightness(1.18);
}

.module-code-strip {
  display: grid;
  grid-template-columns: repeat(6, 18px);
  gap: 6px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.module-code-strip i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid transparent;
  color: #ffffff;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 5px 12px rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

.module-code-strip i.bullish {
  background: var(--bullish);
  border-color: color-mix(in srgb, var(--bullish) 70%, #ffffff);
}

.module-code-strip i.bearish {
  background: var(--bearish);
  border-color: color-mix(in srgb, var(--bearish) 70%, #ffffff);
}

.module-code-strip i.sideways {
  background: var(--sideways);
  border-color: color-mix(in srgb, var(--sideways) 70%, #ffffff);
  color: #1f2937;
}

/* Instrument Drilldown Modal */
.instrument-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(10px);
}

.instrument-modal-backdrop.hidden {
  display: none;
}

.instrument-modal {
  width: min(1500px, 100%);
  height: min(920px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-xl);
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
}

.instrument-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}

.instrument-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.instrument-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.instrument-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}

.instrument-chart-layout.composite-drilldown {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.instrument-chart {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid #9aa4b2;
  border-radius: var(--radius);
  background: #000;
}

.internal-chart-stack {
  display: grid;
  gap: 8px;
  height: 100%;
}

.internal-chart-panel {
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.internal-chart-panel.price {
  min-height: 0;
}

.chart-overlay-note {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 2;
  max-width: min(520px, calc(100% - 24px));
  color: #e8eef8;
  font-size: 0.72rem;
  line-height: 1.2;
  pointer-events: none;
}

.instrument-breakdown {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
  overflow: auto;
  min-height: 0;
}

.instrument-orders {
  min-height: 0;
  max-height: 160px;
  overflow: auto;
}

.instrument-orders:empty {
  display: none;
}

.instrument-orders-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
}

.instrument-orders-heading strong {
  color: var(--text);
  font-size: 0.95rem;
}

.instrument-orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.instrument-order-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.instrument-order-card.buy {
  border-left-color: var(--bullish);
}

.instrument-order-card.sell {
  border-left-color: var(--bearish);
}

.instrument-order-card strong {
  grid-column: 1 / -1;
  color: var(--text);
}

.instrument-order-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.instrument-order-card b {
  justify-self: end;
  color: var(--muted);
}

.instrument-order-card.profit b {
  color: var(--bullish);
}

.instrument-order-card.loss b {
  color: var(--bearish);
}

.instrument-breakdown-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.instrument-breakdown-grid,
.combined-module-analysis {
  display: grid;
  gap: 10px;
}

.instrument-breakdown-grid div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.instrument-breakdown-grid strong,
.instrument-breakdown-grid span {
  display: block;
}

.instrument-breakdown-grid strong {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.instrument-breakdown-grid span {
  margin-top: 4px;
  line-height: 1.4;
}

.combined-drilldown-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.combined-drilldown-summary > strong {
  color: var(--text);
  font-size: 1.15rem;
}

.combined-drilldown-summary > span:not(.symbol-bull-bear-meter) {
  color: var(--muted);
}

.combined-module-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--module-color);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
}

.combined-module-card > div:first-child {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
}

.combined-module-card i {
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--module-color) 18%, transparent);
  color: var(--module-color);
  font-style: normal;
  font-weight: 900;
}

.combined-module-card strong,
.combined-module-card b {
  color: var(--text);
}

.combined-module-card span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.combined-module-card > div:last-child {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 128px;
}

.module-analysis-meter {
  width: 128px;
  height: 9px;
}

.combined-module-card em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.combined-module-card.bullish em {
  color: var(--bullish);
}

.combined-module-card.bearish em {
  color: var(--bearish);
}

.combined-module-card.sideways em {
  color: var(--sideways);
}

.instrument-status {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.instrument-status.bullish {
  color: var(--bullish);
}

.instrument-status.bearish {
  color: var(--bearish);
}

/* News Cards */
.news-stack {
  display: grid;
  gap: 12px;
}

.news-card {
  padding: 16px;
  display: grid;
  gap: 10px;
  transition: var(--transition);
}

.news-card:hover {
  box-shadow: var(--shadow-md);
}

.news-time {
  font-size: 12px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 1024px) {
  .hamburger-button {
    display: flex;
  }

  .layout-dashboard,
  .dashboard-two-column {
    grid-template-columns: 1fr;
  }

  .sidebar {
    top: calc(var(--ticker-height) + var(--top-nav-height));
    box-shadow: var(--shadow-lg);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .workspace {
    grid-column: 1;
    margin-left: 0;
  }
}

@media (max-width: 1200px) {
  #homeAnalysisGrid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sentinel-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-instrument-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .combined-analyzer-heading,
  .combined-analyzer-row {
    grid-template-columns: 110px minmax(260px, 1fr) 150px 120px 110px 100px;
    gap: 12px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .page-shell {
    padding: calc(var(--ticker-height) + var(--top-nav-height)) 0 0 0;
  }

  .workspace {
    height: calc(100vh - var(--ticker-height) - var(--top-nav-height));
    padding: 20px 12px;
  }

  .sentinel-detail-grid {
    grid-template-columns: 1fr;
  }

  .module-instrument-grid {
    grid-template-columns: 1fr;
  }

  .top-nav {
    padding: 18px 16px 14px;
  }

  .brand-lockup {
    gap: 10px;
  }

  .nav-actions {
    padding-top: 4px;
  }

  .instrument-modal-backdrop {
    padding: 10px;
  }

  .instrument-modal {
    height: calc(100vh - 20px);
    padding: 14px;
  }

  .instrument-modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .instrument-chart-layout,
  .instrument-chart-layout.composite-drilldown {
    grid-template-columns: 1fr;
  }

  .instrument-chart {
    min-height: 360px;
  }

  .nav-actions {
    gap: 6px;
  }

  .utility-button {
    min-width: auto;
    padding: 8px 12px;
    font-size: 13px;
  }

  .analysis-grid,
  #homeAnalysisGrid {
    grid-template-columns: 1fr;
  }

  .metric-table-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .metric-table-label {
    min-height: 34px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-table-value {
    width: calc(100% - 20px);
    justify-content: flex-start;
  }

  .control-bar {
    grid-template-columns: 1fr;
  }

  .home-hero-meta-compact {
    grid-template-columns: 1fr;
  }

  .live-ticker {
    padding: 8px 12px;
  }

  .ticker-item {
    font-size: 11px;
  }

  /* Stack combined analyzer on mobile */
  .combined-analyzer-heading,
  .combined-analyzer-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .combined-analyzer-heading button {
    display: none;
  }

  .combined-analyzer-row > * {
    justify-self: start;
  }

  .combined-analyzer-row em {
    text-align: left;
  }
}
