/* ==========================================================================
   PPR2 Front-end Styles
   Designed to sit inside any Bootstrap theme without conflicts.
   All selectors are scoped to .ppr2-wrap.
   ========================================================================== */

.ppr2-wrap {
    font-family: inherit;
    color: inherit;
    line-height: 1.5;
}
.ppr2-error {
    color: #d32f2f;
    padding: 12px;
    border: 1px solid #f5c6cb;
    background: #fff5f5;
    border-radius: 4px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.ppr2-btn {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    line-height: 1.4;
    transition: opacity .15s;
    font-weight: 500;
}
.ppr2-btn:hover { opacity: .85; text-decoration: none; }
.ppr2-btn-primary   { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.ppr2-btn-secondary { background: #fff; color: #444; border-color: #ddd; }
.ppr2-btn-link {
    background: none;
    border: none;
    color: #c62828;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    text-decoration: underline;
}
.ppr2-btn-link:hover { color: #8d1c1c; }

/* ==========================================================================
   Day Cards — next 5 business days snapshot
   ========================================================================== */
.ppr2-day-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;   /* bottom breathing room inside .ppr2-upcoming-body */
    -webkit-overflow-scrolling: touch;
}
.ppr2-day-card {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 14px 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    text-decoration: none !important;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, background .15s;
    text-align: center;
    cursor: pointer;
}
.ppr2-day-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26,115,232,.12);
    color: inherit;
}
.ppr2-day-card-active {
    border-color: #1a73e8;
    background: #e8f0fe;
}
.ppr2-day-name {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #999;
}
.ppr2-day-card-active .ppr2-day-name { color: #1565c0; }
.ppr2-day-date {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}
.ppr2-day-card-active .ppr2-day-date { color: #1a73e8; }
.ppr2-day-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 4px;
}
.ppr2-day-count strong {
    font-size: 22px;
    font-weight: 800;
    color: #111;
    line-height: 1;
}
.ppr2-day-card-active .ppr2-day-count strong { color: #1a73e8; }
.ppr2-day-count small {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 1px;
}
.ppr2-day-count em {
    font-style: normal;
    font-size: 20px;
    font-weight: 700;
    color: #ccc;
}

/* ==========================================================================
   Upcoming Listings panel extras
   ========================================================================== */
.ppr2-upcoming-body {
    padding: 14px 16px 4px;
}
/* "× Clear date" link that appears in the panel header when a date is active */
.ppr2-upcoming-clear {
    font-size: 12px;
    color: #888;
    text-decoration: none;
    border: 1px solid #ddd;
    padding: 2px 9px;
    border-radius: 999px;
    line-height: 1.4;
    transition: color .15s, border-color .15s;
}
.ppr2-upcoming-clear:hover {
    color: #c62828;
    border-color: #c62828;
    text-decoration: none;
}

/* ==========================================================================
   Filter Panel
   ========================================================================== */
.ppr2-filters {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}
.ppr2-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}
.ppr2-filters-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #999;
}
.ppr2-hotsheet-link {
    font-size: 13px;
    font-weight: 600;
    color: #e5a000;
    text-decoration: none;
}
.ppr2-hotsheet-link:hover { color: #c47a00; text-decoration: none; }

/* Collapsible panel — header becomes a toggle button */
.ppr2-filter-collapsible .ppr2-filters-head {
    cursor: pointer;
    user-select: none;
}
.ppr2-filter-collapsible .ppr2-filters-head:hover .ppr2-filters-title {
    color: #666;
}
/* Arrow chevron rotates to indicate open/closed state */
.ppr2-filter-arrow {
    display: inline-block;
    transition: transform .2s ease;
    transform: rotate(-90deg);   /* Closed: points right */
}
.ppr2-filters-open .ppr2-filter-arrow {
    transform: rotate(0deg);     /* Open: points down */
}
/* Body is hidden when panel is closed; JS uses slideUp/slideDown for animation */
.ppr2-filter-collapsible .ppr2-filter-body {
    display: none;
}
.ppr2-filter-collapsible.ppr2-filters-open .ppr2-filter-body {
    display: block;   /* JS overrides with inline style during animation */
}

.ppr2-filter-form { padding: 14px 16px 0; }

/* Grid layout: auto-fill columns, consistent sizing */
.ppr2-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.ppr2-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ppr2-filter-field label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    margin: 0;
}
.ppr2-filter-field input[type="date"],
.ppr2-filter-field select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    color: #333;
}
.ppr2-filter-field input[type="date"]:focus,
.ppr2-filter-field select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,.1);
}

