/* ═══════════════════════════════════════════════════════════════
   MINE MARKET TERMINAL - Bloomberg of Mining
   All styles scoped under #terminal
   Bloomberg DNA: zero border-radius, crushed padding, monospace,
   dense rows, ALL CAPS labels. Mine Market brand colors.
   ═══════════════════════════════════════════════════════════════ */

/* ── Mobile gate ── */
#terminal .terminal-mobile-gate {
  display: none;
  text-align: center;
  padding: 80px 24px;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.6;
}
#terminal .terminal-mobile-gate .gate-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
  display: block;
}
#terminal .terminal-mobile-gate a {
  color: #d7b56d;
  text-decoration: none;
}
@media (max-width: 899px) {
  #terminal .terminal-shell { display: none !important; }
  #terminal .terminal-mobile-gate { display: block; }
}

/* ── Shell layout ── */
#terminal .terminal-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-family: 'SF Mono', 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: #cbd5e1;
  background: #0B0F1A;
}

/* ── Topbar ── */
#terminal .terminal-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 8px;
  background: #0f1320;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
  position: relative;
}
#terminal .terminal-topbar .topbar-search {
  flex: 1;
  max-width: 400px;
  height: 24px;
  background: #1a1f2e;
  border: 1px solid #333;
  border-radius: 0;
  color: #f7f7fb;
  padding: 0 8px;
  font-size: 0.75rem;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  outline: none;
  transition: border-color 0.2s;
}
#terminal .terminal-topbar .topbar-search:focus {
  border-color: #d7b56d;
}
#terminal .terminal-topbar .topbar-search::placeholder {
  color: #4a5568;
}
#terminal .terminal-topbar .topbar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #d7b56d;
  font-weight: 700;
  white-space: nowrap;
}
#terminal .terminal-topbar .topbar-exit {
  background: rgba(215, 181, 109, 0.1);
  border: 1px solid #d7b56d55;
  color: #d7b56d;
  font-size: 0.72rem;
  padding: 2px 12px;
  border-radius: 0;
  cursor: pointer;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  transition: all 0.15s;
  margin-left: auto;
  height: 26px;
}
#terminal .terminal-topbar .topbar-exit:hover {
  color: #0B0F1A;
  background: #d7b56d;
  border-color: #d7b56d;
}

/* ── Morning Briefing ── */
#terminal .terminal-briefing {
  margin-bottom: 0;
}
#terminal .briefing-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
#terminal .briefing-title {
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #f7f7fb;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#terminal .briefing-date {
  font-size: 0.68rem;
  color: #4a5568;
}
#terminal .briefing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
}
#terminal .briefing-card {
  background: #0f1320;
  border: 1px solid #333;
  border-radius: 0;
  padding: 6px 8px;
}
#terminal .briefing-card-wide {
  grid-column: span 2;
}
#terminal .briefing-card-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}
#terminal .briefing-card-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f7f7fb;
  line-height: 1.2;
  margin-bottom: 2px;
}
#terminal .briefing-card-detail {
  font-size: 0.7rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#terminal .briefing-movers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
#terminal .briefing-mover {
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
#terminal .briefing-mover-sym {
  font-weight: 600;
  font-size: 0.75rem;
}
#terminal .briefing-mover-price {
  color: #cbd5e1;
  font-size: 0.75rem;
}
#terminal .briefing-deals {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#terminal .briefing-deal {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Briefing sector snapshot */
#terminal .briefing-sector-row {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
}
#terminal .briefing-sector-row span {
  color: #94a3b8;
}

/* ── Mining News Feed ── */
#terminal .news-list {
  padding: 0;
}
#terminal .news-row {
  border-bottom: 1px solid #262626;
  transition: background 0.12s;
}
#terminal .news-row:last-child {
  border-bottom: none;
}
#terminal .news-row:hover {
  background: rgba(215,181,109,0.04);
}
#terminal .news-row-main {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  min-height: 20px;
}
#terminal .news-time {
  font-size: 0.65rem;
  color: #4a5568;
  white-space: nowrap;
  min-width: 42px;
}
#terminal .news-headline {
  font-size: 0.75rem;
  color: #cbd5e1;
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
#terminal .news-headline:hover {
  color: #f7f7fb;
  text-decoration: underline;
}
#terminal .news-headline-recent {
  color: #d7b56d;
  font-weight: 600;
}
#terminal .news-headline-recent:hover {
  color: #e8ca8a;
}
#terminal .news-source {
  font-size: 0.58rem;
  color: #4a5568;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
