:root {
  --ink: #101418;
  --muted: #65717e;
  --line: #d9e0e7;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #f8fafc;
  --accent: #0f766e;
  --accent-2: #b91c1c;
  --gold: #b7791f;
  --blue: #1d4ed8;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
  --left-rail-width: 370px;
  --right-rail-width: 390px;
  --asset-marker-scale: 1;
  --workspace-selected-bg: #eef2f7;
  --workspace-selected-border: #c8d2dd;
  --workspace-selected-rail: #74908d;
  --workspace-selected-icon: #1f2937;
  --map-control-bg: rgba(248, 250, 252, 0.82);
  --map-control-border: rgba(203, 213, 225, 0.84);
  --map-control-shadow: 0 12px 26px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e7ecef;
  letter-spacing: 0;
}

button, input, select, textarea {
  font: inherit;
}

button, .icon-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 34px;
  border-radius: 6px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
}

button:hover, .icon-link:hover { border-color: #aab7c4; }

button.active, .primary-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

button.danger { color: #fff; background: var(--accent-2); border-color: var(--accent-2); }

select, input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 8px 9px;
}

textarea { min-height: 82px; resize: vertical; }
input.saving,
select.saving,
textarea.saving {
  opacity: 0.68;
}

label {
  display: grid;
  gap: 6px;
  color: #34404b;
  font-size: 12px;
  font-weight: 650;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns:
    minmax(240px, var(--left-rail-width))
    6px
    minmax(280px, 1fr)
    6px
    minmax(280px, var(--right-rail-width));
  grid-template-rows: 56px 1fr;
  overflow: hidden;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 2000;
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.identity strong, .identity span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity span { color: var(--muted); font-size: 12px; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions select { width: 190px; }
.component-selector {
  position: relative;
}

.component-selector-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.component-selector-button {
  font: inherit;
  font-weight: 400;
  line-height: normal;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 34px;
  border-radius: 6px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.component-selector-button:hover,
.component-selector-toggle:checked + .component-selector-button {
  border-color: #aab7c4;
}

.component-selector-button:focus-visible,
.component-selector-toggle:focus-visible + .component-selector-button {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.component-selector-button svg {
  width: 24px;
  height: 24px;
}

.component-selector-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 5000;
  display: none;
  gap: 2px;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}

.component-selector-toggle:checked ~ .component-selector-menu {
  display: grid;
}

.component-selector-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #1f2937;
  font-size: 13px;
  cursor: pointer;
}

.component-selector-row:hover {
  background: #eef6f4;
}

.component-selector-row input {
  width: auto;
}

body.surface-focus-mode .segmented {
  opacity: 0.45;
}

body.surface-focus-mode .map-stage {
  background: #f8fafc;
}

body.surface-focus-mode #map {
  background: #f8fafc;
}

body.surface-focus-mode .leaflet-tile-pane {
  display: none;
}

.asset-search {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 34px 34px;
  gap: 4px;
  align-items: center;
}

.asset-search input {
  min-height: 34px;
  padding: 0 9px;
}

.asset-search input.search-miss {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.14);
}

input.search-miss {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.14);
}

.dev-clear {
  font-weight: 850;
  letter-spacing: 0;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  border: 0;
  border-radius: 0;
  min-height: 32px;
}

.role-pill {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #a7f3d0;
  color: #065f46;
  background: #ecfdf5;
  border-radius: 999px;
  padding: 6px 10px;
}

.left-rail, .right-rail {
  grid-row: 2;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
  background: #edf2f6;
  border-right: 1px solid var(--line);
}

.left-rail {
  grid-column: 1;
}

.left-rail::-webkit-scrollbar,
.right-rail::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.right-rail {
  grid-column: 5;
  border-right: 0;
  border-left: 1px solid var(--line);
  overflow: hidden;
}

.map-stage {
  grid-column: 3;
  grid-row: 2;
}

.rail-resizer {
  grid-row: 2;
  width: 6px;
  min-width: 6px;
  background: #dbe3eb;
  cursor: col-resize;
  position: relative;
  z-index: 8;
}

.rail-resizer::after {
  content: "";
  position: absolute;
  inset: 0 -5px;
}

.rail-resizer:hover,
.rail-resizer.dragging {
  background: #94a3b8;
}

.left-resizer {
  grid-column: 2;
}

.right-resizer {
  grid-column: 4;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  flex: 0 0 auto;
  min-height: 0;
}

#panelWorkspace.panel.compact {
  flex: 1 1 420px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none;
}

#panelInspector {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#panelTabs {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#panelAudit {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.right-rail > .panel:not(.collapsed) {
  flex: 1 1 0;
  min-height: 96px;
  display: flex;
  flex-direction: column;
}

.right-rail > .panel:not(.collapsed):only-child {
  min-height: 0;
}

#panelInspector .inspector-body:not(.hidden),
#panelTabs .tab-body:not(.hidden),
#panelAudit .audit-tab-body:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.panel-title {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.panel-title[draggable="true"] {
  cursor: move;
}

.panel-title h2 {
  cursor: pointer;
}

.panel.dragging {
  opacity: 0.72;
}

.panel.component-hidden {
  display: none !important;
}
.panel.collapsed {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
}

.panel.collapsed > :not(.panel-title) {
  display: none !important;
}

.panel.collapsed .panel-title {
  border-bottom: 0;
}

.panel-resize-handle {
  flex: 0 0 7px;
  min-height: 7px;
  cursor: row-resize;
  border-top: 1px solid rgba(203, 213, 225, 0.65);
  background: transparent;
}

.panel-resize-handle:hover,
.panel-resize-handle.dragging {
  background: #dbeafe;
}

.left-rail.dock-target,
.right-rail.dock-target {
  background: #dbeafe;
}

.panel-title h2, .dialog-card h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-actions button {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

.panel-actions button:not([data-close-panel]) {
  width: auto;
  min-width: 32px;
  padding: 0 9px;
}

.panel-actions button[data-close-panel] {
  width: 30px;
  min-width: 30px;
  padding: 0;
}


.panel-actions svg {
  width: 15px;
  height: 15px;
}

.site-tree, .layers-list, .tab-body, .inspector-body {
  padding: 10px;
}

#panelTabs .tab-body {
  padding: 16px;
}

#panelAudit .audit-tab-body {
  padding: 16px;
}

.site-tree {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 8px;
  scrollbar-width: none;
}

.site-tree:hover,
.site-tree:focus-within {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.site-tree::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.site-tree:hover::-webkit-scrollbar,
.site-tree:focus-within::-webkit-scrollbar {
  width: 8px;
}

.site-tree::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.workspace-tree {
  display: grid;
  gap: 6px;
}

.tree-project,
.tree-site-row,
.tree-layer,
.tree-add-map {
  width: 100%;
  min-width: 0;
  justify-content: stretch;
  text-align: left;
  color: var(--ink);
}

.tree-project,
.tree-site-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  min-height: 34px;
  background: transparent;
  border-color: transparent;
}

.tree-project.active,
.tree-site-row.active,
.tree-layer-row.active {
  color: var(--ink);
  background: var(--workspace-selected-bg);
  border-color: var(--workspace-selected-border);
  box-shadow: inset 3px 0 0 var(--workspace-selected-rail);
}

.tree-project.active svg,
.tree-site-row.active svg,
.tree-layer.active svg {
  color: var(--workspace-selected-icon);
}

.tree-project span,
.tree-site-row span,
.tree-layer span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.tree-project strong,
.tree-project small,
.tree-site-row strong,
.tree-site-row small,
.tree-layer strong,
.tree-layer small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-project strong,
.tree-site-row strong {
  font-size: 12.5px;
  line-height: 1.2;
  white-space: normal;
}

.tree-project small,
.tree-site-row small,
.tree-layer small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.tree-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.tree-site-list {
  display: grid;
  gap: 2px;
}

.tree-site-block {
  display: grid;
  gap: 2px;
  border-radius: 8px;
  position: relative;
}

