:root {
  color-scheme: light;
  --studio-desktop-header-height: 59px;
  --studio-sticky-gap: 18px;
  --bg: #f5eee8;
  --panel: #ffffff;
  --frame-bg: #2a5050;
  --navigation-bg: #e0e9ea;
  --line: #bdc9c9;
  --text: #16201c;
  --muted: #5e6b66;
  --accent: #3e6464;
  --accent-strong: #294d4d;
  --warning: #8a5318;
  --danger: #9b2f2f;
  --shadow: 0 10px 24px rgba(30, 40, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  overflow-x: hidden;
}

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

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
}

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

button.primary,
#saveButton,
#saveSubjectButton,
#saveGeometryButton,
#saveSubobjectButton {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

#deleteButton {
  color: var(--danger);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.app-shell[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--studio-desktop-header-height);
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.brand-block {
  flex: 0 0 auto;
}

.brand {
  font-size: 18px;
  font-weight: 700;
}

.context-switcher {
  min-width: 280px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  background: #f3f7f4;
}

.context-index-button {
  min-height: 30px;
  padding: 4px 7px;
  border-color: #b9cac1;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
}

.context-switcher > label {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  align-items: stretch;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.context-switcher select {
  grid-column: 1;
  min-width: 0;
  width: 100%;
  padding: 1px 24px 1px 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.context-switcher > label > strong {
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 13px;
  letter-spacing: normal;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.context-release-status {
  min-width: 110px;
  display: grid;
  padding-left: 8px;
  border-left: 1px solid #cbd8d1;
  line-height: 1.15;
}

.context-release-status span,
.context-release-status small {
  color: var(--muted);
  font-size: 9px;
}

.context-release-status strong {
  max-width: 135px;
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-release-status small {
  max-width: 135px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instance {
  color: var(--muted);
  font-size: 12px;
}

.workplanes {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workplanes a,
.workplanes span {
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 6px;
  text-decoration: none;
}

.workplanes .active {
  color: #ffffff;
  background: var(--accent-strong);
}

.tour-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.tour-controls button {
  white-space: nowrap;
}

.app-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 22px;
  border-bottom: 1px solid #bfd0c5;
  background: #edf4f0;
  color: var(--accent-strong);
  font-size: 13px;
}

.app-status.error {
  border-bottom-color: #e0b9b9;
  background: #f8eeee;
  color: var(--danger);
}

.app-status-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid #b8cbc0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: app-status-spin 0.8s linear infinite;
}

.app-status.error .app-status-spinner {
  display: none;
}

@keyframes app-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.tour-menu {
  position: absolute;
  z-index: 200;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 28px));
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.tour-menu strong {
  padding: 4px 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.tour-menu button {
  width: 100%;
  text-align: left;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
}

.workspace.modeling-mode {
  grid-template-columns: 1fr;
}

.workspace.reference-mode {
  grid-template-columns: 1fr;
}

.workspace.guide-mode {
  grid-template-columns: 1fr;
}

.workspace.modeling-mode .domain-pane,
.workspace.reference-mode .domain-pane,
.workspace.guide-mode .domain-pane {
  display: none;
}

.domain-pane,
.reference-pane {
  min-width: 0;
  min-height: 0;
}

.domain-pane {
  border-right: 1px solid var(--line);
  background: #eef2ed;
  padding: 16px;
  overflow: auto;
}

.pane-head,
.reference-head,
.table-head,
.form-head,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 16px;
}

.domain-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.hidden {
  display: none !important;
}

.jig-busy {
  position: relative;
  isolation: isolate;
}

.jig-busy-overlay {
  position: absolute;
  z-index: 15000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 120px;
  background: rgba(246, 247, 244, 0.78);
  color: var(--accent-strong);
  cursor: progress;
  font-weight: 700;
  backdrop-filter: blur(1.5px);
}

.jig-busy-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(62, 100, 100, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: jig-busy-spin 700ms linear infinite;
}

@keyframes jig-busy-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jig-busy-spinner {
    animation: none;
    border-color: rgba(62, 100, 100, 0.35);
    border-top-color: var(--accent);
  }
}

.help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  border: 1px solid #b9c5bd;
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  vertical-align: text-bottom;
}

.help::after {
  content: "?";
  line-height: 1;
}

.help-tooltip {
  position: fixed;
  z-index: 20000;
  max-width: min(360px, calc(100vw - 20px));
  padding: 10px 12px;
  border: 1px solid #c8d1c8;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 14px 36px rgba(30, 40, 36, 0.18);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
}

.driver-popover.climae-tour-popover {
  min-width: min(360px, calc(100vw - 28px));
  max-width: min(460px, calc(100vw - 28px));
  border: 1px solid #c8d1c8;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(30, 40, 36, 0.22);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.driver-popover.climae-tour-popover .driver-popover-title {
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
}

.driver-popover.climae-tour-popover .driver-popover-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.driver-popover.climae-tour-popover button {
  min-height: 30px;
  border-radius: 6px;
  text-shadow: none;
}

.domain-item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.domain-item.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.domain-item strong,
.domain-item span {
  display: block;
}

.domain-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.reference-pane {
  padding: 18px 20px;
  overflow: auto;
}

.reference-home {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 0 36px;
}

.reference-home.lineage-mode {
  width: min(1280px, 100%);
}

.reference-home-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.reference-home-head h1 {
  margin-top: 2px;
  font-size: 28px;
}

.reference-home-head p:not(.eyebrow) {
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted);
}

.reference-home-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reference-home-view-switcher {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef2ed;
}

.reference-home-view-switcher button {
  min-height: 32px;
  padding: 5px 10px;
  border-color: transparent;
  background: transparent;
}

.reference-home-view-switcher button.active {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reference-home-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.reference-home-item {
  width: 100%;
  min-height: 104px;
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(380px, 1.8fr) auto;
  gap: 22px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 9px;
  text-align: left;
  box-shadow: 0 4px 14px rgba(30, 40, 36, 0.04);
}

.reference-home-item:hover,
.reference-home-item:focus-visible {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent), 0 8px 24px rgba(30, 40, 36, 0.08);
}

.reference-home-item.current-context {
  border-color: #9fbbae;
  background: #f7fbf8;
  box-shadow: inset 4px 0 0 var(--accent);
}

.reference-current-context {
  padding: 2px 7px;
  border-radius: 999px;
  background: #dceee4;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
}

.reference-home-item-main,
.reference-home-item-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.reference-home-item-main {
  display: grid;
  gap: 4px;
}

.reference-home-item-title strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.reference-status {
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf2ee;
  color: var(--muted);
  font-size: 11px;
}

.reference-internal-name {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.reference-home-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reference-home-counts > span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f9f6;
  color: var(--muted);
  font-size: 12px;
}

.reference-home-counts strong {
  color: var(--text);
}

.reference-home-open {
  color: var(--accent-strong);
  font-weight: 700;
  white-space: nowrap;
}

.reference-home-open span {
  margin-left: 5px;
  font-size: 18px;
}

.reference-lineage-view {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.lineage-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid #bfd0c7;
  border-radius: 9px;
  background: linear-gradient(135deg, #edf5f0, #ffffff);
}

.lineage-intro > div:first-child {
  max-width: 720px;
  display: grid;
  gap: 4px;
}

.lineage-intro p:not(.eyebrow) {
  color: var(--muted);
}

.lineage-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 12px;
  color: var(--muted);
  font-size: 11px;
}

.lineage-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lineage-legend i {
  width: 10px;
  height: 10px;
  border: 2px solid #9aa8a0;
  border-radius: 3px;
  background: #ffffff;
}

.lineage-legend i.complete {
  border-color: var(--accent);
}

.lineage-legend i.active {
  border-color: var(--accent-strong);
  background: var(--accent);
}

.lineage-legend i.legacy {
  border-color: #c79b63;
  border-style: dashed;
}

.lineage-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.lineage-status.error {
  color: var(--danger);
}

.lineage-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 14px;
  align-items: start;
}

.lineage-map-region {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(41, 83, 63, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 83, 63, 0.035) 1px, transparent 1px),
    #fbfcfa;
  background-size: 24px 24px;
}

.reference-lineage-graph {
  min-height: 280px;
  overflow: auto;
}

.reference-lineage-graph svg {
  display: block;
  min-width: 100%;
}

.lineage-domain-title {
  fill: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.lineage-domain-slug,
.lineage-empty-lane {
  fill: var(--muted);
  font-size: 10px;
}

.lineage-edge {
  pointer-events: none;
}

.lineage-edge path {
  fill: none;
  stroke: #83978c;
  stroke-width: 1.5;
}

.lineage-edge.fork path,
.lineage-edge.inherits_from path,
.lineage-edge.adopts path {
  stroke: #9b6d32;
  stroke-dasharray: 4 3;
}

.lineage-edge.merge path {
  stroke: #74568c;
  stroke-width: 2;
}

.lineage-edge text {
  fill: var(--muted);
  font-size: 8px;
}

#lineage-arrow path {
  fill: #83978c;
}

.lineage-node {
  cursor: pointer;
  outline: none;
}

.lineage-node rect {
  fill: #ffffff;
  stroke: #9fb0a7;
  stroke-width: 1.5;
  transition: fill 120ms ease, stroke 120ms ease;
}

.lineage-node.legacy rect {
  stroke: #c79b63;
  stroke-dasharray: 4 3;
}

.lineage-node.active-release rect {
  fill: #edf7f1;
  stroke: var(--accent-strong);
  stroke-width: 2;
}

.lineage-node.selected rect,
.lineage-node:focus rect {
  stroke: #1f6f52;
  stroke-width: 3;
}

.lineage-node.base rect {
  fill: #e6f2eb;
}

.lineage-node.compared rect {
  fill: #fff3df;
  stroke: #ad6f25;
}