#terminal .news-tag {
  display: inline-block;
  padding: 0px 4px;
  border-radius: 0;
  font-size: 0.58rem;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
#terminal .news-summary {
  display: none;
  padding: 0 8px 4px 56px;
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.45;
}
#terminal .news-row:hover .news-summary {
  display: block;
}

/* ── Ticker ── */
#terminal .terminal-ticker {
  display: flex;
  align-items: center;
  height: 22px;
  background: #0a0e18;
  border-bottom: 1px solid #333;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
#terminal .terminal-ticker .ticker-track {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
  animation: tickerScroll 40s linear infinite;
  padding-left: 100%;
}
#terminal .terminal-ticker:hover .ticker-track {
  animation-play-state: paused;
}
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
#terminal .ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: #94a3b8;
}
#terminal .ticker-item .ticker-symbol {
  color: #f7f7fb;
  font-weight: 600;
}
#terminal .ticker-item .ticker-price {
  color: #e2e8f0;
}
#terminal .ticker-item .ticker-change {
  font-weight: 600;
}
#terminal .ticker-item .ticker-change.up { color: #22c55e; }
#terminal .ticker-item .ticker-change.down { color: #ef4444; }
#terminal .ticker-item .ticker-change.flat { color: #64748b; }
#terminal .ticker-sep {
  color: #333;
  font-size: 0.55rem;
}

/* ── Workspace (main + map rail) ── */
#terminal .terminal-workspace {
  display: grid;
  grid-template-columns: 1fr 40px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
#terminal .terminal-workspace.map-expanded {
  grid-template-columns: 1fr 360px;
}

/* ── Main panel ── */
#terminal .terminal-main {
  overflow: hidden;
  padding: 4px;
  min-height: 0;
}

/* ── Terminal grid (no-scroll Bloomberg layout) ── */
#terminal .tg {
  display: grid;
  grid-template-columns: 0.6fr 0.7fr 1.7fr;
  grid-template-rows: auto 1fr 1fr;
  grid-template-areas:
    "briefing  briefing  briefing"
    "prices    chart     screener"
    "news      announce  deals";
  gap: 4px;
  height: 100%;
  min-height: 0;
}
#terminal .tg-briefing  { grid-area: briefing; }
#terminal .tg-prices    { grid-area: prices;   min-height: 0; overflow: hidden; }
#terminal .tg-chart     { grid-area: chart;    min-height: 0; overflow: hidden; }
#terminal .tg-screener  { grid-area: screener; min-height: 0; overflow: hidden; }
#terminal .tg-news      { grid-area: news;     min-height: 0; overflow: hidden; }
#terminal .tg-announce  { grid-area: announce; min-height: 0; overflow: hidden; }
#terminal .tg-deals     { grid-area: deals;    min-height: 0; overflow: hidden; }

/* ── Commodity price table ── */
#terminal .price-table-wrap {
  background: #0f1320;
  border: 1px solid #333;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 0;
}
#terminal .price-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-bottom: 1px solid #333;
}
#terminal .price-table-header h3 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f7f7fb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
}
#terminal .price-table-header .price-updated {
  font-size: 0.62rem;
  color: #4a5568;
}
#terminal .price-table {
  width: 100%;
  border-collapse: collapse;
}
#terminal .price-table th {
  text-align: left;
  padding: 3px 8px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #4a5568;
  font-weight: 600;
  border-bottom: 1px solid #333;
  background: rgba(255,255,255,0.02);
}
#terminal .price-table th.right,
#terminal .price-table td.right {
  text-align: right;
}
#terminal .price-table td {
  padding: 3px 8px;
  font-size: 0.75rem;
  color: #e2e8f0;
  border-bottom: 1px solid #1e1e1e;
  height: 20px;
}
#terminal .price-table tr:last-child td {
  border-bottom: none;
}
#terminal .price-table tr:hover td {
  background: rgba(215,181,109,0.04);
}
#terminal .price-table .metal-name {
  font-weight: 500;
  color: #f7f7fb;
}
#terminal .price-table .metal-icon {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 0;
  margin-right: 6px;
}
#terminal .price-change-up { color: #22c55e; }
#terminal .price-change-down { color: #ef4444; }
#terminal .price-change-flat { color: #64748b; }

