/* ============================================================
   EX.IO RWA Product Page — Styles
   ============================================================ */

/* ── Reset & Globals ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #ffffff;
  --bg-subtle:    #f8f9fa;
  --bg-hover:     #f1f3f5;
  --border:       #e9ecef;
  --border-light: #f1f3f5;
  --text:         #212529;
  --text-secondary: #868e96;
  --text-muted:   #adb5bd;
  --accent:       #00c98d;
  --accent-hover: #00b37d;
  --accent-light: #e6faf3;

  /* Risk colours */
  --risk-p1: #00c98d;
  --risk-p2: #4dabf7;
  --risk-p3: #ffd43b;
  --risk-p4: #ff922b;
  --risk-p5: #ff6b6b;

  /* Layout */
  --nav-h:     56px;
  --sidebar-w: 220px;
  --detail-w:  480px;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);

  /* Transitions */
  --transition: 150ms ease;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ── Top Navigation ──────────────────────────────────────── */
.top-nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-xl);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.nav-left { display: flex; align-items: center; gap: var(--sp-xl); }
.nav-right { display: flex; align-items: center; gap: var(--sp-md); }

/* Logo */
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
}
.logo-ex { color: var(--text); }
.logo-dot { color: var(--text); }
.logo-io { color: var(--text); }

/* Nav links */
.nav-links { display: flex; gap: var(--sp-lg); }
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--sp-xs) 0;
  transition: color var(--transition);
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }

/* Deposit button */
.btn-deposit {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-deposit:hover {
  background: var(--accent);
  color: #fff;
}

/* Dropdown toggle */
.dropdown-toggle {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.dropdown-toggle:hover { color: var(--text); background: var(--bg-hover); }
.caret { font-size: 0.625rem; }

/* Icon buttons */
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ── App Body (below nav) ────────────────────────────────── */
.app-body {
  display: flex;
  margin-top: var(--nav-h);
  margin-left: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  border-right: 1px solid var(--border);
  background: var(--bg);
  overflow-y: auto;
  padding: var(--sp-md) 0;
  z-index: 90;
}

/* Category tree */
.category-tree { }

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-xs, 4px) var(--sp-lg);
  opacity: 0.6;
}

.cat-group { margin-bottom: 2px; }

.cat-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font-family: var(--font);
}
.cat-header:hover { background: var(--bg-hover); }

.cat-icon {
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.cat-icon svg, .lucide-icon { width: 16px; height: 16px; stroke-width: 1.75; }
.cat-chevron {
  margin-left: auto;
  font-size: 0.625rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  display: flex;
  align-items: center;
}
.cat-chevron svg { width: 12px; height: 12px; }
.cat-group.open .cat-chevron { transform: rotate(180deg); }

.cat-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height 250ms ease;
}
.cat-group.open .cat-children { max-height: 300px; }

.cat-child {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px var(--sp-lg) 6px 44px;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-secondary);
  border: none;
  background: none;
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-child:hover { color: var(--text); background: var(--bg-hover); }
.cat-child.active {
  color: var(--accent);
  font-weight: 500;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding-left: 41px;
}

.cat-header-all {
  cursor: pointer;
  margin-bottom: var(--sp-xs);
}
.cat-header-all.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

/* Asset List Grid */
.list-wrapper {
  padding: var(--sp-xl);
}

/* View Toggle Toolbar */
.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-md);
  gap: var(--sp-md);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm) var(--sp-lg);
  margin-bottom: var(--sp-md);
}
.filter-bar:empty { display: none; }
.filter-group {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}
.filter-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  margin-right: 2px;
}
.filter-options {
  display: flex;
  gap: 2px;
}
.filter-chip {
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Search Box */
.search-box {
  position: relative;
  flex: 0 1 260px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 30px;
  padding: 0 var(--sp-sm) 0 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }
.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  color: var(--text-muted);
  background: var(--bg);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.view-btn + .view-btn { border-left: 1px solid var(--border); }
.view-btn:hover { color: var(--text); background: var(--bg-hover); }
.view-btn.active { color: var(--accent); background: var(--accent-light); }

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-lg);
}