.tree-site-block.active {
  padding-left: 5px;
  border-left: 2px solid var(--workspace-selected-rail);
}

.tree-surface-list {
  display: grid;
  gap: 1px;
  margin-left: 7px;
}

.tree-layers {
  display: grid;
  gap: 1px;
  margin: 0 0 4px 12px;
}

.tree-group-static {
  cursor: default;
}

.tree-layer-row {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 5px;
  min-width: 0;
  position: relative;
}

.tree-site-row[draggable="true"],
.tree-layer-row[draggable="true"] {
  cursor: grab;
}

.tree-site-block.dragging,
.tree-layer-row.dragging {
  opacity: 0.56;
}

.tree-site-block.drop-before::before,
.tree-site-block.drop-after::after,
.tree-layer-row.drop-before::before,
.tree-layer-row.drop-after::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  border-radius: 999px;
  background: #0f766e;
  box-shadow: 0 0 0 2px rgba(240, 253, 250, 0.9);
  z-index: 4;
}

.tree-site-block.drop-before::before,
.tree-layer-row.drop-before::before {
  top: -2px;
}

.tree-site-block.drop-after::after,
.tree-layer-row.drop-after::after {
  bottom: -2px;
}

.tree-surface-row {
  grid-template-columns: minmax(0, 1fr);
}

.tree-layer {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-height: 23px;
  padding: 2px 5px;
  border: 0;
  background: transparent;
}

.tree-layer.active {
  background: var(--workspace-selected-bg);
  color: var(--ink);
}

.tree-layer > svg {
  width: 15px;
  height: 15px;
  justify-self: center;
}

.tree-layer strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.14;
  font-size: 10.75px;
}

.tree-layer small {
  font-size: 9.75px;
}

.tree-layer-delete {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #991b1b;
  opacity: 0.58;
}

.tree-layer-delete:hover {
  opacity: 1;
  background: #fff1f2;
}

.tree-layer-delete svg {
  width: 11px;
  height: 11px;
}

.tree-layer-visible {
  position: relative;
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin-left: 0;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: #fff;
  cursor: pointer;
}

.tree-layer-visible input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tree-layer-visible-spacer {
  cursor: default;
  border-color: transparent;
  background: transparent;
}

.tree-layer-visible-spacer svg {
  width: 13px;
  height: 13px;
  color: #475569;
}

.tree-layer-visible span {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: grid;
  place-items: center;
}

.tree-layer-visible input:checked + span {
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #fff;
}

.tree-layer-visible input:checked + span::after {
  content: "";
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.tree-reorder {
  display: flex;
  gap: 2px;
  position: absolute;
  right: 4px;
  top: 4px;
  padding: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
}

.tree-reorder button {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.tree-reorder button:hover {
  color: #0f172a;
  background: rgba(255,255,255,0.75);
}

.tree-reorder .tree-danger {
  color: #991b1b;
}

.tree-reorder .tree-danger:hover {
  background: #fff1f2;
}

.tree-reorder svg {
  width: 13px;
  height: 13px;
}

.tree-add-map {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 4px 7px;
  border-style: dashed;
  color: var(--muted);
  font-size: 11px;
}

.tree-site-actions {
  display: grid;
  gap: 2px;
  margin: 2px 0 2px 10px;
}

.tree-objects {
  display: grid;
  gap: 1px;
  margin: 0 0 4px 10px;
  padding-left: 8px;
  border-left: 1px solid #d8e0ea;
}

.tree-empty {
  margin: 0 0 3px 7px;
  color: var(--muted);
  font-size: 10.5px;
  padding: 2px 5px;
}

.tree-group,
.tree-asset {
  min-height: 22px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  display: grid;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 2px 4px;
  width: 100%;
  justify-content: stretch;
  text-align: left;
  font-size: 11px;
  line-height: 1.15;
}

.tree-group {
  grid-template-columns: 10px minmax(0, 1fr) auto;
}

.tree-type .tree-group {
  grid-template-columns: 10px 8px minmax(0, 1fr) auto;
}

.tree-asset {
  grid-template-columns: 8px minmax(0, 1fr) auto;
  margin-left: 15px;
  width: calc(100% - 15px);
  position: relative;
}

.tree-asset::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  width: 8px;
  border-top: 1px solid #d8e0ea;
}

.tree-asset.active {
  background: var(--workspace-selected-bg);
  color: var(--ink);
  border-color: var(--workspace-selected-border);
}

.tree-group strong {
  font-size: 11px;
}

.tree-asset strong {
  font-size: 10.75px;
}

.tree-asset strong,
.tree-asset small,
.tree-group strong,
.tree-group small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-asset small,
.tree-group small {
  color: var(--muted);
  font-size: 9.75px;
}

.tree-asset small {
  justify-self: end;
  max-width: 48%;
}

.tree-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--type-color, #334155);
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(15, 23, 42, 0.12);
}

.tree-asset .tree-dot {
  width: 6px;
  height: 6px;
}

.tree-type {
  display: grid;
  gap: 1px;
  position: relative;
}

.tree-type.open::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 21px;
  bottom: 3px;
  width: 1px;
  background: #d8e0ea;
}

.tree-disclosure {
  width: 10px;
  height: 10px;
  display: grid;
  place-items: center;
  color: #64748b;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.tree-disclosure::before {
  content: "+";
  transform: translateY(-0.5px);
}

.tree-disclosure.open::before {
  content: "-";
}

.tree-group:hover .tree-disclosure {
  color: #0f172a;
  background: #e2e8f0;
}

.tool-grid {
  padding: 8px 10px;
  display: grid;
  gap: 10px;
}

.tool-group {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  display: grid;
  gap: 4px;
  position: relative;
}

.tool-group-title {
  justify-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  line-height: 1.1;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  width: auto;
  box-shadow: none;
}

.tool-group-title:active {
  cursor: grabbing;
}

.tool-group-title:hover {
  color: #334155;
  background: transparent;
  border-color: transparent;
}

.tool-group.dragging {
  opacity: 0.62;
}

.tool-group.drop-before::before,
.tool-group.drop-after::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  border-radius: 999px;
  background: #f59e0b;
  z-index: 2;
}

.tool-group.drop-before::before {
  top: -5px;
}

.tool-group.drop-after::after {
  bottom: -5px;
}

.tool-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 5px;
}

.tool-grid [data-tool] {
  justify-content: flex-start;
  min-height: 32px;
  padding: 3px 6px 3px 5px;
  border-color: #dbe5ef;
  border-left: 3px solid var(--type-color, var(--line));
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  display: grid;
  grid-template-columns: 8px 15px minmax(0, 1fr);
  gap: 5px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 660;
  line-height: 1.05;
  box-shadow: none;
}

.tool-grid [data-tool][draggable="true"] {
  cursor: grab;
}

.tool-grid [data-tool][draggable="true"]:active {
  cursor: grabbing;
}

.tool-grid [data-tool].active {
  background: #fff7ed;
  color: #111827;
  border-color: #fed7aa;
  border-left-color: var(--type-color, #f59e0b);
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.22);
}

.tool-swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--type-color, #334155);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.7), 0 0 0 3px rgba(15,23,42,0.12);
}

.tool-grid [data-tool] span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tool-grid [data-tool] svg {
  width: 14px;
  height: 14px;
}

.app-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-marker svg {
  width: calc(17px * var(--asset-marker-scale));
  height: calc(17px * var(--asset-marker-scale));
}

.asset-marker.selected {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 5px rgba(245, 158, 11, 0.92),
    0 8px 18px rgba(15, 23, 42, 0.25);
}

.map-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.map-stage.panel-drop-target::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 640;
  border: 2px dashed rgba(15, 118, 110, 0.72);
  border-radius: 12px;
  background: rgba(236, 253, 245, 0.16);
  pointer-events: none;
}

.selection-box {
  position: absolute;
  z-index: 650;
  border: 1px solid rgba(37, 99, 235, 0.9);
  background: rgba(59, 130, 246, 0.14);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7) inset;
  pointer-events: none;
}

