/* Readable foregrounds over the original, gently faded NOVI atmosphere. */
:root { color-scheme: dark; --novi-ink: #f0f6fc; --novi-muted: #bfcede; --novi-cyan: #83e5ff; --novi-green: #88efb2; --novi-red: #ff9aac; --novi-gold: #ffe095; }
html { font-size: 16px; scroll-padding-top: 80px; }
/* Let two-finger gestures magnify the page, including charts and windows. */
html, body, body :is(.panel,.dashboard-window,.novi-workspace,canvas,.workspace-tabs) { touch-action: pan-x pan-y pinch-zoom; }
body { font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.5; color: var(--novi-ink); }
#noviJarvisAtmosphere, .jarvis-coins { opacity: .68; }
#bg { opacity: .6; }
body .panel, body .novi-control-workspace .control-panel { background: rgba(7, 23, 38, .94) !important; border-color: #38617d; backdrop-filter: none; }
body .dashboard-window > .window-heading { padding: 10px 12px; border-radius: 8px; background: rgba(7, 23, 38, .90); }
body :is(.novi-brief-metrics, .novi-brief-alerts, .news-card, .control-agent, .timeline-event) { background-color: #0b2133; }
body :is(h1,h2,h3,h4) { color: var(--novi-ink); line-height: 1.35; text-shadow: none; overflow-wrap: anywhere; }
body :is(.panel, .dashboard-window, .novi-workspace) :is(p,small,label,td,th,li,summary) { line-height: 1.5; }
body :is(.panel, .dashboard-window, .novi-workspace) :is(p,small,label) { color: var(--novi-muted); }
body :is(.row > span,.control-agent small,.agent-reason,.timeline-event small,.window-heading p,.window-heading small,.news-card span,.ledger-row time) { color: var(--novi-muted); }
body :is(.panel,.dashboard-window) a { color: var(--novi-cyan); text-underline-offset: .2em; }
body :is(.positive,.bullish,.grade-A) { color: var(--novi-green); }
body :is(.negative,.bearish,.grade-D) { color: var(--novi-red); }
body :is(.warning,.grade-C,.low-conviction-badge) { color: var(--novi-gold); }
body .novi-readable-text { font-size: var(--novi-readable-size) !important; }
body :is(button,input,select,textarea) { font-family: inherit; }
body :is(input,select,textarea) { font-size: 16px !important; line-height: 1.4; color: var(--novi-ink); background-color: #091b2e; }
body :is(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid #83e5ff !important; outline-offset: 3px; }
body .workspace-tabs { min-height: 54px; align-items: center; overflow-y: hidden; }
body .workspace-tabs > button { min-height: 40px; font-size: 14px; line-height: 1.3; letter-spacing: .25px; }
body .workspace-tabs > button:not(.active) { color: #d3e8f5; background: #102a3d; }
body .workspace-tabs > button.active { color: #042012; background: #88efb2; border-color: #88efb2; box-shadow: none; }
body :is(.panel-head,.window-heading,.card-title) { flex-wrap: wrap; gap: 10px; }
body :is(.panel,.dashboard-window,.novi-workspace) { min-width: 0; }
body .novi-readable-window { overflow: auto; overscroll-behavior: auto; }
body .dashboard-window.novi-readable-window { padding: 14px; background: rgba(7, 23, 38, .92) !important; border: 1px solid #38617d; border-radius: 10px; }
body :is(.guided-brief-grid,.novi-brief-metrics) { grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); }
body .control-agent-matrix { grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); }
body .control-agent-title { flex-wrap: wrap; }
body .agent-grade { width: 30px; height: 30px; flex-shrink: 0; }
body :is(.guided-brief-grid,.control-agent-matrix) > * { min-width: 0; overflow-wrap: anywhere; }
body .novi-data-delayed { color: var(--novi-gold) !important; }
/* Venue states share .live with the floating price badge. Keep quote rows
   in normal flow, with mobile padding included in their full width. */
body .venue-rows > .venue-row {
  position: static;
  inset: auto;
  box-sizing: border-box;
  box-shadow: none;
  font-weight: normal;
}
body .whale-panel { box-sizing: border-box; max-width: 100%; }
body .whale-panel-head { flex-wrap: wrap; }
body .whale-live-dot { min-width: 0; overflow-wrap: anywhere; }
body .whale-live-dot[data-state]:not([data-state="live"]) { color: var(--novi-gold); }
body .whale-live-dot[data-state]:not([data-state="live"])::before { background: currentColor; box-shadow: none; }
body .whale-radar { height: auto; }
body .whale-radar > span { display: block; position: static; padding: 6px 8px; text-align: center; overflow-wrap: anywhere; }
body .whale-metrics :is(span,b) { white-space: normal; overflow-wrap: anywhere; }
@media(max-width:720px) {
  body { padding-top: 72px; }
  body .workspace-tabs { min-height: 62px; }
  body .workspace-tabs > button { font-size: 14px; min-height: 44px; }
  body :is(.control-grid,.guided-brief-grid,.novi-brief-metrics) { grid-template-columns: minmax(0,1fr); }
  body .window-heading { align-items: flex-start; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
}

/* Allow enlarged text to fit the available panel width. */
body :is(.novi-frontier-grid,.novi-portfolio-grid,.novi-portfolio-metrics,.control-heatmap,.novi-visual-grid,.novi-differentiator-cards,.novi-intelligence-lab) > * {
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
body .control-heatmap { grid-template-columns: repeat(4,minmax(0,1fr)); }
body .novi-sankey > div { grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) minmax(0,1fr); }
body .novi-sankey > div > * { min-width: 0; overflow-wrap: anywhere; }
body .novi-ledger-stats dd { overflow-wrap: anywhere; }
@media(max-width:720px) {
  body .novi-frontier-grid { grid-template-columns: minmax(0,1fr); }
  body .control-heatmap { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body .novi-portfolio-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body .novi-portfolio-grid { grid-template-columns: minmax(0,1fr); }
  body .novi-portfolio-grid article { grid-column: auto; }
  body :is(.novi-ledger-bar,.novi-ledger-stats) { min-width: 0; }
  body .novi-ledger-bar strong { white-space: normal; overflow-wrap: anywhere; }
}
@media(max-width:390px) {
  body .novi-portfolio-metrics { grid-template-columns: minmax(0,1fr); }
}

/* Content-sized windows: no reserved card height or nested vertical scrollers. */
body .panel:not(.chart-focus-mode),
body .dashboard-window:not(.chart-focus-mode) {
  height: auto !important;
  min-height: 0 !important;
  align-self: start;
}
body .novi-readable-window:not(.chart-focus-mode) {
  overflow: visible;
}
body :is(.grid,.bottom,.v7grid,.v11grid,.executive-brief,.review-tools-grid) {
  height: auto !important;
  min-height: 0 !important;
  align-items: start;
  align-content: start;
  grid-auto-rows: auto;
}
body .guided-investor-brief {
  padding: 12px !important;
  margin-bottom: 10px;
}
body .guided-brief-grid { gap: 8px; }
body .guided-brief-grid > div { padding: 8px; }
body .panel > :last-child { margin-bottom: 0; }
@media(max-width:720px) {
  body :is(.left,.center,.right1,.right2) { height: auto; min-height: 0; }
  body .dashboard-window { margin-bottom: 10px; }
  body .dashboard-window > .window-heading { padding: 8px 10px; margin-top: 8px; }
  /* Offscreen estimates and translated drag positions leave false gaps on phones. */
  body :is(.bottom,.live-verification-window,.fundamentals-window,.forecast-window,.wallet-window,.v7grid) {
    content-visibility: visible;
    contain-intrinsic-size: none;
  }
  body .panel.dashboard-draggable { transform: none; }
}

/* Compact phone navigation; swipe horizontally to reach more workspaces. */
/* Desktop windows share one gutter and use measured content heights. */
@media(min-width:721px) {
  body > :is(.dashboard-window,.novi-workspace,.guided-investor-brief,#noviGlobalBrand,#noviMultiAsset) {
    box-sizing: border-box;
    width: min(calc(100% - 32px),1920px) !important;
    max-width: calc(100% - 32px);
    margin: 0 auto 16px !important;
  }
  body :is(.grid,.bottom,.v7grid,.v11grid,.review-tools-grid) { gap: 16px !important; }
  body .grid { padding: 0; }
  body :is(.left,.center,.right1,.right2) { gap: 16px; min-width: 0; }
  body .dashboard-window > .window-heading { margin: 0 0 16px; padding: 12px 14px; }
  body .dashboard-window.novi-readable-window { padding: 16px; }
  body :is(.bottom,.live-verification-window,.fundamentals-window,.forecast-window,.wallet-window,.v7grid) {
    content-visibility: visible;
    contain-intrinsic-size: none;
  }
}

@media(max-width:720px) {
  html { scroll-padding-top: 52px; }
  body { padding-top: 52px; }
  body .workspace-tabs { min-height: 44px; padding: 5px 8px; gap: 6px; }
  body .workspace-tabs > button {
    min-height: 32px; padding: 6px 9px; font-size: 12px !important;
    line-height: 1.2; letter-spacing: 0; white-space: nowrap; flex: 0 0 auto;
  }
  body .workspace-tabs kbd { display: none; }
  body .ma-workspace-tabs {
    display: flex; flex-wrap: nowrap; gap: 6px; max-width: 100%;
    overflow-x: auto; padding: 4px 0 7px; scrollbar-width: thin;
  }
  body .ma-workspace-tabs > button {
    flex: 0 0 auto; min-height: 30px; padding: 6px 8px;
    font-size: 12px !important; line-height: 1.2; letter-spacing: 0;
    white-space: nowrap; border-radius: 7px;
  }
}

/* A compact chart needs its own parent, rather than the whole price card. */
body .pricebox > .price-chart-stage {
  position: relative;
  box-sizing: border-box;
  width: 100%; max-width: 100%; min-width: 0;
  height: 150px !important; min-height: 150px !important;
  margin-top: 14px;
}
body .pricebox .price-chart-stage > canvas#miniChart {
  display: block;
  position: absolute; inset: 0;
  width: 100% !important; max-width: 100%;
  height: 100% !important; margin: 0 !important;
}
@media(max-width:720px) {
  body .workspace-tabs {
    display: flex; flex-wrap: nowrap;
    box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  body .workspace-tabs > * { flex: 0 0 auto; }
  body .pricebox > .price-chart-stage { height: 170px !important; min-height: 170px !important; }
}

/* Sample accounts have long addresses; keep them within the wallet panel. */
body #walletSampleView,
body #walletSampleView .wallet-table-wrap { min-width: 0; max-width: 100%; }
body #walletSampleView .wallet-table { min-width: 0; }
body #walletSampleView .wallet-table td:first-child {
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
@media (max-width: 720px) {
  body #walletSampleView .wallet-table-wrap { overflow: visible; }
  body #walletSampleView .wallet-table,
  body #walletSampleView .wallet-table tbody { display: block; width: 100%; }
  body #walletSampleView .wallet-table tr:first-child { display: none; }
  body #walletSampleView .wallet-table tr:not(:first-child) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 12px; gap: 10px 14px;
    border-bottom: 1px solid rgba(120,157,180,.3);
  }
  body #walletSampleView .wallet-table td {
    display: block; min-width: 0; padding: 0; border: 0;
    text-align: left; white-space: normal; overflow-wrap: anywhere;
    font-size: 14px; line-height: 1.5;
  }
  body #walletSampleView .wallet-table td:nth-child(-n+2),
  body #walletSampleView .wallet-table td:last-child { grid-column: 1 / -1; }
  body #walletSampleView .wallet-table td::before {
    display: block; color: #8daabd; font-size: 11px; font-weight: 600;
    letter-spacing: .04em;
  }
  body #walletSampleView .wallet-table td:nth-child(1)::before { content: 'Account'; }
  body #walletSampleView .wallet-table td:nth-child(2)::before { content: 'Published label'; }
  body #walletSampleView .wallet-table td:nth-child(3)::before { content: 'Wallet XRP'; }
  body #walletSampleView .wallet-table td:nth-child(4)::before { content: 'Escrow XRP'; }
  body #walletSampleView .wallet-table td:nth-child(5)::before { content: 'Combined XRP'; }
}

body .whale-timeline-window .panel-head { flex-wrap: wrap; gap: 10px; }
body #whaleTimeline {
  height: auto; min-height: 140px; display: flex; flex-direction: column;
  align-items: stretch; justify-content: center; gap: 12px;
  box-sizing: border-box; padding: 16px; min-width: 0;
}
body #whaleTimeline .whale-timeline-summary {
  margin: 0; color: #d8edf8; font-size: 16px; line-height: 1.5;
  overflow-wrap: anywhere;
}
body #whaleTimeline .whale-timeline-period {
  margin: 0; color: #8daabd; font-size: 14px; line-height: 1.5;
}
body #whaleTimeline > svg { display: block; width: 100%; height: auto; min-height: 116px; }
body #whaleTimelineState { white-space: normal; overflow-wrap: anywhere; }

body .control-agent.collecting { border-left: 3px solid #8aa9b8; }
body .control-agent.degraded { border-left: 3px solid #ff6476; }
body .control-agent .agent-status { white-space: normal; overflow-wrap: anywhere; }
body .control-agent .agent-activity { color: #8aa9b8; font-weight: 400; }
@media (max-width: 720px) {
  body .control-agent-matrix { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  body .control-agent { padding: 14px; }
  body .control-agent-title { align-items: center; }
  body .control-agent-title b { font-size: 16px; line-height: 1.4; }
  body .control-agent small { font-size: 14px; line-height: 1.5; margin-top: 8px; }
  body .control-agent .agent-reason { color: #a8c0ce; }
}

/* Distinguish ledger snapshots from retained, validated transfer history. */
body .whale-section-label { margin: 16px 0 8px; font-size: 12px; letter-spacing: .08em; color: var(--novi-muted); }
body .whale-event { padding: 12px; min-width: 0; border-left: 3px solid #68879b; background: #0b2133; color: var(--novi-ink); }
body .whale-event.recent { border-left-color: var(--novi-green); }
body .whale-event.historical { border-left-color: #68879b; background: #0b2133; color: var(--novi-ink); }
body .whale-event-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; justify-content: space-between; }
body .whale-event-heading b { font-size: 17px; }
body .whale-event .whale-transfer-status { font-size: 11px; letter-spacing: .04em; color: var(--novi-green); }
body .whale-event > small, body .whale-wallet-route { display: block; margin-top: 6px; font-size: 13px; overflow-wrap: anywhere; }
body .whale-event details { margin-top: 8px; font-size: 13px; }
body .whale-event summary { padding: 6px 0; cursor: pointer; color: var(--novi-cyan); }
body .whale-transfer-details { display: grid; gap: 5px; margin-top: 6px; overflow-wrap: anywhere; }
body .whale-transfer-details span { min-width: 0; }
body .whale-panel { overflow: hidden; }
body .whale-section-label { font-size: 12px !important; }
body .whale-event .whale-transfer-status { font-size: 11px !important; }
/* Keep the animated scan inside the radar instead of across the long card. */
body .whale-panel::after { display: none; }

body .novi-whale-summary { margin-top: 16px; padding: 14px; background: #0b2133; border-left: 3px solid #68879b; overflow-wrap: anywhere; }
body .novi-whale-summary[data-notable="true"] { border-left-color: var(--novi-gold); }
body .novi-whale-summary h3 { margin: 0 0 8px; font-size: 16px; }
body .novi-whale-summary p { margin: 8px 0; }
body .novi-whale-summary summary { cursor: pointer; color: var(--novi-cyan); }
