:root {
  color-scheme: light;
  --bg: #eef1f0;
  --surface: #ffffff;
  --surface-soft: #f7f8f7;
  --surface-warm: #f6f4ef;
  --ink: #172325;
  --muted: #657276;
  --subtle: #879396;
  --line: #d6dedd;
  --line-strong: #b7c3c1;
  --accent: #0f766e;
  --accent-dark: #0a5f59;
  --accent-soft: #dff1ed;
  --coral: #c85e3b;
  --coral-soft: #f7e5df;
  --blue: #3f6f9d;
  --blue-soft: #e5edf5;
  --gold: #aa741e;
  --gold-soft: #fbf0d7;
  --shadow: 0 1px 2px rgba(21, 37, 39, 0.08), 0 14px 32px rgba(21, 37, 39, 0.08);
  --font: Inter, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}
button, input, select { color: inherit; font: inherit; letter-spacing: 0; }
button, select, label { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: 0.48; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
  outline-offset: 2px;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: 0; }
svg { display: block; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 11px;
  color: #fff;
  background: var(--accent-dark);
  border-radius: 4px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand-lockup, .topbar-actions, .viewer-actions, .toolbar-group, .viewer-footer, .project-stats,
.section-heading-inline, .panel-heading, .inspector-tools, .history-actions, .inspector-footer,
.viewer-footer-actions, .project-title, .image-meta, .image-card, .image-card-actions,
.lane-settings-heading, .figure-actions {
  display: flex;
  align-items: center;
}
.brand-lockup { min-width: 250px; gap: 11px; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 6px;
}
.brand-mark svg { width: 20px; height: 20px; color: #c8eee5; }
.brand-lockup h1 { margin: 0; font-size: 17px; font-weight: 760; }
.brand-lockup p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.dot::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 7px 3px; background: var(--line-strong); border-radius: 50%; }
.topbar-actions { justify-content: flex-end; gap: 7px; flex-wrap: wrap; }

.button, .icon-button, .text-button { border: 1px solid transparent; background: none; text-decoration: none; }
.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 5px;
  font-weight: 680;
  line-height: 1.2;
  white-space: nowrap;
}
.button svg, .icon-button svg { width: 17px; height: 17px; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { background: var(--surface); border-color: var(--line-strong); }
.button.secondary:hover:not(:disabled), .button.ghost:hover:not(:disabled) { background: var(--surface-soft); }
.button.ghost { color: var(--muted); }
.button.small { min-height: 31px; padding: 5px 9px; font-size: 12px; }
.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: var(--muted);
  border-radius: 5px;
}
.icon-button:hover:not(:disabled) { color: var(--ink); background: var(--surface-soft); }
.icon-button.small-icon { width: 31px; height: 31px; flex-basis: 31px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; color: var(--accent-dark); font-size: 12px; font-weight: 650; }
.text-button:hover:not(:disabled) { color: var(--coral); }
.text-button svg { width: 14px; height: 14px; }