.icon-scale-control {
  position: absolute;
  top: 54px;
  left: 12px;
  z-index: 530;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--map-control-bg);
  border: 1px solid var(--map-control-border);
  border-radius: 14px;
  box-shadow: var(--map-control-shadow);
  padding: 4px;
  touch-action: none;
  backdrop-filter: blur(8px);
}

.icon-scale-control.dragging {
  opacity: 0.86;
}

.icon-scale-control button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 11px;
  justify-content: center;
}

.icon-scale-control.collapsed {
  width: 40px;
  height: 40px;
  padding: 0;
}

.icon-scale-control.collapsed button {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  border-radius: inherit;
  color: #172033;
  box-shadow: none;
}

.icon-scale-control.collapsed svg,
.map-navigator.collapsed svg {
  width: 19px;
  height: 19px;
}

.icon-scale-panel {
  display: grid;
  grid-template-columns: minmax(96px, 140px) 42px;
  align-items: center;
  gap: 8px;
  padding-right: 7px;
}

.icon-scale-slider-label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.icon-scale-panel input {
  padding: 0;
}

#iconScaleValue {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.icon-label-toggle {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  font-size: 11px;
  cursor: pointer;
}

.icon-label-toggle input {
  margin: 0;
}

.icon-scale-control.collapsed .icon-scale-panel {
  display: none;
}

.panel-promote-layer {
  position: absolute;
  inset: 18px;
  z-index: 660;
  pointer-events: none;
}

.panel-promote-layer:empty {
  display: none;
}

.panel.promoted {
  pointer-events: auto;
  position: absolute;
  left: 28px;
  top: 28px;
  width: min(1040px, calc(100% - 56px));
  height: min(820px, calc(100% - 56px));
  display: flex;
  flex-direction: column;
  flex: none !important;
  min-height: 0 !important;
  min-width: min(360px, calc(100% - 8px));
  max-width: none !important;
  max-height: none !important;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.28);
}

.panel.promoted.moving,
.panel.promoted.resizing {
  user-select: none;
}

.panel.promoted > .panel-resize-handle {
  display: none;
}

.panel.promoted .panel-title {
  cursor: move;
}

.panel.promoted .panel-title button,
.panel.promoted .panel-title a,
.panel.promoted .panel-title input,
.panel.promoted .panel-title select {
  cursor: pointer;
}

.panel.promoted > :not(.panel-title) {
  flex: 1 1 auto;
  min-height: 0;
}

.panel.promoted > .tabs {
  flex: 0 0 auto;
}

.panel.promoted .tab-body:not(.hidden),
.panel.promoted .inspector-body:not(.hidden),
.panel.promoted .audit-tab-body:not(.hidden) {
  flex: 1 1 auto;
  max-height: none;
  overflow: auto;
}

#panelAudit.promoted {
  background: #f8fafc;
}

#panelAudit.promoted .panel-title {
  min-height: 38px;
  padding: 7px 10px;
  background: #fff;
}

#panelAudit.promoted .audit-tab-body:not(.hidden) {
  padding: 14px 16px 18px;
}

.panel-return-btn {
  margin-left: auto;
}

.promoted-panel-resize {
  position: absolute;
  width: 24px;
  height: 24px;
  opacity: 0;
  z-index: 5;
  touch-action: none;
  background: transparent;
}

.promoted-panel-resize[data-resize-corner="northWest"] {
  left: -4px;
  top: -4px;
  cursor: nwse-resize;
}

.promoted-panel-resize[data-resize-corner="northEast"] {
  right: -4px;
  top: -4px;
  cursor: nesw-resize;
}

.promoted-panel-resize[data-resize-corner="southWest"] {
  left: -4px;
  bottom: -4px;
  cursor: nesw-resize;
}

.promoted-panel-resize[data-resize-corner="southEast"] {
  right: -4px;
  bottom: -4px;
  cursor: nwse-resize;
}

.promoted-panel-resize:hover,
.promoted-panel-resize.dragging {
  opacity: 1;
}

.promoted-panel-resize:hover::after,
.promoted-panel-resize.dragging::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
}
#map {
  height: 100%;
  width: 100%;
  background: #c9d4dc;
}

#map .leaflet-tile,
#map .leaflet-zoom-animated {
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.map-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 500;
  display: flex;
  gap: 8px;
}

.map-hud span {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 750;
}

.map-navigator {
  position: absolute;
  top: 54px;
  left: 56px;
  z-index: 560;
  width: min(282px, calc(100% - 24px));
  background: var(--map-control-bg);
  border: 1px solid var(--map-control-border);
  border-radius: 12px;
  box-shadow: var(--map-control-shadow);
  overflow: hidden;
  touch-action: none;
  backdrop-filter: blur(8px);
}

.map-navigator.dragging {
  opacity: 0.86;
}

.map-nav-toggle {
  display: none;
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #172033;
  box-shadow: none;
  justify-content: center;
}

.map-navigator.collapsed {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 14px;
  background: var(--map-control-bg);
}

.map-navigator.collapsed .map-nav-toggle {
  display: inline-flex;
}

.map-navigator.collapsed .map-nav-panel {
  display: none;
}

.map-nav-panel {
  display: grid;
  gap: 6px;
  padding: 7px;
}

.map-nav-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  cursor: move;
  user-select: none;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.map-nav-handle button {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
}

.map-nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 5px;
}

.map-nav-row input,
.map-nav-row button {
  min-height: 34px;
}

.map-nav-status {
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floor-plan-footprint {
  cursor: pointer;
}

.asset-hover-tooltip {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1.15;
}

.asset-hover-tooltip strong,
.asset-hover-tooltip span {
  display: block;
  white-space: nowrap;
}

.asset-hover-tooltip span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 1px;
}

.floor-plan-enter {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 50%;
  border-color: #94a3b8;
  background: rgba(248, 250, 252, 0.94);
  color: #334155;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.floor-plan-enter svg {
  width: 20px;
  height: 20px;
}

.object-filter {
  position: absolute;
  top: 102px;
  left: 12px;
  z-index: 500;
  display: grid;
  gap: 6px;
  width: max-content;
  max-width: calc(100% - 24px);
  max-height: none;
  overflow: visible;
  background: var(--map-control-bg);
  border: 1px solid var(--map-control-border);
  border-radius: 18px;
  box-shadow: var(--map-control-shadow);
  padding: 12px 4px 5px;
  touch-action: none;
  backdrop-filter: blur(8px);
  transform: scale(var(--object-filter-scale, 1));
  transform-origin: top left;
}


.object-filter.resizing {
  opacity: 0.9;
}

.object-filter-resize {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 8px;
  height: 8px;
  cursor: nwse-resize;
  opacity: 0.42;
  border-right: 2px solid rgba(51, 65, 85, 0.72);
  border-bottom: 2px solid rgba(51, 65, 85, 0.72);
  border-radius: 1px;
  z-index: 2;
}

.object-filter-resize:hover,
.object-filter.resizing .object-filter-resize {
  opacity: 0.85;
}

.object-filter::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  height: 10px;
  cursor: move;
}

.object-filter.dragging {
  opacity: 0.82;
}

.object-filter.filter-mode-normal {
  grid-template-columns: 36px;
}

.object-filter.filter-mode-two-column {
  grid-template-columns: repeat(2, 36px);
  border-radius: 18px;
}

.object-filter.filter-mode-horizontal {
  grid-auto-flow: column;
  grid-template-rows: 36px;
  border-radius: 18px;
}

.object-filter.filter-mode-horizontal-two-column {
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 36px);
  border-radius: 18px;
}

.object-filter button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  gap: 4px;
  font-size: 11px;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.13);
}

