
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f2f5;
}




*, *::before, *::after {
  box-sizing: border-box;
}



.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 320px 1fr 320px;
  grid-template-areas:
    "ribbon ribbon ribbon"
    "left   main   right"
    "left   bottom right";
  height: 100vh;
}

/* Ribbon */

.ribbon {
  grid-area: ribbon;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid #d0d4dc;
  background: #f7f9fc;
}

.ribbon-tabs {
  display: flex;
  gap: 4px;
}

.ribbon-tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px;
}

.ribbon-tab.active {
  border-color: #c4cad5;
  background: #ffffff;
}

.ribbon-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ribbon-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #eef2f7;
}

.ribbon-field label {
  font-size: 12px;
  color: #0f172a;
  white-space: nowrap;
}

.ribbon-field select {
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

/* Ribbon dropdowns (e.g., Managers) */
.ribbon-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ribbon-dropdown .dropdown-trigger {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #e5e7eb;
  cursor: pointer;
}

.ribbon-dropdown .dropdown-trigger:hover {
  background: #d4d4d8;
}

.ribbon-dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 140px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ribbon-dropdown .dropdown-menu button {
  width: 100%;
  text-align: left;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
}

.ribbon-dropdown .dropdown-menu button:hover {
  background: #eef2f7;
}

.ribbon-actions .primary {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #2c6fed;
  background: #2f73ff;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.ribbon-actions .primary:hover {
  background: #255cd9;
}

.ribbon-actions > button:not(.primary) {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #e5e7eb;
  cursor: pointer;
}

.ribbon-actions > button:not(.primary):hover {
  background: #d4d4d8;
}

.project-menu {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
}

.project-menu .project-label {
  font-size: 12px;
  color: #0f172a;
}

.project-menu button {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  cursor: pointer;
}

.project-menu button:hover {
  background: #e5e7eb;
}

.drawing-menu {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 12px;
}

.drawing-menu select {
  font-size: 12px;
  padding: 2px 4px;
}

.drawing-menu input[type="file"] {
  font-size: 11px;
}

/* Main canvas */

.main {
  grid-area: main;
  padding: 8px;
  overflow: hidden;
}

.canvas-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.canvas-header {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #1e293b;
}

.canvas-hint {
  font-size: 12px;
  color: #64748b;
}

.canvas-body {
  flex: 1;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
}

/* Scroll/pan wrapper */

.floor-wrapper {
  position: relative;
  margin: 0 auto;
  border-radius: 6px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  max-width: 100%;
  max-height: 100%;
}

/* Inner zoom layer */

.canvas-inner-zoom {
  position: relative;
  width: 1000px;
  height: 600px;
  transform-origin: top left;
}

/* PDF.js canvas sits behind the device layer. It's shown only when a PDF background is active. */
#pdfCanvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 600px;
  display: none;
  background: #ffffff;
}

/* Floorplan and overlay fill inner layer */

.floor-wrapper object#floorPlan {
  display: block;
  width: 1000px;
  height: 600px;
}

/* When using PDF.js, hide the <object> and show the canvas renderer. */
.canvas-inner-zoom.is-pdfjs #pdfCanvas {
  display: block;
}
.canvas-inner-zoom.is-pdfjs object#floorPlan {
  display: none;
}

#deviceLayer {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 600px;
  pointer-events: auto;
}

/* Measurement overlay sits between background and devices. */
#measurementLayer {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 600px;
  pointer-events: auto;
}

#measurementLayer .measurement-line {
  stroke: #0f172a;
  stroke-width: 2;
  pointer-events: stroke;
  cursor: pointer;
}

/* Selected measurement highlight */
#measurementLayer .measurement-line.selected {
  stroke: #1d4ed8;
}

#measurementLayer .measurement-line.preview {
  stroke-dasharray: 6 4;
}

/* Invisible wide hit-target for easy selection */
#measurementLayer .measurement-hit {
  stroke: transparent;
  stroke-width: 12;
  pointer-events: stroke;
  cursor: pointer;
}

