:root {
  color-scheme: light;
  --ink: #182124;
  --ink-soft: #48565b;
  --muted: #748186;
  --line: #d8dfdc;
  --line-strong: #bcc7c3;
  --surface: #ffffff;
  --surface-soft: #f3f6f4;
  --canvas: #f7f9f8;
  --green: #087f6a;
  --green-dark: #086754;
  --green-soft: #dff2ed;
  --coral: #e56a54;
  --coral-soft: #fce8e3;
  --amber: #a56808;
  --danger: #bd3b34;
  --shadow: 0 12px 32px rgba(24, 33, 36, 0.12);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  min-width: 320px;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="checkbox"],
input[type="range"],
label.file-field {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.file-field:focus-within {
  outline: 3px solid rgba(8, 127, 106, 0.2);
  outline-offset: 1px;
}

.hidden {
  display: none !important;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 0 20px;
  backdrop-filter: blur(12px);
}

.brand-lockup,
.boot-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-lockup h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
}

.brand-lockup p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.brand-symbol {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: end;
  justify-content: center;
  gap: 3px;
  border: 1px solid #9bbcb4;
  border-radius: 7px;
  background: #edf7f4;
  padding: 7px;
}

.brand-symbol span {
  display: block;
  width: 4px;
  border-radius: 2px 2px 0 0;
  background: var(--green);
}

.brand-symbol span:nth-child(1) {
  height: 8px;
}

.brand-symbol span:nth-child(2) {
  height: 17px;
}

.brand-symbol span:nth-child(3) {
  height: 12px;
  background: var(--coral);
}

.brand-symbol.large {
  width: 46px;
  height: 46px;
  padding: 9px;
}

.brand-symbol.large span {
  width: 5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.engine-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.engine-dot,
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--amber);
}

.engine-badge.ready .engine-dot,
.status-line.ready .status-dot {
  background: var(--green);
}

.status-line.error .status-dot {
  background: var(--danger);
}

.icon-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  text-decoration: none;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

.icon-button.compact {
  width: 32px;
  height: 32px;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.app-layout {
  display: grid;
  min-height: calc(100vh - 66px);
  grid-template-columns: 310px minmax(0, 1fr);
}

.control-panel {
  position: relative;
  z-index: 5;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.control-section {
  border-bottom: 1px solid var(--line);
  padding: 19px 18px 21px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 15px;
}

.section-title.compact {
  align-items: center;
  margin-bottom: 13px;
}

.section-title h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 760;
}

.section-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.section-index {
  display: inline-flex;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
}

.file-field {
  display: block;
  margin-top: 13px;
}

.file-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.optional-label {
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 650;
}

.file-drop {
  display: flex;
  min-height: 57px;
  align-items: center;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: #fbfcfb;
  padding: 8px 10px;
  transition:
    border-color 120ms ease,
    background 120ms ease;
}

.file-field:hover .file-drop,
.file-drop.dragging {
  border-color: var(--green);
  background: #f3faf8;
}

.file-drop.loaded {
  border-style: solid;
  border-color: #96cbbd;
  background: #f2faf7;
}

.file-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green-dark);
}

.file-icon svg {
  width: 17px;
  height: 17px;
}

.file-copy {
  display: block;
  min-width: 0;
}

.file-copy strong,
.file-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.file-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.command-row {
  display: grid;
  margin-top: 14px;
  gap: 8px;
  grid-template-columns: 1fr 0.72fr;
}

.button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.button svg {
  width: 15px;
  height: 15px;
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.button.primary:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.button.secondary:hover,
.button.tertiary:hover {
  border-color: #98aaa4;
  background: var(--surface-soft);
  color: var(--ink);
}

.button.tertiary {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status-line {
  display: flex;
  min-height: 28px;
  align-items: flex-start;
  gap: 7px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.status-line .status-dot {
  margin-top: 3px;
}

.field,
.range-field {
  display: block;
  margin-top: 12px;
}

.field > span:first-child,
.range-field > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 680;
}

.field input,
.field select,
.field textarea,
.input-unit {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
}

.field input,
.field select {
  height: 32px;
  padding: 0 8px;
  font-size: 11px;
}

.field textarea {
  min-height: 160px;
  padding: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9aa5a1;
}

.field-row {
  display: grid;
  gap: 9px;
}

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

.font-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.input-unit {
  display: grid;
  height: 32px;
  align-items: center;
  grid-template-columns: 1fr auto;
  overflow: hidden;
}

.input-unit input {
  height: 30px;
  border: 0;
}

.input-unit span {
  padding-right: 8px;
  color: var(--muted);
  font-size: 9px;
}

.range-field input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: var(--green);
}

.range-field output {
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}

.toggle-field {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #edf0ef;
  margin-top: 11px;
  padding-top: 10px;
}

.toggle-field strong,
.toggle-field small {
  display: block;
}

.toggle-field strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.toggle-field small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.toggle-field input {
  position: relative;
  width: 32px;
  height: 18px;
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid #aebbb6;
  border-radius: 10px;
  background: #d7deda;
  transition: background 120ms ease;
}

.toggle-field input::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 29, 27, 0.25);
  content: "";
  transition: transform 120ms ease;
}