.object-filter button:not(.active) {
  opacity: 0.48;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.object-filter button.active {
  background: var(--marker-bg, var(--type-color, var(--accent)));
  color: var(--marker-fg, #fff);
  border-color: var(--marker-border, rgba(255,255,255,0.88));
}

.object-filter-inspection-cycle.active {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.object-filter-separator {
  grid-column: 1 / -1;
  width: calc(100% - 6px);
  height: 1px;
  margin: 1px 3px;
  background: rgba(100, 116, 139, 0.26);
  border-radius: 999px;
}

.object-filter.filter-mode-horizontal .object-filter-separator,
.object-filter.filter-mode-horizontal-two-column .object-filter-separator {
  grid-column: auto;
  width: 1px;
  height: 24px;
  margin: 4px 2px;
  align-self: center;
}

.object-filter svg {
  width: 18px;
  height: 18px;
}

.line-draw-hint {
  position: absolute;
  top: 96px;
  left: 12px;
  z-index: 520;
  max-width: min(520px, calc(100% - 24px));
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 750;
}

#map.drawing-line {
  cursor: crosshair;
}

#map.placing-asset,
#map.placing-asset .leaflet-interactive {
  cursor: copy;
}

.drop-zone {
  position: absolute;
  inset: auto 28px 24px 28px;
  z-index: 520;
  background: rgba(16, 20, 24, 0.78);
  color: #fff;
  border: 1px dashed rgba(255,255,255,0.65);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transform: translateY(140%);
  transition: transform 160ms ease;
  pointer-events: none;
}

.drop-zone.visible { transform: translateY(0); }

.asset-marker {
  position: relative;
  width: calc(34px * var(--asset-marker-scale));
  height: calc(34px * var(--asset-marker-scale));
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--marker-bg, #334155);
  border: 2px solid var(--marker-border, #fff);
  color: var(--marker-fg, #fff);
  box-shadow: 0 9px 24px rgba(15, 23, 42, 0.32);
}

.asset-marker-label {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  max-width: 160px;
  transform: translateX(-50%);
  padding: 3px 6px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 5px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.18);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  pointer-events: none;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-labels-visible .marker-zoom-full .leaflet-marker-icon > .asset-marker .asset-marker-label,
.asset-labels-visible .marker-zoom-step-1 .leaflet-marker-icon > .asset-marker .asset-marker-label {
  display: block;
}

.leaflet-marker-icon > .asset-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.marker-zoom-step-1 .leaflet-marker-icon > .asset-marker,
.asset-marker.zoom-step-1 {
  width: calc(28px * var(--asset-marker-scale));
  height: calc(28px * var(--asset-marker-scale));
}

.marker-zoom-step-1 .leaflet-marker-icon > .asset-marker svg,
.asset-marker.zoom-step-1 svg {
  width: calc(14px * var(--asset-marker-scale));
  height: calc(14px * var(--asset-marker-scale));
}

.marker-zoom-step-2 .leaflet-marker-icon > .asset-marker,
.asset-marker.zoom-step-2 {
  width: calc(22px * var(--asset-marker-scale));
  height: calc(22px * var(--asset-marker-scale));
  border-width: 2px;
}

.marker-zoom-step-2 .leaflet-marker-icon > .asset-marker svg,
.asset-marker.zoom-step-2 svg {
  width: calc(11px * var(--asset-marker-scale));
  height: calc(11px * var(--asset-marker-scale));
}

.marker-zoom-step-3 .leaflet-marker-icon > .asset-marker,
.asset-marker.zoom-step-3 {
  width: calc(17px * var(--asset-marker-scale));
  height: calc(17px * var(--asset-marker-scale));
  border-width: 2px;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.28);
}

.marker-zoom-step-3 .leaflet-marker-icon > .asset-marker svg,
.asset-marker.zoom-step-3 svg {
  width: calc(8px * var(--asset-marker-scale));
  height: calc(8px * var(--asset-marker-scale));
}

.marker-zoom-dot .leaflet-marker-icon > .asset-marker,
.asset-marker.zoom-dot {
  width: calc(10px * var(--asset-marker-scale));
  height: calc(10px * var(--asset-marker-scale));
  border-width: 2px;
  outline-width: 0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.24);
}

.marker-zoom-dot .leaflet-marker-icon > .asset-marker svg,
.asset-marker.zoom-dot svg {
  display: none;
}

.drag-ghost {
  position: fixed;
  left: -120px;
  top: -120px;
  pointer-events: none;
  z-index: 9999;
}

.asset-marker.unchecked { outline: 2px solid rgba(245, 158, 11, 0.8); }
.asset-marker.checked { outline: 2px solid rgba(22, 163, 74, 0.8); }

.leaflet-marker-icon.drop-target .asset-marker {
  outline: 4px solid rgba(20, 184, 166, 0.9);
  transform: translate(-50%, -50%) scale(1.08);
}

.coverage-handle {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translate(4.5px, 4.5px);
  transition: opacity 120ms ease;
}

.coverage-handle.visible {
  opacity: 1;
}

.coverage-handle.range {
  border-color: #111827;
}

.coverage-handle.fov-left,
.coverage-handle.fov-right {
  border-color: #b91c1c;
}

.line-handle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #111827;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

.bezier-handle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
}
.asset-weakness-marker {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--weakness-color, #64748b);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.32);
}

.asset-weakness-marker svg {
  width: 13px;
  height: 13px;
}

.localized-weakness-form,
.localized-weakness-list {
  display: grid;
  gap: 9px;
}

.localized-visible {
  align-self: end;
  min-height: 34px;
  padding: 8px 0;
}

.localized-weakness-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 7px;
}

.localized-weakness-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.localized-weakness-card p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}
.localized-weakness-menu {
  width: min(390px, calc(100vw - 24px));
  gap: 5px;
  padding: 8px;
}

.localized-weakness-menu > strong {
  padding: 1px 4px 3px;
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.localized-weakness-menu-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  max-height: none;
  overflow: visible;
  padding: 3px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 7px;
  background: rgba(241, 245, 249, 0.58);
}

.localized-weakness-menu-list button {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.42);
  white-space: normal;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.12;
  text-align: left;
}

.localized-weakness-menu-list button:nth-child(4n+1),
.localized-weakness-menu-list button:nth-child(4n+4) {
  background: rgba(240, 253, 250, 0.78);
}

.localized-weakness-menu-list button:hover {
  background: #e7f4f1;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.22);
}

.localized-weakness-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  border-top: 1px solid rgba(203, 213, 225, 0.82);
  padding-top: 6px;
}

.localized-weakness-custom input {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.localized-weakness-custom button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.draft-line-handle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #111827;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
}

.draft-line-handle.start {
  width: 10px;
  height: 10px;
  border-color: #16a34a;
}

.map-context-menu {
  position: absolute;
  z-index: 900;
  min-width: 160px;
  background: rgba(255,255,255,0.97);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.map-context-menu button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
}

.map-context-menu button.active {
  background: #ecfdf5;
  color: var(--accent);
}

