:root {
  --bg-dark: #0a1628;
  --bg-panel: #111d33;
  --bg-card: #152238;
  --border: #1e3a5f;
  --text: #e8f0fe;
  --text-muted: #8ba3c7;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #ef4444;
  --warning: #f59e0b;
  --incomplete: #e11d48;
  --partial: #eab308;
  --complete: #22c55e;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* Screens */
.screen {
  display: none;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  position: relative;
}
.screen.active {
  display: flex;
}

/* Blueprint background */
.blueprint-bg {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(rgba(10,22,40,0.85), rgba(10,22,40,0.9)),
    url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h100v100H0z' fill='%230a1628'/%3E%3Cpath d='M0 20h100M0 40h100M0 60h100M0 80h100M20 0v100M40 0v100M60 0v100M80 0v100' stroke='%231e3a5f' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: cover, 60px 60px;
  z-index: 0;
}

/* Sign In */
#signInScreen {
  align-items: center;
  justify-content: center;
}
.sign-in-card, .project-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow);
  text-align: center;
}
.sign-in-card h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}
.subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}
.hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Project Select */
#projectScreen {
  align-items: center;
  justify-content: center;
}
.project-card h2 {
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}
.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.project-item {
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.project-item:hover, .project-item.selected {
  border-color: var(--accent);
  background: rgba(34, 197, 94, 0.1);
}
.project-item .check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
}
.project-item.selected .check {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.welcome {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

/* Main App Layout */
#mainScreen {
  display: none;
  flex-direction: row;
}
#mainScreen.active {
  display: flex;
}

.sidebar {
  width: 240px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-header h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.sidebar-building-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.sidebar-building-label h3 {
  margin-bottom: 0;
}
.building-details-btn {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  line-height: 1.3;
}
.building-details-btn i { margin-right: 0.25rem; font-size: 0.75rem; }
.building-details-btn:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.4);
  border-color: #60a5fa;
}

.sidebar select, .unit-selector select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.floor-selector label, .unit-selector label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.floor-btns {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.floor-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.floor-btn:hover, .floor-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.floor-btn.small {
  font-size: 0.75rem;
  padding: 0.45rem;
}
.floor-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.extra-floors {
  display: flex;
  gap: 0.4rem;
}

/* Plan View */
.plan-view {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0d1a2d;
}
.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.plan-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}
.status-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.legend.incomplete i { background: var(--incomplete); }
.legend.complete i { background: var(--complete); }
.legend.partial i { background: var(--partial); }

.plan-container {
  flex: 1;
  min-height: 0; /* critical for flex child to shrink and get real height */
  overflow: hidden;
  padding: 0;
  display: block;
  position: relative;
  touch-action: none;
  cursor: grab;
  background: 
    linear-gradient(rgba(13,26,45,0.7), rgba(13,26,45,0.85)),
    repeating-linear-gradient(0deg, transparent, transparent 19px, #1e3a5f22 19px, #1e3a5f22 20px),
    repeating-linear-gradient(90deg, transparent, transparent 19px, #1e3a5f22 19px, #1e3a5f22 20px);
}
.plan-container.is-panning {
  cursor: grabbing;
}
.plan-container.is-fallback {
  overflow: auto;
  padding: 1.5rem;
  cursor: default;
  touch-action: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
}

/* Unit Cards on Plan */
.unit-card {
  width: 90px;
  height: 70px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
  position: relative;
  font-weight: 700;
  font-size: 1.1rem;
  user-select: none;
}
.unit-card:hover, .unit-card.selected {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.4);
  z-index: 2;
}
.unit-card.incomplete {
  background: rgba(225, 29, 72, 0.25);
  border-color: var(--incomplete);
  color: #fda4af;
}
.unit-card.complete {
  background: rgba(34, 197, 94, 0.25);
  border-color: var(--complete);
  color: #86efac;
}
.unit-card.partial {
  background: rgba(249, 115, 22, 0.25);
  border-color: var(--partial);
  color: #fdba74;
}
.unit-card .unit-type {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 2px;
}
.unit-card .task-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Details Panel */
.details-panel {
  width: 320px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.details-header h3 {
  font-size: 1rem;
}
.details-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
.empty-state {
  color: var(--text-muted);
  text-align: center;
  margin-top: 3rem;
  font-size: 0.95rem;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.task-item {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.75rem;
  border-left: 4px solid var(--incomplete);
  cursor: pointer;
  transition: background 0.15s;
}
.task-item:hover {
  background: #1a2d4a;
}
.task-item.done {
  border-left-color: var(--complete);
  opacity: 0.75;
}
.task-item .task-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
.task-item .task-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 1rem 0 0.5rem;
}

.measurement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.measurement-field {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.6rem;
}
.measurement-field label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}
.measurement-field input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.notes-box {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 60px;
}

.action-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-hover);
}
.btn.secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover {
  background: #1a2d4a;
}
.btn.ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn.ghost:hover {
  color: var(--text);
  border-color: var(--border);
}
.btn.full {
  width: 100%;
}
.btn.danger {
  background: var(--danger);
  color: #fff;
}
.btn.danger:hover {
  background: #dc2626;
}
.task-modal-footer {
  justify-content: flex-end;
  gap: 0.6rem;
}
.task-modal-footer-actions {
  display: flex;
  gap: 0.6rem;
  margin-left: auto;
  width: 100%;
  justify-content: flex-end;
}
.task-modal-footer-actions .btn.primary {
  min-width: 7.5rem;
}
/* Create Invoice: phone-thumb friendly, in scrollable task fields (not Save row) */
.btn-create-invoice {
  min-height: 48px;
  padding: 0.9rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  width: 100%;
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
}
/* Small text-link Delete, at BOTTOM of scrollable task fields — not on Save row */
.btn-delete-task-link {
  display: inline-block;
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  padding: 0.35rem 0 0.25rem;
  margin: 0.15rem 0 0;
  min-height: 0;
  width: auto;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  -webkit-appearance: none;
  appearance: none;
}
.btn-delete-task-link:hover {
  color: #dc2626;
}
.invoice-modal {
  z-index: 1100;
}
.invoice-job-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.4;
}
.invoice-from-line {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}
.invoice-setup-link {
  font-size: 0.8rem;
  margin: -0.35rem 0 0.85rem;
}
.invoice-setup-link a {
  color: var(--accent, #2563eb);
}

.close-btn {
  /* OTC return/close — red theme */
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid #991b1b;
  background: #b91c1c;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.close-btn:hover {
  background: #dc2626;
  border-color: #b91c1b;
  color: #fff;
}

/* Other panel closes — same red return theme */
.fixture-submittal-close-text,
#arLayoutPanel button[onclick="closeArLayoutPanel()"] {
  background: #b91c1c !important;
  border: 1px solid #991b1b !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: 0.5rem !important;
  padding: 0.35rem 0.75rem !important;
}
.fixture-submittal-close-text:hover,
#arLayoutPanel button[onclick="closeArLayoutPanel()"]:hover {
  background: #dc2626 !important;
}