.app-shell { width: min(1600px, 100%); margin: 0 auto; padding: 0 24px 36px; }
.project-strip {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 2px 13px;
  border-bottom: 1px solid var(--line);
}
.project-title { min-width: 0; gap: 20px; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: 0.12em; line-height: 1.3; }
.project-name-field { display: flex; min-width: min(460px, 55vw); align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 650; }
.project-name-field input { width: 100%; min-height: 34px; padding: 6px 9px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px; font-weight: 650; }
.project-stats { gap: 16px; }
.stat { display: grid; gap: 1px; min-width: 52px; text-align: right; }
.stat strong { font-size: 16px; line-height: 1.1; }
.stat small { color: var(--muted); font-size: 10px; }
.status-pill { display: inline-flex; min-height: 24px; align-items: center; padding: 4px 8px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.status-pill.is-dirty { color: var(--gold); background: var(--gold-soft); border-color: #e6cf9d; }
.status-pill.is-saved { color: var(--accent-dark); background: var(--accent-soft); border-color: #b9dfd5; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 430px); gap: 18px; padding-top: 18px; }
.viewer-panel, .inspector-panel, .image-library { min-width: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.viewer-panel, .inspector-panel { display: flex; min-height: 650px; flex-direction: column; }
.panel-heading { justify-content: space-between; gap: 15px; padding: 17px 18px 13px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .section-heading-inline h2 { margin: 3px 0 0; font-size: 18px; line-height: 1.2; white-space: nowrap; }
.viewer-heading { padding-bottom: 10px; }
.viewer-actions { gap: 3px; }
.zoom-control { display: inline-flex; min-width: 130px; align-items: center; gap: 7px; padding: 0 5px; color: var(--muted); }
.zoom-control input { width: 88px; accent-color: var(--accent); }
.zoom-control output { width: 38px; font-family: var(--mono); font-size: 11px; text-align: right; }
.viewer-toolbar { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 18px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.toolbar-group { gap: 13px; flex-wrap: wrap; }
.toggle-control { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.toggle-control input { position: absolute; opacity: 0; pointer-events: none; }
.toggle { position: relative; display: inline-block; width: 29px; height: 17px; background: #c3cdcb; border-radius: 999px; transition: background 140ms ease; }
.toggle::after { position: absolute; top: 3px; left: 3px; width: 11px; height: 11px; background: #fff; border-radius: 50%; content: ""; transition: transform 140ms ease; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.toggle-control input:checked + .toggle { background: var(--accent); }
.toggle-control input:checked + .toggle::after { transform: translateX(12px); }
.viewer-hint { color: var(--subtle); font-size: 11px; text-align: right; }

.canvas-viewport { position: relative; display: grid; min-height: 500px; flex: 1; place-items: center; overflow: auto; padding: 20px; background: var(--surface-warm); }
.canvas-viewport.is-dragging { outline: 2px dashed var(--accent); outline-offset: -8px; }
.canvas-frame { position: relative; width: min(100%, 940px); max-width: none; aspect-ratio: 4 / 3; flex: 0 0 auto; overflow: visible; background: #e6ebe9; border: 1px solid #c5cfcc; box-shadow: 0 5px 16px rgba(22, 37, 38, .12); }
.canvas-frame canvas, .canvas-frame svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.canvas-frame canvas { background: #fff; }
.canvas-frame svg { overflow: visible; touch-action: none; }
.canvas-frame.is-inverted canvas { filter: invert(1) contrast(1.06); }
.frame-badge { position: absolute; right: 8px; bottom: 8px; max-width: calc(100% - 16px); overflow: hidden; padding: 4px 7px; color: #fff; background: rgba(23, 35, 37, .77); border-radius: 3px; font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.empty-state { display: grid; width: min(460px, 100%); justify-items: center; gap: 9px; padding: 48px 24px; color: var(--muted); text-align: center; }
.empty-icon { display: grid; width: 52px; height: 52px; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 8px; }
.empty-icon svg { width: 25px; height: 25px; }
.empty-state h3 { margin: 4px 0 0; color: var(--ink); font-size: 17px; }
.empty-state p { margin: 0 0 8px; font-size: 12px; }
.viewer-footer { min-height: 52px; justify-content: space-between; gap: 15px; padding: 9px 18px; border-top: 1px solid var(--line); }
.image-meta { min-width: 0; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.viewer-footer-actions { gap: 6px; }

.inspector-panel { background: var(--surface); }
.inspector-tools { justify-content: space-between; gap: 10px; padding: 12px 16px 7px; }
.sort-lock {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #b9dfd5;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}
.sort-lock svg { width: 14px; height: 14px; }
.compact-field { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 11px; font-weight: 650; }
.compact-field select { min-height: 31px; padding: 5px 8px; background: var(--surface-soft); border: 1px solid var(--line-strong); border-radius: 4px; font-size: 12px; }
.history-actions { gap: 3px; }
.lane-settings {
  margin: 4px 16px 10px;
  padding: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.lane-settings-heading { justify-content: space-between; gap: 10px; }
.lane-settings-heading h3 { margin: 3px 0 0; font-size: 13px; line-height: 1.25; }
.lane-count-pill {
  flex: 0 0 auto;
  padding: 3px 6px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #c6d6e5;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}
.lane-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(66px, .75fr) 62px;
  gap: 6px;
  margin-top: 10px;
}
.concentration-inputs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}
.concentration-field {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 680;
  text-align: center;
}
.concentration-field span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.concentration-field input {
  width: 100%;
  min-width: 0;
  min-height: 29px;
  padding: 5px 3px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
}
.concentration-field input:focus { border-color: var(--accent); }
.lane-detect-button { width: 100%; margin-top: 9px; }
.selection-summary { display: flex; min-height: 57px; align-items: center; gap: 10px; margin: 6px 16px 9px; padding: 9px 11px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.selection-summary.is-active { background: var(--accent-soft); border-color: #b8ded6; }
.summary-icon { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; color: var(--accent); background: #fff; border: 1px solid #b8ded6; border-radius: 4px; }
.summary-icon svg { width: 16px; height: 16px; }
.selection-summary strong, .selection-summary span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-summary strong { font-size: 12px; }
.selection-summary span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.band-list { min-height: 120px; flex: 1; overflow: auto; padding: 0 12px 12px; }
.list-empty { display: grid; min-height: 165px; align-content: center; justify-items: center; gap: 8px; color: var(--subtle); font-size: 12px; text-align: center; }
.list-empty svg { width: 27px; height: 27px; color: var(--line-strong); }
.band-row { position: relative; display: grid; grid-template-columns: 25px minmax(0, 1fr) 28px; gap: 6px; align-items: start; margin-bottom: 8px; padding: 10px 7px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; transition: border-color 120ms ease, background 120ms ease; }
.band-row:hover { border-color: var(--line-strong); }
.band-row.is-selected { background: #f1faf8; border-color: #69a99e; box-shadow: inset 3px 0 0 var(--accent); }
.band-index { display: grid; width: 23px; height: 23px; place-items: center; align-self: start; color: #fff; background: var(--ink); border-radius: 4px; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.band-row.is-selected .band-index { background: var(--accent); }
.band-fields { display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: 6px; min-width: 0; }
.band-field { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 10px; font-weight: 650; }
.band-field input { width: 100%; min-height: 29px; padding: 5px 6px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 3px; font-size: 12px; }
.band-field input:focus { border-color: var(--accent); }
.band-field.kda input, .band-field.concentration input, #concentration-unit, #lane-count { font-family: var(--mono); }
.row-actions { grid-column: 3; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; gap: 1px; align-self: start; }
.row-actions button { display: inline-grid; width: 24px; height: 24px; place-items: center; padding: 0; color: var(--subtle); border: 0; background: transparent; border-radius: 3px; }
.row-actions button:hover:not(:disabled) { color: var(--ink); background: var(--surface-soft); }
.row-actions button svg { width: 14px; height: 14px; }
.row-remove { color: var(--coral) !important; }
.metric-inline { grid-column: 2 / -1; display: flex; justify-content: space-between; gap: 8px; color: var(--subtle); font-family: var(--mono); font-size: 10px; }
.metric-inline strong { color: var(--blue); font-weight: 650; }
.measurement-panel { margin: 3px 16px 12px; padding: 12px; background: var(--surface-warm); border: 1px solid #e5ded0; border-radius: 5px; }
.subsection-heading h3 { margin: 3px 0 9px; font-size: 13px; }
.measurement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0; }
.measurement-grid div { padding: 7px 6px; background: #fff; border: 1px solid #e5ded0; border-radius: 3px; }
.measurement-grid dt { color: var(--muted); font-size: 10px; }
.measurement-grid dd { margin: 3px 0 0; color: var(--ink); font-family: var(--mono); font-size: 12px; font-weight: 650; }
.lane-measurements { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e5ded0; }
.lane-measurements > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
}
.lane-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lane-metric {
  min-width: 0;
  padding: 7px 5px;
  background: #fff;
  border: 1px solid #e5ded0;
  border-radius: 3px;
  text-align: center;
}
.lane-metric span, .lane-metric small, .lane-metric strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-metric span { color: var(--muted); font-size: 9px; }
.lane-metric strong { margin-top: 3px; color: var(--blue); font-family: var(--mono); font-size: 11px; }
.lane-metric small { margin-top: 2px; color: var(--subtle); font-family: var(--mono); font-size: 9px; }
.measurement-note { margin: 8px 0 0; color: var(--subtle); font-size: 10px; line-height: 1.4; }
.inspector-footer { justify-content: space-between; gap: 8px; margin-top: auto; padding: 11px 16px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.inspector-footer > span { display: inline-flex; align-items: center; gap: 5px; }
.inspector-footer svg { width: 14px; height: 14px; color: var(--accent); }

.figure-builder, .image-library { min-width: 0; margin-top: 18px; padding: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.section-heading-inline { justify-content: space-between; gap: 12px; padding: 15px 18px 11px; border-bottom: 1px solid var(--line); }
.section-heading-inline h2 { font-size: 16px; }
.figure-actions { justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.figure-preview-surface {
  display: grid;
  min-height: 260px;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background: var(--surface-warm);
  border-bottom: 1px solid var(--line);
}
#figure-canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #c5cfcc;
  box-shadow: 0 5px 16px rgba(22, 37, 38, .12);
}
.figure-empty { display: grid; min-height: 180px; align-content: center; justify-items: center; gap: 8px; color: var(--subtle); font-size: 12px; text-align: center; }
.figure-empty svg { width: 28px; height: 28px; color: var(--line-strong); }
.figure-footer { min-height: 40px; padding: 11px 18px; color: var(--muted); font-family: var(--mono); font-size: 10px; line-height: 1.5; }
.image-library-list { display: flex; min-height: 116px; gap: 10px; overflow-x: auto; padding: 13px 16px 16px; }
.library-empty { display: flex; min-height: 82px; align-items: center; gap: 8px; color: var(--subtle); font-size: 12px; }
.library-empty svg { width: 21px; height: 21px; }
.image-card { position: relative; width: 220px; min-width: 220px; gap: 9px; padding: 7px; text-align: left; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.image-card.is-active { background: var(--accent-soft); border-color: #73afa6; box-shadow: inset 0 3px 0 var(--accent); }
.image-card-thumb { display: grid; width: 62px; height: 62px; flex: 0 0 62px; place-items: center; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 3px; }
.image-card-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-card-copy { display: grid; min-width: 0; gap: 3px; }
.image-card-copy strong, .image-card-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-card-copy strong { font-size: 12px; }
.image-card-copy span { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.image-card-copy small { color: var(--subtle); font-size: 10px; }
.image-card-actions { position: absolute; top: 5px; right: 5px; gap: 1px; }
.image-card-actions button { display: inline-grid; width: 23px; height: 23px; place-items: center; padding: 0; color: var(--subtle); border: 0; background: rgba(255,255,255,.85); border-radius: 3px; }
.image-card-actions button:hover:not(:disabled) { color: var(--coral); }
.image-card-actions svg { width: 13px; height: 13px; }

/* SVG annotation states */
.band-shape { fill: rgba(15, 118, 110, .12); stroke: #0f766e; stroke-width: .0025; vector-effect: non-scaling-stroke; cursor: move; }
.band-shape:hover { fill: rgba(15, 118, 110, .22); }
.band-group.is-selected .band-shape { fill: rgba(200, 94, 59, .14); stroke: #c85e3b; stroke-width: .0035; }
.band-label-bg { fill: rgba(23, 35, 37, .82); rx: .004; ry: .004; pointer-events: none; }
.band-label { fill: var(--ink); font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; font-size: .024px; font-weight: 650; paint-order: stroke; stroke: #fff; stroke-width: .004; pointer-events: none; }
.band-label-left, .band-label-right { dominant-baseline: middle; }
.annotation-label-bg { fill: rgba(255, 255, 255, .88); stroke: rgba(183, 195, 193, .55); stroke-width: .001; pointer-events: none; }
.lane-label { fill: var(--ink); font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; font-size: .018px; font-weight: 650; paint-order: stroke; stroke: #fff; stroke-width: .003; pointer-events: none; }
.band-index-label { fill: #fff; font-family: var(--mono); font-size: .018px; font-weight: 700; pointer-events: none; }
.lane-guide { stroke: rgba(15, 118, 110, .72); stroke-width: .0015; stroke-dasharray: .006 .004; vector-effect: non-scaling-stroke; pointer-events: none; }
.resize-handle { fill: #fff; stroke: #c85e3b; stroke-width: .003; vector-effect: non-scaling-stroke; cursor: nwse-resize; }
.resize-handle[data-handle="ne"], .resize-handle[data-handle="sw"] { cursor: nesw-resize; }
.drawing-rect { fill: rgba(15, 118, 110, .1); stroke: #0f766e; stroke-width: .003; stroke-dasharray: .012 .008; vector-effect: non-scaling-stroke; pointer-events: none; }

.toast-region { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: grid; gap: 7px; width: min(340px, calc(100vw - 36px)); pointer-events: none; }
.toast { padding: 10px 12px; color: #fff; background: rgba(23, 35, 37, .94); border-left: 3px solid #7ed1c2; border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 12px; line-height: 1.45; }
.toast.is-error { border-left-color: #ed987d; }

@media (max-width: 1120px) {
  .topbar { padding-inline: 17px; }
  .app-shell { padding-inline: 17px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 13px; }
  .project-name-field { min-width: min(360px, 48vw); }
  .lane-settings-grid { grid-template-columns: minmax(0, 1fr) 64px 56px; }
}
@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .project-strip { align-items: flex-start; flex-direction: column; gap: 11px; }
  .project-title { width: 100%; align-items: flex-start; flex-direction: column; gap: 7px; }
  .project-name-field { width: 100%; min-width: 0; }
  .project-stats { width: 100%; justify-content: flex-start; }
  .workspace-grid { grid-template-columns: 1fr; }
  .viewer-panel, .inspector-panel { min-height: 0; }
  .canvas-viewport { min-height: 420px; }
  .band-list { max-height: none; }
  .figure-preview-surface { min-height: 220px; }
}
@media (max-width: 560px) {
  body { font-size: 13px; }
  .app-shell { padding-inline: 10px; }
  .topbar { padding: 10px; }
  .brand-lockup { min-width: 0; }
  .brand-lockup h1 { font-size: 16px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .button { min-height: 33px; padding-inline: 9px; }
  .topbar-actions .button span { display: none; }
  .topbar-actions .button.primary span { display: inline; }
  .panel-heading { padding-inline: 12px; }
  .viewer-toolbar { align-items: flex-start; flex-direction: column; padding-inline: 12px; }
  .viewer-hint { text-align: left; }
  .canvas-viewport { min-height: 300px; padding: 10px; }
  .viewer-footer { align-items: flex-start; flex-direction: column; padding-inline: 12px; }
  .viewer-footer-actions { width: 100%; justify-content: flex-end; }
  .inspector-tools { padding-inline: 12px; }
  .lane-settings { margin-inline: 12px; }
  .lane-settings-grid { grid-template-columns: minmax(0, 1fr) minmax(62px, .65fr); }
  .lane-settings-grid > :first-child { grid-column: 1 / -1; }
  .concentration-inputs { gap: 4px; }
  .concentration-field { font-size: 8px; }
  .concentration-field input { padding-inline: 2px; font-size: 10px; }
  .selection-summary { margin-inline: 12px; }
  .band-list { padding-inline: 8px; }
  .band-row { grid-template-columns: 25px minmax(0, 1fr) 28px; }
  .band-fields { grid-column: 2; grid-template-columns: minmax(0, 1fr) 64px; }
  .row-actions { grid-column: 3; grid-row: 1; }
  .metric-inline { grid-column: 2 / -1; }
  .measurement-panel { margin-inline: 12px; }
  .measurement-grid { gap: 4px; }
  .measurement-grid div { padding-inline: 4px; }
  .lane-metric-grid { gap: 4px; }
  .lane-metric { padding-inline: 3px; }
  .inspector-footer { padding-inline: 12px; }
  .figure-builder .section-heading-inline { align-items: flex-start; flex-direction: column; }
  .figure-actions { width: 100%; justify-content: space-between; }
  .figure-preview-surface { min-height: 180px; padding: 10px; }
  .figure-footer { padding-inline: 12px; }
  .image-card { width: 190px; min-width: 190px; }
}
