:root {
  color-scheme: light;
  --ink: #1e293b;
  --muted: #64748b;
  --paper: #f1f5f9;
  --panel: #f8fafc;
  --line: #e2e8f0;
  --forest: #1e293b;
  --moss: #64748b;
  --acid: #c6ee64;
  --rust: #a84d35;
  --mono: "DM Mono", Consolas, monospace;
  --sans: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 1240px; background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  background:
    linear-gradient(90deg, rgba(99, 102, 241, .0) 1px, transparent 1px) 0 0 / 52px 52px,
    var(--paper);
}

button, input, select { font: inherit; }

.shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 28px; width: min(1800px, calc(100% - 56px)); margin: 0 auto; padding: 28px 0 22px; }
.content { min-width: 0; }
.sidebar { position: sticky; top: 28px; display: flex; flex-direction: column; height: calc(100vh - 56px); min-height: 560px; padding: 17px 12px 18px; border: 1px solid #cbd5e1; background: #f8fafc; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 3px 7px 26px; border-bottom: 1px solid var(--line); }
.sidebar-monogram { display: grid; place-items: center; width: 34px; height: 34px; color: var(--acid); background: var(--forest); font: 700 18px var(--sans); }
.sidebar-brand strong, .sidebar-brand span { display: block; white-space: nowrap; }
.sidebar-brand strong { color: var(--forest); font: 700 10px var(--sans); letter-spacing: .04em; }
.sidebar-brand span { margin-top: 2px; color: #94a3b8; font-size: 9px; }
.sidebar-label { margin: 27px 12px 9px; color: #94a3b8; font: 500 9px var(--mono); letter-spacing: .15em; }
.side-nav { display: grid; gap: 3px; }
.side-nav button { width: 100%; padding: 11px 12px; border: 0; border-left: 3px solid transparent; color: #64748b; background: transparent; cursor: pointer; font: 600 12px var(--sans); text-align: left; }
.side-nav button:hover { color: var(--forest); background: #f1f5f9; }
.side-nav button:focus-visible { outline: 2px solid var(--moss); outline-offset: -2px; }
.side-nav button.selected { border-left-color: var(--acid); color: var(--forest); background: #e2e8f0; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); color: #64748b; font: 500 9px/1.7 var(--mono); letter-spacing: .05em; }
.sidebar-foot span { color: #94a3b8; font-family: var(--sans); letter-spacing: 0; }

.masthead { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 24px; border-bottom: 1px solid #cbd5e1; }
.brand-lockup { display: flex; align-items: center; gap: 15px; }
.brand-mark { display: grid; grid-template-columns: 8px 8px 8px; gap: 3px; align-items: end; height: 33px; padding: 5px; border: 1px solid var(--forest); }
.brand-mark span { display: block; background: var(--forest); }
.brand-mark span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2) { height: 18px; background: var(--moss); }
.brand-mark span:nth-child(3) { height: 25px; background: var(--acid); }
.eyebrow { margin: 0; color: #64748b; font: 500 10px/1.4 var(--mono); letter-spacing: .12em; }
.eyebrow span { color: var(--moss); }
h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.1; letter-spacing: -.045em; font-weight: 700; }
.view-description { margin: 6px 0 0; color: #94a3b8; font-size: 10px; }
.mast-meta { display: flex; align-items: center; gap: 10px; color: #64748b; font: 11px var(--mono); letter-spacing: .05em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 3px rgba(198, 238, 100, .35); }
.meta-divider { height: 14px; width: 1px; background: #cbd5e1; margin: 0 4px; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 17px 0 20px; }
.filter-bar label { display: grid; gap: 6px; min-width: 124px; color: #64748b; font: 500 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.filter-bar input, .filter-bar select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 2px; outline: none; color: var(--ink); background: #f8fafc; font: 12px var(--sans); text-transform: none; letter-spacing: normal; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--moss); box-shadow: 0 0 0 2px rgba(111, 148, 124, .15); }
.filter-bar .search-control { flex: 1; min-width: 200px; }
.content .filter-bar label { min-width: 106px; }
.content .filter-bar .search-control { min-width: 160px; }
.filter-bar input::placeholder { color: #94a3b8; }
.quiet-button { height: 36px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 2px; color: #475569; background: transparent; cursor: pointer; }
.quiet-button:hover { color: var(--forest); background: #e2e8f0; }

.hero-grid { display: grid; grid-template-columns: 1.52fr 1fr 1fr 1fr; gap: 12px; }
.hero-card, .metric-card { position: relative; min-height: 162px; overflow: hidden; padding: 17px 19px; border: 1px solid var(--line); background: var(--panel); }
.value-card { color: #f1f5f9; border-color: var(--forest); background: var(--forest); }
.value-card::after { position: absolute; top: 0; right: 0; width: 34%; height: 100%; background: linear-gradient(135deg, transparent 35%, rgba(198, 238, 100, .07) 35%, rgba(198, 238, 100, .07) 36%, transparent 36%); content: ""; pointer-events: none; }
.card-topline { display: flex; align-items: center; justify-content: space-between; color: #64748b; font: 500 9px var(--mono); letter-spacing: .12em; }
.value-card .card-topline { color: #cbd5e1; }
.card-index { color: #94a3b8; }
.hero-value { position: relative; z-index: 1; margin: 18px 0 7px; font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -.055em; }
.hero-foot { display: flex; gap: 7px; color: #cbd5e1; font-size: 10px; }
.hero-foot span:first-child { color: var(--acid); font-family: var(--mono); }
.sparkline { position: absolute; right: 12px; bottom: 8px; width: 35%; height: 55px; opacity: .85; }
.sparkline svg { width: 100%; height: 100%; overflow: visible; }
.sparkline polyline { fill: none; stroke: var(--acid); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sparkline circle { fill: var(--acid); }
.metric-card { display: flex; flex-direction: column; }
.metric-glyph { color: #94a3b8; font-size: 15px; }
.metric-value { margin: 19px 0 2px; font: 500 30px/1 var(--mono); letter-spacing: -.08em; }
.metric-label { margin: 5px 0 12px; color: #94a3b8; font-size: 10px; }
.metric-rule { display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 8px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 9px; }
.metric-rule span:first-child { color: #475569; font-family: var(--mono); }
.cancel-card .metric-glyph, .cancel-card .metric-value { color: var(--rust); }

.analytics-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 12px; margin-top: 12px; }
.analysis-lower { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.analysis-lower:has(> [data-view="fornecedores"]:not([hidden])) { grid-template-columns: minmax(0, 1.7fr) minmax(0, .8fr); }
.single-panel { grid-template-columns: minmax(0, 1fr) !important; }
.panel { min-width: 0; padding: 17px 19px; border: 1px solid var(--line); background: var(--panel); }
.monthly-panel, .tax-panel { min-height: 248px; }
.partner-panel, .state-panel, .cfop-panel { min-height: 220px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.panel-heading h2 { margin: 3px 0 0; color: #1e293b; font-size: 16px; letter-spacing: -.035em; }
.panel-select { display: grid; gap: 5px; color: #94a3b8; font: 9px var(--mono); letter-spacing: .05em; }
.panel-select select { min-width: 110px; height: 30px; padding: 0 8px; border: 1px solid var(--line); color: var(--forest); background: #f8fafc; font: 11px var(--sans); }
.panel-unit { color: #94a3b8; font: 9px var(--mono); letter-spacing: .06em; white-space: nowrap; }
.monthly-chart { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: end; height: 180px; max-width: 100%; overflow-x: auto; padding: 8px 2px 0; border-bottom: 1px solid #cbd5e1; background: repeating-linear-gradient(to bottom, transparent 0 39px, #e2e8f0 39px 40px); }
.month-column { display: grid; grid-template-rows: 1fr 19px; height: 100%; min-width: 0; padding: 0; border: 0; align-items: end; color: inherit; background: transparent; cursor: pointer; text-align: center; }
.month-column:hover .month-bar, .month-column:focus-visible .month-bar { background: #334155; }
.month-column:focus-visible { outline: 2px solid var(--moss); outline-offset: -2px; }
.month-bar-slot { display: flex; align-items: end; justify-content: center; height: 100%; }
.month-bar { position: relative; width: min(32px, 62%); min-height: 4px; background: linear-gradient(180deg, #94a3b8, #475569); }
.month-bar::before { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--acid); content: ""; }
.month-label { align-self: end; color: #94a3b8; font: 9px var(--mono); }
.month-value { display: none; }
.tax-list, .rank-list, .cfop-list { display: grid; gap: 10px; }
.tax-row, .rank-row, .cfop-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 9px; }
.tax-name, .rank-name, .cfop-name { overflow: hidden; color: #64748b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tax-track, .rank-track, .cfop-track { height: 6px; background: #e2e8f0; }
.tax-fill, .rank-fill, .cfop-fill { height: 100%; background: #64748b; }
.tax-row:first-child .tax-fill, .rank-row:first-child .rank-fill, .cfop-row:first-child .cfop-fill { background: #475569; }
.tax-value, .rank-value, .cfop-value { color: #475569; font: 10px var(--mono); text-align: right; white-space: nowrap; }
.tax-note { margin: 10px 0 0; color: #94a3b8; font-size: 9px; }
.rank-list { gap: 9px; }
.rank-row { grid-template-columns: minmax(90px, 1.1fr) 1fr auto; }
.supplier-list { display: grid; max-height: 470px; overflow: auto; }
.supplier-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) minmax(60px, .65fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 51px; padding: 7px 2px; border: 0; border-bottom: 1px solid #f1f5f9; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.supplier-row:hover, .supplier-row:focus-visible { background: #f1f5f9; }
.supplier-identity, .supplier-numbers { display: grid; gap: 2px; min-width: 0; }
.supplier-identity strong { overflow: hidden; color: #334155; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.supplier-identity small, .supplier-numbers small { overflow: hidden; color: #94a3b8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.supplier-track { height: 7px; background: #e2e8f0; }
.supplier-track span { display: block; height: 100%; background: #64748b; }
.supplier-row:first-child .supplier-track span { background: #475569; }
.supplier-numbers { justify-items: end; }
.supplier-numbers strong { color: #334155; font: 500 10px var(--mono); white-space: nowrap; }
.supplier-matrix-panel { margin-top: 12px; }
.supplier-matrix-panel .table-wrap { max-height: 440px; overflow: auto; }
.supplier-matrix-panel thead th { position: sticky; top: 0; background: var(--panel); }
.matrix-supplier { max-width: 310px; }
.matrix-supplier strong, .matrix-supplier small { display: block; overflow: hidden; text-overflow: ellipsis; }
.matrix-supplier strong { color: #334155; font-size: 10px; }
.matrix-supplier small { margin-top: 2px; color: #94a3b8; font: 9px var(--mono); }
.state-chart { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 16px; height: 140px; padding: 0 8px; border-bottom: 1px solid #cbd5e1; }
.state-column { display: grid; grid-template-rows: 1fr 18px; height: 100%; align-items: end; text-align: center; }
.state-bar-slot { display: flex; justify-content: center; align-items: end; height: 100%; }
.state-bar { width: min(34px, 56%); min-height: 4px; background: #64748b; }
.state-column:nth-child(2) .state-bar { background: #94a3b8; }
.state-column:nth-child(3) .state-bar { background: #94a3b8; }
.state-label { align-self: end; color: #64748b; font: 9px var(--mono); }
.state-value { color: #64748b; font: 9px var(--mono); }
.state-column { position: relative; }
.state-column .state-value { position: absolute; top: -17px; width: 100%; text-align: center; }
.cfop-list { gap: 13px; }
.cfop-row { grid-template-columns: 36px 1fr auto; }
.cfop-name { font-family: var(--mono); }
.product-panel { margin-top: 12px; }
.product-panel[hidden] { display: none; }
.table-panel { margin-top: 12px; padding-bottom: 4px; }
.table-heading { align-items: end; margin-bottom: 9px; }
.table-wrap { overflow: auto; }
.table-panel .table-wrap { max-height: 620px; }
.table-panel thead th { position: sticky; top: 0; background: var(--panel); }
.table-actions { display: flex; align-items: center; gap: 8px; }
.table-actions .panel-unit { margin-right: 5px; }
.table-actions .quiet-button { height: 30px; font-size: 10px; }
.note-open { padding: 0; border: 0; color: #475569; background: transparent; cursor: pointer; font: inherit; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.note-open:hover { color: #1e293b; }
.note-open:focus-visible { outline: 2px solid var(--moss); }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead th { padding: 9px 8px; border-bottom: 1px solid #cbd5e1; color: #94a3b8; font: 9px var(--mono); letter-spacing: .06em; white-space: nowrap; }
tbody td { padding: 10px 8px; border-bottom: 1px solid #f1f5f9; color: #475569; font-size: 10px; white-space: nowrap; }
tbody tr:hover { background: #f1f5f9; }
td.numeric { color: #334155; font-family: var(--mono); text-align: right; }
th.numeric { text-align: right; }
.issuer-cell { max-width: 270px; overflow: hidden; color: #334155; font-weight: 600; text-overflow: ellipsis; }
.note-number { color: #475569; font-family: var(--mono); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid #e2e8f0; color: #64748b; font: 9px var(--mono); }
.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: #94a3b8; content: ""; }
.status-pill.cancelled { border-color: #cbd5e1; color: #9b4f3a; }
.status-pill.cancelled::before { background: #64748b; }
.file-links { display: flex; gap: 5px; }
.file-link, .file-missing { padding: 3px 6px; border: 1px solid #e2e8f0; color: #475569; font: 9px var(--mono); text-decoration: none; }
.file-link:hover { border-color: #94a3b8; background: #f1f5f9; }
.file-missing { color: #94a3b8; border-color: #e2e8f0; }
.loading-cell, .empty-cell { padding: 28px 8px; color: #94a3b8; text-align: center; }
.footer { display: flex; justify-content: space-between; padding: 13px 1px 0; color: #94a3b8; font-size: 9px; }
.error-banner { margin: 18px 0; padding: 12px 14px; border-left: 3px solid var(--rust); color: #475569; background: #e2e8f0; }

.business-reading { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; margin-top: 12px; }
.reading-card { min-width: 0; min-height: 142px; padding: 16px 19px; border: 1px solid var(--line); background: var(--panel); }
.reading-card .panel-heading { margin-bottom: 12px; }
.movement-chart { display: grid; gap: 11px; }
.movement-row { display: grid; grid-template-columns: minmax(150px, .8fr) 1.2fr auto; align-items: center; gap: 12px; }
.movement-label { display: grid; gap: 2px; }
.movement-label strong { color: #334155; font-size: 11px; }
.movement-label span { color: #94a3b8; font-size: 9px; }
.movement-track, .product-track { height: 8px; overflow: hidden; background: #e2e8f0; }
.movement-fill, .product-fill { display: block; height: 100%; background: #64748b; }
.movement-fill.outgoing { background: #94a3b8; }
.movement-value, .product-value { color: #475569; font: 500 10px var(--mono); text-align: right; white-space: nowrap; }
.business-insight { margin: 12px 0 8px; color: #334155; font-size: 13px; line-height: 1.6; }
.coverage-note, .panel-note { margin: 0; color: #94a3b8; font-size: 10px; line-height: 1.5; }
.partner-panel, .state-panel, .cfop-panel { min-height: 250px; }
.state-chart { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; height: auto; padding: 2px 0 0; border: 0; }
.state-row { display: grid; grid-template-columns: 28px minmax(30px, 1fr) 54px auto; align-items: center; gap: 7px; }
.flow-panel { margin-top: 12px; }
.flow-chart { display: grid; gap: 7px; }
.flow-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 75px 120px; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); color: #475569; background: #f8fafc; cursor: pointer; text-align: left; }
.flow-row:hover, .flow-row:focus-visible { border-color: #94a3b8; background: #f1f5f9; }
.flow-row strong { font: 500 11px var(--mono); }
.flow-row small { color: #94a3b8; font-size: 10px; }
.flow-row > span:last-child { font: 500 10px var(--mono); text-align: right; }
.flow-track { height: 7px; background: #e2e8f0; }
.flow-track span { display: block; height: 100%; background: #64748b; }
.state-name { color: #475569; font: 10px var(--mono); }
.state-track { height: 6px; background: #e2e8f0; }
.state-fill { display: block; height: 100%; background: #64748b; }
.state-row:nth-child(2) .state-fill { background: #94a3b8; }
.state-row:nth-child(3) .state-fill { background: #cbd5e1; }
.state-detail { color: #94a3b8; font-size: 9px; text-align: right; white-space: nowrap; }
.state-value { color: #475569; font: 9px var(--mono); text-align: right; white-space: nowrap; }
.cfop-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 7px; }
.cfop-value { font-size: 9px; }
.product-panel .rank-list { gap: 11px; }
.product-row { display: grid; grid-template-columns: minmax(160px, 1.1fr) minmax(100px, 1fr) minmax(150px, .9fr) auto; align-items: center; gap: 14px; }
.product-name { overflow: hidden; color: #475569; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.product-detail { color: #94a3b8; font-size: 9px; white-space: nowrap; }
.panel-note { margin-top: 14px; }
.month-label { display: grid; justify-items: center; gap: 3px; }
.month-label small { color: #94a3b8; font: 8px var(--sans); white-space: nowrap; }
.month-value { display: block; color: #64748b; font: 8px var(--mono); white-space: nowrap; }
.month-column { grid-template-rows: 14px 1fr 27px; }
.month-bar-slot { min-height: 0; }
.price-chart { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.price-month { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 9px; border: 1px solid var(--line); }
.price-month strong { color: var(--forest); font: 10px var(--mono); }
.price-month span { color: #475569; font-size: 10px; }
.price-month small { display: block; color: #94a3b8; font-size: 9px; }
.comparable-panel { margin-top: 12px; }
.comparable-panel .panel-select { min-width: 300px; max-width: 470px; }
.comparable-panel .panel-select select { width: 100%; }
.comparable-table-wrap { max-height: 340px; margin-top: 12px; }
.comparable-table-wrap thead th { position: sticky; top: 0; background: var(--panel); }
.comparable-notes { display: flex; gap: 8px; flex-wrap: wrap; white-space: normal; }
.product-name small { display: block; overflow: hidden; color: #94a3b8; font-size: 9px; text-overflow: ellipsis; }
.product-row { min-height: 28px; }
.product-analytics .panel { min-height: 250px; }
.product-panel .rank-list { max-height: 410px; overflow: auto; padding-right: 8px; }
.note-dialog { width: min(1040px, calc(100% - 100px)); max-width: none; max-height: 86vh; padding: 0 22px 22px; border: 1px solid #cbd5e1; color: var(--ink); background: var(--panel); box-shadow: 0 22px 80px rgba(20, 49, 36, .28); }
.note-dialog::backdrop { background: rgba(13, 33, 26, .56); }
.dialog-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.dialog-top strong { color: #64748b; font: 500 10px var(--mono); letter-spacing: .1em; }
.detail-header { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 16px; }
.detail-header h2 { margin: 0; color: var(--forest); font-size: 21px; }
.detail-header h2 small { color: #94a3b8; font-size: 11px; font-weight: 500; }
.detail-header p { margin: 5px 0 0; color: #94a3b8; font: 10px var(--mono); }
.detail-header > strong { color: var(--forest); font: 500 19px var(--mono); white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.detail-grid > div { display: grid; align-content: start; gap: 6px; min-height: 70px; padding: 11px; background: #f8fafc; }
.detail-grid span { color: #94a3b8; font: 9px var(--mono); letter-spacing: .04em; }
.detail-grid strong { overflow-wrap: anywhere; color: #334155; font-size: 11px; font-weight: 600; }
.detail-grid strong small { display: block; margin-top: 3px; color: #94a3b8; font: 9px var(--mono); }
.detail-section { margin-top: 23px; }
.detail-section h3 { margin: 0 0 9px; color: var(--forest); font-size: 14px; }
.detail-section h3 small { margin-left: 8px; color: #94a3b8; font: 9px var(--mono); }
.detail-links { display: flex; flex-wrap: wrap; gap: 9px; color: #94a3b8; font-size: 11px; }
.detail-links .note-open { padding: 7px 9px; border: 1px solid var(--line); }
.detail-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.detail-totals span { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line); color: #94a3b8; font-size: 10px; }
.detail-totals strong { color: var(--forest); font: 500 11px var(--mono); }
.detail-table { max-height: 350px; }
.detail-table thead th { position: sticky; top: 0; background: var(--panel); }
.detail-product { max-width: 290px; overflow: hidden; text-overflow: ellipsis; }
.detail-product small { display: block; color: #94a3b8; font: 9px var(--mono); }
.note-dialog .panel-note { margin-top: 18px; }
.fiscal-detail-panel, .registry-panel, .registry-sources { margin-top: 12px; }
.registry-evidence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 14px 0; }
.registry-evidence > div { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 12px; border: 1px solid var(--line); background: #f8fafc; }
.registry-evidence span { color: #64748b; font: 9px var(--mono); letter-spacing: .05em; }
.registry-evidence strong { color: var(--forest); font-size: 14px; font-weight: 600; }
.registry-evidence small { color: #94a3b8; font-size: 10px; }
.registry-detail { display: block; margin-top: 4px; color: #94a3b8; font-size: 9px; line-height: 1.3; }
.fiscal-measures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.fiscal-measure { display: grid; gap: 7px; min-width: 0; padding: 12px; border: 1px solid var(--line); background: #f8fafc; }
.fiscal-measure span { color: #64748b; font-size: 10px; }
.fiscal-measure strong { color: var(--forest); font: 500 16px var(--mono); white-space: nowrap; }
.fiscal-measure small { color: #94a3b8; font-size: 9px; }
.fiscal-table-wrap, .review-table-wrap { max-height: 470px; }
.fiscal-table-wrap thead th, .review-table-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.fiscal-table-wrap table, .review-table-wrap table { min-width: 100%; }
.review-table-wrap { margin-top: 12px; }
.review-table-wrap table { table-layout: fixed; min-width: 920px; }
.review-table-wrap th:nth-child(1) { width: 23%; }
.review-table-wrap th:nth-child(2) { width: 21%; }
.review-table-wrap th:nth-child(3) { width: 16%; }
.review-table-wrap th:nth-child(4) { width: 9%; }
.review-table-wrap th:nth-child(5) { width: 5%; }
.review-table-wrap th:nth-child(6) { width: 15%; }
.review-table-wrap th:nth-child(7) { width: 11%; }
.review-controls { display: flex; gap: 8px; align-items: end; }
.review-controls select { max-width: 225px; }
.review-group-title { margin: 15px 0 8px; color: var(--forest); font-size: 13px; }
.review-group-wrap { max-height: 210px; }
.review-group-wrap table { min-width: 100%; }
.review-group-wrap thead th { position: sticky; top: 0; background: var(--panel); }
.review-reason { white-space: normal; }
.review-reason strong, .review-reason small { display: block; }
.review-reason small { margin-top: 4px; color: #94a3b8; line-height: 1.4; }
.review-required { color: #475569 !important; }
.review-key { display: block; margin-top: 5px; overflow-wrap: anywhere; white-space: normal; color: #94a3b8; font: 9px var(--mono); }
.source-links { display: flex; gap: 10px; flex-wrap: wrap; }
.source-links a { padding: 9px 12px; border: 1px solid var(--line); color: #475569; background: #f8fafc; font-size: 11px; text-decoration: none; }
.source-links a:hover, .source-links a:focus-visible { border-color: #94a3b8; background: #f1f5f9; }
.market-panel { margin-top: 12px; }
.content .filter-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.content .filter-bar label, .content .filter-bar .search-control { min-width: 0; }
.content .filter-bar .quiet-button { justify-self: end; }
.content .filter-bar:not(.detail-filter-bar) { padding-bottom: 12px; }
.content .detail-filter-bar { padding-top: 12px; }
.filter-context { margin: -12px 0 18px; }
.market-controls { display: flex; gap: 10px; }
.market-controls select { min-width: 130px; height: 30px; padding: 0 8px; border: 1px solid var(--line); color: var(--forest); background: #f8fafc; font: 11px var(--mono); }
.market-legend { display: flex; gap: 18px; margin: 15px 0 8px; color: #64748b; font-size: 10px; }
.market-legend span { display: flex; align-items: center; gap: 6px; }
.market-swatch { display: inline-block; width: 14px; height: 3px; }
.market-swatch.mcs { background: #475569; }
.market-swatch.comex { background: #94a3b8; }
.market-trend { height: 205px; padding: 8px 12px 0; border: 1px solid var(--line); background: #f8fafc; }
.market-trend svg { width: 100%; height: 172px; }
.market-axis { stroke: #cbd5e1; stroke-width: 1; vector-effect: non-scaling-stroke; }
.market-tick { fill: #94a3b8; font: 9px var(--mono); }
.market-line-mcs, .market-line-comex { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.market-line-mcs { stroke: #475569; }
.market-line-comex { stroke: #94a3b8; }
.market-months { display: flex; justify-content: space-between; padding: 0 18px 0 27px; color: #94a3b8; font: 9px var(--mono); }
.market-table-wrap { max-height: 340px; margin-top: 13px; }
.market-table-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.market-context { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.ipp-chart { display: grid; gap: 16px; }
.ipp-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 48px; align-items: center; gap: 12px; color: var(--forest); font: 11px var(--mono); }
.ipp-row > div:first-child { display: grid; gap: 4px; }
.ipp-row small { color: #94a3b8; font-size: 9px; }
.ipp-values { display: flex; align-items: end; gap: 3px; }
.ipp-values span { flex: 1; padding: 7px 2px; border-bottom: 2px solid #94a3b8; color: #64748b; font-size: 9px; text-align: center; }
.pim-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.pim-context > div { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); background: #f8fafc; }
.pim-context span { color: #94a3b8; font-size: 10px; }
.pim-context strong { color: var(--forest); font: 500 21px var(--mono); }
.pim-context > small { grid-column: 1 / -1; color: #94a3b8; font-size: 9px; }

@media print {
  body { background: white; }
  .shell { display: block; width: 100%; padding: 0; }
  .sidebar, .filter-bar, .quiet-button { display: none; }
  .panel, .hero-card, .metric-card { break-inside: avoid; }
}

/* ===================== TEMA COLORIDO ===================== */
:root {
  --ink: #0f172a;
  --muted: #64748b;
  --paper: #f3f5fb;
  --panel: #ffffff;
  --line: #e7ebf3;
  --forest: #1e1b4b;
  --moss: #6366f1;
  --acid: #a5b4fc;
  --rust: #e11d48;
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --sky: #0ea5e9;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --radius: 16px;
}
html { background: var(--paper); }
body { font-size: 13px; color: var(--ink); background: radial-gradient(1200px 500px at 85% -10%, rgba(99, 102, 241, .10), transparent 60%), radial-gradient(900px 400px at 10% 0%, rgba(20, 184, 166, .08), transparent 60%), var(--paper); background-attachment: fixed; }

/* Sidebar */
.sidebar { border: 0; border-radius: 20px; padding: 20px 14px; color: #c7d2fe; background: linear-gradient(180deg, #1e1b4b 0%, #312e81 55%, #4c1d95 100%); box-shadow: 0 20px 40px -20px rgba(49, 46, 129, .6); }
.sidebar-brand { border-bottom-color: rgba(255, 255, 255, .12); }
.sidebar-monogram { border-radius: 12px; color: #fff; background: linear-gradient(135deg, #22d3ee, #6366f1 55%, #a855f7); box-shadow: 0 6px 16px -4px rgba(99, 102, 241, .7); }
.sidebar-brand strong { color: #fff; font-size: 11px; }
.sidebar-brand span { color: #a5b4fc; font-size: 10px; }
.sidebar-label { color: #818cf8; }
.side-nav { gap: 4px; }
.side-nav button { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 10px; color: #c7d2fe; font-size: 13px; }
.side-nav button::before { width: 8px; height: 8px; border-radius: 3px; background: var(--dot, #818cf8); content: ""; opacity: .85; flex: none; }
.side-nav button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.side-nav button.selected { color: #1e1b4b; background: #fff; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45); }
.side-nav button.selected::before { opacity: 1; }
.side-nav [data-nav="geral"] { --dot: #a5b4fc; }
.side-nav [data-nav="compras"] { --dot: #6366f1; }
.side-nav [data-nav="fornecedores"] { --dot: #0ea5e9; }
.side-nav [data-nav="produtos"] { --dot: #14b8a6; }
.side-nav [data-nav="precos"] { --dot: #8b5cf6; }
.side-nav [data-nav="mercado"] { --dot: #f59e0b; }
.side-nav [data-nav="fiscal"] { --dot: #f43f5e; }
.side-nav [data-nav="cadastro"] { --dot: #10b981; }
.side-nav [data-nav="analise"] { --dot: #22d3ee; }
.side-nav [data-nav="notas"] { --dot: #ec4899; }
.sidebar-foot { border-top-color: rgba(255, 255, 255, .12); color: #a5b4fc; }
.sidebar-foot span { color: #818cf8; }

/* Cabeçalho e filtros */
.masthead { border-bottom: 0; padding-bottom: 14px; }
.brand-mark { border: 0; border-radius: 12px; background: #fff; box-shadow: var(--shadow); height: 42px; padding: 7px 8px; }
.brand-mark span:nth-child(1) { background: #14b8a6; border-radius: 2px; }
.brand-mark span:nth-child(2) { background: #6366f1; border-radius: 2px; }
.brand-mark span:nth-child(3) { background: #f59e0b; border-radius: 2px; }
.eyebrow { color: #6366f1; font-weight: 500; }
.eyebrow span { color: #a5b4fc; }
h1 { font-size: 28px; letter-spacing: -.035em; background: linear-gradient(90deg, #1e1b4b, #4f46e5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.view-description { color: #64748b; font-size: 12px; }
.mast-meta { padding: 8px 14px; border-radius: 999px; color: #4338ca; background: #fff; box-shadow: var(--shadow); }
.live-dot { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .2); }
.filter-bar { padding: 18px 20px 12px; border-radius: var(--radius) var(--radius) 0 0; background: #fff; box-shadow: var(--shadow); }
.content .detail-filter-bar { padding: 12px 20px 20px; border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 18px; }
.filter-bar label { color: #64748b; }
.filter-bar input, .filter-bar select { border-color: #e2e8f0; border-radius: 10px; background: #f8fafc; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); background: #fff; }
.quiet-button { border-radius: 10px; border-color: #e2e8f0; color: #4338ca; background: #fff; font-weight: 600; }
.quiet-button:hover { color: #fff; border-color: #6366f1; background: #6366f1; }
.quiet-button.small { height: 30px; font-size: 11px; }

/* Cartões */
.panel, .reading-card { border: 0; border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); padding: 18px 20px; }
.panel-heading h2 { color: #0f172a; font-size: 17px; letter-spacing: -.02em; }
.panel-unit { padding: 4px 8px; border-radius: 999px; color: #4f46e5; background: #eef2ff; font-size: 9px; }
.panel-note, .coverage-note { color: #64748b; font-size: 11px; }
.panel-select { color: #64748b; }
.panel-select select, .market-controls select { border-radius: 10px; border-color: #e2e8f0; color: #1e1b4b; background: #f8fafc; }
thead th { color: #64748b; border-bottom-color: #e2e8f0; background: #fff !important; }
tbody td { color: #334155; font-size: 11px; border-bottom-color: #f1f5f9; }
tbody tr:hover { background: #f5f7ff; }
td.numeric { color: #0f172a; }
.issuer-cell { color: #0f172a; }
.note-open { color: #4f46e5; font-weight: 600; }
.note-open:hover { color: #312e81; }
.status-pill { border-radius: 999px; border-color: #bbf7d0; color: #047857; background: #ecfdf5; }
.status-pill::before { background: #10b981; }
.status-pill.cancelled { border-color: #fecdd3; color: #be123c; background: #fff1f2; }
.status-pill.cancelled::before { background: #f43f5e; }
.file-link { border-radius: 6px; border-color: #c7d2fe; color: #4338ca; background: #eef2ff; }
.file-link:hover { border-color: #6366f1; background: #e0e7ff; }
.file-missing { border-radius: 6px; }
.analytics-grid, .analysis-lower, .business-reading { gap: 16px; margin-top: 16px; }
.supplier-matrix-panel, .supplier-root-panel, .flow-panel, .table-panel, .product-panel, .comparable-panel, .market-panel, .fiscal-detail-panel, .registry-panel, .registry-sources { margin-top: 16px; }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: 1.6fr repeat(5, minmax(0, 1fr)); gap: 14px; }
.hero-card, .metric-card { min-height: 150px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.value-card { color: #fff; background: linear-gradient(135deg, #4338ca 0%, #6366f1 45%, #8b5cf6 100%); box-shadow: 0 18px 36px -18px rgba(79, 70, 229, .8); }
.value-card::after { display: none; }
.value-card .card-topline { color: #e0e7ff; }
.hero-value { margin: 20px 0 8px; font-size: 34px; font-weight: 800; letter-spacing: -.04em; }
.hero-foot { color: #e0e7ff; font-size: 11px; }
.hero-foot span:first-child { color: #fff; font-weight: 700; }
.trend-chip { padding: 4px 9px; border-radius: 999px; color: #fff; background: rgba(255, 255, 255, .18); font: 600 10px var(--sans); letter-spacing: 0; }
.trend-chip.up { background: rgba(16, 185, 129, .9); }
.trend-chip.down { background: rgba(244, 63, 94, .9); }
.sparkline { right: 0; bottom: 0; width: 55%; height: 70px; opacity: 1; }
.sparkline polyline { stroke: #fff; stroke-width: 2.5; }
.metric-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: #fff; position: relative; overflow: hidden; }
.metric-card::before { position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tone); content: ""; }
.metric-card::after { position: absolute; right: -30px; bottom: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--tone); opacity: .08; content: ""; }
.tone-sky { --tone: #0ea5e9; } .tone-violet { --tone: #8b5cf6; } .tone-teal { --tone: #14b8a6; } .tone-amber { --tone: #f59e0b; } .tone-rose { --tone: #f43f5e; }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font-size: 18px; background: color-mix(in srgb, var(--tone) 14%, white); }
.metric-title { margin: 0; color: #64748b; font-size: 11px; font-weight: 600; }
.metric-value { margin: 4px 0 2px; color: #0f172a; font: 800 24px/1.1 var(--sans); letter-spacing: -.03em; white-space: nowrap; }
.metric-label { margin: 0; color: #64748b; font-size: 11px; }
.cancel-card .metric-value { color: #e11d48; }

/* Grade da visão geral */
.overview-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; }
.chart-box { position: relative; width: 100%; height: 240px; }
.chart-box.tall { height: 290px; }
.chart-box.medium { height: 230px; }
.chart-box canvas { display: block; }
.legend-inline { display: flex; gap: 14px; color: #475569; font-size: 11px; font-weight: 600; }
.legend-inline span { display: flex; align-items: center; gap: 6px; }
.legend-inline i { width: 10px; height: 10px; border-radius: 3px; }
.donut-wrap { display: grid; gap: 14px; }
.chart-box.donut { height: 190px; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { color: #0f172a; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.donut-center span { color: #64748b; font-size: 10px; }
.donut-legend { display: grid; gap: 7px; }
.legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 64px; align-items: center; gap: 8px; font-size: 11px; }
.legend-row i { width: 10px; height: 10px; border-radius: 3px; }
.legend-row span { overflow: hidden; color: #334155; text-overflow: ellipsis; white-space: nowrap; }
.legend-row strong { color: #0f172a; font-family: var(--mono); font-weight: 500; }
.legend-row small { color: #64748b; font-family: var(--mono); text-align: right; }
.insight-list { display: grid; gap: 9px; margin-bottom: 10px; }
.insight { display: grid; grid-template-columns: 30px 1fr; align-items: start; gap: 10px; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, white); }
.insight-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #fff; font-size: 15px; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.insight p { margin: 0; color: #334155; font-size: 12px; line-height: 1.5; }
.insight strong { color: #0f172a; }
.top-list { display: grid; gap: 12px; }
.top-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.top-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-weight: 800; font-size: 12px; }
.top-body { display: grid; gap: 5px; min-width: 0; }
.top-line { display: flex; justify-content: space-between; gap: 8px; }
.top-line strong { overflow: hidden; color: #0f172a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.top-line span { color: #0f172a; font: 500 11px var(--mono); white-space: nowrap; }
.top-track { height: 6px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.top-track i { display: block; height: 100%; border-radius: 999px; }
.top-body small { color: #64748b; font-size: 10px; }
.recent-list { display: grid; }
.recent-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto 120px; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid #f1f5f9; }
.recent-row:last-child { border-bottom: 0; }
.recent-date { display: grid; place-items: center; padding: 5px 0; border-radius: 10px; color: #4338ca; background: #eef2ff; }
.recent-date strong { font-size: 12px; } .recent-date small { color: #818cf8; font-size: 9px; }
.recent-body { display: grid; gap: 2px; min-width: 0; }
.recent-body small { overflow: hidden; color: #64748b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.recent-value { color: #0f172a; font: 500 12px var(--mono); text-align: right; }
.badge { padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge-indigo { color: #4338ca; background: #e0e7ff; } .badge-rose { color: #be123c; background: #ffe4e6; } .badge-amber { color: #b45309; background: #fef3c7; } .badge-slate { color: #475569; background: #f1f5f9; }

/* Listas e barras coloridas das outras telas */
.tax-track, .rank-track, .cfop-track, .supplier-track, .state-track, .flow-track, .movement-track, .product-track { height: 8px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.tax-fill, .rank-fill, .cfop-fill, .supplier-track span, .state-fill, .flow-track span, .movement-fill, .product-fill { border-radius: 999px; }
.movement-fill { background: linear-gradient(90deg, #818cf8, #4f46e5); }
.movement-fill.outgoing { background: linear-gradient(90deg, #fda4af, #f43f5e); }
.tax-name, .rank-name, .cfop-name, .state-name { color: #334155; font-size: 11px; font-weight: 600; }
.tax-value, .rank-value, .cfop-value, .state-value, .movement-value, .product-value { color: #0f172a; font-size: 11px; }
.supplier-row { grid-template-columns: 26px minmax(170px, 1.3fr) minmax(60px, .65fr) 190px; border-bottom-color: #f1f5f9; border-radius: 10px; padding: 8px 6px; }
.supplier-row:hover, .supplier-row:focus-visible { background: #f5f7ff; }
.supplier-rank { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 800; font-size: 11px; }
.supplier-identity strong { color: #0f172a; font-size: 12px; }
.supplier-identity small, .supplier-numbers small { color: #64748b; font-size: 10px; }
.supplier-numbers small + small { overflow: visible; white-space: normal; text-align: right; }
.supplier-numbers strong { color: #0f172a; font-size: 14px; }
.flow-row { border: 0; border-radius: 12px; background: #f8fafc; }
.flow-row:hover, .flow-row:focus-visible { background: #eef2ff; }
.flow-row strong { color: #1e1b4b; font-size: 12px; }
.product-name { color: #0f172a; font-size: 11px; }
.price-chart { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 14px; }
.price-month { border: 0; border-radius: 12px; background: #f8fafc; }
.price-month strong { color: #4338ca; font: 700 11px var(--sans); text-transform: capitalize; }
.price-month span { display: grid; grid-template-columns: 8px auto 1fr; align-items: center; gap: 2px 6px; color: #334155; font-size: 11px; }
.price-month span i { width: 8px; height: 8px; border-radius: 2px; }
.price-month span b { text-align: right; font: 500 11px var(--mono); }
.price-month span small { grid-column: 2 / -1; color: #64748b; font-size: 10px; }
.comparable-panel .chart-box { margin: 12px 0 4px; }
.market-panel .chart-box { margin: 10px 0; }
.fiscal-measure, .registry-evidence > div, .pim-context > div, .detail-totals span { border: 0; border-radius: 12px; background: #f8fafc; }
.fiscal-measure { border-top: 3px solid #6366f1; }
.fiscal-measure:nth-child(4n+2) { border-top-color: #0ea5e9; } .fiscal-measure:nth-child(4n+3) { border-top-color: #14b8a6; } .fiscal-measure:nth-child(4n+4) { border-top-color: #f59e0b; }
.fiscal-measure strong, .registry-evidence strong, .pim-context strong { color: #1e1b4b; }
.pim-context strong { color: #4f46e5; }
.registry-evidence > div { border-left: 3px solid #10b981; }
.source-links a { border: 0; border-radius: 10px; color: #4338ca; background: #eef2ff; font-weight: 600; }
.source-links a:hover, .source-links a:focus-visible { color: #fff; background: #6366f1; }
.note-dialog { border: 0; border-radius: 18px; }
.detail-grid { border: 0; border-radius: 12px; overflow: hidden; background: #e2e8f0; }
.detail-grid > div { background: #f8fafc; }
.detail-header h2, .detail-header > strong, .detail-section h3 { color: #1e1b4b; }
.error-banner { border-radius: 12px; }
.footer { color: #64748b; font-size: 10px; padding-top: 18px; }
/* ajustes de layout */
.kpi-grid { grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; }
.kpi-grid .value-card { grid-row: span 2; display: flex; flex-direction: column; }
.value-card .card-topline { gap: 10px; }
.value-card .card-topline > span:first-child { white-space: nowrap; }
.trend-chip { white-space: nowrap; }
.value-card .hero-value, .value-card .hero-foot { position: relative; z-index: 1; }
.value-card .hero-value { margin-top: 26px; font-size: 40px; }
.value-card .sparkline { left: 0; right: 0; width: 100%; height: 45%; opacity: .9; }
.metric-card { min-height: 0; flex-direction: row; align-items: center; gap: 14px; padding: 18px 16px; }
.metric-card > div:last-child { min-width: 0; }
.metric-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tone-indigo { --tone: #6366f1; }
.overview-grid > .panel { display: flex; flex-direction: column; }
.overview-grid .chart-box.tall, .overview-grid .chart-box.medium { flex: 1 1 auto; }
.overview-grid .chart-box.tall { min-height: 290px; }
.overview-grid .chart-box.medium { min-height: 220px; }
.panel:not(.span-4) > .donut-wrap { grid-template-columns: 240px minmax(0, 1fr); align-items: center; gap: 28px; }
.panel:not(.span-4) > .donut-wrap .chart-box.donut { height: 220px; }
.state-row { grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "name track value" ". detail detail"; row-gap: 4px; }
.state-name { grid-area: name; } .state-track { grid-area: track; } .state-value { grid-area: value; font-size: 11px; } .state-detail { grid-area: detail; text-align: left; color: #64748b; font-size: 10px; }

.analysis-view .filter-bar, .analysis-view #filter-context, .analysis-view .mast-meta, .analysis-view #footer-data { display: none; }
.analysis-report { margin-top: 16px; padding: 32px 42px 42px; }
.analysis-report-top { display: flex; align-items: start; justify-content: space-between; gap: 24px; max-width: 1000px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.analysis-report-top .eyebrow { margin: 0 0 5px; font: 500 10px var(--mono); letter-spacing: .12em; }
.analysis-report-top p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.analysis-download { flex: none; padding: 9px 13px; border: 1px solid #c7d2fe; border-radius: 9px; color: #4338ca; background: #eef2ff; font-size: 11px; font-weight: 700; text-decoration: none; }
.analysis-download:hover, .analysis-download:focus-visible { background: #e0e7ff; }
.analysis-markdown { max-width: 1000px; color: #334155; font-size: 14px; line-height: 1.75; }
.analysis-markdown h2 { margin: 28px 0 14px; color: #1e1b4b; font-size: 29px; line-height: 1.25; letter-spacing: -.035em; }
.analysis-markdown h3 { margin: 32px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); color: #1e1b4b; font-size: 19px; line-height: 1.35; }
.analysis-markdown h4 { margin: 24px 0 10px; color: #1e1b4b; font-size: 15px; }
.analysis-markdown p { margin: 0 0 15px; }
.analysis-markdown blockquote { margin: 0 0 26px; padding: 15px 19px; border-left: 4px solid #6366f1; border-radius: 0 10px 10px 0; color: #334155; background: #f5f7ff; }
.analysis-markdown ul, .analysis-markdown ol { margin: 0 0 19px; padding-left: 24px; }
.analysis-markdown li { margin: 0 0 9px; padding-left: 3px; }
.analysis-markdown li::marker { color: #6366f1; font-weight: 800; }
.analysis-markdown strong { color: #0f172a; }
.analysis-markdown a { color: #4338ca; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.analysis-markdown a:hover, .analysis-markdown a:focus-visible { color: #312e81; }
.analysis-markdown code { padding: 1px 5px; border-radius: 4px; color: #4338ca; background: #eef2ff; font: 12px var(--mono); }

.intelligence-report { margin-top: 16px; padding: 30px 36px 36px; }
.intelligence-head { display: flex; justify-content: space-between; gap: 24px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.intelligence-head h2 { margin: 3px 0 8px; color: #1e1b4b; font-size: 27px; letter-spacing: -.035em; }
.intelligence-head p:last-child { max-width: 750px; margin: 0; color: #64748b; font-size: 12px; line-height: 1.6; }
.intelligence-toolbar { display: flex; align-items: center; gap: 12px; margin: 22px 0 10px; }
.intelligence-toolbar label { color: #475569; font-size: 11px; font-weight: 700; }
.intelligence-toolbar input { width: 290px; height: 36px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 9px; outline: none; color: #0f172a; background: #fff; font: 12px var(--sans); }
.intelligence-toolbar input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px #e0e7ff; }
.intelligence-toolbar span { margin-left: auto; color: #64748b; font: 11px var(--mono); }
.intelligence-caveat { margin: 0 0 18px; color: #64748b; font-size: 11px; line-height: 1.6; }
.intelligence-list { display: grid; gap: 12px; }
.intelligence-card { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(200px, .65fr) minmax(230px, .8fr); gap: 26px; align-items: start; padding: 22px 24px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.intelligence-profile { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.intelligence-rank { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #4f46e5; background: #eef2ff; font: 700 11px var(--mono); }
.intelligence-profile h3 { margin: 1px 0 4px; color: #0f172a; font-size: 14px; line-height: 1.35; }
.intelligence-id { margin: 0; color: #818da1; font: 10px var(--mono); }
.intelligence-activity { margin: 10px 0; color: #475569; font-size: 11px; line-height: 1.55; }
.intelligence-links { display: flex; flex-wrap: wrap; gap: 6px; }
.intelligence-links a { padding: 5px 8px; border-radius: 7px; color: #4338ca; background: #eef2ff; font-size: 10px; font-weight: 700; text-decoration: none; }
.intelligence-links a:hover, .intelligence-links a:focus-visible { background: #e0e7ff; text-decoration: underline; }
.intelligence-purchase { padding: 2px 0; }
.intelligence-purchase > span, .intelligence-contact > span { display: block; margin-bottom: 8px; color: #94a3b8; font: 9px var(--mono); letter-spacing: .04em; }
.intelligence-purchase strong { display: block; color: #0f172a; font: 700 16px var(--sans); white-space: nowrap; }
.intelligence-purchase small { display: block; margin-top: 4px; color: #64748b; font-size: 10px; }
.intelligence-track { height: 5px; margin-top: 14px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.intelligence-track i { display: block; height: 100%; border-radius: inherit; background: #6366f1; }
.intelligence-contacts { display: grid; gap: 12px; }
.intelligence-contact { min-width: 0; }
.intelligence-contact > span { margin-bottom: 3px; }
.intelligence-contact > a { display: block; overflow-wrap: anywhere; color: #1e1b4b; font-size: 11px; font-weight: 700; text-decoration: none; }
.intelligence-contact > a:hover { text-decoration: underline; }
.intelligence-contact small { display: block; margin-top: 3px; color: #64748b; font-size: 9px; line-height: 1.4; }
.intelligence-contact small a { color: #4f46e5; }
.intelligence-contacts > p { margin: 0; color: #64748b; font-size: 11px; }
