:root {
  --bg: #0d1320;
  --panel: rgba(14, 22, 38, 0.84);
  --panel-strong: rgba(10, 16, 29, 0.92);
  --text: #ebf2ff;
  --muted: #a9b7d2;
  --line: rgba(255, 255, 255, 0.1);
  --brand: #67b6ff;
  --brand-soft: rgba(103, 182, 255, 0.18);
  --brand-2: #8fd7ff;
  --brand-3: #ffcb77;
  --danger: #ff8d8d;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.36);
  --radius: 18px;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background: var(--bg);
  padding: 18px;
  color-scheme: dark;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.app-shell > .hero,
.app-shell > .panel {
  width: min(1180px, 100%);
}

.app-shell > [data-view-panel] {
  width: min(1180px, 100%);
}

#referencePanel {
  display: grid;
  gap: 14px;
}

#referencePanel[hidden] {
  display: none !important;
}

.hero {
  padding: 20px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.04;
}

.hero p {
  margin: 0;
  max-width: 980px;
  color: rgba(235, 242, 255, 0.8);
}

.test-tabs {
  margin: 10px 0 10px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.tab-btn {
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  background: transparent;
}

.tab-btn[aria-selected="true"] {
  border-color: rgba(90, 162, 255, 0.4);
  background: linear-gradient(180deg, rgba(90, 162, 255, 0.25), rgba(90, 162, 255, 0.12));
}

.tab-btn:focus-visible {
  outline: none;
  border-color: rgba(103, 182, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(103, 182, 255, 0.14);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.hero-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  padding: 14px;
}

.hero-card-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(235, 242, 255, 0.82);
  margin-bottom: 8px;
}

.panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.compact-head h2,
.compact-head h3,
.panel-head h2,
.panel-head h3 {
  margin: 0 0 4px;
  font-size: clamp(23px, 3vw, 29px);
  line-height: 1.08;
}

.panel-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-bullets {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel-bullets li + li {
  margin-top: 4px;
}

.sos-tldr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.sos-tldr-card {
  background: rgba(255, 255, 255, 0.04);
}

.sos-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.sos-flow-step {
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.sos-flow-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.sos-flow-step strong {
  font-size: 13px;
  color: rgba(235, 242, 255, 0.92);
}

.sos-flow-arrow {
  width: 48px;
  height: 18px;
  flex: 0 0 auto;
  stroke: rgba(103, 182, 255, 0.76);
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sos-reminder-card {
  margin-top: 18px;
}

.section-kicker {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.controls {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(103, 182, 255, 0.05));
}

.grid {
  display: grid;
  gap: 10px;
}

.grid-controls {
  margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.setup-columns {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.35fr);
  grid-template-areas:
    "left-top right-top"
    "left-bottom right-bottom";
  gap: 14px;
  margin-top: 12px;
  align-items: start;
}

.grid-controls-left {
  grid-area: left-top;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.grid-fodder-controls {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.grid-fodder-controls-left,
.grid-fodder-controls-right {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.grid-fodder-controls-right {
  position: relative;
  padding-left: 18px;
}

.grid-fodder-controls-right::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: rgba(235, 242, 255, 0.76);
}

input,
select,
button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  padding: 9px 11px;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(103, 182, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(103, 182, 255, 0.14);
}

input:disabled,
select:disabled {
  cursor: not-allowed;
  color: rgba(235, 242, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

select option {
  background: #0f1728;
}

button {
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.08s ease, border-color 0.16s ease, background 0.16s ease;
}

button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

button:active {
  transform: translateY(1px);
}

button.is-stop-simulation {
  border-color: rgba(255, 149, 149, 0.72);
  background: rgba(255, 124, 124, 0.18);
  color: #ffd8d8;
}

button.is-stop-simulation:hover {
  border-color: rgba(255, 172, 172, 0.82);
  background: rgba(255, 124, 124, 0.26);
}

.control-tile {
  display: grid;
  align-content: end;
}

.action-card {
  display: grid;
}

.input-action-card {
  align-self: stretch;
}

.input-action-card .secondary-action {
  min-height: 100%;
}

.secondary-action {
  width: 100%;
  min-height: 58px;
}

.validation-message {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--danger);
}

.validation-message:empty {
  display: none;
}

.switch-card {
  display: grid;
  gap: 8px;
  align-self: stretch;
  align-content: center;
  min-height: 58px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
  color: inherit;
  text-decoration: none;
}

.safeguard-card {
  grid-area: right-top;
  gap: 10px;
  min-height: 0;
}

.safeguard-all-btn {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.1;
}

.safeguard-all-btn.is-active {
  border-color: rgba(90, 162, 255, 0.55);
  background: rgba(90, 162, 255, 0.22);
}

.safeguard-toggle-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.modifier-row {
  grid-area: right-bottom;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.modifier-row > .switch-card,
.modifier-row > .select-card {
  min-width: 0;
}

.modifier-row .switch-card {
  min-height: 58px;
}

.input-action-card {
  grid-area: left-bottom;
}

.mini-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.mini-switch-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(235, 242, 255, 0.88);
}

.select-card {
  align-self: stretch;
  align-content: center;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.select-card select {
  min-height: 40px;
}

.switch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(235, 242, 255, 0.82);
}

.switch-title-plain {
  letter-spacing: 0.01em;
  text-transform: none;
}

.event-switch {
  position: relative;
  display: inline-flex;
}

.event-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.event-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.event-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
  transition: left 0.18s ease;
}

.event-switch input:focus-visible + .event-switch-track {
  border-color: rgba(103, 182, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(103, 182, 255, 0.14);
}

.event-switch input:checked + .event-switch-track {
  border-color: rgba(90, 162, 255, 0.55);
  background: rgba(90, 162, 255, 0.22);
}

.event-switch input:checked + .event-switch-track::after {
  left: 21px;
}

.summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.fodder-summary-grid {
  margin-top: 14px;
}

.fodder-summary-grid .metric-value,
.fodder-summary-grid .metric-value-small {
  font-size: clamp(18px, 3vw, 24px);
}

.exact-stack {
  display: grid;
  gap: 0;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.exact-section {
  min-width: 0;
}

.exact-section + .exact-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.exact-section-head {
  margin-bottom: 12px;
}

.exact-section-head h3,
.exact-section-head h4 {
  margin: 0 0 4px;
}

.exact-section .table-wrap {
  margin-top: 12px;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-value {
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.05;
  font-weight: 800;
}

.metric-value-small {
  font-size: clamp(16px, 3vw, 22px);
}

.plot-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.plot-section + .plot-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-head + .plot-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.plot-section-head h4 {
  margin: 0 0 4px;
  font-size: 17px;
}

.plot-stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  margin-top: 12px;
}

.plot-stats-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.plot-stats-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.plot-stat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.plot-stat-spacer {
  min-height: 0;
}

.plot-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.plot-card-head h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.histogram-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 12px;
}

.plot-tooltip {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 16, 29, 0.96);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  white-space: nowrap;
}

.lookup-matrix-table {
  width: max-content;
  min-width: 0;
}

.lookup-matrix-table-fluid {
  width: max-content;
  min-width: 100%;
}

.lookup-matrix-table th,
.lookup-matrix-table td {
  text-align: center;
  min-width: 86px;
}

.lookup-matrix-table th:first-child,
.lookup-matrix-table td:first-child {
  text-align: left;
  width: 1%;
  min-width: 0;
  background: rgba(10, 16, 29, 0.96);
}

.lookup-highlight {
  background: rgba(103, 182, 255, 0.18);
  color: var(--brand-2);
  font-weight: 700;
}

.lookup-highlight-label {
  color: var(--brand-2);
  font-weight: 700;
}

.lookup-cross-hover {
  box-shadow: inset 0 0 0 999px rgba(103, 182, 255, 0.14);
}

.panel-tool {
  min-width: 260px;
  max-width: 340px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.panel-tool-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(235, 242, 255, 0.58);
  white-space: nowrap;
}

.panel-tool select {
  min-width: 170px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.plot-tool {
  min-width: 0;
  max-width: none;
  width: max-content;
  display: grid;
  gap: 10px;
  align-items: stretch;
  justify-self: end;
}

.plot-tool-row {
  display: flex;
  align-items: end;
  gap: 8px;
  width: 100%;
}

.plot-tool-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.plot-tool input {
  min-width: 0;
  width: 100%;
}

.simulation-progress-wrap {
  display: grid;
  gap: 6px;
  width: 100%;
}

.simulation-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.simulation-progress-value {
  font-size: 12px;
  color: rgba(235, 242, 255, 0.76);
}

.simulation-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.simulation-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(103, 182, 255, 0.92), rgba(155, 255, 176, 0.92));
  transition: width 0.12s linear;
}

.inset-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.14));
}

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

.rulebook-section-title {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 14px 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.rulebook-grid > .rulebook-section-title:first-child {
  margin-top: 4px;
  padding-top: 2px;
  border-top: none;
}

.rule-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
}

.rule-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(235, 242, 255, 0.82);
}

.rule-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(235, 242, 255, 0.74);
}