/* ── Performance bar chart ── */
#terminal #terminal-perf-bars {
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
}

/* ── Map rail ── */
#terminal .terminal-map-rail {
  background: #0a0e18;
  border-left: 1px solid #333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s;
}
#terminal .terminal-map-rail .map-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}
#terminal .terminal-map-rail .map-rail-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #d7b56d;
  font-weight: 600;
}
#terminal .terminal-map-rail .map-rail-toggle {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
  border-radius: 0;
  transition: color 0.15s;
}
#terminal .terminal-map-rail .map-rail-toggle:hover {
  color: #d7b56d;
}
#terminal .terminal-map-container {
  flex: 1;
  min-height: 0;
  position: relative;
}
/* Collapsed state (default) */
#terminal .terminal-map-rail.collapsed .map-rail-title,
#terminal .terminal-map-rail.collapsed .terminal-map-container {
  display: none;
}
#terminal .terminal-map-rail.collapsed .map-rail-header {
  flex-direction: column;
  padding: 6px 4px;
}

/* ── Dense table (shared: screener, deals, etc) ── */
#terminal .terminal-table-wrap {
  background: #0f1320;
  border: 1px solid #333;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 0;
}
#terminal .terminal-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-bottom: 1px solid #333;
}
#terminal .terminal-table-header h3 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f7f7fb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
}
#terminal .terminal-table-filter {
  height: 24px;
  background: #1a1f2e;
  border: 1px solid #333;
  border-radius: 0;
  color: #f7f7fb;
  padding: 0 6px;
  font-size: 0.7rem;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  outline: none;
  width: 200px;
}
#terminal .terminal-table-filter:focus {
  border-color: #d7b56d;
}
#terminal .dense-table {
  width: 100%;
  border-collapse: collapse;
}
#terminal .dense-table th {
  text-align: left;
  padding: 3px 8px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #4a5568;
  font-weight: 600;
  border-bottom: 1px solid #333;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
#terminal .dense-table th:hover {
  color: #d7b56d;
}
#terminal .dense-table th .sort-arrow {
  font-size: 0.55rem;
  margin-left: 3px;
  opacity: 0.4;
}
#terminal .dense-table th .sort-arrow.active {
  opacity: 1;
  color: #d7b56d;
}
#terminal .dense-table td {
  padding: 2px 6px;
  font-size: 0.7rem;
  color: #cbd5e1;
  border-bottom: 1px solid #1e1e1e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  height: 20px;
}
#terminal .dense-table tr {
  cursor: pointer;
  transition: background 0.1s;
}
#terminal .dense-table tbody tr:hover td {
  background: rgba(215,181,109,0.06);
}
#terminal .dense-table .badge {
  display: inline-block;
  padding: 0px 5px;
  border-radius: 0;
  font-size: 0.62rem;
  font-weight: 600;
}
#terminal .dense-table .badge-gold { background: rgba(215,181,109,0.15); color: #d7b56d; }
#terminal .dense-table .badge-blue { background: rgba(59,130,246,0.15); color: #60a5fa; }
#terminal .dense-table .badge-green { background: rgba(34,197,94,0.15); color: #22c55e; }
#terminal .dense-table .badge-purple { background: rgba(168,85,247,0.15); color: #a855f7; }
#terminal .dense-table .mono {
  font-size: 0.7rem;
}

