:root {
  --bg: #f4f5f7; --panel: #ffffff; --text: #1d2430; --muted: #667085;
  --line: #d9dee7; --line-soft: #e9ecf1; --blue: #2563eb; --blue-soft: #eff6ff;
  --point: #667085; --interest: #7c3aed;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
a { color: var(--blue); }
.dashboard-shell { width: min(1560px, 100%); margin: 0 auto; padding: 24px; }
.app-header { display: flex; justify-content: space-between; align-items: end; padding: 2px 0 18px; }
.app-header h1 { margin: 0; font-size: 23px; line-height: 1.3; letter-spacing: -.025em; font-weight: 650; }
.app-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.header-meta { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.panel, .summary-grid { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 12px; }
.summary-grid > div { min-height: 66px; padding: 14px 17px; border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.summary-grid > div:last-child { border-right: 0; }
.summary-grid span { color: var(--muted); font-size: 11px; }
.summary-grid strong { font-size: 18px; letter-spacing: -.02em; font-weight: 620; }
.summary-grid > div:last-child strong { font-size: 14px; }
.summary-grid .load-error { grid-column: 1 / -1; border: 0; }
.controls-panel { margin-bottom: 12px; padding: 12px; display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.controls-panel label:not(.check-field) { display: grid; gap: 5px; min-width: 155px; }
.controls-panel label > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.controls-panel .search-field { flex: 1; min-width: 220px; }
input, select { height: 35px; padding: 0 10px; color: var(--text); background: #fff; border: 1px solid #cbd1dc; border-radius: 5px; outline: none; }
input:focus, select:focus, button:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.check-field { height: 35px; padding: 0 9px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.check-field input { width: auto; height: auto; accent-color: var(--blue); }
.check-field span { color: var(--text) !important; white-space: nowrap; font-size: 12px !important; }
.reset-button { height: 35px; padding: 0 12px; color: #475467; background: #fff; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.reset-button:hover { background: #f8fafc; }
.chart-panel { margin-bottom: 12px; }
.panel-header { min-height: 67px; padding: 14px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-header h2 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.chart-actions { display: flex; align-items: center; gap: 18px; }
.zoom-toggle { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: #f8fafc; }
.zoom-toggle button { height: 27px; padding: 0 9px; border: 0; border-radius: 3px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.zoom-toggle button[aria-pressed="true"] { color: var(--text); background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.zoom-toggle button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; box-shadow: none; }
.legend { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--point); display: inline-block; }
.legend-dot.frontier { background: #fff; border: 2px solid var(--blue); }
.legend-interest { width: 9px; height: 9px; border-radius: 2px; background: var(--interest); display: inline-block; transform: rotate(45deg); }
.legend-promo { width: 9px; height: 9px; border: 2px solid #16a34a; border-radius: 50%; background: #fff; display: inline-block; }
.legend-line { width: 15px; border-top: 2px dashed #c2410c; display: inline-block; }
.chart-wrap { position: relative; height: 530px; padding: 18px 28px 42px 69px; }
.plot { position: relative; width: 100%; height: 100%; border-left: 1px solid #aeb6c3; border-bottom: 1px solid #aeb6c3; }
.y-grid { position: absolute; z-index: 0; left: 0; right: 0; border-top: 1px solid var(--line-soft); }
.y-grid span { position: absolute; left: -39px; top: -8px; width: 30px; text-align: right; color: var(--muted); font-size: 10px; }
.x-grid { position: absolute; z-index: 0; top: 0; bottom: 0; border-left: 1px solid var(--line-soft); }
.x-grid span { position: absolute; left: 0; bottom: -24px; color: var(--muted); font-size: 10px; transform: translateX(-50%); white-space: nowrap; }
.reference-line { position: absolute; z-index: 1; left: 0; right: 0; border-top: 1.5px dashed #c2410c; pointer-events: none; }
.reference-line span { position: absolute; right: 5px; top: -20px; padding: 2px 5px; color: #9a3412; background: #fff7ed; border-radius: 3px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.x-title { position: absolute; right: 29px; bottom: 11px; color: var(--muted); font-size: 10px; }
.y-title { position: absolute; left: 17px; top: 17px; color: var(--muted); font-size: 10px; writing-mode: vertical-rl; transform: rotate(180deg); }
.frontier-line { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.frontier-line path { fill: none; stroke: var(--blue); stroke-width: .5; vector-effect: non-scaling-stroke; opacity: .7; }
.model-point { position: absolute; z-index: 4; width: 10px; height: 10px; margin: -5px 0 0 -5px; padding: 0; border: 1.5px solid #fff; border-radius: 50%; background: var(--point); box-shadow: 0 0 0 1px rgba(29,36,48,.35); cursor: pointer; transition: transform 80ms ease; }
.model-point:hover, .model-point:focus-visible, .model-point.active { z-index: 5; transform: scale(1.65); background: #111827; outline: none; }
.model-point.frontier { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; background: #fff; border: 3px solid var(--blue); box-shadow: 0 0 0 1px #fff; }
.model-point.frontier:hover, .model-point.frontier:focus-visible, .model-point.frontier.active { background: var(--blue); }
.model-point.interest { z-index: 4; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border: 2px solid #fff; border-radius: 2px; background: var(--interest); box-shadow: 0 0 0 1px var(--interest); transform: rotate(45deg); }
.model-point.interest:hover, .model-point.interest:focus-visible, .model-point.interest.active { z-index: 6; background: #5b21b6; transform: rotate(45deg) scale(1.55); }
.model-point.promo { box-shadow: 0 0 0 2px #16a34a; }
.interest-label { position: absolute; z-index: 3; margin: 10px 0 0 9px; padding: 1px 3px; color: #5b21b6; background: rgba(255,255,255,.88); font-size: 9px; font-weight: 650; line-height: 1.25; white-space: nowrap; pointer-events: none; }
.interest-label.supplemental { margin-top: -22px; }
.frontier-leader { position: absolute; z-index: 2; height: 1px; visibility: hidden; background: linear-gradient(90deg, rgba(37,99,235,.75), rgba(147,197,253,.7)); box-shadow: 0 0 0 .25px rgba(255,255,255,.8); transform-origin: 0 50%; pointer-events: none; }
.frontier-label { position: absolute; z-index: 5; min-width: 108px; max-width: 172px; visibility: hidden; display: grid; gap: 2px; padding: 6px 8px 6px 9px; border: 1px solid #bfdbfe; border-left: 3px solid var(--blue); border-radius: 6px; color: #1e3a8a; background: rgba(255,255,255,.96); box-shadow: 0 3px 10px rgba(37,99,235,.12), 0 1px 2px rgba(15,23,42,.08); text-align: left; cursor: pointer; backdrop-filter: blur(4px); transition: border-color 100ms ease, box-shadow 100ms ease, transform 100ms ease; }
.frontier-label span { overflow: hidden; font-size: 10px; font-weight: 720; line-height: 1.18; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.frontier-label small { color: #64748b; font-size: 8px; font-weight: 620; line-height: 1.1; white-space: nowrap; }
.frontier-label small b { padding: 0 2px; color: #93a3b8; font-weight: 500; }
.frontier-label:hover, .frontier-label:focus-visible, .frontier-label.active { z-index: 7; border-color: #60a5fa; color: #1d4ed8; background: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.2), 0 1px 3px rgba(15,23,42,.1); outline: none; transform: translateY(-1px); }
.chart-tooltip { position: absolute; z-index: 10; width: 220px; padding: 11px; background: #111827; color: #fff; border-radius: 5px; pointer-events: none; box-shadow: 0 8px 22px rgba(17,24,39,.2); }
.chart-tooltip strong { display: block; font-size: 12px; line-height: 1.35; }
.chart-tooltip > span { display: block; margin: 3px 0 9px; color: #9ca3af; font-size: 10px; }
.chart-tooltip dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.chart-tooltip dl div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #374151; padding-top: 5px; }
.chart-tooltip dt { color: #9ca3af; font-size: 10px; }
.chart-tooltip dd { margin: 0; font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-tooltip .tooltip-note { margin: 9px 0 0; padding-top: 7px; color: #c4b5fd; border-top: 1px solid #374151; font-size: 9px; line-height: 1.35; }
.table-panel { overflow: hidden; }
.table-heading { min-height: 60px; flex-wrap: wrap; }
.table-actions { display: flex; align-items: center; gap: 14px; }
.table-hint { color: var(--muted); font-size: 11px; }
.table-sort { display: flex; align-items: center; gap: 7px; }
.table-sort > span { color: var(--muted); font-size: 10px; font-weight: 650; }
.table-sort select { width: 150px; height: 32px; }
.table-scroll { max-height: 680px; overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
thead { position: sticky; top: 0; z-index: 5; background: #f8fafc; }
th { padding: 9px 11px; color: #667085; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; letter-spacing: .02em; font-weight: 650; white-space: nowrap; }
td { padding: 10px 11px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f8fafc; }
tbody tr.selected-row { background: var(--blue-soft); }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.rank { color: var(--muted); width: 62px; font-variant-numeric: tabular-nums; }
.model-name { min-width: 220px; font-weight: 590; }
.model-name code, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
td code { display: block; margin-top: 3px; color: #8a93a3; font-size: 9px; }
.frontier-badge, .interest-badge, .promo-badge, .external-badge { margin-left: 5px; padding: 2px 5px; border-radius: 3px; font-size: 9px; font-weight: 650; }
.frontier-badge { margin-left: 8px; color: #1d4ed8; background: #dbeafe; }
.interest-badge { margin-left: 8px; color: #5b21b6; background: #ede9fe; }
.promo-badge { color: #166534; background: #dcfce7; }
.external-badge { color: #475467; background: #eef0f3; }
.score { font-weight: 650; }
.muted-cell { color: #596273; }
.empty-state { padding: 42px; text-align: center; color: var(--muted); }
footer { padding: 18px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
footer p { max-width: 1100px; margin: 0 0 4px; }
footer strong { color: #475467; }
@media (max-width: 900px) {
  .dashboard-shell { padding: 14px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid > div:nth-child(2) { border-right: 0; }
  .summary-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .chart-wrap { height: 470px; padding-right: 18px; }
  .legend { display: none; }
  .chart-actions { gap: 6px; flex-wrap: wrap; justify-content: end; }
}
@media (max-width: 560px) {
  .app-header { align-items: start; gap: 12px; }
  .header-meta { margin-top: 7px; font-size: 10px; }
  .summary-grid strong { font-size: 16px; }
  .controls-panel label:not(.check-field) { flex: 1; min-width: 135px; }
  .controls-panel .search-field { flex-basis: 100%; }
  .chart-wrap { height: 420px; padding-left: 54px; }
  .frontier-label { min-width: 0; max-width: 126px; padding: 4px 6px; border-left-width: 2px; }
  .frontier-label span { font-size: 8px; }
  .frontier-label small { display: none; }
  .panel-header { align-items: start; }
  .chart-panel .panel-header { flex-direction: column; }
  .x-grid:nth-of-type(2), .x-grid:nth-of-type(4), .x-grid:nth-of-type(6) { display: none; }
  .chart-tooltip { width: 185px; }
  .table-hint { display: none; }
  .table-actions { margin-left: auto; }
}