.media-marker,
.photo-marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--marker-bg, #fff);
  border: 2px solid var(--marker-border, var(--type-color, #111827));
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
  display: grid;
  place-items: center;
  color: var(--marker-fg, var(--type-color, #111827));
}

.media-marker svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.evidence-card {
  cursor: grab;
}

.evidence-card:active {
  cursor: grabbing;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fff;
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
}

.item-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.layers-list .item-card header {
  justify-content: flex-start;
}

.layers-list .item-card header strong {
  flex: 1 1 auto;
}

.layers-list .item-card header .chip {
  margin-left: auto;
}

.item-card strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.item-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.record-attribution {
  display: block;
  color: #7b8794;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.005em;
}

.microcopy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.menu-visibility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.menu-visibility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 7px;
}

.menu-visibility-chip {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--type-color, var(--accent));
  border-radius: 7px;
  background: #fff;
  display: grid;
  grid-template-columns: auto 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: #1f2937;
  font-size: 12px;
  font-weight: 760;
}

.menu-visibility-chip input {
  width: auto;
  margin: 0;
}

.menu-visibility-chip span {
  color: var(--type-color, var(--accent));
  display: grid;
  place-items: center;
}

.menu-visibility-chip svg {
  width: 15px;
  height: 15px;
}

.marker-scheme-sample {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--marker-bg, #334155);
  color: var(--marker-fg, #fff);
  border: 2px solid var(--marker-border, #fff);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.18);
}

.marker-scheme-sample svg {
  width: 15px;
  height: 15px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.records-action-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.quick-observation-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
}

.quick-observation-form textarea {
  min-height: 76px;
}

.quick-observation-form .form-row.three {
  grid-template-columns: 1fr;
  gap: 8px;
}

.path-builder {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.path-builder header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.audit-create {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.audit-create.compact {
  padding: 8px;
  gap: 6px;
  background: rgba(255,255,255,0.72);
}

.audit-create.compact.collapsed {
  padding: 7px 8px;
}

.audit-create header,
.audit-linked header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.audit-create header {
  cursor: pointer;
  user-select: none;
}

.audit-create header strong {
  font-size: 14px;
}

.audit-create.compact header strong {
  font-size: 12px;
  color: var(--muted);
}

.audit-create.collapsed .audit-create-row {
  display: none;
}

.audit-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.audit-create-row input {
  min-height: 38px;
}

.audit-create-row button {
  min-height: 38px;
}

.audit-create.compact .audit-create-row input {
  min-height: 32px;
  font-size: 14px;
}

.audit-create.compact .audit-create-row button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 14px;
}

.audit-create.compact .audit-create-row button svg {
  width: 18px;
  height: 18px;
}

.audit-system-card,
.client-file-card {
  gap: 12px;
}

.audit-system-card > header {
  cursor: pointer;
  user-select: none;
}

.audit-system-card > header strong {
  font-size: 14px;
}

.audit-system-details {
  display: grid;
  gap: 12px;
}

.audit-system-card.details-collapsed .audit-system-details {
  display: none;
}

.audit-section-editor {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.audit-section-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.audit-section-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audit-section-actions button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.audit-section-actions button svg {
  width: 15px;
  height: 15px;
}

.audit-section-editor-grid {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.audit-section-list {
  display: grid;
  gap: 5px;
  align-content: start;
}

.audit-section-list > button {
  justify-content: flex-start;
  min-height: 30px;
  padding: 5px 8px;
  border-color: transparent;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.audit-section-list > button.active {
  background: #ecfdf5;
  color: var(--accent);
  border-color: #bbf7d0;
}

.audit-section-add {
  border-top: 1px solid #edf1f5;
  margin-top: 4px;
  padding-top: 7px;
  display: grid;
  gap: 6px;
}

.audit-section-editor.docked .audit-section-add {
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.audit-section-add input,
.audit-section-add button {
  min-height: 30px;
  font-size: 12px;
}

.audit-section-editor.docked .audit-section-add button {
  min-width: 68px;
}

.audit-section-note-field textarea {
  min-height: 154px;
}

.audit-section-editor.docked .audit-section-note-field textarea {
  min-height: 118px;
}

.audit-linked {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.audit-observation-templates,
.audit-linked-records {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.audit-observation-templates > header,
.audit-linked-records > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.audit-template-sections {
  display: grid;
  gap: 6px;
}

.audit-template-section {
  border: 1px solid #dbe5ef;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.audit-template-section summary {
  min-height: 34px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}

.audit-template-section summary::marker {
  color: #64748b;
}

.audit-template-list {
  border-top: 1px solid #edf1f5;
  padding: 6px;
  display: grid;
  gap: 5px;
  background: #f8fafc;
}

.audit-template-row {
  min-height: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  padding: 5px 5px 5px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.audit-template-row span {
  min-width: 0;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.audit-template-row button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.audit-custom-observation {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  gap: 8px;
}

.audit-record-card {
  border: 1px solid #dbe5ef;
  border-radius: 7px;
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 7px;
}

.audit-record-card strong {
  color: #0f172a;
  font-size: 13px;
}

.audit-record-card p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.audit-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 6px;
}

.audit-asset-linker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.audit-asset-linker input,
.audit-asset-linker button {
  min-height: 32px;
  font-size: 13px;
}

.audit-asset-chip {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: auto 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.audit-asset-chip input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.audit-asset-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.audit-asset-grid .asset-mini-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--type-color, #334155);
  color: #fff;
  font-size: 12px;
}

.asset-mini-icon svg,
.asset-mini-icon .app-icon,
.asset-mini-icon .app-custom-icon {
  width: 15px;
  height: 15px;
}

.audit-asset-grid span {
  color: var(--muted);
  font-size: 11px;
}

.client-file-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(150px, 0.6fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.client-file-form textarea {
  grid-column: 1 / -1;
  min-height: 74px;
}

.panel.promoted .audit-asset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#panelAudit.promoted .audit-create {
  padding: 12px;
  margin-bottom: 12px;
}

#panelAudit.promoted .audit-create-row {
  grid-template-columns: minmax(220px, 1fr) auto;
}

#panelAudit.promoted .audit-create-row input,
#panelAudit.promoted .audit-create-row button {
  min-height: 36px;
}

#panelAudit.promoted .audit-system-card {
  padding: 10px;
  gap: 10px;
}

#panelAudit.promoted .settings-grid.three {
  gap: 9px;
}

#panelAudit.promoted .audit-section-note-field textarea {
  min-height: 128px;
}

.path-steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.path-steps li {
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
}

.path-steps li button {
  width: 24px;
  height: 24px;
  margin-left: 4px;
  padding: 0;
  vertical-align: middle;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 750;
}

.sev-critical { background: #7f1d1d; color: #fff; border-color: #7f1d1d; }
.sev-high { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.sev-medium { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.sev-low { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.sev-undefined { background: #f1f5f9; color: #475569; }

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.tabs button {
  border: 0;
  border-radius: 0;
  background: #fff;
  min-height: 38px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.1;
}

.tabs button.active {
  color: var(--accent);
  background: #ecfdf5;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.audit-tabs {
  grid-template-columns: 1fr;
}

.audit-tabs button {
  min-height: 36px;
  padding: 0 8px;
  font-size: 12.5px;
  line-height: 1.1;
  white-space: nowrap;
}

#panelAudit.promoted .audit-tabs button {
  min-height: 38px;
  font-size: 12.5px;
}

.hidden { display: none !important; }

.empty-state {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-list {
  max-height: 176px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 4px 0;
}

.weakness-check-list {
  gap: 8px;
  height: var(--weakness-list-height, auto);
  max-height: none;
  min-height: 112px;
  align-content: start;
  grid-auto-rows: min-content;
  overflow: hidden;
  resize: vertical;
  padding-right: 2px;
  scrollbar-width: none;
}

.weakness-check-list::-webkit-scrollbar {
  display: none;
}

.weakness-check-list.saving {
  opacity: 0.65;
}

.weakness-check-group {
  display: grid;
  gap: 4px;
  align-content: start;
  grid-auto-rows: min-content;
}

.weakness-check-group h4 {
  margin: 0;
  color: #5b6876;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.check-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  align-items: start;
  font-size: 11.5px;
  line-height: 1.18;
  color: #26323e;
}

.check-line input { width: auto; margin-top: 2px; }

.workspace-site-admin {
  gap: 8px;
}

.workspace-site-admin-title .chip {
  flex: 0 0 auto;
}

.workspace-site-admin .microcopy {
  margin: 0;
}

.workspace-site-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
}

.workspace-site-admin-row.active {
  background: var(--workspace-selected-bg);
  border-color: var(--workspace-selected-border);
  box-shadow: inset 3px 0 0 var(--workspace-selected-rail);
}

.workspace-site-open {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 32px;
  padding: 3px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.workspace-site-open:hover {
  background: rgba(15, 118, 110, 0.06);
}

.workspace-site-open > svg {
  width: 16px;
  height: 16px;
  justify-self: center;
  color: var(--workspace-selected-icon);
}

.workspace-site-open span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.workspace-site-open strong,
.workspace-site-open small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-site-open strong {
  font-size: 12px;
  line-height: 1.15;
}

.workspace-site-open small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}

.workspace-site-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

button.workspace-site-delete {
  min-width: 72px;
  min-height: 30px;
  padding: 0 8px;
  gap: 4px;
}

button.workspace-site-delete svg {
  width: 13px;
  height: 13px;
}

@media (max-width: 520px) {
  .workspace-site-admin-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .workspace-site-actions {
    justify-content: space-between;
  }
}

.inspector-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
}

.section-title {
  min-height: 38px;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  cursor: default;
}

.section-title strong {
  font-size: 12px;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1;
}

.section-title[data-section-toggle] {
  cursor: pointer;
}

.section-title[data-section-drag-handle] {
  cursor: grab;
}

.section-title[data-section-drag-handle]:active {
  cursor: grabbing;
}

.section-grip {
  width: 15px;
  height: 15px;
  color: #94a3b8;
  flex: 0 0 auto;
}

.inspector-section.dragging {
  opacity: 0.62;
}

.inspector-section.drop-before::before,
.inspector-section.drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 999px;
  background: #f59e0b;
  z-index: 2;
}

.inspector-section.drop-before::before {
  top: 2px;
}

.inspector-section.drop-after::after {
  bottom: 2px;
}

.section-body {
  display: none;
  padding: 9px;
  border-top: 1px solid var(--line);
  gap: 8px;
}

.inspector-section.open .section-body {
  display: grid;
}

button.danger {
  color: #991b1b;
  border-color: #fecaca;
  background: #fff1f2;
}

button.subtle-danger {
  min-width: 34px;
  padding: 0;
  background: #fff;
}

button.subtle-danger:hover {
  background: #fff1f2;
  border-color: #fca5a5;
}

button.subtle-danger:disabled {
  color: #94a3b8;
  background: #f8fafc;
  border-color: var(--line);
  cursor: not-allowed;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.media-preview {
  min-width: 0;
}

.media-preview.image {
  display: block;
}

.media-preview.image img,
.media-preview.video video {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.media-preview.video video {
  aspect-ratio: 16 / 9;
}

.media-preview.audio {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.media-audio-title {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.media-audio-row {
  display: grid;
  grid-template-columns: 30px minmax(116px, 1fr) 30px;
  gap: 6px;
  align-items: center;
}

.media-preview.audio audio {
  display: none;
}

.media-audio-play,
.media-audio-menu {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  color: #334155;
  background: #fff;
}

.media-audio-play svg,
.media-audio-menu svg {
  width: 16px;
  height: 16px;
}

.media-audio-progress {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.media-audio-progress input {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.media-preview.video a,
.media-preview.file {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.media-preview.compact.audio {
  padding: 6px;
}

.media-actions-menu {
  position: fixed;
  z-index: 5000;
  display: grid;
  gap: 2px;
  min-width: 154px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.24);
}

.media-actions-menu a,
.media-actions-menu button {
  min-height: 34px;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1f2937;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  text-align: left;
}

.media-actions-menu a:hover,
.media-actions-menu button:not(:disabled):hover {
  background: #eef6f4;
}

.media-actions-menu button:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.media-actions-menu svg {
  width: 16px;
  height: 16px;
}

.media-actions-menu small {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.leaflet-popup-content .media-popup {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.media-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 2px;
}

.media-popup-actions button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.report-media-list {
  display: grid;
  gap: 7px;
  margin: 6px 0 12px;
}

.asset-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 7px;
}

.asset-photo-grid a {
  display: block;
}

.asset-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.empty-state.compact {
  padding: 6px 0;
  text-align: left;
}

.layer-control {
  display: grid;
  grid-template-columns: 1fr repeat(5, auto);
  gap: 8px;
  align-items: center;
}

.layer-control input[type="range"] { padding: 0; }

.layer-visibility-toggle {
  position: relative;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #fff;
  cursor: pointer;
}

.layer-visibility-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.layer-visibility-toggle span {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.layer-visibility-toggle input:checked + span {
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #fff;
}

.layer-visibility-toggle input:checked + span::after {
  content: "";
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.layer-clipboard-status {
  margin-top: -8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.layer-clipboard-status.has-file {
  color: #0f766e;
  font-weight: 700;
}

dialog {
  border: 0;
  padding: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop { background: rgba(15, 23, 42, 0.36); }

.dialog-card {
  width: min(460px, 94vw);
  padding: 16px;
  display: grid;
  gap: 12px;
  background: #fff;
}

.confirm-card {
  width: min(380px, 92vw);
}

.confirm-card p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.settings-dialog {
  width: min(880px, 96vw);
  height: min(720px, 92vh);
  background: #fff;
  display: grid;
  grid-template-rows: auto 1fr;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.settings-head h2 {
  margin: 0;
  font-size: 16px;
}

.settings-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 190px 1fr;
}

.settings-nav {
  padding: 10px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 6px;
}

.settings-nav button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
}

.settings-nav button.active {
  background: #ecfdf5;
  color: var(--accent);
}

.settings-content {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.settings-tab {
  display: grid;
  gap: 12px;
}

.weakness-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.weakness-area-label {
  color: #0f172a;
  font-size: 14px;
  font-weight: 750;
}

.weakness-template-editor {
  min-height: 220px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre;
}

.audit-template-settings-group {
  display: grid;
  gap: 10px;
}

.audit-template-settings-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.report-dialog {
  width: min(1040px, 96vw);
}

.docs-dialog {
  width: min(920px, 96vw);
  height: min(760px, 92vh);
}

#floorPlanDialog {
  position: fixed;
  inset: 82px 18px auto auto;
  margin: 0;
  z-index: 1200;
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 104px);
}

.floor-plan-dialog {
  width: min(420px, calc(100vw - 36px));
  height: auto;
  max-height: calc(100vh - 104px);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}

.floor-plan-wizard {
  overflow: auto;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.floor-plan-copy {
  padding: 12px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  display: grid;
  gap: 4px;
}

.floor-plan-copy p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.floor-plan-placement-card {
  padding: 12px;
  border: 1px solid #ccfbf1;
  border-radius: 8px;
  background: #f0fdfa;
  display: grid;
  gap: 7px;
}

.floor-plan-placement-card p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.floor-plan-placement-card button {
  justify-self: start;
}

.floor-plan-wizard menu {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.floor-plan-placement-image {
  cursor: move;
  outline: 1px solid rgba(15, 118, 110, 0.45);
}

.rotated-image-overlay {
  overflow: visible;
  will-change: transform;
}

.rotated-image-overlay-img {
  display: block;
  object-fit: fill;
  user-select: none;
  will-change: transform;
}

.layer-focus-image {
  outline: 1px solid rgba(15, 23, 42, 0.16);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.2);
  background: #fff;
}

.floor-plan-handle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0f766e;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  display: grid;
  place-items: center;
  color: #0f766e;
}

.floor-plan-handle svg {
  width: 14px;
  height: 14px;
}

.floor-plan-resize-handle {
  cursor: nwse-resize;
}

.floor-plan-northEast-handle,
.floor-plan-southWest-handle {
  cursor: nesw-resize;
}

.floor-plan-northWest-handle,
.floor-plan-southEast-handle {
  cursor: nwse-resize;
}

.floor-plan-move-handle {
  cursor: move;
}

.floor-plan-rotate-handle {
  cursor: grab;
  position: relative;
}

.floor-plan-rotate-handle:active {
  cursor: grabbing;
}

.floor-plan-rotate-handle svg {
  position: absolute;
  width: 13px;
  height: 13px;
}

.floor-plan-rotate-handle svg.counter {
  transform: rotate(180deg);
}

.docs-content {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
}

.docs-content .doc-card {
  background: #fff;
}

.report-builder {
  min-height: 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
}

.report-options {
  border-right: 1px solid var(--line);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  background: #f8fafc;
}

.report-option-field {
  display: grid;
  gap: 4px;
  font-size: 11.5px;
  line-height: 1.18;
  color: #26323e;
}

.report-option-field span {
  font-weight: 700;
}

.report-option-field select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.report-preview {
  padding: 18px;
  overflow: auto;
  display: grid;
  gap: 14px;
  background: #fff;
}

.report-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.report-preview-head strong,
.report-preview-head span {
  display: block;
}

.report-preview section {
  border-bottom: 1px solid #edf1f5;
  padding-bottom: 10px;
}

.report-preview h3,
.report-preview h4 {
  margin: 0 0 6px;
}

.report-preview p,
.report-preview ul {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}


.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.report-kpi-grid span {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

.report-kpi-grid strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
}

.report-domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.report-domain-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  display: grid;
  gap: 7px;
}

.report-domain-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.report-domain-card header span {
  color: #64748b;
  font-size: 12px;
  text-align: right;
}

.report-problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin: 8px 0 10px;
}

.report-problem-card {
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px;
  background: #fff7f7;
  display: grid;
  gap: 6px;
}

.report-problem-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.report-problem-card header span {
  color: #64748b;
  font-size: 12px;
}

.report-problem-card .report-media-list.compact {
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
  margin: 0;
}

.report-problem-card .media-preview.image img,
.report-problem-card .media-preview.video video {
  aspect-ratio: 4 / 3;
}

.report-layer-weakness-list {
  display: grid;
  gap: 10px;
  margin: 8px 0 10px;
}

.report-layer-weakness-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  display: grid;
  gap: 6px;
}

.report-layer-weakness-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.report-layer-weakness-card header span {
  color: #64748b;
  font-size: 12px;
}


.chip-row.compact {
  gap: 5px;
}

.report-table {
  display: grid;
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 8px;
  font-size: 12px;
}

.report-table > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #e2e8f0;
}

.map-layer-table > div {
  grid-template-columns: 1.2fr 1.2fr .55fr .75fr .65fr 1.8fr;
}

.finding-summary-table > div,
.weakness-register-table > div {
  grid-template-columns: 1.6fr .75fr .75fr 1.4fr;
}

.weakness-register-table.by-object > div {
  grid-template-columns: 1.6fr .75fr .75fr 1.4fr;
}

.weakness-register-table.by-weakness > div {
  grid-template-columns: 1fr 2fr 1fr 1.15fr;
}

.asset-appendix-table > div {
  grid-template-columns: 1.15fr .9fr .7fr 1.3fr 1.9fr .55fr;
}

.report-table > div:first-child {
  border-top: 0;
}

.report-table span {
  min-width: 0;
  padding: 7px 8px;
  border-left: 1px solid #e2e8f0;
  overflow-wrap: anywhere;
  color: #334155;
}

.report-table span:first-child {
  border-left: 0;
}

.report-table-head {
  background: #f8fafc;
  font-weight: 700;
}

.report-location-list {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.report-location-list span {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr .9fr;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
}

.report-location-list small {
  color: #64748b;
  font-size: 12px;
}.doc-card p + p {
  margin-top: 4px;
}

@media (max-width: 760px) {
  .docs-content {
    grid-template-columns: 1fr;
  }

  .weakness-type-grid {
    grid-template-columns: 1fr;
  }

  .audit-asset-grid,
  .audit-section-editor-grid,
  .panel.promoted .audit-asset-grid,
  .client-file-form,
  .audit-create-row,
  .audit-custom-observation {
    grid-template-columns: 1fr;
  }

}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.swatch-input {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: center;
}

.swatch-input input[type="color"] {
  height: 36px;
  padding: 2px;
}

.dialog-card menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(248, 250, 252, 0.55), rgba(248, 250, 252, 0.90)),
    url("https://images.unsplash.com/photo-1494526585095-c41746248156?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-panel {
  width: min(390px, calc(100vw - 32px));
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(255,255,255,0.68);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.login-panel h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.login-panel form { display: grid; gap: 13px; }
.login-panel .primary-btn { width: 100%; }
.form-error { color: var(--accent-2); margin: 0; font-size: 13px; }

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns:
      minmax(240px, var(--left-rail-width))
      6px
      minmax(280px, 1fr)
      6px
      minmax(280px, var(--right-rail-width));
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 48vh auto auto;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .topbar, .left-rail, .map-stage, .right-rail { grid-column: 1; }
  .left-rail, .map-stage, .right-rail { grid-row: auto; }
  .rail-resizer { display: none; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .left-rail, .right-rail { border: 0; }
  .right-rail { overflow: visible; }
  .map-stage { height: 48vh; }
  .panel-promote-layer { inset: 8px; }
  .panel.promoted {
    width: 100%;
    height: 100%;
  }
}

.audit-tabs {
  grid-template-columns: 1fr;
}

.audit-item-create-row {
  grid-template-columns: minmax(130px, 0.8fr) minmax(150px, 1fr) minmax(110px, 0.7fr) auto;
}

.audit-item-card {
  margin-left: calc(var(--audit-depth, 0) * 12px);
  gap: 7px;
}

.audit-item-card > header {
  cursor: pointer;
  user-select: none;
}
.audit-item-card > .audit-area-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
  justify-content: normal;
  gap: 8px;
  min-height: 38px;
}

.audit-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #dbe5ef;
  border-radius: 5px;
  background: #f8fafc;
  color: #475569;
}

.audit-toggle-icon svg {
  width: 13px;
  height: 13px;
}

.audit-disclosure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #475569;
  transition: transform 120ms ease;
}

.audit-disclosure svg {
  width: 14px;
  height: 14px;
}

.audit-disclosure.open {
  transform: rotate(90deg);
}

.audit-area-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.audit-area-copy > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#panelAudit.promoted .audit-item-create-row.is-root {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.55fr) minmax(180px, 0.7fr) auto;
}

#panelAudit.promoted .audit-item-create-row.is-child {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.65fr) auto;
}

.audit-area-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  color: #334155;
  font-size: 12px;
}

.audit-area-stats span {
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  background: #f8fafc;
  padding: 3px 8px;
  font-weight: 750;
  white-space: nowrap;
}

.audit-area-stats .finding-count {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.audit-area-stats .hidden-count {
  border-color: #d8dee6;
  background: #f1f5f9;
  color: #64748b;
}

.audit-item-details {
  display: grid;
  gap: 7px;
}

.audit-item-details > .settings-grid {
  gap: 7px;
}

.audit-item-details > label textarea {
  min-height: 54px;
}

.audit-item-card.details-collapsed .audit-item-details {
  display: none;
}

.audit-linked {
  border: 1px solid #dbe5ef;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.audit-linked summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 8px;
  cursor: pointer;
  list-style: none;
}

.audit-linked summary::-webkit-details-marker {
  display: none;
}

.audit-linked[open] summary .audit-disclosure {
  transform: rotate(90deg);
}

.audit-linked .chip {
  margin-left: auto;
}

.audit-linked .audit-asset-grid {
  border-top: 1px solid #edf1f5;
  padding: 8px;
}

.audit-linked .audit-evidence-upload {
  margin: 0 8px 8px;
}

.audit-field-plan {
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.audit-field-plan-toggle {
  width: 100%;
  min-height: 36px;
  border: 0;
  background: #f8fafc;
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  text-align: left;
  color: #0f172a;
}

.audit-field-plan-toggle strong {
  font-size: 14px;
}

.audit-field-plan-toggle span:not(.audit-disclosure) {
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.audit-field-plan.open .audit-field-plan-toggle .audit-disclosure {
  transform: rotate(90deg);
}

.audit-field-plan-list {
  display: grid;
  gap: 6px;
  border-top: 1px solid #edf1f5;
  padding: 8px;
  background: #fff;
}

.audit-field-plan-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.6fr) minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 8px;
  background: #fff;
}

.audit-field-plan-row > div {
  display: grid;
  gap: 2px;
}

.audit-field-plan-row strong,
.audit-field-plan-row p {
  margin: 0;
}

.audit-field-plan-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.audit-response-panel {
  border-top: 1px solid var(--line);
  padding-top: 7px;
  display: grid;
  gap: 6px;
}

.audit-checklist-counts {
  display: flex;
  align-items: center;
  gap: 5px;
}

.audit-response-panel > header,
.audit-response-section summary,
.audit-response-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.audit-response-section {
  border: 1px solid #dbe5ef;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.audit-response-section summary {
  min-height: 32px;
  padding: 5px 8px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 750;
}

.audit-response-section summary::-webkit-details-marker {
  display: none;
}

.audit-response-section[open] > summary .audit-disclosure {
  transform: rotate(90deg);
}

.audit-response-section summary .chip {
  margin-left: auto;
}

.audit-response-list {
  border-top: 1px solid #edf1f5;
  background: #f8fafc;
  padding: 4px;
  display: grid;
  gap: 4px;
}

.audit-response-row {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  padding: 6px;
  display: grid;
  gap: 5px;
}

.audit-response-row.status-ok {
  border-color: #bbf7d0;
  background: #f3fcf5;
}

.audit-response-row.status-finding {
  border-color: #fecaca;
  background: #fff7f7;
}

.audit-response-row.status-follow-up {
  border-color: #fde68a;
  background: #fffbea;
}

.audit-response-row.status-not-tested,
.audit-response-row.status-not-applicable {
  border-color: #bfdbfe;
  background: #f3f8ff;
}

.audit-response-main strong {
  font-size: 13px;
  line-height: 1.3;
  color: #0f172a;
}

.audit-response-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.audit-response-meta {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
}

.audit-hide-response {
  min-height: 24px;
  border-color: transparent;
  background: transparent;
  padding: 2px 5px;
  color: #64748b;
  font-size: 11px;
}

.audit-hide-response:hover {
  border-color: #d6dee7;
  background: #f8fafc;
}

.audit-hide-response svg {
  width: 13px;
  height: 13px;
}

.audit-response-controls {
  display: grid;
  grid-template-columns: minmax(132px, 0.2fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
}

.audit-response-controls select,
.audit-response-controls textarea,
.audit-custom-response input,
.audit-custom-response select {
  font-size: 14px;
}

.audit-response-controls select {
  min-height: 34px;
  padding: 5px 8px;
}

.audit-response-controls textarea {
  min-height: 44px;
  padding: 6px 8px;
}

.audit-custom-response {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.45fr) 130px auto;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid #dbe5ef;
  border-radius: 6px;
  background: #f8fafc;
}

.audit-response-actions {
  display: grid;
  gap: 4px;
}

.audit-response-row .audit-row-action,
.audit-custom-response .audit-add-row-btn {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.audit-response-row .audit-row-action svg {
  width: 14px;
  height: 14px;
}

.audit-mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  color: #334155;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
}

.audit-evidence-upload {
  display: inline-grid;
  gap: 4px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.audit-row-evidence {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #475569;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.audit-row-evidence:hover {
  border-color: #aab7c4;
}

.audit-row-evidence svg {
  width: 14px;
  height: 14px;
}

.audit-row-evidence input {
  display: none;
}

.audit-hidden-responses {
  border-top: 1px solid #e5eaf0;
  background: #f8fafc;
}

.audit-hidden-responses > summary {
  justify-content: flex-start;
  min-height: 30px;
  padding: 4px 8px;
  color: #64748b;
  font-weight: 650;
}

.audit-hidden-responses > summary svg {
  width: 14px;
  height: 14px;
}

.audit-hidden-response-list {
  display: grid;
  gap: 3px;
  padding: 0 5px 5px;
}

.audit-hidden-response-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #fff;
  padding: 5px 6px;
  color: #64748b;
  font-size: 12px;
}

.audit-hidden-response-row button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 7px;
  font-size: 11px;
}

.audit-child-items {
  display: grid;
  gap: 8px;
}

#panelAudit:not(.promoted) .audit-area-header {
  grid-template-columns: auto minmax(0, 1fr);
}

#panelAudit:not(.promoted) .audit-area-stats {
  grid-column: 2;
  justify-content: flex-start;
}

#panelAudit:not(.promoted) .audit-response-controls,
#panelAudit:not(.promoted) .audit-custom-response {
  grid-template-columns: 1fr;
}

#panelAudit:not(.promoted) .audit-response-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .audit-item-create-row,
  .audit-response-controls,
  .audit-custom-response,
  .audit-area-header,
  .audit-field-plan-toggle,
  .audit-field-plan-row {
    grid-template-columns: 1fr;
  }

  .audit-area-stats {
    justify-content: flex-start;
  }

  #panelAudit.promoted .audit-item-create-row.is-root,
  #panelAudit.promoted .audit-item-create-row.is-child {
    grid-template-columns: 1fr;
  }
}

.report-builder-head {
  align-items: center;
  gap: 14px;
}

.report-builder-head h2 {
  margin-bottom: 2px;
}

.report-builder-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.report-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-head-actions select {
  min-height: 34px;
  padding: 4px 10px;
}

.report-builder-status {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.report-builder-status span {
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  background: #fff;
  padding: 4px 8px;
}

.warn-chip {
  color: #92400e !important;
  background: #fffbeb !important;
  border-color: #fde68a !important;
}

.report-builder-workspace {
  grid-template-columns: minmax(230px, 0.72fr) minmax(520px, 1.8fr) minmax(280px, 0.9fr);
  gap: 0;
  min-height: min(76vh, 860px);
}

.report-outline,
.report-source-drawer,
.report-section-editor {
  min-height: 0;
  overflow: auto;
}

.report-outline,
.report-source-drawer {
  background: #f8fafc;
}

.report-outline {
  border-right: 1px solid var(--line);
  padding: 10px;
}

.report-source-drawer {
  border-left: 1px solid var(--line);
  padding: 10px;
}

.report-outline-head,
.report-source-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 10px;
  color: #0f172a;
  font-size: 12px;
}

.report-outline-head span,
.report-source-head span {
  color: var(--muted);
  font-size: 11px;
}

.report-outline-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: stretch;
  gap: 4px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 7px;
  overflow: hidden;
}

.report-outline-row.active {
  border-color: #0f766e;
  box-shadow: inset 3px 0 0 #0f766e;
}

.report-outline-row.stale {
  border-color: #facc15;
}

.report-include-toggle {
  display: grid;
  place-items: center;
  border-right: 1px solid #eef2f7;
}

.report-outline-row button {
  min-width: 0;
  justify-content: flex-start;
  align-items: flex-start;
  display: grid;
  gap: 2px;
  text-align: left;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  padding: 8px 9px;
}

.report-outline-row strong {
  overflow-wrap: anywhere;
  font-size: 12.5px;
}

.report-outline-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.report-section-editor {
  background: #fff;
  padding: 12px;
}

.report-editor-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.report-editor-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: start;
}

