    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
    :root { --app-vh: 100vh; }
    html, body { min-height: 100%; }
    body { font-family: 'Inter', sans-serif; min-height: var(--app-vh); }
    @supports (height: 100dvh) { :root { --app-vh: 100dvh; } }
    .gmnoprint, .gm-style-cc, a[href^="https://maps.google.com/maps"], a[href^="https://www.google.com/maps"] { display: none !important; }
    .gm-style-pbc { opacity: 0 !important; }
    .custom-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
    .custom-scroll::-webkit-scrollbar-track { background: transparent; }
    .custom-scroll::-webkit-scrollbar-thumb { background: rgba(156, 163, 175, 0.28); border-radius: 9999px; }
    .fade-in { animation: fadeIn 0.15s ease-out forwards; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    .pop-in { animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
    @keyframes popIn { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
    .archive-match-banner { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 6px; padding: 5px 8px; border-radius: 6px; background: rgba(220, 38, 38, 0.12); border: 1px solid rgba(220, 38, 38, 0.3); color: #dc2626; font-size: 11px; font-weight: 600; cursor: pointer; animation: alertPulse 2.5s ease-in-out infinite; }
    .dark .archive-match-banner { background: rgba(220, 38, 38, 0.15); border-color: rgba(220, 38, 38, 0.35); color: #f87171; }
    @keyframes alertPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
    .card-item { transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, opacity 0.2s, transform 0.2s; border-width: 1px; }
    .card-item:hover { border-width: 1px; transform: translateY(-1px); }
    .hover-new:hover { border-color: rgba(37, 99, 235, 0.7) !important; box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12) inset; }
    .hover-contacted:hover { border-color: rgba(21, 128, 61, 0.7) !important; box-shadow: 0 0 0 1px rgba(21, 128, 61, 0.12) inset; }
    .hover-quoted:hover { border-color: rgba(147, 51, 234, 0.7) !important; box-shadow: 0 0 0 1px rgba(147, 51, 234, 0.12) inset; }
    .hover-converted:hover { border-color: rgba(234, 179, 8, 0.75) !important; box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.14) inset; }
    .stage-card-new { background: rgba(37, 99, 235, 0.07) !important; border-color: rgba(37, 99, 235, 0.3) !important; }
    .stage-card-contacted { background: rgba(21, 128, 61, 0.07) !important; border-color: rgba(21, 128, 61, 0.3) !important; }
    .stage-card-quoted { background: rgba(147, 51, 234, 0.07) !important; border-color: rgba(147, 51, 234, 0.3) !important; }
    .converted-card { background: rgba(234, 179, 8, 0.07) !important; border-color: rgba(234, 179, 8, 0.48) !important; }
    .inactive-converted-card { background: rgba(148, 163, 184, 0.11) !important; border-color: rgba(148, 163, 184, 0.3) !important; opacity: 0.72; }
    #property-media-shell { position: relative; overflow: hidden; background: #111; }
    #property-view { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 10; }
    input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
    input[type=number] { -moz-appearance: textfield; }
    .stage-badge-new { background: rgba(37, 99, 235, 0.1); color: #60a5fa; border: 1px solid rgba(37, 99, 235, 0.22); }
    .stage-badge-contacted { background: rgba(21, 128, 61, 0.1); color: #4ade80; border: 1px solid rgba(21, 128, 61, 0.22); }
    .stage-badge-quoted { background: rgba(147, 51, 234, 0.1); color: #c084fc; border: 1px solid rgba(147, 51, 234, 0.22); }
    .stage-badge-converted { background: rgba(234, 179, 8, 0.1); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.22); }
    .archive-badge-non-responsive { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.16); }
    .archive-badge-chose-competitor { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.16); }
    .archive-badge-price-sensitive { background: rgba(21, 128, 61, 0.12); color: #15803d; border: 1px solid rgba(21, 128, 61, 0.16); }
    .archive-badge-not-interested { background: rgba(168, 85, 247, 0.12); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.16); }
    .archive-badge-bad-lead { background: rgba(100, 116, 139, 0.16); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.16); }
    .archive-badge-other { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.16); }
    .voice-active { box-shadow: 0 0 0 3px rgba(37,99,235,0.22); border-color: #2563eb !important; color: #dc2626 !important; animation: micPulse 1.2s ease-in-out infinite; }
    @keyframes micPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
    @media (pointer: coarse) {
      .textarea-mic-btn { min-width: 40px; min-height: 40px; display: flex; align-items: center; justify-content: center; }
      .textarea-mic-btn svg, .textarea-mic-btn i { width: 20px !important; height: 20px !important; }
    }
    .voice-field-armed { box-shadow: 0 0 0 2px rgba(37,99,235,0.15) inset; border-color: rgba(37,99,235,0.55) !important; }
    .pac-container { z-index: 99999 !important; border-radius: 12px; border: 1px solid rgba(148,163,184,0.25); overflow: hidden; }
    .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
    .no-scrollbar::-webkit-scrollbar { display: none; }
    .signature-pad canvas { touch-action: none; }
    .contract-toggle-btn.active { background: #0f172a; color: white; border-color: #0f172a; }
    .gm-ui-hover-effect { top: 0 !important; right: 0 !important; }
    .pipeline-chevron-wrap { position: relative; margin-bottom: 0; overflow: visible; }
    .pipeline-chevron { position: relative; height: 40px; width: 100%; }
    .pipeline-chevron.first, .pipeline-chevron.middle { width: calc(100% + 16px); }
    .pipeline-chevron.last { width: 100%; }
    .pipeline-chevron-wrap[data-stage-index="0"] .pipeline-chevron { z-index: 4; }
    .pipeline-chevron-wrap[data-stage-index="1"] .pipeline-chevron { z-index: 3; }
    .pipeline-chevron-wrap[data-stage-index="2"] .pipeline-chevron { z-index: 2; }
    .pipeline-chevron-wrap[data-stage-index="3"] .pipeline-chevron { z-index: 1; }
    .pipeline-chevron-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
    .pipeline-chevron-content { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
    .pipeline-chevron.first .pipeline-chevron-content { padding-left: 14px; padding-right: 24px; }
    .pipeline-chevron.middle .pipeline-chevron-content { padding-left: 22px; padding-right: 24px; }
    .pipeline-chevron.last .pipeline-chevron-content { padding-left: 22px; padding-right: 14px; }
    .pipeline-chevron-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1; }
    .pipeline-chevron-count { width: 20px; height: 20px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #d1d5db; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); }
    .quote-compact-card { border-radius: 9px; border: 1px solid rgba(148, 163, 184, 0.14); background: rgba(255,255,255,0.03); padding: 5px 7px; }
    .quote-compact-card-purple { border-radius: 10px; border: 1px solid rgba(147, 51, 234, 0.3); background: rgba(147, 51, 234, 0.1); padding: 5px 8px; }
    .quote-compact-card-converted { border-radius: 10px; border: 1px solid rgba(234, 179, 8, 0.38); background: rgba(234, 179, 8, 0.16); padding: 5px 8px; }
    .quote-compact-title { font-size: 9px; line-height: 1; text-transform: uppercase; letter-spacing: 0.08em; color: rgb(100 116 139); margin-bottom: 4px; font-weight: 700; }
    .quote-mini-btn { min-height: 26px; height: 26px; font-size: 10px; font-weight: 500; border-radius: 7px; }
    .quote-primary-btn { min-height: 28px; height: 28px; font-size: 11px; font-weight: 600; border-radius: 9px; }
    .quote-tight-stack { display: flex; flex-direction: column; gap: 4px; }
    .quote-tight-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
    .quote-tight-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
    .quote-tight-grid-7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
    .quote-helper { margin-top: 3px; font-size: 10px; line-height: 1.1; }
    .quote-fit-panel { height: 100%; display: flex; flex-direction: column; justify-content: flex-start; }
    .quote-fit-panel-inner { display: flex; flex-direction: column; gap: 5px; height: 100%; }
    .stage-modal-new { background: rgba(37, 99, 235, 0.07) !important; border-color: rgba(37, 99, 235, 0.3) !important; }
    .stage-modal-contacted { background: rgba(21, 128, 61, 0.07) !important; border-color: rgba(21, 128, 61, 0.3) !important; }
    .stage-modal-quoted { background: rgba(147, 51, 234, 0.07) !important; border-color: rgba(147, 51, 234, 0.3) !important; }
    .stage-modal-converted { background: rgba(234, 179, 8, 0.07) !important; border-color: rgba(234, 179, 8, 0.48) !important; }
    .editable-inline-input { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 1px 3px; min-width: 0; }
    .editable-inline-input:focus { background: rgba(255,255,255,0.92); border-color: rgba(37, 99, 235, 0.5); color: #0f172a; outline: none; }
    .dark .editable-inline-input:focus { background: rgba(11, 13, 16, 0.92); color: white; }
    .detail-shell { width: 1010px; max-width: calc(100vw - 54px); height: 652px; max-height: calc(100vh - 54px); }
    .detail-header-main { display: grid; grid-template-columns: 1fr 250px; gap: 12px; align-items: start; }
    .detail-meta-row { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 7px; font-size: 13px; color: rgb(51 65 85); }
    .dark .detail-meta-row { color: rgb(203 213 225); }
    .detail-meta-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
    .detail-meta-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgb(30 41 59); }
    .dark .detail-meta-item span { color: rgb(226 232 240); }
    .contact-inline-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
    .contact-link-chip, .contact-inline-chip { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: none; background: rgba(255,255,255,0.04); border: 1px solid rgba(148,163,184,0.1); border-radius: 9999px; padding: 2px 6px; }
    .contact-link-chip a { min-width: 0; max-width: 172px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: rgb(30 41 59); font-size: 12px; }
    .dark .contact-link-chip a { color: rgb(226 232 240); }
    .contact-link-chip a:hover { color: #60a5fa; }
    .contact-inline-chip input { min-width: 68px; max-width: 172px; background: transparent; border: 0; outline: none; font-size: 12px; color: rgb(30 41 59); }
    .dark .contact-inline-chip input { color: rgb(226 232 240); }
    .contact-inline-btn { width: 16px; height: 16px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; color: rgb(148 163 184); transition: all 0.18s ease; }
    .contact-inline-btn:hover { background: rgba(255,255,255,0.08); color: white; }
    .contact-inline-btn-danger:hover { color: #f87171; background: rgba(127,29,29,0.14); }
    .action-stack { display: flex; flex-direction: column; gap: 7px; align-items: stretch; }
    .action-top-row { display: flex; justify-content: flex-end; gap: 6px; }
    .action-secondary-row { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
    .icon-btn-clean { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(148,163,184,0.16); background: rgba(255,255,255,0.04); transition: all 0.18s ease; }
    .icon-btn-clean:hover { background: rgba(255,255,255,0.07); }
    .icon-btn-danger:hover { color: #f87171; border-color: rgba(248,113,113,0.2); background: rgba(127,29,29,0.12); }
    .property-quote-stamp {
      position: absolute;
      right: 10px;
      bottom: 48px;
      z-index: 24;
      display: none;
      align-items: center;
      justify-content: flex-start;
      gap: 7px;
      width: fit-content;
      max-width: calc(100% - 20px);
      background: rgba(15,23,42,0.72);
      border: 1px solid rgba(255,255,255,0.08);
      backdrop-filter: blur(8px);
      border-radius: 12px;
      padding: 5px 8px;
    }
    .property-quote-stamp.visible { display: inline-flex; }
    .property-quote-stamp img { width: 22px; height: 22px; border-radius: 9999px; object-fit: cover; border: 1px solid rgba(255,255,255,0.12); }
    .property-stage-footer {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 25;
      display: none;
      background: linear-gradient(180deg, rgba(88,28,135,0.88), rgba(107,33,168,0.96));
      border-top: 1px solid rgba(255,255,255,0.12);
      backdrop-filter: blur(8px);
      padding: 8px 10px;
    }
    .property-stage-footer.visible { display: block; }
    .property-stage-footer.converted-footer {
      background: rgba(234, 179, 8, 0.96);
      border-top: 1px solid rgba(255,255,255,0.18);
    }
    .property-quote-grid { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; }
    .property-quote-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 9999px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.1); color: white; font-size: 10px; font-weight: 500; }
    .card-meta-corner { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 6px; font-size: 10px; color: rgb(148 163 184); z-index: 4; }
    .card-meta-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 5px; border-radius: 9999px; background: rgba(255,255,255,0.05); border: 1px solid rgba(148,163,184,0.12); }
    .card-action-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px; background: rgba(255,255,255,0.05); border: 1px solid rgba(148,163,184,0.12); cursor: pointer; }
    .card-action-icon:hover { background: rgba(255,255,255,0.12); color: white; }
    .lead-card-photo-wrap {
      width: 100%;
      aspect-ratio: 7 / 5;
      overflow: hidden;
      border-radius: 12px;
      border: 1px solid rgba(148,163,184,0.18);
      background: rgba(15,23,42,0.55);
      position: relative;
    }
    .lead-card-photo-wrap::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 28px;
      background: linear-gradient(to top, rgba(2,6,23,0.32), rgba(2,6,23,0));
      pointer-events: none;
    }
    .card-timer-overlay {
      position: absolute;
      bottom: 6px;
      right: 6px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 9999px;
      background: rgba(0,0,0,0.6);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      font-size: 10px;
      font-weight: 500;
      color: #fff;
      z-index: 5;
      line-height: 1;
    }
    .lead-card-thumb {
      width: 100%;
      height: 112%;
      object-fit: cover;
      object-position: center top;
      display: block;
      transform: translateY(0);
      background: rgba(15,23,42,0.6);
    }
    .lead-card-thumb-fallback {
      width: 100%;
      height: 100%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: rgb(148 163 184);
    }
    .quote-status-bar { margin-top: auto; border-top: 1px solid rgba(148,163,184,0.1); padding-top: 7px; font-size: 11px; color: white; text-align: center; line-height: 1.3; }
    .system-avatar-badge { background: white; border-radius: 9999px; border: 1px solid rgba(148,163,184,0.18); object-fit: cover; }
    .history-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 9999px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid rgba(148,163,184,0.14); background: rgba(255,255,255,0.05); color: rgb(148 163 184); }
    .history-badge-new { background: rgba(37, 99, 235, 0.1); color: #60a5fa; border-color: rgba(37, 99, 235, 0.22); }
    .history-badge-contacted { background: rgba(21, 128, 61, 0.1); color: #4ade80; border-color: rgba(21, 128, 61, 0.22); }
    .history-badge-quoted { background: rgba(147, 51, 234, 0.1); color: #c084fc; border-color: rgba(147, 51, 234, 0.22); }
    .history-badge-converted { background: rgba(234, 179, 8, 0.1); color: #facc15; border-color: rgba(234, 179, 8, 0.22); }
    .history-badge-archived { background: rgba(239, 68, 68, 0.12); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
    .history-badge-restored { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.18); }
    .history-badge-signed { background: rgba(220, 38, 38, 0.12); color: #dc2626; border-color: rgba(220, 38, 38, 0.24); }
    .history-badge-first-impression { background: rgba(234, 179, 8, 0.18); color: #ca8a04; border-color: rgba(234, 179, 8, 0.34); }
    .history-badge-alert { background: rgba(220, 38, 38, 0.12); color: #f87171; border-color: rgba(220, 38, 38, 0.2); }
    html:not(.dark) .history-badge-new { background: #1e40af; color: #ffffff; border-color: #1e3a8a; }
    html:not(.dark) .history-badge-contacted { background: #166534; color: #ffffff; border-color: #14532d; }
    html:not(.dark) .history-badge-quoted { background: #6b21a8; color: #ffffff; border-color: #581c87; }
    html:not(.dark) .history-badge-converted { background: #92400e; color: #ffffff; border-color: #78350f; }
    html:not(.dark) .history-badge-archived { background: #991b1b; color: #ffffff; border-color: #7f1d1d; }
    html:not(.dark) .history-badge-restored { background: #1e40af; color: #ffffff; border-color: #1e3a8a; }
    html:not(.dark) .history-badge-signed { background: #991b1b; color: #ffffff; border-color: #7f1d1d; }
    html:not(.dark) .history-badge-first-impression { background: #92400e; color: #ffffff; border-color: #78350f; }
    html:not(.dark) .history-badge-alert { background: #991b1b; color: #ffffff; border-color: #7f1d1d; }
    .suggested-price-emphasis { font-size: 13px; line-height: 1; font-weight: 400; color: rgb(182 190 200); letter-spacing: 0.002em; }
    .suggested-price-micro { font-size: 10px; font-weight: 400; color: rgb(148 163 184); text-transform: lowercase; }
    .pipeline-drop-zone {
      transition: box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
      border-style: solid;
    }
    .pipeline-drop-zone.drag-target-valid {
      box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18) inset;
      border-color: rgba(34, 197, 94, 0.8) !important;
      background: rgba(34, 197, 94, 0.06) !important;
      border-style: dashed !important;
    }
    html:not(.dark) .pipeline-drop-zone.drag-target-valid {
      box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4) inset !important;
      border-color: rgb(34, 197, 94) !important;
      background: #f6f6f5 !important;
    }
    .pipeline-drop-zone.drag-target-invalid {
      box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18) inset;
      border-color: rgba(239, 68, 68, 0.82) !important;
      background: rgba(239, 68, 68, 0.06) !important;
      border-style: dashed !important;
    }
    html:not(.dark) .pipeline-drop-zone.drag-target-invalid {
      box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4) inset !important;
      border-color: rgb(239, 68, 68) !important;
      background: #f6f6f5 !important;
    }
    .lead-gallery-card { position: relative; aspect-ratio: 16/10; background: #111; border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid rgba(148,163,184,0.12); transition: all 0.2s; }
    .lead-gallery-card:hover { border-color: rgba(37,99,235,0.35); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
    .lead-gallery-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; transition: opacity 0.2s; }
    .lead-gallery-card:hover img { opacity: 1; }
    .lead-gallery-card .gallery-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, transparent 45%); opacity: 0; transition: opacity 0.2s; display: flex; align-items: flex-end; padding: 6px 8px; }
    .lead-gallery-card:hover .gallery-overlay { opacity: 1; }
    html:not(.dark) .lead-gallery-card { border-color: #d6d3d1; background: #f5f5f4; }
    html:not(.dark) .lead-gallery-card:hover { border-color: rgba(21,128,61,0.4); }
    .drag-ghost-card { position: fixed; z-index: 9999; pointer-events: none; width: 260px; max-width: 70vw; opacity: 0.92; box-shadow: 0 20px 50px rgba(0,0,0,0.35); border-radius: 12px; will-change: transform; }
    .drag-origin-hidden { opacity: 0.35 !important; }
    .desktop-dragging-card { opacity: 0.55; }
    .touch-dragging-active { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: hidden !important; touch-action: none; }
    .touch-dragging-active * { touch-action: none; -webkit-overflow-scrolling: auto; }
    .tab-divider-strip {
      height: 10px;
      flex-shrink: 0;
      position: relative;
      z-index: 5;
      background: rgb(248 250 252);
      border-bottom: 1px solid rgb(226 232 240);
      display: none;
    }
    .dark .tab-divider-strip {
      background: rgba(255,255,255,0.05);
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .tab-divider-strip.visible { display: block; }
    .measure-badge-ready {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 6px;
      border-radius: 9999px;
      background: rgba(234,179,8,0.14);
      border: 1px solid rgba(234,179,8,0.32);
      color: #facc15;
      font-size: 10px;
      font-weight: 700;
    }
    .card-convert-overlay {
      position: absolute;
      top: 6px;
      right: 6px;
      z-index: 5;
      background: rgba(15,23,42,0.82);
      backdrop-filter: blur(4px);
      border: 1px solid rgba(234,179,8,0.45);
    }
    .quote-metric-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
    }
    .quote-metric-box {
      border-radius: 9px;
      border: 1px solid rgba(148,163,184,0.14);
      background: rgba(255,255,255,0.03);
      padding: 4px 7px;
    }
    .quote-metric-box.clickable-measure, .quote-compact-card.clickable-measure { cursor: pointer; transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease; }
    .quote-metric-box.clickable-measure:hover, .quote-compact-card.clickable-measure:hover { border-color: rgba(37, 99, 235, 0.5); background: rgba(37, 99, 235, 0.06); box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12) inset; }
    .quote-metric-label {
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: rgb(100 116 139);
      font-weight: 700;
      margin-bottom: 2px;
    }
    .quote-metric-value {
      font-size: 12px;
      font-weight: 600;
      color: rgb(15 23 42);
    }
    .dark .quote-metric-value { color: rgb(248 250 252); }
    .quote-metric-sub {
      margin-top: 2px;
      font-size: 10px;
      color: rgb(100 116 139);
    }
    .sms-recipient-toggle-active {
      background: #2563eb !important;
      color: white !important;
      border-color: #2563eb !important;
    }
    html:not(.dark) .sms-recipient-toggle-active {
      background: #4d7f3b !important;
      border-color: #4d7f3b !important;
    }
    html:not(.dark) .sms-recipients-label {
      color: #4d7f3b !important;
    }
    html:not(.dark) .sms-send-btn {
      background: #4d7f3b !important;
    }
    html:not(.dark) .sms-call-btn {
      background: #eab308 !important;
      color: #1f2937 !important;
    }
    /* Light mode: send options buttons */
    html:not(.dark) .send-email-btn,
    html:not(.dark) .send-text-btn {
      background: #4d7f3b !important;
    }
    html:not(.dark) .sign-in-person-btn {
      background: #eab308 !important;
      color: #1f2937 !important;
    }
    .lead-card-fixed-height { box-sizing: border-box; }
    /* Reserve 2-line height for address so street view photos align across columns */
    .lead-card-address { min-height: 2.4em; }
    .lead-card-bottom-meta { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 500; color: #374151; text-align: center; }
    .dark .lead-card-bottom-meta { color: white; }
    .converted-price-pill { background: rgba(234, 179, 8, 0.18) !important; color: #facc15 !important; border: 1px solid rgba(234, 179, 8, 0.25); }
    html:not(.dark) .converted-price-pill { color: #92400e !important; }
    .first-impression-stars-wrap { margin-top: 8px; text-align: center; }
    .first-impression-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgb(148 163 184); margin-bottom: 3px; }
    .first-impression-stars { display: inline-flex; align-items: center; justify-content: center; gap: 2px; color: #facc15; }
    .star-btn { width: 32px; height: 32px; border-radius: 9999px; border: 1px solid rgb(226 232 240); display: inline-flex; align-items: center; justify-content: center; background: white; color: rgb(148 163 184); transition: all 0.18s ease; }
    .star-btn.active, .star-btn:hover { color: #facc15; border-color: rgba(234,179,8,0.45); background: rgba(254,249,195,0.6); }
    .dark .star-btn { background: #0b0d10; border-color: #272a30; }
    .light .light-toolbar,
    html:not(.dark) .light-toolbar {
      background: #938c87 !important;
      border-color: #847d78 !important;
      box-shadow: 0 8px 22px rgba(120, 110, 100, 0.12);
    }
    html:not(.dark) .light-toolbar .bg-brand-blue,
    html:not(.dark) .light-toolbar .bg-slate-800 {
      background: #4d7f3b !important;
      border-color: #4d7f3b !important;
    }
    html:not(.dark) .light-toolbar span.bg-brand-blue {
      background: #4d7f3b !important;
    }
    html:not(.dark) .light-toolbar .text-slate-400 {
      color: rgba(255,255,255,0.75) !important;
    }
    html:not(.dark) .light-toolbar select {
      background: #ffffff !important;
      color: #374151 !important;
      border-color: rgba(148,163,184,0.3) !important;
    }
    html:not(.dark) .light-toolbar input[type="text"] {
      background: rgba(255,255,255,0.15) !important;
      color: #ffffff !important;
      border-color: rgba(255,255,255,0.2) !important;
    }
    html:not(.dark) .light-toolbar input[type="text"]::placeholder {
      color: rgba(255,255,255,0.55) !important;
    }
    html:not(.dark) body { background: #ffffff; color: #374151; }
    html:not(.dark) main { background: #ffffff !important; }
    html:not(.dark) .pipeline-drop-zone { background: #f6f6f5 !important; border-color: #e5e5e4 !important; }
    html:not(.dark) .card-item {
      background: #ffffff !important;
      border-color: #e5e5e4 !important;
      box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    }
    html:not(.dark) .chevron-poly { fill: #f2f1ec; stroke: none; }
    .dark .chevron-poly { fill: #1f2127; stroke: #2d3139; }
    html:not(.dark) .pipeline-chevron-count {
      color: #6b7280;
      background: #ffffff;
      border-color: rgba(0,0,0,0.1);
    }
    html:not(.dark) #detail-modal-panel,
    html:not(.dark) #new-lead-modal > div,
    html:not(.dark) #archived-leads-modal > div,
    html:not(.dark) #archive-reason-modal > div,
    html:not(.dark) #archive-note-preview-modal > div,
    html:not(.dark) #custom-alert > div {
      box-shadow: 0 18px 40px rgba(120, 110, 100, 0.18);
      background: #ffffff !important;
      border-color: #e5e5e4 !important;
    }
    html:not(.dark) #detail-modal-panel .bg-slate-50,
    html:not(.dark) #new-lead-modal .bg-slate-50,
    html:not(.dark) #archive-reason-modal .bg-slate-50 {
      background: #f9f9f8 !important;
    }
    html:not(.dark) #archived-leads-modal .bg-\[\#1a1d21\],
    html:not(.dark) #archived-leads-modal .bg-\[\#1b1f25\],
    html:not(.dark) #archived-leads-modal .bg-\[\#111418\] {
      background: #f6f6f5 !important;
      color: #374151 !important;
    }
    html:not(.dark) #archived-leads-modal .border-white\/10,
    html:not(.dark) #archived-leads-modal .border-white\/5 {
      border-color: #e5e5e4 !important;
    }
    html:not(.dark) #archived-leads-modal .text-white {
      color: #374151 !important;
    }
    html:not(.dark) #archived-leads-modal #archived-count-pill,
    html:not(.dark) #archived-leads-modal #archived-year-label {
      color: #ffffff !important;
    }
    html:not(.dark) #archived-leads-modal .text-slate-500 {
      color: #6b7280 !important;
    }
    html:not(.dark) #archived-leads-modal .archive-close-btn {
      color: #6b7280 !important;
    }
    html:not(.dark) #archived-leads-modal .archive-close-btn:hover {
      color: #1f2937 !important;
      background: rgba(0,0,0,0.08) !important;
    }
    html:not(.dark) #archived-leads-modal input[type="text"] {
      background: #ffffff !important;
      color: #374151 !important;
      border-color: #e5e5e4 !important;
    }
    html:not(.dark) #archived-leads-modal input[type="text"]::placeholder {
      color: #9ca3af !important;
    }
    html:not(.dark) .quote-compact-card,
    html:not(.dark) .quote-metric-box {
      background: #f9f9f8;
      border-color: #e0ddd8;
    }
    html:not(.dark) .quote-compact-card-purple {
      background: #f3eef9;
      border-color: rgba(107, 33, 168, 0.28);
    }
    html:not(.dark) .quote-compact-card-purple .text-purple-200,
    html:not(.dark) .quote-compact-card-purple .text-purple-100\/85 {
      color: #6b21a8 !important;
    }
    html:not(.dark) .quote-compact-card-converted {
      background: #faf6eb;
      border-color: rgba(180, 130, 0, 0.28);
    }
    html:not(.dark) .quote-compact-card-converted .text-yellow-100,
    html:not(.dark) .quote-compact-card-converted .text-yellow-50\/90 {
      color: #78350f !important;
    }
    html:not(.dark) .quote-status-bar {
      color: #4b5563;
      background: #f6f6f5;
      border-top-color: #e0ddd8;
    }
    html:not(.dark) .card-meta-pill {
      background: #ffffff;
      border-color: rgba(0,0,0,0.08);
      color: #374151;
      box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }
    html:not(.dark) .quote-compact-title {
      color: #6b5e52 !important;
    }
    html:not(.dark) .card-action-icon {
      background: rgba(255,255,255,0.85);
      border-color: rgba(0,0,0,0.1);
      color: #6b7280;
    }
    html:not(.dark) .card-action-icon:hover {
      background: #ffffff;
      color: #374151;
    }
    html:not(.dark) .stage-badge-new { background: #1e40af; color: #ffffff; border-color: #1e3a8a; }
    html:not(.dark) .stage-badge-contacted { background: #166534; color: #ffffff; border-color: #14532d; }
    html:not(.dark) .stage-badge-quoted { background: #6b21a8; color: #ffffff; border-color: #581c87; }
    html:not(.dark) .stage-badge-converted { background: #92400e; color: #ffffff; border-color: #78350f; }
    html:not(.dark) .star-btn.active,
    html:not(.dark) .star-btn.active:hover {
      color: #ca8a04;
      border-color: rgba(234,179,8,0.5);
      background: rgba(254,249,195,0.7);
    }
    html:not(.dark) .star-btn.active i svg,
    html:not(.dark) .star-btn.active svg,
    html:not(.dark) .first-impression-stars i svg,
    html:not(.dark) .first-impression-stars svg {
      fill: currentColor;
    }
    html:not(.dark) .star-btn.active i,
    html:not(.dark) .first-impression-stars i {
      fill: currentColor;
    }
    /* Light mode: all link/button hovers green */
    html:not(.dark) a:hover,
    html:not(.dark) .hover\:text-brand-blue:hover {
      color: #4d7f3b !important;
    }
    html:not(.dark) .light-toolbar .text-\[10px\].text-slate-400 {
      color: rgba(255,255,255,0.7) !important;
    }
    html:not(.dark) #detail-modal-panel .bg-brand-blue,
    html:not(.dark) #interaction-footer .bg-brand-blue {
      background: #4d7f3b !important;
    }
    html:not(.dark) #detail-tabs-row button.text-brand-blue {
      color: #4d7f3b !important;
      border-color: #4d7f3b !important;
    }
    html:not(.dark) #detail-tabs-row button {
      color: #78716c;
    }
    html:not(.dark) #detail-tabs-row button:hover {
      color: #4d7f3b;
    }
    /* Light mode: archive modal blue → green */
    html:not(.dark) #archived-leads-modal .bg-brand-blue {
      background: #4d7f3b !important;
    }
    html:not(.dark) #archived-leads-modal .border-white\/10 button.bg-brand-blue,
    html:not(.dark) #archived-leads-modal button.bg-brand-blue {
      background: #4d7f3b !important;
      color: #ffffff !important;
    }
    /* Light mode notes: match nearby tab styling */
    html:not(.dark) .note-bubble {
      background: #f9f9f8 !important;
      border-color: #e5e5e4 !important;
    }
    /* Generate Contract button: no hover color change in light mode */
    html:not(.dark) .quote-primary-btn.bg-brand-green:hover {
      background: #15803d !important;
    }
    /* Light mode background check buttons */
    html:not(.dark) .bg-slate-800 {
      background: #938c87 !important;
    }
    /* Light mode view buttons (Street/Satellite) */
    html:not(.dark) .view-btn-inactive {
      background: #e8e4de !important;
      color: #6b5e52 !important;
    }
    html:not(.dark) .view-btn-active {
      background: #4d7f3b !important;
    }

    /* ── Light mode: measure modal ── */
    html:not(.dark) #measure-modal {
      background: rgba(255,255,255,0.6);
    }
    html:not(.dark) #measure-modal-shell {
      background: #ffffff;
      border-color: #ddd6c8;
      box-shadow: 0 24px 70px rgba(120,110,100,0.22);
    }
    html:not(.dark) #measure-modal .titlebar {
      background: linear-gradient(180deg, #938c87, #8a837e);
      border-bottom-color: #7d766f;
      color: #ffffff;
    }
    html:not(.dark) #measure-modal .titlebar h1 { color: #ffffff; }
    html:not(.dark) #measure-modal .titlebar .meta { color: rgba(255,255,255,0.7); }
    html:not(.dark) #measure-modal .sidebar {
      background: #f6f6f5;
      border-right-color: #e5e5e4;
    }
    html:not(.dark) #measure-modal .panel {
      background: #ffffff;
      border-color: #e5e5e4;
    }
    html:not(.dark) #measure-modal .panel-header {
      background: #f6f6f5;
      border-bottom-color: #e5e5e4;
    }
    html:not(.dark) #measure-modal .panel-header h2 { color: #6b7280; }
    html:not(.dark) #measure-modal .panel-body { color: #374151; }
    html:not(.dark) #measure-modal .title-btn {
      background: rgba(255,255,255,0.2);
      border-color: rgba(255,255,255,0.3);
      color: #ffffff;
    }
    html:not(.dark) #measure-modal .title-btn:hover {
      background: rgba(255,255,255,0.3);
      border-color: rgba(255,255,255,0.45);
    }
    html:not(.dark) #measure-modal .title-btn.primary {
      background: rgba(21,128,61,0.25);
      border-color: rgba(21,128,61,0.5);
      color: #ffffff;
    }
    html:not(.dark) #measure-modal .title-btn.primary:hover {
      background: rgba(21,128,61,0.35);
      border-color: rgba(21,128,61,0.65);
    }
    html:not(.dark) #measure-modal button,
    html:not(.dark) #measure-modal input[type="text"],
    html:not(.dark) #measure-modal select {
      background: #ffffff;
      border-color: #ddd6c8;
      color: #374151;
    }
    html:not(.dark) #measure-modal button { color: #374151; }
    html:not(.dark) #measure-modal button.active {
      border-color: #4d7f3b;
      background: rgba(21,128,61,0.1);
      color: #4d7f3b;
    }
    html:not(.dark) #measure-modal .danger {
      background: rgba(239,68,68,0.08);
      border-color: rgba(239,68,68,0.3);
      color: #dc2626;
    }
    html:not(.dark) #measure-modal .status {
      background: #f6f6f5;
      border-color: #e5e5e4;
    }
    html:not(.dark) #measure-modal .small { color: #6b7280; }
    html:not(.dark) #measure-modal .hint { color: #4b5563; }
    html:not(.dark) #measure-modal .pill {
      background: rgba(21,128,61,0.1);
      color: #4d7f3b;
      border-color: rgba(21,128,61,0.25);
    }
    html:not(.dark) #measure-modal .pill.alt {
      background: #f6f6f5;
      color: #4b5563;
      border-color: #e5e5e4;
    }
    html:not(.dark) #measure-modal .toggle {
      border-color: #ddd6c8;
      background: #ffffff;
    }
    html:not(.dark) #measure-modal label { color: #4b5563; }
    html:not(.dark) #measure-modal .map-card { background: #f0efec; }
    html:not(.dark) #measure-modal #measureMapWrap { background: #f0efec; }
    html:not(.dark) #measure-modal #mapFooterOverlay {
      background: rgba(255,255,255,0.96);
      border-top-color: #e5e5e4;
    }
    html:not(.dark) #measure-modal .footer-kicker { color: #6b7280; }
    html:not(.dark) #measure-modal .footer-chip-toggle {
      border-color: #ddd6c8;
      background: #ffffff;
      color: #374151;
    }
    html:not(.dark) #measure-modal .footer-select,
    html:not(.dark) #measure-modal .footer-btn {
      border-color: #ddd6c8;
      background: #ffffff;
      color: #374151;
    }
    html:not(.dark) #measure-modal .footer-btn:hover,
    html:not(.dark) #measure-modal .footer-select:hover {
      border-color: #b8b0a8;
      background: #f6f6f5;
    }
    html:not(.dark) #measure-modal .footer-btn.finish {
      background: rgba(21,128,61,0.1);
      border-color: rgba(21,128,61,0.3);
      color: #4d7f3b;
    }
    html:not(.dark) #measure-modal .footer-btn.clear {
      background: rgba(239,68,68,0.06);
      border-color: rgba(239,68,68,0.25);
      color: #dc2626;
    }
    html:not(.dark) #measure-modal .footer-opacity {
      border-color: #ddd6c8;
      background: #ffffff;
    }
    html:not(.dark) #measure-modal .footer-opacity-value { color: #374151; }
    html:not(.dark) #measure-modal .map-overlay {
      background: rgba(255,255,255,0.92);
      border-color: #ddd6c8;
      box-shadow: 0 12px 24px rgba(120,110,100,0.15);
    }
    html:not(.dark) #measure-modal .overlay-metric {
      background: rgba(255,255,255,0.95);
      border-color: #e5e5e4;
    }
    html:not(.dark) #measure-modal .overlay-metric .label { color: #6b7280; }
    html:not(.dark) #measure-modal .overlay-metric .value { color: #1f2937; }
    html:not(.dark) #measure-modal .collapse-indicator { color: #9ca3af; }
    html:not(.dark) #measure-modal .api-ok { color: #15803d; }
    html:not(.dark) #measure-modal input[type="checkbox"],
    html:not(.dark) #measure-modal input[type="range"] {
      accent-color: #4d7f3b;
    }
    html:not(.dark) #measure-modal .title-btn.primary {
      background: #4d7f3b !important;
      border-color: #4d7f3b !important;
      color: #ffffff !important;
    }
    html:not(.dark) #measure-modal .title-btn.primary:hover {
      background: #3d6b2e !important;
      border-color: #3d6b2e !important;
    }

    #measure-modal {
      position: fixed;
      inset: 0;
      z-index: 300;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(0,0,0,0.7);
      backdrop-filter: blur(4px);
      padding: 16px;
    }
    #measure-modal.visible { display: flex; }
    #measure-modal-shell {
      width: min(980px, calc(100vw - 32px));
      height: min(620px, calc(100vh - 32px));
      border-radius: 16px;
      overflow: hidden;
      border: 1px solid #1e293b;
      background: #0f172a;
      box-shadow: 0 24px 70px rgba(0,0,0,0.42);
      display: grid;
      grid-template-rows: 40px 1fr;
    }
    #measure-modal * { box-sizing: border-box; }
    #measure-modal .titlebar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 10px 0 14px;
      background: linear-gradient(180deg, #111827, #0f172a);
      border-bottom: 1px solid #1e293b;
      gap: 12px;
      color: #e2e8f0;
    }
    #measure-modal .title-left { display: flex; align-items: center; min-width: 0; }
    #measure-modal .title-copy { display: flex; flex-direction: column; min-width: 0; }
    #measure-modal .titlebar h1 { margin: 0; font-size: 12px; font-weight: 700; color: #f8fafc; letter-spacing: 0.01em; line-height: 1.05; }
    #measure-modal .titlebar .meta { font-size: 9px; color: #94a3b8; line-height: 1.05; margin-top: 2px; }
    #measure-modal .title-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
    #measure-modal .title-btn {
      display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 26px; padding: 0 10px;
      border-radius: 8px; border: 1px solid #334155; background: #1e293b; color: #e2e8f0; font-size: 10px; font-weight: 700; cursor: pointer;
      transition: background 0.15s ease, border-color 0.15s ease;
    }
    #measure-modal .title-btn:hover { background: #243244; border-color: #475569; }
    #measure-modal .title-btn.primary { background: rgba(37, 99, 235, 0.14); border-color: rgba(59, 130, 246, 0.34); color: #bfdbfe; }
    #measure-modal .title-btn.primary:hover { background: rgba(37, 99, 235, 0.2); border-color: rgba(96, 165, 250, 0.55); }
    #measure-modal .title-btn.close-btn { width: 26px; min-width: 26px; padding: 0; font-size: 14px; line-height: 1; }
    #measure-modal .app { display: grid; grid-template-columns: 214px 1fr; height: 100%; min-height: 0; }
    #measure-modal .sidebar { overflow: hidden; padding: 6px; display: flex; flex-direction: column; gap: 6px; background: #0f172a; border-right: 1px solid #1e293b; }
    #measure-modal .panel { background: #111827; border: 1px solid #1e293b; border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
    #measure-modal .panel.brush-panel { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
    #measure-modal .panel.brush-panel .panel-body { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
    #measure-modal .brush-layout { display: flex; flex-direction: column; min-height: 100%; flex: 1 1 auto; }
    #measure-modal .brush-main { display: grid; gap: 4px; align-content: start; }
    #measure-modal .brush-actions { margin-top: auto; padding-top: 8px; }
    #measure-modal .panel-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 7px; cursor: pointer; user-select: none; background: #0f172a; border-bottom: 1px solid #1e293b; }
    #measure-modal .panel-header h2 { margin: 0; font-size: 9px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.08em; }
    #measure-modal .panel-body { padding: 6px; display: block; color: #e2e8f0; }
    #measure-modal .panel.collapsed .panel-body { display: none; }
    #measure-modal .controls { display: grid; gap: 4px; }
    #measure-modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
    #measure-modal .row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
    #measure-modal button, #measure-modal input[type="text"], #measure-modal input[type="range"], #measure-modal select {
      width: 100%; padding: 5px 7px; border-radius: 8px; border: 1px solid #334155; background: #1e293b; color: #e2e8f0; font-size: 10px;
    }
    #measure-modal input[type="text"] { padding: 6px 7px; }
    #measure-modal input[type="range"] { padding: 0; height: 12px; }
    #measure-modal button { cursor: pointer; font-weight: 700; }
    #measure-modal button.active { border-color: #3b82f6; background: rgba(59,130,246,0.15); color: #93c5fd; }
    #measure-modal .danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.35); color: #fca5a5; }
    #measure-modal .tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
    #measure-modal .tool-btn { padding: 5px 2px; min-height: 38px; display: grid; place-items: center; gap: 2px; }
    #measure-modal .tool-btn .text { font-size: 8px; line-height: 1.1; text-align: center; }
    #measure-modal .status { background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; padding: 5px; display: grid; gap: 3px; font-size: 9px; }
    #measure-modal .small { font-size: 8px; color: #94a3b8; }
    #measure-modal .hint { color: #cbd5e1; font-size: 8px; line-height: 1.25; }
    #measure-modal .pill-row { display: flex; gap: 4px; flex-wrap: wrap; }
    #measure-modal .pill { display: inline-block; padding: 3px 6px; background: rgba(59,130,246,0.12); color: #93c5fd; border-radius: 999px; font-size: 8px; font-weight: 700; border: 1px solid rgba(59,130,246,0.25); }
    #measure-modal .pill.alt { background: #1e293b; color: #cbd5e1; border: 1px solid #334155; }
    #measure-modal .toggle { display: flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 8px; border: 1px solid #334155; background: #1e293b; font-size: 9px; }
    #measure-modal .toggle input { margin: 0; width: auto; }
    #measure-modal label { font-size: 8px; color: #cbd5e1; }
    #measure-modal .map-card { background: #020617; min-width: 0; min-height: 0; display: grid; grid-template-rows: 1fr 70px; }
    #measure-modal #measureMapWrap { position: relative; overflow: hidden; background: #020617; min-width: 0; min-height: 0; }
    #measure-modal #measureMap { position: absolute; inset: 0; top: auto; left: 0; right: 0; bottom: -30px; height: calc(100% + 30px); z-index: 0; }
    #measure-modal #mapTint { display: none; }
    #measure-modal #mapFooterOverlay {
      position: relative; z-index: 25; display: flex; align-items: center; gap: 8px; padding: 8px 10px; pointer-events: auto;
      background: rgba(2, 6, 23, 0.98); border-top: 1px solid rgba(148,163,184,0.18);
    }
    #measure-modal .footer-section { display: flex; align-items: center; gap: 8px; min-width: 0; }
    #measure-modal .footer-section.grow { flex: 1 1 auto; }
    #measure-modal .footer-kicker { width: 58px; font-size: 8px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8; white-space: nowrap; }
    #measure-modal .footer-chip-toggle { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid #273449; background: #0f172a; color: #e2e8f0; font-size: 9px; white-space: nowrap; }
    #measure-modal .footer-chip-toggle input { width: auto; margin: 0; }
    #measure-modal .footer-select, #measure-modal .footer-btn { height: 24px; border-radius: 7px; border: 1px solid #273449; background: #0f172a; color: #f8fafc; font-size: 9px; }
    #measure-modal .footer-select { min-width: 96px; padding: 0 8px; }
    #measure-modal .footer-opacity { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; height: 24px; border-radius: 999px; border: 1px solid #273449; background: #0f172a; }
    #measure-modal .footer-opacity input[type="range"] { width: 72px; height: 12px; padding: 0; margin: 0; background: transparent; border: 0; }
    #measure-modal .footer-opacity-value { min-width: 28px; font-size: 9px; font-weight: 700; color: #e2e8f0; text-align: right; }
    #measure-modal .footer-btn { padding: 0 10px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.15s ease, border-color 0.15s ease; }
    #measure-modal .footer-btn:hover, #measure-modal .footer-select:hover { border-color: #3a4a63; background: #111c2e; }
    #measure-modal .footer-btn.finish { background: rgba(37, 99, 235, 0.16); border-color: rgba(59, 130, 246, 0.34); color: #dbeafe; }
    #measure-modal .footer-btn.clear { background: rgba(239, 68, 68, 0.1); border-color: rgba(248, 113, 113, 0.24); color: #fecaca; }
    #measure-modal #paintCanvas { position: absolute; inset: 0; z-index: 20; display: block; outline: none; }
    #measure-modal .map-overlay {
      position: absolute; top: 8px; left: 8px; z-index: 30; width: 182px; background: rgba(15,23,42,0.92); border: 1px solid #334155;
      border-radius: 12px; backdrop-filter: blur(8px); box-shadow: 0 12px 24px rgba(0,0,0,0.28); padding: 7px; display: grid; gap: 6px; pointer-events: none;
    }
    #measure-modal .overlay-metric { background: rgba(17,24,39,0.95); border: 1px solid #334155; border-radius: 9px; padding: 6px 7px; }
    #measure-modal .overlay-metric .label { font-size: 8px; color: #94a3b8; margin-bottom: 2px; }
    #measure-modal .overlay-metric .value { font-size: 11px; font-weight: 700; color: #f8fafc; line-height: 1.25; }
    #measure-modal .api-ok { color: #86efac; }
    #measure-modal .api-bad { color: #fca5a5; }
    #measure-modal .collapse-indicator { font-size: 10px; color: #94a3b8; }

    @media (max-width: 1180px) {
      .detail-shell { width: 980px; max-width: calc(100vw - 30px); height: 644px; max-height: calc(100vh - 30px); }
    }
    @media (max-width: 1024px) {
      .detail-shell { width: 960px; max-width: calc(100vw - 22px); height: 640px; max-height: calc(100vh - 22px); }
      .detail-header-main { grid-template-columns: 1fr 220px; }
    }
    @media (max-width: 900px) {
      #measure-modal #measure-modal-shell { width: min(920px, calc(100vw - 20px)); height: min(600px, calc(100vh - 20px)); }
      #measure-modal .app { grid-template-columns: 200px 1fr; }
      #measure-modal #mapFooterOverlay { gap: 6px; padding: 7px 8px; }
      #measure-modal .footer-select { min-width: 84px; }
      #measure-modal .footer-btn { padding: 0 8px; }
    }
    @media (max-width: 820px) {
      .detail-shell { width: calc(100vw - 14px); height: calc(var(--app-vh) - 14px); max-width: calc(100vw - 14px); max-height: calc(var(--app-vh) - 14px); }
      .detail-header-main { grid-template-columns: 1fr; }
      .action-stack { align-items: flex-start; }
      .action-top-row, .action-secondary-row { justify-content: flex-start; }
      .property-quote-grid { grid-template-columns: 1fr; gap: 6px; }
    }

    /* ── iPad Pro 11" with sidebar (≈934px available) ── */
    @media (max-width: 1080px) {
      .pipeline-card-compact .card-meta-corner { top: 6px; right: 6px; gap: 4px; }
      .pipeline-card-compact .card-meta-pill { padding: 1px 4px; font-size: 9px; }
      .pipeline-card-compact .card-action-icon { width: 16px; height: 16px; }
      .pipeline-drop-zone { padding: 6px !important; }
      .pipeline-drop-zone > * + * { margin-top: 6px !important; }
      .pipeline-chevron { height: 36px; }
      .pipeline-chevron-title { font-size: 12px; }
      .pipeline-chevron-count { font-size: 10px; min-width: 18px; padding: 1px 5px; }
      .lead-card-photo-wrap { border-radius: 8px; }
      .card-timer-overlay { bottom: 4px; right: 4px; padding: 1px 5px; font-size: 9px; }
      .lead-card-bottom-meta { padding-top: 6px; font-size: 12px; }
      .first-impression-stars-wrap { margin-top: 6px; }
    }
