/* HomeNinja Silver UI theme. Presentation-only overrides shared by all workspaces. */
:root {
  --hn-silver-0: #ffffff;
  --hn-silver-1: #f5f7f9;
  --hn-silver-2: #e9edf1;
  --hn-silver-3: #d8dee4;
  --hn-silver-border: #c3cbd3;
  --hn-silver-ink: #202d36;
  --hn-silver-shadow: 0 1px 0 rgba(255,255,255,.96) inset,
    0 2px 5px rgba(29,43,56,.16), 0 1px 1px rgba(29,43,56,.1);
  --hn-silver-shadow-hover: 0 1px 0 rgba(255,255,255,.98) inset,
    0 3px 7px rgba(29,43,56,.2), 0 1px 2px rgba(29,43,56,.1);
  --hn-teal: #00a19c;
  --hn-teal-dark: #008c86;
  --hn-teal-pale: #d2eeeb;
}

/* Two drawing colours in the space formerly occupied by the pencil button. */
.rail-palette { position: relative; width: 38px; height: 38px; margin: 0 auto 3px; flex: none; }
.rail-palette-swatch { position: absolute; display: block; width: 25px; height: 25px; padding: 0; border: 2px solid #c5d3d5; border-radius: 2px; background: var(--palette-colour); box-shadow: 0 1px 3px #0009; }
.rail-palette-swatch.primary { top: 2px; left: 1px; z-index: 2; }
.rail-palette-swatch.secondary { right: 1px; bottom: 2px; z-index: 1; }
.rail-palette-swatch[aria-pressed="true"] { outline: 2px solid #00a99e; outline-offset: 1px; }
.rail-palette-swatch.secondary[aria-pressed="true"] { z-index: 3; }
.rail-palette-swatch:hover { border-color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

#sitingWorkspace .site-quick-actions > button[data-site-action="save"] { border-radius: 16px; }

/* The brand bar remains Petronas teal; its existing layout and controls remain intact. */
.app-header {
  background: var(--hn-teal);
  border-bottom-color: rgba(0, 73, 72, .28);
}
.app-header .header-actions > .button:not(.button-dark) {
  color: var(--hn-silver-ink);
  border: 1px solid var(--hn-silver-border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--hn-silver-0) 0%, var(--hn-silver-1) 48%, var(--hn-silver-3) 100%);
  box-shadow: var(--hn-silver-shadow);
}
.app-header .header-actions > .button:not(.button-dark):hover:not(:disabled) {
  background: linear-gradient(180deg, #fff 0%, #f4f7f9 45%, #e1e6eb 100%);
  box-shadow: var(--hn-silver-shadow-hover);
}
.app-header .header-actions > .button-dark {
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,.16) inset, 0 2px 5px rgba(10,18,22,.22);
}
.app-header .header-actions > .button-dark:hover:not(:disabled) {
  box-shadow: 0 1px 0 rgba(255,255,255,.19) inset, 0 3px 7px rgba(10,18,22,.27);
}

/* Shared raised workspace tabs. Document tabs remain a separate control. */
.document-tabs {
  background: linear-gradient(180deg, #f6f8fa 0%, #e3e7eb 100%);
  border-bottom-color: #c3cbd2;
}
.workspace-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 18px;
  margin: 3px 2px;
  border: 1px solid #c1c9d0;
  border-radius: 13px;
  background: linear-gradient(180deg, #fff 0%, #f3f5f7 46%, #dfe4e9 100%);
  color: #26333c;
  box-shadow: var(--hn-silver-shadow);
  font-weight: 650;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.workspace-tab:hover:not(.active) {
  border-color: #aebbc4;
  background: linear-gradient(180deg, #fff 0%, #f6f8fa 45%, #e6eaee 100%);
  box-shadow: var(--hn-silver-shadow-hover);
}
.workspace-tab.active {
  border-color: #008f89;
  background: linear-gradient(180deg, #16c9b8 0%, #00a79e 55%, #008f89 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 3px 7px rgba(0,94,91,.24), 0 1px 2px rgba(18,44,49,.12);
}
.workspace-tab.active:hover {
  background: linear-gradient(180deg, #21d1c0 0%, #02aca2 55%, #00948d 100%);
}

/* Plan Editor controls keep their existing placement and black drawing rail. */
.button:not(.button-dark),
.small-button,
.context-right > button,
.history-controls button,
.zoom-controls button,
.font-size-stepper button,
.dimension-round-controls button {
  border-color: var(--hn-silver-border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, var(--hn-silver-1) 46%, var(--hn-silver-2) 100%);
  color: var(--hn-silver-ink);
  box-shadow: var(--hn-silver-shadow);
}
.button:not(.button-dark):hover:not(:disabled),
.small-button:hover,
.context-right > button:hover:not(:disabled),
.history-controls button:hover:not(:disabled),
.zoom-controls button:hover:not(:disabled),
.font-size-stepper button:hover:not(:disabled),
.dimension-round-controls button:hover:not(:disabled) {
  border-color: #aebbc4;
  background: linear-gradient(180deg, #fff 0%, #f5f7f9 45%, #e4e9ed 100%);
  box-shadow: var(--hn-silver-shadow-hover);
}
.button:not(.button-dark):active:not(:disabled),
.small-button:active,
.context-right > button:active:not(:disabled),
.history-controls button:active:not(:disabled),
.zoom-controls button:active:not(:disabled) {
  box-shadow: 0 1px 2px rgba(29,43,56,.13) inset, 0 1px 1px rgba(29,43,56,.08);
}
.button:disabled,
.small-button:disabled,
.context-right > button:disabled {
  box-shadow: none;
}
.tool-rail {
  background: #101719;
  border-right-color: #354249;
}
.inspector-top,
.card-heading,
.section-label,
.symbol-library-heading,
.material-heading {
  color: #17474a;
}
.card-heading,
.section-label,
.symbol-library-heading,
.material-heading {
  background: linear-gradient(180deg, #e0f3f1 0%, var(--hn-teal-pale) 100%);
  border-radius: 7px;
}
.symbol-library-heading {
  flex-shrink: 0;
  gap: 12px;
  padding: 10px 12px;
}
.symbol-library-heading > div {
  min-width: 0;
}
.symbol-library-heading small {
  display: block;
  margin-bottom: 3px;
  line-height: 1.2;
}
.symbol-library-heading h2 {
  margin: 0;
  line-height: 1.2;
}
#symbolLibraryClose {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid var(--hn-silver-border);
  border-radius: 7px;
  font-size: 18px;
  line-height: 1;
  box-shadow: none;
}
#symbolLibraryClose:hover {
  background: #f3f5f6;
}

/* Siting & Property uses the same silver controls while retaining selected teal tools. */
#sitingWorkspace .site-toolbar button:not(.site-primary):not(.active):not(.danger):not([aria-pressed="true"]),
#sitingWorkspace .site-drawing-toolbar > button:not(.active):not(.site-primary):not(.danger):not([aria-pressed="true"]),
#sitingWorkspace .site-actions button:not(.site-primary):not(.active):not(.danger),
#sitingWorkspace .site-map-controls button,
#sitingWorkspace .site-mode button:not(.active),
#sitingWorkspace .site-planning-row button:not(.site-primary):not(.active),
#sitingWorkspace .site-section button:not(.site-primary):not(.active):not(.danger),
.site-dialog button:not(.site-primary):not(.danger) {
  border-color: var(--hn-silver-border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, var(--hn-silver-1) 46%, var(--hn-silver-2) 100%);
  color: var(--hn-silver-ink);
  box-shadow: var(--hn-silver-shadow);
}
#sitingWorkspace .site-toolbar button:not(.site-primary):not(.active):not(.danger):not([aria-pressed="true"]):hover,
#sitingWorkspace .site-drawing-toolbar > button:not(.active):not(.site-primary):not(.danger):not([aria-pressed="true"]):hover,
#sitingWorkspace .site-actions button:not(.site-primary):not(.active):not(.danger):hover,
#sitingWorkspace .site-map-controls button:hover,
#sitingWorkspace .site-mode button:not(.active):hover,
#sitingWorkspace .site-planning-row button:not(.site-primary):not(.active):hover,
#sitingWorkspace .site-section button:not(.site-primary):not(.active):not(.danger):hover,
.site-dialog button:not(.site-primary):not(.danger):hover {
  border-color: #aebbc4;
  background: linear-gradient(180deg, #fff 0%, #f5f7f9 45%, #e4e9ed 100%);
  box-shadow: var(--hn-silver-shadow-hover);
}
#sitingWorkspace input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not(.site-title),
#sitingWorkspace select,
#sitingWorkspace textarea,
.site-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.site-dialog select,
.site-dialog textarea,
#ninjaVisionWorkspace input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
#ninjaVisionWorkspace select,
#ninjaVisionWorkspace textarea,
.nv-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.nv-dialog select,
.nv-dialog textarea {
  border-color: #c8d0d7;
  border-radius: 8px;
  background-color: #fff;
  color: #26333c;
}
#sitingWorkspace .site-sidebar {
  background: linear-gradient(180deg, #f4f6f8 0%, #e9edf1 100%);
  border-right-color: #c5cdd4;
}
#sitingWorkspace .site-section > summary {
  border-radius: 8px;
  background: linear-gradient(180deg, #def2f0 0%, #cde9e6 100%);
  color: #164548;
}
#sitingWorkspace .site-section[open] > summary {
  background: linear-gradient(180deg, #d8efec 0%, #c4e5e1 100%);
}
#sitingWorkspace .site-metric,
#sitingWorkspace .site-results button,
#sitingWorkspace .site-item {
  border-color: #c8d0d7;
  border-radius: 9px;
}
#sitingWorkspace button:focus-visible,
#sitingWorkspace input:focus-visible,
#sitingWorkspace select:focus-visible,
#sitingWorkspace textarea:focus-visible,
.site-dialog button:focus-visible,
.site-dialog input:focus-visible,
.site-dialog select:focus-visible,
.site-dialog textarea:focus-visible {
  outline: 2px solid #008f89;
  outline-offset: 2px;
}

/* NinjaVision receives the same controls and pale teal section hierarchy. */
#ninjaVisionWorkspace button:not(.nv-primary):not(.nv-danger):not(.nv-selected):not(.active):not([aria-pressed="true"]),
.nv-dialog button:not(.nv-primary):not(.nv-danger):not(.nv-selected):not(.active):not([aria-pressed="true"]) {
  border-color: var(--hn-silver-border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, var(--hn-silver-1) 46%, var(--hn-silver-2) 100%);
  color: var(--hn-silver-ink);
  box-shadow: var(--hn-silver-shadow);
}
#ninjaVisionWorkspace button:not(.nv-primary):not(.nv-danger):not(.nv-selected):not(.active):not([aria-pressed="true"]):hover,
.nv-dialog button:not(.nv-primary):not(.nv-danger):not(.nv-selected):not(.active):not([aria-pressed="true"]):hover {
  border-color: #aebbc4;
  background: linear-gradient(180deg, #fff 0%, #f5f7f9 45%, #e4e9ed 100%);
  box-shadow: var(--hn-silver-shadow-hover);
}
.nv-topbar,
.nv-canvas-toolbar {
  background: linear-gradient(180deg, #f4f6f8 0%, #e8edf1 100%);
  border-bottom-color: #c5cdd4;
}
.nv-sidebar {
  background: linear-gradient(180deg, #f4f6f8 0%, #e9edf1 100%);
  border-right-color: #c5cdd4;
}
.nv-sidebar h2,
.nv-sidebar h3,
.nv-dialog > header {
  color: #17474a;
}
.nv-sidebar h2,
.nv-sidebar h3,
.nv-dialog > header {
  background: linear-gradient(180deg, #def2f0 0%, #cde9e6 100%);
  border-radius: 8px;
}
.nv-sidebar h3 {
  padding: 6px 9px;
}
.nv-sidebar h2 {
  padding: 8px 10px;
}
.nv-dialog > header {
  border-bottom-color: #c8e1de;
}
#ninjaVisionWorkspace button:focus-visible,
#ninjaVisionWorkspace input:focus-visible,
#ninjaVisionWorkspace select:focus-visible,
#ninjaVisionWorkspace textarea:focus-visible,
.nv-dialog button:focus-visible,
.nv-dialog input:focus-visible,
.nv-dialog select:focus-visible,
.nv-dialog textarea:focus-visible {
  outline: 2px solid #008f89;
  outline-offset: 2px;
}

/* Consistent high-visibility focus across the shared navigation and editor controls. */
.workspace-tab:focus-visible,
.app-header .header-actions button:focus-visible,
.context-toolbar button:focus-visible,
.small-button:focus-visible {
  outline: 2px solid #007f79;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .workspace-tab { padding-inline: 11px; }
}

/* Shared desktop chrome: a teal brand header and a distinct silver tab shelf. */
:root {
  --hn-matte-top: #f2f4f6;
  --hn-matte-bottom: #edf0f2;
  --hn-matte-border: #bdc6cd;
  --hn-matte-shadow: 0 2px 3px rgba(28, 42, 54, .14),
    0 4px 8px rgba(28, 42, 54, .08);
  --hn-matte-shadow-hover: 0 3px 5px rgba(28, 42, 54, .18),
    0 6px 11px rgba(28, 42, 54, .11);
  --hn-site-sidebar-width: clamp(245px, 22vw, 390px);
}

.app-header {
  height: 60px;
  flex: 0 0 60px;
  background: var(--hn-teal);
  border-bottom: 1px solid rgba(0, 73, 72, .3);
}
.document-tabs {
  height: 42px;
  flex: 0 0 42px;
  gap: 5px;
  padding-left: 8px;
  border-bottom-color: #c4ccd2;
  background: #edf0f2;
}
.siting-active .document-tabs,
.ninjavision-active .document-tabs {
  padding-left: 8px;
}
.document-tabs #tabs {
  align-items: center;
  gap: 4px;
}
.workspace-tab {
  height: 32px;
  margin: 4px 3px;
  padding: 0 16px;
  border: 1px solid var(--hn-matte-border);
  border-radius: 16px;
  background: #edf0f2;
  color: #26333c;
  box-shadow: var(--hn-matte-shadow);
  font: 600 12px Arial, sans-serif;
  white-space: nowrap;
}
.workspace-tab:hover:not(.active) {
  background: #f3f5f6;
  box-shadow: var(--hn-matte-shadow-hover);
}
.workspace-tab.active {
  border-color: #008e87;
  background: #009e97;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 87, 83, .24);
}
.workspace-tab.active:hover {
  background: #00a79f;
}
.tab {
  height: 32px;
  margin: 4px 0;
  padding: 0 12px;
  border: 1px solid #c5cdd3;
  border-radius: 12px;
  background: #edf0f2;
  box-shadow: var(--hn-matte-shadow);
}
.tab.active {
  border-color: #bfc9cf;
  background: #f4f6f7;
  box-shadow: 0 2px 4px rgba(28, 42, 54, .12);
}
.tab.active:after {
  height: 2px;
  border-radius: 2px;
  background: var(--hn-teal);
}
.new-tab {
  width: 38px;
  height: 32px;
  margin: 4px 0;
  border: 1px solid var(--hn-matte-border);
  border-radius: 16px;
  background: #edf0f2;
  box-shadow: var(--hn-matte-shadow);
}

/* Matte, gently raised controls shared by the three workspaces. */
.app-header .header-actions > .button:not(.button-dark),
.app-header .project-save-menu > summary,
.button:not(.button-dark),
.small-button,
.context-right > button,
.history-controls button,
.zoom-controls button,
.font-size-stepper button,
.dimension-round-controls button {
  border-color: var(--hn-matte-border);
  background: var(--hn-matte-bottom);
  color: var(--hn-silver-ink);
  box-shadow: var(--hn-matte-shadow);
}
.app-header .header-actions > .button:not(.button-dark),
.app-header .project-save-menu > summary {
  height: 40px;
}
.app-header .header-actions > .button:not(.button-dark) {
  padding-inline: 16px;
  border-radius: 18px;
}
.app-header .header-actions > .button-dark {
  height: 40px;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(10, 18, 22, .24);
}
.app-header .project-save-controls > .button {
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 18px 0 0 18px !important;
  border-right: 0;
}
.app-header .project-save-controls,
.app-header .project-save-menu {
  height: 40px;
}
.app-header .project-save-menu > summary {
  width: 38px;
  border-left: 1px solid #c3cbd2;
  border-radius: 0 18px 18px 0;
  color: var(--hn-silver-ink);
}
.app-header .header-actions .button svg {
  width: 18px;
  height: 18px;
}
.button:not(.button-dark):hover:not(:disabled),
.small-button:hover:not(:disabled),
.context-right > button:hover:not(:disabled),
.history-controls button:hover:not(:disabled),
.zoom-controls button:hover:not(:disabled),
.font-size-stepper button:hover:not(:disabled),
.dimension-round-controls button:hover:not(:disabled),
.app-header .header-actions > .button:not(.button-dark):hover:not(:disabled),
.app-header .project-save-menu > summary:hover {
  background: #f3f5f6;
  box-shadow: var(--hn-matte-shadow-hover);
}
.button:not(.button-dark):active:not(:disabled),
.small-button:active:not(:disabled),
.context-right > button:active:not(:disabled),
.history-controls button:active:not(:disabled),
.zoom-controls button:active:not(:disabled) {
  background: #e0e4e7;
  box-shadow: 0 1px 2px rgba(28, 42, 54, .12) inset;
}
.button:disabled,
.small-button:disabled,
.context-right > button:disabled {
  box-shadow: none;
}
.context-right > .small-button {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(28, 42, 54, .14);
}
.context-right > .small-button:hover:not(:disabled) {
  box-shadow: 0 1px 2px rgba(28, 42, 54, .18);
}
.context-right > .small-button:active:not(:disabled) {
  box-shadow: 0 1px 2px rgba(28, 42, 54, .12) inset;
}
.tool-rail {
  background: #101719;
  border-right-color: #344147;
}
.tool.active {
  background: #00a79e;
  border-color: #008e87;
  color: #fff;
}

/* Siting: connected, full-width toolbar rows above the property panel and map. */
#sitingWorkspace {
  top: 102px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#sitingWorkspace .site-toolbar,
#sitingWorkspace .site-drawing-toolbar {
  --hn-control-radius: 10px;
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  width: 100%;
  flex-wrap: wrap;
  border: 0;
  border-bottom: 1px solid #c4ccd2;
  border-radius: 0;
  background: #edf0f2;
  box-shadow: none;
}
#sitingWorkspace .site-toolbar {
  min-height: 46px;
  padding: 6px 10px;
  gap: 7px;
}
#sitingWorkspace .site-title {
  flex: 0 1 260px;
  min-width: 180px;
  width: 260px;
  padding: 6px 4px;
  border-color: transparent;
  border-radius: 4px;
  background: transparent;
  font-weight: 700;
}
#sitingWorkspace .site-toolbar-spacer {
  flex: 1 0 10px;
}
#sitingWorkspace .site-drawing-toolbar {
  min-height: 44px;
  padding: 5px 10px;
  gap: 6px;
}
#sitingWorkspace .site-layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--hn-site-sidebar-width) minmax(0, 1fr);
  min-height: 0;
}
#sitingWorkspace .site-sidebar {
  background: linear-gradient(180deg, #f1f3f5 0%, #e8ecef 100%);
  border-right-color: #c2cbd2;
  border-radius: 0;
  box-shadow: 1px 2px 5px rgba(28, 42, 54, .1);
  padding-top: 4px;
}
#sitingWorkspace .site-section > summary {
  border-radius: 10px;
  background: linear-gradient(180deg, #dff0ee 0%, #d3e9e6 100%);
  color: #17474a;
}
#sitingWorkspace .site-section[open] > summary {
  background: linear-gradient(180deg, #d8eeeb 0%, #cbe5e2 100%);
}
#sitingWorkspace input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not(.site-title),
#sitingWorkspace select,
#sitingWorkspace textarea,
.site-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.site-dialog select,
.site-dialog textarea,
#ninjaVisionWorkspace input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
#ninjaVisionWorkspace select,
#ninjaVisionWorkspace textarea,
.nv-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.nv-dialog select,
.nv-dialog textarea {
  border-color: #c4ccd2;
  border-radius: 9px;
  background-color: #fff;
}
#sitingWorkspace .site-toolbar button:not(.site-primary):not(.active):not(.danger):not([aria-pressed="true"]),
#sitingWorkspace .site-drawing-toolbar > button:not(.active):not(.site-primary):not(.danger):not([aria-pressed="true"]),
#sitingWorkspace .site-icon-anchor > button,
#sitingWorkspace .site-layer-anchor > button,
#sitingWorkspace .site-actions button:not(.site-primary):not(.active):not(.danger),
#sitingWorkspace .site-map-controls button,
#sitingWorkspace .site-mode button:not(.active),
#sitingWorkspace .site-planning-row button:not(.site-primary):not(.active),
#sitingWorkspace .site-section button:not(.site-primary):not(.active):not(.danger),
.site-dialog button:not(.site-primary):not(.danger),
#ninjaVisionWorkspace button:not(.nv-primary):not(.nv-danger):not(.nv-selected):not(.active):not([aria-pressed="true"]),
.nv-dialog button:not(.nv-primary):not(.nv-danger):not(.nv-selected):not(.active):not([aria-pressed="true"]) {
  border-color: var(--hn-matte-border);
  border-radius: var(--hn-control-radius, 15px);
  background: var(--hn-matte-bottom);
  color: var(--hn-silver-ink);
  box-shadow: var(--hn-matte-shadow);
}
#sitingWorkspace .site-toolbar > button,
#sitingWorkspace .site-drawing-toolbar > button,
#sitingWorkspace .site-icon-anchor > button,
#sitingWorkspace .site-layer-anchor > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 5px 12px;
  border-radius: 10px;
  line-height: 1.15;
  white-space: nowrap;
}
#sitingWorkspace .site-toolbar button:hover:not(.site-primary):not(.active):not(.danger),
#sitingWorkspace .site-drawing-toolbar > button:hover:not(.active):not(.site-primary):not(.danger),
#sitingWorkspace .site-icon-anchor > button:hover:not(.active):not(:disabled),
#sitingWorkspace .site-layer-anchor > button:hover:not(.active):not(:disabled),
#sitingWorkspace .site-map-controls button:hover,
#sitingWorkspace .site-section button:hover:not(.site-primary):not(.active):not(.danger),
.site-dialog button:hover:not(.site-primary):not(.danger),
#ninjaVisionWorkspace button:hover:not(.nv-primary):not(.nv-danger):not(.nv-selected):not(.active):not([aria-pressed="true"]),
.nv-dialog button:hover:not(.nv-primary):not(.nv-danger):not(.nv-selected):not(.active):not([aria-pressed="true"]) {
  background: #f3f5f6;
  box-shadow: var(--hn-matte-shadow-hover);
}
#sitingWorkspace .site-toolbar button.active,
#sitingWorkspace .site-mode button.active,
#sitingWorkspace .site-planning-row button.active {
  border-color: #008e87;
  border-radius: 16px;
  background: #009e97;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 87, 83, .22);
}
#sitingWorkspace .site-drawing-toolbar button.active {
  border-color: #65b7b1;
  border-radius: 10px;
  background: #d8eeeb;
  color: #007f79;
  box-shadow: none;
}
#sitingWorkspace .site-primary,
.site-dialog .site-primary,
#ninjaVisionWorkspace .nv-primary,
.nv-dialog .nv-primary {
  border-color: #008e87;
  border-radius: 16px;
  background: #009e97;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 87, 83, .2);
}
#sitingWorkspace .site-status {
  z-index: 5;
  border-top: 1px solid #c4ccd2;
  background: #e8ecef;
  color: #46535b;
}
#sitingWorkspace .site-status span:last-child {
  color: #667780;
}
#sitingWorkspace button:focus-visible,
#sitingWorkspace input:focus-visible,
#sitingWorkspace select:focus-visible,
#sitingWorkspace textarea:focus-visible,
#ninjaVisionWorkspace button:focus-visible,
#ninjaVisionWorkspace input:focus-visible,
#ninjaVisionWorkspace select:focus-visible,
#ninjaVisionWorkspace textarea:focus-visible,
.workspace-tab:focus-visible,
.tab:focus-visible,
.app-header .header-actions button:focus-visible {
  outline: 2px solid #007f79;
  outline-offset: 2px;
}
#ninjaVisionWorkspace {
  top: 102px !important;
}
#ninjaVisionWorkspace .nv-sidebar {
  background: linear-gradient(180deg, #f1f3f5 0%, #e8ecef 100%);
}
#ninjaVisionWorkspace .nv-sidebar h2,
#ninjaVisionWorkspace .nv-sidebar h3,
.nv-dialog > header {
  border-radius: 9px;
  background: linear-gradient(180deg, #dff0ee 0%, #d3e9e6 100%);
  color: #17474a;
}
#ninjaVisionWorkspace .nv-topbar,
#ninjaVisionWorkspace .nv-canvas-toolbar {
  border-color: #c4ccd2;
  background: #edf0f2;
}

