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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 16px 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* User Header */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    margin-bottom: 15px;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.logout-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

.add-property-btn {
    background: #4CAF50;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.2s, background 0.2s;
}

.add-property-btn:hover {
    background: #388E3C;
    transform: scale(1.1);
}

.add-property-btn.upload-btn {
    background: #2196F3;
}

.add-property-btn.upload-btn:hover {
    background: #1976D2;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
    color: white;
    flex: 1;
    padding: 10px 5px;
    border-radius: 8px;
    transition: all 0.2s;
}

.stat-btn {
    text-decoration: none;
    cursor: pointer;
}

.stat-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.05);
}

.stat-btn.liked:hover {
    background: rgba(76, 175, 80, 0.3);
}

.stat-btn.passed:hover {
    background: rgba(244, 67, 54, 0.3);
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 12px;
    opacity: 0.7;
}

/* Card Stack */
.card-stack {
    flex: 1;
    position: relative;
    perspective: 1000px;
    min-height: 400px;
}

/* Card peek - show next card behind */
.property-card.peek-card {
    transform: scale(0.92) translateY(15px);
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
    filter: blur(1px);
}

.property-card.active-card {
    z-index: 10;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
}

.property-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    transition: transform 0.1s ease-out;
    display: flex;
    flex-direction: column;
}

.property-card:active {
    cursor: grabbing;
}

/* Card swipe states */
.property-card.swiping-right {
    border: 4px solid #4CAF50;
}

.property-card.swiping-left {
    border: 4px solid #f44336;
}

.property-card.swipe-out-right {
    animation: swipeOutRight 0.4s ease-out forwards;
}

.property-card.swipe-out-left {
    animation: swipeOutLeft 0.4s ease-out forwards;
}

@keyframes swipeOutRight {
    to {
        transform: translateX(150%) rotate(30deg);
        opacity: 0;
    }
}

@keyframes swipeOutLeft {
    to {
        transform: translateX(-150%) rotate(-30deg);
        opacity: 0;
    }
}

/* Swipe indicators */
.swipe-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg) scale(0.5);
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 4px;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 10;
    text-transform: uppercase;
    border: 6px solid;
    pointer-events: none;
}

.swipe-indicator.like {
    background: rgba(76, 175, 80, 0.95);
    color: white;
    border-color: #2e7d32;
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.6);
    transform: translate(-50%, -50%) rotate(-20deg) scale(0.5);
}

.swipe-indicator.dislike {
    background: rgba(244, 67, 54, 0.95);
    color: white;
    border-color: #c62828;
    box-shadow: 0 8px 30px rgba(244, 67, 54, 0.6);
    transform: translate(-50%, -50%) rotate(20deg) scale(0.5);
}

.property-card.swiping-right .swipe-indicator.like {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-20deg) scale(1);
}

.property-card.swiping-left .swipe-indicator.dislike {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(20deg) scale(1);
}

/* Final stamp animation on swipe out */
.property-card.swipe-out-right .swipe-indicator.like,
.property-card.swipe-out-left .swipe-indicator.dislike {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1.2);
    animation: stampPulse 0.3s ease-out;
}

@keyframes stampPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1.2); }
}

/* Card Content */
.card-header {
    background: linear-gradient(135deg, #1a5490 0%, #2c5aa0 100%);
    color: white;
    padding: 20px;
    flex-shrink: 0;
}

.card-header h2 {
    font-size: 18px;
    margin-bottom: 5px;
}

.card-header .address {
    font-size: 14px;
    opacity: 0.9;
}

.card-header .apn {
    font-size: 13px;
    opacity: 0.75;
    font-family: monospace;
}

.batch-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 10px;
    background: rgba(255,255,255,0.2);
}

.batch-badge.nod {
    background: #FF9800;
}

.batch-badge.nts {
    background: #f44336;
}

.batch-badge.reo {
    background: #9C27B0;
}

/* Property type colors */
.batch-badge.type-residential {
    background: #4CAF50;
}