/* Forms */
.form-group {
  margin-bottom: 1rem;
  text-align: left;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}
.form-row {
  display: flex;
  gap: 0.75rem;
}
.form-row .form-group {
  flex: 1;
}
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}
.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.task-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.task-toggles label {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  min-width: 7.5rem;
  user-select: none;
}
.task-toggles label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(34, 197, 94, 0.12);
}
.task-toggles label:has(#taskBillable:checked) {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}
.task-toggles input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.active {
  display: flex;
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1.05rem;
}
.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* Photo Upload */
.photo-upload input[type="file"] {
  margin-bottom: 0.5rem;
}
.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
/* EXIF orientation: show sideways phone JPEGs upright without rewriting /ftp */
.photo-thumb,
.photo-thumb-wrap img,
.photo-preview img,
.photo-viewer-transform img,
#photoViewerImg,
#photoPreview img {
  image-orientation: from-image;
}

.photo-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  display: block;
}
.photo-thumb-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.photo-delete-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #e11d48;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  z-index: 2;
  padding: 0;
}
.photo-delete-btn:hover {
  background: #be123c;
}

/* Photo Viewer */
.photo-viewer {
  max-width: 92vw;
  max-height: 92vh;
  width: min(960px, 92vw);
  background: #000;
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.photo-viewer-stage {
  position: relative;
  width: 100%;
  height: min(78vh, 720px);
  overflow: hidden;
  background: #0a0a0a;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.photo-viewer-stage.is-panning {
  cursor: grabbing;
}
.photo-viewer-transform {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
  line-height: 0;
}
.photo-viewer-transform img,
#photoViewerImg {
  display: block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}
.photo-viewer-delete-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.9);
  background: #e11d48;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  pointer-events: auto;
}
.photo-viewer-delete-btn:hover {
  background: #be123c;
}
/* Close viewer: upper right */
.photo-viewer > .close-btn {
  top: 8px;
  right: 8px;
  left: auto;
  z-index: 6;
}
.photo-viewer .close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  color: #fff;
  z-index: 2;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 36px;
  height: 36px;
}
.photo-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem;
  color: #fff;
}
.photo-nav button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

/* ---------- Unit Type Plan ---------- */
.unit-type-modal {
  width: min(1000px, 96vw) !important;
  max-width: 96vw !important;
}
.unit-type-body {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}
.unit-type-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.unit-type-stage {
  position: relative;
  width: 100%;
  height: min(70vh, 640px);
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 8px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.unit-type-stage.is-panning {
  cursor: grabbing;
}
.unit-type-stage.is-panning .unit-type-hotspot-label {
  visibility: hidden;
}
.unit-type-transform {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  line-height: 0;
}
.unit-type-transform img,
#unitTypeImg {
  display: block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.unit-type-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: center;
}
.unit-type-zoom-controls button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.unit-type-zoom-controls button:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}
#unitTypeZoomLabel {
  min-width: 3.2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.unit-type-hotspot {
  /* Match Unity unit-level fixture color (green ~0.1, 0.8, 0.2 @ 0.5) */
  position: absolute;
  border: 2px solid rgba(34, 197, 94, 0.95);
  background: rgba(26, 204, 51, 0.50);
  border-radius: 2px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  /* Pixel mins only — never inflate % width/height (Unity uses exact DB rects) */
  min-width: 18px;
  min-height: 14px;
}
.unit-type-hotspot:hover {
  background: rgba(34, 197, 94, 0.70);
  border-color: #4ade80;
}
.unit-type-hotspot-label {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 3px #000, 0 1px 2px #000;
  white-space: nowrap;
  padding: 0 2px;
  pointer-events: none;
}
.unit-type-stage.is-panning .unit-type-hotspot {
  pointer-events: none;
}
.unit-type-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Reports ---------- */
.reports-modal {
  width: min(1400px, 98vw) !important;
  max-width: 98vw !important;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}