.asset-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  position: relative;
  overflow: hidden;
  min-height: 160px;
}
.asset-card:hover { 
  border-color: var(--accent); 
  box-shadow: var(--shadow-md); 
  transform: translateY(-2px);
}
.asset-card.selected { 
  border-color: var(--accent); 
  background: var(--accent-light); 
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-sm);
}
.card-title-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.3;
}
.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.card-primary-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Investor Badge */
.investor-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.investor-badge.pi-only {
  background: #fdf3f5;
  color: #c92a2a;
  border-color: #fcc2d7;
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md) var(--sp-sm); /* tighter horizontal gap */
  border-top: 1px solid var(--border-light);
  padding-top: var(--sp-md);
}
.metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.metric-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: capitalize;
}
.metric-val {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

/* Asset name cell */
.cell-asset { display: flex; flex-direction: column; gap: 2px; }
.cell-asset-name { font-weight: 600; font-size: 0.8125rem; }
.cell-asset-sub { font-size: 0.6875rem; color: var(--text-muted); }

/* YTM / change cells */
.cell-positive { color: var(--accent); font-weight: 500; }
.cell-negative { color: var(--risk-p5); font-weight: 500; }

/* Risk badges */
.risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 22px;
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
}
.risk-badge.p1 { background: var(--risk-p1); }
.risk-badge.p2 { background: var(--risk-p2); }
.risk-badge.p3 { background: var(--risk-p3); color: #333; }
.risk-badge.p4 { background: var(--risk-p4); }
.risk-badge.p5 { background: var(--risk-p5); }

/* Trading & Structure badges */
.trading-badge, .structure-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.trading-badge {
  color: #495057;
  border: 1px dotted #ced4da;
}
.structure-badge {
  color: #5c7cfa;
  background: #edf2ff;
}

/* Card Footer */
.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}
.card-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* ── Table View ──────────────────────────────────────────── */
.asset-table-wrap {
  overflow-x: auto;
}
.asset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.asset-table th {
  position: sticky;
  top: 0;
  background: var(--bg-subtle);
  text-align: left;
  padding: var(--sp-sm) var(--sp-md);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.asset-table td {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-table tbody tr {
  cursor: pointer;
  transition: background var(--transition);
}
.asset-table tbody tr:hover {
  background: var(--bg-hover);
}
.asset-table tbody tr.selected {
  background: var(--accent-light);
}

/* Empty state */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px var(--sp-xl);
  color: var(--text-muted);
}

/* ── Detail Panel ────────────────────────────────────────── */
.detail-panel {
  width: var(--detail-w);
  min-width: var(--detail-w);
  border-left: 1px solid var(--border);
  background: var(--bg);
  overflow-y: auto;
}

.detail-content { padding: var(--sp-xl); }

/* Placeholder */
.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
  height: 300px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Detail header */
.detail-header { margin-bottom: var(--sp-xl); }
.detail-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.detail-subtitle {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: var(--sp-sm);
}
.detail-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-sm);
}

/* Risk pill in detail header */
.detail-risk-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}
.risk-pill-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Trade button */
.btn-trade {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}
.btn-trade:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Summary cards row */
.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xl);
}
.summary-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-md) var(--sp-sm);
  text-align: center;
}
.summary-card-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.summary-card-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.summary-card.risk { border-color: transparent; }
.summary-card.risk .summary-card-value { font-weight: 700; }

/* Structure Disclosure */
.detail-structure {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-xl);
}
.structure-heading {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.structure-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.structure-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.8125rem;
}
.structure-label {
  color: var(--text-secondary);
  white-space: nowrap;
}
.structure-val {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

/* Layer Pills */
.layer-desc .structure-val {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.layer-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.layer-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Detail fields list */
.detail-fields { list-style: none; }
.detail-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--border-light);
  gap: var(--sp-md);
}
.detail-field-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 140px;
}
.detail-field-value {
  font-size: 0.8125rem;
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}
.detail-field-value a {
  color: var(--accent);
  transition: color var(--transition);
}
.detail-field-value a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Risk styling in detail */
.risk-text { font-weight: 600; }
.risk-text.p1 { color: var(--risk-p1); }
.risk-text.p2 { color: var(--risk-p2); }
.risk-text.p3 { color: var(--risk-p3); }
.risk-text.p4 { color: var(--risk-p4); }
.risk-text.p5 { color: var(--risk-p5); }