/* Action row — sits below the grid, separated by a hairline */
.ppr2-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0 14px;
    margin-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* ==========================================================================
   Results bar
   ========================================================================== */
.ppr2-results-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
    min-height: 24px;
}
.ppr2-results-bar .ppr2-count {
    font-weight: 700;
    color: #111;
    font-size: 14px;
}
.ppr2-results-sep {
    color: #ccc;
    font-size: 12px;
    margin: 0 2px;
}
/* Filter chips shown inline in the results bar */
.ppr2-results-chip {
    display: inline-block;
    padding: 1px 9px;
    background: #f0f2f5;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}
.ppr2-results-chip-mls { background: #e8f0fe; color: #1a56db; border-color: #c5d5f7; }

/* Legacy alias */
.ppr2-results-header { margin-bottom: 10px; font-size: 14px; color: #555; }

/* ==========================================================================
   Table
   ========================================================================== */
.ppr2-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
.ppr2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}
.ppr2-table th {
    background: #f0f2f5;
    padding: 9px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
    color: #555;
}
.ppr2-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.ppr2-table tbody tr:last-child td { border-bottom: none; }
.ppr2-table tbody tr:hover { background: #f5f8ff; }
.ppr2-table td a { color: #1a73e8; text-decoration: none; }
.ppr2-table td a:hover { text-decoration: underline; }
.ppr2-empty { text-align: center; color: #aaa; padding: 40px !important; font-size: 14px; }

/* Column sizing helpers */
.ppr2-col-star { width: 28px; padding: 4px 2px 4px 8px !important; }
.ppr2-col-date { white-space: nowrap; }
.ppr2-num-th   { text-align: right !important; }
.ppr2-num      { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: #333; }

/* Address link */
.ppr2-address-link { font-weight: 500; }
.ppr2-address-link:hover { text-decoration: underline; }

/* Sale-type tag */
.ppr2-type-tag {
    display: inline-block;
    padding: 2px 6px;
    background: #f0f2f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #555;
    white-space: nowrap;
}

/* Hotsheet star */
.ppr2-star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #ccc;
    padding: 0 2px;
    line-height: 1;
    transition: color .15s;
}
.ppr2-star:hover { color: #e5a000; }
.ppr2-star-on   { color: #e5a000; }
.ppr2-star-lg {
    font-size: 14px;
    padding: 6px 12px;
    border: 1px solid #e5a000;
    border-radius: 6px;
    color: #e5a000;
    background: #fffbf0;
}
.ppr2-star-lg.ppr2-star-on { background: #e5a000; color: #fff; border-color: #e5a000; }

/* Status badges */
.ppr2-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}
.ppr2-badge-open      { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.ppr2-badge-sold      { background: #ffebee; color: #c62828; border-color: #ef9a9a; }
.ppr2-badge-postponed { background: #fff8e1; color: #e65100; border-color: #ffe082; }
.ppr2-badge-cancelled { background: #f5f5f5; color: #757575; border-color: #e0e0e0; }
.ppr2-badge-default   { background: #e8eaf6; color: #3949ab; border-color: #c5cae9; }

/* MLS badges */
.ppr2-mls-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #e8eaf6;
    color: #3949ab;
    border: 1px solid #c5cae9;
}
/* Status variants */
.ppr2-mls-pending { background: #f0f0f0;  color: #555;    border-color: #ddd; }       /* unfetched */
.ppr2-mls-found   { background: #e8f5e9;  color: #2e7d32; border-color: #a5d6a7; }    /* green   */
.ppr2-mls-removed { background: #ffebee;  color: #c62828; border-color: #ef9a9a; }    /* red     */
.ppr2-mls-error   { background: #fff8e1;  color: #b45309; border-color: #fcd34d; }    /* amber   */

/* ==========================================================================
   Pagination
   ========================================================================== */
.ppr2-pagination { margin-top: 16px; text-align: center; }
.ppr2-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #444;
    text-decoration: none;
    font-size: 13px;
}
.ppr2-pagination .page-numbers.current { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.ppr2-pagination .page-numbers:hover:not(.current) { background: #f0f2f5; }

/* ==========================================================================
   Record detail
   ========================================================================== */
.ppr2-back { margin-bottom: 16px; }
.ppr2-back a { color: #1a73e8; text-decoration: none; font-size: 14px; }
.ppr2-back a:hover { text-decoration: underline; }

/* Images */
.ppr2-images { margin-bottom: 20px; }
.ppr2-images-main {
    position: relative;
    display: inline-block;
    width: 100%;
}
.ppr2-images-main img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: zoom-in;
    display: block;
    transition: opacity .15s;
}
.ppr2-images-main img:hover { opacity: .92; }
/* "Click to enlarge" hint */
.ppr2-gallery-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
.ppr2-images-main:hover .ppr2-gallery-hint { opacity: 1; }
.ppr2-images-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.ppr2-thumb {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .15s;
}
.ppr2-thumb:hover, .ppr2-thumb-active { border-color: #1a73e8; }
.ppr2-no-image {
    height: 160px;
    background: #f0f2f5;
    border: 1px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 14px;
    margin-bottom: 20px;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
#ppr2-lightbox {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
#ppr2-lightbox[hidden] { display: none; }

.ppr2-lightbox-backdrop {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,.9);
    cursor: pointer;
}
.ppr2-lightbox-stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 94vw;
}
.ppr2-lb-close {
    position: absolute;
    top: -44px;
    right: -4px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    opacity: .75;
    transition: opacity .15s;
    padding: 0;
}
.ppr2-lb-close:hover { opacity: 1; }
.ppr2-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    box-shadow: 0 4px 40px rgba(0,0,0,.6);
}
.ppr2-lightbox-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}
.ppr2-lb-btn {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    padding: 0;
}
.ppr2-lb-btn:hover:not(:disabled) { background: rgba(255,255,255,.3); }
.ppr2-lb-btn:disabled { opacity: .25; cursor: default; }
.ppr2-lightbox-counter {
    font-size: 13px;
    color: rgba(255,255,255,.65);
    min-width: 52px;
    text-align: center;
}

/* ==========================================================================
   MLS Remarks modal
   ========================================================================== */
#ppr2-remarks-modal {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#ppr2-remarks-modal[hidden] { display: none; }

.ppr2-remarks-backdrop {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,.5);
    cursor: pointer;
}
.ppr2-remarks-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 10px;
    max-width: 640px;
    width: 100%;
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
}
.ppr2-remarks-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    flex-shrink: 0;
}
.ppr2-remarks-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    padding: 0 2px;
    transition: color .15s;
}
.ppr2-remarks-close:hover { color: #111; }
.ppr2-remarks-body {
    padding: 20px 20px 24px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    white-space: pre-wrap;
    word-break: break-word;
}
/* "See MLS Remarks" button inside MLS Listing panel */
.ppr2-remarks-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 14px;
    padding: 8px 14px;
    background: #f0f6ff;
    color: #1a56db;
    border: 1px solid #c5d5f7;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.ppr2-remarks-btn:hover { background: #dce9ff; border-color: #a3bef5; }

/* Prevent body scroll when any overlay is open */
body.ppr2-no-scroll { overflow: hidden; }

/* ==========================================================================
   Property Map
   ========================================================================== */
.ppr2-map-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}
.ppr2-map-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}
.ppr2-map-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #999;
}
.ppr2-map-ext {
    font-size: 12px;
    font-weight: 600;
    color: #1a73e8;
    text-decoration: none;
}
.ppr2-map-ext:hover { text-decoration: underline; }
.ppr2-map-iframe {
    width: 100%;
    height: 340px;
    border: 0;
    display: block;
}

/* Record header */
.ppr2-record-header { margin-bottom: 20px; }
.ppr2-record-header h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.ppr2-record-subtitle {
    color: #666;
    font-size: 15px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Data panels */
.ppr2-record-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.ppr2-panel {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background: #fff;
}
.ppr2-panel h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    margin: 0 0 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.ppr2-dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
}
.ppr2-dl dt { font-size: 12px; font-weight: 600; color: #666; white-space: nowrap; }
.ppr2-dl dd { font-size: 13px; color: #111; margin: 0; word-break: break-word; }

/* Taxes panel */
.ppr2-tax-links {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ppr2-tax-links li a {
    font-size: 13px;
    color: #1a6fbf;
    text-decoration: none;
}
.ppr2-tax-links li a:hover { text-decoration: underline; }
.ppr2-tax-no-links { font-size: 13px; color: #999; margin: 0; }

/* ==========================================================================
   Hotsheet page
   ========================================================================== */
.ppr2-hotsheet-header { display: flex; align-items: baseline; gap: 24px; margin-bottom: 16px; }
.ppr2-hotsheet-header h2 { margin: 0; }
.ppr2-hotsheet-header a { font-size: 14px; color: #1a73e8; }

.ppr2-export-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #1a73e8 !important;
    border: 1px solid #1a73e8;
    border-radius: 4px;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.4;
}
.ppr2-export-btn:hover { background: #e8f0fe; }

/* ==========================================================================
   User sections (Notes, Calcs)
   ========================================================================== */
.ppr2-user-section {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.ppr2-user-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

/* Notes */
.ppr2-notes-list { margin-bottom: 16px; }
.ppr2-note {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.ppr2-note p { margin: 0 0 8px; font-size: 14px; }
.ppr2-note-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
}
.ppr2-add-note-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 8px;
    box-sizing: border-box;
}

/* ==========================================================================
   Calculations — saved cards
   ========================================================================== */
.ppr2-calcs-list { margin-bottom: 16px; }
.ppr2-calc {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.ppr2-calc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.ppr2-calc-date { font-size: 12px; color: #888; flex: 1; }
.ppr2-calc-body {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: #444;
}
.ppr2-calc-body span { white-space: nowrap; }

/* ==========================================================================
   Calculations — form
   ========================================================================== */

/* Scenario label row at top of form */
.ppr2-calc-label-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.ppr2-calc-label-row label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}
.ppr2-calc-label-row input[type="text"] {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Section blocks */
.ppr2-calc-section {
    background: #f7f7f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.ppr2-calc-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #999;
    margin-bottom: 10px;
}

/* Input grid inside a section */
.ppr2-calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
.ppr2-calc-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 3px;
}
.ppr2-calc-field input[type="number"],
.ppr2-calc-field input[type="text"],
.ppr2-calc-field input[type="date"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    background: #fff;
}
.ppr2-calc-field input:disabled {
    background: #f0f0f0;
    color: #777;
    cursor: default;
}

/* Twin fields: % + $ side by side (F4 Closing Credit, F5 Tax Proration) */
.ppr2-calc-field-twin { grid-column: span 2; }
.ppr2-calc-twin-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.ppr2-calc-twin-col { display: flex; flex-direction: column; }
.ppr2-calc-twin-lbl {
    font-size: 10px;
    color: #999;
    margin-bottom: 3px;
}
/* Auto-filled $ input: subtle tint to signal it's calculated */
.ppr2-calc-field input[readonly] {
    background: #f0f4ff;
    color: #444;
    cursor: default;
}

/* Read-only display fields (days) */
.ppr2-calc-field-readonly {
    display: flex;
    flex-direction: column;
}
.ppr2-calc-field-readonly .ppr2-calc-result-val {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding-top: 2px;
}

/* Inline result row (Book Value inside Acquisition section) */
.ppr2-calc-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
}
.ppr2-calc-result-label { color: #555; }
.ppr2-calc-result-label small { font-size: 11px; color: #aaa; }
.ppr2-calc-result-val { font-weight: 700; color: #222; }

/* Results section — blue-tinted background */
.ppr2-calc-results-section {
    background: #f0f4ff;
    border-color: #c8d5f0;
}
.ppr2-calc-results-section .ppr2-calc-section-title { color: #7a94cc; }
.ppr2-calc-results-section .ppr2-calc-result-row { border-top-color: #d5e0f5; }

/* Net Profit row emphasis */
.ppr2-calc-result-row-major {
    border-top: 2px solid #bbc9e8;
    margin-top: 4px;
    padding-top: 8px;
}
.ppr2-calc-result-row-major .ppr2-calc-result-label strong { font-size: 14px; }
.ppr2-calc-net-profit { font-size: 17px !important; }

/* Return metrics — 3-up grid */
.ppr2-calc-returns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #c8d5f0;
}
.ppr2-calc-return-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1px solid #dde5f5;
    border-radius: 6px;
    padding: 10px 6px 8px;
}
.ppr2-calc-return-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #8899bb;
    margin-bottom: 4px;
}
.ppr2-calc-return-val {
    font-size: 20px;
    font-weight: 700;
    color: #1a73e8;
    line-height: 1.1;
}
.ppr2-calc-return-annual {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* ==========================================================================
   Calculations — header row (title + New button)
   ========================================================================== */
.ppr2-calcs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.ppr2-calcs-header h3 { margin: 0; }
.ppr2-btn-sm { padding: 5px 12px; font-size: 13px; }
.ppr2-calcs-empty {
    color: #888;
    font-size: 13px;
    margin: 0 0 4px;
}

/* Clickable saved calc card */
.ppr2-calc-clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ppr2-calc-clickable:hover { border-color: #1a73e8; box-shadow: 0 2px 8px rgba(26,115,232,.12); }
.ppr2-calc-edit-hint {
    font-size: 11px;
    color: #bbb;
    text-align: right;
    margin-top: 6px;
}

/* ==========================================================================
   Calculation modal
   ========================================================================== */
#ppr2-calc-modal {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}
#ppr2-calc-modal[hidden] { display: none; }

.ppr2-calc-modal-backdrop {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, .55);
}
.ppr2-calc-modal-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 10px;
    width: min(800px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .24);
    overflow: hidden;
}

/* Modal header */
.ppr2-calc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}
.ppr2-calc-modal-title { font-size: 15px; font-weight: 700; color: #111; }
.ppr2-calc-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
    transition: color .15s;
}
.ppr2-calc-modal-close:hover { color: #222; }

/* Financial info strip */
.ppr2-calc-modal-fin {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    padding: 10px 20px;
    background: #f0f4ff;
    border-bottom: 1px solid #d6e0f7;
    flex-shrink: 0;
}
.ppr2-calc-fin-item {
    display: flex;
    flex-direction: column;
}
.ppr2-calc-fin-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8899bb;
    margin-bottom: 1px;
}
.ppr2-calc-fin-item strong {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Modal scrollable body */
.ppr2-calc-modal-body {
    padding: 18px 20px 22px;
    overflow-y: auto;
    flex: 1;
}
.ppr2-calc-save-btn { margin-top: 6px; width: 100%; }

/* ==========================================================================
   Scouter photos — upload bar + deletable thumb wrapper
   ========================================================================== */
/* Upload thumbnail — sits last in the thumbstrip, same size as .ppr2-thumb */
.ppr2-upload-thumb {
    width: 72px;
    height: 54px;
    border-radius: 4px;
    border: 2px dashed #ccc;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 300;
    color: #bbb;
    background: #f8f9fa;
    flex-shrink: 0;
    transition: border-color .15s, color .15s, background .15s;
    user-select: none;
    line-height: 1;
}
.ppr2-upload-thumb:hover {
    border-color: #1a73e8;
    color: #1a73e8;
    background: #f0f6ff;
}
.ppr2-upload-status-line {
    margin: 4px 0 0;
    min-height: 1.2em;
}
#ppr2-upload-status {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Scouter thumb wrapper — positions the × delete button over the image */
.ppr2-thumb-wrap {
    position: relative;
    display: inline-block;
    line-height: 0; /* collapse whitespace gap under inline img */
}
.ppr2-scouter-delete {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
}
.ppr2-thumb-wrap:hover .ppr2-scouter-delete { display: flex; }
/* Touch devices have no hover — always show the delete button */
@media (hover: none) {
    .ppr2-scouter-delete { display: flex; }
}

/* Color helpers */
.ppr2-green { color: #2e7d32; }
.ppr2-red   { color: #c62828; }

/* ==========================================================================
   Bid input — listing table
   ========================================================================== */
.ppr2-bid-th  { min-width: 110px; white-space: nowrap; }
.ppr2-bid-cell { white-space: nowrap; }

.ppr2-bid-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
}
.ppr2-bid-dollar {
    font-size: 13px;
    color: #666;
    line-height: 1;
    flex-shrink: 0;
}
.ppr2-bid-wrap.ppr2-bid-text .ppr2-bid-dollar { display: none; }
.ppr2-bid-wrap.ppr2-bid-text .ppr2-bid-input { text-align: left; width: 110px; }

.ppr2-bid-input {
    width: 90px;
    padding: 3px 6px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.ppr2-bid-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,.15);
}

/* Financial panel hr */
.ppr2-fin-hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

/* Bid input inside the financial detail panel */
.ppr2-fin-bid-wrap { display: inline-flex; }
.ppr2-fin-bid-input { width: 120px; font-size: 14px; padding: 4px 8px; }
.ppr2-fin-bid-dt { align-self: center; }

/* ==========================================================================
   Calc modal: Print button
   ========================================================================== */
.ppr2-calc-print-btn {
    margin-left: auto;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    line-height: 1.4;
}
.ppr2-calc-print-btn:hover { background: #e8e8e8; }

.ppr2-calc-print-card-btn {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #333;
    line-height: 1.4;
    white-space: nowrap;
}
.ppr2-calc-print-card-btn:hover { background: #e8e8e8; }

/* ==========================================================================
   Print view (hidden on screen; shown via @media print)
   ========================================================================== */
#ppr2-print-view { display: none; }

.ppr2-pv-head {
    display: flex;
    justify-content: space-between;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    font-weight: bold;
    margin-bottom: 14pt;
}
.ppr2-pv-property-block {
    border: 1px solid #555;
    padding: 8pt 12pt;
    margin-bottom: 12pt;
    border-radius: 3pt;
    font-family: Arial, Helvetica, sans-serif;
}
.ppr2-pv-prop-address {
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 5pt;
}
.ppr2-pv-prop-line {
    font-size: 9pt;
    margin-bottom: 3pt;
    color: #222;
}
.ppr2-pv-scenario-label {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11pt;
    font-style: italic;
    margin-bottom: 8pt;
    color: #555;
}
.ppr2-pv-table {
    width: 75%;
    border-collapse: collapse;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
}
.ppr2-pv-lbl {
    text-align: right;
    padding: 1.5pt 8pt 1.5pt 0;
    color: #444;
    width: 32%;
    vertical-align: middle;
}
.ppr2-pv-val {
    text-align: left;
    padding: 1.5pt 24pt 1.5pt 0;
    font-weight: bold;
    width: 20%;
    vertical-align: middle;
}
.ppr2-pv-spacer td { height: 8pt; }
.ppr2-pv-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 18pt;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9pt;
    font-weight: bold;
    border-top: 1px solid #ccc;
    padding-top: 6pt;
}

/* ==========================================================================
   Upcoming Carousels — [pr2_upcoming_carousel] and [pr2_upcoming_sidebar]
   ========================================================================== */

/* Shared wrapper */
.ppr2-uc-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.ppr2-uc-track-wrap { overflow: hidden; }
.ppr2-uc-track {
    display: flex;
    transition: transform .35s ease;
    will-change: transform;
}

/* Card */
.ppr2-uc-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.ppr2-uc-img {
    width: 100%;
    padding-top: 68%;   /* aspect ratio ~3:2 */
    background-size: cover;
    background-position: center;
    background-color: #eee;
}
.ppr2-uc-img-none { background-color: #ddd; }
.ppr2-uc-body {
    padding: 12px 14px 8px;
    flex: 1;
}
.ppr2-uc-address {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    line-height: 1.35;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.ppr2-uc-bid {
    font-size: 13px;
    color: #444;
}
.ppr2-uc-bid span { color: #666; }
.ppr2-uc-btn {
    display: block;
    text-align: center;
    background: #5a7c2e;
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none !important;
    padding: 10px 0;
    margin: 0;
}
.ppr2-uc-btn:hover { background: #4a6626; }

/* Prev / Next arrows */
.ppr2-uc-prev,
.ppr2-uc-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255,255,255,.92);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #333;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    transition: background .15s;
}
.ppr2-uc-prev:hover,
.ppr2-uc-next:hover { background: #fff; }
.ppr2-uc-prev { left: 4px; }
.ppr2-uc-next { right: 4px; }
.ppr2-uc-prev:disabled,
.ppr2-uc-next:disabled { opacity: .35; cursor: default; }

/* 4-wide carousel — card width + margin-right set by JS */
.ppr2-uc-wide .ppr2-uc-track-wrap { margin: 0 44px; }

/* Sidebar carousel — card width set by JS, no gap */
.ppr2-uc-sidebar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 0 4px;
}
.ppr2-uc-sidebar .ppr2-uc-prev,
.ppr2-uc-sidebar .ppr2-uc-next {
    position: static;
    transform: none;
}
.ppr2-uc-dots {
    display: flex;
    gap: 5px;
}
.ppr2-uc-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background .2s;
}
.ppr2-uc-dot.active { background: #5a7c2e; }

/* Card column count is responsive via JS visibleCount() — no CSS overrides needed */

/* ==========================================================================
   @media print — JS moves #ppr2-print-view to body root and hides siblings
   ========================================================================== */
@media print {
    /* Remove browser timestamp/URL header+footer (they live in @page margin) */
    @page { size: auto; margin: 0mm; }

    #ppr2-print-view {
        display: block !important;
        padding: 0.45in 0.55in;
        background: #fff !important;
        box-sizing: border-box;
        width: 100%;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .ppr2-day-cards        { gap: 6px; }
    .ppr2-day-card         { min-width: 80px; padding: 10px 6px 8px; }
    .ppr2-day-count strong { font-size: 18px; }
    .ppr2-filter-row       { grid-template-columns: 1fr 1fr; }
    .ppr2-record-panels    { grid-template-columns: 1fr; }
    .ppr2-calc-grid        { grid-template-columns: 1fr 1fr; }
    .ppr2-calc-returns-grid { grid-template-columns: 1fr; }
    .ppr2-hotsheet-header  { flex-direction: column; gap: 8px; }
}
@media (max-width: 480px) {
    .ppr2-filter-row    { grid-template-columns: 1fr; }
    .ppr2-calc-grid     { grid-template-columns: 1fr; }
    .ppr2-calc-label-row { flex-direction: column; align-items: flex-start; }
    .ppr2-calc-label-row input[type="text"] { width: 100%; }
}