.batch-badge.type-multifamily {
    background: #2196F3;
}

.batch-badge.type-condo {
    background: #00BCD4;
}

.batch-badge.type-commercial {
    background: #FF9800;
}

.batch-badge.type-industrial {
    background: #607D8B;
}

.batch-badge.type-land {
    background: #8BC34A;
}

.batch-badge.type-agriculture {
    background: #795548;
}

/* Import source badge */
.import-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
    margin-top: 10px;
    background: rgba(255,255,255,0.2);
    color: white;
}

.import-badge.import-email {
    background: #2196F3;
}

.import-badge.import-spreadsheet {
    background: #4CAF50;
}

.import-badge.import-csv {
    background: #FF9800;
}

.import-badge.import-manual {
    background: #9C27B0;
}

.import-badge.import-unknown {
    background: #757575;
}

.titlepro-note {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    padding: 5px 10px;
    margin-top: 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #e65100;
    font-weight: 500;
}

.card-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

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

.property-item {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
}

.property-item label {
    display: block;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.property-item .value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.property-item.full-width {
    grid-column: span 2;
}

.maps-link {
    display: block;
    margin-top: 15px;
    padding: 12px;
    background: #4285f4;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
}

.maps-link:hover {
    background: #3367d6;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
    transform: scale(1.1);
}

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

.dislike-btn {
    background: #f44336;
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.like-btn {
    background: #4CAF50;
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.notes-btn {
    background: #2196F3;
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.visible {
    display: flex;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.modal-content textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
}

.modal-content textarea:focus {
    outline: none;
    border-color: #2196F3;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.cancel-btn {
    background: #e0e0e0;
    color: #333;
}

.save-btn {
    background: #4CAF50;
    color: white;
}

/* End Screen */
.end-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.end-screen h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.view-liked-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 15px 30px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
}

/* End Screen Buttons */
.end-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.end-btn {
    display: inline-block;
    padding: 15px 30px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.end-btn:hover {
    transform: scale(1.05);
}

.end-btn.liked-btn {
    background: #4CAF50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.end-btn.passed-btn {
    background: #f44336;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.hidden {
    display: none !important;
}

/* Liked Page Styles */
.liked-page {
    height: auto;
    min-height: 100vh;
}

.liked-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    margin-bottom: 15px;
    color: white;
}

.liked-header .back-btn {
    margin-right: 5px;
}

.liked-header .region-indicator {
    font-size: 12px;
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Export buttons row */
.header-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.header-actions .export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.header-actions .export-btn:hover {
    background: #388E3C;
    transform: translateY(-1px);
}

.header-actions .export-btn svg {
    flex-shrink: 0;
}

.back-btn {
    color: white;
    text-decoration: none;
    font-size: 18px;
}

.liked-header h1 {
    font-size: 18px;
    margin: 0;
    white-space: nowrap;
}

.liked-header .count {
    background: #4CAF50;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 14px;
    margin-left: auto;
}

.liked-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 20px;
}

.liked-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

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

.liked-card-header h3 {
    font-size: 16px;
    color: #333;
}

.liked-card .address {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.liked-card .apn {
    color: #888;
    font-size: 13px;
    font-family: monospace;
    margin-bottom: 12px;
}

.liked-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.liked-details .detail {
    text-align: center;
    padding: 8px 4px;
}

.liked-details .label {
    display: block;
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.liked-details .value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

.liked-card .notes {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
}

.liked-actions {
    display: flex;
    gap: 10px;
}

.map-link {
    flex: 1;
    padding: 10px;
    background: #4285f4;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
}

.remove-btn {
    padding: 10px 15px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.empty-state, .error {
    text-align: center;
    color: white;
    padding: 40px;
    font-size: 16px;
}

.empty-state a {
    color: #4CAF50;
}

/* AI Summary */
.ai-summary {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border-left: 4px solid #2c5aa0;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.ai-summary h3 {
    color: #1a5490;
    font-size: 13px;
    margin: 0 0 8px 0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-summary p {
    margin: 0;
    color: #333;
    font-size: 13px;
    line-height: 1.5;
}

/* Links Row */
.links-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.links-row .map-link {
    flex: 1;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    color: white;
}

.links-row .map-link.maps {
    background: #4285f4;
}

.links-row .map-link.maps:hover {
    background: #3367d6;
}

.links-row .map-link.earth {
    background: #34a853;
}

.links-row .map-link.earth:hover {
    background: #2d9249;
}

.links-row .map-link.recording {
    background: #ff9800;
}

.links-row .map-link.recording:hover:not(:disabled) {
    background: #f57c00;
}

.links-row .map-link.radar {
    background: #7b2cbf;
}

.links-row .map-link.radar:hover {
    background: #6a1fa3;
}

.links-row .map-link.disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    opacity: 0.7;
    border: none;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: white;
    border-radius: 8px;
    flex: 1;
}

.links-row .map-link.disabled:hover {
    background: #bdbdbd;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Passed Page Header */
.liked-header .count.passed {
    background: #f44336;
}

/* Navigation tabs */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-tab {
    flex: 1;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
}

.nav-tab:hover {
    background: rgba(255,255,255,0.2);
}

.nav-tab.active {
    background: #4CAF50;
}

/* Region Button */
.region-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 10px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.region-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* Region Modal */
.region-modal-content {
    max-width: 350px;
}

.region-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.region-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.region-option {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.region-option:hover {
    background: #e8f4fd;
    border-color: #2c5aa0;
}

.region-option.selected {
    background: #e8f4fd;
    border-color: #2c5aa0;
}

.region-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.region-stats {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* Region indicator in headers */
.region-indicator {
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-left: auto;
    margin-right: 10px;
}


/* ── Property table ──────────────────────────────────────── */
.prop-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}
.prop-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #e0e0e0;
}
.prop-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}
.prop-table th {
    background: #1a1a2e;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.th-sortable {
    cursor: pointer;
    user-select: none;
}
.th-sortable:hover { color: #e0e0e0; background: #22223a; }
.th-sort-icon { color: #4a9eff; font-style: normal; }

/* Column widths */
.col-expand   { width: 28px; padding: 0 4px !important; }
.col-address  { min-width: 160px; }
.col-city     { min-width: 100px; }
.col-type     { min-width: 120px; }
.col-assessed { min-width: 100px; }
.col-default  { min-width: 100px; }
.col-lender   { min-width: 140px; }
.col-trustee  { min-width: 130px; }
.col-date     { min-width: 90px; white-space: nowrap; }
.col-actions  { width: 80px; text-align: center; }

/* Data rows */
.prop-row {
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}
.prop-row:hover { background: rgba(255,255,255,0.05); }
.prop-row.expanded { background: rgba(74,158,255,0.08); }
.prop-row td {
    padding: 9px 12px;
    vertical-align: middle;
}
.prop-row-address { font-weight: 600; color: #f0f0f0; }

/* Expand chevron */
.row-chevron {
    font-size: 9px;
    color: rgba(255,255,255,0.35);
    display: inline-block;
    transition: transform 0.2s;
}
.prop-row.expanded .row-chevron { transform: rotate(90deg); color: #4a9eff; }

/* Row action buttons */
.tbl-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.07);
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.tbl-btn:hover { transform: scale(1.15); }
.tbl-pass:hover { background: rgba(231,76,60,0.3); border-color: #e74c3c; color: #e74c3c; }
.tbl-like:hover { background: rgba(39,174,96,0.3); border-color: #27ae60; color: #27ae60; }

/* Detail expanded row */
.prop-detail-row td {
    padding: 0;
    background: rgba(0,0,0,0.25);
    border-bottom: 2px solid rgba(74,158,255,0.2);
}
.prop-detail-inner {
    padding: 0;
}
.prop-detail-layout {
    display: flex;
    gap: 0;
}
.prop-detail-map {
    width: 340px;
    flex-shrink: 0;
    min-height: 260px;
}
.prop-detail-map .catalog-map-iframe {
    width: 100%;
    height: 100%;
    min-height: 260px;
    display: block;
    border: none;
}
.prop-detail-body {
    flex: 1;
    padding: 16px 20px;
    overflow: hidden;
}

/* Row exit animations */
@keyframes rowExitLike {
    to { opacity: 0; background: rgba(39,174,96,0.3); transform: translateX(40px); }
}
@keyframes rowExitPass {
    to { opacity: 0; background: rgba(231,76,60,0.15); transform: translateX(-40px); }
}
.row-exit-like { animation: rowExitLike 0.35s ease forwards; }
.row-exit-pass { animation: rowExitPass 0.35s ease forwards; }

/* ── Property research section ───────────────────────────── */
.research-section {
    padding: 10px 18px 4px;
}
.research-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    color: #c0c0e0;
    font-size: 13px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.research-btn:hover { background: rgba(74,158,255,0.15); border-color: #4a9eff; color: #e0e8ff; }
.research-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.research-result {
    background: rgba(74,158,255,0.07);
    border: 1px solid rgba(74,158,255,0.2);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
}
.research-result-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4a9eff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.research-cached {
    font-size: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1px 7px;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.research-summary {
    color: #d0d0e8;
    line-height: 1.55;
    margin: 0 0 10px 0;
}
.research-sources {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}
.research-source-link {
    color: #4a9eff;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.research-source-link:hover { text-decoration: underline; }
.research-refresh-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    padding: 3px 10px;
    cursor: pointer;
}
.research-refresh-btn:hover { color: #e0e0e0; border-color: rgba(255,255,255,0.3); }
.research-error {
    color: #e74c3c;
    font-size: 13px;
    padding: 6px 0;
}

/* ── Sort chips bar ──────────────────────────────────────── */
.sort-chips-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(74,158,255,0.08);
    border: 1px solid rgba(74,158,255,0.2);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}
.sort-chips-label {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right: 2px;
}
.sort-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 3px 8px;
}
.sort-chip-then { color: rgba(255,255,255,0.35); font-size: 11px; }
.sort-chip-label { color: #e0e0e0; font-weight: 600; }
.sort-chip-dir { color: #4a9eff; font-weight: 700; }
.sort-chip-remove {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    padding: 0 0 0 2px;
    line-height: 1;
}
.sort-chip-remove:hover { color: #e74c3c; }
.sort-chips-clear {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    padding: 3px 10px;
    cursor: pointer;
    margin-left: 4px;
}
.sort-chips-clear:hover { color: #e0e0e0; border-color: rgba(255,255,255,0.3); }

/* ── Search bar ──────────────────────────────────────────── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.search-field-select {
    background: #0f0f1a;
    color: #e0e0e0;
    border: 1px solid #2a2a3e;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
}
.search-input {
    flex: 1;
    background: #0f0f1a;
    color: #e0e0e0;
    border: 1px solid #2a2a3e;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    outline: none;
    min-width: 0;
}
.search-input:focus { border-color: #4a9eff; }
.search-input::placeholder { color: rgba(255,255,255,0.3); }
.search-clear-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    display: none;
}
.search-clear-btn.visible { display: block; }
.search-clear-btn:hover { color: #e74c3c; }
.search-count {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   CATALOG CARD — shared across remaining, liked, and passed
   ═══════════════════════════════════════════════════════════ */

.catalog-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 40px;
}
.catalog-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 16px;
}

/* Card shell */
.catalog-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.catalog-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.3); }

/* Header */
.catalog-card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.catalog-card-address {
    font-size: 17px;
    font-weight: 700;
    color: #f0f0f0;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
}
.catalog-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.apn-label {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
}
.catalog-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Satellite map iframe */
.catalog-map-container {
    width: 100%;
    height: 260px;
    background: #0d1117;
    overflow: hidden;
}
.catalog-map-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Body */
.catalog-card-body { padding: 14px 18px; }

/* Links row */
.catalog-card-links {
    padding: 0 18px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Recording Document Section */
.recording-doc-section {
    margin: 0 18px 14px;
    padding: 14px 16px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 10px;
}
.rec-doc-date {
    font-size: 13px;
    font-weight: 600;
    color: #86efac;
    margin-bottom: 8px;
}
.rec-doc-header {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4ade80;
    margin-bottom: 10px;
}
.rec-doc-link {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 14px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 6px;
    color: #86efac;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s;
}
.rec-doc-link:hover { background: rgba(34, 197, 94, 0.25); }
.rec-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 14px;
}
.rec-doc-item label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4ade80;
    margin-bottom: 2px;
}
.rec-doc-item .value {
    font-size: 13px;
    color: #d1fae5;
    word-break: break-word;
}

/* Doc type badge (shown in row and card header) */
.doc-type-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #4ade80;
    vertical-align: middle;
}

/* Notes */
.catalog-card-notes { padding: 0 18px 12px; }
.card-notes-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
    padding: 10px 12px;
    resize: vertical;
    min-height: 60px;
    outline: none;
    font-family: inherit;
}
.card-notes-input:focus { border-color: rgba(255,255,255,0.25); }
.card-notes-input::placeholder { color: rgba(255,255,255,0.25); }

/* Action buttons row */
.catalog-card-actions {
    display: flex;
    gap: 10px;
    padding: 12px 18px 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.card-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.1s;
}
.card-btn:active { transform: scale(0.97); }
.card-btn.pass-btn {
    background: rgba(231,76,60,0.15);
    color: #e74c3c;
    border: 1.5px solid rgba(231,76,60,0.3);
}
.card-btn.pass-btn:hover { background: rgba(231,76,60,0.25); }
.card-btn.like-btn {
    background: rgba(39,174,96,0.15);
    color: #27ae60;
    border: 1.5px solid rgba(39,174,96,0.3);
}
.card-btn.like-btn:hover { background: rgba(39,174,96,0.25); }
.card-btn.save-btn {
    background: rgba(33,150,243,0.15);
    color: #2196F3;
    border: 1.5px solid rgba(33,150,243,0.3);
}
.card-btn.save-btn:hover { background: rgba(33,150,243,0.25); }

/* Exit animations (remaining page only) */
@keyframes exitLike { to { transform: translateX(120%) rotate(15deg); opacity: 0; } }
@keyframes exitPass { to { transform: translateX(-120%) rotate(-15deg); opacity: 0; } }
.card-exit-like { animation: exitLike 0.35s ease forwards; }
.card-exit-pass { animation: exitPass 0.35s ease forwards; }

/* Infinite scroll spinner */
.catalog-spinner { display: flex; justify-content: center; gap: 8px; padding: 24px; }
.spinner-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,0.4);
    animation: dotPulse 1.2s ease-in-out infinite;
}
.spinner-dot:nth-child(2) { animation-delay: 0.2s; }
.spinner-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
    0%,80%,100% { transform: scale(0.7); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Empty state */
.catalog-empty { text-align: center; padding: 60px 20px; color: rgba(255,255,255,0.6); }
.catalog-empty h2 { font-size: 22px; margin: 12px 0 8px; color: #f0f0f0; }

/* NTS — Notice of Trustee Sale */
.nts-row {
    background: rgba(220, 38, 38, 0.12) !important;
    border-left: 3px solid #ef4444;
}
.nts-row:hover {
    background: rgba(220, 38, 38, 0.2) !important;
}
.nts-row.expanded {
    background: rgba(220, 38, 38, 0.18) !important;
}
.nts-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}
.nts-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.nts-cal-btn {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.5);
    color: #93c5fd;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.nts-cal-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.28);
}
.nts-cal-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.nts-badge-sm {
    display: inline-block;
    background: rgba(220, 38, 38, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}