/* ── ASX Announcements panel ── */
#terminal .announce-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  padding: 3px 8px;
  border-bottom: 1px solid #1e1e1e;
  font-size: 0.72rem;
  color: #cbd5e1;
  transition: background 0.1s;
  cursor: pointer;
  text-decoration: none;
}
#terminal .announce-row:hover {
  background: rgba(215,181,109,0.06);
}
#terminal .announce-time {
  font-size: 0.62rem;
  color: #4a5568;
  min-width: 36px;
  flex-shrink: 0;
  padding-top: 1px;
}
#terminal .announce-code {
  font-size: 0.65rem;
  font-weight: 700;
  color: #d7b56d;
  min-width: 32px;
  flex-shrink: 0;
}
#terminal .announce-header {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd5e1;
}
#terminal .announce-row[data-sensitive="true"] .announce-header {
  color: #f7f7fb;
  font-weight: 500;
}
#terminal .announce-type-badge {
  display: inline-block;
  padding: 0 4px;
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  border: 1px solid;
  white-space: nowrap;
}
#terminal .announce-type-badge.type-drill-results { color: #22c55e; border-color: #22c55e44; background: #22c55e11; }
#terminal .announce-type-badge.type-resource-update { color: #d7b56d; border-color: #d7b56d44; background: #d7b56d11; }
#terminal .announce-type-badge.type-quarterly { color: #60a5fa; border-color: #60a5fa44; background: #60a5fa11; }
#terminal .announce-type-badge.type-financial { color: #818cf8; border-color: #818cf844; background: #818cf811; }
#terminal .announce-type-badge.type-capital-raise { color: #f472b6; border-color: #f472b644; background: #f472b611; }
#terminal .announce-type-badge.type-trading-halt { color: #ef4444; border-color: #ef444444; background: #ef444411; }
#terminal .announce-type-badge.type-insider { color: #fbbf24; border-color: #fbbf2444; background: #fbbf2411; }
#terminal .announce-type-badge.type-presentation { color: #94a3b8; border-color: #94a3b844; background: #94a3b811; }
#terminal .announce-type-badge.type-production { color: #6ee7b7; border-color: #6ee7b744; background: #6ee7b711; }
#terminal .announce-type-badge.type-study { color: #c084fc; border-color: #c084fc44; background: #c084fc11; }
#terminal .announce-type-badge.type-general { color: #64748b; border-color: #64748b44; background: #64748b11; }
#terminal .announce-sensitive-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  margin-top: 5px;
  title: 'Market sensitive';
}

/* ── Scrollbar (terminal-specific) ── */
#terminal .terminal-main::-webkit-scrollbar {
  width: 5px;
}
#terminal .terminal-main::-webkit-scrollbar-track {
  background: transparent;
}
#terminal .terminal-main::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 0;
}
#terminal .terminal-main::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ── Command palette ── */
#terminal .cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  backdrop-filter: blur(4px);
}
#terminal .cmd-palette {
  background: #0f1320;
  border: 1px solid #d7b56d;
  border-radius: 0;
  width: 560px;
  max-width: 90vw;
  box-shadow: 0 16px 64px rgba(0,0,0,0.6);
  overflow: hidden;
}
#terminal .cmd-input {
  width: 100%;
  height: 36px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #333;
  color: #f7f7fb;
  font-size: 0.82rem;
  padding: 0 12px;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  outline: none;
  box-sizing: border-box;
}
#terminal .cmd-input::placeholder { color: #4a5568; }
#terminal .cmd-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 0;
}
#terminal .cmd-item {
  padding: 6px 12px;
  font-size: 0.78rem;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.1s;
}
#terminal .cmd-item:hover,
#terminal .cmd-item.active {
  background: rgba(215,181,109,0.08);
  color: #f7f7fb;
}
#terminal .cmd-hint {
  padding: 4px 12px;
  font-size: 0.62rem;
  color: #4a5568;
  border-top: 1px solid #333;
  text-align: center;
}

/* ── Search dropdown ── */
#terminal .search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-width: 420px;
  max-height: 360px;
  overflow-y: auto;
  background: #0f1320;
  border: 1px solid #d7b56d;
  border-radius: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 100;
  display: none;
  margin-top: 2px;
}
#terminal .search-category {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #4a5568;
  font-weight: 600;
  padding: 6px 8px 2px;
}
#terminal .search-result-item {
  padding: 4px 8px;
  font-size: 0.75rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 5px;
}
#terminal .search-result-item:hover,
#terminal .search-result-item.active {
  background: rgba(215,181,109,0.08);
}
#terminal .search-empty {
  padding: 12px 8px;
  font-size: 0.75rem;
  color: #4a5568;
  text-align: center;
}

/* ── Deep Dive view (fills main panel when visible) ── */
#terminal .terminal-deepdive {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}
#terminal .dd-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}
#terminal .dd-back {
  background: none;
  border: 1px solid #333;
  color: #94a3b8;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 0;
  cursor: pointer;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  text-transform: uppercase;
  transition: all 0.15s;
  white-space: nowrap;
  height: 24px;
}
#terminal .dd-back:hover { color: #f7f7fb; border-color: #d7b56d; }
#terminal .dd-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f7f7fb;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
#terminal .dd-meta {
  font-size: 0.68rem;
  color: #64748b;
  margin-left: auto;
  white-space: nowrap;
}
#terminal .dd-tabs {
  display: flex;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}