/* Match NinjaVision's internal steps to the shared matte control system. */
#ninjaVisionWorkspace .nv-steps {
  gap: 6px;
  padding-top: 4px;
  padding-bottom: 4px;
  background: #edf0f2;
  border-bottom-color: #c4ccd2;
}
#ninjaVisionWorkspace .nv-step {
  margin: 2px 0;
  padding: 7px 13px;
  border: 1px solid var(--hn-matte-border);
  border-radius: 16px;
  background: #edf0f2;
  color: #26333c;
  box-shadow: var(--hn-matte-shadow);
}
#ninjaVisionWorkspace .nv-step.active {
  border-color: #008e87;
  background: #009e97;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 87, 83, .22);
}
#ninjaVisionWorkspace .nv-step.active .nv-step-number {
  border-color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.15);
  color: #fff;
}
#ninjaVisionWorkspace button.nv-selected {
  border-color: #008e87;
  background: #d5eeeb;
  color: #006d66;
  box-shadow: var(--hn-matte-shadow);
}

@media (max-width: 850px) {
  :root { --hn-site-sidebar-width: 245px; }
}
@media (max-width: 600px) {
  :root { --hn-site-sidebar-width: 205px; }
  .app-header { height: 56px; flex-basis: 56px; }
  .document-tabs { height: 42px; flex-basis: 42px; padding-left: 8px; }
  .siting-active .document-tabs,
  .ninjavision-active .document-tabs { padding-left: 8px; }
  .workspace-tab { height: 30px; padding-inline: 9px; font-size: 10px; }
  #sitingWorkspace,
  #ninjaVisionWorkspace { top: 98px !important; }
}

