:root {
  --bg: #0b0f12;
  --bg-2: #11181d;
  --bg-3: #172027;
  --panel: #151d23;
  --panel-2: #1c2730;
  --panel-3: #22313b;
  --ink: #e7edf1;
  --muted: #92a4ad;
  --line: #2d3c46;
  --line-2: #3f5664;
  --cyan: #39d5ff;
  --green: #00e096;
  --yellow: #f7c948;
  --red: #ff5c5c;
  --magenta: #ff4fd8;
  --grid-minor: rgba(57, 213, 255, 0.08);
  --grid-major: rgba(57, 213, 255, 0.22);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

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

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #0e1418;
  color: var(--ink);
}

button {
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
}

button:hover {
  border-color: var(--cyan);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(57, 213, 255, 0.4);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.primary {
  border-color: rgba(57, 213, 255, 0.8);
  background: linear-gradient(180deg, #16536a, #0f3a4c);
  color: #eaffff;
}

.danger {
  border-color: rgba(255, 92, 92, 0.75);
  color: #ffd8d8;
}

.auth-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(57, 213, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(57, 213, 255, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 50% 20%, rgba(57, 213, 255, 0.12), transparent 34%),
    var(--bg);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

.auth-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: rgba(17, 24, 29, 0.96);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-panel h1,
.auth-panel p,
.cad-card h2,
.feature-editor h2 {
  margin: 0;
}

.auth-panel h1 {
  margin-top: 12px;
  font-size: 24px;
  letter-spacing: 0;
}

.auth-panel p {
  margin-top: 6px;
  color: var(--muted);
}

.cad-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: #081014;
  font-weight: 800;
  letter-spacing: 0;
}

.cad-logo.small {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.auth-tabs,
.actions,
.top-actions,
.two-cols,
.toggle-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.top-actions {
  min-width: 0;
  justify-content: flex-end;
}

.top-actions select {
  width: auto;
  max-width: min(340px, 100%);
}

.toggle-line {
  flex-wrap: nowrap;
  width: auto;
  min-height: 30px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.toggle-line input {
  width: auto;
  min-width: 14px;
  margin: 0;
  padding: 0;
  accent-color: var(--cyan);
}

.auth-tabs {
  margin: 22px 0 16px;
}

.auth-tabs .active,
.side-nav .active,
.tool-palette .active,
.cad-ribbon .active {
  border-color: var(--cyan);
  background: rgba(57, 213, 255, 0.15);
  color: #eaffff;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span,
.ribbon-group span,
.stat span,
.status-lines span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.cad-shell {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}

.cad-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.cad-sidebar {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--line);
  background: #0d1317;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

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

.sidebar-brand strong {
  display: block;
  line-height: 1.1;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-toggle {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  margin-left: auto;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: var(--line-2);
  color: var(--cyan);
  font-size: 18px;
  line-height: 1;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px;
  overflow: auto;
}

.side-nav button {
  width: 100%;
  min-height: 42px;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: transparent;
}

.side-nav button b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.side-nav button span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-size: 11px;
}

.sidebar-collapsed .cad-sidebar {
  grid-template-rows: auto 1fr;
}

.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 10px 8px;
}

.sidebar-collapsed .sidebar-brand .cad-logo,
.sidebar-collapsed .brand-copy,
.sidebar-collapsed .side-nav button b {
  display: none;
}

.sidebar-collapsed .sidebar-toggle {
  margin-left: 0;
}

.sidebar-collapsed .side-nav {
  padding: 8px;
}

.sidebar-collapsed .side-nav button {
  min-height: 46px;
  justify-content: center;
  padding: 6px;
}

.sidebar-collapsed .side-nav button span {
  width: 30px;
  height: 30px;
}

.cad-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.cad-topbar {
  position: relative;
  z-index: 20;
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow: visible;
}

.cad-topbar > div {
  min-width: 0;
}

.cad-topbar h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.cad-topbar span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: break-word;
  word-break: normal;
}

.page-grid {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-content: start;
  gap: 14px;
  padding: 14px;
  background: #10161b;
}

.dashboard-page {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) minmax(280px, 0.8fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  background: #10161b;
}

.dashboard-summary {
  grid-column: 1 / -1;
}

.dashboard-map-card,
.dashboard-list,
.dashboard-status {
  min-height: 0;
  overflow: hidden;
}

.dashboard-map-card {
  display: grid;
  grid-row: 2 / 4;
  grid-template-rows: auto minmax(0, 1fr);
}

.dashboard-map-preview {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: block;
  border: 1px solid var(--line);
  background: #081014;
}

.dashboard-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
}

.dashboard-list .compact-list {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

.dashboard-status {
  grid-column: 2;
  grid-row: 3;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: 1 / -1;
}

.cad-card,
.feature-editor {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  padding: 14px;
}

.cad-card h2,
.feature-editor h2 {
  min-width: 0;
  margin-bottom: 12px;
  font-size: 15px;
  color: #f2f8fb;
  overflow-wrap: break-word;
  word-break: normal;
}

.muted-copy {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.pipeline-page {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(360px, 1fr) minmax(260px, 320px);
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  padding: 10px;
}

.pipeline-page.qa-collapsed {
  grid-template-columns: minmax(190px, 240px) minmax(360px, 1fr) 58px;
}

.pipeline-page.stages-collapsed {
  grid-template-columns: 72px minmax(360px, 1fr) minmax(260px, 320px);
}

.pipeline-page.stages-collapsed.qa-collapsed {
  grid-template-columns: 72px minmax(360px, 1fr) 58px;
}

.pipeline-stage-rail,
.pipeline-main,
.pipeline-qa {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

.pipeline-stage-rail {
  display: grid;
  gap: 6px;
  align-content: start;
  border: 1px solid var(--line);
  background: #0d1317;
  padding: 8px;
}

.pipeline-stage-rail.collapsed {
  padding: 8px 6px;
  overflow: hidden;
}

.pipeline-stage-rail.collapsed [data-pipeline-stage] {
  display: none;
}

.pipeline-stage-rail button {
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: start;
  text-align: left;
  background: #101820;
  padding: 8px;
}

.pipeline-stage-rail button span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  min-height: 34px;
  height: 100%;
  border: 1px solid var(--line-2);
  color: var(--cyan);
  font-weight: 800;
  font-size: 15px;
}

.pipeline-stage-rail button b,
.pipeline-stage-rail button em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.16;
}

.pipeline-stage-rail button b {
  display: -webkit-box;
  max-height: 2.4em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
  align-self: start;
}

.pipeline-stage-rail button em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  align-self: end;
  white-space: nowrap;
}

.pipeline-stage-rail button.active {
  border-color: var(--cyan);
  background: rgba(57, 213, 255, 0.14);
}

.pipeline-stage-rail button.approved span {
  border-color: var(--green);
  color: var(--green);
}

.pipeline-stage-rail button.stale span {
  border-color: var(--yellow);
  color: var(--yellow);
}

.pipeline-rail-toggle {
  min-height: 34px;
  display: block;
  width: 100%;
  padding: 0 8px;
  text-align: center;
  white-space: nowrap;
  border-color: rgba(57, 213, 255, 0.58);
  background: rgba(57, 213, 255, 0.09);
  color: var(--cyan);
}

.pipeline-stage-rail.collapsed .pipeline-rail-toggle {
  height: 116px;
  padding: 8px 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.pipeline-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.pipeline-form-card {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pipeline-head,
.pipeline-form-title {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.pipeline-form-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pipeline-head,
.pipeline-form-tabs,
.pipeline-zone-index {
  flex: 0 0 auto;
}

.pipeline-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.pipeline-form-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  overflow: visible;
}

.pipeline-form-tabs button {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.pipeline-form-tabs button.active {
  border-color: var(--cyan);
  background: rgba(57, 213, 255, 0.14);
}

.pipeline-form-tabs button span {
  color: var(--muted);
  font-size: 11px;
}

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

.manual-entry-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.manual-entry-head,
.manual-records-head,
.manual-record-main,
.manual-record-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.manual-entry-head h3,
.manual-records-head h4 {
  margin: 0;
}

.manual-entry-head p,
.manual-records-head span,
.manual-muted {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.manual-entry-actions,
.manual-form-submit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manual-entry-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.manual-entry-kpis div {
  border: 1px solid var(--border);
  background: rgba(5, 12, 15, 0.55);
  padding: 10px;
}

.manual-entry-kpis span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.manual-entry-kpis b {
  color: var(--cyan);
  font-size: 22px;
}

.manual-entry-toolbar,
.manual-entry-form,
.manual-entry-import {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
  align-items: end;
}

.manual-entry-form .wide,
.manual-entry-import > label {
  grid-column: 1 / -1;
}

.manual-entry-panel label {
  min-width: 0;
}

.manual-entry-panel label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.manual-entry-panel input,
.manual-entry-panel select,
.manual-entry-panel textarea {
  width: 100%;
  min-width: 0;
}

.manual-entry-panel textarea {
  resize: vertical;
}

.manual-import-side {
  display: grid;
  gap: 10px;
  align-content: start;
}

.manual-file-preview {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(5, 12, 15, 0.7);
  padding: 10px;
  overflow-wrap: anywhere;
}

.manual-error {
  border: 1px solid rgba(255, 94, 94, 0.65);
  color: #ffb4b4;
  background: rgba(80, 16, 16, 0.35);
  padding: 10px;
}

.manual-findings {
  display: grid;
  gap: 8px;
}

.manual-findings h4 {
  margin: 0;
  color: var(--cyan);
}

.manual-findings button {
  display: grid;
  gap: 4px;
  text-align: left;
  border-color: rgba(255, 94, 94, 0.65);
  background: rgba(80, 16, 16, 0.28);
}

.manual-findings em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.manual-record-list {
  display: grid;
  gap: 10px;
}

.manual-record-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  background: rgba(5, 12, 15, 0.52);
  padding: 12px;
}

.manual-record-card.has-error {
  border-color: rgba(255, 94, 94, 0.75);
}

.manual-record-card.is-ready {
  border-color: rgba(255, 204, 77, 0.72);
}

.manual-record-card.is-published {
  border-color: rgba(0, 255, 156, 0.7);
}

.manual-record-card.is-archived {
  opacity: 0.6;
}

.manual-record-highlight {
  outline: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(57, 213, 255, 0.12);
}

.manual-record-main b {
  display: block;
  overflow-wrap: anywhere;
}

.manual-record-main span,
.manual-record-actions time {
  color: var(--muted);
  font-size: 12px;
}

.manual-record-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.manual-record-badges i {
  border: 1px solid var(--border);
  color: var(--cyan);
  background: rgba(57, 213, 255, 0.08);
  font-style: normal;
  padding: 4px 8px;
}

.manual-record-payload {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px;
}

.manual-record-payload span {
  min-width: 0;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(54, 79, 93, 0.65);
  padding: 8px;
  overflow-wrap: anywhere;
}

.manual-record-payload b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.manual-record-errors {
  display: grid;
  gap: 6px;
}

.manual-record-errors button {
  text-align: left;
  color: #ffcdcd;
  border-color: rgba(255, 94, 94, 0.6);
}

.pipeline-split {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  align-items: start;
}

.pipeline-form-stack {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.op15-production-evidence {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(15, 21, 25, 0.72);
  padding: 12px;
}

.op15-evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 10px;
}

.op15-evidence-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(54, 79, 93, 0.9);
  background: rgba(8, 13, 16, 0.9);
  padding: 10px;
  min-width: 0;
}

.op15-evidence-card.ok {
  border-color: rgba(0, 224, 150, 0.55);
}

.op15-evidence-card.open {
  border-color: rgba(255, 203, 77, 0.52);
}

.op15-evidence-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.op15-evidence-card-head div,
.op15-evidence-list div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.op15-evidence-card-head b,
.op15-evidence-card-head strong {
  color: var(--cyan);
}

.op15-evidence-card p,
.op15-evidence-list span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.op15-evidence-list {
  display: grid;
  gap: 6px;
}

.op15-evidence-list div {
  border: 1px solid rgba(54, 79, 93, 0.75);
  padding: 7px;
}

.op15-evidence-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.op15-evidence-content,
.op15-evidence-form button {
  grid-column: 1 / -1;
}

.pipeline-large-textarea {
  min-height: 180px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.stat-row.compact {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  margin-bottom: 12px;
}

.stat-row.compact .stat {
  min-height: 74px;
  display: grid;
  align-content: center;
  padding: 10px;
}

.stat-row.compact .stat span {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.stat-row.compact .stat b {
  min-width: 0;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.pipeline-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin: -2px 0 12px;
}

.pipeline-report-actions button {
  min-width: 128px;
  white-space: nowrap;
}

.pipeline-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.pipeline-table-head h3 {
  margin: 0;
  color: var(--cyan);
  font-size: 14px;
}

.pipeline-table-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: break-word;
  word-break: normal;
}

.pipeline-table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pipeline-table-actions button {
  min-height: 34px;
  border: 1px solid rgba(57, 213, 255, 0.72);
  border-radius: 3px;
  background: rgba(57, 213, 255, 0.12);
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
}

.pipeline-source-table-list {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.source-table-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.source-table-list article,
.report-preview-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(6, 12, 16, 0.58);
  padding: 10px;
}

.source-table-list b,
.source-table-list span,
.source-table-list small,
.report-preview-card p,
.report-preview-card li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-table-list span,
.source-table-list small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.op15-v6-panel {
  margin-bottom: 12px;
}

.op15-card-grid,
.op15-package-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}

.op15-card-grid.figures {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.op15-figure-card {
  display: grid;
  gap: 8px;
}

.op15-figure-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #071014;
}

.op15-package-grid ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.pipeline-source-table {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(6, 12, 16, 0.58);
  padding: 8px;
}

.pipeline-source-table summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  color: var(--text);
}

.pipeline-source-table summary b,
.pipeline-source-table summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-source-table .pipeline-grid-scroll {
  margin-top: 8px;
}

.inline-cad3d-scene {
  touch-action: none;
  cursor: grab;
}

.inline-cad3d-scene:active {
  cursor: grabbing;
}

.inline-cad3d-scene.zoom {
  cursor: zoom-in;
}

.inline-cad3d-scene.orbit {
  cursor: ew-resize;
}

.pipeline-grid-scroll {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  background: #0f1519;
}

.pipeline-data-grid {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.pipeline-data-grid th,
.pipeline-data-grid td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 0;
  max-width: none;
  padding: 7px 9px;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
  line-height: 1.35;
}

.pipeline-data-grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #172027;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pipeline-data-grid td.grid-cell span {
  display: block;
  max-width: inherit;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pipeline-data-grid td.grid-cell.id {
  max-width: none;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  white-space: normal;
}

.pipeline-data-grid td.grid-cell.id span,
.pipeline-data-grid td.grid-cell.status span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pipeline-data-grid td.grid-cell.long {
  max-width: none;
}

.pipeline-data-grid td.grid-cell.wide {
  max-width: none;
}

.pipeline-data-grid td.grid-cell.status {
  max-width: none;
  white-space: normal;
}

.pipeline-data-grid td.empty-cell {
  white-space: normal;
  color: var(--muted);
}

.pipeline-data-grid input,
.pipeline-data-grid select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 12px;
}

.wall-design-grid th,
.wall-design-grid td,
.geotech-grid th,
.geotech-grid td,
.economics-grid th,
.economics-grid td {
  min-width: 0;
}

.normalized-preview-table td.grid-cell.wide span {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.data-loading-steps,
.status-flow,
.block-scene-legend {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.data-loading-step,
.status-flow span,
.block-scene-legend span {
  min-width: 0;
  border: 1px solid var(--line);
  background: #0f1519;
  color: var(--muted);
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.25;
}

.data-loading-step {
  display: grid;
  gap: 2px;
  flex: 1 1 124px;
}

.data-loading-step b {
  color: var(--cyan);
}

.data-loading-step.active {
  border-color: var(--cyan);
  background: rgba(57, 213, 255, 0.12);
  color: var(--ink);
}

.data-loading-step-context {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  background: rgba(57, 213, 255, 0.07);
  padding: 9px 10px;
  margin-bottom: 12px;
}

.data-loading-step-context b {
  color: var(--cyan);
}

.data-loading-step-context span,
.data-loading-step-context small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.help-tip {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: 6px;
  border: 1px solid rgba(57, 213, 255, 0.72);
  border-radius: 50%;
  color: var(--cyan);
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  cursor: help;
  vertical-align: text-top;
}

.help-tip:hover,
.help-tip:focus {
  background: rgba(57, 213, 255, 0.18);
  outline: none;
}

.help-tip::after {
  content: attr(data-tip);
  position: fixed;
  z-index: 1200;
  width: min(360px, calc(100vw - 32px));
  max-width: 360px;
  transform: translate(-18px, 24px);
  display: none;
  border: 1px solid rgba(57, 213, 255, 0.72);
  background: #0c1318;
  color: #e7edf1;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.46);
  padding: 9px 10px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.help-tip:hover::after,
.help-tip:focus::after {
  display: block;
}

.inline-action-row,
.batch-selector-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-notice {
  min-width: 0;
  border: 1px solid rgba(57, 213, 255, 0.44);
  background: rgba(57, 213, 255, 0.08);
  color: #cfeff7;
  padding: 9px 10px;
  margin-bottom: 10px;
  line-height: 1.35;
}

.inline-notice.action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.inline-notice.action span {
  min-width: min(100%, 320px);
  flex: 1 1 320px;
}

.batch-selector-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.batch-selector-actions {
  justify-content: flex-end;
  padding-bottom: 2px;
}

.field-needs-fix {
  outline: 2px solid var(--yellow) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.15) !important;
}

.status-flow span {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.import-profile-panel,
.catalog-table {
  min-width: 0;
}

.catalog-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 10px;
  align-items: end;
  margin: 8px 0 12px;
}

.compact-field {
  gap: 4px;
}

.compact-field span {
  font-size: 10px;
}

.compact-field input,
.compact-field select {
  min-height: 34px;
  font-size: 13px;
}

.connector-catalog {
  display: grid;
  gap: 8px;
}

.connector-catalog-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 10px;
}

.connector-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: #101820;
  padding: 10px;
}

.connector-card b,
.connector-card code,
.connector-card dd {
  overflow-wrap: anywhere;
}

.connector-card b {
  display: block;
  color: #f2f8fb;
}

.connector-card code {
  display: inline-block;
  margin-top: 4px;
  color: var(--yellow);
  font-size: 12px;
}

.connector-card dl {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 0;
}

.connector-card dt {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.connector-card dd {
  margin: 2px 0 0;
  color: #dce7ec;
  font-size: 12px;
  line-height: 1.3;
}

.import-profile-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 10px;
}

.import-profile-grid article,
.template-list div {
  min-width: 0;
  border: 1px solid var(--line);
  background: #101820;
  padding: 10px;
}

.import-profile-grid b,
.template-list b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-profile-grid span {
  display: block;
  margin-top: 4px;
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.import-profile-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.template-list {
  display: grid;
  gap: 8px;
}

.template-list code {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.icon-danger {
  min-width: 30px;
  padding: 0;
  color: #ffb9b9;
}

.pipeline-qa {
  display: grid;
  gap: 12px;
  align-content: start;
}

.pipeline-qa-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.pipeline-qa-head h2 {
  margin: 0;
}

.pipeline-qa-head button {
  min-height: 30px;
  padding: 0 8px;
  white-space: nowrap;
}

.pipeline-qa.collapsed {
  gap: 8px;
  padding: 8px;
  overflow: hidden;
}

.pipeline-qa.collapsed .pipeline-qa-head {
  grid-template-columns: 1fr;
  justify-items: center;
}

.pipeline-qa.collapsed .pipeline-qa-head h2 {
  font-size: 13px;
  text-align: center;
}

.pipeline-qa.collapsed .pipeline-qa-head button {
  width: 40px;
  min-width: 40px;
  height: 92px;
  padding: 6px 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.pipeline-list {
  display: grid;
  gap: 6px;
  color: #c7d5da;
  font-size: 12px;
}

.pipeline-list div {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(15, 21, 25, 0.82);
  padding: 7px;
  overflow-wrap: break-word;
  word-break: normal;
}

.pipeline-list b,
.pipeline-list span {
  display: block;
}

.pipeline-list span {
  margin-top: 2px;
  color: var(--muted);
}

.pipeline-list .error {
  color: #ffcece;
  border: 1px solid rgba(255, 92, 92, 0.42);
  background: rgba(255, 92, 92, 0.08);
}

.pipeline-list .qa-error-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.pipeline-list .qa-error-action button {
  min-height: 28px;
  padding: 4px 8px;
  white-space: nowrap;
}

.pipeline-list .ok {
  color: var(--green);
  border-color: rgba(0, 224, 150, 0.45);
  background: rgba(0, 224, 150, 0.08);
}

.qa-list,
.qa-ok {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(15, 21, 25, 0.82);
  padding: 8px;
  color: #c7d5da;
  font-size: 12px;
  line-height: 1.35;
}

.qa-list div {
  border-left: 2px solid var(--yellow);
  padding-left: 8px;
  overflow-wrap: anywhere;
}

.qa-ok {
  border-color: rgba(0, 224, 150, 0.42);
  background: rgba(0, 224, 150, 0.08);
  color: var(--green);
}

.geotech-grid input,
.geotech-grid select {
  min-width: 0;
}

.pipeline-zone-index {
  align-content: start;
}

.zone-index-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.zone-index-list button {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 14px minmax(86px, 0.44fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 8px;
}

.zone-index-list button:hover,
.zone-index-list button.active {
  border-color: var(--cyan);
  background: rgba(57, 213, 255, 0.12);
}

.zone-index-list i,
.zone-code-chip::before {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(231, 237, 241, 0.5);
  box-shadow: 0 0 10px rgba(57, 213, 255, 0.18);
}

.zone-index-list i {
  display: block;
}

.zone-index-list b {
  min-width: 0;
  color: var(--yellow);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  overflow-wrap: break-word;
  word-break: normal;
}

.zone-index-list span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.restriction-layer-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.restriction-layer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.restriction-layer:hover,
.restriction-layer:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(57, 213, 255, 0.12);
}

.restriction-layer span {
  color: var(--muted);
  font-size: 12px;
}

.restriction-layer b {
  color: var(--cyan);
  font-size: 22px;
}

.restriction-layer.no_go {
  border-color: rgba(255, 92, 92, 0.62);
  background: rgba(255, 92, 92, 0.08);
}

.restriction-layer.restricted {
  border-color: rgba(247, 201, 72, 0.62);
  background: rgba(247, 201, 72, 0.08);
}

.restriction-layer.warning {
  border-color: rgba(57, 213, 255, 0.45);
  background: rgba(57, 213, 255, 0.07);
}

.restriction-risk-dashboard {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.restriction-risk-dashboard div {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(15, 21, 25, 0.92);
  padding: 10px;
}

.restriction-risk-dashboard span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.restriction-risk-dashboard b {
  display: block;
  margin-top: 6px;
  color: var(--cyan);
  font-size: 22px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: rgba(57, 213, 255, 0.09);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.62);
}

.map-preview-modal {
  position: fixed;
  z-index: 901;
  inset: 5vh 5vw auto;
  max-height: 90vh;
  overflow: auto;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(57, 213, 255, 0.72);
  background: #101820;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.56);
  padding: 14px;
}

.restriction-map-preview {
  width: 100%;
  min-height: 300px;
  display: block;
  border: 1px solid var(--line);
  background: #081014;
}

.modal-zone-table {
  max-height: 260px;
}

.geology-workbench {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.5fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.geology-loaded-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 16px;
}

.geology-load-state {
  border: 1px solid rgba(57, 213, 255, 0.42);
  background: rgba(57, 213, 255, 0.08);
  padding: 18px;
  display: grid;
  gap: 12px;
  max-width: 720px;
}

.geology-load-state h3 {
  margin: 0;
  color: var(--text);
}

.geology-load-state p {
  margin: 0;
  color: var(--muted);
}

.pipeline-subtitle {
  margin: 14px 0 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.media-preview-panel {
  min-width: 0;
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 12px;
}

.media-preview-grid,
.report-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}

.core-preview-grid {
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.media-preview-card,
.report-preview-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: #101820;
  padding: 10px;
}

.media-thumb,
.report-preview-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #081014;
}

.media-thumb img,
.media-thumb svg,
.report-preview-media img,
.report-preview-media iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: cover;
}

.media-fallback,
.media-fallback svg {
  width: 100%;
  height: 100%;
}

.media-preview-body,
.report-preview-head,
.report-preview-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.media-preview-body b,
.report-preview-head b {
  min-width: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: normal;
}

.media-preview-body span,
.media-preview-body p,
.report-preview-head span,
.report-preview-meta,
.report-preview-meta span,
.media-empty {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

.media-preview-body a,
.report-preview-meta a {
  min-width: 0;
  overflow: hidden;
  color: var(--cyan);
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-preview-text {
  min-height: 170px;
  max-height: 260px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  background: #081014;
  color: #d5e0e5;
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}

.media-empty {
  border: 1px dashed var(--line-2);
  background: rgba(57, 213, 255, 0.05);
  padding: 14px;
}

.media-empty.compact {
  min-height: 120px;
  display: grid;
  place-items: center;
}

.geology-hole-tree,
.geology-qa-panel,
.geology-map-preview {
  min-width: 0;
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 12px;
}

.geology-hole-tree {
  display: grid;
  gap: 8px;
}

.geology-hole-tree div:not(.empty) {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.geology-hole-tree b,
.geology-hole-tree span {
  display: block;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.geology-hole-tree span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.geology-map-preview svg {
  width: 100%;
  max-height: 260px;
  border: 1px solid var(--line);
  background: #0b1115;
}

.geology-map-preview.trace-3d {
  display: grid;
  gap: 12px;
}

.geology-map-preview.trace-3d svg {
  min-height: 390px;
  max-height: none;
}

.trace-3d-scene {
  font-family: inherit;
}

.trace-3d-grid line {
  stroke: rgba(110, 139, 153, 0.38);
  stroke-width: 1;
}

.trace-3d-grid text,
.trace-3d-scale text,
.trace-3d-axis text {
  fill: #9fb1ba;
  font-size: 13px;
  font-weight: 700;
}

.trace-3d-axis line {
  stroke-width: 3;
  stroke-linecap: round;
}

.trace-3d-axis .axis-x {
  stroke: #39d5ff;
}

.trace-3d-axis .axis-y {
  stroke: #00e096;
}

.trace-3d-axis .axis-z {
  stroke: #ffd166;
}

.trace-borehole-path {
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trace-borehole-shadow {
  stroke: rgba(0, 0, 0, 0.7);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trace-label {
  fill: #e7edf1;
  font-size: 14px;
  font-weight: 800;
}

.trace-label-bg {
  stroke: #071014;
  stroke-width: 5;
  stroke-linejoin: round;
}

.trace-depth {
  fill: #b9c8ce;
  font-size: 12px;
  font-weight: 700;
}

.trace-3d-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.trace-3d-meta div {
  min-width: 0;
  border: 1px solid var(--line);
  background: #0b1115;
  padding: 9px;
}

.trace-3d-meta span,
.trace-3d-meta b {
  display: block;
  min-width: 0;
}

.trace-3d-meta span {
  color: var(--muted);
  font-size: 12px;
}

.trace-3d-meta b {
  margin-top: 3px;
  color: var(--cyan);
  overflow-wrap: break-word;
  word-break: normal;
}

.block-model-preview {
  min-width: 0;
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 12px;
}

.block-model-visual-stack {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.cad3d-inline-toolbar {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  border: 1px solid var(--line);
  background: #0b1216;
  padding: 7px;
}

.cad3d-inline-toolbar button {
  min-height: 28px;
  min-width: 54px;
  padding: 0 8px;
  font-size: 11px;
}

.cad3d-inline-toolbar button.active {
  border-color: var(--cyan);
  background: rgba(57, 213, 255, 0.15);
  color: #eaffff;
}

.block-model-preview svg {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  background: #071014;
}

.block-model-preview-3d svg {
  min-height: 360px;
}

.block-record-modal {
  inset: 4vh 4vw auto;
  width: min(1380px, 92vw);
}

.block-record-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 12px;
  align-items: start;
}

.block-record-details {
  min-width: 0;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 12px;
}

.block-record-details h3 {
  margin: 0;
  color: var(--cyan);
  font-size: 14px;
}

.block-record-kv {
  min-width: 0;
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.block-record-kv div {
  min-width: 0;
  display: grid;
  gap: 3px;
  border-top: 1px solid rgba(45, 60, 70, 0.78);
  padding-top: 8px;
}

.block-record-kv span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.block-record-kv b {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.block-record-scene svg {
  min-height: 460px;
}

.block-cube-highlight {
  stroke: var(--yellow);
  stroke-width: 4;
  filter: drop-shadow(0 0 8px rgba(247, 201, 72, 0.8));
}

.model-cluster-workspace {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.model-cluster-tree {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.model-cluster-tree article {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  background: #101820;
  padding: 10px;
}

.model-cluster-tree b {
  color: var(--yellow);
  font-family: "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
}

.model-cluster-tree span,
.model-cluster-tree small {
  color: var(--muted);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.model-cluster-scene svg {
  min-height: 320px;
}

.block-scene-grid line {
  stroke: rgba(57, 213, 255, 0.16);
  stroke-width: 1;
}

.block-scene-axis line {
  stroke: var(--cyan);
  stroke-width: 2;
}

.block-scene-axis text,
.block-scene-labels text {
  fill: var(--cyan);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.block-scene-labels text {
  fill: var(--muted);
  font-size: 12px;
}

.block-cube polygon {
  stroke: rgba(231, 237, 241, 0.32);
  stroke-width: 0.7;
}

.block-cube polyline {
  stroke: rgba(7, 16, 20, 0.72);
  stroke-width: 0.8;
}

.block-scene-legend {
  margin-top: 10px;
  margin-bottom: 0;
}

.block-scene-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.block-scene-legend i {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(231, 237, 241, 0.38);
}

.pipeline-placeholder {
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 16px;
}

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

.stat {
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 12px;
}

.stat b {
  display: block;
  margin-top: 5px;
  color: var(--cyan);
  font-size: 21px;
}

.status-lines {
  display: grid;
  gap: 8px;
}

.status-lines div,
.metrics-strip div {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.status-lines b,
.metrics-strip b,
.table-row strong,
.pipeline-head h2,
.pipeline-form-title h2 {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.pipeline-head h2,
.pipeline-form-title h2 {
  max-width: 100%;
  line-height: 1.25;
}

.project-table,
.object-table,
.attribute-table,
.compact-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.table-row {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(140px, 1.3fr) minmax(44px, auto);
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 10px;
}

.table-row.static {
  cursor: default;
}

.table-row.active {
  border-color: var(--cyan);
  background: rgba(57, 213, 255, 0.12);
}

.table-row span {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.table-row b {
  min-width: 0;
  color: var(--yellow);
  font-size: 12px;
  text-align: right;
  overflow-wrap: break-word;
  word-break: normal;
}

.editor-page {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}

.cad-ribbon {
  min-width: 0;
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 6px;
  align-items: stretch;
  align-content: start;
  max-height: min(190px, 28vh);
  overflow: auto;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.ribbon-group {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
  align-items: center;
  padding: 5px;
  border: 1px solid var(--line);
  background: #11181d;
}

.ribbon-group span {
  flex: 0 0 100%;
  padding: 0 4px;
}

.ribbon-group button,
.ribbon-group select,
.ribbon-group label {
  flex: 0 1 auto;
  max-width: 100%;
}

.ribbon-group button {
  min-height: 28px;
  padding: 0 8px;
}

.ribbon-group select {
  width: auto;
  max-width: min(220px, 100%);
  padding: 6px 8px;
}

.editor-body {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 78px minmax(360px, 1fr) minmax(280px, 320px);
  overflow: hidden;
}

.editor-page.tools-collapsed .editor-body {
  grid-template-columns: 0 minmax(360px, 1fr) minmax(280px, 320px);
}

.editor-page.properties-collapsed .editor-body {
  grid-template-columns: 78px minmax(360px, 1fr) 0;
}

.editor-page.tools-collapsed.properties-collapsed .editor-body {
  grid-template-columns: 0 minmax(360px, 1fr) 0;
}

.tool-palette {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 6px;
  border-right: 1px solid var(--line);
  background: #0d1317;
  overflow: auto;
}

.tool-palette button {
  min-height: 40px;
  display: grid;
  gap: 2px;
  place-items: center;
  padding: 4px;
}

.tool-palette b {
  color: var(--cyan);
  font-size: 12px;
}

.tool-palette span {
  color: var(--muted);
  font-size: 9px;
}

.map-stage {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  padding: 6px;
  background: #070a0d;
  overflow: hidden;
}

.map-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background:
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-major) 1px, transparent 1px),
    #081014;
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px, auto;
  cursor: grab;
  isolation: isolate;
}

.editor-page.tools-collapsed .tool-palette,
.editor-page.properties-collapsed .properties-panel {
  display: none;
}

.map-frame:active {
  cursor: grabbing;
}

.tile-layer {
  opacity: 1;
}

.tile-layer.light {
  filter: grayscale(0.75) brightness(1.08) contrast(0.92);
}

.tile-layer.satellite {
  opacity: 1;
}

.map-tile {
  pointer-events: none;
}

.map-label {
  fill: rgba(231, 237, 241, 0.62);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(8, 16, 20, 0.9);
  stroke-width: 5px;
}

.map-frame.light {
  background:
    linear-gradient(90deg, rgba(15, 39, 52, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 39, 52, 0.08) 1px, transparent 1px),
    #d8dde0;
}

.map-frame.satellite {
  background:
    linear-gradient(135deg, rgba(57, 213, 255, 0.11), transparent 40%),
    linear-gradient(45deg, #283526, #162226);
}

.map-frame.view-3d {
  background:
    linear-gradient(120deg, rgba(247, 201, 72, 0.08), transparent 42%),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-minor) 1px, transparent 1px),
    #081014;
  background-size: auto, 28px 28px, 28px 28px, auto;
}

#mapCanvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  touch-action: none;
}

.cad-crosshair {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.35;
}

.cad-crosshair::before,
.cad-crosshair::after {
  content: "";
  position: absolute;
  background: var(--cyan);
}

.cad-crosshair::before {
  left: 26px;
  top: 0;
  width: 1px;
  height: 54px;
}

.cad-crosshair::after {
  left: 0;
  top: 26px;
  width: 54px;
  height: 1px;
}

.map-panel-toggle {
  position: absolute;
  top: 50%;
  z-index: 6;
  min-width: 32px;
  width: auto;
  min-height: 58px;
  padding: 0 7px;
  transform: translateY(-50%);
  border-color: rgba(57, 213, 255, 0.55);
  background: rgba(8, 12, 15, 0.78);
  color: var(--cyan);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.map-panel-toggle.left {
  left: 8px;
}

.map-panel-toggle.right {
  right: 8px;
}

.map-panel-toggle.collapsed {
  min-width: 42px;
  font-size: 10px;
  letter-spacing: 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.coords {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  max-width: min(320px, calc(100% - 180px));
  border: 1px solid var(--line);
  background: rgba(8, 12, 15, 0.86);
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  padding: 6px 8px;
}

.grid-scale {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  max-width: min(470px, calc(100% - 260px));
  border: 1px solid var(--line);
  background: rgba(8, 12, 15, 0.78);
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  padding: 6px 8px;
  pointer-events: none;
  text-align: right;
}

.orientation-widget {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 154px;
  max-width: min(240px, calc(100% - 24px));
  border: 1px solid var(--line-2);
  background: rgba(8, 12, 15, 0.76);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  padding: 7px;
  pointer-events: none;
}

.orientation-widget strong,
.orientation-widget span {
  display: block;
}

.orientation-widget strong {
  font-size: 11px;
  color: var(--ink);
}

.orientation-widget span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.compass-face {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49%, rgba(57, 213, 255, 0.25) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(0, 224, 150, 0.22) 50%, transparent 51%),
    #0b1115;
}

.compass-face i {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 16px;
  height: 3px;
  transform-origin: 0 50%;
}

.compass-face .compass-x {
  background: var(--green);
  transform: rotate(0deg);
}

.compass-face .compass-y {
  background: var(--cyan);
  transform: rotate(-90deg);
}

.compass-face .compass-z {
  width: 15px;
  background: var(--yellow);
  transform: rotate(-44deg);
}

.view-3d .compass-face .compass-x {
  transform: rotate(22deg);
}

.view-3d .compass-face .compass-y {
  transform: rotate(-58deg);
}

.view-3d .compass-face .compass-z {
  transform: rotate(-28deg);
}

.compass-face .north,
.compass-face .east,
.compass-face .up {
  position: absolute;
  font-size: 9px;
  color: var(--cyan);
  font-weight: 800;
}

.compass-face .north {
  top: 3px;
  left: 17px;
}

.compass-face .east {
  right: 4px;
  top: 16px;
  color: var(--green);
}

.compass-face .up {
  right: 9px;
  top: 5px;
  color: var(--yellow);
}

.draw-assistant {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  max-width: min(620px, calc(100% - 280px));
  border: 1px solid var(--line-2);
  background: rgba(8, 12, 15, 0.76);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  padding: 6px;
  pointer-events: none;
}

.draw-assistant > div {
  display: grid;
  align-content: center;
  min-width: min(150px, 100%);
  border-right: 1px solid var(--line);
  padding-right: 6px;
}

.draw-assistant > div:last-child {
  border-right: none;
  padding-right: 0;
}

.draw-assistant span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.draw-assistant strong {
  margin-top: 3px;
  color: var(--cyan);
  font-size: 12px;
}

.assistant-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: min(150px, 100%);
}

.assistant-actions button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  pointer-events: auto;
}

.axis-overlay {
  opacity: 0.78;
}

.axis-overlay line {
  stroke-width: 3;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.72));
}

.axis-overlay .axis-x {
  stroke: var(--green);
}

.axis-overlay .axis-y {
  stroke: var(--cyan);
}

.axis-overlay .axis-z {
  stroke: var(--yellow);
}

.axis-overlay text {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(8, 16, 20, 0.9);
  stroke-width: 4px;
}

.terrain-contour {
  stroke: rgba(105, 197, 109, 0.78);
  stroke-width: 1.25;
  stroke-dasharray: 6 4;
  pointer-events: none;
}

.terrain-contour-label {
  fill: rgba(215, 251, 255, 0.88);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  paint-order: stroke;
  stroke: rgba(8, 16, 20, 0.92);
  stroke-width: 4px;
  pointer-events: none;
}

.terrain-water-layer {
  pointer-events: none;
}

.terrain-water-area {
  fill: rgba(31, 111, 209, 0.34);
  stroke: rgba(47, 156, 255, 0.92);
  stroke-width: 2;
}

.terrain-water-line {
  fill: none;
  stroke: rgba(47, 156, 255, 0.95);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reference-coord-label {
  fill: var(--yellow);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(5, 8, 10, 0.95);
  stroke-width: 4px;
  pointer-events: none;
}

.properties-panel {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #0d1317;
  padding: 10px;
}

.coordinate-create {
  margin-top: 10px;
}

.coordinate-create textarea {
  min-height: 118px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 10px;
  margin: 10px 0 14px;
}

.metrics-strip div {
  display: grid;
  gap: 2px;
  justify-content: start;
}

.metrics-strip b {
  color: var(--cyan);
}

.terrain-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  background: rgba(57, 213, 255, 0.05);
  padding: 8px;
}

.terrain-metrics div,
.terrain-metrics > span {
  min-width: 0;
}

.terrain-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.terrain-metrics b {
  display: block;
  margin-top: 2px;
  color: var(--yellow);
  font-size: 12px;
}

.object-type-legend {
  margin-bottom: 10px;
}

.map-layer-manager {
  margin-bottom: 10px;
}

.compact-actions {
  margin-bottom: 8px;
}

.compact-actions button {
  min-height: 28px;
  font-size: 12px;
}

.ghost-small {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(9, 15, 18, 0.62);
  color: var(--cyan);
  font-size: 12px;
  cursor: pointer;
}

.layer-counter {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.map-layer-list {
  display: grid;
  gap: 6px;
}

.map-layer-list.collapsed {
  display: none;
}

.map-layer-group {
  min-width: 0;
  border: 1px solid var(--line);
  background: #0f1519;
}

.map-layer-group summary {
  cursor: pointer;
  list-style: none;
}

.map-layer-group summary::-webkit-details-marker {
  display: none;
}

.map-layer-group .toggle-line {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  display: grid;
  grid-template-columns: auto 12px minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  padding: 6px 8px;
}

.map-layer-group .layer-check {
  display: inline-grid;
  place-items: center;
}

.map-layer-group .toggle-line i,
.map-layer-object i {
  width: 12px;
  height: 12px;
  display: block;
  border: 1px solid rgba(231, 237, 241, 0.44);
}

.map-layer-group .toggle-line b,
.map-layer-object span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-layer-group .toggle-line span {
  color: var(--muted);
  font-size: 11px;
}

.map-layer-group .toggle-line button {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(9, 15, 18, 0.82);
  color: var(--cyan);
  font-size: 11px;
  cursor: pointer;
}

.wall-design-grid input,
.wall-design-grid select {
  min-width: 112px;
}

.map-layer-objects {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  padding: 0 6px 6px;
}

.map-layer-object,
.map-layer-object label {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 6px;
}

.map-layer-object {
  grid-template-columns: minmax(0, 1fr) 28px;
  border: 1px solid rgba(45, 60, 70, 0.72);
  background: rgba(8, 14, 18, 0.78);
  padding: 4px;
}

.map-layer-object.active {
  border-color: var(--cyan);
}

.map-layer-object label {
  grid-template-columns: auto 12px minmax(0, 1fr);
  color: #c7d5da;
  font-size: 11px;
}

.map-layer-object input {
  width: auto;
  margin: 0;
}

.map-layer-object button {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  color: var(--cyan);
}

.object-type-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
}

.object-type-list span,
.object-type-preview,
.object-row-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.object-type-list span {
  border: 1px solid var(--line);
  background: #0f1519;
  padding: 6px 7px;
  color: #c7d5da;
  font-size: 11px;
  overflow-wrap: break-word;
  word-break: normal;
}

.object-type-list i,
.object-type-preview i,
.object-row-meta i {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 1px solid rgba(231, 237, 241, 0.42);
  box-shadow: 0 0 10px rgba(57, 213, 255, 0.16);
}

.object-type-preview {
  margin: -4px 0 10px;
  border: 1px solid var(--line);
  background: rgba(15, 21, 25, 0.86);
  padding: 7px 8px;
}

.object-type-preview b {
  min-width: 0;
  color: var(--cyan);
  font-size: 12px;
  overflow-wrap: break-word;
  word-break: normal;
}

.zone-code-chip {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  border: 1px solid currentColor;
  padding: 2px 6px;
  color: var(--yellow);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.2;
  vertical-align: middle;
  overflow-wrap: break-word;
  word-break: normal;
}

.zone-code-chip::before {
  content: "";
  flex: 0 0 12px;
  background: var(--zone-color, currentColor);
}

.svg-feature {
  cursor: pointer;
}

.svg-feature.selected {
  filter: drop-shadow(0 0 8px rgba(57, 213, 255, 0.72));
}

.vertex {
  cursor: grab;
}

.vertex:active {
  cursor: grabbing;
}

.label-text,
.zone-code-label,
.measure-text {
  pointer-events: none;
  font-size: 13px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #071015;
  stroke-width: 4px;
}

.zone-code-label {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  stroke: rgba(5, 8, 10, 0.95);
  stroke-width: 4px;
}

.geology-map-hole {
  pointer-events: none;
}

.geology-map-hole text {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(5, 8, 10, 0.95);
  stroke-width: 4px;
}

.measure-text {
  fill: var(--yellow);
}

.empty,
.code-sample {
  border: 1px dashed var(--line-2);
  color: var(--muted);
  background: #0f1519;
  padding: 12px;
}

.code-sample {
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--green);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(440px, calc(100vw - 36px));
  border: 1px solid var(--cyan);
  background: #0d1317;
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

@media (max-width: 1180px) {
  .cad-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar-brand div:not(.cad-logo),
  .side-nav button:not(.active) {
    font-size: 0;
  }

  .side-nav button {
    justify-content: center;
  }

  .editor-body {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .editor-page.tools-collapsed .editor-body,
  .editor-page.tools-collapsed.properties-collapsed .editor-body {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .editor-page.properties-collapsed .editor-body {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .cad-ribbon {
    grid-template-columns: 1fr;
  }

  .properties-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    border-left: none;
    border-top: 1px solid var(--line);
    max-height: 280px;
  }

  .dashboard-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(280px, 1fr) auto auto;
    overflow: auto;
  }

  .dashboard-summary,
  .dashboard-map-card,
  .dashboard-list,
  .dashboard-status {
    grid-column: 1;
    grid-row: auto;
  }

  .dashboard-map-preview {
    min-height: 300px;
  }

  .pipeline-page {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .pipeline-page.qa-collapsed {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .pipeline-page.stages-collapsed,
  .pipeline-page.stages-collapsed.qa-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .pipeline-qa {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .pipeline-head,
  .pipeline-form-title {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1380px) {
  .pipeline-page {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .pipeline-page.qa-collapsed {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .pipeline-page.stages-collapsed,
  .pipeline-page.stages-collapsed.qa-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .pipeline-qa {
    grid-column: 1 / -1;
    grid-row: 2;
    max-height: 260px;
  }

  .pipeline-head,
  .pipeline-form-title {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .cad-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .cad-sidebar {
    grid-row: 1;
    grid-template-rows: auto;
  }

  .sidebar-brand {
    display: none;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .side-nav button {
    min-width: 92px;
    justify-content: flex-start;
    font-size: 12px;
  }

  .cad-main {
    grid-row: 2;
  }

  .cad-topbar {
    align-items: flex-start;
    height: auto;
    padding: 10px;
    flex-direction: column;
  }

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

  .dashboard-page {
    padding: 10px;
  }

  .stat-row {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .draw-assistant {
    left: 8px;
    top: 8px;
    max-width: calc(100% - 16px);
    flex-direction: column;
  }

  .draw-assistant > div {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 6px;
  }

  .orientation-widget {
    right: 8px;
    top: auto;
    bottom: 48px;
    min-width: 172px;
  }

  .grid-scale {
    left: 8px;
    right: 8px;
    bottom: 42px;
    max-width: none;
    text-align: left;
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }

  .pipeline-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow: auto;
  }

  .pipeline-main {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .pipeline-form-card {
    flex: 0 0 auto;
    overflow: visible;
  }

  .pipeline-stage-rail {
    display: flex;
    overflow-x: auto;
  }

  .pipeline-stage-rail button {
    min-width: 188px;
  }

  .editor-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(360px, 1fr) auto;
  }

  .editor-page.tools-collapsed .editor-body,
  .editor-page.properties-collapsed .editor-body,
  .editor-page.tools-collapsed.properties-collapsed .editor-body {
    grid-template-columns: 1fr;
  }

  .tool-palette {
    grid-row: 1;
    grid-column: 1;
    grid-template-columns: repeat(4, minmax(70px, 1fr));
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .map-stage {
    grid-column: 1;
    grid-row: 2;
    min-height: 380px;
  }

  .properties-panel {
    grid-column: 1;
    grid-row: 3;
  }

  .editor-page.tools-collapsed .map-stage {
    grid-row: 1;
  }

  .editor-page.tools-collapsed .properties-panel {
    grid-row: 2;
  }

  .editor-page.properties-collapsed .map-stage {
    grid-row: 2;
  }

  .editor-page.tools-collapsed.properties-collapsed .map-stage {
    grid-row: 1;
  }
}

@media (max-width: 1080px) {
  .page-grid,
  .dashboard-page {
    overflow: auto;
  }

  .pipeline-page {
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .span-2,
  .span-3 {
    grid-column: 1 / -1;
  }

  .pipeline-page {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }

  .pipeline-page.qa-collapsed {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }

  .pipeline-qa {
    grid-column: 1 / -1;
    grid-row: auto;
    max-height: 260px;
  }

  .pipeline-form-card,
  .pipeline-main,
  .pipeline-qa,
  .cad-card {
    min-width: 0;
  }

  .pipeline-table-head,
  .pipeline-head,
  .pipeline-form-title {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .pipeline-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow: auto;
  }

  .pipeline-page.qa-collapsed {
    grid-template-columns: 1fr;
  }

  .pipeline-main {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .pipeline-form-card {
    flex: 0 0 auto;
    overflow: visible;
  }

  .pipeline-qa {
    max-height: none;
  }
}

@media (min-width: 1081px) {
  .pipeline-page {
    grid-template-columns: minmax(190px, 240px) minmax(360px, 1fr) minmax(260px, 320px);
    overflow: hidden;
  }

  .pipeline-page.qa-collapsed {
    grid-template-columns: minmax(190px, 240px) minmax(360px, 1fr) 58px;
  }

  .pipeline-page.stages-collapsed {
    grid-template-columns: 72px minmax(360px, 1fr) minmax(260px, 320px);
  }

  .pipeline-page.stages-collapsed.qa-collapsed {
    grid-template-columns: 72px minmax(360px, 1fr) 58px;
  }

  .pipeline-qa {
    grid-column: auto;
    grid-row: auto;
    max-height: 100%;
  }
}

@media (max-width: 900px) {
  .table-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .table-row b {
    text-align: left;
  }

  .status-lines div,
  .metrics-strip div {
    display: grid;
    grid-template-columns: minmax(96px, 0.45fr) minmax(0, 1fr);
  }

  .pipeline-data-grid {
    min-width: 100%;
  }

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

  .batch-selector-actions {
    justify-content: flex-start;
  }

  .cad-topbar {
    align-items: flex-start;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .top-actions select {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .cad-shell.sidebar-collapsed,
  .cad-shell {
    grid-template-columns: 1fr;
  }

  .cad-main {
    min-height: 0;
  }

  .cad-ribbon {
    max-height: 220px;
  }

  .draw-assistant,
  .orientation-widget,
  .coords,
  .grid-scale {
    max-width: calc(100% - 16px);
  }

  .coords {
    right: 8px;
  }

  .pipeline-data-grid {
    min-width: 100%;
  }
}