.reports-body {
  padding: 0.85rem 1.15rem 1.15rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}
.reports-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.reports-presets .btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
}
.reports-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}
.reports-filters .form-group {
  margin: 0;
  min-width: 0;
}
.reports-filters label {
  font-size: 0.75rem;
  margin-bottom: 0.3rem;
}
.reports-filters select,
.reports-filters input[type="date"],
.reports-filters input[type="text"] {
  width: 100%;
  min-width: 0;
  font-size: 0.9rem;
  padding: 0.55rem 0.65rem;
}
.reports-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.reports-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.reports-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 220px;
  max-height: 52vh;
  background: var(--bg-card);
}
.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.reports-table th {
  position: sticky;
  top: 0;
  background: var(--bg-panel);
  color: var(--text-muted);
  text-align: left;
  font-weight: 600;
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.reports-table td {
  padding: 0.42rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.reports-table tbody tr:hover {
  background: rgba(255,255,255,0.04);
  cursor: pointer;
}
.reports-table .empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
}
.rpt-status {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.rpt-status.open { background: rgba(244,63,94,0.2); color: #fb7185; }
.rpt-status.done { background: rgba(34,197,94,0.2); color: #4ade80; }
.rpt-desc {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mat-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.mat-filters {
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  max-width: 640px;
}
.mat-columns {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.85rem;
  min-height: 0;
  flex: 1;
}
.mat-columns .reports-table-wrap {
  max-height: 58vh;
}
.mat-section-title {
  margin: 0;
  padding: 0.55rem 0.65rem 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


/* Phone nav — only shown inside max-width: 600px */
.phone-nav-btn {
  display: none;
}
.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .reports-filters {
    grid-template-columns: repeat(2, 1fr);
  }
  .reports-table-wrap {
    max-height: 40vh;
  }
  .mat-columns {
    grid-template-columns: 1fr;
  }
}

/* Mobile Responsive */
@media (max-width: 900px) {
  #mainScreen {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem;
    gap: 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .sidebar-header, .floor-selector, .unit-selector {
    flex: 1;
    min-width: 120px;
  }
  .sidebar .btn {
    flex: 1;
    min-width: 100px;
  }
  .plan-view {
    flex: 1 1 auto;
    min-height: 40vh; /* ensure plan area has real height on tablets */
  }
  .plan-container {
    min-height: 35vh;
  }
  .details-panel {
    width: 100%;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .plan-container.is-fallback {
    padding: 1rem;
  }
  .unit-card {
    width: 76px;
    height: 60px;
    font-size: 0.95rem;
  }
}

@media (max-width: 600px) {
  .sign-in-card, .project-card {
    padding: 1.75rem 1.25rem;
  }
  .btn-create-invoice {
    min-height: 56px;
    font-size: 1.15rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
  }
  .btn-delete-task-link {
    font-size: 0.8125rem;
    padding: 0.35rem 0 0.25rem;
    min-height: 0;
  }
  .task-modal-footer-actions {
    width: 100%;
  }
  .task-modal-footer-actions .btn {
    flex: 1;
    min-height: 48px;
  }

  .status-legend {
    display: none;
  }

  /* Phone menu button (hidden on tablet/desktop via display:none default) */
  .phone-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
  }
  .phone-nav-btn:active {
    background: #1a2d4a;
  }

  /* Compact plan header — reclaim vertical space for the canvas */
  .plan-header {
    padding: 0.45rem 0.65rem;
    gap: 0.5rem;
  }
  .plan-header h2 {
    font-size: 0.95rem;
  }
  .plan-header-left {
    gap: 0.45rem;
  }

  /*
   * Phone sidebar = left drawer (not the tablet horizontal wrap).
   * Tablet ≤900 keeps in-flow wrap; this overrides only ≤600.
   */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    max-width: 86vw;
    z-index: 70;
    flex-direction: column;
    flex-wrap: nowrap;
    flex: none;
    padding: 1rem;
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    gap: 0.85rem;
    border-right: 1px solid var(--border);
    border-bottom: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s ease, visibility 0.22s;
    box-shadow: 8px 0 32px rgba(0,0,0,0.45);
  }
  #mainScreen.sidebar-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .sidebar-header,
  .floor-selector,
  .unit-selector,
  .sidebar .btn {
    flex: none;
    min-width: 0;
    width: 100%;
  }
  .floor-btns .floor-btn,
  .extra-floors .floor-btn {
    min-height: 44px;
  }
  .sidebar select,
  .unit-selector select {
    min-height: 44px;
    font-size: 1rem;
  }
  .sidebar .btn {
    min-height: 44px;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }
  .sidebar-backdrop[hidden] {
    display: none !important;
  }

  /* Larger plan zoom tap targets on phone */
  .plan-zoom-controls button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  /*
   * Phone-only: tablet 900px column keeps details in-flow at max-height 40vh.
   * On ~390px that stack (wrapped sidebar + 40vh plan + 40vh details) exceeds
   * the visual viewport (iOS chrome / home indicator). body overflow:hidden
   * then clips the details. Take the panel out of the 100vh column.
   */
  .plan-view {
    min-height: 0; /* override tablet 40vh so plan can shrink */
    flex: 1 1 auto;
  }
  .plan-container {
    min-height: 0; /* override tablet 35vh */
  }

  /* Bottom sheet sits in the visible viewport, not below a clipped column */
  .details-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    width: 100%;
    height: auto;
    max-height: calc(70dvh - env(safe-area-inset-bottom, 0px));
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(0,0,0,0.5);
    transform: translateY(110%);
    visibility: hidden;
    pointer-events: none;
    flex-shrink: 0;
  }
  #mainScreen.details-open .details-panel {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    height: min(70dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 3.5rem));
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
  #mainScreen.details-open .plan-view {
    min-height: 0;
    flex: 1 1 auto;
  }
  .details-header {
    flex-shrink: 0;
    position: relative;
    padding-top: 1.15rem;
  }
  .details-header::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
  }
  .details-header .close-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .details-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 1.25rem;
  }
  .details-panel.overlay-mode #planOverlayPanel {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.75rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ===== Real Plan Image + Hotspots ===== */
.plan-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  /* Limit compositor layer size on mobile GPUs */
  contain: strict;
  background: #0d1a2d;
}