/* In Siting, keep branding and workspace navigation in the left rail.
   The map and its canvas start at the viewport's top edge. */
.siting-active .app-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 31;
  width: var(--hn-site-sidebar-width);
  height: 60px;
  padding: 0 8px;
  gap: 6px;
  border-right: 1px solid #c2cbd2;
}
.siting-active .app-header .brand { min-width: 0; flex: 0 1 auto; }
.siting-active .app-header .brand-logo { display: block; width: clamp(125px, 12vw, 175px); }
.siting-active .app-header .header-divider { display: none; }
.siting-active .app-header .document-heading { min-width: 0; max-width: none; flex: 1; gap: 3px; }
.siting-active .app-header #projectTitle { font-size: 10px; }
.siting-active .app-header .save-status { font-size: 8px; }
.siting-active .document-tabs {
  position: fixed;
  top: 60px;
  left: 0;
  z-index: 30;
  width: var(--hn-site-sidebar-width);
  height: 42px;
  padding: 0 4px;
  gap: 0;
  border-right: 1px solid #c2cbd2;
}
.siting-active .document-tabs .workspace-tab {
  flex: 1 1 0;
  min-width: 0;
  margin: 3px 1px;
  padding: 0 3px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 601px) {
  .siting-active .document-tabs #editorWorkspaceTab { flex: 0 1 79px; }
  .siting-active .document-tabs #sitingWorkspaceTab { flex: 1 1 105px; }
  .siting-active .document-tabs #ninjaVisionWorkspaceTab { flex: 1 1 110px; }
}
.siting-active .document-tabs .nv-tab-icon { width: 13px; height: 13px; }
.siting-active .document-tabs .local-pill { display: none; }
.siting-active #sitingWorkspace { top: 0 !important; }
.siting-active #sitingWorkspace .site-sidebar {
  margin-top: 102px;
  height: calc(100% - 102px);
}
@media (max-width: 600px) {
  .siting-active .app-header,
  .siting-active .document-tabs { width: max(150px, 42vw); }
  .siting-active .app-header { height: 54px; padding: 0 5px; }
  .siting-active .app-header .brand-logo { width: min(145px, calc(42vw - 10px)); }
  .siting-active .app-header .document-heading { display: none; }
  .siting-active .document-tabs {
    top: 54px;
    height: 108px;
    flex-direction: column;
    align-items: stretch;
    padding: 3px 6px;
  }
  .siting-active .document-tabs .workspace-tab {
    width: 100%;
    height: 32px;
    flex: 1 1 32px;
    margin: 1px 0;
    font-size: 10px;
  }
  .siting-active #sitingWorkspace .site-sidebar {
    margin-top: 162px;
    height: calc(100% - 162px);
  }
}

/* Status shares the remaining header width with the project and company names. */
.app-header .document-heading .save-status { min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