@media (max-width: 900px) {
  .plot-stats-grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plot-stats-grid-five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plot-stat-spacer {
    display: none;
  }

  .rulebook-grid {
    grid-template-columns: 1fr;
  }

  .grid-fodder-controls {
    grid-template-columns: 1fr;
  }

  .sos-tldr-grid {
    grid-template-columns: 1fr;
  }

  .sos-flow {
    align-items: stretch;
  }

  .sos-flow-arrow {
    transform: rotate(90deg);
    margin: 0 auto;
  }

  .grid-fodder-controls-left,
  .grid-fodder-controls-right {
    grid-template-columns: 1fr;
  }

  .grid-fodder-controls-right {
    padding-left: 0;
    padding-top: 18px;
  }

  .grid-fodder-controls-right::before {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
  }
}

canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(13, 19, 32, 0.96), rgba(7, 11, 20, 0.98));
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.table-wrap-tall {
  max-height: 640px;
  scrollbar-color: rgba(103, 182, 255, 0.72) rgba(8, 12, 20, 0.88);
  scrollbar-width: thin;
}

.table-wrap-reference {
  max-height: 46rem;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.table-wrap-tall::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-wrap-tall::-webkit-scrollbar-track {
  background: rgba(8, 12, 20, 0.88);
  border-radius: 999px;
}

.table-wrap-tall::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(103, 182, 255, 0.92), rgba(103, 182, 255, 0.54));
  border: 2px solid rgba(8, 12, 20, 0.88);
  border-radius: 999px;
}