.plan-image-wrapper {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  line-height: 0;
  background: #0d1a2d;
  border-radius: 8px;
  overflow: visible;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transform-origin: 0 0;
  /* no will-change: on Android it promotes a huge layer and causes black tiles */
  user-select: none;
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-user-select: none;
}

.plan-image-wrapper img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
  image-rendering: auto;
}

.plan-zoom-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-zoom-controls button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.plan-zoom-controls button:hover {
  background: var(--bg-card);
  border-color: var(--accent);
}
.plan-zoom-label {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(10,22,40,0.85);
  border-radius: 6px;
  padding: 2px 4px;
}

.hotspot {
  position: absolute;
  border: 2px solid rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.15);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  touch-action: none;
  pointer-events: auto;
  z-index: 5;
}
.hotspot-label {
  pointer-events: none;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  text-shadow:
    0 0 3px #000,
    0 1px 2px #000,
    1px 0 2px #000,
    -1px 0 2px #000;
  white-space: nowrap;
  transform-origin: center center;
}

.hotspot:hover {
  filter: brightness(1.15);
  z-index: 10;
}

/* Strong selection ring — very thick so it stays visible when zoomed out */
.hotspot.selected {
  z-index: 20 !important;
  border-color: #22d3ee !important;
  border-width: 14px !important;
  outline: 10px solid rgba(34, 211, 238, 0.95);
  outline-offset: 6px;
  box-shadow:
    0 0 0 12px rgba(34, 211, 238, 1),
    0 0 0 28px rgba(34, 211, 238, 0.55),
    0 0 0 44px rgba(14, 165, 233, 0.3),
    0 0 50px rgba(34, 211, 238, 0.85) !important;
  animation: hotspot-pulse 1.4s ease-in-out 2;
}
.hotspot.selected .hotspot-label {
  color: #e0f2fe !important;
  text-shadow:
    0 0 4px #000,
    0 0 8px rgba(34, 211, 238, 0.9),
    0 1px 2px #000;
}

@keyframes hotspot-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 12px rgba(34, 211, 238, 1),
      0 0 0 28px rgba(34, 211, 238, 0.55),
      0 0 0 44px rgba(14, 165, 233, 0.3),
      0 0 50px rgba(34, 211, 238, 0.85);
  }
  50% {
    box-shadow:
      0 0 0 16px rgba(34, 211, 238, 1),
      0 0 0 36px rgba(34, 211, 238, 0.45),
      0 0 0 56px rgba(14, 165, 233, 0.22),
      0 0 70px rgba(34, 211, 238, 0.95);
  }
}

.hotspot.incomplete {
  border-color: #e11d48 !important;
  background: rgba(225, 29, 72, 0.35) !important;
  color: #fecdd3;
}
.hotspot.incomplete:hover {
  background: rgba(225, 29, 72, 0.55) !important;
}

.hotspot.partial {
  border-color: #eab308 !important;
  background: rgba(234, 179, 8, 0.35) !important;
  color: #fef08a;
}
.hotspot.partial:hover {
  background: rgba(234, 179, 8, 0.55) !important;
}

.hotspot.complete {
  border-color: #2563eb !important;
  background: rgba(34, 197, 94, 0.4) !important;
  color: #bbf7d0;
}
.hotspot.complete:hover {
  background: rgba(34, 197, 94, 0.6) !important;
}

/* neutral when no task data */
.hotspot.none {
  border-color: rgba(148, 163, 184, 0.6) !important;
  background: rgba(148, 163, 184, 0.15) !important;
  color: #e2e8f0;
}

.plan-loading {
  color: var(--text-muted);
  padding: 3rem;
  text-align: center;
  width: 100%;
}

/* ---------- Progress / Status Descriptions ---------- */
.progress-modal {
  width: min(760px, 96vw) !important;
  max-width: 96vw !important;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}
