/**
 * Map MTN - Stylesheet & Design System
 * Theme: Modern Enterprise Light GIS Theme (Clean, Crisp, High-Contrast)
 */

:root {
  --bg-main: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-cyan: #0284c7;
  --accent-blue: #2563eb;
  --accent-emerald: #16a34a;
  --accent-amber: #d97706;
  --accent-rose: #dc2626;
  --accent-purple: #7c3aed;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.brand-icon {
  font-size: 22px;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  text-transform: uppercase;
}

.area-badge {
  font-size: 12px;
  font-weight: 700;
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 3px 10px;
  border-radius: 12px;
}

.header-center {
  flex: 1;
  max-width: 480px;
  margin: 0 20px;
}

.search-bar-wrapper {
  position: relative;
  width: 100%;
}

.search-icon-pos {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  height: 36px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 12px 0 36px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.custom-search-pin {
  background: transparent !important;
  border: none !important;
}

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

.btn-header {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-header.primary {
  background: #0284c7;
  color: #ffffff;
  border: none;
}

.btn-header.primary:hover {
  background: #0369a1;
}

.btn-header.secondary {
  background: #f8fafc;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-header.secondary:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

/* App Body Layout */
.app-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  background: #e2e8f0;
}

/* Floating Sidebar Panels (Light Glassmorphic) */
.panel-left-otdr {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 380px;
  max-height: calc(100% - 28px);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 900;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.panel-right-layers {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 320px;
  max-height: calc(100% - 28px);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 900;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.panel-left-otdr.collapsed {
  transform: translateX(-410px);
  opacity: 0;
  pointer-events: none;
}

.panel-right-layers.collapsed {
  transform: translateX(350px);
  opacity: 0;
  pointer-events: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fafc;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-collapse {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
}

.btn-collapse:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.panel-body {
  padding: 8px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Floating HUD Open Buttons */
.floating-hud-btn {
  position: absolute;
  top: 14px;
  z-index: 850;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: none;
}

.floating-hud-btn.left { left: 14px; }
.floating-hud-btn.left.notes-btn { top: 54px; }
.floating-hud-btn.right { right: 14px; }

.floating-hud-btn:hover {
  background: #f8fafc;
  border-color: var(--accent-cyan);
}

/* Inputs & Form Elements */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.field-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.input-with-action {
  display: flex;
  gap: 5px;
}

/* Quickfilter Dropdown Component */
.quickfilter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

.quickfilter-item {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  font-size: 11px;
  transition: all 0.12s ease;
}

.quickfilter-item:hover,
.quickfilter-item.selected {
  background: #f0f9ff;
  color: #0284c7;
}

.quickfilter-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quickfilter-item-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
}

.quickfilter-item-name {
  font-weight: 600;
  color: var(--text-primary);
}

.quickfilter-item-code {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #0284c7;
  font-weight: 700;
}

/* Search Clear Button */
.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 5;
}

.search-clear-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

/* Global Search Dropdown & Result Items */
.global-search-dropdown {
  min-width: 440px;
  max-width: 580px;
  max-height: 380px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  border: 1px solid #cbd5e1;
}

.search-results-header {
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.search-results-hint {
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
}

.search-empty-state {
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
}

.search-result-item {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background 0.12s ease;
}

.search-result-item:hover,
.search-result-item.selected {
  background: #f0f9ff;
}

.search-item-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: #f1f5f9;
}

.search-item-icon-wrapper.badge-customer {
  background: #e0f2fe;
}

.search-item-icon-wrapper.badge-joint {
  background: #fef3c7;
}

.search-item-icon-wrapper.badge-cable {
  background: #ecfeff;
}

.search-item-icon-wrapper.badge-node {
  background: #e0e7ff;
}

.search-item-icon-wrapper.badge-coordinate {
  background: #fee2e2;
}

.search-item-content {
  flex: 1;
  min-width: 0;
}

.search-item-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.search-item-title {
  font-weight: 700;
  font-size: 12.5px;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-item-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
  background: #f1f5f9;
  color: #64748b;
}

.search-item-tag.badge-customer {
  background: #e0f2fe;
  color: #0369a1;
}

.search-item-tag.badge-joint {
  background: #fef3c7;
  color: #b45309;
}

.search-item-tag.badge-cable {
  background: #cffafe;
  color: #0891b2;
}

.search-item-tag.badge-node {
  background: #e0e7ff;
  color: #4338ca;
}

.search-item-tag.badge-coordinate {
  background: #fee2e2;
  color: #b91c1c;
}

.search-item-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
  margin-top: 2px;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-highlight {
  color: #0284c7;
  font-weight: 700;
  background: rgba(2, 132, 199, 0.12);
  padding: 0 2px;
  border-radius: 3px;
}

.input-text {
  flex: 1;
  height: 28px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 0 8px;
  color: var(--text-primary);
  font-size: 11.5px;
  outline: none;
  font-family: inherit;
}

.input-text:focus {
  background: #ffffff;
  border-color: var(--accent-cyan);
}

.btn-pick {
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-pick.start {
  background: #16a34a;
  color: #fff;
}

.btn-pick.end {
  background: #dc2626;
  color: #fff;
}

.btn-pick.picking {
  background: #d97706;
  color: #fff;
  animation: pulse-border 1s infinite alternate;
}

@keyframes pulse-border {
  from { transform: scale(1); opacity: 0.85; }
  to { transform: scale(1.05); opacity: 1; }
}

.quick-presets {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.preset-chip {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
}

.preset-chip:hover {
  background: #e2e8f0;
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.route-recent-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: inherit;
}

.route-recent-chip:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0284c7;
  transform: translateY(-1px);
}

.btn-action-primary {
  height: 32px;
  background: #0284c7;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.25);
  transition: all 0.15s ease;
}

.btn-action-primary:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

/* OTDR Results Presentation */
.otdr-results-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-box {
  font-size: 10px;
  color: var(--text-secondary);
  padding: 4px 6px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 5px;
}

.cut-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 5px;
  padding: 5px 7px;
}

.cut-title {
  font-size: 11px;
  font-weight: 800;
  color: #b91c1c;
}

.cut-coords {
  font-size: 10.5px;
  color: var(--text-primary);
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-link {
  color: #0284c7;
  font-weight: 700;
  text-decoration: none;
  font-size: 10.5px;
}

.nav-link:hover {
  text-decoration: underline;
}

.joints-list-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.joint-item-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 5px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.joint-item-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.joint-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.joint-badge-before {
  background: #fef3c7;
  color: #b45309;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
}

.joint-badge-after {
  background: #dcfce7;
  color: #15803d;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

.btn-card-nav {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #64748b;
  border-radius: 3px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-card-nav:hover:not([disabled]) {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.joint-code-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  margin-left: 4px;
}

.joint-delta-text {
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.joint-card-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
}

/* Layer Switcher Rows */
.layer-section-title {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  padding: 10px 14px 4px 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-toggle-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  transition: all 0.15s ease;
  user-select: none;
}

.group-toggle-chip:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.group-toggle-chip.active {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #7dd3fc;
}

.layer-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.layer-toggle-row:hover {
  background: #f8fafc;
}

.layer-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer-name-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.layer-icon-badge {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.layer-icon-badge.cyan { background: #0284c7; color: #fff; }
.layer-icon-badge.purple { background: #6366f1; color: #fff; }

.maxi-name-chip {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}

.maxi-name-chip.active {
  background: #eab308;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(234, 179, 8, 0.4);
}

.maxi-name-chip.inactive {
  background: #e2e8f0;
  color: #94a3b8;
  border-color: #cbd5e1;
}

.maxi-name-chip:hover {
  transform: scale(1.08);
}

/* Maxi Toggle Switch Component */
.maxi-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.maxi-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.maxi-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .2s;
  border-radius: 20px;
}

.maxi-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .maxi-slider {
  background-color: #0284c7;
}

input:checked + .maxi-slider:before {
  transform: translateX(16px);
}

/* Clean Text-Only Tooltips (NO Background, NO Border) */
.leaflet-tooltip.maxi-permanent-label,
.leaflet-tooltip.otdr-cut-label,
.leaflet-tooltip.otdr-joint-label {
  background: transparent !important;
  color: #0f172a !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 0 !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  text-shadow: 
    -1.5px -1.5px 0 #ffffff,
     1.5px -1.5px 0 #ffffff,
    -1.5px  1.5px 0 #ffffff,
     1.5px  1.5px 0 #ffffff,
     0px 2px 4px rgba(0, 0, 0, 0.45) !important;
}

.leaflet-tooltip.otdr-cut-label {
  color: #dc2626 !important;
  font-size: 12px !important;
}

.leaflet-tooltip.maxi-permanent-label:before,
.leaflet-tooltip.otdr-cut-label:before,
.leaflet-tooltip.otdr-joint-label:before {
  display: none !important;
}

.maxi-layer-svg-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.maxi-joint-svg-marker {
  background: transparent !important;
  border: none !important;
}

.maxi-map-svg-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
  cursor: pointer;
}

.maxi-map-svg-wrapper:hover {
  transform: scale(1.35);
  filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.8));
  z-index: 9999 !important;
}

/* Pulsing Cut Marker with High Visibility Bouncing Icon */
.pulsing-cut-marker {
  width: 22px;
  height: 22px;
  background: #dc2626;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(220, 38, 38, 0.7);
  animation: pulsing-radar 1.2s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000 !important;
}

.pulsing-cut-marker:after {
  content: "💥";
  font-size: 16px;
  margin-top: -28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  animation: bounce-pin 0.8s infinite alternate ease-in-out;
}

@keyframes bounce-pin {
  from { transform: translateY(0); }
  to { transform: translateY(-7px); }
}

@keyframes pulsing-radar {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.8);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 18px rgba(220, 38, 38, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
  margin-left: auto;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: #e11d48;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  z-index: 1500;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
}

.mobile-nav-btn {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: all 0.15s ease;
  user-select: none;
}

.mobile-nav-btn:active {
  background: #f1f5f9;
}

.mobile-nav-btn.active {
  color: var(--accent-cyan);
}

.mobile-nav-icon {
  font-size: 18px;
}

.mobile-nav-text {
  font-size: 10px;
  font-weight: 700;
}

.mobile-nav-btn.gps-highlight .mobile-nav-icon {
  animation: pulse-gps 1.5s infinite;
}

@keyframes pulse-gps {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Pulsing User GPS Marker */
.pulsing-gps-marker {
  width: 18px;
  height: 18px;
  background: #0284c7;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(2, 132, 199, 0.7);
  animation: user-gps-radar 1.5s infinite;
}

/* ==========================================================================
   Ruler & Multi-Point Distance Measurement Tool
   ========================================================================== */
.btn-header.ruler-active,
#btn-ruler.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0369a1 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.map-measuring-mode,
.map-measuring-mode .leaflet-grab,
.map-measuring-mode .leaflet-interactive {
  cursor: crosshair !important;
}

/* While measuring, prevent marker popups from hijacking clicks so clicks register on map */
.map-measuring-mode .leaflet-marker-pane,
.map-measuring-mode .leaflet-overlay-pane {
  pointer-events: none !important;
}

/* Ruler Floating HUD Card (Translucent Glassmorphism) */
.ruler-hud-card {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  border-radius: 14px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
  animation: rulerSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rulerSlideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.ruler-hud-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ruler-hud-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.ruler-hud-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.ruler-hud-distance-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.ruler-hud-dist-val {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.ruler-hud-dist-unit {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.ruler-hud-dist-km {
  font-size: 12px;
  font-weight: 600;
  color: #0284c7;
  margin-left: 4px;
}

.ruler-hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-ruler-action {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-ruler-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-ruler-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-ruler-action.primary {
  background: rgba(2, 132, 199, 0.85);
  color: #ffffff;
  border-color: rgba(3, 105, 161, 0.8);
}

.btn-ruler-action.primary:hover:not(:disabled) {
  background: #0284c7;
}

.btn-ruler-action.danger {
  background: rgba(255, 241, 242, 0.7);
  color: #e11d48;
  border-color: rgba(254, 205, 211, 0.8);
}

.btn-ruler-action.danger:hover:not(:disabled) {
  background: rgba(255, 228, 230, 0.9);
  border-color: #fda4af;
}

/* Custom Ruler Marker Pin & Tooltip */
.ruler-point-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(2, 132, 199, 0.9);
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  user-select: none;
  transition: transform 0.15s ease;
}

.ruler-point-pin:hover {
  transform: scale(1.2);
}

.ruler-point-pin.start {
  background: rgba(22, 163, 74, 0.9);
}

.ruler-point-pin.end {
  background: rgba(220, 38, 38, 0.9);
}

.ruler-tooltip-badge {
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  white-space: nowrap !important;
}

/* ==========================================================================
   Joint Notes Feature Styles (v2.4.0)
   ========================================================================== */

.notes-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-cyan);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
  min-width: 14px;
}

.notes-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-size: 11px;
  color: #0369a1;
}

.btn-refresh-notes {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-refresh-notes:hover {
  background: #0369a1;
}

.notes-list-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.notes-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 16px;
  color: #94a3b8;
  gap: 8px;
}

.notes-empty-icon {
  font-size: 32px;
  opacity: 0.6;
}

.notes-empty-text {
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

/* Individual Note Card */
.note-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}

.note-card:hover {
  background: #f0f9ff;
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
  transform: translateX(2px);
}

.note-card-text {
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  transition: all 0.15s ease;
  cursor: pointer;
}

.note-card:hover .note-card-text,
.note-card-text:hover {
  color: #0284c7;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note-card-photos {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.note-photo-thumb {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #cbd5e1;
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.note-photo-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border-color: #0284c7;
}

.note-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

.btn-note-jump {
  background: #0284c7;
  color: #ffffff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.2);
}

.btn-note-jump:hover {
  background: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.btn-note-action {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: #0284c7;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-note-action:hover {
  background: #f0f9ff;
}

.btn-note-action.delete {
  color: #e11d48;
}

.btn-note-action.delete:hover {
  background: #fff1f2;
}

/* Note Modal Editor */
.note-joint-summary-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.4;
  color: #334155;
}

.note-textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.45;
  box-sizing: border-box;
}

#note-photos-preview-grid,
.note-photos-grid {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  margin-top: 6px !important;
  margin-bottom: 6px !important;
  max-height: 150px !important;
  overflow-y: auto !important;
}

.note-photo-preview-item {
  position: relative !important;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  background: #f1f5f9 !important;
  cursor: zoom-in !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.note-photo-preview-item img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.btn-remove-photo {
  position: absolute !important;
  top: 2px !important;
  right: 2px !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: rgba(225, 29, 72, 0.9) !important;
  color: #ffffff !important;
  border: none !important;
  font-size: 11px !important;
  font-weight: bold !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
  z-index: 5 !important;
}

.note-photo-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-attach-photo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-attach-photo:hover {
  background: #e2e8f0;
  border-color: #0284c7;
  color: #0284c7;
}

.btn-attach-photo.secondary {
  background: #fafafa;
}

.btn-action-danger {
  height: 38px;
  padding: 0 14px;
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-danger:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

/* Image Lightbox Modal (80% Viewport, Light Theme Translucent Glassmorphism & Slider) */
.lightbox-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.28) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  z-index: 99999 !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  user-select: none;
}

.lightbox-modal-content {
  width: 80vw !important;
  height: 80vh !important;
  max-width: 80vw !important;
  max-height: 80vh !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 14px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.lightbox-top-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 14px !important;
  background: rgba(248, 250, 252, 0.82) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  z-index: 10 !important;
}

.lightbox-counter {
  color: #0369a1 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  background: #e0f2fe !important;
  border: 1px solid #bae6fd !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
}

.lightbox-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.lightbox-tool-btn {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.lightbox-tool-btn:hover {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
  border-color: #94a3b8 !important;
  transform: translateY(-1px) !important;
}

.lightbox-close-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  font-size: 18px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}

.lightbox-close-btn:hover {
  background: #fee2e2 !important;
  color: #e11d48 !important;
  border-color: #fca5a5 !important;
  transform: scale(1.1) !important;
}

.lightbox-viewport {
  flex: 1 !important;
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  touch-action: none !important;
  cursor: grab !important;
}

.lightbox-viewport.is-dragging {
  cursor: grabbing !important;
}

.lightbox-image {
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  border-radius: 6px !important;
  transform-origin: center center !important;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18) !important;
  pointer-events: auto !important;
}

.lightbox-nav-btn {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.88) !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 20px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 20 !important;
  transition: all 0.2s ease !important;
  backdrop-filter: blur(6px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12) !important;
}

.lightbox-nav-btn:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  transform: translateY(-50%) scale(1.1) !important;
}

.lightbox-nav-btn.prev {
  left: 14px !important;
}

.lightbox-nav-btn.next {
  right: 14px !important;
}

.lightbox-nav-btn:disabled {
  opacity: 0.2 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Popup Note integration button */
.btn-popup-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-popup-note:hover {
  background: #dcfce7;
  border-color: #4ade80;
}

.popup-note-preview {
  margin-top: 6px;
  padding: 6px 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 11px;
  color: #166534;
  line-height: 1.35;
}

/* ==========================================================================
   Google Street View Pegman Control & Marker System
   ========================================================================== */
.leaflet-control-pegman-wrap {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  margin-bottom: 8px !important;
}

.leaflet-control-pegman-wrap:hover {
  background: #fffbeb;
  border-color: #f59e0b;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.leaflet-control-pegman-wrap:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.leaflet-control-pegman-wrap.active {
  background: #fef3c7;
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.45), 0 4px 12px rgba(217, 119, 6, 0.25);
  animation: pegmanGlow 1.8s infinite alternate;
}

@keyframes pegmanGlow {
  0% { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35); }
  100% { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.65); }
}

.pegman-ctrl-doll {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pegman-ctrl-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 6px;
  border: 1px solid #ffffff;
  line-height: 1;
  letter-spacing: -0.2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Floating Dragging Ghost Element (Dangling Pegman) */
#pegman-drag-ghost {
  position: fixed;
  z-index: 100000;
  pointer-events: none;
  display: none;
  transform: translate(-18px, -8px);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
  cursor: grabbing;
}

/* Street View Picking Mode Banner */
.streetview-mode-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1.5px solid #f59e0b;
  border-radius: 30px;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.22), 0 2px 6px rgba(0, 0, 0, 0.08);
  animation: slideDownBanner 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownBanner {
  from {
    transform: translate(-50%, -20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.streetview-banner-icon {
  font-size: 18px;
  animation: bouncePegman 1s infinite alternate;
}

@keyframes bouncePegman {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.streetview-banner-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #92400e;
  white-space: nowrap;
}

.streetview-banner-cancel {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 14px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.streetview-banner-cancel:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Pegman Marker Pin on Map */
.pegman-map-marker {
  position: relative;
  width: 36px;
  height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: grab;
}

.pegman-map-marker:active {
  cursor: grabbing;
}

.pegman-marker-base {
  position: absolute;
  bottom: 0;
  width: 22px;
  height: 10px;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.8) 0%, rgba(217, 119, 6, 0.4) 60%, transparent 100%);
  border-radius: 50%;
  z-index: 1;
}

.pegman-marker-pulse {
  position: absolute;
  bottom: -4px;
  width: 30px;
  height: 18px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.35);
  animation: pegmanRadarPulse 1.8s infinite ease-out;
  z-index: 0;
}

@keyframes pegmanRadarPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.pegman-marker-doll {
  position: relative;
  z-index: 2;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  transition: transform 0.15s ease;
}

.pegman-map-marker:hover .pegman-marker-doll {
  transform: scale(1.1) translateY(-2px);
}

/* Pegman Popup Card */
.pegman-popup-card {
  font-family: var(--font-sans);
  color: var(--text-primary);
  padding: 4px 2px;
  min-width: 220px;
}

.pegman-popup-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #b45309;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1.5px solid #fef3c7;
}