#reportSectionTitle {
  width: 100%;
  font-size: 22px;
  font-weight: 760;
  border-color: transparent;
  padding-left: 0;
}

#reportSectionTitle:focus {
  border-color: var(--line);
  padding-left: 10px;
}

#reportSectionBody {
  flex: 1 1 auto;
  min-height: 430px;
  resize: vertical;
  line-height: 1.45;
  font-size: 14px;
  font-weight: 520;
}

.report-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-editor-foot {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.report-redaction-preview {
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}

.report-redaction-preview summary {
  cursor: pointer;
  font-weight: 750;
}

.report-redaction-preview pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 11px;
}

.report-source-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}

.report-source-kpis span {
  display: grid;
  gap: 2px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.report-source-kpis strong {
  color: #0f172a;
  font-size: 16px;
}

.report-source-drawer h3 {
  margin: 12px 0 6px;
  font-size: 12px;
}

.report-source-list {
  display: grid;
  gap: 6px;
}

.report-source-list article {
  display: grid;
  gap: 3px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.report-source-list strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.report-source-list span,
.muted-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.empty-state.compact {
  padding: 8px;
  min-height: 0;
  text-align: left;
}

@media (max-width: 1100px) {
  .report-builder-workspace {
    grid-template-columns: 220px minmax(430px, 1fr);
  }
  .report-source-drawer {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}