.progress-body {
  padding: 0.85rem 1.15rem 1.15rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  flex: 1;
}
.progress-banner {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--text);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.35;
}
.progress-pickers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.progress-pickers .form-group {
  margin: 0;
}
.progress-pickers label,
.progress-attach label {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}
.progress-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.progress-unit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.progress-selected-count {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}
.progress-checklist-wrap {
  overflow-y: auto;
  min-height: 140px;
  max-height: 42vh;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.progress-unit-list {
  display: flex;
  flex-direction: column;
  padding: 0.35rem;
}
.progress-unit-row {
  display: grid;
  grid-template-columns: auto 3.25rem 1fr;
  gap: 0.55rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.progress-unit-row:last-child {
  border-bottom: none;
}
.progress-unit-row:hover {
  background: rgba(255,255,255,0.04);
}
.progress-unit-row.is-selected {
  background: rgba(59, 130, 246, 0.16);
  outline: 1px solid rgba(59, 130, 246, 0.45);
}
.progress-unit-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #3b82f6;
}
.progress-unit-id {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.9rem;
}
.progress-unit-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-attach {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}
.lookahead-attach {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr) minmax(0, 0.9fr) auto;
}
.lookahead-attach input[type="date"] {
  width: 100%;
}
.progress-attach .form-group {
  margin: 0;
}
.progress-confirm {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.progress-readonly-wrap {
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}
.progress-readonly-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.progress-readonly {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.progress-chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 0.75rem;
}
.progress-readonly-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .progress-pickers,
  .progress-attach,
  .lookahead-attach {
    grid-template-columns: 1fr;
  }
  .progress-selected-count {
    margin-left: 0;
  }
}

/* ---------- Fixture Submittal PDF modal ---------- */
.fixture-submittal-modal {
  width: min(960px, 96vw) !important;
  max-width: 96vw !important;
  height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  color: #fff;
}
.fixture-submittal-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.fixture-submittal-modal .modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
}
.fixture-submittal-body {
  flex: 1;
  min-height: 0;
  background: #111;
}
.fixture-submittal-body iframe {
  width: 100%;
  height: 100%;
  min-height: 60vh;
  border: 0;
  background: #222;
}
.fixture-submittal-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}
.fixture-submittal-nav button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 0.95rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}
.fixture-submittal-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}
.fixture-submittal-nav button:not(:disabled):hover {
  background: rgba(255,255,255,0.28);
}
.fixture-submittal-page-num {
  opacity: 0.75;
  font-size: 0.9rem;
}
.fixture-submittal-close-text {
  margin-left: 0.5rem;
}

/* ===== Site plan (Back to Site) ===== */
.site-plan-notice {
  flex-shrink: 0;
  margin: 0 1rem 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(234, 179, 8, 0.12);
  color: #fde68a;
  font-size: 0.85rem;
  font-weight: 600;
}
.site-plan-notice[hidden] {
  display: none !important;
}
.hotspot.hotspot-site {
  border-radius: 50%;
  /* High-contrast site building pins — readable on light & dark plan sheets */
  border: 5px solid #f59e0b;
  background: rgba(245, 158, 11, 0.68);
  box-shadow:
    0 0 0 2px #000,
    0 0 0 5px rgba(255, 255, 255, 0.95),
    0 0 0 9px rgba(0, 0, 0, 0.75),
    0 0 24px rgba(245, 158, 11, 0.95);
  pointer-events: auto;
  z-index: 6;
  min-width: 32px;
  min-height: 32px;
}
.hotspot.hotspot-site:hover {
  background: rgba(251, 191, 36, 0.82);
  border-color: #fbbf24;
  box-shadow:
    0 0 0 2px #000,
    0 0 0 5px #fff,
    0 0 0 10px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(251, 191, 36, 1);
}
.hotspot.hotspot-site .hotspot-label {
  white-space: normal;
  text-align: center;
  max-width: 92%;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 0 4px #000,
    0 1px 3px #000,
    1px 0 3px #000,
    -1px 0 3px #000,
    0 0 12px rgba(0,0,0,0.95);
  pointer-events: none;
}
.hotspot.hotspot-site.selected {
  border-color: #22d3ee !important;
  background: rgba(34, 211, 238, 0.55) !important;
}
.plan-container.is-site-view .status-legend {
  opacity: 0.45;
}


