:root {
  --amana-ink: #2c3340;
  --amana-muted: #6b7280;
  --amana-surface: #eef1f4;
  --amana-panel: #ffffff;
  --amana-line: #e2e5ea;
  --amana-accent: #0d6e6e;
  --amana-accent-soft: #e6f3f3;
  --amana-warn: #b45309;
  --amana-map-edge: #0b5fff;
  --fc-blue: #1a73e8;
  --fc-blue-dark: #1557b0;
  --fc-green: #34a853;
  --fc-topbar-h: 56px;
  --fc-nav-w: 258px;
  --fc-filters-w: 280px;
  --fc-safe-top: env(safe-area-inset-top, 0px);
  --fc-safe-bottom: env(safe-area-inset-bottom, 0px);
  --fc-safe-left: env(safe-area-inset-left, 0px);
  --fc-safe-right: env(safe-area-inset-right, 0px);
  --fc-panel-duration: 0.42s;
  --fc-panel-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 52px;
  --sidebar-w: 280px;
  --font-display: "Almarai", "Segoe UI", "Tahoma", sans-serif;
  --wo-navy: #466691;
  --wo-navy-dark: #355074;
}

* { box-sizing: border-box; }

html, body.app-body, body.fc-body-root {
  height: 100%;
  height: 100dvh;
  margin: 0;
  font-family: var(--font-display);
  color: var(--amana-ink);
  background: #fff;
  overflow: hidden;
  overscroll-behavior: none;
}

.app-main.fc-main {
  height: 100%;
}

/* ========== Fulcrum shell ========== */
.fc-app.measure-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  background: #fff;
}

.fc-topbar {
  height: var(--fc-topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.75rem 0 0.5rem;
  border-bottom: 1px solid var(--amana-line);
  background: #fff;
  z-index: 30;
}

.fc-topbar-left,
.fc-topbar-center,
.fc-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fc-topbar-left { flex: 0 0 auto; }
.fc-topbar-center { flex: 1 1 auto; min-width: 0; justify-content: center; }
.fc-topbar-right { flex: 0 0 auto; }

.fc-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 3px 8px;
  line-height: 0;
  background: #fff;
  border: 1px solid rgba(63, 43, 132, 0.16);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(10, 170, 183, 0.35), 0 6px 14px rgba(63, 43, 132, 0.08);
}

.fc-logo-img {
  display: block;
  height: 42px;
  width: auto;
  max-width: 132px;
  object-fit: contain;
}

.fc-project {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: default;
  color: #374151;
  font-weight: 600;
  font-size: 0.92rem;
}

.fc-project:hover { background: #f3f4f6; }
.fc-caret { font-size: 0.7rem; color: #9ca3af; }

.fc-btn {
  border: none;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.fc-btn-ghost {
  background: #f3f4f6;
  color: #4b5563;
}

.fc-btn-ghost:hover { background: #e5e7eb; }

.fc-btn-primary {
  background: var(--fc-blue);
  color: #fff;
}

.fc-btn-primary:hover { background: var(--fc-blue-dark); color: #fff; }

.fc-btn-short { display: none; }

.fc-input {
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  min-width: 160px;
  outline: none;
}

.fc-input:focus { border-color: var(--fc-blue); box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15); }

.fc-record-search {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.fc-record-count {
  font-size: 0.8rem;
  color: var(--amana-muted);
  white-space: nowrap;
}

.fc-link-btn {
  background: none;
  border: none;
  color: var(--fc-blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  white-space: nowrap;
}

.fc-link-btn:hover { text-decoration: underline; }

.fc-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #4b5563;
}

.fc-icon-btn:hover { background: #f9fafb; }

.fc-icon-round { border-radius: 50%; }

.fc-icon-add {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--fc-green);
  border-color: var(--fc-green);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.fc-icon-add:hover {
  background: #2d8f47;
  border-color: #2d8f47;
  color: #fff;
}

.fc-panel-toggles {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: 0.35rem;
}

.fc-toggle-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #4b5563;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
}

.fc-toggle-btn:hover { background: #f3f4f6; }

.fc-toggle-btn.is-on {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--fc-blue);
}

.fc-body {
  flex: 1 1 auto;
  display: grid;
  /* RTL: العمود الأول يميناً = القائمة ثم الفلاتر ثم الخريطة */
  grid-template-columns: var(--fc-nav-w) var(--fc-filters-w) 1fr;
  min-height: 0;
  height: calc(100% - var(--fc-topbar-h));
  transition: grid-template-columns var(--fc-panel-duration) var(--fc-panel-ease);
}

.fc-app.is-nav-collapsed .fc-body {
  grid-template-columns: 0 var(--fc-filters-w) 1fr;
}

.fc-app.is-filters-collapsed .fc-body {
  grid-template-columns: var(--fc-nav-w) 0 1fr;
}

.fc-app.is-nav-collapsed.is-filters-collapsed .fc-body {
  grid-template-columns: 0 0 1fr;
}

.fc-nav,
.fc-filters.sidebar {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  visibility: visible;
  transition:
    transform var(--fc-panel-duration) var(--fc-panel-ease),
    opacity calc(var(--fc-panel-duration) * 0.85) ease,
    visibility 0s linear 0s,
    box-shadow var(--fc-panel-duration) ease,
    border-color var(--fc-panel-duration) ease,
    padding var(--fc-panel-duration) ease;
  will-change: transform, opacity;
}

.fc-app.is-nav-collapsed .fc-nav,
.fc-app.is-filters-collapsed .fc-filters {
  overflow: hidden;
  border-color: transparent !important;
  padding: 0;
  min-width: 0;
  width: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: none;
  transition:
    transform var(--fc-panel-duration) var(--fc-panel-ease),
    opacity calc(var(--fc-panel-duration) * 0.55) ease,
    visibility 0s linear var(--fc-panel-duration),
    box-shadow var(--fc-panel-duration) ease,
    border-color var(--fc-panel-duration) ease,
    padding var(--fc-panel-duration) ease;
}

/* RTL: القائمة يميناً — تنزلق للخارج يميناً */
.fc-app.is-nav-collapsed .fc-nav {
  transform: translate3d(18px, 0, 0);
}

/* الفلاتر تنزلق قليلاً مع تلاشي */
.fc-app.is-filters-collapsed .fc-filters {
  transform: translate3d(24px, 0, 0) scale(0.985);
  transform-origin: right center;
}

/* Navigation (يمين في RTL) */
.fc-nav {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--amana-line);
  border-right: none;
  overflow: hidden;
  padding: 0;
  font-size: 0.86rem;
  min-width: 0;
  box-shadow: -2px 0 12px rgba(15, 23, 42, 0.04);
}

.fc-nav-head,
.fc-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--amana-line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}

.fc-nav-head span,
.fc-filters-head h2 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.fc-panel-hide {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 4px;
  color: #6b7280;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fc-panel-hide:hover {
  background: #f3f4f6;
  color: #111827;
}

.fc-nav-section { margin-bottom: 0.35rem; padding-top: 0.25rem; }

.fc-nav-label,
.fc-nav-group {
  padding: 0.45rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.04em;
}

.fc-nav-group {
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 600;
}

.fc-nav-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  color: #4b5563;
  text-decoration: none;
  border-right: 3px solid transparent;
  border-left: none;
}

.fc-nav-item:hover {
  background: #f9fafb;
  color: #111827;
}

.fc-nav-item.is-active {
  background: #eff6ff;
  color: var(--fc-blue);
  border-right-color: var(--fc-blue);
  font-weight: 600;
}

.fc-nav-item.is-sub {
  align-items: flex-start;
  padding: 0.42rem 0.75rem;
  margin: 0 0.45rem 0.15rem 0.35rem;
  border-radius: 8px;
  border-right: none;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: normal;
}

.fc-nav-item.is-sub .fc-nav-ico {
  margin-top: 0.12rem;
}

.fc-nav-item.is-sub:hover {
  background: #f4f7fb;
}

    .fc-nav-item.is-sub.is-active {
        background: #fef3c7;
        color: var(--fc-blue);
        font-weight: 700;
    }

.fc-nav-item.is-soon {
  opacity: 0.78;
  cursor: default;
}

.fc-nav-ico {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5b6573;
  opacity: 1;
}

.fc-nav-ico svg {
  width: 1.12rem;
  height: 1.12rem;
  display: block;
}

.fc-nav-item.is-active .fc-nav-ico {
  color: var(--fc-blue);
}

.fc-nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.35rem 0 1.1rem;
  -webkit-overflow-scrolling: touch;
}

.fc-nav-acc {
  --fc-acc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  margin: 0;
  border: 0;
  background: transparent;
}

.fc-nav-acc + .fc-nav-acc {
  border-top: 1px solid #f1f3f6;
}

.fc-nav-acc-head {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.68rem 0.85rem;
  cursor: pointer;
  user-select: none;
  color: #1f2937;
  font-weight: 800;
  font-size: 0.84rem;
  line-height: 1.3;
  transition: background 0.22s ease, color 0.22s ease;
}

.fc-nav-acc-head::-webkit-details-marker,
.fc-nav-acc-head::marker {
  display: none;
  content: none;
}

.fc-nav-acc-head:hover {
  background: #f8fafc;
}

.fc-nav-acc-title {
  flex: 1;
  min-width: 0;
}

.fc-nav-acc-head .fc-nav-ico {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  background: #f1f5f8;
  color: var(--wo-navy, #466691);
  transition:
    transform 0.38s var(--fc-acc-ease),
    background 0.25s ease,
    color 0.25s ease;
}

.fc-nav-acc-head .fc-nav-ico svg {
  width: 0.98rem;
  height: 0.98rem;
}

.fc-nav-caret {
  width: 0.42rem;
  height: 0.42rem;
  flex-shrink: 0;
  border-inline-end: 2px solid #9aa3af;
  border-bottom: 2px solid #9aa3af;
  transform: rotate(45deg);
  transition: transform 0.38s var(--fc-acc-ease);
  margin-inline-start: 0.15rem;
}

.fc-nav-acc.is-expanded > .fc-nav-acc-head .fc-nav-caret,
.fc-nav:not(.is-nav-ready) .fc-nav-acc[open] > .fc-nav-acc-head .fc-nav-caret {
  transform: rotate(-45deg);
}

.fc-nav-acc.is-expanded > .fc-nav-acc-head,
.fc-nav:not(.is-nav-ready) .fc-nav-acc[open] > .fc-nav-acc-head {
  color: #111827;
}

.fc-nav-acc.is-expanded > .fc-nav-acc-head .fc-nav-ico {
  transform: scale(1.06);
}

.fc-nav-acc:has(.fc-nav-item.is-active) > .fc-nav-acc-head {
  color: var(--fc-blue);
}

.fc-nav-acc:has(.fc-nav-item.is-active) > .fc-nav-acc-head .fc-nav-ico {
  background: #eef5ff;
  color: var(--fc-blue);
}

.fc-nav-acc-clip {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s var(--fc-acc-ease);
}

.fc-nav-acc.is-expanded > .fc-nav-acc-clip,
.fc-nav:not(.is-nav-ready) .fc-nav-acc[open] > .fc-nav-acc-clip {
  grid-template-rows: 1fr;
}

.fc-nav-acc-clip > .fc-nav-acc-body {
  min-height: 0;
  overflow: hidden;
}

.fc-nav-acc-body {
  display: flex;
  flex-direction: column;
  padding: 0 0 0.5rem;
}

.fc-nav-acc-body .fc-nav-item.is-sub {
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.28s ease,
    transform 0.34s var(--fc-acc-ease),
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.fc-nav-acc.is-expanded .fc-nav-item.is-sub,
.fc-nav:not(.is-nav-ready) .fc-nav-acc[open] .fc-nav-item.is-sub {
  opacity: 1;
  transform: none;
}

.fc-nav-acc.is-expanded .fc-nav-item.is-sub:nth-child(1) { transition-delay: 0.05s; }
.fc-nav-acc.is-expanded .fc-nav-item.is-sub:nth-child(2) { transition-delay: 0.09s; }
.fc-nav-acc.is-expanded .fc-nav-item.is-sub:nth-child(3) { transition-delay: 0.13s; }

@media (prefers-reduced-motion: reduce) {
  .fc-nav-acc-clip,
  .fc-nav-caret,
  .fc-nav-acc-head,
  .fc-nav-acc-head .fc-nav-ico,
  .fc-nav-acc-body .fc-nav-item.is-sub {
    transition: none !important;
  }

  .fc-nav-acc-body .fc-nav-item.is-sub {
    opacity: 1;
    transform: none;
  }
}

.fc-nav-bottom { margin-top: 1rem; }

/* Filters panel */
.fc-filters.sidebar {
  background: #fafbfc;
  border-left: 1px solid var(--amana-line);
  border-right: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  box-shadow: -4px 0 18px rgba(15, 23, 42, 0.06);
}

.fc-filters-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease, transform 0.2s var(--fc-panel-ease);
}

.fc-filters-close:hover {
  color: #111827;
  transform: rotate(90deg);
}

.fc-filter-block {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--amana-line);
  background: #fff;
  transition: background-color 0.2s ease;
}

.fc-filters.is-opening .fc-filter-block {
  animation: fcFilterBlockIn 0.38s var(--fc-panel-ease) both;
}

.fc-filters.is-opening .fc-filter-block:nth-child(1) { animation-delay: 0.02s; }
.fc-filters.is-opening .fc-filter-block:nth-child(2) { animation-delay: 0.06s; }
.fc-filters.is-opening .fc-filter-block:nth-child(3) { animation-delay: 0.1s; }
.fc-filters.is-opening .fc-filter-block:nth-child(4) { animation-delay: 0.14s; }
  .fc-filters.is-opening .fc-filter-block:nth-child(5) { animation-delay: 0.18s; }
  .fc-filters.is-opening .fc-filter-block:nth-child(6) { animation-delay: 0.22s; }
  .fc-filters.is-opening .fc-filter-block:nth-child(7) { animation-delay: 0.26s; }

@keyframes fcFilterBlockIn {
  from {
    opacity: 0;
    transform: translate3d(12px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fc-body,
  .fc-nav,
  .fc-filters.sidebar,
  .fc-filters-close,
  .fc-filter-block {
    transition: none !important;
    animation: none !important;
  }
}

.fc-filter-title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
}

.fc-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
  color: #374151;
}

.fc-check input { accent-color: var(--fc-blue); }

.fc-search-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
  padding: 3px;
  background: #f3f4f6;
  border-radius: 8px;
}

