/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --nav-bg: #0b1f33;
  --nav-text: #e8eef4;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --border: #d5dde5;
  --text: #1a2330;
  --muted: #5b6b7c;
  --accent: #0d7a7a;
  --accent-hover: #0a6363;
  --csb-primary: #1d6fd8;
  --csb-secondary: #d64545;
  --tag-new: #1f8a4c;
  --tag-changed: #c47b12;
  --tag-removed: #c0392b;
  --ok: #1f8a4c;
  --warn: #c47b12;
  --block: #c0392b;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --radius: 6px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
  line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
}
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.top-nav {
  background: var(--nav-bg);
  color: var(--nav-text);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  height: 48px;
}
.top-nav .brand { font-weight: 700; letter-spacing: 0.04em; font-size: 15px; }
.top-nav nav { display: flex; gap: 16px; flex: 1 1; }
.top-nav a { opacity: 0.75; padding: 14px 0; border-bottom: 2px solid transparent; }
.top-nav a.active { opacity: 1; border-bottom-color: var(--accent); font-weight: 600; }
.top-nav .user {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}

.context-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.field label { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.field select, .field input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: #fff;
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.segmented button {
  border: 0;
  background: #fff;
  padding: 7px 12px;
  color: var(--muted);
}
.segmented button.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.context-meta { margin-left: auto; color: var(--muted); font-size: 12px; align-self: center; }

.tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 4px;
  padding: 0 16px;
}
.tabs a {
  padding: 10px 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs a.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.page { padding: 16px; flex: 1 1; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-body { padding: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.badge.new { background: #e6f6ec; color: var(--tag-new); }
.badge.changed { background: #fff4e5; color: var(--tag-changed); }
.badge.removed { background: #fdecea; color: var(--tag-removed); }
.badge.ok { background: #e6f6ec; color: var(--ok); }
.badge.warn { background: #fff4e5; color: var(--warn); }
.badge.block { background: #fdecea; color: var(--block); }
.badge.neutral { background: #eef2f6; color: var(--muted); }

.btn {
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 8px 14px;
  font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #9aa7b5; cursor: not-allowed; }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text); }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--border); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }

/* Workspace do esquemático: chrome compacto + grid que preenche o viewport */
.schematic-workspace {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* nav (~48) + context (~64) + tabs (~42) + page padding (~32) */
  height: calc(100vh - 186px);
  height: calc(100dvh - 186px);
  min-height: 460px;
  overflow: hidden;
}

.schematic-workspace .seed-banner {
  margin-bottom: 0;
  flex-shrink: 0;
  padding: 8px 12px;
}

.schematic-workspace .legend {
  margin-bottom: 0;
  flex-shrink: 0;
}

.editor-grid {
  display: grid;
  /* Laterais compactas; coluna central (poço) maximizada */
  grid-template-columns:
    var(--components-panel-width, 220px)
    minmax(0, 1fr)
    var(--inspector-panel-width, 280px);
  grid-gap: 10px;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

.components-panel,
.inspector {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.components-panel .panel-body,
.components-panel-body,
.inspector .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.panel-resize-handle {
  position: absolute;
  top: 0;
  right: -7px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
  touch-action: none;
}

.panel-resize-handle::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 4px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background 0.12s ease;
}

.panel-resize-handle:hover::after,
.panel-resize-handle:focus-visible::after,
body.resizing-panels .panel-resize-handle::after {
  background: var(--accent);
}

.schematic-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.schematic-panel .panel-body {
  background: var(--bg);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 10px;
}

.schematic-panel .canvas-chrome {
  flex-shrink: 0;
  margin-bottom: 8px;
}

.schematic-stage {
  flex: 1 1 auto;
  min-height: 420px;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.tree-item {
  padding: 6px 8px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.tree-item:hover { background: #f0f4f8; }
.tree-item.selected { background: #e8f4f4; outline: 1px solid #b7dede; }
.tree-item .tree-label { min-width: 0; }
.tree-item.removed .tree-label {
  color: var(--tag-removed);
  text-decoration: line-through;
}
.tree-group { font-weight: 600; margin: 10px 0 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; }

.canvas-placeholder {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  height: 100%;
  /* Fallback fora do workspace (ex.: CSB); no esquemático o pai define a altura */
  min-height: min(52vh, 420px);
  margin: 0;
  background: linear-gradient(180deg, #fafbfc 0%, #eef3f7 100%);
  border: 1px dashed #b8c4d0;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.schematic-workspace .canvas-placeholder {
  min-height: 0;
}
.schematic-workspace .canvas-placeholder.unity-host {
  min-height: 420px;
}
.unity-surface {
  position: absolute;
  inset: 0;
}
.unity-host {
  border-style: solid;
  background: #0b1f33;
  padding: 0;
  overflow: hidden;
  min-height: 420px;
  max-width: none;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  touch-action: none;
  -moz-user-select: none;
       user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.unity-canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  min-height: unset;
  display: block;
  background: #0b1f33;
  outline: none;
  touch-action: none;
  -moz-user-select: none;
       user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.unity-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(11, 31, 51, 0.72);
  color: #e8eef4;
  font-weight: 600;
  pointer-events: none;
}
.unity-error { color: #ffb4b4; padding: 16px; text-align: center; }
.unity-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f7fafc;
}
.unity-missing-box {
  max-width: 560px;
  color: var(--text);
}
.unity-missing-box code {
  background: #eef2f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.unity-missing-box ol { padding-left: 18px; }
.well-schematic {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.schematic-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  align-items: stretch;
}
.schematic-csb-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  max-width: 520px;
}
.legend {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}
.swatch { width: 14px; height: 3px; display: inline-block; margin-right: 4px; vertical-align: middle; }
.swatch.primary { background: var(--csb-primary); }
.swatch.secondary { background: var(--csb-secondary); }
.swatch.verify {
  width: 12px;
  height: 12px;
  border: 1.5px dashed var(--warn);
  background: transparent;
  margin-right: 4px;
  box-sizing: border-box;
}

.canvas-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.canvas-chrome-layers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.canvas-chrome-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  white-space: nowrap;
}
.canvas-chrome-item input {
  margin: 0;
  accent-color: var(--accent);
}
.canvas-chrome-item:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}
.canvas-chrome-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.canvas-chrome-scale {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

.inspector .panel-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.inspector-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.inspector-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
}
.inspector-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.inspector-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}
.inspector-title .badge { flex-shrink: 0; }
.inspector .field { min-width: 0; }
.inspector .field label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.inspector-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-gap: 10px;
  gap: 10px;
  margin-bottom: 4px;
}
.inspector .row { margin-bottom: 10px; }
.inspector .hint { color: var(--muted); font-size: 11px; margin-top: 2px; }
.inspector .hint.asbuilt {
  color: var(--tag-changed);
  font-weight: 600;
  margin: 2px 0 10px;
}
.inspector .subhead {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 12px;
}
.inspector .section-title {
  font-weight: 600;
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.inspector-requer {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.inspector-test-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 12px;
}
.inspector-action-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 8px;
}
.callout,
.inspector .callout {
  background: #fff8e8;
  border: 1px solid #f0d9a0;
  border-radius: var(--radius);
  padding: 8px 10px;
  color: #7a5a10;
  margin: 12px 0;
}
.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 8px;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.inspector-actions .btn {
  width: 100%;
  text-align: center;
}
.inspector .field select,
.inspector .field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: #fff;
}
.seed-banner {
  background: #fff8e8;
  border: 1px solid #f0d9a0;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: #7a5a10;
  margin-bottom: 12px;
}

.csb-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-gap: 12px;
  gap: 12px;
}
.csb-grid .schematic-stage {
  min-height: min(60vh, 560px);
}
.csb-grid .canvas-placeholder {
  height: auto;
  aspect-ratio: 3 / 4;
  max-height: min(75vh, 720px);
}
.status-cards { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; gap: 10px; margin-bottom: 12px; }
.status-card { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.status-card h3 { margin: 0 0 6px; font-size: 13px; }

.publish-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr 280px;
  grid-gap: 12px;
  gap: 12px;
  align-items: start;
}

/* Same idea as components panel on esquemático: fixed viewport budget + internal scroll */
.publish-checklist-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(70vh, 640px);
  overflow: hidden;
}

.publish-checklist-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.stepper {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.step .dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border);
  display: grid; place-items: center; font-size: 10px;
}
.step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.current .dot { border-color: var(--csb-primary); color: var(--csb-primary); font-weight: 700; }

.validation-item {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #eef2f6;
}
.validation-item .icon { font-weight: 700; width: 14px; }

.fields-home { display: grid; grid-gap: 14px; gap: 14px; }
.field-section { overflow: hidden; }
.field-section-header { gap: 12px; }
.wells-list { display: grid; grid-gap: 10px; gap: 10px; max-width: 720px; }
.well-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.well-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

/* SGPP-inspired field card grid (DEP tokens, no copied assets) */
.fields-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  grid-gap: 16px;
  gap: 16px;
  max-width: 900px;
}
.nav-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 14px 16px;
  background: var(--accent);
  color: #f7fbfb;
  border-radius: 10px;
  min-height: 150px;
  transition: transform 0.18s ease, background 0.18s ease;
  box-shadow: var(--shadow);
}
.nav-tile:hover {
  transform: scale(1.04);
  background: var(--accent-hover);
}
.nav-tile-glyph {
  color: #f7fbfb;
  opacity: 0.95;
  line-height: 0;
}
.nav-tile-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.25;
  word-break: break-word;
}
.nav-tile-meta {
  font-size: 11px;
  opacity: 0.85;
}
.nav-tile .badge {
  background: rgba(255, 255, 255, 0.18);
  color: #f7fbfb;
  border: none;
}
.crumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.crumb-nav a {
  color: var(--accent);
  font-weight: 600;
}
.crumb-nav a:hover { text-decoration: underline; }
.login-box {
  max-width: 420px;
  margin: 80px auto;
  padding: 24px;
}
.login-box h1 { margin-top: 0; font-size: 22px; }
.login-box .actions { display: flex; gap: 8px; margin-top: 16px; }

.compare-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 18px;
  margin-bottom: 12px;
  padding: 12px 14px;
}
.compare-head .field { min-width: 200px; }
.compare-head .field label,
.compare-field-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.compare-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding-bottom: 6px;
}
.compare-legend {
  margin: 0 0 6px auto;
}
.compare-legend .swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.compare-legend .swatch.removed-dash {
  width: 10px;
  height: 10px;
  border: 0;
  background: var(--tag-removed);
}
.compare-head .timeline { flex-basis: 100%; }
.compare-pane-head { align-items: flex-start; }
.compare-pane-title { font-weight: 700; }
.compare-pane-sub {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.compare-type-pill {
  background: #e7f6f4;
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.compare-pane .panel-body { padding: 0; }
.compare-unity-frame {
  display: block;
  width: 100%;
  height: 640px;
  border: 0;
  background: #0b1f33;
}
.compare-overlay-stack { position: relative; }
.compare-overlay-stack .overlay-top {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0.48;
  pointer-events: none;
}
.unity-embed-root {
  position: fixed;
  inset: 0;
  background: #0b1f33;
}
.unity-embed-root .unity-host {
  height: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
}
.unity-embed-error {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  color: #ffb4b4;
  margin: 0;
}
.compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.compare-canvases {
  display: grid;
  grid-template-columns: 1fr 1fr 280px;
  grid-gap: 12px;
  gap: 12px;
  margin-bottom: 12px;
}
.compare-canvases.overlay {
  grid-template-columns: minmax(0, 1fr) 280px;
}
.compare-toolbar.panel { padding: 12px; }
.snapshot-pickers {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 8px;
  min-width: 0;
}
.snapshot-pickers legend { font-weight: 700; padding: 0 4px; }
.snapshot-pickers label,
.timeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.timeline { flex: 1 1; min-width: 220px; }
.snapshot-pickers select,
.schematic-nav input,
.timeline input[type="range"] {
  font: inherit;
}
.snapshot-pickers select,
.schematic-nav input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 6px;
  background: #fff;
}
.compare-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.compare-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.compare-filters input[type="checkbox"] { margin-right: 6px; }
tr.diff-added td { background: #e6f6ec; }
tr.diff-changed td { background: #fff4e5; }
tr.diff-removed td { background: #fdecea; }
tr.diff-removed { outline: 1px dashed var(--tag-removed); outline-offset: -2px; }
tr.is-selected td { box-shadow: inset 0 -2px 0 var(--accent); }
tr.mark-pending td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.mark-expired td:first-child,
tr.mark-failed td:first-child { box-shadow: inset 3px 0 0 var(--block); }
tr.mark-degraded td:first-child { box-shadow: inset 3px 0 0 var(--tag-changed); }
tr.mark-shared td:first-child { box-shadow: inset 3px 0 0 var(--csb-primary); }

.banner {
  background: #fff8e8;
  border: 1px solid #f0d9a0;
  border-radius: var(--radius);
  padding: 8px 12px;
  color: #7a5a10;
}
.banner.info {
  background: #eef6f6;
  border-color: #b7dede;
  color: var(--text);
}
.banner.block {
  background: #fdecea;
  border-color: #f0c2bc;
  color: var(--block);
}
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 11px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.table-wrap { overflow-x: auto; }
.field textarea,
.note-field textarea,
table textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: #fff;
  resize: vertical;
  min-height: 52px;
}

.schematic-workspace { overflow: hidden; }
.wbs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.wbs-strip div { display: flex; flex-direction: column; min-width: 88px; }
.wbs-strip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.note-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  flex-shrink: 0;
}
.note-field-head,
.catalog-picker {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.catalog-picker {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 8px;
  background: #fafbfc;
}
.catalog-picker ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 220px; overflow: auto; }
.catalog-picker li button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  border-radius: 4px;
}
.catalog-picker li button.active,
.catalog-picker li button:hover { background: #e8f4f4; }
.catalog-picker li span { display: block; color: var(--muted); font-size: 11px; }
.template-entry { margin: 0 0 8px; }
.template-entry .btn { font-size: 11px; padding: 4px 8px; }
.tree-item.dim { opacity: 0.38; }
.schematic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.schematic-nav .btn { padding: 4px 8px; }
.schematic-nav label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.schematic-nav input { width: 72px; }
.schematic-viewport { flex: 1 1; min-height: 0; overflow: auto; }
.schematic-zoom { transform-origin: top center; min-height: 100%; }
.schematic-panel .schematic-stage { min-height: 240px; }
.label-line {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text);
  flex-shrink: 0;
}
.minimap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
}
.minimap-track {
  position: relative;
  flex: 1 1;
  height: 18px;
  background: #eef3f7;
  border: 1px dashed #b8c4d0;
  border-radius: 999px;
}
.minimap-track button {
  position: absolute;
  top: 3px;
  width: 8px;
  height: 10px;
  margin-left: -4px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  padding: 0;
}
.minimap-track button.on { background: var(--tag-changed); height: 14px; top: 1px; }
.canvas-chrome-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.canvas-chrome-meta select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 6px;
  background: #fff;
}
.status-card.primary { border-top: 3px solid var(--csb-primary); background: #f4f8fd; }
.status-card.secondary { border-top: 3px solid var(--csb-secondary); background: #fdf6f6; }
.swatch.added { background: var(--tag-new); height: 8px; }
.swatch.changed { background: var(--tag-changed); height: 8px; }
.swatch.removed-dash {
  width: 18px;
  height: 0;
  border-bottom: 2px dashed var(--tag-removed);
  background: transparent;
}
.abandon-note summary { cursor: pointer; padding: 10px 12px; font-weight: 600; }
.step.current { color: var(--text); font-weight: 700; }
.step.done { color: var(--text); }

@media (max-width: 1100px) {
  .schematic-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .editor-grid, .csb-grid, .publish-grid, .compare-canvases {
    grid-template-columns: 1fr;
  }
  .editor-grid {
    flex: none;
    height: auto;
  }
  .components-panel,
  .inspector {
    height: auto;
    max-height: min(42vh, 380px);
  }
  .schematic-panel {
    height: min(70vh, 720px);
  }
  .panel-resize-handle {
    display: none;
  }
}

