    :root {
      --dm-navy: #0a192f;
      --dm-navy-light: #132743;
      --dm-panel-bg: #0f172a;
      --dm-card-bg: #1e293b;
      --dm-card-border: rgba(255, 255, 255, 0.08);
      --dm-blue: #0284c7;
      --dm-blue-hover: #0369a1;
      --dm-accent: #22c55e;
      --dm-accent-hover: #16a34a;
      --dm-critical: #ef4444;
      --dm-high: #f97316;
      --dm-medium: #eab308;
      --dm-low: #10b981;
      --dm-text-main: #f8fafc;
      --dm-text-muted: #94a3b8;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-font-smoothing: antialiased;
    }

    html, body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: var(--dm-navy);
      color: var(--dm-text-main);
      font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    }

    body {
      display: flex;
      flex-direction: column;
    }

    /* Top Bar */
    .inspect-header {
      height: 64px;
      background: var(--dm-navy);
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 20px;
      z-index: 1000;
      gap: 16px;
    }

    .brand-section {
      display: flex;
      align-items: center;
      gap: 14px;
      min-width: 280px;
    }

    .brand-badge {
      display: flex;
      align-items: center;
      gap: 8px;
      text-decoration: none;
      color: white;
    }

    .brand-badge img {
      height: 32px;
      width: auto;
      filter: brightness(0) invert(1);
    }

    .brand-tag {
      background: rgba(2, 132, 199, 0.2);
      border: 1px solid var(--dm-blue);
      color: #38bdf8;
      font-size: 11px;
      font-weight: 800;
      padding: 3px 8px;
      border-radius: 6px;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }

    .project-info {
      border-left: 1px solid rgba(255, 255, 255, 0.15);
      padding-left: 14px;
    }

    .project-title {
      font-size: 15px;
      font-weight: 700;
      color: #fff;
      line-height: 1.2;
    }

    .project-sub {
      font-size: 11px;
      color: var(--dm-text-muted);
      font-weight: 500;
    }

    /* Severity Counter Pills */
    .stats-pills {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .stat-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 700;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      cursor: pointer;
      transition: all 0.2s;
    }

    .stat-pill:hover, .stat-pill.active {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .stat-pill .dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
    }

    .stat-pill.crit { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
    .stat-pill.crit .dot { background: var(--dm-critical); box-shadow: 0 0 8px var(--dm-critical); }
    .stat-pill.high { border-color: rgba(249, 115, 22, 0.4); color: #fdba74; }
    .stat-pill.high .dot { background: var(--dm-high); box-shadow: 0 0 8px var(--dm-high); }
    .stat-pill.med { border-color: rgba(234, 179, 8, 0.4); color: #fef08a; }
    .stat-pill.med .dot { background: var(--dm-medium); }
    .stat-pill.low { border-color: rgba(16, 185, 129, 0.4); color: #86efac; }
    .stat-pill.low .dot { background: var(--dm-low); }

    /* Action Buttons in Header */
    .header-actions {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .btn-hdr {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 8px 16px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      text-decoration: none;
      cursor: pointer;
      transition: all 0.2s;
      border: none;
    }

    .btn-tour {
      background: var(--dm-accent);
      color: #052e16;
    }
    .btn-tour:hover {
      background: var(--dm-accent-hover);
      transform: translateY(-1px);
      box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
    }

    .btn-help {
      background: rgba(255, 255, 255, 0.08) !important;
      color: #94a3b8 !important;
      border: 1px solid rgba(255, 255, 255, 0.16) !important;
    }
    .btn-help:hover, .btn-help.active {
      background: rgba(56, 189, 248, 0.2) !important;
      border-color: rgba(56, 189, 248, 0.5) !important;
      color: #38bdf8 !important;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3) !important;
    }

    .btn-photos-action {
      background: rgba(14, 165, 233, 0.22) !important;
      color: #38bdf8 !important;
      border: 1.5px solid rgba(56, 189, 248, 0.6) !important;
      font-weight: 700 !important;
      box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
    }
    .btn-photos-action:hover, .btn-photos-action.active {
      background: #0284c7 !important;
      border-color: #38bdf8 !important;
      color: #ffffff !important;
      box-shadow: 0 0 16px rgba(56, 189, 248, 0.55) !important;
    }
    .hdr-photos-badge {
      background: rgba(56, 189, 248, 0.35);
      color: #38bdf8;
      font-size: 11px;
      padding: 1px 7px;
      border-radius: 10px;
      font-family: 'JetBrains Mono', monospace;
      font-weight: 800;
      margin-left: 3px;
    }
    .btn-photos-action:hover .hdr-photos-badge,
    .btn-photos-action.active .hdr-photos-badge {
      background: rgba(255, 255, 255, 0.35);
      color: #ffffff;
    }

    .btn-pdf {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.2);
    }
    .btn-pdf:hover {
      background: rgba(255, 255, 255, 0.18);
    }

    .btn-share {
      background: transparent;
      color: var(--dm-text-muted);
      border: 1px solid rgba(255, 255, 255, 0.12);
      padding: 8px 12px;
    }
    .btn-share:hover {
      color: #fff;
      border-color: rgba(255, 255, 255, 0.3);
    }

    .btn-add-obs {
      background: var(--dm-blue);
      color: #fff;
    }
    .btn-add-obs:hover {
      background: var(--dm-blue-hover);
    }

    /* Header Responsiveness: Ensure header actions (Kuvat, Aloita kierros) are NEVER hidden or pushed off-screen */
    @media (max-width: 1380px) and (min-width: 861px) {
      .stats-pills .stat-pill.med,
      .stats-pills .stat-pill.low {
        display: none !important;
      }
    }
    @media (max-width: 1180px) and (min-width: 861px) {
      .inspect-header .stats-pills {
        display: none !important;
      }
      .brand-section {
        min-width: auto !important;
      }
    }

    /* Desktop Header Clean-up: remove redundant 3D tools that live in 3D viewport */
    @media (min-width: 861px) {
      #btn-measure-hdr,
      #btn-add-pin-hdr,
      .btn-mobile-menu-trigger {
        display: none !important;
      }
    }

    /* Admin Upload Button & Modal Styles */
    .btn-admin-upload {
      background: rgba(168, 85, 247, 0.15);
      color: #c084fc;
      border: 1px solid rgba(168, 85, 247, 0.4);
    }
    .btn-admin-upload:hover {
      background: rgba(168, 85, 247, 0.28);
      border-color: #c084fc;
      color: #fff;
      transform: translateY(-1px);
      box-shadow: 0 4px 14px rgba(168, 85, 247, 0.3);
    }

    .btn-admin-link {
      background: rgba(239, 68, 68, 0.15);
      color: #fca5a5;
      border: 1px solid rgba(239, 68, 68, 0.4);
    }
    .btn-admin-link:hover {
      background: rgba(239, 68, 68, 0.28);
      border-color: #fca5a5;
      color: #fff;
      transform: translateY(-1px);
    }

    .user-pill-wrap {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .user-info-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 8px;
      font-size: 12px;
      color: var(--dm-text-muted);
    }

    .btn-logout {
      background: rgba(255, 255, 255, 0.08);
      color: var(--dm-text-muted);
      border: 1px solid rgba(255, 255, 255, 0.15);
    }
    .btn-logout:hover {
      background: rgba(239, 68, 68, 0.2);
      color: #ef4444;
      border-color: #ef4444;
    }

    .btn-login {
      background: var(--dm-blue);
      color: #fff;
    }
    .btn-login:hover {
      background: var(--dm-blue-hover);
    }

    .modal-admin-upload .modal-box {
      max-width: 680px;
      background: #0f172a;
      border: 1px solid rgba(168, 85, 247, 0.35);
      box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(168, 85, 247, 0.15);
    }

    .admin-upload-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 14px;
    }
    @media (max-width: 640px) {
      .admin-upload-grid {
        grid-template-columns: 1fr;
      }
    }

    .admin-card {
      background: #1e293b;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      transition: all 0.2s;
    }
    .admin-card:hover {
      border-color: rgba(168, 85, 247, 0.4);
      background: #243247;
    }

    .admin-card-header {
      display: flex;
      align-items: center;
      gap: 8px;
      font-weight: 700;
      font-size: 13px;
      color: #f8fafc;
    }
    .admin-card-header i {
      color: #c084fc;
      font-size: 15px;
    }

    .admin-card-desc {
      font-size: 11px;
      color: #94a3b8;
      line-height: 1.4;
      flex: 1;
    }

    .admin-card-input {
      display: none;
    }

    .admin-card-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 8px 12px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 700;
      background: rgba(168, 85, 247, 0.2);
      border: 1px solid rgba(168, 85, 247, 0.5);
      color: #e9d5ff;
      cursor: pointer;
      transition: all 0.2s;
      width: 100%;
    }
    .admin-card-btn:hover {
      background: #9333ea;
      color: #fff;
    }
    .admin-card-btn.loading {
      opacity: 0.7;
      pointer-events: none;
    }

    .admin-log-box {
      margin-top: 14px;
      background: #020617;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      padding: 12px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      color: #cbd5e1;
      max-height: 130px;
      overflow-y: auto;
      white-space: pre-wrap;
      line-height: 1.5;
    }

    .upload-progress-cont {
      margin-top: 10px;
      height: 6px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 3px;
      overflow: hidden;
      display: none;
    }
    .upload-progress-bar {
      height: 100%;
      background: linear-gradient(90deg, #9333ea, #38bdf8);
      width: 0%;
      transition: width 0.2s;
    }

    /* Main Container (Split View) */
    .inspect-workspace {
      width: 100%;
      flex: 1;
      display: flex;
      position: relative;
      overflow: hidden;
    }

    /* 3D Viewer Area */
    .viewer-area {
      width: 100%;
      flex: 1;
      position: relative;
      background: #050a12;
      overflow: hidden;
    }

    #potree_container {
      position: absolute;
      width: 100%;
      height: 100%;
      left: 0;
      top: 0;
    }

    #potree_render_area {
      position: absolute;
      width: 100%;
      height: 100%;
      left: 0;
      top: 0;
    }

    #potree_sidebar_container {
      display: none !important;
    }

    /* Floating 3D Model Mode Switcher */
    .view-mode-bar {
      position: absolute;
      top: 16px;
      left: 16px;
      background: rgba(15, 23, 42, 0.9);
      backdrop-filter: blur(16px);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 4px;
      display: flex;
      gap: 4px;
      z-index: 55;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .btn-mode-toggle {
      background: transparent;
      border: 1px solid transparent;
      color: #94a3b8;
      font-size: 12px;
      font-weight: 700;
      padding: 6px 12px;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s;
    }

    .btn-mode-toggle:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.08);
    }

    .btn-mode-toggle.active {
      background: var(--dm-blue);
      border-color: rgba(255, 255, 255, 0.2);
      color: #fff;
      box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45);
    }

    .btn-photos-toggle {
      background: rgba(14, 165, 233, 0.15) !important;
      border: 1px solid rgba(56, 189, 248, 0.45) !important;
      color: #38bdf8 !important;
    }
    .btn-photos-toggle:hover, .btn-photos-toggle.active {
      background: #0284c7 !important;
      border-color: #38bdf8 !important;
      color: #ffffff !important;
      box-shadow: 0 2px 10px rgba(2, 132, 199, 0.5) !important;
    }
    .floating-photos-badge {
      background: rgba(56, 189, 248, 0.35);
      color: #38bdf8;
      font-size: 10px;
      padding: 1px 6px;
      border-radius: 10px;
      font-family: 'JetBrains Mono', monospace;
      font-weight: 800;
      margin-left: 2px;
    }
    .btn-photos-toggle.active .floating-photos-badge,
    .btn-photos-toggle:hover .floating-photos-badge {
      background: rgba(255, 255, 255, 0.3);
      color: #ffffff;
    }
    .btn-cams-toggle.active {
      background: #0ea5e9 !important;
      color: #ffffff !important;
    }

    /* Floating View Orientation Bar */
    .view-orientation-bar {
      position: absolute;
      top: 64px;
      left: 16px;
      background: rgba(15, 23, 42, 0.85);
      backdrop-filter: blur(16px);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 12px;
      padding: 5px;
      display: flex;
      gap: 4px;
      z-index: 50;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .btn-orient {
      background: transparent;
      border: none;
      color: #cbd5e1;
      font-size: 12px;
      font-weight: 600;
      padding: 6px 12px;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s;
    }

    .btn-orient:hover, .btn-orient.active {
      background: rgba(255, 255, 255, 0.15);
      color: #fff;
    }

    /* Filter Floating Bar at Bottom of 3D */
    .filter-bar {
      position: absolute;
      bottom: 20px;
      left: 20px;
      background: rgba(15, 23, 42, 0.85);
      backdrop-filter: blur(16px);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 30px;
      padding: 6px 10px;
      display: flex;
      align-items: center;
      gap: 6px;
      z-index: 50;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .filter-btn {
      background: transparent;
      border: none;
      color: #94a3b8;
      font-size: 12px;
      font-weight: 700;
      padding: 6px 12px;
      border-radius: 20px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .filter-btn:hover {
      color: #fff;
    }

    .filter-btn.active {
      background: var(--dm-blue);
      color: #fff;
    }

    /* 3D Control Quick-Hint Pill */
    .control-hint-pill {
      position: absolute;
      bottom: 68px;
      left: 20px;
      background: rgba(15, 23, 42, 0.9);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 20px;
      padding: 6px 12px 6px 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      z-index: 52;
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
      transition: all 0.2s ease-out;
    }

    .hint-pill-content {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .hint-pill-icon {
      color: #38bdf8;
      font-size: 13px;
    }

    .hint-pill-text {
      font-size: 11.5px;
      color: #cbd5e1;
      white-space: nowrap;
    }

    .hint-pill-text strong {
      color: #ffffff;
    }

    .hint-pill-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      border-left: 1px solid rgba(255, 255, 255, 0.15);
      padding-left: 8px;
    }

    .hint-pill-btn-guide {
      background: rgba(2, 132, 199, 0.25);
      border: 1px solid rgba(56, 189, 248, 0.4);
      color: #38bdf8;
      padding: 3px 8px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.15s;
    }

    .hint-pill-btn-guide:hover {
      background: #0284c7;
      color: #ffffff;
      box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
    }

    .hint-pill-btn-close {
      background: transparent;
      border: none;
      color: #94a3b8;
      font-size: 16px;
      line-height: 1;
      cursor: pointer;
      padding: 2px 4px;
      border-radius: 4px;
      transition: all 0.15s;
    }

    .hint-pill-btn-close:hover {
      color: #ffffff;
      background: rgba(255, 255, 255, 0.1);
    }

    /* 3D Pin Badges */
    .dm-pin-marker {
      position: absolute;
      transform: translate(-50%, -100%);
      cursor: pointer;
      z-index: 100;
      display: flex;
      flex-direction: column;
      align-items: center;
      pointer-events: auto;
      transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .dm-pin-marker:hover, .dm-pin-marker.active {
      transform: translate(-50%, -115%) scale(1.18);
      z-index: 150;
    }

    .dm-pin-badge {
      width: 32px;
      height: 32px;
      border-radius: 50% 50% 50% 0;
      transform: rotate(-45deg);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 800;
      font-size: 13px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
      border: 2px solid #fff;
    }

    .dm-pin-badge span {
      transform: rotate(45deg);
    }

    .dm-pin-pulse {
      position: absolute;
      bottom: -4px;
      width: 10px;
      height: 6px;
      background: rgba(0, 0, 0, 0.5);
      border-radius: 50%;
    }

    /* Inspection Side Panel */
    .inspect-panel {
      width: 440px;
      background: var(--dm-panel-bg);
      border-left: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      flex-direction: column;
      z-index: 60;
      box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
      transition: transform 0.3s ease;
    }

    .panel-header {
      padding: 16px 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(255, 255, 255, 0.02);
    }

    .panel-title-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .btn-back-list {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #fff;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 12px;
      transition: all 0.2s;
    }

    .btn-back-list:hover {
      background: rgba(255, 255, 255, 0.16);
    }

    .panel-title {
      font-size: 15px;
      font-weight: 700;
      color: #fff;
    }

    /* Panel Mode Switcher (Havainnot vs Kaikki Kuvat) */
    .panel-mode-bar {
      display: flex;
      background: rgba(10, 16, 26, 0.95);
      padding: 6px 14px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      gap: 8px;
    }
    .panel-mode-btn {
      flex: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 7px 12px;
      border-radius: 8px;
      background: transparent;
      border: 1px solid transparent;
      color: #94a3b8;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
    }
    .panel-mode-btn:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.05);
    }
    .panel-mode-btn.active {
      background: rgba(2, 132, 199, 0.16);
      border-color: rgba(2, 132, 199, 0.45);
      color: #38bdf8;
    }
    .panel-mode-count {
      font-size: 10px;
      padding: 1px 5px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.1);
      font-family: 'JetBrains Mono', monospace;
      color: #cbd5e1;
    }
    .panel-mode-btn.active .panel-mode-count {
      background: rgba(56, 189, 248, 0.25);
      color: #38bdf8;
    }

    /* Photo Browser Container & Controls */
    .obs-tab-wrapper {
      display: flex;
      flex-direction: column;
      gap: 20px;
      width: 100%;
    }
    .photos-browser {
      display: flex;
      flex-direction: column;
      gap: 14px;
      width: 100%;
    }
    .photo-controls-wrap {
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: rgba(13, 21, 34, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      padding: 12px;
    }
    .photo-level-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .photo-level-title {
      font-size: 12px;
      font-weight: 700;
      color: #94a3b8;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .photo-level-stats {
      font-size: 11px;
      color: #38bdf8;
      font-family: 'JetBrains Mono', monospace;
      font-weight: 600;
    }
    .photo-floor-chips {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding-bottom: 4px;
      scrollbar-width: thin;
    }
    .floor-chip-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 5px 10px;
      border-radius: 20px;
      font-size: 11.5px;
      font-weight: 700;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #cbd5e1;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.2s;
    }
    .floor-chip-btn:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
      border-color: rgba(255, 255, 255, 0.25);
    }
    .floor-chip-btn.active {
      background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
      color: #fff;
      border-color: #38bdf8;
      box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
    }
    .floor-chip-badge {
      font-size: 9.5px;
      padding: 1px 4px;
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.35);
      font-family: 'JetBrains Mono', monospace;
    }
    .photo-toolbar-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(255, 255, 255, 0.06);
      flex-wrap: wrap;
    }
    .photo-sort-wrap {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11.5px;
      color: #94a3b8;
    }
    .photo-sort-select {
      background: #0f172a;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 6px;
      color: #fff;
      padding: 4px 8px;
      font-size: 11.5px;
      cursor: pointer;
      outline: none;
    }
    .photo-actions-quick {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .btn-quick-photo-tour {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--dm-accent);
      color: #052e16;
      border: none;
      border-radius: 6px;
      padding: 5px 10px;
      font-size: 11.5px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
    }
    .btn-quick-photo-tour:hover {
      background: var(--dm-accent-hover);
      transform: translateY(-1px);
    }
    .btn-toggle-3d-cams {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(255, 255, 255, 0.08);
      color: #94a3b8;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 6px;
      padding: 5px 9px;
      font-size: 11.5px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }
    .btn-toggle-3d-cams:hover, .btn-toggle-3d-cams.active {
      color: #38bdf8;
      border-color: rgba(56, 189, 248, 0.4);
      background: rgba(56, 189, 248, 0.15);
    }
    .photo-grid-container {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 10px;
    }
    .photo-browser-card {
      background: #0f172a;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 10px;
      overflow: hidden;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      flex-direction: column;
      position: relative;
    }
    .photo-browser-card:hover {
      border-color: #38bdf8;
      transform: translateY(-3px);
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    }
    .photo-card-img-wrap {
      width: 100%;
      aspect-ratio: 3 / 2;
      background: #000;
      position: relative;
      overflow: hidden;
    }
    .photo-card-img-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.3s;
    }
    .photo-browser-card:hover .photo-card-img-wrap img {
      transform: scale(1.05);
    }
    .photo-card-meta {
      padding: 6px 8px;
      display: flex;
      flex-direction: column;
      gap: 3px;
      background: rgba(15, 23, 42, 0.95);
    }
    .photo-card-idx-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
    }
    .photo-card-num {
      font-weight: 800;
      color: #fff;
      font-family: 'JetBrains Mono', monospace;
    }
    .photo-card-alt {
      font-size: 10px;
      color: #38bdf8;
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
    }
    .photo-card-badge-row {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-wrap: wrap;
    }
    .photo-badge-floor {
      font-size: 9px;
      padding: 1px 4px;
      border-radius: 4px;
      background: rgba(168, 85, 247, 0.2);
      color: #c084fc;
      border: 1px solid rgba(168, 85, 247, 0.3);
      font-weight: 700;
    }
    .photo-badge-cardinal {
      font-size: 9px;
      padding: 1px 4px;
      border-radius: 4px;
      background: rgba(234, 179, 8, 0.15);
      color: #fde047;
      border: 1px solid rgba(234, 179, 8, 0.25);
      font-weight: 700;
    }
    .photo-badge-obs {
      font-size: 9px;
      padding: 1px 4px;
      border-radius: 4px;
      background: rgba(239, 68, 68, 0.2);
      color: #fca5a5;
      border: 1px solid rgba(239, 68, 68, 0.3);
      font-weight: 700;
    }
    .dz-btn-floor-step {
      background: rgba(168, 85, 247, 0.18) !important;
      border-color: rgba(168, 85, 247, 0.4) !important;
      color: #d8b4fe !important;
    }
    .dz-btn-floor-step:hover {
      background: rgba(168, 85, 247, 0.3) !important;
      color: #fff !important;
    }

    .panel-content {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    /* Observation List (Default View) */
    .obs-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .obs-card {
      background: linear-gradient(180deg, #131d2e 0%, #0d1522 100%);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 12px;
      padding: 12px 14px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      gap: 12px;
      align-items: center;
      position: relative;
    }

    .obs-card:hover {
      border-color: rgba(56, 189, 248, 0.35);
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }

    .obs-card.active {
      border-color: var(--dm-blue);
      background: linear-gradient(180deg, rgba(2, 132, 199, 0.18) 0%, rgba(13, 21, 34, 0.95) 100%);
      box-shadow: 0 0 0 1px var(--dm-blue), 0 4px 16px rgba(2, 132, 199, 0.25);
    }

    .obs-card-num {
      width: 26px;
      height: 26px;
      border-radius: 8px;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 12px;
      flex-shrink: 0;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    }

    .obs-card-body {
      flex: 1;
      min-width: 0;
    }

    .obs-card-title {
      font-size: 14.5px;
      font-weight: 700;
      color: #f8fafc;
      margin-bottom: 3px;
      line-height: 1.3;
      text-transform: capitalize;
    }

    .obs-card-cat {
      font-size: 11.5px;
      color: #94a3b8;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .obs-card-thumb {
      width: 58px;
      height: 58px;
      border-radius: 10px;
      object-fit: cover;
      border: 1px solid rgba(255, 255, 255, 0.12);
      flex-shrink: 0;
      background: #000;
    }

    .obs-card-thumb-wrap {
      position: relative;
      width: 58px;
      height: 58px;
      border-radius: 10px;
      overflow: hidden;
      flex-shrink: 0;
      background: #090d16;
      border: 1px solid rgba(255, 255, 255, 0.15);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    }

    .obs-card-thumb-wrap img {
      display: block;
      pointer-events: none;
    }

    .thumb-reticle-dot {
      position: absolute;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      border: 1.5px solid #ef4444;
      background: rgba(239, 68, 68, 0.55);
      box-shadow: 0 0 6px rgba(239, 68, 68, 0.95);
      transform: translate(-50%, -50%);
      pointer-events: none;
      z-index: 2;
    }

    .mob-banner-thumb-inner {
      position: relative;
      width: 44px;
      height: 44px;
      border-radius: 8px;
      overflow: hidden;
      flex-shrink: 0;
      background: #090d16;
      border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .photo-stage-thumb-wrap {
      position: relative;
      width: 100%;
      height: 100%;
      overflow: hidden;
      border-radius: 6px;
      background: #090d16;
    }

    /* Active Observation Detail View */
    .obs-detail {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .obs-detail-badge-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
    }

    .badge-severity {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.3px;
      padding: 3px 9px;
      border-radius: 9999px;
      white-space: nowrap;
      line-height: 1.2;
    }

    .badge-severity .sev-dot {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .badge-category {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 11.5px;
      font-weight: 600;
      color: #cbd5e1;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.12);
      padding: 3px 10px;
      border-radius: 9999px;
    }

    .obs-detail-title {
      font-size: 18px;
      font-weight: 800;
      color: #fff;
      line-height: 1.3;
    }

    /* Ultra-HD Photo Stage */
    .photo-stage-card {
      background: #000;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .photo-stage-main {
      position: relative;
      height: 220px;
      background: #030712;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: zoom-in;
    }

    .photo-stage-main img {
      max-width: 100%;
      max-height: 100%;
      object-fit: cover;
      transition: transform 0.2s;
    }

    .photo-stage-main:hover img {
      transform: scale(1.02);
    }

    .photo-stage-tag {
      position: absolute;
      top: 10px;
      left: 10px;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(6px);
      padding: 4px 8px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 700;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .photo-stage-expand {
      position: absolute;
      bottom: 10px;
      right: 10px;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(6px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #fff;
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
    }

    .photo-stage-thumbs {
      display: flex;
      gap: 8px;
      padding: 10px;
      background: #090d16;
      overflow-x: auto;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .photo-stage-thumb-item {
      position: relative !important;
      width: 52px;
      height: 38px;
      border-radius: 8px;
      overflow: hidden;
      cursor: pointer;
      opacity: 0.65;
      border: 1.5px solid transparent;
      flex-shrink: 0;
      transition: all 0.15s ease;
    }

    .photo-stage-thumb-item.active {
      opacity: 1;
      border-color: var(--dm-blue);
      box-shadow: 0 0 8px rgba(2, 132, 199, 0.45);
    }

    .photo-stage-thumb-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    /* Text info cards */
    .info-card {
      background: var(--dm-card-bg);
      border: 1px solid var(--dm-card-border);
      border-radius: 10px;
      padding: 14px;
    }

    .info-card-label {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--dm-text-muted);
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .info-card-text {
      font-size: 13px;
      line-height: 1.5;
      color: #f1f5f9;
    }

    .info-card.rec {
      border-left: 3px solid var(--dm-high);
      background: rgba(249, 115, 22, 0.06);
    }

    /* Guided Tour Bottom Controls */
    .tour-nav-bar {
      padding: 14px 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(15, 23, 42, 0.95);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .btn-tour-nav {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #fff;
      padding: 10px 16px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s;
    }

    .btn-tour-nav:hover {
      background: rgba(255, 255, 255, 0.18);
    }

    .btn-tour-nav.primary {
      background: var(--dm-blue);
      border-color: var(--dm-blue);
    }
    .btn-tour-nav.primary:hover {
      background: var(--dm-blue-hover);
    }

    .tour-counter-text {
      font-size: 12px;
      font-weight: 700;
      color: var(--dm-text-muted);
      font-family: 'JetBrains Mono', monospace;
    }

    /* Deep Zoom Modal */
    .modal-deepzoom {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0, 0, 0, 0.95);
      z-index: 200000;
      display: none;
      flex-direction: column;
    }

    .deepzoom-bar {
      height: 56px;
      padding: 0 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      background: rgba(18, 18, 20, 0.92);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      z-index: 10;
    }

    .deepzoom-title-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      flex: 1;
    }

    .deepzoom-title {
      font-weight: 700;
      font-size: 14px;
      color: #fff;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .deepzoom-badge {
      background: rgba(255, 255, 255, 0.12);
      color: #94a3b8;
      font-size: 11px;
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 10px;
      white-space: nowrap;
    }

    .deepzoom-controls {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-shrink: 0;
    }

    .deepzoom-btn {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #fff;
      border-radius: 8px;
      padding: 6px 12px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: all 0.15s ease;
      touch-action: manipulation;
    }

    .deepzoom-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      border-color: rgba(255, 255, 255, 0.3);
    }

    .deepzoom-btn.danger {
      background: rgba(239, 68, 68, 0.15);
      border-color: rgba(239, 68, 68, 0.3);
      color: #f87171;
    }

    .deepzoom-btn.danger:hover {
      background: rgba(239, 68, 68, 0.25);
    }

    .deepzoom-stage {
      flex: 1;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      cursor: grab;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
      background: #0a0a0c;
    }

    .deepzoom-stage.grabbing {
      cursor: grabbing;
    }

    #deepzoom-canvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: block;
      touch-action: none;
    }

    .photo-pin-marker {
      position: absolute;
      transform: translate(-50%, -50%);
      pointer-events: none;
      z-index: 25;
      display: flex;
      flex-direction: column;
      align-items: center;
      transition: opacity 0.2s ease;
    }

    .photo-pin-target {
      width: 26px;
      height: 26px;
      border: 2px solid #ef4444;
      border-radius: 50%;
      box-shadow: 0 0 10px rgba(239, 68, 68, 0.85), inset 0 0 6px rgba(239, 68, 68, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(239, 68, 68, 0.18);
      animation: pulse-pin 2s infinite ease-in-out;
    }

    .photo-pin-target::after {
      content: '';
      width: 6px;
      height: 6px;
      background: #ef4444;
      border-radius: 50%;
      box-shadow: 0 0 6px #fff;
    }

    .photo-pin-label {
      margin-top: 3px;
      background: rgba(15, 23, 42, 0.88);
      border: 1px solid rgba(239, 68, 68, 0.6);
      color: #fecaca;
      font-size: 10px;
      font-weight: 700;
      padding: 1px 6px;
      border-radius: 4px;
      white-space: nowrap;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    @keyframes pulse-pin {
      0%, 100% { transform: scale(1); opacity: 0.9; }
      50% { transform: scale(1.18); opacity: 1; }
    }

    .deepzoom-hint {
      position: absolute;
      bottom: 16px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #cbd5e1;
      font-size: 11px;
      padding: 6px 14px;
      border-radius: 20px;
      pointer-events: none;
      z-index: 10;
      display: flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    }

    .deepzoom-nav-btn {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: rgba(15, 23, 42, 0.78);
      backdrop-filter: blur(12px);
      border: 1px solid rgba(255, 255, 255, 0.22);
      color: #fff;
      font-size: 18px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 100;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
      touch-action: manipulation;
    }
    .deepzoom-nav-btn:hover {
      background: rgba(56, 189, 248, 0.3);
      border-color: var(--dm-blue);
      color: #38bdf8;
      transform: translateY(-50%) scale(1.1);
    }
    .deepzoom-nav-btn.prev {
      left: 20px;
    }
    .deepzoom-nav-btn.next {
      right: 20px;
    }

    .thumb-idx {
      position: absolute;
      bottom: 2px;
      right: 2px;
      background: rgba(0, 0, 0, 0.82);
      color: #fff;
      font-size: 9px;
      font-weight: 800;
      padding: 1px 4px;
      border-radius: 4px;
      line-height: 1;
      pointer-events: none;
      backdrop-filter: blur(2px);
    }

    /* Mid widths (e.g. the embedded demo iframe): drop the title and button
       labels so the badges and controls fit on one row without overlapping. */
    @media (max-width: 1280px) {
      .deepzoom-title {
        display: none;
      }
      .deepzoom-title-wrap {
        overflow: hidden;
      }
      .deepzoom-btn span {
        display: none;
      }
    }

    @media (max-width: 860px) {
      .deepzoom-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
      }
      .deepzoom-nav-btn.prev {
        left: 8px;
      }
      .deepzoom-nav-btn.next {
        right: 8px;
      }
      .deepzoom-bar {
        padding: 0 8px !important;
        height: 44px !important;
        gap: 4px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
      }
      .deepzoom-title {
        display: none !important;
      }
      .dz-btn-hide-mobile,
      #deepzoom-zoom-badge,
      #deepzoom-cardinal-badge {
        display: none !important;
      }
      .deepzoom-title-wrap {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
      }
      #deepzoom-photo-counter {
        font-size: 10px !important;
        padding: 2px 6px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
      }
      #deepzoom-floor-badge {
        font-size: 10px !important;
        padding: 2px 6px !important;
        max-width: 100px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }
      .deepzoom-controls {
        gap: 3px !important;
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
      }
      .deepzoom-btn {
        padding: 4px 6px !important;
        font-size: 11px !important;
        height: 30px !important;
        min-width: 28px !important;
      }
      .deepzoom-btn span,
      .deepzoom-btn b {
        display: none !important;
      }
      .deepzoom-btn#btn-deepzoom-1to1 {
        padding: 4px 7px !important;
      }
      .deepzoom-btn#btn-deepzoom-1to1 b {
        display: inline !important;
        font-size: 11px !important;
      }
      .deepzoom-btn.danger {
        padding: 4px 8px !important;
      }
      .deepzoom-btn.danger span {
        display: none !important;
      }
      .deepzoom-hint {
        font-size: 10px !important;
        padding: 3px 8px !important;
        bottom: 8px !important;
      }
    }

    /* New Observation Modal */
    .modal-new-obs {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(8px);
      z-index: 200000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
    }

    .modal-box {
      background: #182234;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 14px;
      width: 100%;
      max-width: 560px;
      max-height: 90vh;
      overflow-y: auto;
      padding: 24px;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    }

    .form-group {
      margin-bottom: 14px;
    }

    .form-group label {
      display: block;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: #94a3b8;
      margin-bottom: 6px;
    }

    .form-group input, .form-group select, .form-group textarea {
      width: 100%;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #fff;
      padding: 10px 12px;
      border-radius: 8px;
      font-family: inherit;
      font-size: 14px;
      outline: none;
    }

    .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
      border-color: var(--dm-blue);
      background: rgba(255, 255, 255, 0.1);
    }

    .form-group select {
      color-scheme: dark;
    }

    .form-group select option {
      background: #182234;
      color: #f8fafc;
    }

    .form-group input[type="file"] {
      color-scheme: dark;
      color: var(--dm-text-muted);
    }

    .form-group input[type="file"]::file-selector-button {
      background: #25344b;
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 6px;
      color: #f8fafc;
      font: inherit;
      margin-right: 10px;
      padding: 5px 9px;
      cursor: pointer;
    }

    .form-group input[type="file"]::file-selector-button:hover {
      background: #334761;
    }

    /* Toast Notification */
    #inspect-toast {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%) translateY(40px);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      background: #0f172a;
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #fff;
      padding: 10px 22px;
      border-radius: 30px;
      font-size: 13px;
      font-weight: 700;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
      z-index: 300000;
      transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s;
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
    }

    #inspect-toast.show {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    /* Mobile Tab Bar (Hidden on desktop) */
    .mobile-tab-bar {
      display: none;
    }

    .mobile-obs-banner {
      display: none;
    }

    .mobile-list-header-tools {
      display: none;
    }

    /* Mobile Responsive */
    @media (max-width: 860px) {
      html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
      }

      /* Compact single-row header (48px) */
      .inspect-header {
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 0 10px !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
      }

      .brand-section {
        min-width: 0;
        flex: 1;
        gap: 6px;
        align-items: center;
      }

      .brand-badge img {
        height: 20px;
      }

      .brand-tag {
        font-size: 8px;
        padding: 2px 4px;
      }

      .project-info {
        padding-left: 6px;
        min-width: 0;
        flex: 1;
      }

      .project-title {
        font-size: 14px !important;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 110px) !important;
      }

      .project-sub {
        display: none !important;
      }

      /* Hide stats pills from header on mobile - they belong in Havainnot tab! */
      .inspect-header .stats-pills {
        display: none !important;
      }

      /* Clean mobile header: single hamburger menu button */
      .header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
      }

      /* Hide individual action buttons and user badge on mobile header (they live in the mobile menu) */
      .header-actions .btn-hdr:not(.btn-mobile-menu-trigger),
      .user-pill-wrap {
        display: none !important;
      }

      /* Show only mobile hamburger menu trigger button */
      .header-actions .btn-mobile-menu-trigger {
        display: inline-flex !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        padding: 0 !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.16) !important;
        color: #fff !important;
        border-radius: 9px !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 16px !important;
        cursor: pointer !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
        transition: all 0.15s !important;
      }

      .header-actions .btn-mobile-menu-trigger:active {
        background: rgba(255, 255, 255, 0.2) !important;
        transform: scale(0.95);
      }

      /* Top Toast on Mobile (does not cover 3D bottom, completely hidden when inactive) */
      #inspect-toast {
        top: 54px !important;
        bottom: auto !important;
        transform: translateX(-50%) translateY(-35px) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        max-width: 90vw !important;
        white-space: nowrap !important;
        font-size: 12px !important;
        padding: 8px 16px !important;
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s !important;
      }
      #inspect-toast.show {
        transform: translateX(-50%) translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
      }

      /* Sleek mobile tab bar */
      .mobile-tab-bar {
        display: flex !important;
        width: 100% !important;
        max-width: 100vw !important;
        background: #090e1a !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        z-index: 200;
        flex-shrink: 0;
        box-sizing: border-box !important;
      }

      .mobile-tab-btn {
        flex: 1;
        background: transparent;
        border: none;
        color: #94a3b8;
        font-size: 12px !important;
        font-weight: 700 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
        border-bottom: 2.5px solid transparent;
        transition: all 0.2s;
      }

      .mobile-tab-btn.active {
        color: #fff !important;
        border-bottom-color: var(--dm-blue) !important;
        background: rgba(2, 132, 199, 0.12) !important;
      }

      /* Maximize 3D viewport area */
      .inspect-workspace {
        width: 100% !important;
        max-width: 100vw !important;
        height: calc(100% - 48px - 38px) !important;
        flex-direction: column !important;
        position: relative !important;
        flex: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
      }

      .viewer-area {
        width: 100% !important;
        height: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        flex: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
      }

      #potree_container,
      #potree_render_area {
        width: 100% !important;
        height: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
      }

      .inspect-panel {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        border-left: none !important;
      }

      /* Tab Switching on Mobile */
      .workspace-tab-3d .inspect-panel {
        display: none !important;
      }
      .workspace-tab-3d .viewer-area {
        display: block !important;
      }

      .workspace-tab-list .viewer-area,
      .workspace-tab-photos .viewer-area {
        display: none !important;
      }
      .workspace-tab-list .inspect-panel,
      .workspace-tab-photos .inspect-panel {
        display: flex !important;
      }

      /* Floating controls in 3D: compact and elegant */
      .view-mode-bar {
        top: 10px !important;
        left: 10px !important;
        padding: 3px !important;
        gap: 3px !important;
        background: rgba(15, 23, 42, 0.88) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        border-radius: 10px !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
      }

      .btn-mode-toggle {
        padding: 5px 9px !important;
        font-size: 11px !important;
        gap: 4px !important;
        border-radius: 7px !important;
      }

      .btn-mode-toggle span {
        display: inline !important;
      }

      #btn-mode-both {
        display: none !important;
      }

      #btn-add-pin-floating {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 5px 9px !important;
        font-size: 11px !important;
        border-radius: 7px !important;
        background: rgba(34, 197, 94, 0.22) !important;
        color: #86efac !important;
        border: 1px solid rgba(34, 197, 94, 0.55) !important;
        font-weight: 700 !important;
      }

      #btn-add-pin-floating span {
        display: inline !important;
      }

      #btn-measure-floating {
        display: none !important;
      }

      .mode-bar-divider {
        height: 14px !important;
        margin: 0 3px !important;
      }

      /* Pin Active Banner on mobile: perfectly scaled and positioned below orientation bar */
      .pin-active-banner {
        top: 86px !important;
        width: calc(100vw - 20px) !important;
        max-width: 360px !important;
        padding: 7px 12px !important;
        font-size: 11px !important;
        gap: 8px !important;
        border-radius: 20px !important;
        box-sizing: border-box !important;
      }

      .pin-active-banner span {
        white-space: normal !important;
        line-height: 1.3 !important;
      }

      .btn-cancel-pin {
        padding: 3px 8px !important;
        font-size: 10px !important;
        white-space: nowrap !important;
      }

      /* Orientation presets bar on mobile: clean second row below mode bar without any overlap */
      .view-orientation-bar {
        top: 48px !important;
        left: 10px !important;
        right: auto !important;
        padding: 3px !important;
        gap: 3px !important;
        max-width: calc(100vw - 20px) !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        background: rgba(15, 23, 42, 0.88) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
        z-index: 80 !important;
      }

      .view-orientation-bar::-webkit-scrollbar {
        display: none;
      }

      .btn-orient {
        padding: 4px 8px !important;
        font-size: 10.5px !important;
        flex-shrink: 0 !important;
      }

      /* CRITICAL: HIDE bottom filter bar in 3D view on mobile so it DOES NOT block pins! */
      .viewer-area .filter-bar {
        display: none !important;
      }

      /* Compact floating 3D control hint on mobile */
      .control-hint-pill {
        bottom: 12px !important;
        left: 10px !important;
        right: auto !important;
        max-width: calc(100vw - 20px) !important;
        padding: 5px 10px !important;
        gap: 6px !important;
        border-radius: 14px !important;
      }
      .mobile-obs-banner.active ~ .control-hint-pill {
        display: none !important;
      }

      /* Sleek floating Bottom Sheet Card for selected observation in 3D */
      .mobile-obs-banner {
        display: none !important;
      }

      .mobile-obs-banner.active {
        display: flex !important;
        position: absolute !important;
        bottom: 12px !important;
        left: 10px !important;
        right: 10px !important;
        background: rgba(15, 23, 42, 0.94) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 14px !important;
        padding: 10px 14px !important;
        flex-direction: column !important;
        gap: 8px !important;
        z-index: 120 !important;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7) !important;
        animation: slideUpMobileCard 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      }

      @keyframes slideUpMobileCard {
        from { transform: translateY(20px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
      }

      .mob-banner-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }

      .mob-banner-title-row {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1;
      }

      .mob-banner-thumb {
        width: 44px;
        height: 44px;
        border-radius: 8px;
        object-fit: cover;
        border: 1px solid rgba(255, 255, 255, 0.15);
        flex-shrink: 0;
      }

      .mob-banner-close-btn {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: #94a3b8;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 12px;
        flex-shrink: 0;
        transition: all 0.2s;
      }
      .mob-banner-close-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
      }

      .mob-banner-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-top: 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
      }

      .mob-banner-tour-btns {
        display: flex;
        align-items: center;
        gap: 6px;
      }

      .btn-mob-nav {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #cbd5e1;
        padding: 5px 10px;
        border-radius: 7px;
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
      }

      .btn-mob-view-info {
        background: var(--dm-blue) !important;
        border: none !important;
        color: #fff !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        padding: 6px 14px !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
      }

      /* Mobile List Tools (Tour button, Filters, Stats chips) */
      .mobile-list-header-tools {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 14px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      }

      .mobile-list-header-tools.hidden {
        display: none !important;
      }

      .btn-mobile-start-tour {
        background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
        color: #fff !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 10px !important;
        padding: 11px 16px !important;
        font-size: 13.5px !important;
        font-weight: 700 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 9px !important;
        cursor: pointer !important;
        box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35) !important;
        transition: all 0.2s ease !important;
        letter-spacing: 0.2px !important;
      }
      .btn-mobile-start-tour:active {
        transform: scale(0.98) !important;
        background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
      }
      .btn-mobile-start-tour i {
        font-size: 12px !important;
        color: #7dd3fc !important;
      }

      .mobile-filter-chips {
        display: flex !important;
        gap: 6px !important;
        overflow-x: auto !important;
        padding-bottom: 3px !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
      }
      .mobile-filter-chips::-webkit-scrollbar {
        display: none !important;
      }

      .mobile-filter-btn {
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        color: #94a3b8 !important;
        padding: 6px 12px !important;
        border-radius: 8px !important;
        font-size: 11.5px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
        transition: all 0.15s ease !important;
      }

      .mobile-filter-btn.active {
        background: rgba(2, 132, 199, 0.22) !important;
        color: #38bdf8 !important;
        border-color: rgba(2, 132, 199, 0.5) !important;
        box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2) !important;
      }

      .mobile-stats-row {
        display: flex !important;
        gap: 6px !important;
        overflow-x: auto !important;
        padding-bottom: 3px !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
      }
      .mobile-stats-row::-webkit-scrollbar {
        display: none !important;
      }

      .mobile-stats-row .stat-pill {
        flex-shrink: 0 !important;
        padding: 5px 10px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
      }

      .panel-content {
        padding: 12px 14px !important;
        gap: 14px !important;
      }

      .tour-nav-bar {
        padding: 10px 12px !important;
        gap: 8px !important;
        background: rgba(11, 15, 25, 0.95) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
      }

      .btn-tour-nav {
        padding: 8px 12px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
        gap: 5px !important;
      }

      .tour-counter-text {
        font-size: 11px !important;
      }

      /* Hide panel header add pin button on mobile */
      .inspect-panel .panel-header .btn-add-pin-action {
        display: none !important;
      }

      /* Measurement toolbar mobile responsiveness */
      .measure-toolbar {
        top: 48px !important;
        width: calc(100vw - 20px) !important;
        max-width: 360px !important;
        padding: 6px 10px !important;
        border-radius: 16px !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        gap: 6px !important;
      }
      .measure-mode-tabs {
        padding: 2px !important;
        gap: 1px !important;
      }
      .measure-tab-btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
      }
      .measure-status-text {
        font-size: 11px !important;
        width: 100% !important;
        text-align: center !important;
      }
    }

    /* --- Report Modal & Print Styling --- */
    .modal-report {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(10, 15, 29, 0.94);
      backdrop-filter: blur(12px);
      z-index: 1200;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .report-toolbar {
      background: var(--dm-surface);
      border-bottom: 1px solid var(--dm-border);
      padding: 12px 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      flex-shrink: 0;
    }

    .report-toolbar-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .report-toolbar-title {
      font-weight: 800;
      font-size: 15px;
      color: #fff;
    }

    .report-badge-count {
      background: rgba(3, 169, 244, 0.15);
      color: var(--dm-blue);
      border: 1px solid rgba(3, 169, 244, 0.3);
      padding: 3px 10px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 700;
    }

    .report-toolbar-header-row {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .btn-rep-action,
    .btn-rep-close {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 12.5px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      border: 1px solid transparent;
      white-space: nowrap;
    }

    .btn-rep-print {
      background: var(--dm-blue);
      color: #fff;
      border-color: var(--dm-blue);
    }
    .btn-rep-print:hover {
      background: var(--dm-blue-hover);
    }

    .btn-rep-server {
      background: rgba(255, 255, 255, 0.08);
      color: #fff;
      border-color: rgba(255, 255, 255, 0.15);
    }
    .btn-rep-server:hover {
      background: rgba(255, 255, 255, 0.16);
    }

    .btn-rep-close {
      background: rgba(239, 68, 68, 0.12);
      color: #fca5a5;
      border-color: rgba(239, 68, 68, 0.25);
    }
    .btn-rep-close:hover {
      background: rgba(239, 68, 68, 0.25);
      color: #fff;
    }

    .report-toolbar-actions-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .report-scroll-container {
      flex: 1;
      overflow-y: auto;
      padding: 30px 20px;
      display: block;
      background: #090d16;
    }

    #report-printable-area {
      display: block;
      width: 100%;
      max-width: 860px;
      margin: 0 auto;
    }

    .report-page {
      width: 100%;
      max-width: 860px;
      min-height: 1120px;
      background: #ffffff;
      color: #0f172a;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
      border-radius: 6px;
      padding: 44px;
      margin-bottom: 32px;
      box-sizing: border-box;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
      display: flex;
      flex-direction: column;
    }

    .rep-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      border-bottom: 2px solid #002b49;
      padding-bottom: 16px;
      margin-bottom: 20px;
    }

    .rep-logo-area {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .rep-logo-img {
      max-height: 44px;
      width: auto;
      object-fit: contain;
    }

    .rep-logo-fallback {
      font-size: 20px;
      font-weight: 900;
      color: #002b49;
      letter-spacing: -0.5px;
    }

    .rep-logo-fallback span {
      color: var(--dm-blue);
    }

    .rep-header-meta {
      text-align: right;
    }

    .rep-doc-title {
      font-size: 18px;
      font-weight: 800;
      color: #002b49;
      letter-spacing: 0.5px;
    }

    .rep-doc-sub {
      font-size: 12px;
      color: #64748b;
      margin-top: 2px;
    }

    .rep-doc-date {
      font-size: 11px;
      color: #334155;
      margin-top: 6px;
    }

    .rep-meta-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      padding: 16px 20px;
      margin-bottom: 24px;
    }

    .rep-meta-item {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .rep-meta-label {
      font-size: 11px;
      font-weight: 700;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .rep-meta-val {
      font-size: 13px;
      font-weight: 700;
      color: #0f172a;
    }

    .rep-scope-note {
      background: #eff6ff;
      border-left: 3px solid #0284c7;
      color: #334155;
      font-size: 11px;
      line-height: 1.5;
      margin: -8px 0 20px;
      padding: 9px 12px;
    }

    .rep-section-title {
      font-size: 13px;
      font-weight: 800;
      color: #002b49;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
      border-left: 3px solid var(--dm-blue);
      padding-left: 8px;
    }

    .rep-stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 24px;
    }

    .rep-stat-box {
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      padding: 12px;
      text-align: center;
      background: #ffffff;
    }

    .rep-stat-box.crit { border-top: 4px solid #ef4444; background: #fff5f5; }
    .rep-stat-box.high { border-top: 4px solid #f97316; background: #fffaf0; }
    .rep-stat-box.med { border-top: 4px solid #eab308; background: #fefce8; }
    .rep-stat-box.low { border-top: 4px solid #10b981; background: #f0fdf4; }

    .rep-stat-num {
      font-size: 24px;
      font-weight: 800;
      line-height: 1;
      margin-bottom: 4px;
      color: #0f172a;
    }

    .rep-stat-txt {
      font-size: 11px;
      font-weight: 700;
      color: #475569;
      line-height: 1.2;
    }

    .rep-stat-txt small {
      font-size: 9px;
      font-weight: 500;
      color: #64748b;
    }

    .rep-snapshot-box {
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 24px;
      background: #0a101d;
    }

    .rep-snapshot-img {
      width: 100%;
      height: 340px;
      object-fit: contain;
      display: block;
      background: #0a101d;
    }

    .rep-snapshot-caption {
      padding: 6px 12px;
      font-size: 11px;
      color: #64748b;
      background: #f8fafc;
      border-top: 1px solid #e2e8f0;
      font-style: italic;
    }

    .rep-closeup-box {
      margin-bottom: 12px;
    }

    .rep-closeup-img {
      width: 100%;
      height: 300px;
      object-fit: cover;
      display: block;
      background: #0a101d;
    }

    .rep-photos-grid.compact .rep-photo-img-wrap {
      height: 190px;
    }

    .rep-closeup-box.small .rep-closeup-img {
      height: 200px;
    }

    .rep-photos-grid.single.crops .rep-photo-img-wrap,
    .rep-photos-grid.two-col.crops .rep-photo-img-wrap {
      height: 220px;
    }

    .rep-crop-img {
      object-fit: cover;
    }

    .rep-table-wrap {
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin-bottom: 24px;
    }

    .rep-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      margin-bottom: 0;
    }

    .rep-table th {
      background: #002b49;
      color: #ffffff;
      padding: 8px 10px;
      text-align: left;
      font-weight: 700;
      font-size: 11px;
    }

    .rep-table td {
      padding: 8px 10px;
      border-bottom: 1px solid #e2e8f0;
      color: #1e293b;
      vertical-align: top;
    }

    .rep-table tr:nth-child(even) td {
      background: #f8fafc;
    }

    .rep-pill {
      display: inline-block;
      padding: 3px 8px;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.3px;
    }

    .rep-crit { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
    .rep-high { background: #ffedd5; color: #c2410c; border: 1px solid #fdba74; }
    .rep-med { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
    .rep-low { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

    .rep-subpage-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #002b49;
      color: #ffffff;
      padding: 8px 14px;
      border-radius: 6px;
      margin-bottom: 16px;
      font-size: 11px;
    }

    .rep-subpage-title {
      font-weight: 700;
      letter-spacing: 0.3px;
    }

    .rep-subpage-meta {
      opacity: 0.8;
      font-size: 10px;
    }

    .rep-obs-header {
      display: flex;
      align-items: center;
      gap: 12px;
      padding-bottom: 12px;
      border-bottom: 1px solid #e2e8f0;
      margin-bottom: 16px;
    }

    .rep-obs-num-tag {
      width: 32px;
      height: 32px;
      background: #002b49;
      color: #ffffff;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 15px;
      flex-shrink: 0;
    }

    .rep-obs-title {
      font-size: 15px;
      font-weight: 800;
      color: #0f172a;
    }

    .rep-obs-cat {
      font-size: 12px;
      color: #64748b;
      margin-top: 2px;
    }

    .rep-obs-details-grid {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 16px;
    }

    .rep-detail-block {
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      padding: 12px 14px;
      background: #ffffff;
    }

    .rep-detail-label {
      font-size: 10px;
      font-weight: 800;
      color: #475569;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 4px;
    }

    .rep-detail-text {
      font-size: 12px;
      line-height: 1.5;
      color: #1e293b;
    }

    .rep-photos-grid {
      display: grid;
      gap: 12px;
      margin-bottom: 20px;
    }

    .rep-photos-grid {
      display: grid;
      gap: 16px;
      margin-bottom: 24px;
    }

    .rep-photos-grid.single {
      grid-template-columns: 1fr;
    }

    .rep-photos-grid.single .rep-photo-img-wrap {
      height: 310px;
    }

    .rep-photos-grid.two-col {
      grid-template-columns: 1fr 1fr;
    }

    .rep-photos-grid.two-col .rep-photo-img-wrap {
      height: 310px;
    }

    .rep-photo-card {
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      overflow: hidden;
      background: #f8fafc;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
      display: flex;
      flex-direction: column;
      cursor: zoom-in;
    }

    .rep-photo-img-wrap {
      background: #e2e8f0;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .rep-photo-img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      transition: transform 0.2s ease;
    }

    .rep-photo-card:hover .rep-photo-img {
      transform: scale(1.02);
    }

    .rep-photo-caption {
      padding: 10px 14px;
      font-size: 12px;
      color: #334155;
      background: #ffffff;
      border-top: 1px solid #e2e8f0;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .rep-footer {
      border-top: 1px solid #e2e8f0;
      padding-top: 10px;
      margin-top: auto;
      display: flex;
      justify-content: space-between;
      font-size: 10px;
      color: #94a3b8;
    }

    /* Mobile Report Responsive Styling */
    @media (max-width: 860px) {
      .report-toolbar {
        padding: 10px 12px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        background: #090e1a !important;
      }

      .report-toolbar-header-row {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
      }

      .report-toolbar-left {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
      }

      .report-toolbar-title {
        font-size: 13px !important;
        font-weight: 800 !important;
        color: #fff !important;
        white-space: nowrap !important;
      }

      .report-badge-count {
        font-size: 10.5px !important;
        padding: 2px 6px !important;
      }

      .report-toolbar-actions-row {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
      }

      .btn-rep-action {
        flex: 1 1 50% !important;
        justify-content: center !important;
        padding: 9px 8px !important;
        font-size: 11.5px !important;
        height: 38px !important;
        border-radius: 8px !important;
        min-width: 0 !important;
      }

      .btn-rep-close {
        padding: 6px 12px !important;
        font-size: 12px !important;
        height: 32px !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
      }

      .report-scroll-container {
        padding: 12px 8px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
      }

      #report-printable-area {
        display: block !important;
        width: 100% !important;
        margin: 0 auto !important;
      }

      .report-page {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: auto !important;
        height: auto !important;
        flex-shrink: 0 !important;
        padding: 20px 14px !important;
        margin-bottom: 16px !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
      }

      .rep-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        margin-bottom: 14px !important;
        padding-bottom: 12px !important;
      }

      .rep-logo-fallback {
        font-size: 16px !important;
      }

      .rep-header-meta {
        text-align: left !important;
      }

      .rep-doc-title {
        font-size: 15px !important;
        letter-spacing: 0.2px !important;
        word-break: break-word !important;
      }

      .rep-doc-sub {
        font-size: 11px !important;
      }

      .rep-doc-date {
        font-size: 10.5px !important;
        margin-top: 3px !important;
      }

      .rep-meta-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 12px 14px !important;
        margin-bottom: 16px !important;
      }

      .rep-meta-label {
        font-size: 10px !important;
      }

      .rep-meta-val {
        font-size: 12.5px !important;
      }

      .rep-scope-note {
        font-size: 10.5px !important;
        line-height: 1.4 !important;
        padding: 8px 10px !important;
        margin: 0 0 16px 0 !important;
      }

      .rep-section-title {
        font-size: 12px !important;
        margin-bottom: 10px !important;
      }

      .rep-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
      }

      .rep-stat-box {
        padding: 8px 6px !important;
      }

      .rep-stat-num {
        font-size: 20px !important;
        margin-bottom: 2px !important;
      }

      .rep-stat-txt {
        font-size: 10px !important;
      }

      .rep-stat-txt small {
        font-size: 8.5px !important;
      }

      .rep-snapshot-img {
        height: 220px !important;
        object-fit: contain !important;
      }

      .rep-table-wrap {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 16px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 6px !important;
      }

      .rep-table {
        min-width: 480px !important;
        margin-bottom: 0 !important;
        font-size: 11px !important;
      }

      .rep-subpage-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 3px !important;
        padding: 8px 10px !important;
      }

      .rep-subpage-title {
        font-size: 11px !important;
      }

      .rep-subpage-meta {
        font-size: 9.5px !important;
      }

      .rep-obs-header {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding-bottom: 10px !important;
        margin-bottom: 12px !important;
      }

      .rep-obs-title {
        font-size: 14px !important;
      }

      .rep-obs-cat {
        font-size: 11px !important;
      }

      .rep-photos-grid.two-col {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
      }

      .rep-photos-grid.single .rep-photo-img-wrap,
      .rep-photos-grid.two-col .rep-photo-img-wrap {
        height: 220px !important;
      }

      .rep-footer {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        font-size: 9.5px !important;
      }
    }

    /* Print Specific Rules */
    @media print {
      @page {
        size: A4 portrait;
        margin: 0;
      }

      *, *:before, *:after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }

      html, body {
        width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        overflow: visible !important;
        background: #ffffff !important;
        color: #000000 !important;
        display: block !important;
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
      }

      .inspect-header,
      .inspect-workspace,
      .mobile-tab-bar,
      #mobile-tab-bar,
      .mobile-obs-banner,
      #mobile-obs-banner,
      .modal-deepzoom,
      .modal-new-obs,
      #inspect-toast,
      .report-toolbar,
      .no-print {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
      }

      .modal-report {
        position: static !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        backdrop-filter: none !important;
      }

      .report-scroll-container {
        display: block !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        width: 100% !important;
        height: auto !important;
      }

      #report-printable-area {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 auto !important;
        padding: 0 !important;
      }

      .report-page {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 12mm 16mm !important;
        margin: 0 auto !important;
        width: 210mm !important;
        max-width: 210mm !important;
        min-height: 270mm !important;
        height: auto !important;
        box-sizing: border-box !important;
        color: #000000 !important;
        page-break-after: always !important;
        break-after: page !important;
        position: relative !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
      }

      .report-page:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
      }

      .report-page-break {
        page-break-after: always !important;
        break-after: page !important;
      }

      .report-page-break:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
      }

      .rep-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
      }

      .rep-header-meta {
        text-align: right !important;
      }

      .rep-meta-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 10px 14px !important;
        margin-bottom: 10px !important;
      }

      .rep-scope-note {
        font-size: 9.5px !important;
        padding: 6px 8px !important;
        margin-bottom: 10px !important;
      }

      .rep-section-title {
        font-size: 12.5px !important;
        margin-bottom: 8px !important;
      }

      .rep-stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
      }

      .rep-stat-box {
        padding: 6px !important;
      }

      .rep-snapshot-box {
        margin-bottom: 10px !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        background: #0a101d !important;
      }

      .rep-snapshot-img {
        width: 100% !important;
        height: 260px !important;
        max-height: 260px !important;
        object-fit: contain !important;
        display: block !important;
        background: #0a101d !important;
      }

      .rep-snapshot-caption {
        padding: 4px 8px !important;
        font-size: 9.5px !important;
      }

      .rep-closeup-img {
        height: 250px !important;
        max-height: 250px !important;
        object-fit: cover !important;
      }

      .rep-photos-grid.compact .rep-photo-img-wrap,
      .rep-photos-grid.compact .rep-photo-img {
        height: 140px !important;
        max-height: 140px !important;
      }

      .rep-closeup-box.small .rep-closeup-img {
        height: 180px !important;
        max-height: 180px !important;
      }

      .rep-photos-grid.crops .rep-photo-img-wrap,
      .rep-photos-grid.crops .rep-photo-img {
        height: 190px !important;
        max-height: 190px !important;
      }

      .rep-photos-grid.crops .rep-crop-img {
        object-fit: cover !important;
      }

      .rep-photos-grid {
        display: grid !important;
        gap: 12px !important;
        margin-bottom: 12px !important;
      }

      .rep-photos-grid.single {
        grid-template-columns: 1fr !important;
      }

      .rep-photos-grid.two-col {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
      }

      .rep-photo-card {
        display: block !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
        background: #ffffff !important;
        overflow: hidden !important;
        box-shadow: none !important;
      }

      .rep-photo-img-wrap {
        display: block !important;
        width: 100% !important;
        height: 195px !important;
        max-height: 195px !important;
        background: #0a101d !important;
        overflow: hidden !important;
        text-align: center !important;
      }

      .rep-photo-img {
        display: block !important;
        width: 100% !important;
        height: 195px !important;
        max-height: 195px !important;
        object-fit: contain !important;
        background: #0a101d !important;
      }

      .rep-photo-caption {
        padding: 5px 8px !important;
        font-size: 9.5px !important;
        background: #ffffff !important;
        color: #334155 !important;
        border-top: 1px solid #e2e8f0 !important;
        display: flex !important;
        align-items: center !important;
      }

      .rep-table-wrap {
        overflow: visible !important;
        border: none !important;
        margin-bottom: 14px !important;
      }

      .rep-table {
        min-width: 100% !important;
        font-size: 11px !important;
      }

      .rep-subpage-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 12px !important;
        margin-bottom: 12px !important;
      }

      .rep-subpage-title {
        font-size: 12px !important;
      }

      .rep-obs-header {
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        margin-bottom: 10px !important;
      }

      .rep-footer {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-top: auto !important;
        padding-top: 8px !important;
        border-top: 1px solid #e2e8f0 !important;
        font-size: 9.5px !important;
      }
    }

    /* Pin Placement Mode Styles */
    .btn-add-pin-action {
      background: rgba(34, 197, 94, 0.15) !important;
      color: #86efac !important;
      border: 1px solid rgba(34, 197, 94, 0.4) !important;
      font-weight: 700 !important;
    }
    .btn-add-pin-action:hover {
      background: rgba(34, 197, 94, 0.3) !important;
      color: #ffffff !important;
      border-color: rgba(34, 197, 94, 0.8) !important;
      box-shadow: 0 0 12px rgba(34, 197, 94, 0.35) !important;
    }

    .pin-active-banner {
      position: absolute;
      top: 64px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(10, 15, 29, 0.94);
      border: 2px solid var(--dm-accent);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(34, 197, 94, 0.3);
      border-radius: 30px;
      padding: 10px 22px;
      color: #fff;
      font-size: 13px;
      display: flex;
      align-items: center;
      gap: 16px;
      z-index: 200;
      animation: bannerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      backdrop-filter: blur(8px);
      pointer-events: auto;
    }

    @keyframes bannerSlideDown {
      from { opacity: 0; transform: translate(-50%, -15px); }
      to { opacity: 1; transform: translate(-50%, 0); }
    }

    .pin-pulse-dot {
      width: 10px;
      height: 10px;
      background: var(--dm-accent);
      border-radius: 50%;
      box-shadow: 0 0 10px var(--dm-accent);
      animation: pulseDot 1.2s infinite ease-in-out;
      flex-shrink: 0;
    }

    @keyframes pulseDot {
      0% { transform: scale(0.9); opacity: 0.8; }
      50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 16px var(--dm-accent); }
      100% { transform: scale(0.9); opacity: 0.8; }
    }

    .btn-cancel-pin {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #cbd5e1;
      padding: 4px 12px;
      border-radius: 14px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .btn-cancel-pin:hover {
      background: rgba(239, 68, 68, 0.3);
      color: #fff;
      border-color: #ef4444;
    }

    /* 3D Measurement Tool Styles */
    .btn-measure-action {
      background: rgba(6, 182, 212, 0.15) !important;
      color: #67e8f9 !important;
      border: 1px solid rgba(6, 182, 212, 0.4) !important;
      font-weight: 700 !important;
    }
    .btn-measure-action:hover, .btn-measure-action.active {
      background: rgba(6, 182, 212, 0.3) !important;
      color: #ffffff !important;
      border-color: rgba(6, 182, 212, 0.8) !important;
      box-shadow: 0 0 12px rgba(6, 182, 212, 0.35) !important;
    }

    .measure-toolbar {
      position: absolute;
      top: 64px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(10, 25, 47, 0.95);
      border: 1.5px solid #06b6d4;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(6, 182, 212, 0.35);
      border-radius: 30px;
      padding: 6px 14px;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 12px;
      z-index: 200;
      animation: bannerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      backdrop-filter: blur(10px);
      pointer-events: auto;
    }

    .measure-mode-tabs {
      display: flex;
      background: rgba(255, 255, 255, 0.08);
      border-radius: 20px;
      padding: 3px;
      gap: 2px;
    }

    .measure-tab-btn {
      background: none;
      border: none;
      color: #94a3b8;
      padding: 5px 12px;
      border-radius: 16px;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s;
    }
    .measure-tab-btn:hover {
      color: #fff;
    }
    .measure-tab-btn.active {
      background: #06b6d4;
      color: #042f2e;
      box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
    }

    .measure-status-text {
      font-size: 12px;
      color: #e2e8f0;
      font-weight: 500;
      white-space: nowrap;
      padding: 0 4px;
    }

    .measure-actions {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .measure-action-btn {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #cbd5e1;
      padding: 5px 10px;
      border-radius: 14px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
    .measure-action-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      color: #fff;
    }
    .measure-action-btn.finish {
      background: rgba(34, 197, 94, 0.25);
      border-color: #22c55e;
      color: #86efac;
    }
    .measure-action-btn.finish:hover {
      background: #22c55e;
      color: #052e16;
    }
    .measure-action-btn.danger:hover {
      background: rgba(239, 68, 68, 0.3);
      border-color: #ef4444;
      color: #fca5a5;
    }

    /* 3D Measurement Badges */
    .dm-measure-badge {
      position: absolute;
      background: rgba(10, 25, 47, 0.94);
      border: 1.5px solid #06b6d4;
      border-radius: 8px;
      padding: 5px 10px;
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 12px rgba(6, 182, 212, 0.35);
      transform: translate(-50%, -100%);
      margin-top: -10px;
      color: #fff;
      white-space: nowrap;
      pointer-events: auto;
      display: flex;
      flex-direction: column;
      gap: 2px;
      transition: border-color 0.2s, box-shadow 0.2s;
      user-select: none;
      z-index: 100;
    }
    .dm-measure-badge:hover {
      border-color: #67e8f9;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 18px rgba(6, 182, 212, 0.55);
      z-index: 110;
    }
    .dm-measure-badge .badge-main {
      font-size: 13px;
      font-weight: 800;
      color: #67e8f9;
      font-family: 'JetBrains Mono', monospace;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .dm-measure-badge .badge-sub {
      font-size: 10px;
      color: #94a3b8;
      font-family: 'JetBrains Mono', monospace;
    }
    .dm-measure-badge .badge-actions {
      display: none;
      align-items: center;
      gap: 6px;
      margin-top: 4px;
      padding-top: 4px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    .dm-measure-badge:hover .badge-actions {
      display: flex;
    }
    .badge-btn {
      background: rgba(255, 255, 255, 0.12);
      border: none;
      border-radius: 4px;
      color: #cbd5e1;
      padding: 2px 6px;
      font-size: 10px;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.15s;
    }
    .badge-btn:hover {
      background: #06b6d4;
      color: #042f2e;
    }
    .badge-btn.del:hover {
      background: #ef4444;
      color: #fff;
    }

    /* Live Cursor Tooltip */
    .measure-cursor-tooltip {
      position: absolute;
      pointer-events: none;
      background: rgba(15, 23, 42, 0.92);
      border: 1px solid #06b6d4;
      border-radius: 6px;
      padding: 3px 8px;
      font-size: 11px;
      font-family: 'JetBrains Mono', monospace;
      color: #67e8f9;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
      z-index: 150;
      transform: translate(12px, 12px);
      white-space: nowrap;
      display: none;
    }

    /* Measurements Tray */
    .measure-tray {
      position: absolute;
      bottom: 24px;
      right: 20px;
      background: rgba(10, 25, 47, 0.94);
      border: 1px solid rgba(6, 182, 212, 0.4);
      border-radius: 12px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
      width: 290px;
      max-height: 320px;
      display: flex;
      flex-direction: column;
      z-index: 120;
      backdrop-filter: blur(10px);
      overflow: hidden;
      animation: bannerSlideDown 0.25s ease-out;
    }
    .measure-tray-header {
      padding: 10px 14px;
      background: rgba(6, 182, 212, 0.12);
      border-bottom: 1px solid rgba(6, 182, 212, 0.25);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12px;
      font-weight: 700;
      color: #67e8f9;
    }
    .measure-tray-body {
      padding: 8px;
      overflow-y: auto;
      max-height: 220px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .measure-tray-item {
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      padding: 8px 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      transition: background 0.15s;
    }
    .measure-tray-item:hover {
      background: rgba(6, 182, 212, 0.08);
      border-color: rgba(6, 182, 212, 0.3);
    }
    .measure-tray-item-val {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 13px;
      color: #67e8f9;
    }
    .measure-tray-item-sub {
      font-size: 10px;
      color: #94a3b8;
      font-family: 'JetBrains Mono', monospace;
    }
    .measure-tray-actions {
      display: flex;
      gap: 4px;
    }
    .measure-tray-btn {
      background: none;
      border: none;
      color: #94a3b8;
      cursor: pointer;
      padding: 4px 6px;
      border-radius: 4px;
      font-size: 11px;
      transition: all 0.15s;
    }
    .measure-tray-btn:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.1);
    }
    .measure-tray-btn.del:hover {
      color: #ef4444;
      background: rgba(239, 68, 68, 0.15);
    }

    /* 3D Model Loading Overlay */
    .dm-3d-loader {
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at center, rgba(15, 23, 42, 0.92) 0%, rgba(2, 6, 23, 0.98) 100%);
      backdrop-filter: blur(12px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
    }
    .dm-loader-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding: 32px 40px;
      max-width: 380px;
      width: 90%;
      background: rgba(30, 41, 59, 0.6);
      border: 1px solid rgba(56, 189, 248, 0.25);
      border-radius: 20px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.15);
    }
    .dm-loader-spinner {
      position: relative;
      width: 72px;
      height: 72px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 20px;
    }
    .dm-pulse-ring {
      position: absolute;
      inset: 0;
      border: 3px solid transparent;
      border-top-color: #38bdf8;
      border-right-color: #0284c7;
      border-radius: 50%;
      animation: dmSpin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    }
    .dm-cube-icon {
      font-size: 26px;
      color: #38bdf8;
      animation: dmPulse 2s ease-in-out infinite;
    }
    @keyframes dmSpin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    @keyframes dmPulse {
      0%, 100% { transform: scale(0.9); opacity: 0.8; }
      50% { transform: scale(1.1); opacity: 1; }
    }
    .dm-loader-text {
      font-size: 16px;
      font-weight: 700;
      color: #f8fafc;
      letter-spacing: -0.2px;
      margin-bottom: 14px;
      font-family: 'Plus Jakarta Sans', sans-serif;
    }
    .dm-loader-progress-track {
      width: 100%;
      height: 6px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 999px;
      overflow: hidden;
      margin-bottom: 10px;
      position: relative;
    }
    .dm-loader-progress-bar {
      height: 100%;
      background: linear-gradient(90deg, #0284c7, #38bdf8, #67e8f9);
      border-radius: 999px;
      transition: width 0.15s ease-out;
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
    }
    .dm-loader-subtext {
      font-size: 12px;
      color: #94a3b8;
      font-family: 'JetBrains Mono', monospace;
    }

    /* DeepZoom Direct Photo Pinning & Multi-Pin Layer */
    .deepzoom-btn.dz-btn-pin-action {
      background: rgba(14, 165, 233, 0.16);
      border-color: rgba(56, 189, 248, 0.45);
      color: #38bdf8;
      font-weight: 700;
      transition: all 0.2s ease;
    }
    .deepzoom-btn.dz-btn-pin-action:hover {
      background: rgba(14, 165, 233, 0.28);
      border-color: #38bdf8;
      color: #fff;
    }
    .deepzoom-btn.dz-btn-pin-action.active {
      background: #0284c7 !important;
      border-color: #38bdf8 !important;
      color: #ffffff !important;
      box-shadow: 0 0 14px rgba(56, 189, 248, 0.6);
      animation: pulse-pin 1.6s infinite ease-in-out;
    }
    .deepzoom-stage.pinning-mode,
    .deepzoom-stage.pinning-mode canvas {
      cursor: crosshair !important;
    }

    .deepzoom-pin-banner {
      position: absolute;
      top: 14px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(15, 23, 42, 0.94);
      border: 1px solid rgba(56, 189, 248, 0.65);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.28);
      border-radius: 9999px;
      padding: 8px 18px;
      color: #f8fafc;
      font-size: 13px;
      font-weight: 500;
      z-index: 40;
      display: flex;
      align-items: center;
      gap: 14px;
      backdrop-filter: blur(12px);
      animation: dzSlideDown 0.22s ease-out;
    }
    @keyframes dzSlideDown {
      from { opacity: 0; transform: translate(-50%, -10px); }
      to { opacity: 1; transform: translate(-50%, 0); }
    }
    .deepzoom-pin-banner-content {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .deepzoom-pin-banner-content i {
      color: #38bdf8;
      font-size: 15px;
    }
    .deepzoom-pin-banner-cancel {
      background: rgba(239, 68, 68, 0.2);
      border: 1px solid rgba(239, 68, 68, 0.5);
      color: #fca5a5;
      border-radius: 9999px;
      padding: 4px 12px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.15s ease;
    }
    .deepzoom-pin-banner-cancel:hover {
      background: rgba(239, 68, 68, 0.4);
      color: #fff;
    }

    .deepzoom-pins-layer {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 24;
      overflow: hidden;
    }

    .dz-photo-pin {
      position: absolute;
      transform: translate(-50%, -50%);
      pointer-events: auto;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      transition: transform 0.12s ease;
    }
    .dz-photo-pin:hover {
      transform: translate(-50%, -50%) scale(1.18);
      z-index: 35 !important;
    }
    .dz-photo-pin-head {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 800;
      color: #fff;
      border: 2px solid rgba(255, 255, 255, 0.85);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
      position: relative;
    }
    .dz-photo-pin-head.critical {
      background: #ef4444;
      box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
    }
    .dz-photo-pin-head.high {
      background: #f97316;
      box-shadow: 0 0 12px rgba(249, 115, 22, 0.8);
    }
    .dz-photo-pin-head.medium {
      background: #eab308;
      box-shadow: 0 0 12px rgba(234, 179, 8, 0.8);
      color: #0f172a;
    }
    .dz-photo-pin-head.low {
      background: #06b6d4;
      box-shadow: 0 0 12px rgba(6, 182, 212, 0.8);
    }
    .dz-photo-pin.active .dz-photo-pin-head {
      border-color: #38bdf8;
      box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.45), 0 0 18px rgba(56, 189, 248, 0.9);
      animation: pulse-pin 1.6s infinite ease-in-out;
    }
    .dz-photo-pin-label {
      margin-top: 4px;
      background: rgba(15, 23, 42, 0.92);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 4px;
      padding: 2px 6px;
      font-size: 10px;
      font-weight: 700;
      color: #f8fafc;
      white-space: nowrap;
      max-width: 140px;
      overflow: hidden;
      text-overflow: ellipsis;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
      pointer-events: none;
    }

    /* --- Phone ergonomics: larger tap targets, visible-viewport units, 16px fields ---
       Additive overrides for the compact layout above; desktop is untouched. */
    @media screen and (max-width: 860px) {
      /* Full-screen layers follow the visible viewport; 100vh is taller than it while iOS shows its toolbar */
      .modal-deepzoom,
      .modal-new-obs,
      .modal-report {
        height: 100dvh;
      }

      /* Header menu button and tab bar reach 44px (the workspace height below accounts for the taller tab bar) */
      .header-actions .btn-mobile-menu-trigger {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
      }

      .mobile-tab-bar {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
      }

      .mobile-tab-btn {
        font-size: 13px !important;
      }

      .inspect-workspace {
        height: calc(100% - 48px - 44px) !important;
      }

      /* Small chips keep their look; an invisible padding makes the touch area 44px */
      .btn-mode-toggle,
      .hint-pill-btn-guide,
      .hint-pill-btn-close {
        position: relative;
      }

      .btn-mode-toggle::after,
      .hint-pill-btn-guide::after,
      .hint-pill-btn-close::after {
        content: '';
        position: absolute;
        inset: -10px -4px;
      }

      .hint-pill-btn-guide::after,
      .hint-pill-btn-close::after {
        inset: -12px -6px;
      }

      /* Photo viewer and report toolbars */
      .deepzoom-btn {
        height: 44px !important;
      }

      .deepzoom-nav-btn {
        width: 44px;
        height: 44px;
      }

      .btn-rep-action {
        height: 44px !important;
      }

      .btn-rep-close {
        height: 44px !important;
      }

      /* 16px text keeps iOS Safari from zooming the page when a field gets focus */
      body input:not([type='range'], [type='checkbox'], [type='radio'], [type='file'], [type='hidden']),
      body select,
      body textarea {
        font-size: 16px !important;
      }
    }