.fc-search-mode {
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.2rem;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.3;
}

.fc-search-mode:hover { color: #111827; }

.fc-search-mode.is-on {
  background: #fff;
  color: var(--fc-blue);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.fc-search-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 0.3rem;
}

.fc-input.fc-input-block {
  width: 100%;
  min-width: 0;
  display: block;
}

.fc-coord-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.fc-coord-row .fc-input {
  min-width: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.fc-search-help {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: #9ca3af;
  line-height: 1.35;
}

.fc-search-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.fc-search-actions .fc-btn {
  flex: 1;
}

.fc-search-hint {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: #6b7280;
  min-height: 1.1em;
  line-height: 1.4;
}

.fc-search-hint.is-ok { color: #047857; }
.fc-search-hint.is-err { color: #b91c1c; }

/* أزرار إعادة فتح اللوحات على يمين الخريطة */
.fc-reopen-rail {
  position: absolute;
  top: 72px;
  right: 0;
  z-index: 1100;
  display: none;
  flex-direction: column;
  gap: 6px;
}

.fc-app.is-nav-collapsed .fc-reopen-rail,
.fc-app.is-filters-collapsed .fc-reopen-rail {
  display: flex;
}

.fc-reopen-tab {
  display: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: #fff;
  border: 1px solid #d1d5db;
  border-left: none;
  border-radius: 0 6px 6px 0;
  padding: 0.85rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.fc-app.is-filters-collapsed #btnShowFilters,
.fc-app.is-nav-collapsed #btnShowNav {
  display: block;
}

.fc-reopen-tab:hover {
  background: #eff6ff;
  color: var(--fc-blue);
}

/* Map */
.fc-map.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #111;
}

.fc-map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  width: auto;
  max-width: calc(100% - 24px);
  align-items: center;
  justify-content: flex-start;
}

.fc-layers-pop {
  position: absolute;
  top: 56px;
  inset-inline-end: 12px;
  z-index: 1100;
  width: min(260px, calc(100% - 24px));
  padding: 0.75rem 0.85rem 0.85rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(15, 40, 60, 0.12);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  color: #0f172a;
  font-family: "Almarai", system-ui, sans-serif;
}

.fc-layers-pop[hidden] {
  display: none !important;
}

.fc-layers-title {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #0b1f33;
}

.fc-layers-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem 0;
  border-top: 1px solid #e2e8f0;
}

.fc-layers-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.fc-layers-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 0.1rem;
}

.fc-layers-opt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.fc-layers-opt input {
  accent-color: #0f766e;
  margin: 0;
}

.fc-map-search {
  position: relative;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  width: 220px;
  flex-shrink: 0;
}

.fc-map-btn.is-work {
  background: #c2410c;
  color: #fff;
  border-inline-end-color: #9a3412;
}

.fc-map-btn.is-work:hover {
  background: #9a3412;
  color: #fff;
}

.fc-map-btn.is-save-wo {
  background: #15803d;
  color: #fff;
  border-inline-end-color: #166534;
}

.fc-map-btn.is-save-wo:hover:not(:disabled) {
  background: #166534;
  color: #fff;
}

.fc-map-btn.is-wo-edit:not(:disabled) {
  color: #466691;
}

.fc-map-btn.is-wo-print:not(:disabled) {
  color: #355074;
}

.leaflet-tooltip.wo-map-tooltip {
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  font-family: Almarai, Tahoma, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
  direction: rtl;
}

.leaflet-tooltip.wo-map-tooltip::before {
  border-top-color: #0f172a;
}

.leaflet-tooltip.building-map-tooltip {
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-family: Almarai, Tahoma, sans-serif;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.32);
  direction: rtl;
  min-width: 11rem;
  white-space: normal;
}

.leaflet-tooltip.building-map-tooltip::before {
  border-top-color: #0f172a;
}

.leaflet-tooltip.building-map-tooltip .bld-tip-code {
  font-weight: 800;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: #93c5fd;
}

.leaflet-tooltip.building-map-tooltip .bld-tip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.76rem;
  line-height: 1.45;
}

.leaflet-tooltip.building-map-tooltip .bld-tip-row span {
  color: #94a3b8;
  font-weight: 600;
}

.leaflet-tooltip.building-map-tooltip .bld-tip-row b {
  font-weight: 800;
  color: #fff;
}

.fc-map-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fc-map-search input {
  width: 100%;
  border: none;
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  outline: none;
  border-radius: 2px;
}

.fc-map-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  width: auto;
  height: 40px;
  max-width: min(100%, calc(100vw - 280px));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.fc-map-stack-sep {
  display: block;
  width: 4px;
  align-self: stretch;
  background: #e5e7eb;
  border-inline-end: 1px solid #d1d5db;
  flex-shrink: 0;
}