.toggle-field input:checked {
  border-color: var(--green);
  background: var(--green);
}

.toggle-field input:checked::after {
  transform: translateX(14px);
}

.palette-preview {
  display: block;
  width: 100%;
  height: 7px;
  border-radius: 3px;
  margin-top: 6px;
  background: #dde3e1;
}

.color-control {
  display: grid;
  width: 100%;
  height: 32px;
  align-items: center;
  grid-template-columns: 40px 1fr;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
}

.field .color-control input[type="color"] {
  width: 40px;
  height: 30px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 4px;
  background: transparent;
  cursor: pointer;
}

.color-control output {
  padding: 0 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.export-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, 1fr);
}

.settings-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.panel-export-controls {
  border-top: 1px solid #edf0ef;
  margin-top: 10px;
  padding-top: 1px;
}

.panel-export-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr 1fr;
  margin-top: 7px;
}

.results-panel {
  min-width: 0;
  background: var(--canvas);
}

.analysis-header {
  display: flex;
  min-height: 91px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 15px 24px;
}

.eyebrow {
  display: block;
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.analysis-title {
  min-width: 0;
}

.analysis-title h2 {
  overflow: hidden;
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.metric-strip {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
}

.metric {
  min-width: 76px;
  border-left: 1px solid var(--line);
  padding: 2px 15px;
  text-align: center;
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  color: var(--ink);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.metric span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.view-tabs {
  display: flex;
  min-height: 47px;
  align-items: end;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0 22px;
}

.view-tab {
  position: relative;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-size: 11px;
  font-weight: 680;
}

.view-tab svg {
  width: 15px;
  height: 15px;
}

.view-tab::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: transparent;
  content: "";
}

.view-tab:hover {
  color: var(--ink-soft);
}

.view-tab.active {
  color: var(--green-dark);
}

.view-tab.active::after {
  background: var(--green);
}

.tab-count {
  display: inline-flex;
  min-width: 19px;
  height: 17px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--surface-soft);
  padding: 0 5px;
  color: var(--ink-soft);
  font-size: 9px;
}

.figure-workspace {
  padding: 0 24px 22px;
}

.plot-toolbar {
  display: flex;
  min-height: 61px;
  align-items: center;
  justify-content: space-between;
}

.plot-context span,
.plot-context strong {
  display: block;
}

.plot-context span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 680;
  text-transform: uppercase;
}

.plot-context strong {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 690;
}

.plot-stage {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

#plot {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.plot-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
  backdrop-filter: blur(2px);
}

.plot-loading svg {
  width: 18px;
  height: 18px;
  animation: spin 0.8s linear infinite;
}

.figure-note {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fbfcfb;
  color: var(--muted);
  padding: 0 13px;
  font-size: 9px;
}

.mapping-workspace {
  padding: 18px 24px 24px;
}

.plate-workspace {
  padding: 18px 24px 24px;
}

.plate-toolbar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
}

.plate-summary {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.plate-scroll {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: auto;
  padding: 20px;
}

.plate-grid {
  display: grid;
  width: max-content;
  min-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  grid-template-columns: 26px repeat(
      var(--plate-columns),
      var(--well-size)
    );
}

.plate-grid[data-format="384"] {
  gap: 4px;
}

.plate-corner,
.plate-column-label,
.plate-row-label {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.plate-column-label {
  width: var(--well-size);
}

.plate-row-label {
  height: var(--well-size);
}

.plate-well {
  --well-color: #aeb8b4;

  display: grid;
  width: var(--well-size);
  height: var(--well-size);
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--well-color) 72%, #263237);
  border-radius: 50%;
  background: color-mix(in srgb, var(--well-color) 76%, white);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  color: #172024;
  font-size: 7px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.plate-well.empty {
  border-color: #d8dfdc;
  background: #f7f9f8;
  box-shadow: none;
}

.plate-well.excluded {
  border-style: dashed;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.75) 0,
      rgba(255, 255, 255, 0.75) 3px,
      transparent 3px,
      transparent 6px
    ),
    color-mix(in srgb, var(--well-color) 45%, white);
  opacity: 0.72;
}

.plate-grid[data-format="384"] .plate-well {
  box-shadow: none;
}

.plate-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fbfcfb;
  padding: 11px 13px;
}

.plate-legend-item {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9px;
}

.plate-legend-item > span:last-child {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plate-swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--well-color) 72%, #263237);
  border-radius: 50%;
  background: var(--well-color);
}

.plate-legend-more {
  color: var(--muted);
  font-size: 9px;
}

.mapping-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mapping-filter {
  display: grid;
  width: min(340px, 100%);
  height: 34px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  grid-template-columns: 34px 1fr;
}

.mapping-filter svg {
  width: 15px;
  height: 15px;
  justify-self: center;
  color: var(--muted);
}

.mapping-filter input {
  width: 100%;
  height: 32px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 9px 0 0;
  font-size: 11px;
}