#measurementLayer .measurement-endcap {
  stroke: #0f172a;
  stroke-width: 2;
}

#measurementLayer g.selected .measurement-endcap {
  stroke: #1d4ed8;
}

#measurementLayer .measurement-label {
  font-size: 12px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  fill: #0f172a;
  stroke: #ffffff;
  stroke-width: 3;
  paint-order: stroke;
  pointer-events: auto;
  cursor: pointer;
}

#measurementLayer .measurement-label.selected {
  fill: #1d4ed8;
}

#measurementLayer .measurement-label.selected {
  fill: #1d4ed8;
}

.measure-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.measure-last {
  min-width: 92px;
  font-weight: 600;
  color: #0f172a;
}

/* Screen-reader only label helper */
.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;
}

/* When a PDF background is active, we render via PDF.js onto #pdfCanvas and hide the <object>. */
.pdf-background #pdfCanvas {
  display: block;
}

.pdf-background object#floorPlan {
  display: none;
}

/* Device icons */

.device-icon {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%; /* default to circle */
  border: 2px solid #0f172a;
  background: #f9fafb;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  color: #0f172a;
  transform: translate(-50%, -50%) scale(1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: move;
}

/* Device icon shape overrides (so symbol shapes render on canvas) */
.device-icon.shape-square{ border-radius: 4px; }
.device-icon.shape-rectangle{ border-radius: 4px; }
.device-icon.shape-triangle,
.device-icon.shape-pentagon,
.device-icon.shape-hexagon,
.device-icon.device-icon.selected {
  box-shadow: 0 0 0 2px #3b82f6;
  border-color: #1d4ed8;
  background: #eff6ff;
}

/* Right pane */

/* Left pane (Accessories Manager) */

.left-pane {
  grid-area: left;
  border-right: 1px solid #d0d4dc;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.left-pane-header {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 14px;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.left-pane-content {
  padding: 8px 10px 10px;
  overflow: auto;
  font-size: 13px;
}

.accessory-type-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accessory-type-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f9fafb;
  padding: 6px;
}

.accessory-type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.accessory-type-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.accessory-type-title strong {
  white-space: nowrap;
}

.count-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  flex: 0 0 auto;
}

.accessory-type-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.accessory-type-actions button {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  cursor: pointer;
}

.accessory-type-actions button:hover {
  background: #cbd5e1;
}