.fc-map-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-inline-end: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.fc-map-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.fc-map-btn:last-child { border-inline-end: none; }
.fc-map-btn:hover:not(:disabled) { background: #f3f4f6; }
.fc-map-btn.is-tool.is-on,
.fc-map-btn.is-on {
  background: #eff6ff;
  color: var(--fc-blue);
}

.fc-map-btn.is-draw.is-ok:not(:disabled) { color: #15803d; }
.fc-map-btn.is-draw.is-save:not(:disabled) { color: #1d4ed8; }
.fc-map-btn.is-draw.is-danger:not(:disabled) { color: #b91c1c; }
.fc-map-btn.is-lab:not(:disabled) {
  color: #0f766e;
}

.fc-map-btn.is-lab:not(:disabled):hover {
  background: #ecfdf5;
}

.fc-map-btn.is-draw:not(:disabled):hover {
  background: #eff6ff;
}

.fc-draw-status {
    position: absolute;
    top: 60px;
    right: 12px;
    left: auto;
    z-index: 1000;
    margin: 0;
    max-width: min(420px, calc(100% - 48px));
    padding: 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    font-size: 0.8rem;
    line-height: 1.4;
    color: #ff0000;
    pointer-events: none;
}

/* Legacy overrides for shell */
.app-header { display: none; }

.api-key-banner {
  grid-column: 1 / -1;
  background: #fff3cd;
  color: #664d03;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #ffecb5;
  font-size: 0.9rem;
  z-index: 5;
}

.search-row { position: relative; }

.search-results {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1100;
  background: #fff;
  border: 1px solid var(--amana-line);
  border-radius: 2px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.search-results li {
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid #eef1f5;
  line-height: 1.3;
  text-align: right;
  direction: rtl;
}

.search-results li:hover,
.search-results li:focus {
  background: #eff6ff;
  outline: none;
}

.search-empty {
  color: var(--amana-muted);
  cursor: default !important;
}

.vertex-icon {
  background: transparent !important;
  border: none !important;
}

.vertex-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.vertex-marker.is-wo-edit {
  border-color: #fef08a;
  box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.35), 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

.vertex-marker.is-bld-edit {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35), 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

.wo-edge-handle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #facc15;
  border: 2px solid #fff;
  color: #713f12;
  font-size: 14px;
  font-weight: 800;
  line-height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.wo-edge-handle:hover {
  background: #eab308;
  transform: scale(1.12);
}

.bld-edge-handle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.bld-edge-handle:hover {
  background: #2563eb;
  transform: scale(1.12);
}

.dimension-label-wrap {
  background: transparent !important;
  border: none !important;
}

.dimension-label {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #1a2332;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 700;
  color: #1a2332;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transform: translate(-50%, -50%);
}

.leaflet-container {
  font: inherit;
  width: 100%;
  height: 100%;
}

.leaflet-control-zoom { display: none !important; }

.panel {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.panel-title {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
  font-weight: 700;
}

.subheading {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--amana-muted);
  margin: 0.85rem 0 0.4rem;
  font-weight: 700;
}

.hint {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: var(--amana-muted);
  line-height: 1.45;
}

.search-row input { width: 100%; }

.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.btn-grid .btn {
  font-size: 0.82rem;
  padding: 0.4rem 0.5rem;
}

.toolbar-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  position: relative;
}

@media (max-width: 1100px) {
  .fc-topbar-center .fc-record-search { flex: 1; }
  .fc-record-search .fc-input { min-width: 0; width: 100%; }
}

@media (max-width: 760px) {
  .fc-map-controls { width: auto; }
}


.btn-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.btn-icon:disabled {
  opacity: 0.45;
}

.btn-icon.btn-work {
  background: #c2410c;
  border-color: #c2410c;
  color: #fff;
}

.btn-icon.btn-work:hover:not(:disabled) {
  background: #9a3412;
  border-color: #9a3412;
  color: #fff;
}

.btn-icon.btn-work.is-active,
.btn-icon.btn-primary.is-active {
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.35);
}

.btn-icon.btn-primary.is-active {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.35);
}

.btn-grid .btn-report,
.btn-icon.btn-save {
  background: #0369a1;
  border-color: #0369a1;
  color: #fff;
}

.btn-icon.btn-save:hover:not(:disabled) {
  background: #075985;
  border-color: #075985;
  color: #fff;
}

.building-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 180px;
  overflow-y: auto;
}

.building-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  text-align: right;
  border: 1px solid var(--amana-line);
  background: #fff;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.building-list-item strong {
  color: #0369a1;
}

.building-list-item span {
  color: var(--amana-muted);
  font-size: 0.75rem;
}

.building-list-item.is-active {
  border-color: #0369a1;
  background: #f0f9ff;
  box-shadow: 0 0 0 2px rgba(3, 105, 161, 0.2);
}

.building-popup-meta .wo-row {
  margin-bottom: 0.35rem;
}

.btn-icon.btn-report {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
}

.btn-icon.btn-report:hover:not(:disabled) {
  background: #152a45;
  border-color: #152a45;
  color: #fff;
}

.work-order-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  max-height: 160px;
  overflow-y: auto;
}

.wo-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  text-align: right;
  border: 1px solid var(--amana-line);
  background: #fff;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.wo-list-item strong {
  color: #c2410c;
}

.wo-list-item span {
  color: var(--amana-muted);
  font-size: 0.75rem;
}

.wo-list-item.is-active {
  border-color: #c2410c;
  background: #fff7ed;
  box-shadow: 0 0 0 2px rgba(194, 65, 12, 0.2);
}

.wo-active-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #c2410c;
  margin-bottom: 0.35rem;
}

.work-order-card .wo-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0;
  border-bottom: 1px dashed var(--amana-line);
  font-size: 0.82rem;
}

.work-order-card .wo-row span {
  color: var(--amana-muted);
}

.work-order-card .wo-desc {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.4;
}

.rpt-workorder {
  margin-bottom: 6px;
}

.rpt-wo-table {
  font-size: 11px;
}

.rpt-wo-table th {
  background: #eef2f6;
  color: #12324f;
  width: 18%;
  font-weight: 700;
}

.rpt-wo-table td {
  text-align: right;
}

.rpt-workorder-missing .rpt-wo-missing {
  margin: 8px;
  color: #b45309;
  font-size: 12px;
}

.tool-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}

.dot-work { background: #c2410c; }
.dot-build { background: #0b5fff; }
.dot-restore { background: #eab308; box-shadow: inset 0 0 0 1px #a16207; }
.dot-remove { background: #ef4444; }

.swatch-work {
  background: rgba(194, 65, 12, 0.25);
  border: 2px solid #c2410c;
}

.btn-accent {
  background: var(--amana-accent);
  border-color: var(--amana-accent);
  color: #fff;
}

.btn-accent:hover:not(:disabled) {
  background: #0a5858;
  border-color: #0a5858;
  color: #fff;
}

.btn-accent:disabled {
  opacity: 0.55;
}

.map-stage {
  position: relative;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
}

.map-legend {
  position: absolute;
  right: 12px;
  bottom: 24px;
  left: auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--amana-line);
  border-radius: 2px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  display: inline-block;
}

.swatch-boundary {
  background: rgba(11, 95, 255, 0.25);
  border: 2px solid var(--amana-map-edge);
}

.swatch-vertex {
  background: #fff;
  border: 2px solid #c62828;
  border-radius: 50%;
}

.north-chip {
  font-weight: 700;
  color: var(--amana-ink);
  border-left: 1px solid var(--amana-line);
  padding-left: 0.65rem;
}

.empty-state {
  font-size: 0.85rem;
  color: var(--amana-muted);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--amana-line);
}

.metric-label {
  font-size: 0.85rem;
  color: var(--amana-muted);
}

.metric-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.shape-note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--amana-warn);
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.side-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.28rem 0;
  border-bottom: 1px solid #eef1f5;
}

.table-wrap {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--amana-line);
  border-radius: 4px;
}

.coord-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.coord-table th,
.coord-table td {
  padding: 0.3rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid #eef1f5;
}

.coord-table th {
  background: var(--amana-surface);
  position: sticky;
  top: 0;
}

@media (max-width: 900px) {
  .header-tagline {
    display: none;
  }
}

/* ---------- Report modal & sheet ---------- */

#reportModal.is-sketch-kroki #reportWoSection,
#reportModal.is-sketch-kroki #reportWorkOrderBanner,
#reportModal.is-sketch-kroki #reportBuildingMetaSection {
  display: none !important;
}

#reportModal.is-sketch-kroki input[data-kroki-lock],
#reportModal.is-sketch-kroki textarea[data-kroki-lock] {
  background: #f3f4f6;
  pointer-events: none;
}

.kroki-modal-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.kroki-modal-logo {
  height: 48px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 4px 8px;
  box-shadow: none;
}

.kroki-modal-titles {
  min-width: 0;
}

.kroki-modal-titles .modal-title {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
}

.kroki-modal-sub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--amana-muted, #6b7280);
  font-weight: 600;
}

#reportModal.is-sketch-kroki .modal-content {
  border: none;
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--font-display);
  position: relative;
}

#reportModal.is-sketch-kroki .modal-dialog {
  max-width: 980px;
}

#reportModal.is-sketch-kroki .modal-header {
  background: #12324f;
  color: #fff;
  border-bottom: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
}

#reportModal.is-sketch-kroki .modal-header .kroki-close,
#reportModal.is-sketch-kroki .modal-header .btn-close {
  position: static;
  order: 2;
  margin: 0 !important;
  margin-inline-start: auto !important;
  flex-shrink: 0;
  filter: invert(1) grayscale(1) brightness(2);
  opacity: 0.95;
}

#reportModal.is-sketch-kroki .kroki-modal-brand {
  order: 1;
}

#reportModal .modal-content {
  position: relative;
}

.kroki-loader {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.kroki-loader.is-on {
  display: flex !important;
}

#reportModal.is-sketch-kroki .kroki-modal-sub {
  color: rgba(255, 255, 255, 0.82);
}

#reportModal.is-sketch-kroki .modal-body {
  background: var(--amana-surface, #eef1f4);
  padding: 1rem 1.1rem 1.15rem;
}

#reportModal.is-sketch-kroki .modal-footer {
  background: #fff;
  border-top: 1px solid var(--amana-line, #e2e5ea);
  gap: 0.45rem;
}

#reportModal.is-sketch-kroki .modal-footer .btn-accent {
  background: #12324f;
  border-color: #12324f;
  color: #fff;
  font-weight: 800;
}

#reportModal.is-sketch-kroki .modal-footer .btn-accent:hover {
  background: #0d2438;
}

#reportModal.is-sketch-kroki .modal-footer .btn-primary {
  background: #12324f;
  border-color: #12324f;
  font-weight: 700;
}

.kroki-officer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 0.85rem;
}