.mapping-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex-wrap: wrap;
}

.mapping-summary {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 9px;
}

.mapping-summary strong {
  color: var(--ink-soft);
}

.mapping-table-wrap {
  max-height: calc(100vh - 285px);
  min-height: 430px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: auto;
}

.mapping-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mapping-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 36px;
  border-bottom: 1px solid var(--line-strong);
  background: #f1f5f3;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 760;
  text-align: left;
}

.mapping-table th,
.mapping-table td {
  border-right: 1px solid #e9edeb;
  padding: 0 8px;
}

.mapping-table th:last-child,
.mapping-table td:last-child {
  border-right: 0;
}

.mapping-table td {
  height: 37px;
  border-bottom: 1px solid #edf0ef;
  background: var(--surface);
  font-size: 10px;
}

.mapping-table tr.excluded td {
  background: #fafbfa;
  color: #94a09c;
}

.mapping-table tr.hidden-row {
  display: none;
}

.mapping-table .include-column {
  width: 50px;
  text-align: center;
}

.mapping-table .well-column {
  width: 72px;
}

.mapping-table .replicate-column {
  width: 86px;
}

.mapping-table td:first-child {
  text-align: center;
}

.mapping-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
}

.mapping-table input[type="text"],
.mapping-table input[type="number"] {
  width: 100%;
  height: 29px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  padding: 0 5px;
  font-size: 10px;
}

.mapping-table input[type="text"]:hover,
.mapping-table input[type="number"]:hover {
  border-color: var(--line);
  background: #fbfcfb;
}

.mapping-table input[type="text"]:focus,
.mapping-table input[type="number"]:focus {
  border-color: var(--green);
  background: #fff;
}

.well-id {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 720;
}

dialog {
  width: min(650px, calc(100vw - 30px));
  border: 0;
  border-radius: 7px;
  box-shadow: var(--shadow);
  padding: 0;
}

dialog::backdrop {
  background: rgba(23, 34, 32, 0.42);
  backdrop-filter: blur(2px);
}

.dialog-shell {
  padding: 20px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 15px;
}

.dialog-header h2 {
  margin: 4px 0 0;
  font-size: 16px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 16px;
}

.dialog-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid #91c4b8;
  border-radius: 6px;
  background: #eef9f5;
  box-shadow: var(--shadow);
  color: var(--green-dark);
  padding: 0 13px;
  font-size: 10px;
  font-weight: 700;
}

.toast svg {
  width: 16px;
  height: 16px;
}

.boot-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #f7f9f8;
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

.boot-screen.dismissed {
  visibility: hidden;
  opacity: 0;
}

.boot-lockup strong {
  font-size: 18px;
}

.boot-progress {
  width: 220px;
  height: 4px;
  border-radius: 2px;
  margin-top: 25px;
  background: #dde4e1;
  overflow: hidden;
}

.boot-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 2px;
  background: var(--green);
  animation: boot 1.15s ease-in-out infinite alternate;
}

.boot-screen p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
}

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

@keyframes boot {
  from {
    transform: translateX(-80%);
  }
  to {
    transform: translateX(220%);
  }
}

@media (max-width: 1120px) {
  .app-layout {
    grid-template-columns: 286px minmax(0, 1fr);
  }

  .analysis-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .metric-strip {
    width: 100%;
  }

  .metric:first-child {
    border-left: 0;
  }

  .mapping-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mapping-filter {
    width: 100%;
  }

  .mapping-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .app-header {
    position: relative;
  }

  .engine-badge {
    display: none;
  }

  .app-layout {
    display: block;
  }

  .control-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .control-section {
    padding: 17px 16px;
  }

  .analysis-header {
    padding: 16px;
  }

  .view-tabs {
    padding: 0 8px;
    overflow-x: auto;
  }

  .view-tab {
    padding: 0 10px;
  }

  .figure-workspace,
  .plate-workspace,
  .mapping-workspace {
    padding-right: 12px;
    padding-left: 12px;
  }

  .plot-stage,
  #plot {
    min-height: 470px;
  }

  .mapping-table-wrap {
    max-height: 70vh;
  }
}

@media (max-width: 560px) {
  .app-header {
    min-height: 60px;
    padding: 0 12px;
  }

  .brand-lockup p {
    display: none;
  }

  .command-row,
  .field-row.two,
  .font-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .metric:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .metric {
    padding: 7px;
  }

  .view-tab {
    font-size: 10px;
  }

  .mapping-actions .button {
    flex: 1 1 calc(50% - 4px);
  }

  .mapping-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 8px 0;
  }

  .figure-note {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
  }

  .figure-workspace[data-view="heatmap"] .plot-stage {
    overflow-x: auto;
  }

  .figure-workspace[data-view="heatmap"] #plot {
    min-width: 700px;
  }

  .figure-workspace[data-view="kinetics"] .plot-stage {
    height: var(--plot-mobile-height, 620px);
    min-height: 620px;
    aspect-ratio: auto;
  }

  .plate-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .plate-scroll {
    padding: 14px;
  }
}
