.aq-step-page { display: flex; flex-direction: column; gap: 16px; padding: 0 0 32px; max-width: 1280px; }
.aq-step-page h1 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.2; }
.aq-step-lead { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.aq-step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aq-step-card h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.2; }
.aq-step-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.aq-step-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.aq-step-field { display: flex; flex-direction: column; gap: 4px; min-width: 160px; font-size: 12px; font-weight: 600; }
.aq-step-field input, .aq-step-select select {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
}
.aq-step-select { position: relative; display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; }
.aq-step-select select { appearance: none; padding-right: 32px; }
.aq-step-select .aq-chevron { position: absolute; right: 12px; bottom: 8px; color: var(--muted); pointer-events: none; }
.aq-step-parents { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.aq-step-parent {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.aq-step-parent[aria-current="true"] { background: var(--soft); }
.aq-step-layers { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.aq-step-layers li { display: flex; gap: 8px; align-items: baseline; }
.aq-step-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aq-step-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 8px 12px;
}
.aq-step-table td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.aq-step-table td.num, .aq-step-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.aq-step-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--scrim);
}
.aq-step-dialog {
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}
.aq-step-dialog form {
  width: min(440px, calc(100vw - 32px));
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aq-step-dialog h2 { margin: 0; font-size: 18px; font-weight: 600; }
.aq-step-dialog p { margin: 0; font-size: 14px; color: var(--muted); }
.aq-step-dialog .aq-step-actions { justify-content: flex-end; }
.hx-btn.danger {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--line-strong);
}
.hx-btn.danger:hover:not(:disabled) { background: var(--danger-soft); }
@media (max-width: 720px) {
  .aq-step-actions .hx-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .aq-step-page, .aq-step-dialog { transition: none; }
}
/* ACQ-GRID-PAGE-1: the Grid step. The map and a 340 px side panel, then the layers card full width. */
.aq-grid-head { display: flex; flex-direction: column; gap: 8px; }
.aq-grid-titles { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.aq-grid-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.aq-grid-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.aq-grid-map-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.aq-grid-map { height: 460px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.aq-grid-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.aq-grid-seg button {
  appearance: none;
  border: 0;
  height: 32px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font: 600 13px/1 var(--font);
  cursor: pointer;
  transition: background 120ms ease;
}
.aq-grid-seg button + button { border-left: 1px solid var(--line-strong); }
.aq-grid-seg button:hover:not([aria-pressed="true"]) { background: var(--surface-2); }
.aq-grid-seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.aq-grid-seg button:focus-visible { outline-offset: -2px; }
.aq-grid-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.aq-grid-legend li { display: inline-flex; align-items: center; gap: 8px; }
.aq-grid-key { flex: none; width: 20px; height: 12px; border-radius: 4px; }
.aq-grid-key.is-area { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.aq-grid-key.is-cells, .aq-grid-key.is-patch {
  border: 1px solid var(--accent);
  background-color: color-mix(in srgb, var(--accent) 12%, transparent);
  background-image: linear-gradient(var(--line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--line-strong) 1px, transparent 1px);
  background-size: 5px 5px;
}
.aq-grid-key.is-parent { border: 1.5px dashed var(--line-strong); background: color-mix(in srgb, var(--line-strong) 8%, transparent); }
.aq-grid-key.is-section { height: 0; border-top: 2px dashed var(--ink); border-radius: 0; }
/* ACQ-UI-FIX-1022: the rotation row keeps the compass beside the field; the drag on the map comes later. */
.aq-grid-rotation { display: flex; align-items: flex-end; gap: 12px; }
.aq-grid-compass { flex: none; margin-bottom: 2px; }
.aq-grid-compass circle { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.aq-grid-compass path { fill: var(--muted); }
.aq-grid-compass path.is-north { fill: var(--accent); }
.aq-step-row label.is-disabled { color: var(--muted); cursor: not-allowed; }
.aq-grid-kicker { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.aq-grid-body { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.aq-grid-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.aq-grid-decision:not(.is-decided) { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-1); }
.aq-grid-next {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 36px;
  padding: 0 14px;
  text-decoration: none;
}
a.aq-grid-next:hover, a.aq-grid-next:focus { color: var(--on-accent); text-decoration: none; }
.aq-grid-change summary { display: flex; align-items: center; min-height: 32px; font-size: 13px; font-weight: 600; cursor: pointer; }
.aq-grid-change-body { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.aq-grid-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.aq-grid-stat dt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.aq-grid-stat dd { margin: 4px 0 0; }
.aq-grid-value { font-family: var(--mono); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.aq-grid-unit { font-size: 12px; color: var(--muted); }
.aq-grid-source { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.aq-grid-parent-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aq-grid .aq-step-parent { justify-content: space-between; }
.aq-grid .hx-btn.small { height: 28px; padding: 0 12px; font-size: 13px; }
.aq-grid-drawings { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 24px; align-items: start; }
.aq-grid-figure { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; }
.aq-grid-figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.aq-grid-figure figcaption { font-size: 12px; line-height: 1.45; color: var(--muted); }
.aq-strata-1 { fill: var(--strata-1); }
.aq-strata-2 { fill: var(--strata-2); }
.aq-strata-3 { fill: var(--strata-3); }
.aq-strata-4 { fill: var(--strata-4); }
.aq-strata-5 { fill: var(--strata-5); }
.aq-strata-6 { fill: var(--strata-6); }
.aq-strata-tight { fill: var(--strata-tight); }
.aq-strata-band { stroke: var(--strata-edge); stroke-width: .5; }
.aq-strata-hatch { stroke: var(--strata-hatch); stroke-width: 1.2; }
.aq-strata-edge { stroke: var(--strata-edge); stroke-width: .75; }
.aq-strata-frame { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.aq-grid-land { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.aq-grid-tick { fill: var(--muted); font: 400 11px var(--font); font-variant-numeric: tabular-nums; }
.aq-grid-tickline { stroke: var(--line); stroke-width: 1; }
.aq-grid-leader { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.aq-grid-label { fill: var(--ink); font: 600 13px var(--font); }
.aq-grid-label-detail { fill: var(--muted); font: 400 12px var(--font); }
.aq-grid-label-detail.is-tight { fill: var(--warn); font-weight: 600; }
.aq-grid-scalebar { stroke: var(--ink); stroke-width: 2; }
.aq-strata-swatch { display: inline-block; flex: none; width: 12px; height: 12px; margin-right: 8px; border: 1px solid var(--strata-edge); border-radius: 4px; vertical-align: -1px; }
.aq-strata-swatch.aq-strata-1 { background: var(--strata-1); }
.aq-strata-swatch.aq-strata-2 { background: var(--strata-2); }
.aq-strata-swatch.aq-strata-3 { background: var(--strata-3); }
.aq-strata-swatch.aq-strata-4 { background: var(--strata-4); }
.aq-strata-swatch.aq-strata-5 { background: var(--strata-5); }
.aq-strata-swatch.aq-strata-6 { background: var(--strata-6); }
.aq-strata-swatch.aq-strata-tight { background: repeating-linear-gradient(45deg, var(--strata-hatch) 0 1px, var(--strata-tight) 1px 4px); }
.aq-grid-table-wrap { overflow-x: auto; }
.aq-grid-table th.aq-grid-unit {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: top;
}
.aq-grid-table th.aq-grid-unit .hx-chip { margin-left: 8px; }
.aq-grid-table td { white-space: nowrap; }
.aq-grid-note { font-size: 12px; }
@media (max-width: 900px) {
  .aq-grid-top, .aq-grid-drawings { grid-template-columns: 1fr; }
  .aq-grid-map { height: 340px; }
  .aq-grid-figure-column { max-width: 400px; }
}
/* Phones: the section and the table keep a readable size and scroll sideways inside their own frame. */
@media (max-width: 640px) {
  .aq-grid-figure-section { overflow-x: auto; }
  .aq-grid-figure-section svg { min-width: 600px; }
  .aq-grid-figure-section figcaption { position: sticky; left: 0; max-width: calc(100vw - 80px); }
  .aq-grid-table { min-width: 600px; }
  .aq-grid-table th.aq-grid-unit { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .aq-grid-seg button { transition: none; }
}

/* ACQ-UI-FIX-1022: the Sources acquire strip; the bar is the indeterminate "live" loop and stops under reduced motion. */
.aq-acquire-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; font-size: 13px; }
.aq-acquire-bar { position: relative; flex: 1 1 120px; max-width: 240px; height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.aq-acquire-bar > span { position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: 999px; background: var(--accent); animation: aq-acquire-slide 1.4s ease-in-out infinite; }
@keyframes aq-acquire-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .aq-acquire-bar > span { animation: none; width: 100%; opacity: .5; } }