.kroki-intro {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.9rem;
  background: #fff;
  border: 1px solid var(--amana-line, #e2e5ea);
  border-right: 3px solid var(--wo-navy, #466691);
  border-radius: 8px;
}

.kroki-intro strong {
  color: var(--wo-navy, #466691);
  font-size: 0.92rem;
}

.kroki-intro span {
  color: var(--amana-muted, #6b7280);
  font-size: 0.8rem;
  font-weight: 600;
}

.kroki-intro,
.kroki-f-notes,
.kroki-photos-head {
  grid-column: 1 / -1;
}

#reportModal.is-sketch-kroki .kroki-officer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#reportModal.is-sketch-kroki .kroki-f-street,
#reportModal.is-sketch-kroki .kroki-f-north,
#reportModal.is-sketch-kroki .kroki-f-east,
#reportModal.is-sketch-kroki .kroki-f-south,
#reportModal.is-sketch-kroki .kroki-f-west {
  max-width: none;
}

#reportModal.is-sketch-kroki .kroki-f-street,
#reportModal.is-sketch-kroki .kroki-f-north,
#reportModal.is-sketch-kroki .kroki-f-east,
#reportModal.is-sketch-kroki .kroki-f-south,
#reportModal.is-sketch-kroki .kroki-f-west,
#reportModal.is-sketch-kroki .kroki-f-notes {
  background: #fff;
  border: 1px solid var(--amana-line, #e2e5ea);
  border-radius: 10px;
  padding: 0.7rem 0.8rem 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

#reportModal.is-sketch-kroki .kroki-officer-grid .form-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--amana-ink, #2c3340);
}

.kroki-dir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--wo-navy, #466691);
  font-size: 0.7rem;
  font-weight: 800;
}

#reportModal.is-sketch-kroki .kroki-officer-grid .form-control {
  border-color: #d7dee8;
  border-radius: 8px;
  min-height: 42px;
  font-weight: 600;
}

#reportModal.is-sketch-kroki .kroki-officer-grid .form-control:focus {
  border-color: var(--fc-blue, #1a73e8);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

.kroki-photos-head {
  margin: 0.25rem 0 0;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--wo-navy, #466691);
}

.kroki-photos-head span {
  color: var(--amana-muted, #6b7280);
  font-weight: 700;
  font-size: 0.8rem;
}

.kroki-photo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0.7rem;
  background: #fff;
  border: 1px solid var(--amana-line, #e2e5ea);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.kroki-photo-card:hover {
  border-color: var(--wo-navy, #466691);
}

.kroki-photo-label {
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--amana-ink, #2c3340);
}

.kroki-photo-card input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.kroki-photo-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 7px;
  background: #eef2f7;
  color: var(--wo-navy, #466691);
  font-size: 0.78rem;
  font-weight: 800;
}

.kroki-photo-card.has-file .kroki-photo-cta {
  background: #dcfce7;
  color: #166534;
}

.report-photo-preview {
  margin-top: 0;
  min-height: 110px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.report-photo-preview img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.report-photo-preview.is-empty::after {
  content: "لم تُرفع صورة";
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
}

.kroki-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0 0.55rem;
  color: var(--wo-navy, #466691);
  font-size: 0.9rem;
}

#reportModal.is-sketch-kroki .report-preview-wrap {
  max-height: 42vh;
  background: #d7e0ea;
  border-radius: 10px;
}

@media (max-width: 720px) {
  #reportModal.is-sketch-kroki .kroki-officer-grid {
    grid-template-columns: 1fr;
  }
}

.rpt-photo-empty {
  min-height: 88px;
  background: repeating-linear-gradient(-45deg, #f1f5f9, #f1f5f9 8px, #e2e8f0 8px, #e2e8f0 16px);
}

.report-preview-wrap {
  overflow: auto;
  max-height: 68vh;
  background: #c5d0dc;
  border: 1px solid var(--amana-line);
  border-radius: 8px;
  padding: 1rem;
}

.report-sheet {
  display: flex;
  justify-content: center;
}

/* Exact municipal landscape sheet proportions */
.rpt-page {
  width: 1280px;
  background: #fff;
  border: 3px solid #12324f;
  border-radius: 4px;
  padding: 8px;
  font-family: "Almarai", Tahoma, sans-serif;
  color: #1a2332;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  direction: ltr;
}

.rpt-letterhead {
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  border: 2px solid #12324f;
  border-radius: 0;
  background: #fff;
}

.rpt-letterhead-inner {
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 8px 12px 8px;
}

.rpt-letterhead-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.rpt-letterhead .rpt-amana-logo {
  display: block;
  width: 100%;
  height: 86px;
  max-width: none;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.rpt-letterhead-copy {
  text-align: center;
  min-width: 0;
}

.rpt-letterhead-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #12324f;
  margin-bottom: 2px;
}

.rpt-letterhead-agency {
  font-size: 18px;
  font-weight: 800;
  color: #12324f;
  line-height: 1.25;
}

.rpt-letterhead-dept {
  font-size: 13px;
  font-weight: 800;
  color: #12324f;
  margin-top: 2px;
}

.rpt-letterhead-project {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-top: 3px;
}

.rpt-letterhead-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 8px 12px;
  border-radius: 0;
  background: #12324f;
  color: #fff;
  text-align: center;
  box-shadow: none;
}

.rpt-letterhead-badge span {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.92;
}

.rpt-letterhead-badge b {
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.rpt-letterhead-bar {
  height: 6px;
  background: #12324f;
}

.rpt-body {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: stretch;
}

.rpt-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.rpt-top-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.rpt-photos-caption {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 800;
  color: #12324f;
  margin: 0 0 2px;
  text-align: right;
}

.rpt-main-map {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 100%;
  height: 100%;
}

.rpt-main-map .rpt-photos-caption {
  order: 0;
  flex: 0 0 auto;
}

.rpt-main-map .rpt-top-thumbs {
  flex: 0 0 auto;
}

.rpt-main-map-only .rpt-frame.rpt-sketch.rpt-sketch-map {
  min-height: 560px;
  flex: 1 1 auto;
}

.rpt-main-map-sketch .rpt-frame.rpt-sketch.rpt-sketch-map {
  min-height: 420px;
  flex: 1 1 auto;
}

.rpt-sketch-map {
  height: 480px;
  background: #0f172a;
}

.rpt-sketch-map img {
  object-fit: cover;
  background: #0f172a;
}

.rpt-bottom {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.rpt-footer-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rpt-footer-bar {
  height: 28px;
  background: #fff;
}

.rpt-frame {
  border: 2px solid #12324f;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
}

.rpt-photo img,
.rpt-locator img,
.rpt-sketch img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rpt-photo,
.rpt-locator {
  height: 110px;
}

.rpt-sketch {
  height: 460px;
  background: #fff;
}

.rpt-sketch img {
  object-fit: contain;
  background: #fff;
  image-rendering: auto;
}

/* لقطة الخريطة الحية: تملأ إطار rpt-frame rpt-sketch rpt-sketch-map بالكامل */
.rpt-frame.rpt-sketch.rpt-sketch-map {
  flex: 1 1 auto;
  min-height: 520px;
  height: 100%;
  align-self: stretch;
  background: #0f172a;
}

.rpt-frame.rpt-sketch.rpt-sketch-map img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  object-position: center center;
  background: #0f172a;
}

.rpt-sidebar {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rpt-sidebar-official {
  gap: 6px;
  padding: 6px;
  border: 2px solid #12324f !important;
  background: #fff;
}

.rpt-agency {
  font-size: 12px;
  font-weight: 800;
  color: #12324f;
  line-height: 1.3;
}

.rpt-dept {
  font-size: 10px;
  font-weight: 700;
  color: #12324f;
  line-height: 1.3;
  margin-bottom: 2px;
}

.rpt-side-sec {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 0;
  border: 1px solid #12324f;
  min-height: 0;
  background: #fff;
}

.rpt-side-rail {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: #12324f;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  text-align: center;
}

.rpt-side-body {
  padding: 5px 6px;
  min-width: 0;
}

.rpt-kv {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 10px;
  margin: 2px 0;
  line-height: 1.35;
}

.rpt-kv > span {
  color: #0f2744;
  font-weight: 700;
  white-space: nowrap;
}

.rpt-kv > b {
  font-weight: 700;
  color: #111827;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.rpt-kv .rpt-accent {
  color: #12324f;
}

.rpt-kv .rpt-fixed {
  color: #0f2744;
}

.rpt-kv-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.rpt-kv-report {
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px dashed #93c5fd;
}

.rpt-qr-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 4px !important;
}

.rpt-qr-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rpt-qr-arrow {
  color: #dc2626;
  font-size: 10px;
  font-weight: 800;
}

.rpt-utm-title {
  font-size: 9px;
  font-weight: 800;
  color: #0f2744;
  text-align: center;
  margin-bottom: 4px;
}

.rpt-utm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.rpt-utm-table th,
.rpt-utm-table td {
  border: 1px solid #12324f;
  padding: 2px 3px;
  text-align: center;
}

.rpt-utm-table th {
  background: #12324f;
  color: #fff;
  font-weight: 800;
}

.rpt-utm-p,
.rpt-utm-e,
.rpt-utm-n {
  color: #dc2626;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rpt-office {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rpt-office-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 2px 0 4px;
}

.rpt-office-logo {
  display: block;
  max-width: 140px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.rpt-office-phone {
  font-size: 8px;
  color: #475569;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 2px;
}

.rpt-stamp b {
  min-height: 28px;
  display: block;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
}

.rpt-notes-box {
  min-height: 48px;
  font-size: 10px;
  color: #334155;
  line-height: 1.4;
  white-space: pre-wrap;
}

.rpt-brand {
  text-align: center;
  padding: 4px 4px 2px;
}

.rpt-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
  padding: 4px 2px;
}

.rpt-amana-logo {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  max-height: 72px;
  object-fit: contain;
}

.rpt-logo-stack {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rpt-seal {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid #12324f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #12324f;
  background: #eef4fa;
}

.rpt-seal-sm {
  width: 44px;
  height: 44px;
  font-size: 11px;
  align-self: center;
}

.rpt-entity {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  color: #12324f;
}

.rpt-meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.rpt-meta-table th,
.rpt-meta-table td {
  border: 1px solid #12324f;
  padding: 3px 5px;
  vertical-align: middle;
}

.rpt-meta-table th {
  width: 38%;
  background: #12324f;
  color: #fff;
  font-weight: 700;
  text-align: right;
}

.rpt-meta-table td {
  text-align: right;
  background: #fff;
}

.rpt-qr {
  width: 84px;
  height: 84px;
  margin: 2px auto;
}

.rpt-qr img {
  width: 84px !important;
  height: 84px !important;
}

.rpt-qr-fallback {
  font-size: 9px;
  word-break: break-all;
  text-align: center;
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  color: #64748b;
}

.rpt-mini-legend {
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #12324f;
  padding: 4px;
}

.rpt-legend-line {
  width: 28px;
  height: 0;
  border-top: 3px solid #dc2626;
  display: inline-block;
}

.rpt-section-head {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #12324f;
  border: 1px solid #12324f;
  padding: 3px 6px;
  text-align: center;
}

.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.rpt-table th,
.rpt-table td {
  border: 1px solid #12324f;
  padding: 4px 6px;
  text-align: center;
}

.rpt-table thead th {
  background: #12324f;
  color: #fff;
  font-weight: 700;
}

.rpt-coord-table {
  font-size: 10px;
}

.rpt-vac {
  margin-top: auto;
  text-align: center;
  font-size: 10px;
  color: #12324f;
  padding-top: 6px;
}

.rpt-vac-mark {
  display: inline-block;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.08em;
  border: 2px solid #12324f;
  padding: 2px 10px;
  margin-bottom: 2px;
}

.rpt-sides,
.rpt-notes {
  padding: 0;
  min-height: 130px;
}

.rpt-sides .rpt-table {
  font-size: 11px;
}

.rpt-sides-table .col-dir {
  width: 70px;
  font-weight: 700;
}

.rpt-sides-table .col-len {
  width: 70px;
  color: #dc2626;
  font-weight: 700;
}

.rpt-sum-row td {
  background: #eef4fa;
  font-weight: 700;
}

.rpt-area-row td {
  background: #fff1f2;
  font-weight: 800;
  color: #dc2626;
  font-size: 13px;
}

.rpt-lw-row td {
  background: #f8fafc;
  font-weight: 700;
  color: #12324f;
}

.rpt-notes {
  padding: 0 0 8px;
}

.rpt-notes p {
  margin: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: #334155;
  min-height: 70px;
}

#reportModal .modal-body {
  background: #f7f9fb;
}

#reportModal .modal-dialog {
  max-width: 1320px;
}

/* RTL form fields: right-aligned text */
.form-control,
.form-select {
  text-align: right;
}

.form-control-rtl,
textarea.form-control-rtl {
  text-align: right;
  direction: rtl;
}

#woBoundaryPoints {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  background-color: #f8fafc;
  resize: vertical;
  min-height: 5.5rem;
}

/* —— Work-order modal (report identity) —— */
.wo-modal {
  font-family: "Almarai", Tahoma, sans-serif;
  border: none;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.wo-modal-header {
  background: var(--wo-navy, #466691);
  color: #fff;
  border-bottom: none;
  align-items: flex-start;
  position: relative;
  padding-inline-start: 1rem;
  padding-inline-end: 3rem; /* مساحة لزر الإغلاق على اليسار */
}

.wo-modal-header .btn-close {
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  margin: 0 !important;
  opacity: 0.95;
}

.wo-modal-header .btn-close:hover {
  opacity: 1;
}

.wo-modal-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wo-modal-logo {
  width: 64px;
  height: auto;
  background: #fff;
  border-radius: 4px;
  padding: 4px;
}

.wo-modal-agency {
  font-size: 0.78rem;
  opacity: 0.9;
  margin-bottom: 0.15rem;
}

.wo-modal-header .modal-title {
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0;
}

.wo-modal-lead {
  color: #5a6577;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.wo-section-title {
  background: var(--wo-navy, #466691);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.45rem 0.75rem;
  border-radius: 3px;
  margin-bottom: 0.35rem;
}

.wo-modal .form-label {
  font-weight: 700;
  color: #334155;
  font-size: 0.86rem;
}

.wo-modal-footer {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.btn-wo-primary {
  background: var(--wo-navy, #466691);
  border-color: var(--wo-navy-dark, #355074);
  color: #fff;
  font-weight: 700;
  font-family: inherit;
}

.btn-wo-primary:hover {
  background: var(--wo-navy-dark, #355074);
  border-color: #2c4260;
  color: #fff;
}

.wo-modal-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.wo-modal-loader.d-none { display: none !important; }

.wo-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #dbe4f0;
  border-top-color: var(--wo-navy, #466691);
  border-radius: 50%;
  animation: woSpin 0.75s linear infinite;
}

.wo-loader-text {
  font-weight: 700;
  color: var(--wo-navy, #466691);
  font-size: 0.95rem;
}

@keyframes woSpin {
  to { transform: rotate(360deg); }
}

/* —— Work-order print sheet —— */
.wo-print-root {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 794px;
  background: #fff;
  z-index: -1;
}

.wo-print-page {
  width: 794px;
  min-height: 1123px;
  padding: 28px 32px 36px;
  box-sizing: border-box;
  background: #fff;
  color: #111;
  font-family: "Almarai", Tahoma, sans-serif;
  direction: rtl;
}

.wo-print-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.wo-print-header-side {
  font-size: 12px;
  line-height: 1.55;
  color: #222;
}

.wo-print-header-side.is-end { text-align: left; }
.wo-print-header-side.is-start { text-align: right; }

.wo-print-logo {
  width: 100px;
  height: auto;
  display: block;
  margin: 0 auto;
  background: #fff;
  padding: 4px;
  border-radius: 2px;
}

.wo-print-rule {
  border: none;
  border-top: 1px solid #9ca3af;
  margin: 8px 0 14px;
}

.wo-print-title {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 4px;
}

.wo-print-date {
  text-align: center;
  font-size: 13px;
  margin: 0 0 14px;
  color: #333;
}

.wo-print-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 12.5px;
}

.wo-print-table th {
  background: #466691;
  color: #fff;
  font-weight: 700;
  border: 1px solid #334155;
  padding: 7px 8px;
  text-align: center;
}

.wo-print-table td {
  border: 1px solid #334155;
  padding: 8px;
  text-align: center;
  background: #fff;
  min-height: 28px;
}

.wo-print-map-head {
  background: #466691;
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: 8px;
  border: 1px solid #334155;
  border-bottom: none;
}

.wo-print-map-frame {
  border: 1px solid #334155;
  height: 460px;
  overflow: hidden;
  position: relative;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wo-print-map-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.wo-print-vertex {
  background: transparent !important;
  border: none !important;
}

.wo-print-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  font-size: 13px;
  font-weight: 700;
}

.wo-print-sign {
  min-width: 42%;
  line-height: 2;
}


/* —— Building report accordion (mobile) —— */
.bld-editor {
  position: absolute;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.bld-editor[hidden] { display: none !important; }
.bld-editor.is-open {
  /* keep overlay click-through so the map stays usable */
  pointer-events: none;
}

.bld-editor-body {
  flex: 1;
  min-height: 0;
  position: relative;
  pointer-events: none;
}

.bld-editor-side {
    --bld-side-width: 380px;
    pointer-events: auto;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--bld-side-width);
    min-width: 26vw;
    max-width: 57vw;
    background: #eef2f5;
    border-left: 1px solid #d7dee5;
    box-shadow: -8px 0 28px rgba(15, 23, 42, 0.14);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    font-family: Almarai, Tahoma, sans-serif;
    animation: bldSideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bld-side-resizer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 10px;
  z-index: 5;
  cursor: ew-resize;
  touch-action: none;
  background: transparent;
}

.bld-side-resizer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 2px;
  width: 4px;
  height: 48px;
  margin-top: -24px;
  border-radius: 999px;
  background: #94a3b8;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease, height 0.15s ease;
}

.bld-side-resizer:hover::before,
.bld-side-resizer:focus-visible::before,
.bld-editor-side.is-resizing .bld-side-resizer::before {
  opacity: 1;
  background: #466691;
  height: 64px;
}

.bld-editor-side.is-resizing {
  user-select: none;
  transition: none;
}

.bld-editor-side.is-resizing,
body.is-bld-side-resizing {
  cursor: ew-resize !important;
}

body.is-bld-side-resizing {
  user-select: none;
}

body.is-bld-side-resizing iframe {
  pointer-events: none;
}

@keyframes bldSideIn {
  from { transform: translateX(20px); opacity: 0.5; }
  to { transform: translateX(0); opacity: 1; }
}

.bld-report-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 58px;
  padding: 8px 10px;
  background: #12324f;
  color: #fff;
}

.bld-header-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 42px;
  padding: 3px 7px;
  background: #fff;
  border-radius: 9px;
  line-height: 0;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.bld-header-logo-img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 108px;
  object-fit: contain;
}

.bld-report-title {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bld-editor-x,
.bld-header-menu {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bld-editor-x:active,
.bld-header-menu:active { transform: scale(0.94); }

.bld-editor-side-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px 18px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.bld-accordion {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-inline-start: 0.35rem;
}

.bld-accordion::before {
  content: "";
  position: absolute;
  top: 1.15rem;
  bottom: 1.15rem;
  inset-inline-start: 1.55rem;
  width: 2px;
  background: #c5d0dc;
  border-radius: 2px;
  pointer-events: none;
  z-index: 0;
}

.bld-acc {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  padding-bottom: 0.7rem;
}

.bld-acc:last-child {
  padding-bottom: 0;
}

.bld-acc-head {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr 34px;
  align-items: center;
  gap: 10px;
  border: 1px solid #dde5ea;
  background: #fff;
  padding: 11px 12px;
  text-align: right;
  cursor: pointer;
  font-family: inherit;
  color: #0f172a;
  min-height: 52px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.bld-acc-head:hover {
  border-color: #b8c7d9;
  box-shadow: 0 2px 8px rgba(70, 102, 145, 0.1);
}

.bld-acc.is-open .bld-acc-head {
  background: #466691;
  color: #fff;
  border-color: #466691;
  box-shadow: 0 4px 14px rgba(70, 102, 145, 0.22);
  border-radius: 12px 12px 0 0;
}

.bld-acc-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #466691;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 0 0 4px #eef3f8;
  position: relative;
  z-index: 2;
}

.bld-acc.is-open .bld-acc-num {
  background: #fff;
  color: #466691;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.bld-acc-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.bld-acc-toggle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  background: #f1f5f9;
  border: 1px solid #dbe3ee;
  color: #466691;
  position: relative;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.bld-acc-toggle::before,
.bld-acc-toggle::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.bld-acc-toggle::before {
  width: 12px;
  height: 2px;
}

.bld-acc-toggle::after {
  width: 2px;
  height: 12px;
}

.bld-acc.is-open .bld-acc-toggle {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.bld-acc.is-open .bld-acc-toggle::after {
  opacity: 0;
  transform: scaleY(0);
}

.bld-acc-body {
  display: none;
  padding: 12px 14px 14px;
  background: #fff;
  border: 1px solid #dde5ea;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  margin-top: -1px;
}

.bld-acc.is-open .bld-acc-body { display: block; }

.bld-field-label {
  display: block;
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 6px;
}

.bld-field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d5dee6;
  border-radius: 8px;
  background: #f8fafb;
  padding: 0 10px;
  margin-bottom: 10px;
  min-height: 46px;
}

.bld-field-ico {
  color: #7b8a97;
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}

.bld-field .bld-input,
.bld-field .bld-select {
  border: none;
  background: transparent;
  margin: 0;
  padding: 0.65rem 0;
  min-height: 44px;
  font-size: 16px;
  width: 100%;
  font-family: inherit;
  color: #0f172a;
  outline: none;
  text-align:right;
}

.bld-textarea {
  width: 100%;
  border: 1px solid #d5dee6;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font-family: inherit;
  font-size: 16px;
  min-height: 130px;
  resize: vertical;
  background: #f8fafb;
  color: #0f172a;
}

.bld-geo-card {
  border: 1px solid #cfe8ea;
  background: #f3fbfb;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
}

.bld-geo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #466691;
}

.bld-geo-refresh {
  border: none;
  background: #466691;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

.bld-geo-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 8px;
}

.bld-geo-live-ico {
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 2px #fff;
}

.bld-geo-live-ico.is-on,
.bld-geo-card.is-live .bld-geo-live-ico {
  background: #16a34a;
}

.bld-geo-live-ico.is-on::before,
.bld-geo-live-ico.is-on::after,
.bld-geo-card.is-live .bld-geo-live-ico::before,
.bld-geo-card.is-live .bld-geo-live-ico::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(22, 163, 74, 0.55);
  animation: userLocPulse 1.8s ease-out infinite;
}

.bld-geo-live-ico.is-on::after,
.bld-geo-card.is-live .bld-geo-live-ico::after {
  animation-delay: 0.9s;
}

/* خريطة: أيقونة الموقع الحالي (نبض أخضر) */
.user-loc-icon {
  background: transparent !important;
  border: none !important;
}

.user-loc-marker {
  position: relative;
  width: 22px;
  height: 33px;
  pointer-events: none;
}

.user-loc-pulse {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.35);
  animation: userLocPulse 1.8s ease-out infinite;
}

.user-loc-pulse--delay {
  animation-delay: 0.9s;
}

.user-loc-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 33px;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.35));
}

@keyframes userLocPulse {
  0% {
    transform: scale(0.55);
    opacity: 0.85;
  }
  70% {
    transform: scale(2.4);
    opacity: 0;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

.bld-kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 0.85rem;
}
.bld-kv span { color: #64748b; }
.bld-kv b { color: #0f172a; font-weight: 700; }

.bld-info-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8f4ff;
  color: #1e4b7a;
  font-size: 0.8rem;
  border: 1px solid #cfe3f8;
}

.bld-req { color: #dc2626; font-weight: 800; }

.bld-input-block {
  width: 100%;
  border: 1px solid #d5dee6;
  border-radius: 8px;
  background: #f8fafb;
  padding: 0.7rem 0.8rem;
  min-height: 44px;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 10px;
}

.bld-opt-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #1e3a5f;
  background: #eef2f6;
  border: 1px solid #d7e3ee;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  line-height: 1.45;
}

.bld-opt-label::before {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #466691;
  box-shadow: 0 0 0 4px rgba(70, 102, 145, 0.16);
}

.bld-opt-label::after {
  content: "اختر";
  margin-inline-start: auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  padding: 2px 8px;
}

.bld-opt-group.is-check + .bld-opt-label,
.bld-opt-group + .bld-opt-label {
  margin-top: 16px;
}

.bld-opt-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
  padding: 10px;
  background: #fff;
  border: 1px solid #d7e3ee;
  border-top: 1px dashed #d7e3ee;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.bld-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d5dee6;
  background: #f8fafc;
  border-radius: 999px;
  padding: 0.48rem 0.85rem 0.48rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bld-opt:hover {
  border-color: #466691;
  background: #fff;
  color: #1e3a5f;
}

.bld-opt input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  border: 2px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bld-opt input::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}

.bld-opt:has(input:checked) {
  border-color: #466691;
  background: #466691;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(70, 102, 145, 0.28);
}

.bld-opt:has(input:checked) input {
  border-color: #fff;
  background: #fff;
}

.bld-opt:has(input:checked) input::after {
  background: #466691;
}

.bld-opt-group.is-check .bld-opt {
  border-radius: 10px;
}

.bld-opt-group.is-check .bld-opt input {
  border-radius: 4px;
}

.bld-opt-group.is-check .bld-opt input::after {
  width: 8px;
  height: 5px;
  border-radius: 0;
  border: 2px solid transparent;
  border-top: 0;
  border-inline-start: 0;
  transform: rotate(45deg) translate(-1px, -1px);
  background: transparent;
}

.bld-opt-group.is-check .bld-opt:has(input:checked) input::after {
  border-color: #466691;
}

.bld-opt-label:has(+ .bld-opt-group.is-check)::after {
  content: "متعدد";
}

.bld-file {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.bld-acc-body > .bld-select {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  border: 1px solid #d5dee6;
  border-radius: 8px;
  background: #fff;
  padding: 0.55rem 0.7rem;
  min-height: 42px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #0f172a;
}

.bld-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.bld-photo-card {
  position: relative;
  border: 1px solid #d5dee6;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.bld-photo-card img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #e5e7eb;
  cursor: zoom-in;
}

.bld-photo-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0.4rem 0.45rem 0.5rem;
}

.bld-photo-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bld-photo-kind-select {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1px solid #c5d0db;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 0.72rem;
  font-family: inherit;
  padding: 0 0.35rem;
}

.bld-photo-kind-select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.bld-photo-del {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

.bld-photo-del:hover { background: #fecaca; }
.bld-photo-del:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bld-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12050;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bld-photo-lightbox[hidden] {
  display: none !important;
}

.bld-photo-lightbox-bar {
  position: absolute;
  top: 0;
  inset-inline: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
}

.bld-photo-lightbox-bar strong {
  font-size: 0.95rem;
}

.bld-photo-lightbox-close {
  border: none;
  background: transparent;
  color: #f8fafc;
  font-size: 1.6rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  border-radius: 6px;
}

.bld-photo-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.bld-photo-lightbox img {
  max-width: min(96vw, 1100px);
  max-height: calc(100vh - 5.5rem);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  margin-top: 2.5rem;
}

/* TinyMCE inside building report accordion */
.bld-acc-body .tox-tinymce {
  border: 1px solid #d5dee6 !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.bld-acc-body .tox .tox-editor-header {
  background: #eceff1 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.bld-acc-body .tox .tox-toolbar,
.bld-acc-body .tox .tox-toolbar__overflow,
.bld-acc-body .tox .tox-toolbar__primary {
  background: #eceff1 !important;
}

.bld-acc-body .tox .tox-statusbar {
  border-top: 1px solid #dde3e8 !important;
  background: #f8fafb !important;
}

.bld-acc-body .tox:not(.tox-tinymce-inline) .tox-editor-header {
  border-bottom: 1px solid #dde3e8;
}

.bld-acc-body .tox .tox-tbtn {
  margin: 1px;
}

.bld-acc-body textarea.bld-richtext {
  min-height: 220px;
}

.bld-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 10px;
}

.bld-btn-secondary {
  border: 1px solid #466691;
  background: #fff;
  color: #466691;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
}
.bld-btn-secondary:hover { background: #ecfdf5; }

.bld-files-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  margin-inline-start: 6px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}

.bld-lab-empty {
  margin: 0.35rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.bld-lab-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.bld-lab-file-meta {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.bld-lab-file-meta b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bld-lab-dl-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid #c7d7e8;
  border-radius: 10px;
  background: #fff;
  color: #466691;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.bld-lab-dl-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.bld-lab-dl-icon:hover {
  background: #eef4fb;
  color: #355074;
}

.bld-lab-dl-icon.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.lab-pdf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4500;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}

.lab-pdf-lightbox[hidden] {
  display: none !important;
}

.lab-pdf-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border-radius: 12px 12px 0 0;
  direction: rtl;
}

.lab-pdf-lightbox-titles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.lab-pdf-lightbox-titles strong {
  color: #1e3a5f;
  font-size: 0.95rem;
}

.lab-pdf-lightbox-titles span {
  color: #64748b;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-pdf-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.lab-pdf-lightbox-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #334155;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

#labPdfLightboxFrame {
  flex: 1;
  width: 100%;
  border: 0;
  border-radius: 0 0 12px 12px;
  background: #111;
  min-height: 0;
}

.lab-pdf-lightbox-fallback {
  margin: 0;
  padding: 1rem;
  background: #fff;
  color: #475569;
  text-align: center;
  border-radius: 0 0 12px 12px;
}

.bld-acc-actions {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #dce4ea;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.bld-act {
  border-radius: 8px;
  min-height: 44px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
}

.bld-act svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.bld-act-cancel {
  background: #eef1f4;
  color: #475569;
  border-color: #d5dde4;
}

.bld-act-draft {
  background: #fff;
  color: #466691;
  border-color: #466691;
}

.bld-act-save {
  background: #466691;
  color: #fff;
}

.bld-act-finish {
  background: var(--amana-accent, #0d6e6e);
  color: #fff;
  border-color: var(--amana-accent, #0d6e6e);
}

.bld-act-finish:hover {
  filter: brightness(0.95);
}

.bld-act-review-ok {
  background: var(--amana-accent, #0d6e6e);
  color: #fff;
  border-color: var(--amana-accent, #0d6e6e);
}

.bld-act-review-notes {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}

.bld-act-review-notes.is-compose-send {
  background: #9a3412;
  color: #fff;
  border-color: #9a3412;
}

#bldConfirmComments.is-review-compose {
  background: #fff;
  border-color: #fdba74;
  box-shadow: 0 0 0 3px rgba(253, 186, 116, 0.25);
}

.bld-review-history {
  margin: 0.85rem 0 0.35rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.bld-review-history .bld-opt-label {
  margin-bottom: 0.45rem;
}

.bld-review-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 220px;
  overflow-y: auto;
}

.bld-review-history-item {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-inline-start: 4px solid #94a3b8;
}

.bld-review-history-item.is-internal {
  background: #f8fafc;
  border-color: #cbd5e1;
  border-inline-start-color: #466691;
}

.bld-review-history-item.is-approval {
  background: #fff7ed;
  border-color: #fed7aa;
  border-inline-start-color: #c2410c;
}

.bld-review-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.bld-review-source {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.3;
}

.bld-review-source.is-internal {
  background: #e8eef6;
  color: #355074;
}

.bld-review-source.is-approval {
  background: #ffedd5;
  color: #9a3412;
}

.bld-review-history-meta strong {
  color: #334155;
  font-weight: 800;
}

.bld-review-history-item.is-internal .bld-review-history-meta strong {
  color: #355074;
}

.bld-review-history-item.is-approval .bld-review-history-meta strong {
  color: #9a3412;
}

.bld-review-history-notes {
  font-size: 0.86rem;
  line-height: 1.5;
  color: #1e293b;
  white-space: pre-wrap;
}

.bld-review-history-empty {
  margin: 0;
  padding: 0.35rem 0.15rem;
  color: #94a3b8;
  font-size: 0.82rem;
}

.measure-app.is-review-viewer .bld-act-save,
.measure-app.is-review-viewer .bld-act-finish {
  display: none !important;
}

.bld-act-finish:disabled,
.bld-act-save:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.bld-lock-banner {
  margin: 0 10px 10px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--amana-accent-soft, #e6f3f3);
  border: 1px solid color-mix(in srgb, var(--amana-accent, #0d6e6e) 25%, #e2e5ea);
  color: var(--amana-accent, #0d6e6e);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.bld-editor.is-report-locked .bld-editor-side-scroll {
  opacity: 1;
}

.bld-editor.is-report-locked .bld-acc-body input,
.bld-editor.is-report-locked .bld-acc-body select,
.bld-editor.is-report-locked .bld-acc-body textarea {
  background: #f3f6f8;
  color: #475569;
  pointer-events: none;
}

.bld-editor.is-report-locked.is-review-notes-open #bldConfirmComments {
  background: #fff;
  color: #0f172a;
  pointer-events: auto;
  cursor: text;
  border-color: #fdba74;
  box-shadow: 0 0 0 3px rgba(253, 186, 116, 0.22);
}

.bld-editor.is-report-locked .bld-acc-body .bld-opt,
.bld-editor.is-report-locked .bld-acc-body button:not(.bld-acc-head),
.bld-editor.is-report-locked .bld-acc-body input[type="file"] {
  pointer-events: none;
}

.bld-editor.is-report-locked .bld-acc-head {
  pointer-events: auto;
  cursor: pointer;
}

.db-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.db-confirm-overlay.d-none { display: none !important; }

.db-confirm-card {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--amana-line, #e2e5ea);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  padding: 1.25rem 1.2rem 1.1rem;
  text-align: center;
  animation: dbConfirmIn 0.22s ease;
}

@keyframes dbConfirmIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.db-confirm-ico {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--amana-accent-soft, #e6f3f3);
  color: var(--amana-accent, #0d6e6e);
  font-size: 1.45rem;
  font-weight: 800;
}

.db-confirm-ico::before { content: "?"; }
.db-confirm-card.is-warn .db-confirm-ico {
  background: #fff7ed;
  color: #c2410c;
}
.db-confirm-card.is-danger .db-confirm-ico {
  background: #fef2f2;
  color: #dc2626;
}
.db-confirm-card.is-danger .db-confirm-ico::before { content: "!"; }

.db-confirm-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--amana-ink, #2c3340);
}

.db-confirm-text {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--amana-muted, #6b7280);
  line-height: 1.55;
}

.db-confirm-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.db-confirm-btn {
  min-width: 7.5rem;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.4rem 0.9rem;
}

.db-confirm-btn.is-primary {
  background: var(--amana-accent, #0d6e6e);
  color: #fff;
}

.db-confirm-btn.is-danger {
  background: #dc2626;
  color: #fff;
}

.db-confirm-btn.is-ghost {
  background: #f3f4f6;
  color: #475569;
  border-color: #e5e7eb;
}

/* Keep map + controls usable while the side editor is open */
.fc-app.is-building-editor .fc-map.map-stage,
.fc-app.is-building-editor #map {
  pointer-events: auto;
}

/* Flush-dock map controls to the left edge of bld-editor-side (no gap) */
.fc-app.is-building-editor .fc-map-controls {
  right: var(--bld-side-width, 380px);
  left: 12px;
  width: auto;
  max-width: none;
  align-items: center;
  z-index: 1305;
  transition: right 0.12s ease;
}

.fc-app.is-building-editor .fc-map-controls .fc-map-search {
  width: 220px;
  flex-shrink: 0;
}

.fc-app.is-building-editor .fc-map-controls .fc-map-stack {
  align-self: center;
  max-width: 100%;
  flex: 1 1 auto;
}

.fc-app.is-building-editor .map-legend {
  right: var(--bld-side-width, 380px);
  left: auto;
  z-index: 1305;
  transition: right 0.12s ease;
}

.fc-app.is-building-editor.is-bld-resizing .fc-map-controls,
.fc-app.is-building-editor.is-bld-resizing .map-legend {
  transition: none;
}

@media (max-width: 900px) {
  .bld-editor-side {
    left: auto;
    right: 0;
    max-width: 57vw;
  }
}

/* —— DB save overlay + toast —— */
.db-feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(15, 23, 42, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  backdrop-filter: blur(2px);
}
.db-feedback-overlay.d-none { display: none !important; }

.db-feedback-card {
  min-width: min(92vw, 340px);
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 1.6rem 1.4rem 1.35rem;
  text-align: center;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  direction: rtl;
}

.db-feedback-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border: 4px solid #e2e8f0;
  border-top-color: #466691;
  border-radius: 50%;
  animation: woSpin 0.75s linear infinite;
}

.db-feedback-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #1e3a5f;
  margin-bottom: 0.35rem;
}

.db-feedback-text {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.55;
}

.db-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% - 8px)) scale(0.98);
  z-index: 10040;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: min(92vw, 380px);
  max-width: 460px;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
  direction: rtl;
  border: 1px solid #e2e8f0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.db-toast.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.db-toast.d-none { display: none !important; }

.db-toast-ico {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.05rem;
  margin-top: 0;
}
.db-toast.is-ok .db-toast-ico { background: #16a34a; }
.db-toast.is-ok .db-toast-ico::before { content: "✓"; }
.db-toast.is-err .db-toast-ico { background: #dc2626; }
.db-toast.is-err .db-toast-ico::before { content: "!"; }
.db-toast.is-ok { border-color: #bbf7d0; background: #f0fdf4; }
.db-toast.is-err { border-color: #fecaca; background: #fef2f2; }

.db-toast-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.db-toast-body strong {
  font-size: 0.92rem;
  color: #0f172a;
}
.db-toast-body span {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.45;
  word-break: break-word;
}
.db-toast-close {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}
.db-toast-close:hover { color: #0f172a; }

.bld-act-save.is-busy,
.bld-act-save:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* ========== Responsive: tablet + phone (map first) ========== */
@media (max-width: 1100px) {
  .fc-app.is-compact .fc-body,
  .fc-body {
    grid-template-columns: 1fr !important;
    height: calc(100% - var(--fc-topbar-h));
  }

  .fc-nav,
  .fc-filters.sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    z-index: 1400;
    width: min(88vw, 320px) !important;
    max-width: 100%;
    min-width: 0;
    visibility: visible !important;
    opacity: 1 !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -12px 0 32px rgba(15, 23, 42, 0.22);
    border-color: var(--amana-line) !important;
    padding: 0 !important;
    transition: transform 0.32s var(--fc-panel-ease);
  }

  .fc-nav { display: flex !important; flex-direction: column; }
  .fc-filters.sidebar { display: flex !important; }

  .fc-app.is-nav-collapsed .fc-nav,
  .fc-app.is-filters-collapsed .fc-filters.sidebar {
    transform: translate3d(110%, 0, 0);
    pointer-events: none;
  }

  .fc-app:not(.is-nav-collapsed) .fc-nav,
  .fc-app:not(.is-filters-collapsed) .fc-filters.sidebar {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }

  .fc-drawer-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1350;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.38);
    display: none;
    cursor: pointer;
  }

  .fc-app:not(.is-nav-collapsed) .fc-drawer-backdrop,
  .fc-app:not(.is-filters-collapsed) .fc-drawer-backdrop {
    display: block;
  }

  .fc-reopen-rail {
    display: flex;
  }

  .fc-link-btn { display: none; }

  .leaflet-top.leaflet-right {
    display: none;
  }

  .leaflet-control-attribution {
    max-width: 58vw;
    font-size: 9px !important;
  }
}

@media (max-width: 720px) {
  .fc-topbar {
    height: calc(48px + var(--fc-safe-top));
    padding-top: var(--fc-safe-top);
    padding-inline: 0.4rem;
    gap: 0.35rem;
  }

  .fc-body {
    height: calc(100% - 48px - var(--fc-safe-top));
  }

  .fc-logo {
    padding: 2px 6px;
    border-radius: 8px;
  }
  .fc-logo-img { height: 32px; max-width: 96px; }
  .fc-project { padding: 0.2rem 0.3rem; font-size: 0.82rem; }
  .fc-caret { display: none; }

  .fc-toggle-btn {
    min-height: 40px;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
  }

  .fc-icon-btn,
  .fc-icon-add {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .fc-btn-full { display: none; }
  .fc-btn-short { display: inline; }
  .fc-btn {
    min-height: 40px;
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
  }

  .fc-map-controls {
    top: 10px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    pointer-events: none;
  }

  .fc-map-controls > * { pointer-events: auto; }

  .fc-map-search {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    border-radius: 10px;
    overflow: visible;
  }

  .fc-map-search input {
    font-size: 16px;
    min-height: 44px;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
  }

  .fc-map-stack {
    width: 100%;
    max-width: none;
    height: 44px;
    border-radius: 12px;
  }

  .fc-map-btn {
    width: 44px;
    height: 44px;
  }

  .fc-map-btn svg {
    width: 20px;
    height: 20px;
  }

  .fc-draw-status {
    top: auto;
    bottom: calc(58px + var(--fc-safe-bottom));
    right: 8px;
    left: 8px;
    max-width: none;
    font-size: 0.8rem;
    border-radius: 10px;
    pointer-events: none;
  }

  .fc-reopen-rail {
    top: auto;
    right: 8px;
    left: auto;
    bottom: calc(12px + var(--fc-safe-bottom));
    flex-direction: row;
    gap: 8px;
    z-index: 1200;
  }

  .fc-reopen-tab {
    writing-mode: horizontal-tb;
    transform: none;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    min-height: 44px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  }

  .map-legend {
    right: 8px;
    left: 8px;
    bottom: calc(62px + var(--fc-safe-bottom));
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 10px;
    font-size: 0.72rem;
    padding: 0.4rem 0.55rem;
  }

  .fc-app:not(.is-nav-collapsed) .map-legend,
  .fc-app:not(.is-filters-collapsed) .map-legend,
  .fc-app.is-building-editor .map-legend {
    display: none;
  }

  .bld-editor {
    inset: 0;
    z-index: 1500;
  }

  .bld-editor-side {
    top: 8vh;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0;
    border: none;
    box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.22);
    animation: bldSheetUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .bld-side-resizer { display: none !important; }

  .bld-report-header {
    padding-top: 10px;
    min-height: 56px;
  }

  .bld-acc-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px 10px calc(10px + var(--fc-safe-bottom));
  }

  .bld-act span {
    font-size: 0.78rem;
  }

  .fc-app.is-building-editor .fc-map-controls,
  .fc-app.is-building-editor .fc-reopen-rail {
    display: none;
  }

  .fc-app.is-building-editor .fc-map-controls .fc-map-search {
    width: auto;
  }

  .wo-modal-logo { width: 48px; }

  .fc-input,
  .form-control,
  .form-select,
  .bld-select,
  .bld-file {
    font-size: 16px !important;
  }

  .bld-photo-grid {
    grid-template-columns: 1fr 1fr;
  }

  .db-toast {
    top: calc(0.7rem + var(--fc-safe-top));
    min-width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
  }
}

@keyframes bldSheetUp {
  from { transform: translateY(24px); opacity: 0.55; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 720px) and (orientation: landscape) {
  .fc-map-stack {
    height: 40px;
  }

  .bld-editor-side {
    top: 0;
    border-radius: 0;
  }

  .map-legend { display: none; }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .fc-map-controls {
    width: auto;
    max-width: calc(100% - 24px);
  }

  .fc-map-search { width: 200px; flex-shrink: 0; }

  .fc-map-stack { max-width: calc(100% - 220px); }

  .fc-draw-status {
    right: 12px;
    left: 12px;
    max-width: none;
    top: 60px;
  }

  .bld-editor-side {
    max-width: 57vw;
  }

  .fc-app.is-building-editor .fc-map-controls {
    right: var(--bld-side-width, 57vw);
  }
}

@media (max-width: 720px) {
  #workOrderModal .modal-dialog,
  #reportModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: 100%;
    min-height: 100%;
  }

  #workOrderModal .modal-content,
  #reportModal .modal-content {
    height: 100%;
    border-radius: 0;
    border: none;
  }

  #workOrderModal .modal-body,
  #reportModal .modal-body {
    padding-bottom: calc(1rem + var(--fc-safe-bottom));
  }
}

@media (max-width: 380px) {
  .fc-project { display: none; }
  .fc-logo-img { height: 30px; max-width: 84px; }
}

button, .fc-map-btn, .fc-toggle-btn, .bld-acc-head {
  touch-action: manipulation;
}

/* مسئول الكروكي: تعديل أبعاد المبنى وإنشاء ملف الكروكي فقط */
.measure-app.is-sketch-officer #btnWorkOrder,
.measure-app.is-sketch-officer #btnMapWorkOrder,
.measure-app.is-sketch-officer #btnMapSaveWorkOrder,
.measure-app.is-sketch-officer #btnMapEditWorkOrder,
.measure-app.is-sketch-officer #btnMapPrintWorkOrder,
.measure-app.is-sketch-officer #btnStartDraw,
.measure-app.is-sketch-officer #btnFinish,
.measure-app.is-sketch-officer #btnUndo,
.measure-app.is-sketch-officer #btnReset,
.measure-app.is-sketch-officer #btnExportPdf,
.measure-app.is-sketch-officer #btnUploadLabResult,
.measure-app.is-sketch-officer #btnMapMeasure,
.measure-app.is-sketch-officer #workOrderPanel,
.measure-app.is-sketch-officer #buildingEditor,
.measure-app.is-sketch-officer .fc-map-stack > .fc-map-stack-sep:first-of-type {
  display: none !important;
}

/* زر تصدير الكروكي: يظهر فقط في وضع مسئول الكروكي */
#btnExportSketch {
  display: none !important;
}

.measure-app.is-sketch-officer #btnExportSketch {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: #0f4c81;
  border-color: #93c5fd;
  background: #eff6ff;
}

.measure-app.is-sketch-officer #btnExportSketch:not(:disabled):hover {
  background: #dbeafe;
}

.measure-app.is-sketch-officer #btnExportSketch.is-on {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.measure-app.is-sketch-officer:not(.is-nav-collapsed) .fc-nav {
  display: block !important;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1100px) {
  .measure-app.is-sketch-officer:not(.is-phone) .fc-body {
    grid-template-columns: var(--fc-nav-w) 1fr !important;
  }
  .measure-app.is-sketch-officer:not(.is-phone).is-nav-collapsed .fc-body {
    grid-template-columns: 1fr !important;
  }
  .measure-app.is-sketch-officer:not(.is-phone) .fc-nav {
    position: relative !important;
    top: auto;
    bottom: auto;
    right: auto;
    left: auto;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    z-index: auto;
    box-shadow: none !important;
    overflow: auto;
    padding: 0;
    border-color: var(--amana-line) !important;
  }
  .measure-app.is-sketch-officer:not(.is-phone).is-nav-collapsed .fc-nav {
    display: none !important;
  }
  .measure-app.is-sketch-officer:not(.is-phone):not(.is-filters-collapsed) .fc-drawer-backdrop {
    display: block;
  }
  .measure-app.is-sketch-officer:not(.is-phone).is-filters-collapsed .fc-drawer-backdrop {
    display: none !important;
  }
}

.measure-app.is-lab-officer #btnSaveBuilding,
.measure-app.is-lab-officer #btnStartDraw,
.measure-app.is-lab-officer #btnFinish,
.measure-app.is-lab-officer #btnDeleteVertex,
.measure-app.is-lab-officer #btnUndo,
.measure-app.is-lab-officer #btnReset,
.measure-app.is-lab-officer #btnExportPdf,
.measure-app.is-lab-officer #btnExportSketch,
.measure-app.is-lab-officer #btnUploadLabResult {
  display: none !important;
}

.lab-officer-panel {
  display: none;
}

.measure-app.is-lab-officer .lab-officer-panel {
  display: block;
  position: absolute;
  top: 12px;
  left: 12px;
  right: auto;
  z-index: 1100;
  width: min(380px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--amana-line, #e2e5ea);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  padding: 0.85rem 0.95rem 1rem;
}

.lab-officer-panel[hidden] { display: none !important; }

.lab-visit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.lab-visit-head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--wo-navy, #466691);
}

.lab-officer-hint {
  min-height: 1.2rem;
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  max-height: 9rem;
  overflow-y: auto;
}
.lab-officer-hint.is-ok { color: #15803d; }
.lab-officer-hint.is-err { color: #b91c1c; }

.lab-visit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.65rem;
}

.lab-officer-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  font-weight: 700;
  color: #334155;
}

.lab-officer-field span { font-size: 0.75rem; }

.lab-officer-field input,
.lab-officer-field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  font-size: 0.84rem;
  background: #fff;
}

