.fc-view {
  --fc-ink: var(--ink, #1e313a);
  --fc-muted: var(--muted, #53666f);
  --fc-rule: var(--line, #d9e3e7);
  --fc-focus: var(--focus, #3b6f7d);
  --fc-ease: 160ms cubic-bezier(.2, .65, .3, 1);
  color: var(--fc-ink);
  min-width: 0;
}
.fc-view *, .fc-view *::before, .fc-view *::after { box-sizing: border-box; }
.fc-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.fc-heading { margin: 0 0 16px; }
.fc-heading h2 {
  margin: 0; font-size: clamp(24px, 2.4vw, 30px); font-weight: 600;
  line-height: 1.28; letter-spacing: -.025em;
}
.fc-heading p, .fc-note { color: var(--fc-muted); line-height: 1.7; }
.fc-heading p { margin: 6px 0 0; font-size: 14px; }
.fc-rank-link {
  color: var(--teal, #34606b); font-weight: 500;
  text-decoration: underline; text-decoration-color: rgba(52, 96, 107, .4);
  text-underline-offset: 3px;
}
.fc-rank-link:hover { color: var(--teal-strong, #234953); text-decoration-color: currentColor; }

.fc-panel {
  min-width: 0;
  background: var(--surface, #fff);
  border: 1px solid var(--fc-rule);
  border-radius: var(--radius, 10px);
  box-shadow: var(--shadow-card, 0 1px 2px rgba(24, 42, 50, .04));
}
.fc-status {
  background: #fff; border: 1px solid var(--fc-rule);
  border-radius: var(--radius, 10px); padding: 24px 16px;
}
.fc-context {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 10px 16px; padding: 13px 16px;
  border-radius: calc(var(--radius, 10px) - 1px) calc(var(--radius, 10px) - 1px) 0 0;
  background: #fff;
}
.fc-case { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; gap: 6px 10px; }
.fc-case > span, .fc-scrubber > span { color: var(--fc-muted); font-weight: 500; font-size: 12.5px; }
.fc-case select {
  width: min(340px, 100%); max-width: 100%; min-width: 0; min-height: 36px; padding: 6px 10px;
  border: 1px solid var(--line-control, #cbd8dd); border-radius: var(--radius-sm, 6px);
  background: #fcfdfd; color: var(--fc-ink);
  font: inherit; font-size: 13px; cursor: pointer; text-overflow: ellipsis;
  transition: border-color var(--fc-ease), background-color var(--fc-ease);
}
.fc-case select:hover { border-color: #9bb4bc; background: #f6fafb; }

.fc-picker { position: relative; }
.fc-picker-trigger {
  display: flex; width: fit-content; align-items: center; gap: 9px; list-style: none; cursor: pointer;
  min-height: 36px; padding: 6px 11px;
  border: 1px solid var(--line-control, #cbd8dd); border-radius: var(--radius-sm, 6px);
  color: var(--teal-strong, #234953); background: #f2f7f8; font-size: 13px; font-weight: 600;
}
.fc-picker-trigger::-webkit-details-marker { display: none; }
.fc-picker-trigger::after {
  content: ''; width: 6px; height: 6px; margin: -3px 1px 0 2px; border: solid currentColor;
  border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.fc-picker[open] .fc-picker-trigger::after { transform: translateY(3px) rotate(225deg); }
.fc-picker-trigger:hover, .fc-picker[open] .fc-picker-trigger { background: #e6eff2; border-color: #9cb6be; }
.fc-picker-count { color: #4a656e; font: 500 12px var(--mono, monospace); white-space: nowrap; }
.fc-picker-menu {
  position: absolute; z-index: 6; inset-inline-end: 0; top: calc(100% + 6px); width: min(468px, 84vw);
  padding: 10px; border: 1px solid #c6d5da; border-radius: 8px; background: #fff;
  box-shadow: var(--shadow-pop, 0 12px 32px rgba(24, 42, 50, .14));
}
.fc-picker-search {
  width: 100%; min-height: 34px; padding: 6px 10px; font-size: 13px;
  color: var(--fc-ink); background: #fafcfd;
  border: 1px solid var(--line-control, #cbd8dd); border-radius: 5px;
}
.fc-model-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start;
  gap: 2px; margin-block: 7px; max-height: min(224px, 34vh);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.fc-model-option {
  display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 30px; padding: 3px 5px;
  color: var(--fc-ink); font-size: 12px; line-height: 1.3; cursor: pointer;
  border-radius: 4px; overflow-wrap: anywhere;
}
.fc-model-option:hover, .fc-model-option:focus-within { background: #eef4f6; }
.fc-model-option:has(input:checked) { background: #eaf3f5; color: var(--teal-strong, #234953); font-weight: 600; }
.fc-model-option input { flex: none; margin: 0; width: 14px; height: 14px; accent-color: var(--teal, #34606b); cursor: pointer; }
.fc-model-option svg { flex: none; width: 18px; }
.fc-picker-empty { padding: 8px 4px 12px; color: var(--fc-muted); font-size: 13px; }
.fc-picker-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px solid var(--fc-rule); }
.fc-view .fc-picker-actions button {
  min-height: 31px; padding: 5px 9px; font-size: 12px; font-weight: 500;
  color: var(--teal-strong, #234953); background: #f3f7f8;
  border: 1px solid var(--line-control, #cbd8dd); border-radius: 5px;
}
.fc-picker-actions button:last-child { margin-inline-start: auto; }
.fc-picker-actions button:hover:enabled { background: #e6eff2; border-color: #a9bfc6; }
.fc-picker-actions button:disabled { color: #7a8b92; background: #fafbfb; border-color: #e4ecef; cursor: default; }

.fc-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fc-view .fc-legend > :is(span, button) {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font: inherit; font-size: 12px;
}
.fc-legend > span {
  margin-inline-end: 4px; padding: 4px 8px 4px 2px; font-weight: 600; color: var(--fc-ink);
}
.fc-legend button {
  padding: 4px 8px 4px 9px; min-height: 30px;
  border: 1px solid var(--line-control, #cbd8dd); border-radius: 5px;
  color: var(--fc-ink); background: #f6f9fa; font-weight: 500;
}
.fc-legend button::after {
  content: '×'; margin-left: 2px; font-size: 14px; line-height: 1;
  color: #7c9199; font-weight: 400;
}
.fc-legend button:hover {
  border-color: #93aeb6; background: #edf4f6;
}
.fc-legend button:hover::after { color: var(--fc-ink); }
.fc-view [hidden] { display: none !important; }
.fc-legend svg { flex: none; }

/* Player */
.fc-player {
  display: grid; grid-template-columns: max-content minmax(140px, 1fr) max-content;
  align-items: center; gap: 12px 24px; padding: 10px 16px;
  border-block: 1px solid var(--fc-rule); background: #f5f8fa;
}
.fc-buttons { display: flex; gap: 6px; }
.fc-view button { font: inherit; cursor: pointer; }
.fc-buttons button {
  display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 35px;
  border-radius: var(--radius-sm, 6px); border: 1px solid var(--line-control, #cbd8dd);
  background: #fff; color: #3a515b;
  transition: color var(--fc-ease), background-color var(--fc-ease), border-color var(--fc-ease), box-shadow var(--fc-ease), transform var(--fc-ease);
}
.fc-buttons .fc-play {
  color: #fff; background: var(--teal, #34606b); border-color: var(--teal, #34606b);
  font-size: 13px; font-weight: 600; padding: 0 14px; min-width: 82px;
}
.fc-buttons .fc-step { width: 35px; }
.fc-buttons button:hover:not(:disabled) {
  background: #edf3f5; border-color: #9fb7bf; box-shadow: 0 1px 3px rgba(24, 42, 50, .06);
}
.fc-buttons .fc-play:hover { background: var(--teal-strong, #234953); border-color: var(--teal-strong, #234953); }
.fc-playing .fc-buttons .fc-play {
  background: #e5eff1; border-color: #a9c1c8; color: var(--teal-strong, #234953);
}
.fc-playing .fc-buttons .fc-play:hover { background: #dae8ec; border-color: #8eb0ba; }
.fc-buttons button:active:not(:disabled) { transform: translateY(1px); }
.fc-buttons button:disabled { opacity: .45; cursor: default; }

.fc-scrubber { display: flex; align-items: center; min-width: 0; gap: 10px; }
.fc-scrubber > span { white-space: nowrap; }
.fc-scrubber input {
  --fc-track: #d6e2e6;
  --fc-fill: var(--teal, #34606b);
  appearance: none; -webkit-appearance: none; flex: 1; min-width: 32px; width: 100%;
  height: 30px; margin: 0; border: 0; border-radius: 6px;
  background: transparent; accent-color: var(--fc-focus); cursor: pointer;
}
.fc-scrubber input::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--fc-fill) var(--fc-progress), var(--fc-track) var(--fc-progress));
}
.fc-scrubber input::-moz-range-track { height: 4px; border-radius: 999px; background: var(--fc-track); }
.fc-scrubber input::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--fc-fill); }
.fc-scrubber input::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 15px; height: 15px; margin-top: -5.5px; border-radius: 50%;
  border: 2px solid var(--teal, #34606b); background: #fff; box-shadow: 0 1px 4px rgba(24, 42, 50, .16);
  transition: box-shadow var(--fc-ease), background-color var(--fc-ease), transform var(--fc-ease);
}
.fc-scrubber input::-moz-range-thumb {
  box-sizing: border-box; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--teal, #34606b); background: #fff; box-shadow: 0 1px 4px rgba(24, 42, 50, .16);
  transition: box-shadow var(--fc-ease), background-color var(--fc-ease), transform var(--fc-ease);
}
.fc-scrubber input:hover::-webkit-slider-thumb, .fc-scrubber input:active::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(52, 96, 107, .16); background-color: #f4f9fa;
}
.fc-scrubber input:hover::-moz-range-thumb, .fc-scrubber input:active::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(52, 96, 107, .16); background-color: #f4f9fa;
}
.fc-scrubber output, .fc-time time { font: 500 12px/1.4 var(--mono, Consolas, monospace); white-space: nowrap; color: #475b64; }
.fc-scrubber output { min-width: 62px; text-align: right; }
.fc-time { display: flex; gap: 1px; flex-direction: column; align-items: flex-end; }
.fc-time > span { font-size: 12px; font-weight: 600; color: var(--fc-ink); font-variant-numeric: tabular-nums; }
.fc-time time { font-size: 11px; color: var(--fc-muted); }
.fc-view :is(button, select, input, .fc-plot):focus-visible { outline: 2px solid var(--fc-focus); outline-offset: 2px; }

/* Charts Grid */
.fc-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--fc-rule);
}
.fc-card { min-width: 0; background: #fff; padding: 15px 16px 13px; }
.fc-card:hover { background: #fcfefe; }
.fc-card-title { display: flex; gap: 8px; align-items: baseline; }
.fc-card-title h3 {
  margin: 0; font: 600 clamp(19px, 1.55vw, 22px)/1.25 var(--serif, Georgia, serif);
  letter-spacing: -.02em; color: var(--fc-ink);
}
.fc-card-title > span { font-size: 12px; color: var(--fc-muted); }
.fc-plot {
  margin-top: 6px; display: block; width: 100%; height: auto;
  aspect-ratio: 330 / 137; touch-action: pan-y; cursor: crosshair; border-radius: 4px;
}
.fc-plot .fc-axis { font-family: var(--mono, Consolas, monospace); font-size: 10px; fill: #556871; }
.fc-plot .fc-future { fill: #f1f6f8; }
.fc-plot .fc-gridline { stroke: #dce4e8; stroke-width: .65; }
.fc-plot .fc-origin { stroke: #79939c; stroke-dasharray: 3 3; stroke-width: .9; }
.fc-plot .fc-cursor { stroke: #3d6470; stroke-width: 1; stroke-dasharray: 2 2; }
.fc-plot .fc-pin { stroke: #fff; stroke-width: 1.15; }
.fc-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 60px), 1fr)); gap: 6px;
  margin: 6px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line-subtle, #ebf0f2);
}
.fc-metric { min-width: 0; }
.fc-metric dt {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 0; color: var(--trace-color); font-size: 11px; font-weight: 600;
  line-height: 1.4; overflow-wrap: anywhere;
}
.fc-metric dt::before {
  content: ''; flex: none; width: 8px; height: 2.5px; border-radius: 2px;
  background: var(--trace-color);
}
.fc-metric dd {
  margin: 2px 0 0; color: var(--fc-ink); font: 500 clamp(13px, 1.05vw, 14.5px)/1.4 var(--mono, Consolas, monospace);
  font-variant-numeric: tabular-nums;
}
.fc-note {
  margin: 0; padding: 10px 16px;
  border-top: 1px solid var(--fc-rule);
  border-radius: 0 0 calc(var(--radius, 10px) - 1px) calc(var(--radius, 10px) - 1px);
  background: #fafcfd; font-size: 12px;
}

@media (max-width: 930px) {
  .fc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-player { column-gap: 14px; }
}
@media (max-width: 640px) {
  .fc-context { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 10px; }
  .fc-case { display: grid; width: 100%; }
  .fc-case select { width: 100%; min-height: 40px; }
  .fc-picker-menu { inset-inline: 0; width: 100%; }
  .fc-model-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-picker-trigger, .fc-model-option { min-height: 38px; }
  .fc-legend { gap: 5px; }
  .fc-legend button { min-height: 34px; }
  .fc-legend svg { width: 17px; }
  .fc-player {
    position: sticky; top: var(--header-height); z-index: 3;
    grid-template-columns: max-content minmax(0, 1fr); grid-template-areas: "buttons time" "slider slider";
    padding: 7px 12px 5px; gap: 2px 8px;
    background: rgba(245, 248, 250, .96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(24, 42, 50, .07);
  }
  .fc-buttons { grid-area: buttons; }
  .fc-buttons button { min-height: 36px; }
  .fc-buttons .fc-play { min-width: 74px; padding: 0 11px; }
  .fc-buttons .fc-step { width: 36px; }
  .fc-time { grid-area: time; min-width: 0; text-align: right; }
  .fc-time time { white-space: normal; text-wrap: balance; }
  .fc-scrubber { grid-area: slider; }
  .fc-scrubber input { height: 28px; }
  .fc-grid { grid-template-columns: minmax(0, 1fr); }
  .fc-card { padding: 14px 12px 12px; }
  .fc-plot { scroll-margin-top: calc(var(--header-height) + 100px); }
  .fc-metric dd { font-size: 13.5px; }
  .fc-note { padding: 10px 12px; }
}
@media (max-width: 350px) {
  .fc-buttons { gap: 3px; }
  .fc-buttons .fc-play { padding-inline: 8px; min-width: 66px; }
}
@media (prefers-reduced-motion: reduce) {
  .fc-case select, .fc-buttons button, .fc-scrubber input::-webkit-slider-thumb { transition: none; }
  .fc-buttons button:active:not(:disabled) { transform: none; }
  .fc-scrubber input::-moz-range-thumb { transition: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .fc-picker-trigger, .fc-picker-trigger::after, .fc-picker-actions button, .fc-model-option, .fc-legend button, .fc-card {
    transition: background-color var(--fc-ease), border-color var(--fc-ease), color var(--fc-ease), transform var(--fc-ease);
  }
}
@media (forced-colors: active) {
  .fc-scrubber input, .fc-scrubber input::-webkit-slider-thumb { appearance: auto; }
  .fc-scrubber input::-webkit-slider-runnable-track { background: ButtonBorder; }
}