.lineage-node-version {
  fill: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.lineage-node-meta {
  fill: var(--muted);
  font-size: 9px;
}

.reference-lineage-mobile {
  display: none;
}

.lineage-detail {
  position: sticky;
  top: calc(var(--studio-live-header-height, var(--studio-desktop-header-height)) + var(--studio-sticky-gap));
  display: grid;
  gap: 12px;
  max-height: calc(100vh - var(--studio-live-header-height, var(--studio-desktop-header-height)) - (2 * var(--studio-sticky-gap)));
  overflow-y: auto;
}

.lineage-detail .detail-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lineage-relations {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.lineage-relations > strong {
  margin-top: 4px;
  font-size: 12px;
}

.lineage-relations button {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  background: #f7f9f6;
  text-align: left;
}

.lineage-relations button span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.lineage-relations button strong {
  font-size: 11px;
}

.lineage-detail-actions {
  flex-wrap: wrap;
}

.lineage-fork-notice {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-left: 4px solid var(--warning);
  border-radius: 5px;
  background: #fff8ec;
  color: #633b13;
  font-size: 12px;
}

.lineage-fork-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d7b77d;
  border-left: 4px solid var(--warning);
  border-radius: 7px;
  background: #fffaf1;
}

.lineage-fork-form > div:first-child {
  display: grid;
  gap: 4px;
}

.lineage-fork-form p {
  color: #633b13;
  font-size: 11px;
  line-height: 1.45;
}

.lineage-fork-form label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.lineage-fork-form input,
.lineage-fork-form textarea {
  grid-column: 1;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.lineage-fork-form textarea {
  resize: vertical;
}

.lineage-fork-form label small {
  grid-column: 1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

.lineage-fork-form .form-actions {
  justify-content: flex-end;
}

.lineage-fork-error {
  padding: 7px 8px;
  border-radius: 5px;
  background: #fff0ee;
  color: var(--danger) !important;
}

.lineage-comparison {
  display: grid;
  gap: 12px;
}

.lineage-comparison-selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.lineage-comparison-selection > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9f6;
}

.lineage-comparison-selection small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.lineage-comparison-selection strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.lineage-comparison-selection > b {
  color: var(--muted);
}

.reference-pane.domain-open {
  display: grid;
  grid-template-areas:
    "navigation intro"
    "navigation content";
  grid-template-columns: minmax(215px, 260px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px 20px;
  align-items: start;
}

.reference-pane.domain-open .reference-head {
  grid-area: head;
  margin-bottom: 0;
}

.reference-pane.domain-open .reference-collection-tabs {
  position: sticky;
  top: 0;
  grid-area: navigation;
}

.reference-pane.domain-open .reference-collection-intro {
  grid-area: intro;
}

.reference-pane.domain-open #referenceBrowseDisplay,
.reference-pane.domain-open #referenceEditDisplay,
.reference-pane.domain-open #referenceLabDisplay,
.reference-pane.domain-open #referenceReleaseDisplay,
.reference-pane.domain-open #referenceVerificationDisplay {
  grid-area: content;
}

@media (min-width: 981px) {
  .reference-pane.domain-open {
    overflow: visible;
  }

  .reference-pane.domain-open .reference-collection-tabs {
    top: calc(var(--studio-desktop-header-height) + var(--studio-sticky-gap));
    max-height: calc(100vh - var(--studio-desktop-header-height) - (2 * var(--studio-sticky-gap)));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .reference-pane.domain-open #referenceBrowseDisplay {
    align-items: start;
  }

  .reference-pane.domain-open .reference-detail-pane {
    position: sticky;
    top: calc(var(--studio-desktop-header-height) + var(--studio-sticky-gap));
    align-self: start;
    height: fit-content;
    max-height: calc(100vh - var(--studio-desktop-header-height) - (2 * var(--studio-sticky-gap)));
    overflow: hidden;
  }

  .reference-pane.domain-open .reference-detail-pane #referenceDetailBody {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .reference-pane.domain-open .reference-version-detail-pane #referenceVersionDetailBody {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

.reference-back-button {
  min-height: 0;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 13px;
}

.reference-back-button::before {
  content: "←";
  margin-right: 6px;
}

.reference-collection-intro {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.reference-collection-intro > p {
  font-size: 16px;
}

.reference-relation-note {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.reference-relation-note strong {
  color: var(--accent-strong);
}

.modeling-pane {
  padding: 0;
  overflow: hidden;
}

.reference-head {
  margin-bottom: 14px;
}

#domainMeta {
  color: var(--muted);
  margin-top: 2px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
  min-width: 360px;
}

.summary-box {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.summary-box strong {
  display: block;
  font-size: 20px;
}

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

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.reference-collection-tabs {
  display: grid;
  align-content: start;
  gap: 3px;
  margin: 0;
  padding: 10px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--navigation-bg);
}

.reference-collection-mobile {
  display: none;
}

.reference-collection-tabs .reference-collection-tab {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 28px auto;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 7px 9px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #304747;
  text-align: left;
}

.reference-tab-count {
  padding: 1px 4px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid #9aafab;
  color: #435f58;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.reference-collection-tab.active .reference-tab-count { background: transparent; color: #1e4545; }
.reference-incomplete-filter { font-size: 12px; white-space: nowrap; }
.reference-incomplete-filter[aria-pressed="true"] { background: #c6d8d9; border-color: var(--accent); color: #1e4545; }
.table-head-actions:has(.reference-incomplete-filter:not([hidden])) { flex-wrap: wrap; justify-content: flex-end; }

.reference-collection-tabs .reference-collection-tab:hover {
  background: #d2dfe0;
}

.reference-collection-tabs .reference-collection-tab.active {
  background: #c6d8d9;
  border-left-color: var(--accent);
  color: #1e4545;
  font-weight: 700;
}

.reference-collection-tabs .reference-collection-tab:focus-visible {
  outline: 2px solid #f18700;
  outline-offset: 2px;
}

.reference-tab-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: transparent;
  color: var(--accent);
  font-size: 37.4px;
  line-height: 1;
}

.reference-collection-tab.active .reference-tab-icon {
  background: transparent;
  color: #1e4545;
}

.reference-collection-tab .help {
  margin-left: 0;
  background: transparent;
  border-color: #9aafab;
  color: #405f5b;
}

.tab {
  border: 1px solid var(--line);
  background: #ffffff;
}

.tab.active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.split {
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 420px);
  gap: 14px;
}

.modeling-split {
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
}

.table-region,
.editor-region {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.table-region {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.modeling-split .table-region {
  grid-template-rows: auto;
  align-content: start;
}

.table-head,
.form-head {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.table-head > div:first-child {
  min-width: 0;
}

.table-count {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.reference-list-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) minmax(92px, 110px);
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.reference-list-toolbar:has(#referenceSubjectTypeFilterLabel:not(.hidden)),
.reference-list-toolbar:has(#referenceDatasetVersionFilterLabel:not(.hidden)) {
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 160px) minmax(130px, 180px) minmax(90px, 100px);
}

.reference-list-toolbar:has(#referenceHazardFilterLabel:not(.hidden)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reference-view-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6f8f5;
}

.reference-view-switcher button {
  min-height: 30px;
  padding: 4px 9px;
  border-color: transparent;
  background: transparent;
  font-size: 12px;
}

.reference-view-switcher button.active {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.node-model-tree {
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow: auto;
}

.node-model-tree-subject-type,
.node-model-tree-system {
  display: grid;
  gap: 8px;
}

.node-model-tree-subject-type > h4,
.node-model-tree-system > h5 {
  margin: 0;
}

.node-model-tree-subject-type > h4 {
  color: var(--accent-strong);
  font-size: 15px;
}

.node-model-tree-system > h5 {
  font-size: 14px;
}

.node-model-tree-group {
  display: grid;
  gap: 8px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.node-model-tree-subsystem {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border-color: var(--line);
  background: #fbfcfa;
  color: var(--ink);
  text-align: left;
}

.node-model-tree-subsystem:hover,
.node-model-tree-subsystem:focus-visible,
.node-model-tree-subsystem.active {
  border-color: var(--accent-strong);
  background: #edf6f1;
}

.node-model-tree-subsystem small {
  color: var(--muted);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.reference-list-toolbar label {
  display: block;
  min-width: 0;
  padding: 0;
}

.reference-list-toolbar label > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.reference-list-toolbar input,
.reference-list-toolbar select {
  width: 100%;
  min-width: 0;
}

.reference-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fbfcfa;
}

.reference-pagination span {
  min-width: 100px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f3f5f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

th:has(.table-sort) {
  padding: 0;
}

.table-sort {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
  text-transform: inherit;
  white-space: nowrap;
}

.table-sort:hover {
  border-color: transparent;
  background: #e8ece7;
}

tr {
  cursor: pointer;
}

tr.active td {
  background: #d0e1e1;
}

td small {
  color: var(--muted);
  display: block;
}

.reference-identifier-cell {
  position: relative;
  padding-right: 62px;
}

.reference-identifier-cell > span,
.reference-identifier-cell > small {
  display: block;
  max-width: 38ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-reference-id {
  position: absolute;
  top: 7px;
  right: 7px;
  min-height: 26px;
  padding: 3px 6px;
  color: var(--muted);
  font-size: 11px;
}

.editor-region {
  overflow: auto;
}

.reference-edit-display {
  margin-top: 14px;
}

.asset-model-editor-body,
.asset-model-primary-fields { display: contents; }

#recordForm.asset-model-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  height: max(380px, calc(100dvh - var(--studio-live-header-height, 72px) - 125px));
  max-height: calc(100dvh - 95px);
  min-height: 0;
}

#recordForm.asset-model-form .asset-model-editor-body {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 1fr);
  gap: 18px;
  min-height: 0;
  overflow: hidden;
  padding: 8px 4px 8px 0;
}

#recordForm.asset-model-form .asset-model-primary-fields {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#recordForm.asset-model-form .asset-model-primary-fields > label {
  grid-template-columns: minmax(110px, 29%) 12px minmax(0, 1fr);
  padding: 4px 8px;
}

#recordForm.asset-model-form .asset-model-primary-fields > label > textarea {
  grid-column: 3;
  grid-row: 1;
  min-height: 54px;
}

.asset-model-editor-fields {
  display: grid;
  gap: 8px;
  margin: 6px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7faf8;
}

.asset-model-editor-fields.hidden {
  display: none;
}

.asset-model-editor-fields legend {
  padding: 0 6px;
  font-weight: 700;
}

.asset-model-editor-fields label {
  display: grid;
  gap: 6px;
}

.asset-model-editor-fields label small {
  color: var(--muted);
  font-weight: 400;
}

#recordForm.asset-model-form #fieldId:disabled,
#recordForm.asset-model-form #fieldStatus:disabled {
  background: #e7ece9;
  color: #53615c;
  border-color: #bcc8c2;
  cursor: not-allowed;
}

.asset-model-editor-fields { position: relative; }
.asset-model-status-help { position: absolute; right: 12px; top: 8px; z-index: 2; }
.asset-model-status-help p { right: 0; left: auto; width: min(23rem, 65vw); }
.asset-model-text-field { display: grid; grid-template-columns: minmax(11rem, 12rem) minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; }
.asset-model-text-field textarea { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }
.asset-model-field-head { display: flex; align-items: center; gap: 8px; position: relative; min-width: 0; width: 100%; }
.asset-model-editor-fields .asset-model-field-head label { display: block; min-width: 0; flex: 1 1 auto; font-weight: 600; }
.asset-model-field-help { position: relative; flex: 0 0 auto; margin-left: auto; }
.asset-model-field-help summary { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); cursor: pointer; list-style: none; font-size: .8rem; font-weight: 700; }
.asset-model-field-help summary::-webkit-details-marker { display: none; }
.asset-model-field-help p { position: absolute; z-index: 30; top: 100%; left: 0; width: min(21rem, 70vw); margin: 5px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 5px 18px #0002; color: var(--text); font-size: .85rem; font-weight: 400; }
.asset-model-field-help summary:focus-visible { outline: 3px solid #d78234; outline-offset: 2px; }

@media (max-width: 560px) {
  .asset-model-text-field { grid-template-columns: 1fr; }
}

.asset-model-geometry-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  border: 0;
  padding: 0;
}

.asset-model-geometry-fields legend {
  padding: 0 0 8px;
  font-weight: 600;
}

.asset-model-geometry-fields label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.asset-model-composition {
  display: grid;
  gap: 5px;
  align-content: start;
}

#recordForm.asset-model-form .asset-model-composition {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 7px;
}

.asset-model-composition.hidden {
  display: none;
}

.asset-model-composition h4,
.asset-model-composition p {
  margin: 0;
}

.asset-model-composition p {
  color: var(--muted);
  font-size: 0.85rem;
}

.asset-model-source-tree {
  display: grid;
  gap: 6px;
}

.asset-model-tree-system {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.asset-model-tree-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.asset-model-tree-heading label,
.asset-model-source-tree li label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.asset-model-tree-heading input,
.asset-model-source-tree li input {
  width: 17px;
  height: 17px;
  margin: 0;
  flex: 0 0 auto;
}

.asset-model-tree-heading > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.asset-model-source-tree ul {
  margin: 0 10px 10px 20px;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--line);
}

.asset-model-source-tree li {
  padding: 3px 0 3px 5px;
}

.asset-model-source-omitted {
  color: var(--muted);
  text-decoration: line-through;
}

.asset-model-reference-edit {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.asset-model-reference-edit summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

#referenceAdvancedFields {
  padding: 10px 0;
}

#recordForm.asset-model-form #referenceAdvancedFields,
#recordForm.asset-model-form #instructionHint,
#recordForm.asset-model-form #draftHint { display: none; }

#recordForm.asset-model-form > .form-head { padding: 6px 4px 10px 0; }
#recordForm.asset-model-form > .form-actions {
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface, #fff);
  z-index: 1;
}

.asset-model-advanced-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 22px 70px rgba(20, 36, 31, 0.32);
}
.asset-model-advanced-dialog::backdrop { background: rgba(20, 36, 31, .55); }
.asset-model-advanced-shell { display: grid; gap: 12px; }
.asset-model-advanced-shell header,
.asset-model-advanced-shell footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.asset-model-advanced-shell p { color: var(--muted); font-size: .9rem; }
.asset-model-advanced-shell textarea { box-sizing: border-box; width: 100%; min-height: min(45dvh, 340px); }
.asset-model-advanced-shell #assetModelAdvancedError { color: #a52820; }
.table-head-actions { display: flex; align-items: center; gap: 8px; }
.asset-model-operations-dialog { width: min(92vw, 1050px); max-height: 86dvh; border: 0; border-radius: 12px; padding: 0; box-shadow: 0 18px 60px #10251f55; }
.asset-model-operations-dialog::backdrop { background: rgba(20, 36, 31, .55); }
.asset-model-operations-shell { display: grid; gap: 14px; padding: 20px; }
.asset-model-operations-shell > header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.asset-model-operations-shell h3, .asset-model-operations-shell p { margin: 0; }
.asset-model-operations-body { overflow: auto; max-height: 62dvh; border: 1px solid var(--line); border-radius: 9px; }
.asset-model-operation-matrix { width: 100%; border-collapse: collapse; }
.asset-model-operation-matrix th, .asset-model-operation-matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.asset-model-operation-matrix thead th { position: sticky; top: 0; z-index: 1; background: #f5f8f6; }
.asset-model-operation-matrix tbody th { min-width: 15rem; font-weight: 400; text-transform: none; letter-spacing: normal; font-size: inherit; }
.asset-model-operation-matrix tbody th small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }
.asset-model-operation-toggle { text-align: center !important; min-width: 9rem; }
.asset-model-operation-toggle input { width: 18px; height: 18px; }
.asset-model-operation-toggle.pending-add { background: #dff3e5; }
.asset-model-operation-toggle.pending-remove { background: #fff0d5; }
.asset-model-operations-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.asset-model-operations-actions p { color: var(--muted); }

@media (max-width: 900px) {
  #recordForm.asset-model-form .asset-model-editor-body { grid-template-columns: 1fr; gap: 14px; overflow-y: auto; }
  #recordForm.asset-model-form .asset-model-primary-fields,
  #recordForm.asset-model-form .asset-model-composition { overflow: visible; }
}

.reference-detail-pane {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.reference-version-detail-head {
  align-items: start;
}

.reference-version-detail-head > div {
  min-width: 0;
}

.reference-version-detail-head h3 {
  overflow-wrap: anywhere;
}

.reference-version-detail-head .reference-detail-kind {
  margin: 0 0 4px;
}

.reference-version-detail-pane .form-actions button {
  width: 100%;
}

.reference-linked-item.active {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-strong);
}

@media (min-width: 1281px) {
  .split.dataset-version-open {
    grid-template-columns: minmax(340px, 1fr) minmax(280px, 360px) minmax(280px, 360px);
  }
}

@media (min-width: 981px) and (max-width: 1280px) {
  .split.dataset-version-open .reference-detail-pane:not(.reference-version-detail-pane) {
    display: none;
  }
}

.reference-detail-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.reference-detail-card h4 {
  margin: 0;
  font-size: 16px;
}

.reference-detail-card p {
  color: var(--muted);
}

.reference-detail-kind {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.reference-json-preview {
  margin: 0 12px 12px;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6f7f4;
  color: var(--muted);
  font-size: 12px;
}

.reference-related-section {
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
}

.reference-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.reference-chip {
  background: #edf4f0;
  border: 1px solid #cbdcd3;
  border-radius: 999px;
  color: #174b3a;
  display: inline-flex;
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
}

.asset-model-digest {
  overflow-wrap: anywhere;
}

.reference-related-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.dataset-material-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dataset-metadata-loading {
  color: var(--muted);
  font-size: 11px;
}

.dataset-band-encoding {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dataset-band-encoding li {
  display: grid;
  grid-template-columns: minmax(70px, 0.45fr) minmax(0, 1fr);
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfa;
  font-size: 12px;
}

.dataset-band-encoding span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.dataset-world-coverage {
  display: grid;
  gap: 5px;
  margin: 0;
}

.dataset-world-coverage svg {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #dcecf2;
}

.dataset-world-ocean {
  fill: #dcecf2;
}

.dataset-world-grid path {
  fill: none;
  stroke: #b7d0da;
  stroke-width: 0.6;
}

.dataset-world-land path {
  fill: #e9ece2;
  stroke: #aab4a2;
  stroke-width: 0.8;
}

.dataset-world-footprint {
  fill: rgba(196, 73, 45, 0.28);
  stroke: #b43f28;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.dataset-world-coverage figcaption {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.dataset-raster-preview {
  display: grid;
  gap: 6px;
  margin: 0;
}

.dataset-raster-preview button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2ef;
  cursor: zoom-in;
}

.dataset-raster-preview img {
  display: block;
  width: 100%;
  min-height: 120px;
  max-height: 240px;
  object-fit: contain;
}

.dataset-raster-preview button span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 4px;
  color: #fff;
  background: rgba(20, 36, 31, 0.78);
  font-size: 11px;
}

.dataset-raster-preview figcaption,
.dataset-raster-preview-state {
  color: var(--muted);
  font-size: 11px;
}

.dataset-raster-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  height: min(820px, calc(100vh - 32px));
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 22px 70px rgba(20, 36, 31, 0.32);
}

.dataset-raster-dialog::backdrop {
  background: rgba(20, 36, 31, 0.58);
}

.dataset-raster-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  background: var(--surface, #fff);
}

.dataset-raster-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.dataset-raster-dialog-head h2,
.dataset-raster-dialog-head p {
  margin: 0;
}

.dataset-raster-dialog-meta {
  margin-top: 4px !important;
  color: var(--muted);
  font-size: 12px;
}

.dataset-raster-dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  min-height: 0;
}

.dataset-raster-map-column {
  position: relative;
  min-height: 420px;
}

.dataset-raster-map {
  position: absolute;
  inset: 0;
}

.dataset-raster-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #9f3e2b, 0 1px 5px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 3;
}

.dataset-raster-crosshair i {
  position: absolute;
  top: 50%;
  left: 50%;
  background: #9f3e2b;
  transform: translate(-50%, -50%);
}

.dataset-raster-crosshair i:first-child { width: 44px; height: 1px; }
.dataset-raster-crosshair i:last-child { width: 1px; height: 44px; }

.dataset-raster-pointer {
  position: absolute;
  left: 12px;
  bottom: 28px;
  z-index: 3;
  max-width: calc(100% - 24px);
  padding: 7px 10px;
  border-radius: 5px;
  color: #fff;
  background: rgba(20, 36, 31, 0.86);
  font-size: 12px;
}

.dataset-raster-legend-column {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px;
  overflow: auto;
  border-left: 1px solid var(--line);
}

.dataset-raster-legend-column label {
  display: grid;
  gap: 5px;
  font-size: 12px;
}

.dataset-raster-legend img {
  display: block;
  max-width: 100%;
  max-height: 430px;
}

@media (max-width: 760px) {
  .dataset-raster-dialog-body { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 1fr) auto; }
  .dataset-raster-legend-column { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line); border-left: 0; }
}

.dataset-metadata-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.compact-list {
  padding: 0;
}

.reference-linked-item {
  background: #fbfcfa;
}

.reference-chain {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.reference-chain-step {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #f7faf7;
}

.reference-chain-step span {
  color: var(--muted);
  font-size: 12px;
}

.reference-chain-step strong {
  font-size: 14px;
}

.reference-chain-step small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.reference-json-details {
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.reference-json-details summary {
  padding: 9px 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.reference-json-details .reference-json-preview {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.reference-technical-details .detail-list {
  border-top: 1px solid var(--line);
}

.reference-technical-details .reference-json-preview {
  max-height: 280px;
}

.q7-section-title,
.q7-stage-head,
.q7-execution-head,
.q7-evidence summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.q7-section-title span,
.q7-stage-head span,
.q7-execution-head span,
.q7-execution-head small {
  color: var(--muted);
  font-size: 12px;
}

.q7-contract-section,
.q7-outcome-section {
  padding: 12px;
}

.q7-contract-pipeline,
.q7-execution-pipeline {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.q7-contract-stage,
.q7-execution-stage {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
}

.q7-contract-stage:not(:last-child)::after,
.q7-execution-stage:not(:last-child)::after {
  position: absolute;
  bottom: -9px;
  left: 24px;
  width: 2px;
  height: 9px;
  background: #8aa097;
  content: '';
}

.q7-execution-stage.succeeded {
  border-left: 4px solid #2f6b57;
  background: #f4faf6;
}

.q7-stage-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #24495c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.q7-stage-body {
  min-width: 0;
}

.q7-stage-body p {
  margin: 3px 0;
  overflow-wrap: anywhere;
}

.q7-stage-body small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.q7-outcome-grid,
.q7-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.q7-outcome-grid article,
.q7-result-value {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-top: 3px solid #9b6b1f;
  border-radius: 6px;
  background: #fffaf1;
}

.q7-outcome-grid small,
.q7-result-value span,
.q7-result-value small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.q7-result-value strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.q7-limits {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.geofunction-lab-display {
  min-width: 0;
}

.lab-views {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.lab-views button[aria-selected="true"] {
  background: var(--accent-strong);
  color: #fff;
}

.climate-recipe {
  min-width: 0;
}

.climate-recipe-intro {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.climate-recipe-intro p,
.climate-recipe-message,
.climate-recipe-card-meta {
  color: var(--muted);
  font-size: 13px;
}

.climate-recipe-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.climate-recipe-controls label {
  display: grid;
  gap: 5px;
  min-width: 140px;
  font-size: 12px;
}

.climate-recipe-controls select {
  min-width: 140px;
  max-width: 240px;
}

.climate-recipe-controls .climate-recipe-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-bottom: 9px;
  font-size: 13px;
}

.climate-recipe-switch input {
  width: auto;
}

.climate-recipe-controls .climate-recipe-switch {
  align-self: end;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eff5f1;
  cursor: pointer;
}

.climate-recipe-message {
  margin: 0 0 12px;
}

.climate-recipe-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.climate-recipe-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.climate-recipe-card h4 {
  margin: 0 0 4px;
}

.climate-recipe-card-meta {
  margin-bottom: 8px;
}

.climate-recipe-map-frame {
  position: relative;
  height: 320px;
  overflow: hidden;
  background: #e2e9e5;
}

.climate-recipe-map {
  position: absolute;
  inset: 0;
}

.climate-recipe-map-note {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  padding: 7px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  color: #493c27;
  font-size: 12px;
  pointer-events: none;
}

.climate-recipe-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
}

.climate-recipe-crosshair::before,
.climate-recipe-crosshair::after {
  position: absolute;
  content: '';
  background: #a92f19;
  box-shadow: 0 0 2px #fff;
}

.climate-recipe-crosshair::before {
  top: 8px;
  left: 0;
  width: 18px;
  height: 1px;
}

.climate-recipe-crosshair::after {
  top: 0;
  left: 8px;
  width: 1px;
  height: 18px;
}

.climate-recipe-value {
  min-height: 36px;
  padding-top: 9px;
  font-size: 13px;
}

.climate-recipe-legend {
  margin: 10px 0 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf8;
  font-size: 12px;
}

.climate-recipe-legend figcaption {
  margin-bottom: 7px;
  font-weight: 600;
}

.climate-recipe-legend-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 8px;
}

.climate-recipe-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.climate-recipe-legend-color {
  flex: 0 0 20px;
  height: 12px;
  border: 1px solid #9d9d9d;
}

.climate-recipe-legend-note {
  margin: 7px 0 0;
  color: var(--muted);
}

.climate-recipe-warning {
  margin: 8px 0 0;
  padding: 7px 9px;
  border-left: 3px solid #b57425;
  background: #fff8eb;
  color: #62400c;
  font-size: 12px;
}

.climate-recipe-activate {
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid #285b46;
  border-radius: 5px;
  background: #edf5ee;
  color: #17422e;
  cursor: pointer;
}

.climate-recipe-provenance {
  color: var(--muted);
  font-size: 12px;
}

.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.lab-map-section {
  min-height: 520px;
}

.lab-map {
  height: 466px;
  min-height: 320px;
  background: #dce6de;
}

.lab-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.lab-control-section {
  align-self: stretch;
}

.lab-controls {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.lab-control-group {
  min-width: 0;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.lab-control-group legend {
  padding: 0 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.lab-control-group label {
  min-width: 0;
  padding: 0;
}

.lab-control-group select,
.lab-control-group input {
  min-width: 0;
  width: 100%;
}

.lab-advanced-controls {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
}

.lab-advanced-controls summary,
.lab-trace-section > summary {
  padding: 10px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.lab-advanced-controls > div {
  display: grid;
  border-top: 1px solid var(--line);
}

.lab-results-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  scroll-margin-top: calc(var(--studio-desktop-header-height) + var(--studio-sticky-gap));
}

.lab-results-head:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lab-results-head > p {
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
}

.lab-state {
  color: var(--muted);
  font-size: 12px;
}

.lab-state.error {
  color: #a73725;
  font-weight: 700;
}

.lab-result-section {
  min-height: 140px;
}

.lab-result-section:not(.lab-trace-section) {
  align-content: start;
}

.lab-band-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.lab-band {
  display: grid;
  grid-template-columns: minmax(72px, 120px) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  min-height: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  text-align: left;
}

.lab-band.active {
  border-color: var(--accent);
  background: #edf6f1;
  box-shadow: inset 3px 0 0 var(--accent);
}

.lab-band strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lab-band span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.lab-trace-section .reference-json-preview {
  min-height: 150px;
  margin-top: 0;
}

.lab-trace-section:not([open]) {
  min-height: 0;
}

form {
  display: grid;
}

.compact-form {
  align-content: start;
}

.subobject-form {
  border-top: 1px solid var(--line);
}

.semantic-node-editor {
  border-top: 1px solid var(--line);
}

.semantic-relation-editor {
  border-top: 1px solid var(--line);
}

.semantic-node-fields,
.semantic-relation-fields {
  display: grid;
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.guided-fields {
  display: grid;
  gap: 0;
}

.guided-group {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}

.guided-group h4 {
  margin: 0;
  padding: 10px 12px 0;
  font-size: 13px;
}

.guided-field {
  min-width: 0;
}

.guided-hint {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.3;
}

label {
  display: grid;
  grid-template-columns: minmax(120px, 36%) 16px minmax(0, 1fr);
  column-gap: 6px;
  row-gap: 5px;
  align-items: center;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

label > .help {
  grid-column: 2;
  justify-self: start;
  margin-left: 0;
}

label > input,
label > select {
  grid-column: 3;
  min-width: 0;
}

label > textarea {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

label > .guided-hint {
  grid-column: 3;
}

label:has(> textarea) {
  grid-template-columns: minmax(120px, 36%) 16px minmax(0, 1fr);
  align-items: start;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 8px;
}

input[type="checkbox"] {
  width: auto;
  justify-self: start;
}

textarea {
  resize: vertical;
  min-height: 84px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.form-actions {
  padding: 12px;
  border-top: 1px solid var(--line);
}

#saveState {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  color: var(--muted);
  padding: 16px;
}

.empty.compact {
  padding: 0;
}

.modeling-layout {
  min-height: calc(100vh - 59px);
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.modeling-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.modeling-home {
  height: calc(100vh - 59px);
  min-height: 680px;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) minmax(260px, 1fr);
  background: var(--bg);
}

.modeling-home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.modeling-home-head p,
#subjectDashboardCount {
  color: var(--muted);
  font-size: 12px;
}

.subjects-map {
  min-height: 300px;
  border-bottom: 1px solid var(--line);
  background: #dfe8e2;
}

.subjects-map .maplibregl-map {
  font-family: Arial, Helvetica, sans-serif;
}

.subjects-map .maplibregl-ctrl-top-left {
  top: 12px;
  left: 12px;
}

.subjects-map .maplibregl-ctrl button {
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
}

.map-unavailable {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.subject-dashboard-list {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--panel);
}

.subject-dashboard-scroll {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
}

.subject-dashboard-item {
  width: 100%;
  min-height: 82px;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  background: #ffffff;
}

.subject-dashboard-item.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.subject-dashboard-item strong,
.subject-dashboard-item span,
.subject-dashboard-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.subject-dashboard-item span,
.subject-dashboard-item small {
  color: var(--muted);
  font-size: 12px;
}

.subject-dashboard-type {
  text-transform: uppercase;
  letter-spacing: 0;
}

.subject-dashboard-case {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(42, 107, 86, 0.22);
  background: #edf6f1;
  color: #174b3a !important;
  border-radius: 6px;
  padding: 3px 7px;
  font-weight: 700;
}

.modeling-detail-pane {
  height: calc(100vh - 59px);
  overflow: auto;
  padding: 18px 20px;
}

.detail-head {
  align-items: start;
}

.detail-head > div:first-child {
  display: grid;
  gap: 6px;
}

.modeling-back-button {
  justify-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 13px;
}

.modeling-back-button::before {
  content: "←";
  margin-right: 6px;
}

.modeling-save-state {
  min-height: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
}

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

.modeling-save-state button {
  padding: 6px 9px;
}

.context-pane {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
  overflow: auto;
}

.context-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.context-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.context-summary {
  display: grid;
  gap: 8px;
}

.context-summary-head {
  display: grid;
  gap: 8px;
}

.context-summary h4 {
  margin: 0;
  font-size: 16px;
}

.context-summary p,
.context-note p {
  color: var(--muted);
}

.subject-mini-map-wrap {
  justify-self: start;
  width: min(156px, 100%);
  display: grid;
  gap: 5px;
}

.subject-mini-map {
  width: 156px;
  max-width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef2ed;
}

.subject-mini-map .maplibregl-map {
  font-family: Arial, Helvetica, sans-serif;
}

.subject-mini-map .maplibregl-control-container {
  display: none;
}

.subject-mini-map-wrap span {
  color: var(--muted);
  font-size: 11px;
}

.context-open-button {
  width: 100%;
}

.context-summary .detail-item {
  padding: 7px 8px;
}

.context-filters,
.context-menu,
.context-note {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.context-filters label {
  padding: 0;
}

.subject-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
}

.subject-display-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: flex-end;
  margin: 12px 0 14px;
  padding: 8px 0 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow-x: auto;
  scrollbar-width: thin;
}

.subject-tab-group {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
}

.subject-tab-group + .subject-tab-group {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.subject-tab-group > div {
  display: flex;
  gap: 4px;
}

.subject-tab-group-label {
  padding-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subject-display-select-label {
  display: none;
}

.subject-tab {
  flex: 0 0 auto;
  min-width: 0;
  border-bottom-width: 2px;
  border-radius: 6px 6px 0 0;
  text-align: center;
  font-size: 13px;
  white-space: nowrap;
}

.subject-tab.active {
  background: #ffffff;
  border-color: var(--accent);
  border-bottom-color: var(--accent-strong);
  color: var(--accent-strong);
}

.context-note strong {
  font-size: 13px;
}

.subject-display {
  display: grid;
  gap: 14px;
}

.subject-display-panel {
  display: grid;
  gap: 14px;
}

.subject-overview-display {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: start;
}

.display-section {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

#subjectGeometrySection {
  grid-column: 1 / -1;
  order: -1;
}

.section-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modeling-detail {
  display: grid;
  align-content: start;
  gap: 0;
  box-shadow: var(--shadow);
}

.detail-section {
  min-width: 0;
}

.geometry-tools {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(260px, 1fr) minmax(140px, 180px);
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.geometry-tools label {
  min-width: 0;
  padding: 0;
}

.geometry-kind-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.geometry-head-actions,
.geometry-mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.geometry-mode-buttons {
  justify-content: start;
}

.geometry-mode-buttons button {
  flex: 1 1 92px;
}

.geometry-mode-buttons button.active {
  border-color: var(--accent);
  background: #edf6f1;
  color: var(--accent-strong);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.geometry-tools button {
  width: 100%;
  white-space: nowrap;
}

.geometry-snap-control {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.geometry-snap-control input {
  width: 14px;
  height: 14px;
}

.geometry-tool-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.geometry-validation,
.geometry-edit-status {
  grid-column: 1 / -1;
  min-height: 24px;
  padding: 6px 8px;
  border: 1px solid #dfe5dd;
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 12px;
}

.geometry-change-message {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.geometry-validation.valid {
  border-color: rgba(62, 100, 100, 0.35);
  background: #edf6f1;
  color: var(--accent-strong);
}

.geometry-validation.invalid {
  border-color: rgba(155, 47, 47, 0.28);
  background: #fff6f4;
  color: var(--danger);
}

.geometry-validation.pending {
  border-color: rgba(138, 83, 24, 0.3);
  background: #fff8ec;
  color: var(--warning);
}

.geometry-map {
  margin: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2ed;
  height: clamp(240px, 32vh, 340px);
  overflow: hidden;
}

.geometry-map .maplibregl-map {
  font-family: Arial, Helvetica, sans-serif;
  cursor: crosshair;
}

.overview-readonly .geometry-edit-control {
  display: none;
}

.geometry-editing .geometry-read-control {
  display: none;
}

.geometry-editing .geometry-map {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(62, 100, 100, 0.2);
}

.geometry-editing .geometry-map[data-geometry-mode="trace"] .maplibregl-map {
  cursor: crosshair;
}

.geometry-editing .geometry-map[data-geometry-mode="vertices"] .maplibregl-map {
  cursor: grab;
}

.geometry-editing .geometry-map[data-geometry-mode="move"] .maplibregl-map {
  cursor: move;
}

.overview-readonly .geometry-map {
  height: clamp(280px, 38vh, 430px);
}

.overview-readonly .geometry-map .maplibregl-map {
  cursor: default;
}

.geometry-map .maplibregl-ctrl button {
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
}

.geometry-json-field {
  display: none;
}

.geometry-scope {
  padding: 12px;
}

.geometry-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.geometry-scope .semantic-group {
  min-width: 0;
}

.geometry-scope-card.active {
  border-color: var(--warning);
  box-shadow: inset 3px 0 0 var(--warning);
}

.geometry-scope-pending {
  background: #fff8ec;
}

.indicator-run-panel {
  display: grid;
  gap: 0;
}

.indicator-current {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.indicator-current-card {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4faf6;
}

.indicator-current-card span,
.indicator-current-card small,
.indicator-section-head p {
  color: var(--muted);
  font-size: 12px;
}

.indicator-current-card strong {
  font-size: 16px;
}

.indicator-execution-detail {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.indicator-run-item {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
}

.indicator-run-item.current-selected {
  border-color: #24495c;
  box-shadow: inset 4px 0 0 #24495c;
}

.q7-execution {
  display: grid;
  gap: 12px;
}

.q7-execution-head {
  align-items: end;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.q7-execution-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.q7-execution-head strong {
  overflow-wrap: anywhere;
}

.q7-evidence-grid {
  display: grid;
  gap: 8px;
}

.q7-evidence {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.q7-evidence summary {
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.q7-evidence summary::-webkit-details-marker {
  display: none;
}

.q7-evidence summary span {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e7eef1;
  color: #24495c;
  font-size: 12px;
  text-align: center;
}

.q7-evidence-body {
  display: grid;
  border-top: 1px solid var(--line);
}

.q7-proof-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1.2fr);
  gap: 4px 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.q7-proof-row:last-child {
  border-bottom: 0;
}

.q7-proof-row span,
.q7-proof-row small {
  overflow-wrap: anywhere;
}

.q7-proof-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .q7-proof-row {
    grid-template-columns: 1fr;
  }

  .q7-proof-row small {
    grid-column: auto;
  }
}

.case-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 12px;
}

.case-summary-card,
.case-metric {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.case-summary-card span,
.case-metric span,
.case-summary-card p,
.case-metric small,
.case-plain-item small {
  color: var(--muted);
  font-size: 12px;
}

.case-summary-card strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.case-summary-card p {
  line-height: 1.35;
}

.case-chip-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-chip {
  padding: 4px 7px;
  border: 1px solid #cbd7cf;
  border-radius: 6px;
  background: #f2f6f3;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.case-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  padding: 12px;
}

.case-metric {
  border-left: 4px solid #8aa097;
}

.case-metric strong {
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.case-metric-risk {
  border-left-color: #a45843;
  background: #fff8f5;
}

.case-metric-opportunity {
  border-left-color: #2f6b57;
  background: #f4faf6;
}

.case-metric-heat {
  border-left-color: #9b6b1f;
  background: #fff9ef;
}

.case-plain-item {
  background: #fbfcfb;
}

.indicator-parameters {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.indicator-section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.indicator-section-head h4 {
  margin: 0;
  font-size: 14px;
}

.indicator-section-head span {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.indicator-warning {
  padding: 8px 10px;
  border: 1px solid #e3c79d;
  border-radius: 6px;
  background: #fff8ee;
  color: var(--warning);
  font-size: 12px;
}

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

.parameter-binding {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
}

.parameter-binding.warning {
  border-color: #e3c79d;
  background: #fffaf2;
}

.parameter-binding-main,
.parameter-binding-source {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.parameter-binding span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.parameter-binding strong {
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.parameter-binding small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.parameter-warning {
  color: var(--warning) !important;
}

.parameter-binding-actions {
  display: flex;
  justify-content: end;
}

.parameter-binding-actions button {
  white-space: nowrap;
}

.detail-item.current-selected {
  border-color: var(--accent);
  background: #edf6f1;
  box-shadow: inset 3px 0 0 var(--accent);
}

.detail-section + .detail-section {
  border-top: 1px solid var(--line);
}

.detail-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.detail-item {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
}

.detail-item:not(.wide):not(.long-value) {
  grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
  column-gap: 10px;
  align-items: baseline;
}

button.detail-item {
  width: 100%;
  min-height: 0;
  text-align: left;
  cursor: pointer;
}

button.detail-item:hover {
  border-color: var(--accent);
  background: #f4faf6;
}

.sub-detail {
  margin-left: 18px;
  width: calc(100% - 18px);
}

.detail-item span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.detail-item strong {
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.detail-item:not(.wide):not(.long-value) small {
  grid-column: 2;
}

.detail-item small {
  color: var(--muted);
  font-size: 12px;
}

.detail-item.wide {
  min-width: 0;
}

.semantic-summary {
  padding: 12px;
}

.semantic-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.semantic-bootstrap {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.semantic-bootstrap p {
  max-width: 680px;
  margin: 0;
}

.semantic-summary-tile {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 2px;
  border-color: var(--semantic-stroke, var(--line));
  background: var(--semantic-fill, #fbfcfa);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 var(--semantic-stroke, var(--line));
}

.semantic-summary-tile strong {
  font-size: 22px;
}

.semantic-summary-tile span {
  color: var(--muted);
}

.semantic-summary-tile:hover,
.semantic-summary-tile.active {
  border-color: var(--semantic-stroke, var(--accent));
  box-shadow: inset 0 -4px 0 var(--semantic-stroke, var(--accent));
}

.semantic-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
}

.semantic-graph-wrap {
  min-width: 0;
  padding: 12px;
  overflow-x: auto;
}

.overview-graph-wrap {
  padding-bottom: 4px;
}

.overview-graph-stage {
  margin: 0;
}

.overview-subhead {
  margin: 8px 12px 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.semantic-graph-stage {
  position: relative;
  width: min(100%, 1080px);
  max-width: 1080px;
  display: block;
}

.semantic-graph-stage.graphviz-stage {
  width: fit-content;
  max-width: 100%;
}

.semantic-graph {
  min-width: 0;
  width: 100%;
  height: auto;
  display: block;
}

.graphviz-graph {
  min-width: 0;
  width: auto;
  min-width: 240px;
  max-width: 100%;
}

.semantic-relation-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.semantic-relation-overlay-edge {
  cursor: pointer;
  pointer-events: auto;
}

.semantic-relation-overlay-edge path {
  fill: none;
  stroke: #8a5318;
  stroke-dasharray: 6 5;
  stroke-width: 1.8;
}

.semantic-relation-overlay-edge .semantic-relation-hit {
  stroke: #000000;
  stroke-opacity: 0.001;
  stroke-width: 14;
  pointer-events: stroke;
}

.semantic-relation-overlay-edge path:not(.semantic-relation-hit),
.semantic-relation-overlay-edge text {
  pointer-events: none;
}

.semantic-relation-overlay-edge text {
  fill: #8a5318;
  font-size: 10px;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.semantic-relation-overlay-edge.active path {
  stroke: var(--accent-strong);
  stroke-width: 2.8;
  stroke-dasharray: 0;
}

.semantic-relation-overlay marker path {
  fill: #8a5318;
}

.semantic-graph-edge path {
  fill: none;
  stroke: #678074;
  stroke-width: 1.8;
}

.semantic-graph-edge[data-semantic-kind],
.semantic-graph-edge-carrier {
  cursor: pointer;
}

.semantic-graph-edge .semantic-graph-edge-hit {
  stroke: #000000;
  stroke-opacity: 0.001;
  stroke-width: 14;
  pointer-events: stroke;
}

.semantic-graph:not(.graphviz-graph) .semantic-graph-edge path:not(.semantic-graph-edge-hit),
.semantic-graph:not(.graphviz-graph) .semantic-graph-edge text {
  pointer-events: none;
}

.semantic-graph:not(.graphviz-graph) .semantic-graph-edge text {
  fill: var(--muted);
  font-size: 10px;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.semantic-graph-edge-parent path {
  stroke-dasharray: 5 5;
  stroke: #9aa9a1;
}

.semantic-graph-edge-relation path {
  stroke: #8a5318;
  stroke-dasharray: 6 5;
}

.semantic-graph-edge-relation text {
  fill: #8a5318;
}

.semantic-graph-edge.active path {
  stroke: var(--accent-strong);
  stroke-width: 3;
}

.graphviz-graph .semantic-graph-edge,
.graphviz-graph .semantic-graph-node {
  cursor: pointer;
}

.graphviz-graph .semantic-graph-edge.active path {
  stroke: var(--accent-strong);
  stroke-width: 2.8;
}

.graphviz-graph .semantic-graph-node.active polygon,
.graphviz-graph .semantic-graph-node.active path {
  stroke: var(--accent-strong);
  stroke-width: 2.4;
}

.semantic-graph marker path {
  fill: #678074;
}

.semantic-graph:not(.graphviz-graph) .semantic-graph-node {
  cursor: pointer;
}

.semantic-graph:not(.graphviz-graph) .semantic-graph-node rect {
  fill: #fbfcfa;
  stroke: var(--line);
  stroke-width: 1.4;
}

.semantic-graph:not(.graphviz-graph) .semantic-graph-node text {
  fill: var(--text);
  font-size: 10px;
  font-weight: 600;
}

.semantic-graph:not(.graphviz-graph) .semantic-graph-node .semantic-graph-node-kind {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.semantic-graph:not(.graphviz-graph) .semantic-graph-node.active rect {
  fill: #edf6f1;
  stroke: var(--accent);
  stroke-width: 2.4;
}

.semantic-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
  padding-top: 8px;
}

.semantic-group {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.semantic-group h4 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.semantic-action.active {
  border-color: var(--accent);
  background: #edf6f1;
  box-shadow: inset 3px 0 0 var(--accent);
}

.semantic-relation-item strong {
  overflow-wrap: anywhere;
}

.semantic-context-selection {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.semantic-context-items {
  display: grid;
  gap: 8px;
}

.journal-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px;
}

.journal-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.journal-column h4 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.journal-item {
  align-content: start;
}

.journal-item strong {
  line-height: 1.25;
}

.guide-workspace {
  min-width: 0;
  padding: 28px 24px 56px;
}

.guide-page {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.guide-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #edf6f1 100%);
  box-shadow: var(--shadow);
}

.guide-hero h1,
.guide-discovery-head h1 {
  margin-top: 4px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.guide-hero p:not(.eyebrow),
.guide-discovery-head > p:not(.eyebrow) {
  max-width: 760px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 17px;
}

.guide-section {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.guide-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.guide-section-head p {
  margin-top: 4px;
  color: var(--muted);
}

.guide-workplane-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-workplane-cards article {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background: #fbfcfa;
}

.guide-workplane-cards article > span:first-child {
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
}

.guide-workplane-cards article p {
  color: var(--muted);
}

.guide-workplane-cards article a,
.guide-coming-soon {
  align-self: end;
  color: var(--accent-strong);
  font-weight: 700;
}

.guide-semantic-map {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px minmax(240px, 1fr);
  gap: 18px;
  align-items: center;
}

.guide-model-column {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f6;
}

.guide-model-column > strong {
  padding: 4px 6px 9px;
  color: var(--accent-strong);
  text-transform: uppercase;
}

.guide-model-column button {
  min-height: 42px;
  text-align: left;
}

.guide-model-column button:hover,
.discovery-chain article:hover {
  border-color: var(--accent);
  background: #edf6f1;
}

.guide-model-arrows {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.guide-model-arrows b {
  color: var(--accent);
  font-size: 38px;
}

.guide-path-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-path-cards button {
  display: grid;
  gap: 6px;
  min-height: 100px;
  padding: 16px;
  text-align: left;
}

.guide-path-cards span {
  color: var(--muted);
  font-size: 13px;
}

.guide-discovery-head {
  padding: 26px;
  border-bottom: 1px solid var(--line);
}

.guide-readonly-note {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #c6d8ce;
  border-radius: 7px;
  background: #edf6f1;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.discovery-chain {
  position: relative;
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-left: 46px;
}

.discovery-chain::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 21px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.discovery-chain article {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.discovery-chain article::before {
  content: "";
  position: absolute;
  top: 22px;
  left: -34px;
  width: 15px;
  height: 15px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
}

.discovery-chain article > span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.discovery-chain article p {
  color: var(--muted);
}

.guide-discovery-actions {
  position: sticky;
  bottom: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.guide-discovery-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.discovery-reference-item {
  border-left: 4px solid var(--accent);
  background: linear-gradient(100deg, #ffffff, #f1f8f4);
}

.semantic-help-backdrop {
  position: fixed;
  z-index: 350;
  inset: 0;
  background: rgba(22, 32, 28, 0.28);
}

.semantic-help-panel {
  position: fixed;
  z-index: 360;
  top: 0;
  right: 0;
  width: min(460px, 100vw);
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  border-left: 1px solid var(--line);
  background: #ffffff;
  box-shadow: -18px 0 44px rgba(30, 40, 36, 0.18);
}

.semantic-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.semantic-help-body {
  display: grid;
  align-content: start;
  gap: 0;
  overflow-y: auto;
}

.semantic-help-body section {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.semantic-help-body h3 {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.semantic-help-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.semantic-help-relations span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9f6;
  font-size: 12px;
}

.semantic-help-impact {
  border-left: 4px solid #b97828;
  background: #fff8ec;
}

.semantic-help-example {
  border-left: 4px solid var(--accent);
  background: #edf6f1;
}

.semantic-help-body > button {
  margin: 16px 18px;
}

body.semantic-help-open {
  overflow: hidden;
}

.reference-release-display {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.release-governance-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border: 1px solid #bfd0c7;
  border-radius: 8px;
  background: linear-gradient(135deg, #edf5f0, #ffffff);
}

.release-governance-head > div:first-child {
  max-width: 760px;
  display: grid;
  gap: 5px;
}

.release-governance-head p:not(.eyebrow) {
  color: var(--muted);
}

.active-release-card {
  flex: 0 0 min(260px, 34%);
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #b8cec2;
  border-radius: 7px;
  background: #ffffff;
}

.active-release-card span,
.active-release-card small {
  color: var(--muted);
  font-size: 11px;
}

.active-release-card strong {
  color: var(--accent-strong);
  font-size: 18px;
}

.release-governance-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 14px;
  align-items: start;
}

.release-governance-grid > .display-section {
  padding: 14px;
}

.release-publish-section,
.release-compare-section {
  grid-column: 1 / -1;
}

.domain-release-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.domain-release-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 10px;
  text-align: left;
}

.domain-release-item.active {
  border-color: var(--accent);
  background: #edf5f0;
  box-shadow: inset 3px 0 0 var(--accent);
}

.domain-release-item > span:first-child {
  min-width: 0;
  display: grid;
}

.domain-release-item > span:first-child strong {
  font-size: 16px;
}

.release-active-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dceee4;
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 700;
  vertical-align: 2px;
}

.domain-release-item small {
  color: var(--muted);
}

.domain-release-item > small {
  grid-column: 1 / -1;
}

.release-manifest-status {
  align-self: start;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}

.release-manifest-status.complete {
  background: #dceee4;
  color: var(--accent-strong);
}

.release-manifest-status.legacy {
  background: #f3e8d8;
  color: var(--warning);
}

.release-detail-section {
  display: grid;
  gap: 12px;
}

.release-detail-section .detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.release-notes,
.release-digest,
.release-warning {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px;
  border-radius: 6px;
  background: #f7f9f6;
}

.release-notes {
  display: grid;
  gap: 4px;
}

.release-digest {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.release-digest span {
  color: var(--muted);
  font-size: 11px;
}

.release-digest code {
  overflow-wrap: anywhere;
  font-size: 10px;
}

.release-warning {
  border-left: 4px solid var(--warning);
  background: #fff8ec;
  color: #633b13;
  font-size: 12px;
}

.release-form-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.45fr) minmax(220px, 0.75fr) minmax(280px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.release-form-grid label,
.release-compare-controls label {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: stretch;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.release-form-grid label > input,
.release-form-grid label > select,
.release-form-grid label > textarea,
.release-compare-controls label > select {
  grid-column: 1;
  grid-row: auto;
}

.release-form-grid input,
.release-form-grid select,
.release-form-grid textarea,
.release-compare-controls select {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
}

.release-notes-field textarea {
  resize: vertical;
}

.release-form-grid > button {
  min-height: 40px;
}

.release-action-state {
  min-height: 20px;
  margin-top: 8px;
  color: var(--accent-strong);
  font-size: 12px;
}

.release-action-state.error {
  color: var(--danger);
}

.release-compare-controls {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.release-compare-controls > span {
  align-self: center;
  color: var(--muted);
  font-size: 20px;
}

.release-diff-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.release-diff-summary > span {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9f6;
  color: var(--muted);
  font-size: 11px;
}

.release-diff-summary strong {
  color: var(--text);
  font-size: 15px;
}

.release-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.release-results-grid > section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.release-result-list {
  display: grid;
  gap: 7px;
}

.release-result-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbf9;
}

.release-result-list article > strong,
.release-result-list article > small,
.release-result-list article > p {
  grid-column: 2;
}

.release-result-list article > small,
.release-result-list article > p {
  color: var(--muted);
  font-size: 11px;
}

.release-result-list article > p {
  overflow-wrap: anywhere;
}

.release-result-list code {
  display: inline-block;
  margin: 2px 2px 0 0;
  padding: 2px 4px;
  border-radius: 3px;
  background: #edf1ee;
  font-size: 10px;
}

.release-change-kind,
.release-impact-class {
  align-self: start;
  padding: 3px 5px;
  border-radius: 4px;
  background: #e7ece8;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.release-change-kind.added,
.release-impact-class.compatible_no_action {
  background: #dceee4;
  color: var(--accent-strong);
}

.release-change-kind.modified,
.release-impact-class.recalculation_required,
.release-impact-class.migration_proposed {
  background: #f3e8d8;
  color: var(--warning);
}

.release-change-kind.removed,
.release-impact-class.incompatible,
.release-impact-class.human_intervention {
  background: #f5dede;
  color: var(--danger);
}

@media (max-width: 1100px) and (min-width: 701px) {
  :root {
    --studio-desktop-header-height: 99px;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(280px, 1fr) auto;
  }

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

  .tour-controls {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 980px) {
  .climate-recipe-cards {
    grid-template-columns: 1fr;
  }

  .workspace,
  .split,
  .lab-layout,
  .modeling-layout {
    grid-template-columns: 1fr;
  }

  .split.dataset-version-open .reference-detail-pane:not(.reference-version-detail-pane) {
    display: none;
  }

  .reference-pane.domain-open {
    grid-template-areas:
      "navigation"
      "intro"
      "content";
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .reference-pane.domain-open .reference-collection-tabs {
    position: static;
  }

  .lineage-layout {
    grid-template-columns: 1fr;
  }

  .lineage-detail {
    position: static;
    max-height: none;
  }

  .release-governance-grid,
  .release-results-grid {
    grid-template-columns: 1fr;
  }

  .release-publish-section,
  .release-compare-section {
    grid-column: auto;
  }

  .release-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .release-notes-field {
    grid-column: 1 / -1;
  }

  .lab-results-head {
    align-items: start;
    flex-direction: column;
  }

  .reference-home-item {
    grid-template-columns: minmax(200px, 0.9fr) minmax(0, 1.5fr);
  }

  .reference-home-open {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .domain-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .geometry-tools {
    grid-template-columns: 1fr 1fr;
  }

  .geometry-mode-buttons {
    grid-column: 1 / -1;
  }

  .geometry-tool-actions {
    grid-template-columns: 1fr 1fr;
  }

  .subject-overview-display {
    grid-template-columns: 1fr;
  }

  .geometry-scope-grid {
    grid-template-columns: 1fr;
  }

  .parameter-binding {
    grid-template-columns: 1fr;
  }

  .parameter-binding-actions {
    justify-content: start;
  }

  .modeling-home,
  .modeling-detail-pane {
    height: auto;
    min-height: 0;
  }

  .subjects-map {
    height: 46vh;
  }

  .modeling-main {
    grid-column: 1;
    grid-row: 2;
  }

  .context-pane {
    grid-column: 1;
    grid-row: 1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
  }

  .workplanes {
    grid-column: 1 / -1;
    grid-row: 3;
    min-width: 0;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tour-controls {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    justify-content: flex-end;
    margin-left: 0;
  }

  .context-switcher {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
  }

  .tour-menu {
    position: fixed;
    top: 54px;
    right: 14px;
  }

  .workplanes a,
  .workplanes span {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .modeling-home-head,
  .detail-head,
  .pane-head,
  .reference-head {
    flex-wrap: wrap;
  }

  .reference-pane {
    padding: 14px 12px;
  }

  .reference-home {
    padding-top: 8px;
  }

  .guide-workspace {
    padding: 14px 12px 40px;
  }

  .guide-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .guide-hero h1,
  .guide-discovery-head h1 {
    font-size: 29px;
  }

  .guide-section {
    padding: 16px;
  }

  .guide-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-workplane-cards,
  .guide-path-cards,
  .guide-semantic-map {
    grid-template-columns: 1fr;
  }

  .guide-workplane-cards article {
    min-height: 0;
  }

  .guide-model-arrows {
    padding: 4px 0;
  }

  .guide-model-arrows b {
    transform: rotate(90deg);
  }

  .guide-discovery-head {
    padding: 18px 4px;
  }

  .discovery-chain {
    padding-left: 34px;
  }

  .discovery-chain::before {
    left: 13px;
  }

  .discovery-chain article::before {
    left: -29px;
  }

  .guide-discovery-actions {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .guide-discovery-actions a {
    justify-content: center;
  }

  .reference-home-head {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .reference-home-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .reference-home-view-switcher {
    flex: 1 1 auto;
  }

  .reference-home-view-switcher button {
    flex: 1 1 50%;
  }

  .reference-home-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .reference-home-counts {
    gap: 5px;
  }

  .reference-home-open {
    grid-column: auto;
    justify-self: start;
  }

  .lineage-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .lineage-legend {
    justify-content: flex-start;
  }

  .reference-lineage-graph {
    display: none;
  }

  .reference-lineage-mobile {
    display: grid;
    gap: 12px;
    padding: 10px;
  }

  .reference-lineage-mobile section {
    display: grid;
    gap: 7px;
  }

  .reference-lineage-mobile section > header {
    display: grid;
    gap: 2px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }

  .reference-lineage-mobile header small {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }

  .reference-lineage-mobile section > div {
    display: grid;
    gap: 6px;
  }

  .reference-lineage-mobile button {
    display: grid;
    gap: 4px;
    padding: 9px 10px;
    background: #ffffff;
    text-align: left;
  }

  .reference-lineage-mobile button.selected {
    border-color: var(--accent);
    background: #edf5f0;
    box-shadow: inset 3px 0 0 var(--accent);
  }

  .reference-lineage-mobile button span {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .reference-lineage-mobile button em {
    padding: 2px 5px;
    border-radius: 999px;
    background: #dceee4;
    color: var(--accent-strong);
    font-size: 9px;
    font-style: normal;
  }

  .reference-lineage-mobile button small {
    color: var(--muted);
  }

  .lineage-comparison-selection {
    grid-template-columns: 1fr;
  }

  .lineage-comparison-selection > b {
    display: none;
  }

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

  .reference-collection-tabs {
    display: none;
  }

  .reference-pane.domain-open .reference-collection-mobile {
    position: sticky;
    top: var(--studio-live-header-height, 126px);
    z-index: 4;
    grid-area: navigation;
    display: grid;
    gap: 4px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--bg);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .reference-collection-mobile select {
    width: 100%;
  }

  .release-governance-head {
    align-items: stretch;
    flex-direction: column;
  }

  .active-release-card {
    flex-basis: auto;
  }

  .release-form-grid,
  .release-compare-controls {
    grid-template-columns: 1fr;
  }

  .release-notes-field {
    grid-column: auto;
  }

  .release-compare-controls > span {
    display: none;
  }

  .release-detail-section .detail-list {
    grid-template-columns: 1fr;
  }

  .reference-relation-note {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

  .reference-list-toolbar:has(#referenceSubjectTypeFilterLabel:not(.hidden)),
  .reference-list-toolbar:has(#referenceDatasetVersionFilterLabel:not(.hidden)),
  .reference-list-toolbar:has(#referenceHazardFilterLabel:not(.hidden)) {
    grid-template-columns: 1fr;
  }

  .reference-pagination {
    justify-content: space-between;
    gap: 6px;
  }

  .reference-pagination span {
    min-width: 0;
  }

  .table-wrap table {
    table-layout: fixed;
  }

  .table-wrap th:nth-child(1),
  .table-wrap td:nth-child(1) {
    width: 38%;
  }

  .table-wrap th:nth-child(2),
  .table-wrap td:nth-child(2) {
    width: 44%;
  }

  .table-wrap th:nth-child(3),
  .table-wrap td:nth-child(3) {
    width: 18%;
  }

  .table-wrap th:nth-child(4),
  .table-wrap td:nth-child(4) {
    display: none;
  }

  .table-wrap th,
  .table-wrap td {
    padding-left: 7px;
    padding-right: 7px;
    overflow-wrap: anywhere;
  }

  .reference-identifier-cell {
    padding-right: 7px;
  }

  .reference-identifier-cell > span,
  .reference-identifier-cell > small {
    max-width: 100%;
  }

  .copy-reference-id {
    position: static;
    margin-top: 5px;
  }

  .subject-display-tabs {
    display: none;
  }

  .subject-display-select-label {
    position: sticky;
    top: var(--studio-live-header-height, 126px);
    z-index: 3;
    display: grid;
    gap: 4px;
    margin: 12px 0 14px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--bg);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .subject-display-select-label select {
    width: 100%;
  }

  .reference-pane.domain-open .summary {
    width: 100%;
  }

  #newSubjectButton {
    width: 100%;
  }
}
.studio-reauth[hidden]{display:none!important}
.studio-reauth{position:fixed;inset:0;z-index:1600;display:grid;place-items:center;padding:1rem;background:#102d2be0;font:400 1rem/1.5 system-ui,sans-serif}
.studio-reauth-card{width:min(31rem,100%);padding:1.5rem;border-radius:.8rem;background:#fff;color:#183b39;box-shadow:0 1rem 3rem #0005}
.studio-reauth-card h2{margin:0 0 .5rem;font-size:1.35rem}
.studio-reauth-actions{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:1rem}
.studio-reauth-actions a,.studio-reauth-actions button{display:inline-flex;align-items:center;min-height:2.5rem;padding:.45rem .8rem;border:1px solid #216359;border-radius:.4rem;background:#216359;color:#fff;font:inherit;text-decoration:none;cursor:pointer}
.studio-reauth-actions button{background:#fff;color:#216359}
.studio-reauth-card :focus-visible{outline:3px solid #d78234;outline-offset:3px}

/* Une vue de référentiel remplit l’espace sous le shell. Les contenus longs
   défilent dans leur bloc ; les ancêtres ne créent pas un second scroll. */
body.reference-viewport { height:100dvh; overflow:hidden; display:flex; flex-direction:column }
body.reference-viewport > [data-climae-shell] { flex:0 0 auto }
body.reference-viewport .app-shell { flex:1; min-height:0; overflow:hidden; display:flex; flex-direction:column }
body.reference-viewport .app-shell > .topbar,
body.reference-viewport .app-shell > .app-status { flex:none }
body.reference-viewport .app-shell > .workspace { flex:1; min-height:0; overflow:hidden }
body.reference-viewport #referenceWorkspace { min-height:0; min-width:0; padding:0; overflow:hidden; align-items:stretch }
body.reference-viewport #referenceCollectionIntro { margin:14px 20px 0 0 }
body.reference-viewport #referenceWorkspace > :is(#referenceBrowseDisplay, #referenceEditDisplay, #referenceLabDisplay, #referenceReleaseDisplay, #referenceDatasetReleaseOverviewDisplay) { margin:0 20px 18px 0 }
body.reference-viewport #collectionTabs { position:static; min-height:0; max-height:100%; overflow-y:auto; overscroll-behavior:contain; align-self:stretch }
body.reference-viewport #referenceWorkspace > :is(#referenceEditDisplay, #referenceLabDisplay, #referenceReleaseDisplay, #referenceDatasetReleaseOverviewDisplay) {
  grid-area:content; min-height:0; min-width:0; overflow:auto; overscroll-behavior:contain;
}
body.reference-viewport .reference-head { min-width:0; gap:12px }
body.reference-viewport .reference-head > div:first-child { min-width:0 }
body.reference-viewport .summary { display:flex; min-width:0; max-width:55%; overflow-x:auto; gap:5px; align-self:center }
body.reference-viewport .summary-box { flex:none; display:flex; gap:5px; align-items:baseline; padding:4px 7px; white-space:nowrap }
body.reference-viewport .summary-box strong { font-size:14px }
body.reference-viewport .summary-box span { font-size:11px }
body.reference-viewport #referenceCollectionIntro { display:block; padding:8px 12px; max-height:25dvh; overflow:auto; font-size:13px }
body.reference-viewport #referenceCollectionIntro > summary { cursor:pointer; color:var(--accent-strong); font-weight:600 }
body.reference-viewport #referenceCollectionIntro > p { margin-top:10px; font-size:14px }
body.reference-viewport #referenceCollectionIntro .reference-relation-note { margin-top:10px }
body.reference-viewport #referenceBrowseDisplay { min-height:0; min-width:0; overflow:hidden; align-items:stretch }
body.reference-viewport #referenceBrowseDisplay > :is(.table-region, .reference-detail-pane) { min-height:0; align-self:stretch; overflow:hidden }
body.reference-viewport #referenceBrowseDisplay > .table-region { grid-template-rows:auto auto minmax(0,1fr) auto }
body.reference-viewport :is(#referenceTableWrap, #nodeModelTree) { min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable }
body.reference-viewport #referenceBrowseDisplay .reference-detail-pane {
  position:static; align-self:stretch; height:auto; max-height:none; grid-template-rows:auto minmax(0,1fr) auto;
}
body.reference-viewport :is(#referenceDetailBody, #referenceVersionDetailBody) { min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable }
@media(max-width:980px) {
  body.reference-viewport #referenceWorkspace { grid-template-rows:auto auto minmax(0,1fr); gap:8px }
  body.reference-viewport .summary { max-width:100% }
  /* Sur petit écran, liste et fiche se suivent dans une seule zone de lecture. */
  body.reference-viewport #referenceBrowseDisplay { display:block; overflow:auto; overscroll-behavior:contain }
  body.reference-viewport #referenceBrowseDisplay > :is(.table-region, .reference-detail-pane) { overflow:visible; margin-bottom:12px }
  body.reference-viewport #referenceBrowseDisplay .reference-detail-pane { height:auto; overflow:visible }
  body.reference-viewport #referenceBrowseDisplay :is(#referenceTableWrap, #nodeModelTree, #referenceDetailBody, #referenceVersionDetailBody) { overflow:visible }
}

/* Vérification conserve sa séparation liste/carte redimensionnable. */
body.verification-mode { height:100dvh; overflow:hidden; display:flex; flex-direction:column }
body.verification-mode > [data-climae-shell] { flex:0 0 auto }
body.verification-mode .app-shell { flex:1; min-height:0; overflow:hidden; display:flex; flex-direction:column }
body.verification-mode .app-shell > .topbar, body.verification-mode .app-shell > .app-status { flex:none }
body.verification-mode .app-shell > .workspace { flex:1; min-height:0; overflow:hidden }
body.verification-mode #referenceWorkspace {
  min-height:0; overflow:hidden; padding:0;
  grid-template-areas:"navigation content"; grid-template-rows:minmax(0,1fr); align-items:stretch;
}
body.verification-mode #collectionTabs { position:static; top:auto; min-height:0; max-height:100%; overflow-y:auto; align-self:stretch }
body.verification-mode #referenceVerificationDisplay { min-height:0; height:auto; margin:10px 14px 10px 0; overflow:hidden }
@media(max-width:980px) {
  body.verification-mode #referenceWorkspace { grid-template-areas:"navigation" "content"; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); gap:6px }
  body.verification-mode #collectionTabs { display:none }
  body.verification-mode #referenceCollectionMobileLabel { grid-area:navigation; margin:0 }
}


/* Barre de contexte sombre ; navigation claire et sélection explicite. */
.app-shell > .topbar { background:var(--frame-bg); color:#eff6f6; border-bottom-color:#709292 }
.topbar .instance, .topbar .workplanes a, .topbar .workplanes span { color:#d5e4e4 }
.topbar .workplanes .active { color:#fff; background:#294d4d }
.topbar .context-switcher { background:#355e5e; border-color:#709292 }
.topbar .context-switcher > label, .topbar .context-release-status span, .topbar .context-release-status small { color:#edf5f5 }
.topbar .context-switcher select, .topbar .context-switcher > label > strong, .topbar .context-release-status strong { color:#eff6f6 }
.topbar .context-switcher select option { color:var(--text); background:#fff }
.topbar .context-release-status { border-left-color:#819e9e }
.topbar .context-index-button, .topbar #startTourButton { background:#355e5e; border-color:#9eb8b8; color:#eff6f6 }
.topbar .help { background:transparent; border-color:#a4bcbc; color:#eff6f6 }
.topbar .tour-menu { color:var(--text) }
@media(max-width:980px) {
  body.reference-viewport #referenceWorkspace { padding:10px 12px }
  body.reference-viewport #referenceHead, body.reference-viewport #referenceCollectionIntro,
  body.reference-viewport #referenceWorkspace > :is(#referenceBrowseDisplay, #referenceEditDisplay, #referenceLabDisplay, #referenceReleaseDisplay, #referenceDatasetReleaseOverviewDisplay, #referenceVerificationDisplay) { margin:0 }
}

/* Le nom courant est porté par le fil d’Ariane du shell, une seule fois. */
#referenceShellContext { display:inline-flex; align-items:center; gap:.55rem; min-width:0; max-width:100%; }
#referenceShellName { font-weight:650; overflow-wrap:anywhere; }
.app-shell > .topbar { display:flex; flex-wrap:wrap; min-height:59px; }
.topbar .context-switcher { display:block; min-width:0; padding:4px 10px; }
.topbar .context-release-status { display:flex; flex-wrap:wrap; align-items:baseline; gap:5px 9px; border:0; padding:0; }
.topbar .context-release-status small { font-size:11px; }
.topbar .instance:empty { display:none; }
.topbar .tour-controls { margin-left:auto; }
@media(max-width:700px) {
  .app-shell > .topbar { gap:6px 12px; padding:6px 12px; }
  .topbar .workplanes { width:auto; flex:1; padding-bottom:0; }
}

/* Aide, contexte et mode rejoignent le shell ; pas de second bandeau. */
.climae-header .tour-controls{margin-left:0;position:relative}
.climae-header #startTourButton{width:40px;height:40px;min-height:40px;padding:0;border:1px solid #88aaa4;border-radius:8px;font-size:20px;font-weight:700}
.climae-header .tour-menu{color:var(--text);font-size:14px;line-height:1.4}
.climae-header .tour-menu a,.climae-header .tour-menu button{display:block;padding:8px 10px;text-align:left;text-decoration:none;color:var(--text);background:#fff;border:1px solid var(--line);border-radius:5px;font:inherit}
.climae-header .tour-menu a:hover,.climae-header .tour-menu button:hover{background:#e5efec}
.climae-header #contextReleaseStatus{display:inline-flex;min-width:0;padding:2px 7px;border-left:1px solid #88aaa4;gap:0}
.climae-header #instanceLabel{color:#e1eeeb}

.climae-header #contextReleaseStatus,.climae-header #contextReleaseStatus strong{color:#e1eeeb;opacity:1}

/* Famille SVG technique retenue pour tous les onglets du Référentiel. */
.reference-collection-tabs .reference-collection-tab { grid-template-columns:48px minmax(0,1fr) 28px auto; }
.reference-tab-icon { width:48px; }

/* Deux entrées d’aide, avec la visite de la page en premier. */
.climae-header .tour-menu{width:min(350px,calc(100vw - 28px));gap:6px;padding:8px}
.climae-header .tour-menu a,.climae-header .tour-menu button{width:100%;padding:11px 12px;white-space:normal;border:0;background:transparent}
.climae-header .tour-menu .help-entry-primary{background:#edf4f3}
.climae-header .tour-menu .help-entry-title{display:block;font-size:14px;font-weight:650;line-height:1.4;color:var(--text)}
.climae-header .tour-menu .help-entry-description{display:block;margin-top:3px;font-size:12.5px;font-weight:400;line-height:1.4;color:var(--muted)}

.reference-icon-technical { display:block; flex:none; width:40px; height:40px; object-fit:contain; }
.reference-tab-icon { display:flex; align-items:center; justify-content:center; }

/* Même repère que l’onglet, sur la hauteur du titre et de son sous-titre. */
.reference-view-title { display:flex; align-items:center; gap:10px; min-width:0; }
.reference-view-icon { display:block; flex:none; width:40px; height:40px; object-fit:contain; }
.reference-view-title-copy { min-width:0; }