/* ── Detail Panel Tabs ───────────────────────────────────── */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-md);
}
.detail-tab {
  padding: var(--sp-sm) var(--sp-md);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font);
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Detail Header Actions (Trade + Expand) ─────────────── */
.detail-header-actions {
  float: right;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.btn-expand {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-expand:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Documents Section ──────────────────────────────────── */
.detail-documents {
  margin-top: var(--sp-xl);
}
.documents-heading {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.documents-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.document-item { }
.document-link {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  transition: background var(--transition);
  text-decoration: none;
  color: var(--text);
}
.document-link:hover {
  background: var(--bg-hover);
}
.document-icon {
  flex-shrink: 0;
  color: #e74c3c;
}
.document-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.document-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.document-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.document-download {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition);
}
.document-link:hover .document-download {
  color: var(--accent);
}

/* ── Market Overview Page ─────────────────────────────── */
.market-overview-page {
  position: fixed;
  top: var(--nav-h);
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  overflow-y: auto;
  padding: var(--sp-lg) var(--sp-xl);
  background: var(--bg-secondary);
}
/* Row-based layout */
.mo-row {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
  align-items: stretch;
}
.mo-row-left { flex: 3; min-width: 0; display: flex; flex-direction: column; }
.mo-row-right { flex: 2; min-width: 0; display: flex; flex-direction: column; }
.mo-row-left-stack,
.mo-row-right-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.mo-section-fill {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.mo-section-fill .mo-ticker-grid { flex: 1; }
.mo-section-grow { flex: 1; display: flex; flex-direction: column; }
.mo-section-grow .mo-news-list,
.mo-section-grow .mo-listing-list,
.mo-section-grow .mo-roadshow-list { flex: 1; }

/* Banner */
.mo-banner-area {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.mo-banner-track {
  position: relative;
  flex: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  min-height: 180px;
}
.mo-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.mo-banner-img.active {
  opacity: 1;
}
.mo-banner-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.mo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background var(--transition);
}
.mo-dot.active { background: #fff; }

/* Sections */
.mo-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.mo-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--border);
}
.mo-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.mo-section-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* News items */
.mo-news-list { padding: 0; }
.mo-news-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-xs, 4px);
  padding: 6px var(--sp-md);
  border-bottom: 1px solid var(--border-light, #f5f5f5);
  font-size: 0.8125rem;
  color: var(--text);
  transition: background var(--transition);
  cursor: pointer;
}
.mo-news-item:last-child { border-bottom: none; }
.mo-news-item:hover { background: var(--bg-hover); }
.mo-news-bullet {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}
.mo-news-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mo-news-date {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: var(--sp-sm);
}

/* Ticker grid */
.mo-ticker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
}
.mo-ticker-card {
  background: var(--bg);
  padding: var(--sp-sm) var(--sp-xs, 4px);
  text-align: center;
}
.mo-ticker-time {
  font-size: 0.625rem;
  color: var(--text-muted);
}
.mo-ticker-name {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.mo-ticker-change {
  font-size: 0.625rem;
  margin-bottom: 2px;
}
.mo-ticker-value {
  font-size: 0.8125rem;
  font-weight: 700;
}
.mo-up .mo-ticker-change,
.mo-up .mo-ticker-value { color: var(--positive, #16a34a); }
.mo-down .mo-ticker-change,
.mo-down .mo-ticker-value { color: var(--negative, #dc2626); }
.mo-flat .mo-ticker-change { color: var(--text-muted); }
.mo-flat .mo-ticker-value { color: var(--text); }

/* Listings */
.mo-listing-list { padding: 0; }
.mo-listing-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--border-light, #f5f5f5);
  transition: background var(--transition);
  cursor: pointer;
}
.mo-listing-item:last-child { border-bottom: none; }
.mo-listing-item:hover { background: var(--bg-hover); }
.mo-listing-icon {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.mo-listing-info { flex: 1; min-width: 0; }
.mo-listing-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}
.mo-listing-detail {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.mo-listing-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Roadshow */
.mo-roadshow-list { padding: 0; }
.mo-roadshow-item {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--border-light, #f5f5f5);
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}
.mo-roadshow-item:last-child { border-bottom: none; }
.mo-roadshow-item:hover { background: var(--bg-hover); }
.mo-roadshow-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  padding-right: 70px;
}
.mo-roadshow-speaker {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.mo-roadshow-org {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.mo-roadshow-date {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.mo-video-badge {
  position: absolute;
  top: var(--sp-sm);
  right: var(--sp-md);
  background: var(--accent);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* Sidebar top-level active state */
.cat-header-all.active {
  color: var(--accent);
  background: var(--bg-hover);
}

@media (max-width: 960px) {
  .mo-row { flex-direction: column; }
  .mo-ticker-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .market-overview-page { left: 0; padding: var(--sp-md); }
  .mo-ticker-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Market Data Page ──────────────────────────────────── */
.market-data-page {
  position: fixed;
  top: var(--nav-h);
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  padding: var(--sp-lg) var(--sp-xl);
  overflow-y: auto;
  background: var(--bg-secondary);
}
.md-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-md);
}
.md-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm);
}
.md-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  min-width: 0;
}
.md-panel-calendar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--sp-sm);
}
.md-panel-wide {
  grid-column: 1 / -1;
}
.md-panel-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.md-panel-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.md-panel-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.md-table th {
  text-align: left;
  padding: 4px 8px;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.md-table td {
  padding: 4px 8px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light, #f0f0f0);
  font-variant-numeric: tabular-nums;
}
.md-grid .md-table td { white-space: nowrap; }
.md-table tr:last-child td { border-bottom: none; }
.md-table tr:hover { background: var(--bg-hover); }
.md-positive { color: var(--positive, #16a34a); }
.md-negative { color: var(--negative, #dc2626); }
.md-bond-yield {
  display: block;
  font-weight: 500;
}
.md-bond-chg {
  display: block;
  font-size: 0.625rem;
}
/* Calendar-specific */
.md-table-calendar td:nth-child(4),
.md-table-calendar td:nth-child(5),
.md-table-calendar td:nth-child(6) { text-align: right; white-space: nowrap; }
.md-table-calendar th:nth-child(4),
.md-table-calendar th:nth-child(5),
.md-table-calendar th:nth-child(6) { text-align: right; }
.md-cal-time { font-weight: 600; color: var(--text-secondary); }
.md-cal-highlight { background: rgba(16,185,129,0.04); }
.md-cal-event-hl { font-weight: 600; color: var(--accent); }
.md-pending { color: var(--text-muted); font-style: italic; }

@media (max-width: 1100px) {
  .md-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .market-data-page { left: 0; padding: var(--sp-md); }
  .md-grid { grid-template-columns: 1fr; }
}

/* ── Product Dedicated Page ─────────────────────────────── */
.product-page {
  margin-top: var(--nav-h);
  margin-left: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  background: var(--bg);
}
.product-page-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--sp-xl) var(--sp-xl) 60px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xl);
  font-size: 0.8125rem;
}
.breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
.breadcrumb-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
.breadcrumb-sep {
  color: var(--text-muted);
}
.breadcrumb-current {
  color: var(--text-secondary);
}

/* Product Page Summary Banner */
.pp-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-xl);
  padding: var(--sp-xl);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-xl);
}
.pp-summary-left {
  flex: 1;
  min-width: 0;
}
.pp-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.pp-subtitle {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: var(--sp-sm);
}
.pp-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-md);
}
.pp-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pp-summary-right {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-lg);
  flex-shrink: 0;
}
.pp-kpi {
  text-align: center;
}
.pp-kpi-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.pp-kpi-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.pp-trade {
  height: 40px;
  padding: 0 32px;
  font-size: 0.9375rem;
}

/* Product Page Two-Column Layout */
.pp-columns {
  display: flex;
  gap: var(--sp-xl);
  align-items: flex-start;
}
.pp-col-left {
  flex: 1;
  min-width: 0;
}
.pp-col-right {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-xl);
}
.pp-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 768px) {
  .pp-columns { flex-direction: column; }
  .pp-col-right { width: 100%; }
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive (optional, for smaller screens) ──────────── */
@media (max-width: 1200px) {
  :root { --detail-w: 320px; }
}
@media (max-width: 960px) {
  .detail-panel { display: none; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .app-body, .product-page, .market-data-page { margin-left: 0; }
}
