:root {
  color-scheme: light;
  --canvas: #fffcf0;
  --panel: #f2f0e5;
  --panel-strong: #e6e4d9;
  --surface: #fffffc;
  --surface-soft: #fbf8ea;
  --line: #dad8ce;
  --line-strong: #c8c4b8;
  --ink: #100f0f;
  --muted: #6f6e69;
  --faint: #878580;
  --accent: #24837b;
  --accent-strong: #1c6c66;
  --blue: #205ea6;
  --green: #66800b;
  --amber: #ad8301;
  --orange: #da702c;
  --red: #af3029;
  --shadow: 0 18px 48px rgba(16, 15, 15, 0.12);
  --display:
    'Red Hat Display Variable', 'Red Hat Display', 'Inter', ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --body:
    'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
label.button {
  user-select: none;
}

.app-shell {
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  height: 100%;
  min-width: 0;
}

.captcha-gate {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 252, 240, 0.95), rgba(242, 240, 229, 0.98)),
    var(--canvas);
}

.captcha-card {
  display: grid;
  width: min(540px, 100%);
  gap: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.captcha-card h1 {
  margin-top: 10px;
  overflow: visible;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.04;
  white-space: normal;
  text-wrap: balance;
}

.captcha-copy {
  max-width: 56ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.captcha-form {
  display: grid;
  gap: 10px;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.captcha-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.captcha-status.error {
  color: var(--red);
}

.captcha-status.working {
  color: var(--amber);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 18px 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  max-width: min(62vw, 720px);
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  text-wrap: balance;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--canvas);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.back-link {
  width: fit-content;
  border-radius: 6px;
  color: var(--accent-strong);
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.eyebrow,
.section-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: 0;
}

h1 {
  overflow: hidden;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

.top-actions,
.canvas-toolbar,
.tool-group,
.json-header,
.panel-header {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 10px;
  flex-shrink: 0;
}

.button,
.tool-button,
.icon-button {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 620;
  line-height: 1;
}

.button {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  padding: 0 12px;
}

.button.primary {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #fffffc;
}

.button.subtle {
  background: var(--surface-soft);
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.button.danger {
  color: var(--red);
}

.button:disabled,
.button.disabled,
.tool-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.tool-button {
  min-height: 32px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
}

.tool-button.active {
  border-color: var(--accent);
  background: #e6f0ed;
  color: var(--accent-strong);
}

.icon-button {
  display: inline-grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  padding: 0 8px;
  background: var(--surface-soft);
  font-family: var(--mono);
  font-size: 12px;
}

.button:hover,
.tool-button:hover,
.icon-button:hover {
  border-color: var(--accent);
}

.button:focus-visible,
.tool-button:focus-visible,
.icon-button:focus-visible,
.text-field:focus-visible,
.select-field:focus-visible,
.json-text:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

.run-status {
  min-width: 78px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--panel);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.run-status.ready,
.stage-dot.done {
  color: var(--green);
}

.run-status.running,
.stage-dot.running {
  color: var(--amber);
}

.run-status.error,
.stage-dot.error {
  color: var(--red);
}

.save-state {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.save-state.pending,
.save-state.working {
  color: var(--amber);
}

.save-state.saved {
  color: var(--green);
}

.save-state.error {
  color: var(--red);
}

.json-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: 260px minmax(420px, 1fr) 390px;
  background: var(--canvas);
}

.pipeline-panel,
.inspector-panel {
  min-height: 0;
  background: var(--panel);
}

.pipeline-panel {
  border-right: 1px solid var(--line);
  overflow: auto;
}

.inspector-panel {
  display: grid;
  grid-template-rows: minmax(180px, 1fr) minmax(176px, 0.55fr);
  border-left: 1px solid var(--line);
  overflow: hidden;
}

.panel-header {
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.stage-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 12px 12px;
  list-style: none;
}

.stage-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  color: var(--faint);
}

.stage-label {
  overflow: hidden;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.stage-time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.image-info-card {
  margin: 10px 12px 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.loaded-image-name {
  position: relative;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.loaded-image-name-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loaded-image-name.is-truncated:hover::after,
.loaded-image-name.is-truncated:focus-visible::after {
  content: attr(data-full-name);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(320px, 72vw);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(16, 15, 15, 0.16);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
  z-index: 3;
}

.canvas-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 52px minmax(0, 1fr) 32px;
  background: var(--canvas);
}

.canvas-toolbar {
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

.tool-group {
  gap: 6px;
  min-width: 0;
}

.tool-group.compact {
  margin-left: auto;
}

.zoom-label {
  min-width: 46px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

.stage-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(rgba(218, 216, 206, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(218, 216, 206, 0.34) 1px, transparent 1px),
    var(--surface-soft);
  background-size: 24px 24px;
}

.empty-state {
  display: grid;
  position: absolute;
  inset: 0;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
}

.empty-title {
  max-width: 420px;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
}

.empty-copy {
  max-width: 460px;
  color: var(--muted);
  line-height: 1.5;
}

.image-layer {
  position: relative;
  margin: 28px;
  overflow: hidden;
  background: var(--surface);
  transform-origin: top left;
  box-shadow: var(--shadow);
}

.image-layer img {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--surface);
  max-width: none;
}

.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: none;
}

.edge-line {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.edge-hit {
  fill: none;
  stroke: transparent;
  stroke-linecap: round;
  stroke-width: 12;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}

.edge-label {
  fill: var(--accent-strong);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.edge-line.selected {
  stroke: var(--blue);
  stroke-width: 3;
}

.edge-line.has-shape {
  stroke: var(--accent);
  stroke-width: 3;
}

.edge-line.attach-target {
  stroke: var(--amber);
  stroke-width: 3;
}

.edge-line.linked-selection {
  stroke: var(--blue);
  stroke-width: 3;
}

.connection-preview {
  fill: none;
  stroke: var(--blue);
  stroke-dasharray: 6 4;
  stroke-linecap: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.shape-attach-preview {
  fill: none;
  stroke: var(--amber);
  stroke-dasharray: 4 4;
  stroke-linecap: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.shape-assignment-line {
  fill: none;
  stroke: var(--amber);
  stroke-dasharray: 5 3;
  stroke-linecap: round;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.shape-assignment-dot {
  fill: var(--surface);
  stroke: var(--amber);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.shape-assignment-line.linked-selection {
  stroke: var(--blue);
  stroke-dasharray: none;
  stroke-width: 2.4;
}

.shape-assignment-dot.linked-selection {
  stroke: var(--blue);
}

.shape-assigned-halo {
  fill: rgba(173, 131, 1, 0.1);
  pointer-events: none;
  stroke: var(--amber);
  stroke-dasharray: 5 3;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.shape-assigned-halo.linked-selection {
  fill: rgba(32, 94, 166, 0.12);
  stroke: var(--blue);
  stroke-dasharray: none;
}

.shape-assigned-pin {
  fill: var(--amber);
  pointer-events: none;
  stroke: var(--surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.object-box {
  fill: rgba(255, 252, 240, 0.12);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  cursor: grab;
}

.object-box.connectable {
  cursor: crosshair;
}

.object-box.not-connectable {
  cursor: not-allowed;
  opacity: 0.72;
}

.object-box.node {
  stroke: var(--accent);
}

.object-box.tensor_shape {
  stroke: var(--amber);
}

.object-box.tensor_shape.assigned {
  fill: rgba(173, 131, 1, 0.12);
  stroke: var(--amber);
  stroke-width: 3;
}

.object-box.tensor_shape.linked-selection {
  fill: rgba(32, 94, 166, 0.1);
  stroke: var(--blue);
  stroke-width: 3;
}

.object-box.graph_input {
  stroke: var(--green);
}

.object-box.graph_output {
  stroke: var(--red);
}

.object-box.boundary {
  fill: rgba(255, 255, 252, 0.48);
  stroke-dasharray: 6 4;
}

.object-box.selected {
  stroke: var(--blue);
  stroke-width: 3;
}

.object-label-bg {
  fill: var(--surface);
  cursor: grab;
  pointer-events: auto;
  stroke: var(--line-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.object-label {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.handle {
  fill: var(--surface);
  stroke: var(--blue);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.handle.nw,
.handle.se {
  cursor: nwse-resize;
}

.handle.ne,
.handle.sw {
  cursor: nesw-resize;
}

.draw-preview {
  fill: rgba(32, 94, 166, 0.08);
  stroke: var(--blue);
  stroke-dasharray: 6 4;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.crop-dim {
  fill: rgba(16, 15, 15, 0.18);
  pointer-events: none;
}

.crop-hit {
  fill: rgba(36, 131, 123, 0.04);
  cursor: move;
}

.crop-rect {
  fill: none;
  stroke: var(--blue);
  stroke-dasharray: 7 5;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.crop-handle {
  fill: var(--surface);
  stroke: var(--blue);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.crop-handle.nw,
.crop-handle.se {
  cursor: nwse-resize;
}

.crop-handle.ne,
.crop-handle.sw {
  cursor: nesw-resize;
}

.canvas-hint {
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-section,
.json-section {
  min-width: 0;
  min-height: 0;
  border-bottom: 1px solid var(--line);
}

.inspector-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.object-inspector {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.text-field,
.select-field {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
}

.text-field.invalid {
  border-color: var(--red);
}

.node-controls,
.edge-controls,
.shape-controls {
  display: grid;
  gap: 8px;
}

.node-class-current {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface-soft);
}

.node-class-current span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.node-class-current strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-op-controls {
  display: grid;
  gap: 6px;
}

.field-help {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-help.error {
  color: var(--red);
}

.field-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.field-chip-list {
  display: flex;
  min-height: 32px;
  flex-wrap: wrap;
  gap: 6px;
}

.field-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  gap: 6px;
  padding: 0 4px 0 9px;
}

.field-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-remove {
  display: inline-grid;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  place-items: center;
}

.field-remove:hover {
  background: var(--panel-strong);
  color: var(--red);
}

.field-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 28px;
}

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

.op-list {
  display: grid;
  max-height: 184px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.op-option {
  appearance: none;
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.op-option:last-child {
  border-bottom: 0;
}

.op-option.active,
.op-option:hover {
  background: #e6f0ed;
  color: var(--accent-strong);
}

.op-option-other {
  min-height: 58px;
  background: var(--surface-soft);
}

.op-option-title {
  display: block;
  overflow: hidden;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-option:not(.op-option-other) .op-option-title {
  overflow-wrap: anywhere;
  white-space: normal;
}

.op-option-hint,
.op-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.op-empty {
  padding: 9px 10px;
}

.selection-badge {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.metrics-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.metrics-list div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
}

.metrics-list dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.metrics-list dd {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-inspector {
  min-height: 0;
  margin: 0 16px 16px;
  overflow: auto;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.json-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-bottom: 0;
  overflow: hidden;
}

.json-header {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  background: var(--panel);
}

.json-text {
  width: calc(100% - 32px);
  min-height: 0;
  margin: 0 16px 16px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
  tab-size: 2;
}

.json-line {
  display: block;
  min-height: 1.55em;
  border-left: 2px solid transparent;
  padding: 0 4px 0 8px;
}

.json-selection-line {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-left-color: var(--accent);
  color: var(--ink);
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 220px minmax(360px, 1fr) 340px;
  }

  .topbar {
    padding-left: 14px;
  }
}

@media (max-width: 940px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100%;
    height: auto;
    grid-template-rows: auto auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(560px, 70vh) auto;
  }

  .pipeline-panel,
  .inspector-panel {
    border: 0;
  }

  .stage-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .image-info-card {
    margin-bottom: 12px;
  }

  .inspector-panel {
    grid-template-rows: minmax(180px, 320px) 230px;
  }
}

@media (max-width: 640px) {
  .captcha-card {
    padding: 22px;
  }

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

  .canvas-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .tool-group {
    flex-wrap: wrap;
  }

  .tool-group.compact {
    margin-left: 0;
  }

  .stage-list {
    grid-template-columns: 1fr 1fr;
  }

  .empty-title {
    font-size: 21px;
  }
}