#terminal .dd-tab {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
#terminal .dd-tab:hover { color: #94a3b8; }
#terminal .dd-tab.active {
  color: #d7b56d;
  border-bottom-color: #d7b56d;
}
#terminal .dd-panels {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 8px 0;
}
#terminal .dd-panel { display: none; }
#terminal .dd-panel.active { display: block; }

/* Deep dive summary cards */
#terminal .dd-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 4px;
  margin-bottom: 8px;
}
#terminal .dd-summary-card {
  background: #0f1320;
  border: 1px solid #333;
  border-radius: 0;
  padding: 6px 8px;
}
#terminal .dd-summary-card .dd-sc-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #4a5568;
  margin-bottom: 3px;
}
#terminal .dd-summary-card .dd-sc-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f7f7fb;
}
#terminal .dd-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 0;
  font-size: 0.65rem;
  font-weight: 600;
}
#terminal .dd-status-active { background: rgba(34,197,94,0.15); color: #22c55e; }
#terminal .dd-status-pending { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* Deep dive loading skeleton */
#terminal .dd-loading {
  text-align: center;
  padding: 24px;
  color: #4a5568;
  font-size: 0.78rem;
}
#terminal .dd-loading .skel-bar {
  height: 12px;
  margin: 6px auto;
  max-width: 300px;
}
#terminal .dd-empty {
  text-align: center;
  padding: 20px;
  color: #4a5568;
  font-size: 0.78rem;
}
/* Deep dive section content */
#terminal .dd-panel .detailed-section,
#terminal .dd-panel .collapsible-section {
  margin-bottom: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid #333;
  border-radius: 0;
  overflow: hidden;
}
#terminal .dd-panel .detailed-section-title,
#terminal .dd-panel .collapsible-header {
  font-size: 0.75rem;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
#terminal .dd-panel .collapsible-content {
  padding: 0 8px 8px;
}
#terminal .dd-panel table { font-size: 0.72rem; }
#terminal .dd-panel td,
#terminal .dd-panel th { padding: 3px 6px !important; font-size: 0.72rem; }

/* ── Loading skeleton ── */
#terminal .skel {
  background: linear-gradient(90deg, #1a1f2e 25%, #242a3d 50%, #1a1f2e 75%);
  background-size: 200% 100%;
  animation: skelPulse 1.5s ease-in-out infinite;
  border-radius: 0;
}
@keyframes skelPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Tour overlay ── */
.tt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}
.tt-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 9997;
  pointer-events: auto;
  transition: opacity 0.3s;
}
.tt-spotlight {
  position: fixed;
  z-index: 9999;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.7), 0 0 24px 4px rgba(215,181,109,0.3);
  pointer-events: none;
  transition: left 0.35s cubic-bezier(0.4,0,0.2,1), top 0.35s cubic-bezier(0.4,0,0.2,1), width 0.35s cubic-bezier(0.4,0,0.2,1), height 0.35s cubic-bezier(0.4,0,0.2,1);
}
.tt-tooltip {
  position: fixed;
  z-index: 10000;
  background: #0f1320;
  border: 1px solid #d7b56d;
  border-radius: 0;
  padding: 14px 16px 12px;
  width: 340px;
  max-width: 90vw;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(8px);
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
}
.tt-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.tt-tooltip .tour-step-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #d7b56d;
  font-weight: 700;
  margin-bottom: 6px;
}
.tt-tooltip .tour-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f7f7fb;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}
.tt-tooltip .tour-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 12px;
}
.tt-tooltip .tour-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tt-tooltip .tour-dots {
  display: flex;
  gap: 4px;
}
.tt-tooltip .tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: #333;
  transition: background 0.2s;
}
.tt-tooltip .tour-dot.active {
  background: #d7b56d;
}
.tt-tooltip .tour-dot.done {
  background: #64748b;
}
.tt-tooltip .tour-btns {
  display: flex;
  gap: 4px;
}
.tt-tooltip .tour-btn {
  padding: 4px 10px;
  border-radius: 0;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  text-transform: uppercase;
  transition: all 0.15s;
  border: none;
  height: 24px;
}
.tt-tooltip .tour-btn-skip {
  background: none;
  color: #4a5568;
  border: 1px solid #333;
}
.tt-tooltip .tour-btn-skip:hover {
  color: #94a3b8;
  border-color: #555;
}
.tt-tooltip .tour-btn-back {
  background: none;
  color: #94a3b8;
  border: 1px solid #333;
}
.tt-tooltip .tour-btn-back:hover {
  color: #f7f7fb;
  border-color: #555;
}
.tt-tooltip .tour-btn-next {
  background: rgba(215,181,109,0.15);
  color: #d7b56d;
  border: 1px solid rgba(215,181,109,0.3);
}
.tt-tooltip .tour-btn-next:hover {
  background: rgba(215,181,109,0.25);
}
/* Tour welcome card */
.tt-welcome {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: #0f1320;
  border: 1px solid #d7b56d;
  border-radius: 0;
  padding: 28px 32px;
  width: 420px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 20px 80px rgba(0,0,0,0.7);
  pointer-events: auto;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
}
.tt-welcome .tt-welcome-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}
.tt-welcome .tt-welcome-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f7f7fb;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tt-welcome .tt-welcome-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 20px;
}
.tt-welcome .tt-welcome-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.tt-welcome .tt-welcome-start {
  padding: 6px 20px;
  background: rgba(215,181,109,0.15);
  border: 1px solid rgba(215,181,109,0.3);
  color: #d7b56d;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 0;
  cursor: pointer;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  text-transform: uppercase;
  transition: all 0.15s;
  height: 28px;
}
.tt-welcome .tt-welcome-start:hover {
  background: rgba(215,181,109,0.25);
}
.tt-welcome .tt-welcome-dismiss {
  padding: 6px 14px;
  background: none;
  border: 1px solid #333;
  color: #64748b;
  font-size: 0.75rem;
  border-radius: 0;
  cursor: pointer;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  text-transform: uppercase;
  transition: all 0.15s;
  height: 28px;
}
.tt-welcome .tt-welcome-dismiss:hover {
  color: #94a3b8;
  border-color: #555;
}
/* Restart tour button in topbar */
#terminal .tour-restart-btn {
  background: none;
  border: 1px solid #333;
  color: #4a5568;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 0;
  cursor: pointer;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  text-transform: uppercase;
  transition: all 0.15s;
  white-space: nowrap;
  height: 24px;
}
#terminal .tour-restart-btn:hover {
  color: #d7b56d;
  border-color: #d7b56d;
}