/* ---------- Plan overlay (read-only StatusProgress / StatusAssignments) ---------- */
.plan-overlay-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.plan-overlay-panel[hidden] {
  display: none !important;
}
.details-panel.overlay-mode #detailsBody {
  display: none !important;
}
.details-panel.overlay-mode #planOverlayPanel[hidden],
#planOverlayPanel[hidden] {
  display: none !important;
}
.details-panel.overlay-mode #planOverlayPanel {
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1rem;
  gap: 0.65rem;
}
.details-panel.overlay-mode #closeOverlayBtn {
  /* Close sits at top of overlay panel (above toggles) — do not push content down */
  margin-top: 0;
  flex: 0 0 auto;
}
.details-panel .ov-subs,
.details-panel #overlayTree,
.details-panel .overlay-tree,
.details-panel .ov-color-key {
  max-height: none;
  overflow: visible;
}
.ov-key-swatch.ov-key-forecast {
  background: transparent;
  border: 2px dashed #34d399;
  box-sizing: border-box;
}
.ov-key-swatch.ov-key-week {
  background: #10b981;
}
.plan-overlay-panel > label,
.ov-panel-head label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ov-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ov-panel-head label {
  margin: 0;
}
.ov-close-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
}
.ov-color-key {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 32vh;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem;
}
.ov-color-key[hidden] {
  display: none !important;
}
.ov-key-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.4rem;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.2;
}
.ov-key-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.35);
}
.ov-key-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.35rem 0.45rem;
  margin: 0;
}
.legend.ov-sd i {
  border-radius: 3px;
}
.legend.ov-none i {
  background: #64748b;
}
.ov-mode-list,
.ov-main-list,
.ov-sub-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ov-mode-row,
.ov-main-row,
.ov-sub-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  font-size: 0.88rem;
  background: #1e293b;
  border: 0;
}
.ov-mode-row:hover,
.ov-main-row:hover,
.ov-sub-row:hover {
  background: #243044;
}
.ov-mode-row.is-selected,
.ov-main-row.is-selected,
.ov-sub-row.is-selected {
  background: #1e3a5f;
  box-shadow: inset 3px 0 0 #34d399;
  color: #ecfdf5;
}
.ov-mode-row input,
.ov-main-row input,
.ov-sub-row input {
  accent-color: #34d399;
  margin: 0;
}
.ov-main-row {
  font-weight: 600;
}
.ov-sub-list {
  margin: 0 0 2px 0.85rem;
  border-radius: 6px;
}
.ov-sub-row {
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
}
.ov-main-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  padding: 0.4rem 0.65rem 0.15rem;
}
.ov-subs,
#overlayTree,
.overlay-tree {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 38vh;
  overflow-y: auto;
}
.ov-subs[hidden],
#overlayTree[hidden] {
  display: none !important;
}
/* My Progress on: never keep the accordion display:none */
.plan-overlay-panel:not([hidden]) #planOverlaySubs:not([hidden]),
.plan-overlay-panel:not([hidden]) #overlayTree:not([hidden]) {
  display: flex !important;
  flex-direction: column;
}
.ov-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.4rem 0.65rem;
  margin: 0;
}

.hotspot.ov-paint,
.unit-card.ov-paint {
  box-shadow: none;
}
.hotspot.ov-general,
.unit-card.ov-general {
  border-style: solid !important;
  border-color: rgba(148, 163, 184, 0.5) !important;
  background: rgba(71, 85, 105, 0.28) !important;
}
.hotspot.ov-general.ov-has-sd,
.unit-card.ov-general.ov-has-sd {
  border-color: var(--ov-sd-border, #10b981) !important;
  background: var(--ov-sd-fill, rgba(16, 185, 129, 0.48)) !important;
}
.hotspot.ov-my.ov-done,
.unit-card.ov-my.ov-done {
  border-style: solid !important;
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.52) !important;
}
.hotspot.ov-my.ov-open,
.unit-card.ov-my.ov-open {
  border-style: solid !important;
  border-color: rgba(148, 163, 184, 0.5) !important;
  background: rgba(71, 85, 105, 0.28) !important;
}
.hotspot.ov-lookahead,
.unit-card.ov-lookahead {
  border-style: dashed !important;
  border-color: #34d399 !important;
  background: rgba(16, 185, 129, 0.14) !important;
  outline: 1px dashed rgba(52, 211, 153, 0.45);
  outline-offset: 1px;
}
.hotspot.ov-lookahead.has-week,
.unit-card.ov-lookahead.has-week {
  background: rgba(16, 185, 129, 0.28) !important;
}
.hotspot-ov-week {
  position: absolute;
  right: 2px;
  bottom: 2px;
  pointer-events: none;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: #ecfdf5;
  background: rgba(6, 78, 59, 0.78);
  border: 1px solid rgba(52, 211, 153, 0.7);
  border-radius: 3px;
  padding: 1px 3px;
  text-shadow: none;
  z-index: 6;
}
.hotspot-ov-sd-stack {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  pointer-events: none;
  z-index: 6;
  max-height: 42%;
  overflow: hidden;
  justify-content: center;
}
.hotspot-ov-sd {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  pointer-events: none;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.15;
  color: #ecfdf5;
  background: var(--chip-bg, rgba(6, 78, 59, 0.82));
  border-radius: 3px;
  border-left: 3px solid var(--chip-border, transparent);
  padding: 1px 3px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 6;
}
.hotspot.ov-multi-sd .hotspot-ov-sd,
.unit-card.ov-multi-sd .hotspot-ov-sd {
  flex: 1 1 calc(50% - 1px);
  font-size: 7px;
  padding: 1px 2px;
}
.hotspot-ov-sd-more {
  flex: 0 0 auto !important;
  min-width: 14px;
  background: rgba(15, 23, 42, 0.78);
  border-left-color: rgba(148, 163, 184, 0.7);
}

