:root {
  color-scheme: dark;
  --bg: #101413;
  --panel: #181d1b;
  --panel2: #1d2420;
  --border: #2c342f;
  --text: #edf1e9;
  --muted: #89958b;
  --lime: #bcf49a;
  --green: #a6dda5;
  --red: #ef9c94;
  --amber: #e7c58d;
  --sidebar: 216px;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
button,
a {
  touch-action: manipulation;
}
a {
  color: var(--lime);
  text-decoration: none;
}
button {
  color: var(--text);
}
button,
input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel2);
}
button {
  padding: 9px 13px;
}
button:hover {
  border-color: #52614f;
}
button.primary {
  background: var(--lime);
  color: #1c2b15;
  border-color: var(--lime);
  font-weight: 650;
}
button.ghost {
  background: transparent;
  border-color: transparent;
}
button.active,
.segmented button.active {
  background: #33412c;
  color: var(--lime);
  border-color: #526746;
}
input,
select,
textarea {
  padding: 11px 12px;
  color: var(--text);
  min-width: 0;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
select {
  max-width: 100%;
}
.icon {
  width: 19px;
  height: 19px;
  vertical-align: middle;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 38px;
  min-height: 38px;
  padding: 8px;
  background: transparent;
}
.muted {
  color: var(--muted);
}
.positive {
  color: var(--green);
}
.negative {
  color: var(--red);
}
.small {
  font-size: 12px;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 29px;
  letter-spacing: -1px;
  font-weight: 550;
}
h2 {
  font-size: 17px;
  font-weight: 550;
}
h3 {
  font-size: 14px;
  font-weight: 550;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}
.stack {
  display: grid;
  gap: 20px;
}
.brand-mark {
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -2px;
}
.brand-mark span {
  color: var(--lime);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 38px;
}
.brand-sub {
  font-size: 9px;
  letter-spacing: 2.1px;
  border-left: 1px solid #495044;
  padding-left: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 0 12px;
  margin-bottom: 12px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav button {
  border: 0;
  background: none;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px;
  color: var(--muted);
}
.nav button.active {
  background: #252f23;
  color: var(--lime);
}
.nav .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 10px 0;
}
.machine {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.machine-icon {
  width: 34px;
  height: 34px;
  background: var(--panel2);
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.live-dot {
  width: 6px;
  height: 6px;
  background: var(--lime);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 4px #bcf49a0d;
  margin-right: 5px;
}
.live-dot.off {
  background: var(--amber);
  box-shadow: none;
}
.main {
  margin-left: var(--sidebar);
  padding: 30px 38px 35px;
  max-width: 1800px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 35px;
  gap: 16px;
}
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb span {
  color: var(--text);
  margin-left: 7px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sync-label {
  font-size: 11px;
  color: var(--muted);
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 25px;
  gap: 18px;
}
.page-header p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.7;
}
.run-picker {
  max-width: 335px;
  font-size: 12px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
}
.panel-pad {
  padding: 22px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px 23px;
  gap: 12px;
}
.panel-head .eyebrow {
  margin-bottom: 6px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 22px;
}
.metric {
  padding: 20px 22px;
  position: relative;
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.metric-value {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}
.metric-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.metric-bar {
  height: 3px;
  border-radius: 5px;
  background: #323c30;
  margin-top: 17px;
  overflow: hidden;
}
.metric-bar i {
  display: block;
  height: 100%;
  background: var(--lime);
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 20px;
  margin-bottom: 22px;
}
.chart-toolbar {
  padding: 0 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.performance-panel {
  scroll-margin-top: 16px;
  min-width: 0;
}
.chart-hint {
  margin-top: 8px;
  line-height: 1.5;
}
.chart-stats-block {
  padding: 16px 23px 8px;
  border-top: 1px solid var(--border);
}
.chart-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px 14px;
}
.stat {
  min-width: 0;
}
.stat > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
.stat > strong {
  display: block;
  font-size: 18px;
  font-weight: 500;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.chart-stats-note {
  margin-top: 12px;
  gap: 8px;
}
.holdings-note {
  line-height: 1.7;
  margin: 14px 0;
}
.chart-stats-note > span {
  font-size: 10px;
}
.segmented {
  display: flex;
  gap: 2px;
  background: #111612;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
}
.segmented button {
  border: 0;
  background: none;
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 4px;
  color: var(--muted);
}
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  padding: 12px 24px 0;
}
.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}
.chart {
  position: relative;
  padding: 8px 13px 0;
  min-height: 230px;
}
.chart svg {
  display: block;
  width: 100%;
  height: 265px;
  overflow: visible;
}
.chart .gridline {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 6;
}
.chart text {
  fill: var(--muted);
  font-size: 10px;
  font-family: inherit;
}
.chart .curve {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .hoverline {
  stroke: #75856a;
  stroke-dasharray: 4 4;
}
.chart-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding: 14px 23px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  top: 25px;
  background: #202b23;
  border: 1px solid #4c604d;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.9;
  box-shadow: 0 8px 25px #0004;
  white-space: nowrap;
}
.run-status {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 5px;
  background: #2e3828;
  color: var(--lime);
  white-space: nowrap;
}
.run-status.paused {
  background: #3b3327;
  color: var(--amber);
}
.run-status.failed {
  background: #3c2928;
  color: var(--red);
}
.run-status.completed {
  background: #29332d;
  color: #a6b4a9;
}
.run-status.stale {
  background: #3b3327;
  color: var(--amber);
}
.run-name {
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  margin: 15px 0 8px;
}
.progress-track {
  height: 5px;
  background: #303a2e;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0 8px;
}
.progress-track i {
  display: block;
  background: var(--lime);
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s;
}
.run-stats {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}
.run-stats .row {
  font-size: 11px;
  justify-content: space-between;
}
.run-stats .row span:first-child {
  color: var(--muted);
}
.run-mini-footer {
  border-top: 1px solid var(--border);
  margin-top: 22px;
  padding-top: 17px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
}
.alpha-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 23px 18px;
  flex-wrap: wrap;
}
.alpha-toolbar input {
  flex: 1;
  min-width: 170px;
  font-size: 12px;
  background: var(--bg);
}
.alpha-toolbar select {
  font-size: 12px;
}
.tabs {
  display: flex;
  gap: 18px;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 0;
  font-size: 12px;
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  color: var(--lime);
  border-bottom-color: var(--lime);
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
th {
  text-align: right;
  font-weight: 400;
  color: var(--muted);
  font-size: 10px;
  background: #141a16;
  padding: 12px 17px;
  white-space: nowrap;
}
td {
  border-top: 1px solid var(--border);
  padding: 16px 17px;
  text-align: right;
  font-size: 12px;
  white-space: nowrap;
}
th:first-child,
td:first-child {
  text-align: left;
  padding-left: 23px;
}
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}
tr.alpha-row:hover {
  background: #222b22;
}
.alpha-row {
  cursor: pointer;
}
.alpha-row.is-selected {
  background: color-mix(in srgb, var(--lime) 6%, var(--panel));
  box-shadow: inset 3px 0 var(--lime);
}
.alpha-table {
  min-width: 980px;
}
.alpha-table th,
.alpha-table td {
  padding-left: 12px;
  padding-right: 12px;
}
.alpha-selection {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin: 8px 0 0 41px;
}
.is-selected .alpha-selection {
  color: var(--lime);
}
.alpha-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.alpha-initial {
  width: 31px;
  height: 31px;
  background: #2c3629;
  color: #c3d0bc;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
}
.candidate-link {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font-size: 12px;
}
.candidate-link:hover {
  color: var(--lime);
}
.alpha-caption {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xml-preview {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: left;
  white-space: nowrap;
}
.xml-preview:hover {
  color: var(--lime);
  background: none;
}
.selected-tag {
  color: var(--green);
  font-size: 9px;
}
.score-badge {
  font-family: ui-monospace, monospace;
  background: #2e3828;
  color: var(--lime);
  padding: 5px 7px;
  border-radius: 4px;
}
.sparkline {
  width: 86px;
  height: 30px;
  display: block;
  margin-left: auto;
}
.sparkline path {
  fill: none;
  stroke: var(--lime);
  stroke-width: 1.4;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}
.row-actions button {
  min-width: 31px;
  min-height: 31px;
  padding: 5px;
  border-color: transparent;
}
.row-actions .icon {
  width: 16px;
  height: 16px;
}
.starred {
  color: var(--amber) !important;
}
.table-footer {
  padding: 14px 23px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
.table-footer button {
  padding: 6px 10px;
}
.notice {
  border: 1px solid #555137;
  background: #29281d;
  color: #d6c89e;
  padding: 11px 16px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.empty {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 220px;
  padding: 28px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 12px;
}
.empty .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  color: #66785e;
}
.footer {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #748073;
  gap: 15px;
  margin-top: 26px;
}
.run-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.run-card {
  padding: 22px;
}
.run-card h3 {
  margin: 17px 0 8px;
  overflow-wrap: anywhere;
  font-size: 15px;
}
.run-card .card-count {
  font-size: 27px;
  margin: 20px 0 4px;
  font-variant-numeric: tabular-nums;
}
.run-card .card-actions {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 17px;
  margin-top: 22px;
}
.compare-bar {
  background: #2a3827;
  border: 1px solid #465c3c;
  border-radius: 10px;
  padding: 13px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.event {
  display: flex;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.event:last-child {
  border: 0;
}
.event-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 5px;
  flex-shrink: 0;
}
.event p {
  font-size: 12px;
  line-height: 1.6;
}
.event time {
  font-size: 10px;
  color: var(--muted);
}
.setting-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.setting-row p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.7;
}
.setting-row:last-child {
  border: 0;
}
.settings {
  max-width: 850px;
}
.instructions {
  font-size: 12px;
  color: var(--muted);
  line-height: 2;
}
.boot,
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
.login-card {
  max-width: 390px;
  width: calc(100% - 40px);
  padding: 35px;
}
.login h1 {
  font-size: 24px;
  margin: 20px 0 10px;
}
.login p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}
.login form {
  display: grid;
  gap: 15px;
  margin-top: 26px;
}
.login label {
  font-size: 12px;
  color: var(--muted);
}
.login input {
  margin-top: 8px;
  width: 100%;
  font-size: 16px;
}
.login .error {
  color: var(--red);
}
.remember-device {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  line-height: 1.6;
}
.remember-device input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 0;
  accent-color: var(--accent);
}
.password-form {
  display: grid;
  gap: 18px;
  max-width: 480px;
  margin: 0 auto;
}
.password-form label:not(.remember-device) {
  display: grid;
  gap: 9px;
  font-size: 13px;
}
.password-form input[type="password"] {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}
.password-form .error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  opacity: 0;
  transition: all 0.2s;
  background: #e0ebd9;
  color: #1a2515;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 100;
  max-width: 90vw;
  box-shadow: 0 10px 30px #0005;
}
#toast.show {
  transform: translateX(-50%);
  opacity: 1;
}
dialog {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  width: min(1000px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
}
dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(6px);
}
.detail-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
}
.detail-body {
  padding: 24px;
}
.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 22px;
  gap: 12px;
}
.detail-metrics .stat {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.detail-metrics .stat > strong {
  font-size: 22px;
}
.detail-metric {
  padding: 16px;
}
.detail-metric strong {
  display: block;
  font-size: 22px;
  margin-top: 10px;
  font-weight: 500;
}
.detail-section {
  margin-top: 24px;
}
.detail-section h3 {
  margin-bottom: 14px;
}
.formula {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 1.8;
}
#detail-expression {
  scroll-margin-top: 100px;
}
.expression-heading {
  gap: 10px;
  margin-bottom: 14px;
}
.expression-heading h3 {
  margin: 0;
}
.expression-note {
  margin-top: 12px;
  line-height: 1.9;
}
.xml-formula {
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.9;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}
.xml-formula code {
  font: inherit;
}
.xml-tag {
  color: var(--green);
}
.xml-attr {
  color: var(--muted);
}
.xml-value {
  color: var(--amber);
}
.heatmap {
  display: grid;
  grid-template-columns: 45px repeat(12, minmax(0, 1fr));
  gap: 5px;
  min-width: 550px;
}
.heatmap .month {
  font-size: 10px;
  text-align: center;
  color: var(--muted);
  padding: 6px 0;
}
.heatmap .cell {
  text-align: center;
  border-radius: 4px;
  font-size: 9px;
  padding: 12px 1px;
  background: var(--panel2);
}
.heatmap .year {
  font-size: 10px;
  align-self: center;
  color: var(--muted);
}
.note {
  width: 100%;
  min-height: 85px;
  resize: vertical;
  background: var(--panel);
  font-size: 12px;
}
.mobile-nav {
  display: none;
}
.connection-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f1;
  --panel: #fff;
  --panel2: #edf0e8;
  --border: #dfe4da;
  --text: #233025;
  --muted: #758173;
  --lime: #527c2d;
  --green: #3e7d52;
  --red: #bd6863;
  --amber: #94712d;
}
[data-theme="light"] .segmented,
[data-theme="light"] th {
  background: #f0f3eb;
}
[data-theme="light"] .segmented button.active,
[data-theme="light"] .nav button.active,
[data-theme="light"] .score-badge {
  background: #e4edd8;
}
[data-theme="light"] tr.alpha-row:hover {
  background: #f5f8f0;
}
[data-theme="light"] .tooltip {
  background: #f3f7ed;
}
[data-theme="light"] .compare-bar {
  background: #e4edd8;
}
[data-theme="light"] .notice {
  background: #f7f1da;
}
@media (min-width: 1500px) {
  .main {
    padding: 36px 48px;
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .chart svg {
    height: 300px;
  }
}
@media (max-width: 1190px) {
  :root {
    --sidebar: 185px;
  }
  .sidebar {
    padding-left: 14px;
    padding-right: 14px;
  }
  .main {
    padding: 25px;
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1fr) 255px;
  }
  .metric {
    padding: 18px;
  }
  .metric-value {
    font-size: 26px;
  }
  .run-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hide-medium {
    display: none;
  }
  .brand-sub {
    display: none;
  }
}
@media (max-width: 900px) {
  :root {
    --sidebar: 0px;
  }
  .sidebar {
    display: none;
  }
  .main {
    padding: 25px 24px 100px;
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 30;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  }
  .mobile-nav button {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    min-width: 55px;
    font-size: 9px;
    background: none;
    border: 0;
    color: var(--muted);
    padding: 5px;
  }
  .mobile-nav button.active {
    color: var(--lime);
  }
  .topbar {
    margin-bottom: 24px;
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .metric {
    padding: 15px;
  }
  .metrics-grid {
    gap: 10px;
  }
  .metric-label {
    font-size: 11px;
  }
  .metric-value {
    font-size: 24px;
  }
  .chart-footer {
    flex-wrap: wrap;
  }
  .footer {
    padding-bottom: 10px;
  }
  #toast {
    bottom: 90px;
  }
}
@media (max-width: 650px) {
  .main {
    padding: 20px 16px 100px;
  }
  .topbar {
    margin-bottom: 24px;
  }
  .breadcrumb {
    font-size: 11px;
  }
  .sync-label {
    font-size: 10px;
  }
  .top-actions {
    gap: 5px;
  }
  .top-actions .hide-mobile {
    display: none;
  }
  h1 {
    font-size: 26px;
  }
  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
  }
  .run-picker {
    width: 100%;
    max-width: none;
    min-height: 42px;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
  }
  .metric {
    padding: 16px;
  }
  .metric-value {
    font-size: 28px;
  }
  .metric-label {
    font-size: 11px;
  }
  .metric-sub {
    font-size: 10px;
  }
  .metric-bar {
    margin-top: 11px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
  }
  .active-run {
    display: none;
  }
  .panel-head {
    padding: 18px 16px;
  }
  .panel-head h2 {
    font-size: 15px;
  }
  .chart-toolbar {
    padding: 0 16px;
  }
  .legend {
    padding: 14px 16px 0;
    gap: 12px;
    font-size: 10px;
  }
  .chart {
    padding: 5px 3px 0;
    min-height: 215px;
  }
  .chart svg {
    height: 230px;
  }
  .chart-footer {
    padding: 12px 16px;
    font-size: 9px;
  }
  .alpha-toolbar {
    padding: 0 16px 15px;
    gap: 8px;
  }
  .alpha-toolbar input {
    min-width: 100px;
  }
  .alpha-toolbar select {
    width: 110px;
  }
  .tabs {
    gap: 15px;
  }
  .tabs button {
    font-size: 11px;
  }
  .hide-mobile {
    display: none !important;
  }
  th {
    padding: 10px 9px;
    font-size: 9px;
  }
  td {
    padding: 14px 9px;
    font-size: 11px;
  }
  th:first-child,
  td:first-child {
    padding-left: 15px;
  }
  .alpha-initial {
    display: none;
  }
  .alpha-caption {
    max-width: 115px;
  }
  .candidate-link {
    font-size: 11px;
  }
  .alpha-name {
    gap: 0;
  }
  .sparkline {
    width: 60px;
    height: 25px;
  }
  .row-actions {
    gap: 0;
  }
  .row-actions button {
    min-width: 30px;
    min-height: 36px;
  }
  .table-footer {
    padding: 13px 16px;
    font-size: 10px;
  }
  .footer {
    font-size: 9px;
    line-height: 1.7;
  }
  .run-grid {
    grid-template-columns: 1fr;
  }
  .run-card {
    padding: 20px;
  }
  .detail-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    margin: 0;
  }
  .detail-header {
    padding: 18px 16px;
    padding-top: max(18px, env(safe-area-inset-top));
  }
  .detail-body {
    padding: 18px 16px 35px;
  }
  .detail-header h2 {
    font-size: 15px;
  }
  .setting-row {
    align-items: flex-start;
    gap: 15px;
  }
  .setting-row p {
    font-size: 11px;
  }
  .panel-pad {
    padding: 20px;
  }
  .tooltip {
    font-size: 10px;
    padding: 7px 10px;
  }
  .compare-bar {
    padding: 12px;
    font-size: 11px;
  }
  .compare-bar button {
    font-size: 11px;
    padding: 7px 9px;
  }
  .detail-section table {
    min-width: 470px;
  }
  .performance-panel .panel-head {
    align-items: flex-start;
  }
  .performance-panel .panel-head > .segmented {
    flex-shrink: 0;
  }
  .chart-stats-block {
    padding: 16px 16px 8px;
  }
  .chart-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
  }
  .chart-stats .stat > strong {
    font-size: 22px;
  }
  .alpha-list {
    overflow: visible;
  }
  .alpha-table,
  .alpha-table tbody {
    display: block;
    min-width: 0;
  }
  .alpha-table thead {
    display: none;
  }
  .alpha-table .alpha-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 8px;
    padding: 18px 16px 12px;
    border-top: 1px solid var(--border);
  }
  .alpha-table td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
    min-width: 0;
  }
  .alpha-table .alpha-identity,
  .alpha-table .alpha-actions {
    grid-column: 1 / -1;
  }
  .alpha-table .alpha-identity {
    position: relative;
  }
  .alpha-table .alpha-caption {
    max-width: 100%;
    width: 100%;
    margin-top: 7px;
  }
  .alpha-table .alpha-name,
  .alpha-table .alpha-name > div {
    min-width: 0;
    width: 100%;
  }
  .alpha-table .candidate-link {
    font-size: 13px;
    min-height: 26px;
  }
  .alpha-table .alpha-selection {
    position: absolute;
    top: 7px;
    right: 0;
    margin: 0;
    pointer-events: none;
  }
  .alpha-table .alpha-stat {
    font-size: 14px;
  }
  .alpha-table .alpha-stat::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 9px;
    font-family: inherit;
    margin-bottom: 7px;
  }
  .alpha-table .row-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 7px;
    gap: 12px;
  }
  .alpha-table .row-actions button {
    min-width: 40px;
    min-height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