.pegman-popup-coords {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 10px;
  font-family: var(--font-mono);
}

.pegman-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-open-streetview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff !important;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
  transition: all 0.15s ease;
}

.btn-open-streetview:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.45);
  transform: translateY(-1px);
}

.btn-pegman-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f0f9ff;
  color: #0284c7 !important;
  border: 1px solid #bae6fd;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-pegman-nav:hover {
  background: #e0f2fe;
  color: #0369a1 !important;
}

.btn-pegman-remove {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 10.5px;
  cursor: pointer;
  padding: 3px;
  text-align: center;
  transition: color 0.15s ease;
}

.btn-pegman-remove:hover {
  color: #ef4444;
  text-decoration: underline;
}

/* ==========================================================================
   Mobile & Tablet Media Queries (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .ruler-hud-card {
    top: 8px;
    width: calc(100% - 20px);
    max-width: 380px;
    padding: 8px 12px;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .ruler-hud-dist-val {
    font-size: 17px;
  }

  .btn-ruler-action {
    height: 28px;
    padding: 0 8px;
    font-size: 10.5px;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .floating-hud-btn {
    display: none !important;
  }

  .app-header {
    height: 50px;
    padding: 0 8px;
    gap: 6px;
    position: relative;
    z-index: 2500;
  }

  .header-left {
    gap: 6px;
    flex-shrink: 0;
  }

  .brand-name {
    font-size: 14px;
    white-space: nowrap;
  }

  .brand-tag,
  .area-badge,
  .btn-header.secondary {
    display: none;
  }

  .header-center {
    flex: 1;
    min-width: 0;
    margin: 0 4px;
    max-width: none;
  }

  .search-bar-wrapper {
    width: 100%;
  }

  .search-input {
    height: 32px;
    font-size: 12px;
    padding: 0 26px 0 28px;
    border-radius: 8px;
  }

  .search-icon-pos {
    left: 8px;
    font-size: 12px;
  }

  .search-clear-btn {
    right: 6px;
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .header-right {
    gap: 4px;
    flex-shrink: 0;
  }

  .btn-header {
    height: 30px;
    padding: 0 6px;
    font-size: 11px;
    gap: 3px;
    white-space: nowrap;
  }

  .btn-header.primary {
    height: 30px;
    padding: 0 6px;
    font-size: 11px;
  }

  /* Fixed full-width dropdown on mobile */
  .global-search-dropdown,
  #global-search-dropdown {
    position: fixed !important;
    top: 54px !important;
    left: 8px !important;
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    min-width: 0 !important;
    max-height: 58vh !important;
    border-radius: 12px !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28) !important;
    z-index: 99999 !important;
    background: #ffffff !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  .search-result-item {
    padding: 9px 10px !important;
    min-height: 48px;
  }

  .search-item-title {
    font-size: 12.5px !important;
    line-height: 1.35 !important;
  }

  .search-item-sub {
    font-size: 11px !important;
    line-height: 1.3 !important;
  }

  /* Bottom Sheets for OTDR, Notes, and Layer Switcher */
  .panel-left-otdr,
  .panel-left-notes,
  .panel-right-layers {
    position: fixed;
    top: auto;
    bottom: 58px;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 52vh;
    border-radius: 18px 18px 0 0;
    border: none;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(120%);
    opacity: 1;
    z-index: 1400;
  }

  .panel-left-otdr.mobile-open,
  .panel-left-notes.mobile-open,
  .panel-right-layers.mobile-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .panel-left-otdr.collapsed,
  .panel-left-notes.collapsed,
  .panel-right-layers.collapsed {
    transform: translateY(120%);
    opacity: 0;
  }

  .panel-header {
    padding: 10px 14px;
  }

  /* Offset Leaflet bottom controls above mobile-bottom-nav (58px) */
  .leaflet-bottom {
    bottom: 68px !important;
  }
  .leaflet-right {
    right: 10px !important;
  }

  .streetview-mode-banner {
    top: 56px;
    width: calc(100% - 24px);
    max-width: 360px;
    padding: 6px 12px;
    justify-content: space-between;
  }
  .streetview-banner-text {
    font-size: 11.5px;
  }
}

