:root {
  color-scheme: light;
  --nav-width: 216px;
  --canvas: #f3f6fb;
  --surface: #fff;
  --text: #16243a;
  --muted: #53637b;
  --faint: #60718a;
  --border: #dce5f0;
  --subtle: #f5f8fc;
  --primary: #1858c9;
  --primary-hover: #1048ad;
  --primary-soft: #eaf2ff;
  --up: #b43848;
  --down: #16756a;
  --round: 14px;
  --mono: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font: 14px/1.55 "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

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

body {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
}

h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; font-weight: 650; line-height: 1.4; }
h3 { font-size: 16px; font-weight: 650; }
a { color: inherit; text-decoration: none; }
button, input, select { color: inherit; font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .54; }

:is(a, button, input, select, summary):focus-visible {
  outline: 2px solid #3478ec;
  outline-offset: 3px;
}

.icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.navigation {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 28px 14px 18px;
  background: linear-gradient(155deg, #192b48, #101b2e 52%);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 7px;
  line-height: 1.15;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: #2569e1;
  box-shadow: inset 0 1px #ffffff33;
}

.brand-mark svg { width: 27px; height: 27px; }
.brand-text { font-size: 22px; font-weight: 650; letter-spacing: -.55px; }

.brand-text small {
  display: block;
  margin-top: 5px;
  color: #adbeda;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .1px;
  white-space: nowrap;
}

.side-nav { display: grid; gap: 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #b8c6dd;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.nav-item:hover { color: #fff; background: #ffffff0d; }

.nav-item.active {
  color: #fff;
  background: #233c63;
  border-color: #2d4872;
  box-shadow: inset 3px 0 #7eacff;
}

.nav-item.active .icon { color: #b3ceff; }
.connection {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 17px 9px 2px;
  border-top: 1px solid #ffffff20;
  color: #b8c6dd;
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #8ca1c2;
  box-shadow: 0 0 0 3px #8ca1c225;
}

.status-dot.online { background: #52d7aa; box-shadow: 0 0 0 3px #52d7aa24; }
.status-dot.offline { background: #f39980; box-shadow: 0 0 0 3px #f3998024; }

.workspace {
  width: 100%;
  max-width: 1700px;
  margin-inline: auto;
  padding: 33px clamp(24px, 2.55vw, 44px) 40px;
}

.page-heading { margin-bottom: 25px; }

.page-heading h1 {
  font-size: clamp(26px, 2.5vw, 36px);
  font-weight: 700;
  line-height: 1.23;
  letter-spacing: -.035em;
}

.page-heading p { margin-top: 8px; color: var(--muted); font-size: 13px; }

.context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 23px;
}

.context-card, .panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--round);
  background: var(--surface);
  box-shadow: 0 2px 4px #213c6506;
}

.context-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 86px;
  padding: 14px 16px;
}

.context-icon, .empty-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.context-icon .icon { width: 21px; height: 21px; }
.model-icon { background: #edf1fc; color: #4d5fab; }
.data-icon { background: #e8f6f3; color: #20766a; }
.context-content { min-width: 0; }

.context-content h2 {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.context-content strong {
  display: block;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.context-detail {
  margin-top: 3px;
  color: var(--faint);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.context-detail:empty { display: none; }
.instrument-label { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; margin-bottom: 4px; }
.instrument-label h2 { margin: 0; }
.context-content .instrument-code { font: 650 18px/1.3 var(--mono); }

.status-label {
  display: inline-block;
  flex: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eef3fa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
}

.instrument-label .status-label { padding: 2px 5px; background: var(--primary-soft); color: #2557a3; font-size: 10px; }
.result-badge.ready { background: #e8f6f3; color: #1b695e; }

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(316px, 337px);
  grid-template-areas: "results settings";
  align-items: start;
  gap: 19px;
}

.sidebar { grid-area: settings; }
.results-column { grid-area: results; min-width: 0; }

.settings-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--border);
}

.settings-heading > .icon { width: 19px; height: 19px; color: var(--primary); }
.settings-heading h2 { font-size: 16px; }
button.settings-toggle { display: none; }
.market-settings, .model-search { padding: 15px 17px; }

.workflow-tabs, .result-switch {
  display: flex;
  gap: 3px;
  padding: 4px;
  border-radius: 9px;
  background: #eef2f8;
}

.workflow-tabs { margin: 0 17px 15px; }

.workflow-tabs button, .result-switch button {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.workflow-tabs button:hover, .result-switch button:hover { color: var(--primary); }

.workflow-tabs button[aria-selected="true"], .result-switch button[aria-pressed="true"] {
  border-color: #dce5f1;
  background: var(--surface);
  box-shadow: 0 1px 2px #253e6612;
  color: var(--primary-hover);
  font-weight: 650;
}

.form-page { padding: 0 17px 17px; }
.form-section { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.form-section + .form-section { margin-top: 14px; }
.form-section > label { margin-top: 10px; }

.form-section legend {
  margin-bottom: 7px;
  padding: 0;
  font-size: 12px;
  font-weight: 650;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.market-settings { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
label { display: block; color: var(--muted); font-size: 12px; }

input:not([type="checkbox"]), select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 37px;
  margin-top: 4px;
  padding: 6px 9px;
  border: 1px solid #cfdaea;
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

select { padding-right: 4px; }
input[type="date"] { padding-inline: 7px; }
input::placeholder { color: #677992; }
input.symbol-input { font-family: var(--mono); }
:is(input, select):enabled:hover { border-color: #9db5d5; }
:is(input, select):disabled { background: #f0f4f9; color: #65738a; }

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  flex: none;
  accent-color: var(--primary);
}

.check-row { display: flex; align-items: center; gap: 8px; min-height: 25px; }
.field-help { margin-top: 6px; color: var(--faint); font-size: 11px; line-height: 1.6; }

.advanced-settings {
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--subtle);
}

.advanced-settings[open] { padding-bottom: 10px; }
.advanced-settings > :is(label, .field-grid) { margin-top: 9px; }

:is(.advanced-settings, .settings-group, .metric-details) > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

:is(.advanced-settings, .settings-group, .metric-details) > summary::-webkit-details-marker { display: none; }

:is(.advanced-settings, .settings-group, .metric-details) > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: -3px 3px 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

:is(.advanced-settings, .settings-group, .metric-details)[open] > summary::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

:is(.advanced-settings, .settings-group, .metric-details) > summary:hover { color: var(--primary-hover); }

.settings-group { border-top: 1px solid var(--border); }

.settings-group > summary {
  min-height: 46px;
  padding: 10px 17px;
  color: var(--text);
  font-size: 13px;
}

.settings-group > summary .icon { width: 16px; height: 16px; color: var(--faint); }
.disclosure-form { padding-top: 4px; }
.disclosure-form > .check-row { margin-top: 9px; }
.form-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.stacked-actions { grid-template-columns: 1fr; }

.primary-button, .secondary-button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}

.primary-button { background: var(--primary); color: #fff; }
.primary-button:hover:enabled { background: var(--primary-hover); }
.secondary-button { border-color: #cfdaea; background: var(--surface); color: #344862; }
.secondary-button:hover:enabled { border-color: #98b4df; background: #f7faff; color: var(--primary-hover); }
.text-button { min-height: 30px; padding: 4px 7px; color: var(--primary-hover); }
.text-button:hover:enabled { background: var(--primary-soft); }
:is(.primary-button, .secondary-button, .text-button) .icon { width: 15px; height: 15px; }

.strategy-row { display: grid; grid-template-columns: 1fr 78px; align-items: center; gap: 8px; margin-top: 8px; }

.upload-area {
  padding: 13px 10px;
  border: 1px dashed #9ab6df;
  border-radius: 8px;
  background: #f7faff;
  text-align: center;
}

.upload-area strong, .upload-area span { display: block; }
.upload-area strong { color: var(--text); }
.upload-area span { margin-top: 4px; font-size: 11px; }
.upload-area input[type="file"] { min-height: 0; margin-top: 7px; background: transparent; padding: 4px; border: 0; font-size: 11px; }
.upload-area input::file-selector-button { border: 1px solid var(--border); border-radius: 5px; background: white; padding: 5px 7px; font: inherit; }

.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #d6e0ed;
}

.result-tabs { display: flex; gap: clamp(10px, 1.4vw, 22px); }

.result-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 43px;
  margin-bottom: -1px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.result-tab .icon { width: 16px; height: 16px; }
.result-tab:hover { color: var(--primary-hover); }
.result-tab[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary-hover); font-weight: 650; }
.result-switch { padding: 2px; border-radius: 7px; margin-bottom: 4px; }
.result-switch button { min-height: 28px; padding-inline: 7px; font-size: 11px; }
.overview-stack, .records-stack, .experiments-stack { display: grid; gap: 14px; }

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 19px;
}

.panel-heading > div { min-width: 0; }
.panel-heading p { margin-top: 5px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.panel-heading > :is(.status-label, button) { align-self: center; }
.panel-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; }
.chart-panel > .notice { margin-inline: 19px; margin-bottom: 10px; }

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 15px;
  margin: 0 19px 2px;
  padding: 8px 12px;
  border-radius: 7px;
  background: var(--subtle);
  color: var(--muted);
  font-size: 12px;
}

.summary strong { color: var(--text); font-weight: 650; }

.empty-state {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(365px, 47vh, 505px);
  margin: 0 15px 15px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid #e2eaf6;
  border-radius: 10px;
  background-color: #f9fbff;
  background-image: linear-gradient(#e6edf7 1px, transparent 1px), linear-gradient(90deg, #e6edf7 1px, transparent 1px);
  background-position: 0 -1px, -1px 0;
  background-size: 100% 20%, 10% 100%;
}

.chart-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  padding-inline: 5%;
  pointer-events: none;
}

.chart-placeholder span { position: relative; }

.chart-placeholder span::before, .chart-placeholder span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: var(--level);
  transform: translate(-50%, -50%);
  background: #cddcf1;
}

.chart-placeholder span::before { width: 1px; height: calc(var(--body) + 23px); }

.chart-placeholder span::after {
  width: min(54%, 15px);
  height: var(--body);
  border: 1px solid #ceddf2;
  border-radius: 2px;
  background: #e1ebf9;
}

.chart-placeholder span:nth-child(3n)::after { background: #edf3fc; }

.empty-content {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100%, 342px);
  padding: 23px 18px;
  border: 1px solid #e1e9f5;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 10px 30px #27477612;
  text-align: center;
}

.empty-icon { width: 44px; height: 44px; margin-bottom: 10px; }
.empty-icon .icon { width: 24px; height: 24px; }
.empty-content h3, .view-empty h3 { font-size: 17px; }
.empty-content p, .view-empty p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.empty-actions button { min-height: 39px; }

.chart {
  width: 100%;
  height: clamp(430px, 57vh, 640px);
  min-width: 0;
}

.chart .modebar { margin-right: 13px; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-block: 15px;
}

#metrics { margin: 0 18px 14px; border-radius: 9px; background: var(--subtle); }
.metric { min-width: 0; padding: 2px 14px; border-right: 1px solid var(--border); }
.metric:last-child { border: 0; }
.metric span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }

.metric strong {
  font-size: clamp(18px, 1.6vw, 27px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.positive { color: var(--up); }
.negative { color: var(--down); }

.metric-details { padding: 0 18px 16px; }
.metric-details > summary { min-height: 43px; border-top: 1px solid var(--border); }
.metric-details .table-scroll { border: 1px solid var(--border); border-radius: 8px; }

.view-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 320px;
  padding: 28px;
  text-align: center;
}

.table-scroll {
  max-height: 550px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #b9c8dc transparent;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

th, td { padding: 10px 13px; border-bottom: 1px solid #e8eef6; }
th { position: sticky; top: 0; background: #f2f6fc; color: var(--muted); font-weight: 650; }
td { vertical-align: middle; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }

.table-empty, .catalog-message { padding: 42px 18px; color: var(--muted); font-size: 12px; text-align: center; }
.catalog-list { border-radius: 0 0 var(--round) var(--round); }
.catalog-list table { min-width: 680px; }
.catalog-list .loaded-row { background: #eff5ff; }
.catalog-name { color: var(--text); font-weight: 650; }
.catalog-name, .catalog-filename { min-width: 118px; max-width: 250px; white-space: normal; overflow-wrap: anywhere; }
.catalog-filename, .secondary-line { color: var(--faint); font-size: 11px; }
.secondary-line { display: block; margin-top: 3px; }
#experiment-list table { min-width: 630px; }

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 12px;
}

.table-pagination > div { display: flex; gap: 7px; }
.table-pagination button, td button { min-height: 30px; padding-inline: 8px; }

.experiment-info { padding: 0 19px 17px; font-size: 12px; }
.experiment-info dl { display: grid; grid-template-columns: minmax(80px, 118px) minmax(0, 1fr); gap: 8px 12px; margin: 0 0 14px; }
.experiment-info dt { color: var(--muted); }
.experiment-info dd { margin: 0; overflow-wrap: anywhere; }
.experiment-info details + details { margin-top: 10px; }
.experiment-info pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.notice {
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid #c5d8fa;
  border-radius: 9px;
  background: var(--primary-soft);
  color: #245191;
  font-size: 12px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.notice.error { border-color: #efc7cb; background: #fff0f1; color: #992e3d; }

.task-progress {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #c5d8fa;
  border-radius: 9px;
  background: var(--surface);
}

.task-progress > div { display: flex; align-items: center; gap: 8px; font-size: 12px; }
#task-percent { margin-left: auto; color: var(--primary); font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 5px; margin-top: 9px; accent-color: var(--primary); }

.spinner {
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid #c5d8fa;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1160px) {
  :root { --nav-width: 72px; }
  .navigation { align-items: center; padding-inline: 10px; }
  .brand { margin: 0; }
  .brand-text, .nav-item span, #connection-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .side-nav { width: 100%; }
  .nav-item { justify-content: center; padding-inline: 0; }
  .connection { width: 100%; justify-content: center; }
  .workspace-layout { grid-template-columns: minmax(0, 1fr) 316px; }
}

@media (min-width: 911px) and (max-height: 820px) {
  .workspace { padding-top: 22px; }
  .page-heading, .context-grid { margin-bottom: 16px; }
  .page-heading h1 { font-size: 30px; }
  .context-card { min-height: 74px; padding-block: 10px; }
  .settings-heading { min-height: 47px; padding-block: 9px; }
  .market-settings { padding-block: 10px; }
  .workflow-tabs { margin-bottom: 10px; }
  .form-section + .form-section, .form-section > label { margin-top: 8px; }
  .form-section legend { margin-bottom: 4px; }
  .sidebar :is(input:not([type="checkbox"]), select) { min-height: 34px; }
  .form-actions { margin-top: 10px; }
}

@media (max-width: 910px) {
  .workspace { padding-top: 26px; }
  .workspace-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "settings" "results"; gap: 13px; }
  .sidebar:not(.settings-expanded) .settings-content { display: none; }
  .sidebar:not(.settings-expanded) .settings-heading { border-bottom: 0; }
  button.settings-toggle { display: inline-flex; margin-left: auto; }
  .context-card { gap: 9px; padding-inline: 12px; }
  .context-icon { width: 35px; height: 35px; }
  .context-icon .icon { width: 17px; height: 17px; }
}

@media (max-width: 650px) {
  body { display: block; }
  .navigation {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    height: auto;
    padding: 13px 15px 10px;
  }
  .brand-text, .nav-item span, #connection-status { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .brand-text { font-size: 19px; }
  .brand-text small { margin-top: 4px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .side-nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .nav-item { min-height: 37px; font-size: 12px; gap: 7px; }
  .nav-item .icon { width: 16px; height: 16px; }
  .connection { grid-row: 1; grid-column: 2; margin: 0; width: auto; padding: 0; border: 0; font-size: 10px; }
  .workspace { padding: 19px 15px 24px; }
  .page-heading { margin-bottom: 16px; }
  .page-heading p { margin-top: 5px; font-size: 12px; }
  .context-grid { gap: 8px; margin-bottom: 14px; }
  .context-card { min-height: 65px; }
  .context-content h2 { font-size: 11px; }
  .context-content strong, .context-content .instrument-code { font-size: 14px; }
  input:not([type="checkbox"]), select { font-size: 16px; }
  input[type="date"] { font-size: 14px; }
  .settings-heading { min-height: 48px; padding-block: 8px; }
  .panel-heading { padding: 13px 14px; }
  .panel-heading h2 { font-size: 16px; }
  .chart-panel > .notice, .summary { margin-inline: 13px; }
  .empty-state { margin: 0 9px 9px; min-height: 322px; padding: 14px; }
  .empty-content { padding: 16px 10px; }
  .chart { height: 425px; }
}

@media (max-width: 510px) {
  .context-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .context-card:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .metric:nth-child(2) { border: 0; }
  #result-tabs { width: 100%; justify-content: space-between; gap: 0; }
  .result-tab { font-size: 12px; }
  .result-switch { margin-bottom: 5px; }
}

@media (max-width: 350px) {
  .context-icon { width: 28px; height: 28px; }
  .context-card { gap: 7px; padding-inline: 8px; }
  .connection { font-size: 9px; }
  .empty-actions button { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