.accessory-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.accessory-row {
  display: grid;
  grid-template-columns: 1fr 80px 70px 26px;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.accessory-row .acc-desc {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accessory-row input[type="number"] {
  width: 100%;
  font-size: 12px;
  padding: 2px 4px;
}

.accessory-row .acc-total {
  font-size: 12px;
  text-align: right;
  color: #0f172a;
}

.accessory-row .acc-remove {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  cursor: pointer;
}

.accessory-row .acc-remove:hover {
  background: #e2e8f0;
}

.right-pane {
  grid-area: right;
  border-left: 1px solid #d0d4dc;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.right-pane-header {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

.right-pane-content {
  padding: 8px 10px 10px;
  overflow: auto;
  font-size: 13px;
}

.tag-card {
  display: flex;
  gap: 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  padding: 6px;
  margin-bottom: 8px;
  align-items: center;
  background: #f9fafb;
}

.tag-symbol {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.tag-info {
  flex: 1;
}

.tag-small {
  font-size: 11px;
  color: #64748b;
}

.tag-info button {
  margin-top: 4px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  cursor: pointer;
}

.tag-info button:hover {
  background: #cbd5e1;
}

.tag-info button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tiny {
  font-size: 11px;
  color: #64748b;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.field span {
  font-size: 12px;
  color: #475569;
}

.field select,
.field input[type="number"],
.field input[type="file"] {
  padding: 4px;
  font-size: 12px;
}

.field-inline .inline-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

/* Bottom pane – Explorer */

.bottom-pane {
  grid-area: bottom;
  border-top: 1px solid #d0d4dc;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 140px;
  max-height: 220px;
  max-height: 220px;
}


.bottom-pane-header {
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 500;
}


.bottom-pane-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.bottom-pane-active {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.bottom-pane-active-label {
  font-weight: 500;
}

.bottom-pane-active select {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  min-width: 110px;
}

/*
  Explorer rows use fixed-width "columns" (Page, X,Y, Meta, System, Location)
  so values never shift based on dropdown text length or optional meta fields.
*/
.explorer-device {
  /* Keep list markers (bullets) while still getting fixed columns. */
  display: flex;
  align-items: center;
  gap: 6px;
}

.explorer-device-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-device-page {
  font-size: 11px;
  color: #444;
  width: 140px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.explorer-device-xy {
  font-size: 11px;
  color: #444;
  width: 90px;
  text-align: left;
  white-space: nowrap;
}

.explorer-device-meta {
  width: 220px;
  min-width: 0;
  font-size: 10px;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-device-system {
  width: 110px;
}

.explorer-device-location {
  width: 110px;
}

.explorer-device select {
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}
.bottom-pane-content {
  flex: 1;
  overflow: auto;
  padding: 6px 10px 8px;
}

.explorer-output {
  font-size: 12px;
}

.explorer-system {
  margin-bottom: 8px;
}

.explorer-system-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.explorer-location {
  margin-left: 10px;
}

.explorer-location-title {
  font-weight: 500;
}

.explorer-devices {
  margin-left: 18px;
  list-style: disc;
}
/* legacy meta style removed (meta now lives in its own grid column) */


/* Overlay wizard + page manager */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
  z-index: 1000;
}

.hidden {
  display: none !important;
}

.overlay.hidden {
  display: none;
}

.wizard {
  width: 640px;
  max-width: 95vw;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
}

.wizard-header {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.wizard-header h2 {
  margin: 0;
  font-size: 16px;
}

.wizard-body {
  padding: 10px 14px 4px;
}

.wizard-steps {
  min-height: 180px;
}

.wizard-step.hidden {
  display: none;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px 10px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.wizard-footer button {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #e5e7eb;
  cursor: pointer;
}

.wizard-footer button.primary {
  border-color: #2563eb;
  background: #3b82f6;
  color: #ffffff;
}

.wizard-footer button.primary:hover {
  background: #2563eb;
}

.wizard-footer-right {
  display: flex;
  gap: 6px;
}

.wizard-footer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Generic danger button (used in managers) */
button.danger {
  border-color: #b91c1c;
  background: #ef4444;
  color: #ffffff;
}

button.danger:hover {
  background: #b91c1c;
}

/* Page manager specific */

.page-manager-list {
  margin-top: 6px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f9fafb;
}

.pm-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-bottom: 1px solid #e2e8f0;
}

/* Database Manager layout */
.dbm-grid{display:grid; grid-template-columns: 1fr 1fr; gap:14px; align-items:start;}
.dbm-form,.dbm-list{border:1px solid #e5e5e5; border-radius:8px; padding:12px; background:#fff;}
.dbm-field{display:flex; flex-direction:column; gap:4px; margin-bottom:8px;}
.dbm-field label{font-size:12px; color:#555;}
.dbm-field input[type="text"], .dbm-field input[type="file"]{width:100%;}
.dbm-asset-row{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
@media (max-width: 900px){.dbm-grid{grid-template-columns:1fr;}}

.pm-row:last-child {
  border-bottom: none;
}

.pm-row.active {
  background: #e0f2fe;
}

/* Parts Manager – Remote/Local tabs */
.pm-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 6px;
}

.pm-tab {
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #0f172a;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.pm-tab.active {
  background: #0ea5e9;
  color: white;
  border-color: #0284c7;
}

.pm-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pm-tier {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-tier select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: white;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.pm-index {
  width: 26px;
  font-size: 11px;
  color: #64748b;
}

.pm-name {
  flex: 1;
  font-size: 12px;
  padding: 2px 4px;
}

/* Parts Manager: Local Catalog type binding */
.pm-type {
  min-width: 200px;
  max-width: 240px;
}

.pm-type-select {
  width: 100%;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: white;
}
.pm-size {
  min-width: 120px;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}


.pm-buttons {
  display: flex;
  gap: 4px;
}

.pm-buttons button {
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #e5e7eb;
  cursor: pointer;
}

.pm-buttons button:hover {
  background: #d4d4d8;
}

/* PRINT LAYOUT
   - Hide app chrome
   - Show printContainer with one "page" per drawing
*/

.print-only {
  display: none;
}

@media print {
  body {
    background: #ffffff;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block;
  }

  #printContainer {
    margin: 0;
    padding: 0;
  }

  .print-page {
    page-break-after: always;
    padding: 10px;
  }

  .print-page-title {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .print-page-inner {
    position: relative;
    width: 1000px;
    height: 600px;
  }

  .print-page-inner img {
    width: 1000px;
    height: 600px;
    display: block;
  }

  .print-device-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 1000px;
    height: 600px;
  }

  .print-device {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid #0f172a;
    background: #f9fafb;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    color: #0f172a;
    transform: translate(-50%, -50%) scale(1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

}


.explorer-device {
  cursor: pointer;
}

.explorer-device.selected {
  font-weight: 600;
  color: #0f766e;
}

.bottom-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bottom-pane-search input {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

.bottom-pane-search button {
  margin-left: 6px;
  font-size: 11px;
  padding: 2px 8px;
}

.bottom-pane-search input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
}

.symbol-library-list {
  max-height: 220px;
  overflow: auto;
  margin-top: 6px;
}

/* Reuse .tag-card etc for symbol library entries */


.tag-symbol {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  background: #f9fafb;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Faux Enterprise Admin Shell (V58) --- */

.splash-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #e2e8f0 0, #f1f5f9 45%, #e2e8f0 100%);
}

.splash-card {
  width: 480px;
  max-width: 95vw;
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.splash-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: #0f172a;
}

.splash-subtitle {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: #4b5563;
}

.splash-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 12px;
}

.splash-form input {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
}

.splash-form input:focus {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
  border-color: #0f766e;
}

.splash-actions {
  margin-top: 12px;
}

.splash-actions button {
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: #0f766e;
  color: #ecfeff;
  font-weight: 600;
  cursor: pointer;
}

.splash-actions button:hover {
  background: #0d5e57;
}

.splash-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #6b7280;
}

.admin-workspace {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(to right, #0f172a, #0369a1);
  color: #e5e7eb;
}

.admin-title {
  font-weight: 600;
  font-size: 1rem;
}

.admin-meta {
  font-size: 0.8rem;
  opacity: 0.9;
}

.admin-actions button {
  margin-left: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #111827;
  font-size: 0.8rem;
  cursor: pointer;
}

.admin-actions button:hover {
  background: #f9fafb;
}

.admin-grid {
  padding: 16px 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.admin-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.admin-card h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #111827;
}

.admin-card p {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: #4b5563;
}

.admin-card label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: #4b5563;
  margin-bottom: 8px;
}

.admin-card input {
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
}

.admin-card input:focus {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
  border-color: #0f766e;
}

.admin-panel {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e5e7eb;
}

.admin-panel-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-panel-actions button {
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: #0f766e;
  color: #ecfeff;
  font-size: 0.8rem;
  cursor: pointer;
}

.admin-panel-actions button:hover {
  background: #0d5e57;
}

/* Ensure project app fills viewport when active */
#projectApp.app {
  min-height: 100vh;
}

/* Make sure hidden really hides these top-level shells */
.splash-screen.hidden,
.admin-workspace.hidden,
#projectApp.hidden {
  display: none !important;
}


/* Integrator view panel inside Explorer */
.integrator-panel {
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  font-size: 11px;
}

.integrator-header {
  font-weight: 600;
  margin-bottom: 4px;
}

.integrator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 4px 8px;
}

.integrator-panel .tiny-field span {
  font-size: 11px;
}

.integrator-panel input,
.integrator-panel textarea {
  font-size: 11px;
}

.integrator-notes textarea {
  resize: vertical;
}


/* Integrator panel enhancements */

.integrator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 4px;
}

.integrator-toggle {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #e5e7eb;
  cursor: pointer;
}

.integrator-toggle:hover {
  background: #d4d4d8;
}

.integrator-panel.collapsed .integrator-grid {
  display: none;
}

/* PDF interaction + resizable view window */

/* Make the floorplan view window resizable by dragging the bottom-right corner */
.floor-wrapper {
  resize: both;
}

/* Optional visual cue when PDF interaction mode is active */
#pdfInteractToggleBtn.toggled {
  background: #0f766e;
  color: #ffffff;
}

/* Optional visual cue when Measure tool is active */
#measureToolBtn.toggled {
  background: #1d4ed8;
  color: #ffffff;
}

#measureToolBtn.toggled:hover {
  filter: brightness(1.05);
}

/* When PDF interaction is enabled, you can tweak cursor/appearance if desired */
.floor-wrapper.pdf-interaction-mode {
  cursor: default;
}


/* === Custom: hide canvas header title bar === */
.canvas-header {
  display: none;
}

/* === Custom: Serious Mode layout (hide ribbon + bottom explorer) === */
body.serious-mode .ribbon {
  display: none;
}

body.serious-mode .bottom-pane {
  display: none;
}

/* =====================================================
   Nerd Styles (merged from nerd.css)
   ===================================================== */
   
   

.nerd-btn {
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  font-size: 11px;
  padding: 3px 10px;
  border-width: 2px;
  border-style: solid;
  border-color: #ffffff #404040 #404040 #ffffff; /* Win95 bevel */
  background: linear-gradient(#c0c0c0, #808080);
  box-shadow: 2px 2px 0 #000000;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.nerd-btn::before {
  content: "🔥";
  font-family:
    "Segoe UI Emoji",
    "Noto Color Emoji",
    "Apple Color Emoji",
    system-ui;
  font-size: 14px;
  animation: nerd-fire-flicker 0.7s infinite alternate;
}


.nerd-btn.active {
  border-color: #404040 #ffffff #ffffff #404040;
  box-shadow: inset 2px 2px 0 #000000;
  background: linear-gradient(#808080, #c0c0c0);
}

@keyframes nerd-fire-flicker {
  from { transform: translateY(0); filter: brightness(1); }
  to   { transform: translateY(-1px); filter: brightness(1.4); }
}


/* Dirty Dump – Auto Prune chainsaw button */
.chainsaw-btn .chainsaw-icon {
  font-size: 13px;
  display: inline-block;
  transform-origin: left center;
}

.chainsaw-btn.shaking .chainsaw-icon {
  animation: chainsaw-shake 0.15s infinite;
}

@keyframes chainsaw-shake {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(1px, -1px) rotate(-8deg); }
  50%  { transform: translate(-1px, 1px) rotate(4deg); }
  75%  { transform: translate(1px, 0px) rotate(-5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}



/* === Custom: Serious Mode Win95-style magnifying glass icon === */
.serious-mode-btn .serious-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  background: #c0c0c0;
  border: 1px solid #000000;
  box-shadow: 1px 1px 0 #ffffff;
}



/* === Device Thumbnail Panel === */
.device-thumb-panel {
  padding: 8px;
  background: #111;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.device-thumb-panel.hidden { display: none; }

/* Sidebar placement: spans left pane width */
.device-thumb-panel--sidebar {
  width: 100%;
  border-top: 1px solid #2a2a2a;
}

.device-thumb-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #000;
  border: 1px solid #333;
}

.device-thumb-meta {
  font-size: 11px;
  color: #bbb;
  line-height: 1.3;
}


/* === Left pane footer: Selected device photo === */
.left-pane-content {
  flex: 1;
  min-height: 0;
}

.left-pane-footer {
  flex: 0 0 auto;
  border-top: 1px solid #e2e8f0;
  padding: 8px 10px 10px;
  background: #ffffff;
}

.left-pane-footer p {
  margin: 0 0 8px 0;
}


/* Page Manager: width/height fields */
.pm-dim{
  width: 90px;
  padding: 4px 6px;
  font-size: 12px;
}
.pm-w{ margin-left: 8px; }
.pm-h{ margin-left: 6px; }


/* Choose PDF Page modal */
.pdf-page-picker{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px 0;
}
.pdf-page-picker select{
  min-width: 220px;
}
.pdf-page-picker input[type="number"]{
  width: 90px;
  padding: 4px 6px;
  font-size: 12px;
}
.pdf-page-actions{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.muted{ opacity: 0.75; }


/* Hard override: ensure Choose PDF Page modal is on top and clickable */
#choosePdfPageModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  pointer-events: auto;
}
#choosePdfPageModal.hidden{ display: none !important; }

#choosePdfPageModal .wizard-dialog{
  position: relative;
  z-index: 10000;
  pointer-events: auto;
}

/* Make sure form controls receive pointer events even if a parent container disables them */
#choosePdfPageModal *{
  pointer-events: auto;
}


/* Device thumbnail: spec sheet link */
#deviceSpecLink{
  margin-left: 10px;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}


/* Symbol Manager: shape selector */
.sym-shape-select{
  height: 26px;
  padding: 2px 6px;
  font-size: 12px;
  max-width: 140px;
}

/* Symbol Manager: stroke color picker */
.sym-color-input{
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
}


/* Symbol Library: generated shapes */
.shape-circle{ border-radius: 999px; }
.shape-square{ border-radius: 4px; }
.shape-rectangle{
  width: 44px;
  height: 28px;
  border-radius: 4px;
}

/* ---- PDF Report (print) ---- */
@media print {
  .jw-report {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #0f172a;
  }

  .jw-report-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 4px 0;
  }

  .jw-report-meta {
    font-size: 11px;
    margin: 0 0 12px 0;
    opacity: 0.8;
  }

  .jw-report-location {
    font-size: 18px;
    font-weight: 800;
    margin: 14px 0 6px 0;
    padding-top: 8px;
    border-top: 2px solid #0f172a;
  }

  .jw-report-system {
    font-size: 16px;
    font-weight: 700;
    margin: 10px 0 6px 0;
  }

  .jw-report-system-subhead {
  font-size: 11px;        /* smaller than system */
  font-weight: 600;
  margin: 8px 0 6px 0;
  letter-spacing: 0.04em;
  color: #1f2937;
}



  .jw-report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 10px 0;
  }

  .jw-report-table th,
  .jw-report-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 8px;
    font-size: 11px;
    vertical-align: top;
  }

  .jw-report-table th {
    font-weight: 800;
    background: #f1f5f9;
  }

  .col-qty { width: 52px; text-align: right; }
  .col-type { width: 220px; }
  .col-pn { width: 140px; }
  .col-desc { width: auto; }

  .jw-row-acc td {
    opacity: 0.95;
  }

  .jw-indent {
    padding-left: 18px;
  }
}
@media print {
  .col-img { width: 40px; padding: 4px 6px; }

  .jw-report-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
  }

  /* optional: if you want a visible placeholder border */
  .jw-report-img:not(.is-loaded) {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
  }
}
@media print {
  /* Kill the entire interactive app shell so it can't "eat" page 1 */
  #projectApp,
  #adminWorkspace,
  #splashScreen {
    display: none !important;
  }

  /* Ensure print content is the only thing that flows */
  #printContainer {
    display: block !important;
  }
}