.legend.ov-fill i {
  background: linear-gradient(to top, #10b981 60%, #475569 60%);
}
.legend.ov-done i { background: #10b981; }
.legend.ov-open i { background: #64748b; }
.legend.ov-forecast i {
  background: transparent;
  border: 2px dashed #34d399;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .details-panel.overlay-mode #planOverlayPanel {
    padding: 0.75rem 1rem 1rem;
  }
  .details-panel .ov-subs {
    max-height: none;
  }
}


/* ===== OTC AR layout chip (site / underground only; not on plan canvas) ===== */
.plan-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}
.plan-header-left h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-layout-chip {
  flex-shrink: 0;
  border: 1px solid #166534;
  background: #14532d;
  color: #86efac;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
}
.ar-layout-chip:hover {
  background: #166534;
  border-color: #2563eb;
}
.ar-layout-chip[hidden] {
  display: none !important;
}
.ar-layout-panel {
  flex-shrink: 0;
  margin: 0 1rem 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #166534;
  background: rgba(20, 83, 45, 0.28);
  color: #d1fae5;
  font-size: 0.82rem;
  line-height: 1.45;
}
.ar-layout-panel[hidden] {
  display: none !important;
}
.ar-layout-panel p + p {
  margin-top: 0.35rem;
}
.ar-layout-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.ar-layout-panel-actions a {
  color: #86efac;
  font-weight: 600;
  text-decoration: none;
}
.ar-layout-panel-actions a:hover {
  color: #bbf7d0;
  text-decoration: underline;
}
.ar-layout-panel-actions button {
  background: transparent;
  border: 1px solid #334155;
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.ar-layout-panel-actions button:hover {
  border-color: #64748b;
  color: var(--text);
}


/* ===== GC-imported tasks (Procore / Autodesk) =====
   Row accent teal #0E7C7B — distinct from progress red/yellow/green
   and hotspot selection cyan #22d3ee. Badge P = Procore #F47E20,
   badge A = Autodesk #0696D7. */
.task-item.task-imported {
  border-left: 4px solid #0E7C7B;
  background: rgba(14, 124, 123, 0.14);
  box-shadow: inset 0 0 0 1px rgba(14, 124, 123, 0.35);
}
.task-item.task-imported:hover {
  background: rgba(14, 124, 123, 0.22);
}
.task-item.task-imported.done {
  opacity: 0.85;
}
.task-item .task-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.import-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #fff;
  flex-shrink: 0;
}
.import-badge-pc {
  background: #F47E20;
}
.import-badge-ad {
  background: #0696D7;
}
.task-import-banner {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(14, 124, 123, 0.18);
  border: 1px solid rgba(14, 124, 123, 0.45);
  color: #99f6e4;
  font-size: 0.8rem;
}
.task-import-banner[hidden] {
  display: none !important;
}

/* Reports tabs */
.reports-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.reports-tab {
  background: #1a2d4a;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.reports-tab:hover {
  border-color: #0E7C7B;
  color: var(--text);
}
.reports-tab.active {
  background: rgba(14, 124, 123, 0.25);
  border-color: #0E7C7B;
  color: #99f6e4;
}
.reports-pane[hidden] {
  display: none !important;
}
.rpt-src {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}


/* ===== Import P/A chips on plan hotspots + details header =====
   Corner chips only — do NOT recolor hotspot fill. Visible in task view
   and while progress overlay is active. */
.detail-import-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-left: 0.45rem;
  vertical-align: middle;
}
.detail-import-badges[hidden],
.task-modal-import-badge[hidden],
.task-location-import-badge[hidden] {
  display: none !important;
}
.details-header h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}
.task-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}
.task-modal-title-wrap h3 {
  margin: 0;
}
.task-modal-import-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.task-location-import-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.hotspot-import-badges {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  z-index: 40;
  transform-origin: top right;
  opacity: 1;
  visibility: visible;
}
.hotspot-import-badge {
  min-width: 0.95rem;
  height: 0.95rem;
  padding: 0 0.2rem;
  font-size: 0.58rem;
  border-radius: 0.2rem;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
/* Keep chips readable when plan is zoomed (counter-scale with label) */
.hotspot .hotspot-import-badges {
  /* sized in CSS px; applyPlanTransform scales labels separately */
}
/* Selected/incomplete/complete must NOT clip or cover P/A chips */
.hotspot.selected,
.hotspot.incomplete,
.hotspot.partial,
.hotspot.complete,
.hotspot.none {
  overflow: visible !important;
}
.hotspot.selected .hotspot-import-badges,
.hotspot.incomplete .hotspot-import-badges,
.hotspot.partial .hotspot-import-badges,
.hotspot.complete .hotspot-import-badges,
.hotspot.none .hotspot-import-badges {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 50;
  pointer-events: none;
}
.hotspot.selected .hotspot-label {
  z-index: 1;
}
.hotspot .hotspot-import-badges {
  z-index: 50;
}
/* Done/complete must NOT hide import badges on task rows */
.task-item.done .import-badge,
.task-item.task-imported.done .import-badge,
.task-item.complete .import-badge {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Details list row P/A chips (H3 title badge alone is not enough) */
.task-item .task-title-row .import-badge {
  display: inline-flex !important;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Share photo control + email fallback modal (Sandbox mock) */
/* Share in photo-nav: beat .photo-nav button (circle/translucent) — solid Sandbox accent */
.photo-nav button.photo-viewer-share-btn,
#photoShareBtn.photo-viewer-share-btn {
  width: auto;
  min-width: 72px;
  height: auto;
  min-height: 40px;
  background: var(--accent, #2563eb);
  border: 2px solid rgba(255,255,255,0.85);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.photo-nav button.photo-viewer-share-btn:hover,
#photoShareBtn.photo-viewer-share-btn:hover {
  background: var(--accent-hover, #1d4ed8);
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}
.photo-nav button.photo-viewer-share-btn:active,
#photoShareBtn.photo-viewer-share-btn:active {
  background: #1e40af;
  transform: scale(0.97);
}
.photo-nav {
  flex-wrap: wrap;
}
.photo-share-email-modal {
  max-width: min(420px, 94vw);
  width: 100%;
  background: var(--card-bg, #1e293b);
  color: var(--text, #e2e8f0);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.15rem;
}
.photo-share-email-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.photo-share-email-modal .modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}
.photo-share-email-form label {
  display: block;
  font-size: 0.8rem;
  margin: 0.55rem 0 0.25rem;
  color: var(--text-muted, #94a3b8);
}
.photo-share-email-form input,
.photo-share-email-form textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.45);
  background: rgba(15,23,42,0.55);
  color: inherit;
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
}
.photo-share-email-form textarea {
  min-height: 72px;
  resize: vertical;
}
.photo-share-email-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.9rem;
  justify-content: flex-end;
}
.photo-share-email-status {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  min-height: 1.2em;
  color: var(--text-muted, #94a3b8);
}
.photo-share-email-status.ok { color: #4ade80; }
.photo-share-email-status.err { color: #fb7185; }
.photo-share-email-status.warn { color: #fbbf24; }

/* Invoice status (Sandbox) */
.task-invoice-status {
  margin: 0.55rem 0 0.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 600;
}
.task-invoice-status.is-invoiced {
  background: rgba(22, 163, 74, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(22, 163, 74, 0.35);
}
.task-invoice-status.is-pending {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted, #64748b);
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.task-invoice-status a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.invoice-modal-status {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 600;
}
.invoice-modal-status.is-invoiced {
  background: rgba(22, 163, 74, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(22, 163, 74, 0.35);
}
.invoice-modal-status.is-pending {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted, #64748b);
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.invoice-modal-status a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}
.task-inv-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  background: rgba(22, 163, 74, 0.15);
  color: #1d4ed8;
  border: 1px solid rgba(22, 163, 74, 0.3);
  white-space: nowrap;
}

.rpt-date-hint {
  margin: 0.15rem 0 0.15rem;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  line-height: 1.35;
}
.rpt-inv-stamp {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  vertical-align: middle;
}
.rpt-inv-stamp.is-invoiced {
  background: rgba(22, 163, 74, 0.15);
  color: #1d4ed8;
  border: 1px solid rgba(22, 163, 74, 0.3);
}
.rpt-inv-stamp.is-pending {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted, #64748b);
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.rpt-inv-stamp.is-na {
  color: var(--text-muted, #64748b);
  font-weight: 600;
  padding: 0.1rem 0.2rem;
  border: none;
  background: transparent;
}
a.rpt-inv-link {
  text-decoration: none;
  color: inherit;
}
a.rpt-inv-link:hover .rpt-inv-stamp.is-invoiced {
  background: rgba(22, 163, 74, 0.28);
}


/* ACC issue pins: small visible marker, no text label; tap opens new tab.
   z-index above unit rects so pins win clicks when overlapping. */
.hotspot.hotspot-link {
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  overflow: visible;
  z-index: 40;
}
.hotspot.hotspot-link:hover,
.hotspot.hotspot-link:active {
  z-index: 45;
}
.hotspot.hotspot-link::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -15px 0 0 -9px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #e11d48;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.55);
  pointer-events: none;
}
.hotspot.hotspot-link::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -9px 0 0 -3px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  z-index: 1;
}
.hotspot.hotspot-link:hover::before,
.hotspot.hotspot-link:active::before {
  background: #be123c;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.35), 0 1px 4px rgba(0,0,0,0.55);
}
.hotspot.hotspot-link .hotspot-label {
  display: none;
}


.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Task modal in-flight action busy (photo upload / GC push) */
.task-action-busy {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(6, 150, 215, 0.55);
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
}
.task-action-busy[hidden] {
  display: none !important;
}
.task-action-busy-spinner {
  width: 1.15rem;
  height: 1.15rem;
  border: 2.5px solid rgba(148, 163, 184, 0.35);
  border-top-color: #0696d7;
  border-radius: 50%;
  flex-shrink: 0;
  animation: task-action-spin 0.75s linear infinite;
}
@keyframes task-action-spin {
  to { transform: rotate(360deg); }
}
#taskModal.is-action-busy .modal-content {
  position: relative;
}

/* ACC issue status actions (Sandbox field app) */
.task-acc-actions {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(6, 150, 215, 0.12);
  border: 1px solid rgba(6, 150, 215, 0.4);
}
.task-acc-actions[hidden] {
  display: none !important;
}
.task-acc-actions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.task-acc-actions-row .btn {
  flex: 1 1 auto;
  min-width: 8rem;
}
.task-acc-status-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 0.45rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #f59e0b;
  color: #1a1a1a;
}
.task-acc-status-chip[hidden] {
  display: none !important;
}
.task-acc-status-chip.is-pending {
  background: #f59e0b;
  color: #1a1a1a;
}
.task-acc-action-msg {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: #99f6e4;
}
.task-acc-action-msg.is-error {
  color: #fca5a5;
}
.task-acc-action-msg[hidden] {
  display: none !important;
}


.task-acc-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
  background: #334155;
  color: #e2e8f0;
}
.task-acc-badge.is-pending,
#taskAccStatusChip.is-pending {
  background: #1d4ed8;
  color: #dbeafe;
}
#taskAccStatusChip {
  display: inline-block;
  margin: 0.35rem 0 0.15rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #334155;
  color: #e2e8f0;
}

#taskSendPhotoFormaBtn {
  font-size: 0.85rem;
}


.plan-overlay-panel .ov-close-top {
  margin: 0 0 10px;
  order: -1;
}
.plan-overlay-panel .ov-subs-note {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin: 0 0 6px;
}