.lab-officer-field input[readonly] { background: #f8fafc; color: #475569; }

.lab-visit-geo {
  grid-column: 1 / -1;
}

.lab-geo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.lab-geo-head em {
  color: #b91c1c;
  font-style: normal;
}

.lab-geo-refresh {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #0f766e;
}

.lab-geo-refresh:hover { background: #f0fdfa; }

.lab-geo-status {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.lab-geo-status.is-ok { color: #15803d; }
.lab-geo-status.is-err { color: #b91c1c; }

.lab-geo-coords {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.45rem;
}

.lab-geo-coords label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
}

.lab-geo-coords input {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  font-family: inherit;
  font-size: 0.8rem;
  background: #f8fafc;
  color: #334155;
}

.lab-visit-notes { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .lab-geo-coords {
    grid-template-columns: 1fr;
  }
}

.lab-visit-notes textarea { min-height: 70px; resize: vertical; }

.lab-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.lab-photo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 118px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
  cursor: pointer;
  margin: 0;
}

.lab-photo-card span {
  padding: 0.35rem 0.5rem 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  z-index: 1;
}

.lab-photo-card em {
  display: block;
  padding: 0.3rem 0.45rem 0.55rem;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-align: center;
}

.lab-photo-card input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.lab-photo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lab-photo-card.has-image span,
.lab-photo-card.has-image em { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.45); }

.lab-visit-actions { margin-top: 0.75rem; }

.lab-visit-actions .sk-btn,
#labVisitSave {
  border: 0;
  background: var(--fc-blue, #1a73e8);
  color: #fff;
  border-radius: 8px;
  min-height: 40px;
  padding: 0.35rem 1rem;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

#labVisitSave:disabled { opacity: 0.55; cursor: wait; }

#labVisitForm.is-view-only .lab-photo-card {
  cursor: default;
  pointer-events: none;
}

#labVisitForm.is-view-only .lab-photo-card input {
  display: none;
}

.lab-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #fef3c7;
  color: #92400e;
}
.lab-status.is-progress { background: #dbeafe; color: #1d4ed8; }

@media (max-width: 720px) {
  .measure-app.is-lab-officer .lab-officer-panel {
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    width: auto;
    max-height: min(58dvh, 520px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
  }

  .lab-visit-grid,
  .lab-photos,
  .lab-geo-coords {
    grid-template-columns: 1fr;
  }

  .lab-officer-field input,
  .lab-officer-field textarea,
  .lab-geo-coords input {
    min-height: 44px;
    font-size: 16px;
  }

  .lab-photo-card {
    min-height: 140px;
  }

  #labVisitSave {
    width: 100%;
    min-height: 46px;
  }

  .lab-geo-refresh {
    width: 2.4rem;
    height: 2.4rem;
  }
}

/* Hazard pulse on map for medium/high risk buildings */
.hazard-pulse-icon {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.hazard-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  margin-top: -16px;
  border-radius: 50%;
  background: var(--hpc, #dc2626);
  opacity: 0.55;
  animation: hazardPulse 2s ease-out infinite;
  pointer-events: none;
}

.hazard-pulse--d2 {
  animation-delay: 1s;
}

@keyframes hazardPulse {
  0% {
    transform: scale(0.5);
    opacity: 0.6;
  }
  70% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}



