/* Relocation HQ - High-contrast outdoor theme */

:root {
    --brand-name: "Relocation HQ";
    --primary: #1a5276;
    --primary-light: #2980b9;
    --accent: #e67e22;
    --success: #27ae60;
    --danger: #c0392b;
    --warning: #f39c12;
    --bg: #f5f5f5;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-muted: #555;
    --border: #333;
    --border-light: #ccc;
    --radius: 8px;
    --shadow: 0 2px 4px rgba(0,0,0,0.15);
    --tap-min: 48px;
    --font-base: 18px;
}

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

html {
    font-size: var(--font-base);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Offline / sync banner */
.offline-banner {
    position: sticky;
    top: 0;
    z-index: 101;
    background: #555;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    padding: 10px 16px;
    line-height: 1.3;
}
.offline-banner--pending {
    background: var(--danger);
}
.offline-banner--syncing {
    background: var(--primary);
}

/* Sync pending badge in header */
.sync-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 6px;
    margin-right: 6px;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

/* Pending indicator on entity rows */
._pending-dot::after {
    content: ' \25CF';
    color: var(--warning);
    font-size: 0.7rem;
    vertical-align: super;
}

/* Header */
.header {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

.header h1 {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-back {
    background: none;
    border: 2px solid rgba(255,255,255,0.6);
    color: #fff;
    width: var(--tap-min);
    height: var(--tap-min);
    border-radius: var(--radius);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back:active { background: rgba(255,255,255,0.2); }

.header-actions {
    display: flex;
    gap: 8px;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 3px solid var(--border);
    display: flex;
    align-items: stretch;
    overflow: visible;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 4px;
    min-height: 44px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    border-right: 1px solid var(--border-light);
    transition: background 0.15s;
}

.bottom-nav a:first-child,
.bottom-nav a:last-child { border-right: none; }
.bottom-nav a.active { color: var(--primary); background: #e8f0fe; }
.bottom-nav a:active { background: #e8e8e8; }
.bottom-nav .nav-icon { font-size: 1.4rem; margin-bottom: 2px; }

/* FAB — elevated center button */
.bottom-nav a.nav-fab {
    flex: 0 0 80px;
    border-right: none;
    background: none;
    padding: 0;
    margin: 0 4px;
    min-height: unset;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-fab-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transform: translateY(-18px);
    transition: transform 0.15s, box-shadow 0.15s;
}

.nav-fab-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
    transform: translateY(-14px);
}

.bottom-nav a.nav-fab:active .nav-fab-circle {
    transform: translateY(-18px) scale(0.93);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* More sheet */
#more-sheet {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}
#more-sheet.active { display: flex; }

#more-sheet-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
}

#more-sheet-panel {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

#more-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

#more-sheet-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0 0 12px;
}

#more-sheet-body {
    padding: 8px 0 16px;
}

.more-sheet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s;
}
.more-sheet-item:active { background: var(--bg-alt); }

.more-sheet-icon {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.more-sheet-divider {
    height: 1px;
    background: var(--border-light);
    margin: 6px 20px;
}

/* Main content */
.main { padding: 16px; max-width: 900px; margin: 0 auto; }

/* Cards */
.card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.tip-link {
    margin-left: 8px;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: linear-gradient(135deg, #eef5fa 0%, #dce9f3 100%);
    border: 1px solid #b8d4e8;
    border-radius: 12px;
    padding: 3px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s;
}
.tip-link:hover { background: linear-gradient(135deg, #dce9f3 0%, #c5daea 100%); box-shadow: 0 1px 4px rgba(26,82,118,0.15); }

/* Collapsible cards */
.card-title.collapsible {
    cursor: pointer;
    user-select: none;
}
.collapse-chevron {
    font-size: 0.75rem;
    display: inline-block;
    transition: transform 0.15s;
    margin-right: 6px;
    color: var(--text-muted);
}
.card:not(.collapsed) .collapse-chevron { transform: rotate(90deg); }
.card.collapsed .card-body { display: none; }

/* Stats row */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    flex: 1 1 120px; /* Allow shrinking and growing, minimum 120px */
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--tap-min);
    min-width: var(--tap-min);
    padding: 10px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    background: var(--surface);
    color: var(--text);
}

.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: auto; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:active { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid var(--border-light);
}
th:last-child { padding-right: 18px; }

th {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

th:hover { background: var(--primary-light); }

tr:hover { background: #f0f0f0; }

td a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

td a:hover { text-decoration: underline; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 2px solid;
}

.badge-to-review { background: #fff3cd; color: #856404; border-color: #856404; }
.badge-shortlist { background: #d4edda; color: #155724; border-color: #155724; }
.badge-scheduling-tour { background: #fdebd0; color: #a04000; border-color: #e67e22; }
.badge-tour-scheduled { background: #e8daef; color: #6c3483; border-color: #6c3483; }
.badge-toured { background: #cce5ff; color: #004085; border-color: #004085; }
.badge-offer { background: #f8d7da; color: #721c24; border-color: #721c24; }
.badge-rejected { background: #e2e3e5; color: #383d41; border-color: #383d41; }

.badge-paused { background: #e8daef; color: #6c3483; border-color: #6c3483; }
.badge-closed { background: #d4edda; color: #155724; border-color: #155724; }

.badge-open { background: #fff3cd; color: #856404; border-color: #856404; }
.badge-done { background: #d4edda; color: #155724; border-color: #155724; }

.badge-high { background: #f8d7da; color: #721c24; border-color: #721c24; }
.badge-medium { background: #fff3cd; color: #856404; border-color: #856404; }
.badge-low { background: #e2e3e5; color: #383d41; border-color: #383d41; }

.badge-active { background: #d4edda; color: #155724; border-color: #155724; }
.badge-revoked { background: #e2e3e5; color: #383d41; border-color: #383d41; }
.badge-disabled { background: #e2e3e5; color: #383d41; border-color: #383d41; }

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    min-height: var(--tap-min);
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.3);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23333'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control { min-height: 80px; resize: vertical; }

/* ── Chips & Chip Pickers ──────────────────────────────────────────────── */
.chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    background: var(--bg-muted, #f0f4f8);
    color: var(--text-secondary, #4a5568);
    white-space: nowrap;
}
.chip-lang {
    background: #e8f4fd;
    color: #1a73e8;
}
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.chip-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip-picker-wrap {
    max-height: 160px;
    overflow-y: auto;
}
.chip-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s;
}
.chip-option input[type="checkbox"] {
    display: none;
}
.chip-option.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.chip-option-toggle {
    flex-basis: 100%;
    font-weight: 600;
    border-style: dashed;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-inline {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

/* Checklist */
.checklist-grid {
    display: grid;
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--surface);
    min-height: var(--tap-min);
}

.checklist-item label {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.checklist-btns {
    display: flex;
    gap: 4px;
}

.checklist-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    transition: all 0.15s;
}

.checklist-btn.yes.active { background: var(--success); color: #fff; border-color: var(--success); }
.checklist-btn.no.active { background: var(--danger); color: #fff; border-color: var(--danger); }
.checklist-btn:active { transform: scale(0.95); }

.checklist-notes {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
}

/* Scoring */
.scoring-grid {
    display: grid;
    gap: 12px;
}

.scoring-item {
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
}

.scoring-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.scoring-name { font-weight: 700; }
.scoring-weight { font-size: 0.8rem; color: var(--text-muted); }

.scoring-stars {
    display: flex;
    gap: 4px;
}

.star-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--surface);
    color: var(--text-muted);
    transition: all 0.15s;
}

.star-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.star-btn:active { transform: scale(0.95); }

.score-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    padding: 16px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    margin-top: 12px;
}

/* Evaluation Cards (unified checklist + scoring) */
.eval-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 10px;
    background: var(--surface);
}
.eval-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.eval-label { font-weight: 600; font-size: 0.95rem; }
.eval-weight { font-size: 0.75rem; color: var(--text-muted); }
.eval-stars { display: flex; gap: 4px; margin-bottom: 8px; }
.eval-star {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--surface);
    color: var(--text-muted);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.eval-star.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.eval-star:active { transform: scale(0.95); }
.eval-notes {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 6px;
    box-sizing: border-box;
}
.eval-photo-grid { margin-top: 4px; }
.eval-photo-grid .photo-upload-btn { min-height: 50px; }

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 4px;
}

.tab-btn {
    padding: 6px 14px;
    min-height: var(--tap-min);
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tab-btn:active { opacity: 0.8; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Photo grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-upload-btn {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px dashed var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 4px;
    min-height: 120px;
}

.photo-upload-btn .icon { font-size: 2rem; }
.photo-upload-btn:active { background: #f0f0f0; }

/* Photo lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 95%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: var(--tap-min);
    height: var(--tap-min);
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 64px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    border-radius: 6px;
    z-index: 2;
    transition: background 0.15s;
}
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev.hidden,
.lightbox-next.hidden { display: none; }

.lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    pointer-events: none;
}

/* Amenity checklist */
.amenity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    min-height: var(--tap-min);
    cursor: pointer;
}

.amenity-item.checked {
    background: #d4edda;
    border-color: var(--success);
}

.amenity-checkbox {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.amenity-item.checked .amenity-checkbox {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.amenity-label { font-weight: 600; font-size: 0.9rem; }

/* Activity timeline */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--border-light);
}

.timeline-item {
    position: relative;
    padding: 12px;
    margin-bottom: 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--surface);
}

@keyframes act-highlight {
    0%   { border-color: var(--accent); background: #ddeeff; }
    70%  { border-color: var(--accent); background: #ddeeff; }
    100% { border-color: var(--border-light); background: var(--surface); }
}
.activity-highlighted {
    animation: act-highlight 2.5s ease-out forwards;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 16px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.timeline-type {
    font-weight: 700;
    color: var(--primary);
}

.timeline-note { margin-top: 4px; }

.contact-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Buildings */
.bld-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--primary);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}
.bld-suggestions.active { display: block; }

.bld-suggestion-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
}
.bld-suggestion-item:last-child { border-bottom: none; }
.bld-suggestion-item:hover { background: var(--primary-light, #e8f5ee); }
.bld-suggestion-item strong { font-size: 0.95rem; }
.bld-suggestion-item span { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.bld-suggestion-item .contact-type-badge { color: #fff; font-size: 0.72rem; }

.building-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.building-card:last-child { border-bottom: none; }

.area-chip {
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}
.area-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.infrastructure-score-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.infrastructure-score-row:last-child { border-bottom: none; }

.flag-btn {
    color: var(--text-muted);
    border-color: var(--border);
    font-size: 0.8rem;
}
.flag-btn:hover { color: var(--danger); border-color: var(--danger); }

.flagged-indicator {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--danger);
    color: #fff;
}

.score-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
}

.infra-inherited {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* Item list (furniture, appliances) */
.item-list {
    display: grid;
    gap: 12px;
}

.item-card {
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.item-name { font-weight: 700; }

.item-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.85rem;
}

.item-field label {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Save flash */
.save-flash {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: #fff;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.save-flash.show { opacity: 1; }

/* Toast */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* PWA install card */
.pwa-install-card {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, #eaf4fb 0%, #fff 100%);
    margin-bottom: 16px;
}
.pwa-install-card .card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pwa-install-dismiss {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
}

/* Pipeline table */
.pipeline-card {
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Summary fields */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-field {
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.detail-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.detail-value:empty::after {
    content: '—';
    color: var(--border-light);
}

.detail-grid--fixed {
    grid-template-columns: 1fr 1fr !important;
}

.prop-rent-row {
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    margin-bottom: 12px;
}
.prop-rent-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
}

.prop-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.prop-stat {
    padding: 8px 6px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    text-align: center;
}
.prop-stat-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar select, .filter-bar input {
    min-height: 40px;
    padding: 6px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 1rem; margin-bottom: 16px; }

/* Sortable header */
th[data-sort]::after {
    content: ' \2195';
    opacity: 0.5;
}

th[data-sort].asc::after { content: ' \2191'; opacity: 1; }
th[data-sort].desc::after { content: ' \2193'; opacity: 1; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}
/* Inside modals, make typeahead suggestions flow inline (not absolute)
   so they aren't clipped by the modal's overflow-y:auto */
.modal .bld-suggestions {
    position: relative;
    top: 0;
    border-top: 1px solid var(--primary);
    border-radius: var(--radius);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ── SAM contact cards (inside modal) ─────────────── */
.sam-contact-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px; border: 1px solid var(--border); border-radius: 10px;
}
.sam-contact-avatar {
    width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
    background: var(--primary); display: flex; align-items: center;
    justify-content: center; flex-shrink: 0;
}
.sam-contact-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sam-contact-avatar .sam-initials { color: #fff; font-size: 0.9rem; font-weight: 700; }
.sam-contact-info { flex: 1; min-width: 0; }
.sam-contact-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.sam-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.sam-chip {
    display: inline-block; padding: 2px 8px; font-size: 0.72rem; font-weight: 500;
    border-radius: 10px; background: #f0f4f8; color: #4a5568;
}
.sam-chip-lang { background: #e8f4fd; color: #1a73e8; }
.sam-chip-area { background: #f0fdf4; color: #166534; }
.sam-trust { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }

/* Tip Modal — bottom sheet */
#tip-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 400;
    align-items: flex-end;
    justify-content: center;
}
#tip-modal.active { display: flex; }

#tip-modal-panel {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

#tip-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    background: linear-gradient(135deg, #eef5fa 0%, #fff 100%);
    flex-shrink: 0;
}

.coach-icon {
    font-size: 1.1rem;
    margin-right: 4px;
    vertical-align: middle;
}

#tip-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0 0 12px;
}

#tip-modal-body {
    overflow-y: auto;
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text);
}

#tip-modal-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin: 16px 0 6px;
}
#tip-modal-body h3:first-child { margin-top: 0; }

#tip-modal-body p { margin: 0 0 10px; }

#tip-modal-body ul, #tip-modal-body ol {
    margin: 0 0 10px;
    padding-left: 20px;
}
#tip-modal-body li { margin-bottom: 4px; }

#tip-modal-body .tip-warn {
    background: #fff8e1;
    border-left: 3px solid var(--accent);
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

/* Profile Modal */
#profile-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 400;
    align-items: flex-end;
    justify-content: center;
}
#profile-modal.active { display: flex; }

#profile-modal-panel {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

#profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

#profile-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0 0 12px;
}

#profile-modal-body {
    overflow-y: auto;
    padding: 0;
}

.profile-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.profile-section:last-child { border-bottom: none; }

.profile-field-static {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.profile-field-static label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 52px;
}
.profile-field-static span {
    flex: 1;
    font-size: 0.95rem;
}

.profile-section-muted { background: var(--bg); }

.profile-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.profile-coming-soon {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .amenity-grid { grid-template-columns: 1fr; }
    
    .stats-row {
        flex-wrap: nowrap; /* Prevent wrapping on mobile */
        overflow-x: auto;  /* Enable horizontal scroll */
        padding-bottom: 4px; /* Space for scrollbar */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    .stats-row::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari/Edge */
    }
    .stat-card {
        flex: 0 0 auto; /* Prevent shrinking/growing on mobile */
        min-width: 100px;
        padding: 10px;
    }
    .stat-value { font-size: 1.4rem; }
    .stat-label { font-size: 0.75rem; white-space: nowrap; }
}

/* Inline editable */
.editable {
    cursor: pointer;
    border-bottom: 1px dashed var(--border-light);
    padding: 2px 4px;
    border-radius: 2px;
}

.editable:hover { background: #f0f0f0; }

/* Loading spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Utility */
.hidden { display: none !important; }

/* Auth screen */
#auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    padding: 16px;
}

.auth-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.auth-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.auth-tabs {
    display: flex;
    border-bottom: 3px solid var(--border);
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    min-height: var(--tap-min);
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-error {
    color: var(--danger);
    font-weight: 600;
    text-align: center;
    margin-top: 12px;
    min-height: 1.5em;
}

/* Help View */
#help-content { padding-left: 6px; }
#help-content ol, #help-content ul { padding-left: 20px; }

/* Impersonation banner */
#impersonation-banner {
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

#impersonation-banner strong { font-weight: 700; }

#btn-stop-impersonating {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}

#btn-stop-impersonating:hover { background: rgba(0,0,0,0.35); }

/* Report View */
.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.report-section {
    margin-bottom: 16px;
}

.report-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.report-print-footer {
    display: none;
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #ccc;
}

/* Print styles */
@media print {
    .no-print,
    .header,
    .bottom-nav,
    #more-sheet,
    #save-flash,
    #toast,
    #tip-modal,
    .lightbox,
    .modal-overlay { display: none !important; }

    body {
        background: #fff;
        padding-bottom: 0;
        font-size: 12px;
    }

    .main { max-width: 100%; padding: 0; }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
        margin-bottom: 12px;
    }

    .card-title { font-size: 0.95rem; }

    .stat-card {
        border: 1px solid #ccc;
        box-shadow: none;
        padding: 8px;
    }

    .stat-value { font-size: 1.4rem; }

    .table-wrap { overflow: visible; }

    table { font-size: 0.8rem; width: 100%; }

    th, td { padding: 4px 6px; }

    .badge {
        border: 1px solid currentColor;
        background: transparent !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a { color: var(--text); text-decoration: none; }

    tr { break-inside: avoid; }

    .report-print-footer { display: block; }
}

/* ── Hero Metrics Bar (Business Dashboard) ── */
.hero-metrics-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.hero-metric {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px 8px;
    text-align: center;
    box-shadow: var(--shadow);
}
.hero-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.hero-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Business Cards Grid (Desktop) ── */
.biz-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}
@media (min-width: 768px) {
    .biz-grid {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 12px;
    }
    .biz-card-wide { grid-column: 1; }
    .biz-card-narrow { grid-column: 2; }
    .biz-card-full { grid-column: 1 / -1; }
    .biz-card-half { /* default: auto-placed in grid */ }
    .hero-metrics-bar {
        grid-column: 1 / -1;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    .hero-metric { padding: 18px 12px; }
    .hero-metric-value { font-size: 1.8rem; }
    .hero-metric-label { font-size: 0.75rem; }
}
@media (min-width: 1024px) {
    .biz-grid {
        grid-template-columns: 3fr 2fr;
        gap: 16px;
    }
    .hero-metric { padding: 20px 16px; }
    .hero-metric-value { font-size: 2rem; }
}

/* ── Show More / Expand Link ── */
.biz-show-more {
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
}
.biz-show-more:hover { text-decoration: underline; }

/* ── Time Filter Chips ── */
.time-filter {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 10px;
}
.time-chip {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
}
.time-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Admin Metrics Bar ── */
.admin-metrics-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.admin-metric {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.admin-metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.admin-metric-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Engagement Badges ── */
.eng-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

.eng-power   { background: #d4edda; color: #155724; }
.eng-active  { background: #cce5ff; color: #004085; }
.eng-casual  { background: #fff3cd; color: #856404; }
.eng-dormant { background: #e2e3e5; color: #495057; }

/* ── Playbooks ── */
.pb-contact-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.pb-contact-option:has(input:checked) {
    border-color: var(--primary);
    background: #f0f5fa;
}
.pb-contact-option input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}
.btn-danger {
    background: #fff;
    border-color: #dc3545;
    color: #dc3545;
}
.btn-danger:active {
    background: #dc3545;
    color: #fff;
}

/* Paused account screen */
.paused-screen {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.paused-panel {
    max-width: 380px;
    width: 100%;
    text-align: center;
}
.paused-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}
.paused-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text);
}
.paused-panel p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* Goodbye overlay */
.goodbye-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.goodbye-panel {
    max-width: 380px;
    width: 100%;
    text-align: center;
    color: #fff;
}
.goodbye-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}
.goodbye-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #fff;
}
.goodbye-panel p {
    color: rgba(255,255,255,0.85);
    margin-bottom: 28px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.goodbye-panel .btn-primary {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
}


/* ── Admin Lists Tab ──────────────────────────────────────────────────────── */
.lists-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    min-height: 44px;
}
.lists-row:last-child { border-bottom: none; }
.lists-row.dragging { opacity: 0.4; }
.lists-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1rem;
    flex-shrink: 0;
    padding: 0 4px;
    touch-action: none;
}
.lists-label {
    flex: 1;
    font-size: 0.95rem;
}
.lists-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.lists-lock {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Typeahead: two-tier suggestion headers ───────────────────────────────── */
.bld-suggestion-header {
    padding: 4px 12px 2px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    pointer-events: none;
}
.bld-suggestion-existing {
    background: var(--bg-alt);
}
.bld-suggestion-existing:hover,
.bld-suggestion-existing:active {
    background: var(--border);
}

/* ── Property Cards (Dashboard list view) ────────────────────────────────── */
/* ── Contact cards (dashboard) ──────────────────────────────────────────── */
.contact-card-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.contact-card {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
}
.contact-card-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em;
}
.contact-card-info { flex: 1; min-width: 0; }
.contact-card-name { font-weight: 600; font-size: 0.95rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.contact-card-type {
    display: inline-block; padding: 1px 6px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 600; color: #fff;
    text-transform: uppercase; letter-spacing: 0.03em;
}
.contact-card-props { font-size: 0.78rem; color: var(--text-muted); }
.contact-card-last { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.prop-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0 8px;
}

/* New unified property card */
.pcard {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border-left: 4px solid var(--border);
}
.pcard .pcard-link {
    display: flex;
    gap: 0;
    text-decoration: none;
    color: var(--text);
}
.pcard .pcard-link:active { opacity: 0.9; }
.pcard-thumb {
    width: 88px;
    min-height: 88px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.pcard-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.7);
}
.pcard-info {
    flex: 1;
    padding: 10px 14px;
    min-width: 0;
}
.pcard-row1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 2px;
}
.pcard-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pcard-score {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
}
.pcard-details {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pcard-status {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.pcard-status strong {
    color: var(--text);
}

/* Next step section — integrated footer */
.pcard-nextstep {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 14px 10px;
    border-top: 1px solid var(--border);
    background: #f4f6f8;
}
.pcard-nextstep-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-right: 2px;
}
.pcard-nextstep .next-step-bar {
    display: contents;
}
.next-step-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.next-step-bar .btn-sm,
.pcard-nextstep .btn-sm {
    padding: 5px 12px;
    font-size: 0.82rem;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
}

/* Status left-border colors */
.status-border-to-review      { border-left-color: #adb5bd; }
.status-border-shortlist       { border-left-color: #0d6efd; }
.status-border-scheduling-tour { border-left-color: #e67e22; }
.status-border-tour-scheduled  { border-left-color: #fd7e14; }
.status-border-toured          { border-left-color: #6f42c1; }
.status-border-offer           { border-left-color: #198754; }
.status-border-rejected        { border-left-color: #dc3545; }
.status-border-closed          { border-left-color: #20c997; }

/* Thumbnail placeholder backgrounds */
.status-bg-to-review      { background: #adb5bd; }
.status-bg-shortlist       { background: #0d6efd; }
.status-bg-scheduling-tour { background: #e67e22; }
.status-bg-tour-scheduled  { background: #fd7e14; }
.status-bg-toured          { background: #6f42c1; }
.status-bg-offer           { background: #198754; }
.status-bg-rejected        { background: #dc3545; }
.status-bg-closed          { background: #20c997; }

/* ── Urgency encoding ───────────────────────────────────────────────────── */
.urgency-hot  { border-left-color: #dc3545 !important; border-left-width: 5px !important; background: rgba(220,53,69,0.06) !important; }
.urgency-soon { border-left-color: #e67e22 !important; border-left-width: 5px !important; background: rgba(230,126,34,0.06) !important; }
.urgency-missing { border-left-color: #ffc107 !important; border-left-width: 5px !important; }

.nudge-missing {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; margin-top: 4px;
    background: #fff3cd; border-radius: 6px;
    font-size: 0.82rem; font-weight: 600; color: #856404;
    cursor: pointer; border: none; text-align: left; width: 100%;
}
.nudge-missing:active { opacity: 0.8; }

/* ── Focus card (lightweight pcard for triage view) ─────────────────────── */
.fcard {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
    border-left: 4px solid var(--border);
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.fcard-body { padding: 10px 14px; }
.fcard-header {
    display: flex; justify-content: space-between; align-items: center;
}
.fcard-name {
    font-size: 0.92rem; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}
.fcard-name a { color: var(--text); text-decoration: none; }
.fcard-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.fcard .pcard-nextstep {
    padding: 8px 14px 10px; border-top: 1px solid var(--border);
    background: #f4f6f8; border-radius: 0 0 10px 6px;
}

/* ── Focus section headers ──────────────────────────────────────────────── */
.focus-section-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.88rem; font-weight: 700; color: var(--text);
    margin: 16px 0 8px; padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.focus-section-header:first-child { margin-top: 4px; }
.focus-section-header .focus-count {
    background: var(--text-muted); color: #fff;
    font-size: 0.72rem; padding: 1px 7px; border-radius: 10px; font-weight: 700;
}
.focus-section-header.section-hot  { color: #dc3545; border-bottom-color: #dc3545; }
.focus-section-header.section-hot  .focus-count { background: #dc3545; }
.focus-section-header.section-warn { color: #e67e22; border-bottom-color: #e67e22; }
.focus-section-header.section-warn .focus-count { background: #e67e22; }
.focus-section-header.section-info { color: var(--primary); border-bottom-color: var(--primary); }
.focus-section-header.section-info .focus-count { background: var(--primary); }

/* ── Focus progress bar ─────────────────────────────────────────────────── */
.focus-progress {
    display: flex; gap: 4px; align-items: center;
    padding: 12px 0 4px; margin-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.focus-progress-step { flex: 1; text-align: center; }
.fp-dot {
    width: 26px; height: 26px; border-radius: 50%;
    margin: 0 auto 2px; line-height: 26px;
    font-size: 0.75rem; font-weight: 800; color: #fff;
}
.fp-dot.filled { background: var(--primary); }
.fp-dot.empty  { background: #e0e0e0; color: var(--text-muted); }
.fp-label { font-size: 0.68rem; color: var(--text-muted); }

/* ── Score context label ────────────────────────────────────────────────── */
.pcard-score-label {
    font-size: 0.65rem; font-weight: 600; color: var(--text-muted);
    display: block; text-align: right; line-height: 1; margin-top: 1px;
}

/* ── Tour Mode ──────────────────────────────────────────────────────────── */
.tour-mode-bar {
    position: sticky; top: 0; z-index: 100;
    background: var(--primary); color: #fff;
    padding: 12px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px;
    border-radius: 0 0 12px 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.tour-close {
    position: absolute; right: 8px; top: 6px;
    background: none; border: none; color: #fff; font-size: 1.5rem;
    cursor: pointer; padding: 4px 8px; min-width: 44px; min-height: 44px;
}
.tour-progress { display: flex; align-items: center; gap: 0; }
.tour-step-dot {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; color: #fff;
}
.tour-step-dot.done { background: #fff; color: var(--primary); }
.tour-step-line { width: 40px; height: 3px; background: rgba(255,255,255,0.3); }
.tour-step-line.done { background: #fff; }
.tour-step-label { font-size: 0.9rem; font-weight: 600; }
.tour-prompt {
    background: #FFF8E1; border: 1px solid #FFD54F; border-radius: 8px;
    padding: 10px 14px; margin: 8px 0; font-size: 0.9rem; color: #5D4037; text-align: center;
}
.tour-nav {
    display: flex; justify-content: space-between; padding: 12px 0; gap: 12px;
    position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--border); z-index: 50;
}
.tour-nav .btn { flex: 1; padding: 16px; font-size: 1.05rem; font-weight: 700; border-radius: 10px; min-height: 52px; }
.tour-hidden { display: none !important; }

/* Checklist photo grid — compact */
.checklist-photo-grid { margin-top: 6px; }
.checklist-photo-grid .photo-upload-btn { min-height: 60px; min-width: 60px; }

/* Amenity photo button inline */
.amenity-photo-btn { min-height: 40px !important; min-width: 40px !important; margin-left: auto; padding: 4px; }
.amenity-photo-row { margin-top: 4px; }

/* Tour complete summary */
.tour-summary { text-align: center; padding: 24px 16px; }
.tour-summary .score-big { font-size: 3rem; font-weight: 800; color: var(--primary); }
.tour-summary .tour-stats { display: flex; gap: 16px; justify-content: center; margin: 16px 0; }
.tour-summary .stat-box {
    background: var(--card-bg, #fff); border-radius: 10px; padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); flex: 1;
}
.tour-summary .stat-num { font-size: 1.5rem; font-weight: 700; }
.tour-summary .stat-label { font-size: 0.8rem; color: var(--text-muted); }
.tour-summary .tour-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.tour-summary .tour-actions .btn { padding: 16px; font-size: 1.05rem; font-weight: 700; border-radius: 10px; min-height: 52px; }

/* ── Capture progress bar ────────────────────────────────────────────── */
.capture-progress-bar {
    height: 4px; border-radius: 2px; background: var(--border, #e0e0e0); overflow: hidden;
}
.capture-progress-fill {
    height: 100%; width: 30%; border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent, #e67e22));
    animation: capture-progress-slide 1.8s ease-in-out infinite;
}
@keyframes capture-progress-slide {
    0% { transform: translateX(-100%); width: 30%; }
    50% { transform: translateX(150%); width: 40%; }
    100% { transform: translateX(400%); width: 30%; }
}

/* Legacy prop-card (used in grouped view headers, etc.) */
.prop-card {
    display: block;
    text-decoration: none;
    color: var(--text);
}

/* ── Sort chips ──────────────────────────────────────────────────────────── */
.dash-chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 0 10px;
}
.dash-chip {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}
.dash-chip-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}

/* ── Dashboard sticky header bar ────────────────────────────────────────── */
.dash-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    margin: 0 -16px;
    padding: 8px 16px 0;
    border-bottom: 1px solid var(--border);
}
.dash-sticky-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 8px;
    overflow: hidden;
    max-height: 60px;
    transition: max-height 0.2s ease, padding-bottom 0.2s ease, opacity 0.2s ease;
    opacity: 1;
}
.dash-sticky-scrolled .dash-sticky-top {
    max-height: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}
.dash-chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 0 8px;
}

/* ── Building group headers (By Building card view) ─────────────────────── */
.dash-building-group {
    margin-bottom: 20px;
}
.dash-building-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 8px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 10px;
}
.dash-building-icon {
    font-size: 1rem;
}
.dash-building-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
}
.dash-building-name:hover {
    text-decoration: underline;
}
.dash-building-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Scroll-away app header ──────────────────────────────────────────────── */
.header {
    transition: transform 0.22s ease;
}
.header.header-hidden {
    transform: translateY(-100%);
}

/* ── Negotiation Pipeline ──────────────────────────────────────────────── */
.neg-gap-viz { display:flex; align-items:center; gap:8px; padding:10px; background:var(--bg-alt); border-radius:6px; margin:8px 0; flex-wrap:wrap; }
.neg-amount { font-weight:700; font-size:0.95rem; }
.neg-gap-label { font-size:0.82rem; color:var(--text-muted); }
.neg-round { padding:6px 0; border-bottom:1px solid var(--border); }
.neg-round:last-child { border-bottom:none; }
.neg-ball-us { font-size:0.82rem; font-weight:600; padding:4px 8px; border-radius:4px; background:#eafaf1; color:#27ae60; }
.neg-ball-them { font-size:0.82rem; font-weight:600; padding:4px 8px; border-radius:4px; background:#fef9e7; color:#e67e22; }
.neg-clock-fresh { font-size:0.82rem; padding:6px 10px; border-radius:6px; background:#eafaf1; color:#27ae60; }
.neg-clock-nudge { font-size:0.82rem; padding:6px 10px; border-radius:6px; background:#fef9e7; color:#e67e22; }
.neg-clock-urgent { font-size:0.82rem; padding:6px 10px; border-radius:6px; background:#fdedec; color:#e74c3c; }
.neg-stage-tag { font-size:0.72rem; font-weight:600; padding:2px 6px; border-radius:3px; display:inline-block; text-transform:uppercase; letter-spacing:0.03em; }
.neg-stage-preparing { background:#e8f4f8; color:#2980b9; }
.neg-stage-submitted { background:#fef9e7; color:#e67e22; }
.neg-stage-countered { background:#fdedec; color:#c0392b; }
.neg-stage-accepted { background:#eafaf1; color:#27ae60; }

/* ── Inline Contact Picker (nested inside modals) ─────────────────────── */
.contact-picker { margin:8px 0; padding:10px; background:var(--bg-alt); border-radius:6px; border:1px solid var(--border); }
.contact-picker-section { margin-bottom:10px; }
.contact-picker-section:last-child { margin-bottom:0; }
.contact-picker-header { font-size:0.78rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:6px; }
.contact-picker-card { display:flex; align-items:center; justify-content:space-between; padding:8px 10px; background:#fff; border-radius:4px; border:1px solid var(--border); margin-bottom:4px; }
.contact-picker-card:last-child { margin-bottom:0; }
.contact-picker-name { font-weight:600; font-size:0.9rem; }
.contact-picker-meta { font-size:0.78rem; color:var(--text-muted); }
.contact-picker-badge { font-size:0.72rem; color:#e67e22; font-style:italic; }
.contact-picker-add { font-size:0.82rem; padding:4px 10px; border-radius:4px; background:var(--primary); color:#fff; border:none; cursor:pointer; white-space:nowrap; }
.contact-picker-divider { text-align:center; font-size:0.78rem; color:var(--text-muted); margin:10px 0; position:relative; }
.contact-picker-divider::before, .contact-picker-divider::after { content:''; position:absolute; top:50%; width:30%; height:1px; background:var(--border); }
.contact-picker-divider::before { left:0; }
.contact-picker-divider::after { right:0; }
.contact-picker-inline-form { padding:8px; background:#fff; border-radius:4px; border:1px solid var(--border); }
.contact-picker-inline-form input, .contact-picker-inline-form select { width:100%; margin-bottom:6px; }
.contact-picker-skip { font-size:0.82rem; color:var(--text-muted); background:none; border:none; cursor:pointer; text-align:center; width:100%; margin-top:6px; }

/* ── Coaching Channels (CoachModal footer) ─────────────────────────────── */
.coach-channels { margin-top:20px; padding-top:16px; border-top:2px solid #b8d4e8; }
.coach-channels-label { font-size:0.85rem; font-weight:700; color:var(--primary); margin-bottom:10px; }
.coach-channel-btn { display:flex; align-items:center; gap:8px; padding:12px 14px; margin-bottom:8px; border-radius:8px; background:linear-gradient(135deg, #eef5fa 0%, #dce9f3 100%); border:1px solid #b8d4e8; color:var(--primary); font-weight:600; font-size:0.88rem; text-decoration:none; cursor:pointer; transition:background 0.15s; }
.coach-channel-btn:hover { background:linear-gradient(135deg, #dce9f3 0%, #c5daea 100%); }
.coach-channel-icon { font-size:1.1rem; }
.coach-channel-btn.coach-locked { opacity:0.6; cursor:default; }
.coach-lock-badge { margin-left:auto; font-size:0.72rem; font-weight:600; padding:2px 6px; border-radius:3px; background:#e8e8e8; color:#888; }
.coach-channel-btn.coach-coming-soon { opacity:0.5; cursor:default; border-style:dashed; }

/* ── Tour Reschedule Button (tappable date/time in coaching bar) ─────── */
.btn-tour-reschedule {
    background: none; border: none; padding: 0; font: inherit;
    font-weight: 700; cursor: pointer;
    text-decoration: underline dotted; text-underline-offset: 3px;
}
.btn-tour-reschedule:active { opacity: 0.7; }

/* ── Tour Share Card ─────────────────────────────────────────────────── */
.tour-share-overlay {
    display:none; position:fixed; inset:0; z-index:1100;
    background:rgba(0,0,0,0.85); align-items:center; justify-content:center;
}
.tour-share-overlay.active { display:flex; }
.tour-share-panel {
    position:relative; max-width:420px; width:95%; max-height:92vh;
    background:#fff; border-radius:12px; overflow:hidden;
    display:flex; flex-direction:column;
}
.tour-share-close {
    position:absolute; top:8px; right:12px; z-index:2;
    background:rgba(0,0,0,0.5); color:#fff; border:none;
    width:36px; height:36px; border-radius:50%; font-size:1.4rem;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.tour-share-canvas-wrap {
    position:relative; flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
}
.tour-share-canvas-wrap canvas {
    width:100%; height:auto; display:block;
}
.tour-share-nav {
    position:absolute; top:20%; transform:translateY(-50%);
    background:rgba(0,0,0,0.4); color:#fff; border:none;
    width:40px; height:40px; border-radius:50%; font-size:1.2rem;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.tour-share-prev { left:8px; }
.tour-share-next { right:8px; }
.tour-share-counter {
    position:absolute; bottom:8px; left:50%; transform:translateX(-50%);
    background:rgba(0,0,0,0.5); color:#fff; padding:2px 10px;
    border-radius:10px; font-size:0.75rem;
}
.tour-share-actions {
    display:flex; gap:8px; padding:12px 16px; border-top:1px solid #eee;
}
.btn-tour-share {
    background:none; border:1px solid var(--border); border-radius:6px;
    padding:4px 10px; font-size:0.78rem; cursor:pointer;
    color:var(--primary); display:inline-flex; align-items:center; gap:4px;
}
.btn-tour-share:active { opacity:0.7; }