.table-wrap-tall::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(143, 215, 255, 0.92), rgba(103, 182, 255, 0.66));
}

.table-wrap-tall::-webkit-scrollbar-corner {
  background: rgba(8, 12, 20, 0.88);
}

.strategy-table-wrap {
  max-height: 36rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.42);
  scrollbar-color: rgba(103, 182, 255, 0.72) rgba(8, 12, 20, 0.88);
  scrollbar-width: thin;
}

.strategy-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.strategy-table-wrap::-webkit-scrollbar-track {
  background: rgba(8, 12, 20, 0.88);
  border-radius: 999px;
}

.strategy-table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(103, 182, 255, 0.92), rgba(103, 182, 255, 0.54));
  border: 2px solid rgba(8, 12, 20, 0.88);
  border-radius: 999px;
}

.strategy-table-wrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(143, 215, 255, 0.92), rgba(103, 182, 255, 0.66));
}

.strategy-table-wrap::-webkit-scrollbar-corner {
  background: rgba(8, 12, 20, 0.88);
}

.strategy-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  table-layout: fixed;
}

.strategy-table th,
.strategy-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
}

.strategy-table thead th {
  position: sticky;
  top: 0;
  background: rgba(10, 16, 29, 0.96);
  color: rgba(235, 242, 255, 0.9);
  z-index: 1;
}

.strategy-table tbody tr:hover {
  background: rgba(103, 182, 255, 0.08);
}

.strategy-table th:nth-child(1),
.strategy-table td:nth-child(1) {
  width: 72px;
}

.strategy-table th:nth-child(2),
.strategy-table td:nth-child(2),
.strategy-table th:nth-child(3),
.strategy-table td:nth-child(3) {
  width: 104px;
}

.strategy-table th:nth-child(4),
.strategy-table td:nth-child(4) {
  width: 108px;
}

.strategy-table th:nth-child(5),
.strategy-table td:nth-child(5) {
  width: 126px;
}

.strategy-table th:nth-child(6),
.strategy-table td:nth-child(6) {
  width: 96px;
}

.strategy-table th:nth-child(7),
.strategy-table td:nth-child(7),
.strategy-table th:nth-child(8),
.strategy-table td:nth-child(8) {
  width: 96px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  filter: invert(0.84) hue-rotate(180deg) saturate(0.6);
  opacity: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(10, 16, 29, 0.96);
  color: rgba(235, 242, 255, 0.9);
  z-index: 1;
}

tbody tr:hover {
  background: rgba(103, 182, 255, 0.08);
}

.cell-hit {
  color: var(--brand-2);
  font-weight: 700;
}

.cell-muted {
  color: rgba(255, 255, 255, 0.54);
}

.note {
  margin: 0;
  font-size: 12px;
  color: rgba(235, 242, 255, 0.66);
}

code {
  font-family: var(--mono);
}

@media (max-width: 760px) {
  body {
    padding: 12px;
  }

  .plot-grid {
    grid-template-columns: 1fr;
  }

  .plot-stats-grid-four {
    grid-template-columns: 1fr;
  }

  .plot-stats-grid-five {
    grid-template-columns: 1fr;
  }

  .setup-columns {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left-top"
      "left-bottom"
      "right-top"
      "right-bottom";
  }

  .grid-controls-left {
    grid-template-columns: 1fr;
  }

  .safeguard-toggle-row {
    grid-template-columns: 1fr;
  }

  .modifier-row {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
  }

  .panel-tool {
    width: 100%;
    max-width: none;
    justify-content: space-between;
  }

  .panel-tool select {
    min-width: 0;
    flex: 1 1 auto;
  }

  .metric-value {
    font-size: 24px;
  }
}