/* ── Screener/Watchlist tab toggle ── */
#terminal .screener-tabs {
  display: flex;
  gap: 0;
  align-items: stretch;
}
#terminal .screener-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #4a5568;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px 4px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
#terminal .screener-tab:hover {
  color: #94a3b8;
}
#terminal .screener-tab.active {
  color: #d7b56d;
  border-bottom-color: #d7b56d;
}
#terminal .screener-tab .wl-badge {
  font-size: 0.58rem;
  color: #64748b;
  font-weight: 400;
}
#terminal .screener-tab.active .wl-badge {
  color: #d7b56d88;
}

/* ── Star cells in screener ── */
#terminal .wl-star-cell {
  width: 20px;
  padding: 0 2px !important;
  text-align: center;
}
#terminal .wl-star {
  cursor: pointer;
  font-size: 0.72rem;
  color: #333;
  transition: color 0.12s;
  user-select: none;
}
#terminal .wl-star:hover {
  color: #d7b56d88;
}
#terminal .wl-star.watched {
  color: #d7b56d;
}

/* ── Deep dive watchlist button ── */
#terminal .dd-watchlist-btn {
  background: none;
  border: 1px solid #333;
  color: #333;
  font-size: 0.85rem;
  padding: 0 6px;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
  height: 22px;
}
#terminal .dd-watchlist-btn:hover {
  border-color: #d7b56d88;
  color: #d7b56d88;
}
#terminal .dd-watchlist-btn.watched {
  color: #d7b56d;
  border-color: #d7b56d44;
}

/* ── Watchlist empty state ── */
#terminal .wl-empty {
  text-align: center;
  color: #4a5568;
  padding: 32px 16px;
  font-size: 0.75rem;
  line-height: 1.6;
}
#terminal .wl-empty-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: #333;
}
#terminal .screener-filters-wrap {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

/* About card description scrollbar */
#terminal .dd-about-text::-webkit-scrollbar { width: 4px; }
#terminal .dd-about-text::-webkit-scrollbar-track { background: #1a1f2e; }
#terminal .dd-about-text::-webkit-scrollbar-thumb { background: #333; }