/* ==========================================================================
   Last Updated Badge & Rollback Management Styles (v2.9.18)
   ========================================================================== */
.last-updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.last-updated-badge:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}

.updated-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #10b981;
  animation: pulse-green-glow 2s infinite ease-in-out;
}

@keyframes pulse-green-glow {
  0% { transform: scale(0.95); opacity: 0.7; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); opacity: 0.7; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.backup-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.backup-item-row:hover {
  background: #f0fdf4;
  border-color: #86efac;
}

.backup-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.backup-tag.monthly {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.backup-tag.daily {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.btn-rollback-action {
  background: #0284c7;
  color: #ffffff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-rollback-action:hover {
  background: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

/* ==========================================================================
   Smart-App Document Modal & Job Badges (v2.5.0 - Clean Light Theme)
   ========================================================================== */

/* Interactive Job Badges on Map Popups */
.smartapp-job-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11.5px;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.08);
}

.smartapp-job-badge:hover {
  background: #2563eb;
  color: #ffffff !important;
  border-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

.smartapp-job-badge .badge-icon {
  font-size: 12px;
}

/* Modal Overlay */
.smartapp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: smartappFadeIn 0.2s ease-out;
}

@keyframes smartappFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes smartappSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal Container (Clean Light Theme) */
.smartapp-modal-card {
  width: 95vw;
  max-width: 1280px;
  height: 90vh;
  max-height: 850px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: smartappSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  color: #0f172a;
}

/* Modal Header */
.smartapp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.smartapp-modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.smartapp-modal-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.smartapp-pill-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.smartapp-pill-badge.job {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.smartapp-pill-badge.sap {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.smartapp-pill-badge.status {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.smartapp-pill-badge.project {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

/* Multi-Job Tabs Bar */
.smartapp-modal-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.smartapp-modal-tabs-bar::-webkit-scrollbar {
  height: 4px;
}

.smartapp-modal-tabs-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.smartapp-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.smartapp-tab-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

.smartapp-tab-btn.active {
  background: #eff6ff;
  border: 1.5px solid #2563eb;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}

.smartapp-tab-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.smartapp-tab-badge.empty {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.smartapp-tab-badge.has-files {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.smartapp-tab-btn.active .smartapp-tab-badge.has-files {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

.smartapp-modal-desc-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  line-height: 1.4;
  color: #334155;
}

.smartapp-modal-desc-label {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.smartapp-modal-desc-text {
  color: #475569;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smartapp-close-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.smartapp-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  transform: rotate(90deg);
}

/* Modal Info Bar */
.smartapp-info-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 8px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11.5px;
  line-height: 1.4;
}

.smartapp-info-item {
  display: flex;
  flex-direction: column;
}

.smartapp-info-label {
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
}

.smartapp-info-value {
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal Body Layout (Split View) */
.smartapp-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: #f8fafc;
}

/* Left Sidebar: File List */
.smartapp-files-sidebar {
  width: 330px;
  min-width: 280px;
  max-width: 360px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.smartapp-files-header {
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.smartapp-file-count-badge {
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10.5px;
}

.smartapp-files-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.smartapp-file-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  text-align: left;
}

.smartapp-file-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateX(2px);
}

.smartapp-file-card.active {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.12);
}

.smartapp-file-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.smartapp-file-details {
  flex: 1;
  min-width: 0;
}

.smartapp-file-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
  line-height: 1.35;
  margin-bottom: 3px;
}

.smartapp-file-category {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.smartapp-file-card.active .smartapp-file-category {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Right Content: PDF Viewer & Document Display */
.smartapp-viewer-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f1f5f9;
}

.smartapp-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  gap: 10px;
  flex-wrap: wrap;
}

.smartapp-active-file-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 450px;
}

.smartapp-viewer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.smartapp-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.smartapp-action-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.smartapp-action-btn.primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.smartapp-action-btn.primary:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.smartapp-viewer-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* PDF.js Native Canvas Viewer (Style like MAXI Checker) */
.smartapp-pdf-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.smartapp-pdf-tool-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.smartapp-pdf-tool-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.smartapp-pdf-scroll-pane {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  background: #f1f5f9;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.smartapp-pdf-page-wrapper {
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  background: #ffffff;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.smartapp-pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.smartapp-pdf-page-num {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
}

/* Empty & Non-PDF Message States */
.smartapp-nonpdf-card {
  margin: auto;
  padding: 32px;
  max-width: 480px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.smartapp-nonpdf-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.smartapp-nonpdf-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.smartapp-nonpdf-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Loading & Error States */
.smartapp-loading-state,
.smartapp-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px;
  text-align: center;
}

.smartapp-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: smartappSpin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes smartappSpin {
  to { transform: rotate(360deg); }
}

.smartapp-state-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.smartapp-state-subtitle {
  font-size: 12.5px;
  color: #64748b;
  max-width: 420px;
  line-height: 1.5;
}

.smartapp-retry-btn {
  margin-top: 18px;
  padding: 7px 18px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.smartapp-retry-btn:hover {
  background: #1d4ed8;
}



