.cfx-shell { display: grid; gap: 12px; }
.cfx-hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel);
}
.cfx-eyebrow { color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.cfx-hero h2 { margin: 3px 0 4px; font-size: 20px; }
.cfx-sub { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.cfx-kpis { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cfx-kpi { min-width: 92px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel-2); }
.cfx-kpi span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.cfx-kpi strong { display: block; margin-top: 2px; color: var(--text); font-size: 17px; }
.cfx-controls {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel);
}
.cfx-sector-field { grid-column: span 2; }
.cfx-subsector-field { grid-column: span 3; }
.cfx-relationship-field { grid-column: span 2; }
.cfx-query-field { grid-column: span 5; }
.cfx-market-field { grid-column: span 3; }
.cfx-top-field { grid-column: span 2; }
.cfx-actions { grid-column: span 3; align-self: end; }
.cfx-field { display: grid; gap: 4px; min-width: 0; }
.cfx-field > label { color: var(--muted); font-size: 9.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.cfx-field input, .cfx-field select {
  width: 100%; min-width: 0; padding: 7px 9px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
}
.cfx-query-row, .cfx-range, .cfx-actions, .cfx-lookup { display: flex; align-items: center; gap: 6px; }
.cfx-query-row input { flex: 1; }
.cfx-range input { width: 82px; }
.cfx-btn {
  white-space: nowrap; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); background: var(--panel-2); font-weight: 650; cursor: pointer;
  touch-action: manipulation;
}
.cfx-btn:hover { color: var(--accent); border-color: var(--accent); }
.cfx-btn:focus-visible {
  color: var(--accent); border-color: var(--accent); outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cfx-btn.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.cfx-btn:disabled { opacity: .45; cursor: not-allowed; }
.company-deep-link {
  padding: 0; border: 0; color: #79c0ff; background: transparent;
  font: inherit; text-align: left; cursor: pointer;
}
.cfx-lookup-wrap { display: flex; justify-content: flex-end; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
.cfx-lookup input { width: 220px; padding: 7px 9px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
.cfx-notice { display: none; padding: 9px 12px; border: 1px solid #315277; border-radius: 7px; background: #111c2b; color: #b7cbe3; font-size: 11.5px; }
.cfx-notice.on { display: block; }
.cfx-panel { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.cfx-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.cfx-panel-head h3 { margin: 0; font-size: 14px; }
.cfx-table-wrap { overflow: auto; }
.cfx-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cfx-table-caption {
  padding: 9px 11px; color: var(--muted); background: var(--panel);
  font-size: 10.5px; line-height: 1.4; text-align: left;
}
.cfx-table th { padding: 9px 11px; text-align: left; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--border); font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.cfx-table th.num, .cfx-table td.num { text-align: right; }
.cfx-table th.sortable { cursor: pointer; }
.cfx-sort-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0;
  color: inherit; background: transparent; font: inherit; letter-spacing: inherit;
  text-transform: inherit; cursor: pointer;
}
.cfx-sort-btn:hover { color: var(--accent); }
.cfx-sort-btn:focus-visible { color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.cfx-table td { padding: 9px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cfx-table tbody tr[data-ticker], .cfx-table tbody tr[data-narrative] { cursor: pointer; }
.cfx-table tbody tr:hover { background: rgba(88,166,255,.06); }
.cfx-table tbody tr[data-ticker]:focus-visible,
.cfx-table tbody tr[data-narrative]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px; background: rgba(88,166,255,.08);
}
.cfx-ticker { color: var(--accent); font-weight: 760; }
.cfx-company-name, .cfx-topic { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.cfx-count { display: inline-block; min-width: 24px; padding: 2px 7px; border-radius: 6px; text-align: center; color: #79d8ad; background: rgba(35,134,95,.16); font-weight: 750; }
.cfx-empty, .cfx-loading { padding: 28px; color: var(--muted); text-align: center; }
.cfx-pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; }
.cfx-pager span { color: var(--muted); font-size: 11px; }
.cfx-breadcrumb { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.cfx-breadcrumb button { padding: 0; border: 0; color: var(--accent); background: transparent; cursor: pointer; }
.cfx-panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 48px; }
.cfx-panel-title { margin: 0; font-size: 19px; }
.cfx-answer {
  margin: 8px 0 12px; padding: 9px 11px; border: 1px solid #315277; border-radius: 7px;
  background: #111c2b; color: #d8e6f6; font-size: 12px; line-height: 1.45;
}
.cfx-stats { display: flex; flex-wrap: wrap; gap: 22px; margin: 14px 0; }
.cfx-stat span { display: block; color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.cfx-stat strong { display: block; margin-top: 2px; font-size: 17px; }
.cfx-detail-card { margin-bottom: 14px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.cfx-detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.cfx-detail-head h3 { margin: 0; font-size: 14px; }
.cfx-detail-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.cfx-chart-tabs {
  display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--border);
}
.cfx-chart-tabs button[role="tab"] {
  margin-bottom: -1px; padding: 7px 10px; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); background: transparent; font-weight: 650; cursor: pointer;
}
.cfx-chart-tabs button[role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.cfx-chart-tabs button[role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.cfx-chart-export { margin: 0 0 7px auto; padding-block: 5px; font-size: 10.5px; }
.cfx-chart { padding: 10px 12px 6px; }
.cfx-chart svg { display: block; width: 100%; height: auto; }
.cfx-chart-note { padding: 0 12px 12px; color: var(--muted); font-size: 10.8px; line-height: 1.45; }
.cfx-month-dot { cursor: pointer; }
.cfx-month-dot:hover circle, .cfx-month-dot:focus circle { stroke: #fff; stroke-width: 2; }
.cfx-month-detail { margin: 0 12px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel-2); }
.cfx-month-detail h4 { margin: 0 0 8px; font-size: 12px; }
.cfx-month-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cfx-month-item { padding: 8px 9px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--panel); text-align: left; cursor: pointer; }
.cfx-month-item span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.cfx-monthly-toolbar {
  display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 9px;
}
.cfx-monthly-copy { display: grid; gap: 2px; }
.cfx-monthly-toolbar strong { font-size: 12px; }
.cfx-monthly-toolbar span { color: var(--muted); font-size: 10.5px; }
.cfx-monthly-controls { display: flex; align-items: end; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.cfx-segmented { display: inline-flex; align-items: center; gap: 3px; }
.cfx-control-label { color: var(--muted); font-size: 9.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.cfx-segment {
  padding: 5px 7px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted);
  background: var(--panel-2); font-size: 10.5px; font-weight: 650; cursor: pointer; touch-action: manipulation;
}
.cfx-segment:hover { color: var(--accent); border-color: var(--accent); background: rgba(88,166,255,.09); }
.cfx-segment[aria-pressed="true"] { color: #fff; border-color: var(--accent); background: var(--accent); }
.cfx-segment:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cfx-monthly-toolbar label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10.5px; }
.cfx-monthly-toolbar select {
  padding: 5px 7px; border: 1px solid var(--border); border-radius: 5px; color: var(--text); background: var(--bg);
}
.cfx-monthly-scroll { overflow-x: auto; padding-bottom: 4px; overscroll-behavior-inline: contain; }
.cfx-monthly-canvas { width: calc(210px + var(--plot-width)); min-width: 100%; }
.cfx-price-row, .cfx-month-axis, .cfx-heat-row { display: grid; grid-template-columns: 210px var(--plot-width); }
.cfx-price-row { align-items: end; border-bottom: 1px solid var(--border); }
.cfx-price-row svg { display: block; width: var(--plot-width); height: 100px; }
.cfx-heat-label {
  min-width: 0; padding: 5px 8px; border: 0; overflow: hidden; color: var(--text); background: var(--panel);
  font-size: 10.5px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.cfx-heat-label:hover { color: var(--accent); }
.cfx-heat-label:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cfx-heat-label.static { color: var(--muted); cursor: default; }
.cfx-heat-cells { display: grid; grid-template-columns: repeat(var(--month-count), minmax(28px, 1fr)); width: var(--plot-width); }
.cfx-heat-cells.labels { min-height: 26px; }
.cfx-heat-month {
  min-width: 0; padding: 5px 2px; overflow: visible; color: var(--muted); font-size: 8.5px;
  white-space: nowrap;
}
.cfx-heat-month.active { color: var(--accent); font-weight: 700; }
.cfx-heat-row { border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent); }
.cfx-heat-row.aggregate { border-bottom-color: var(--border); }
.cfx-heat-cell {
  min-width: 0; min-height: 25px; padding: 0; border: 1px solid var(--panel);
  background: color-mix(in srgb, var(--accent) var(--heat-pct), var(--panel-2)); cursor: pointer;
}
.cfx-heat-cell.metric-sentiment.positive { background: color-mix(in srgb, #16805b var(--heat-pct), var(--panel-2)); }
.cfx-heat-cell.metric-sentiment.negative { background: color-mix(in srgb, #c2413a var(--heat-pct), var(--panel-2)); }
.cfx-heat-cell.metric-sentiment.neutral { background: var(--panel-2); }
.cfx-heat-cell.metric-relative.positive { background: color-mix(in srgb, #b7791f var(--heat-pct), var(--panel-2)); }
.cfx-heat-cell.metric-relative.negative { background: color-mix(in srgb, #2563eb var(--heat-pct), var(--panel-2)); }
.cfx-heat-cell.metric-relative.neutral { background: var(--panel-2); }
.cfx-heat-cell.metric-sentiment.unavailable,
.cfx-heat-cell.metric-relative.unavailable {
  background: repeating-linear-gradient(135deg, var(--panel-2) 0 4px, color-mix(in srgb, var(--border) 45%, var(--panel-2)) 4px 6px);
}
.cfx-heat-cell:hover { border-color: var(--text); }
.cfx-heat-cell.active { box-shadow: inset 2px 0 var(--accent), inset -2px 0 var(--accent); }
.cfx-heat-cell.aggregate { background: color-mix(in srgb, #0891b2 var(--heat-pct), var(--panel-2)); }
.cfx-heat-key {
  display: inline-block; width: 46px; height: 8px; margin-right: 6px; border-radius: 2px;
  background: linear-gradient(90deg, var(--panel-2), var(--accent));
}
.cfx-heat-key.metric-sentiment { background: linear-gradient(90deg, #c2413a, var(--panel-2), #16805b); }
.cfx-heat-key.metric-relative { background: linear-gradient(90deg, #2563eb, var(--panel-2), #b7791f); }
.company-panel-fullscreen .cfx-heat-row { content-visibility: auto; contain-intrinsic-size: 31px; }
.cfx-rel { color: var(--text); font-weight: 700; }
.cfx-rel-copy { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.cfx-sent-neg { color: #f07178; }
.cfx-sent-pos { color: #2fb27d; }
.cfx-lookup-choices { display: grid; gap: 5px; margin-top: 12px; }
.cfx-choice { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; width: 100%; padding: 10px 11px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--panel); text-align: left; cursor: pointer; }
.cfx-choice:hover { border-color: var(--accent); }

@media (max-width: 1050px) {
  .cfx-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cfx-sector-field, .cfx-subsector-field, .cfx-relationship-field,
  .cfx-query-field, .cfx-market-field, .cfx-top-field { grid-column: auto; }
  .cfx-query-field, .cfx-actions { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .cfx-hero { display: grid; }
  .cfx-kpis { justify-content: flex-start; }
  .cfx-controls { grid-template-columns: 1fr; }
  .cfx-sector-field, .cfx-subsector-field, .cfx-relationship-field,
  .cfx-query-field, .cfx-market-field, .cfx-top-field, .cfx-actions { grid-column: auto; }
  .cfx-month-items { grid-template-columns: 1fr; }
  .cfx-monthly-toolbar { align-items: stretch; flex-direction: column; }
  .cfx-monthly-controls { align-items: flex-start; justify-content: flex-start; }
  .cfx-price-row, .cfx-month-axis, .cfx-heat-row { grid-template-columns: 150px var(--plot-width); }
  .cfx-monthly-canvas { width: calc(150px + var(--plot-width)); }
  .cfx-detail-head { align-items: flex-start; flex-direction: column; }
  .cfx-detail-actions { align-items: flex-start; flex-direction: column; }
  .cfx-panel-title-row { align-items: flex-start; flex-direction: column; padding-right: 48px; }
  .cfx-chart-tabs { align-items: flex-start; flex-wrap: wrap; }
  .cfx-chart-export { flex-basis: 100%; margin-left: 0; width: fit-content; }
}
