/* ============================================
   RentFair v2 — Nordic Precision
   ============================================ */

:root {
    --ink: #0a0a0a;
    --muted: #767676;
    --accent: #1e5a3d;
    --accent-light: #f0f6f1;
    --soft: #f7f7f7;
    --line: #ececec;
    --danger: #b85e3e;
    --gold: #d4a574;
    --bg: #fcfcfb;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--soft);
    -webkit-font-smoothing: antialiased;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.fraunces { font-family: 'Fraunces', Georgia, serif; }

/* ========================================
   PHONE FRAME
   ======================================== */
.phone-frame {
    position: relative;
    width: 390px;
    height: 844px;
    border: 12px solid #1a1a1a;
    border-radius: 42px;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    background: #1a1a1a;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 24px;
    background: #1a1a1a;
    border-radius: 0 0 14px 14px;
    z-index: 200;
}

.phone-viewport {
    width: 100%;
    height: 100%;
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    position: relative;
    transform: translateZ(0);
}

@media (max-width: 500px) {
    body { align-items: stretch; justify-content: stretch; background: var(--bg); }
    .phone-frame { width: 100%; height: 100%; border: none; border-radius: 0; box-shadow: none; }
    .phone-notch { display: none; }
    .phone-viewport { border-radius: 0; }
}

/* ========================================
   HEADER
   ======================================== */
.header {
    height: 56px;
    min-height: 56px;
    padding: 24px 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    z-index: 100;
}

@media (max-width: 500px) { .header { padding-top: 0; } }

.logo { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-accent { color: var(--accent); }

.header-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--muted);
    cursor: pointer; border-radius: 50%;
    transition: background 0.15s;
}
.header-icon:hover { background: var(--soft); }

/* ========================================
   BOTTOM TAB BAR
   ======================================== */
.tab-bar {
    height: 64px;
    min-height: 64px;
    display: flex;
    align-items: center;
    background: var(--bg);
    border-top: 1px solid var(--line);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-bar .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    text-decoration: none;
    color: var(--muted);
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.tab-bar .tab:hover { text-decoration: none; }
.tab-bar .tab:active { opacity: 0.7; }
.tab-bar .tab.active { color: var(--accent); }

.tab-icon { width: 22px; height: 22px; }
.tab-label { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; }

/* ========================================
   MAIN
   ======================================== */
.main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overflow-x: clip;
    overscroll-behavior-y: none;
    touch-action: pan-y;
    padding: 16px 16px 80px;
    scroll-behavior: smooth;
    width: 100%;
}

.page-container { width: 100%; display: flex; flex-direction: column; gap: 10px; }

/* ========================================
   COMMON ELEMENTS
   ======================================== */
.eyebrow {
    display: block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.step-indicator {
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.65;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.form-label {
    display: block;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 5px;
}

/* ========================================
   INPUTS
   ======================================== */
.input {
    width: 100%;
    padding: 9px 11px;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid transparent;
    border-radius: 7px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    min-height: 38px;
}

.input:focus { border-color: var(--ink); background: #fff; }
.input::placeholder { color: #b5b5b5; font-weight: 400; }

select.input { cursor: pointer; appearance: auto; }

.input-prefix-wrap { position: relative; }
.input-prefix {
    position: absolute; left: 11px; top: 50%;
    transform: translateY(-50%);
    font-size: 13px; color: var(--muted);
    pointer-events: none;
}
.input-with-prefix { padding-left: 22px; }

.textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.5;
}
.textarea::placeholder { font-style: italic; }

/* ========================================
   CARDS
   ======================================== */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

.card-soft {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

/* ========================================
   GREETING (HOME)
   ======================================== */
.greeting {
    padding: 4px 2px 6px;
}

.greeting-small {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.greeting-name {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: 26px;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-top: 2px;
}

/* ========================================
   SEARCH
   ======================================== */
.search-section { position: relative; }

.search-wrapper { position: relative; }

.search-input {
    width: 100%;
    padding: 10px 70px 10px 36px;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
    min-height: 42px;
    transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--ink); }
.search-input::placeholder { color: #b5b5b5; }

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.search-actions {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 2px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
}

.link-btn-danger {
    color: var(--muted);
    font-size: 18px;
    font-weight: 400;
    min-height: 30px;
    padding: 0 6px;
}
.link-btn-danger:hover { color: var(--danger); }

.suggestions-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.suggestions-dropdown.show { display: block; }

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    transition: opacity 0.15s, background 0.15s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--soft);
}

.suggestion-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

.suggestion-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}

.suggestion-secondary {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.3;
}

/* ========================================
   MAP
   ======================================== */
.map-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 110px;
    background: var(--soft);
    border: 1px solid var(--line);
}

.map-tall { height: 130px; }

.map { width: 100%; height: 100%; }

.map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--muted);
    background: var(--soft);
    z-index: 10;
}

/* ========================================
   FORM GRID
   ======================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-group { min-width: 0; }
.form-group.full { grid-column: span 2; }

/* ========================================
   CHIPS
   ======================================== */
.chip-row-label {
    display: block;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.chip-group:last-child { margin-bottom: 0; }

.chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--muted);
    background: var(--soft);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    min-height: 26px;
}

.chip:active { opacity: 0.85; }
.chip.selected { background: var(--ink); color: #fff; }

/* ========================================
   AMENITY ROWS (HOME card 4)
   ======================================== */
.amenity-list { display: flex; flex-direction: column; gap: 6px; }

.amenity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--soft);
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    border-radius: 8px;
    transition: background 0.15s, border-color 0.15s;
}

.amenity-row.selected {
    background: var(--accent-light);
    border-left-color: var(--accent);
}

.amenity-check {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--line);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.amenity-row.selected .amenity-check {
    background: var(--accent);
    border-color: var(--accent);
}

.amenity-check::after {
    content: '';
    width: 8px;
    height: 4px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
    opacity: 0;
    transition: opacity 0.1s;
}

.amenity-row.selected .amenity-check::after { opacity: 1; }

.amenity-name {
    flex: 1;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink);
}

.amenity-control {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.rating-dots { display: flex; gap: 3px; }

.rating-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d8d8d8;
    cursor: pointer;
    transition: background 0.1s;
}
.rating-dot.filled { background: var(--accent); }

.yn-toggle {
    display: flex;
    gap: 3px;
}

.yn-btn {
    padding: 3px 9px;
    font-size: 10.5px;
    font-weight: 600;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 100px;
    cursor: pointer;
    color: var(--muted);
    font-family: inherit;
    min-height: 22px;
}

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

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    width: 100%;
    min-height: 46px;
}

.btn:active { opacity: 0.75; }

.btn-primary {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}
.btn-primary:hover { background: #222; }

.btn-secondary {
    background: #fff;
    color: var(--ink);
    border-color: var(--ink);
}
.btn-secondary:hover { background: var(--soft); }

/* ========================================
   ERROR / EMPTY
   ======================================== */
.error-msg {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fef2ee;
    color: var(--danger);
    border-radius: 8px;
    font-size: 12.5px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 13px;
}
.empty-state a { font-weight: 600; }

/* Preview blur overlay (Score & Comps tabs when no unit yet) */
.preview-wrap {
    position: relative;
    min-height: 100%;
}
.preview-content {
    pointer-events: none;
    user-select: none;
}
.preview-address {
    text-align: center;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 2px 0 6px;
}
.preview-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    pointer-events: auto;
}
.preview-overlay-msg {
    max-width: 280px;
    text-align: center;
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: 0;
}
.preview-overlay-link {
    color: #1e5a3d;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.15s;
}
.preview-overlay-link:hover { opacity: 0.7; }

/* Safari < 18 / very old browsers fallback if backdrop-filter unsupported */
@supports not ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))) {
    .preview-overlay { background: rgba(247, 247, 247, 0.85); }
    .preview-content { filter: blur(4px); }
}

.info-banner {
    padding: 9px 12px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 500;
    text-align: center;
}

.hidden { display: none !important; }

/* ========================================
   STAGE 1 — Concession, validation, parser
   ======================================== */
.field-error {
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
}

.rent-display {
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--soft, #f7f7f6);
    border-radius: 8px;
    font-size: 12.5px;
}
.rent-stated { color: var(--muted, #6b6b6b); }
.rent-effective {
    color: #1e5a3d;
    font-weight: 600;
    margin-top: 2px;
}

.detected-panel {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--accent-light);
    border-radius: 8px;
    font-size: 12.5px;
}
.detected-head {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink, #111);
}
.detected-list { display: flex; flex-direction: column; gap: 4px; }
.detected-item {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.35;
}
.detected-item .src { color: var(--muted, #6b6b6b); font-style: italic; }
.detected-pos { color: #1e5a3d; font-weight: 600; }
.detected-neg { color: var(--danger, #b3382c); font-weight: 600; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.modal-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 10px;
}
.modal-body {
    font-size: 13px;
    color: var(--ink, #111);
    margin-bottom: 14px;
    line-height: 1.4;
}
.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.conflict-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.conflict-item:last-child { border-bottom: none; margin-bottom: 0; }
.conflict-question { margin-bottom: 8px; }
.conflict-resolved {
    color: var(--accent);
    font-weight: 600;
    font-size: 12px;
    margin-top: 4px;
}
.conflict-actions { display: flex; gap: 8px; }
.conflict-actions .btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 12.5px;
}

/* ========================================
   PHASE 2.5 — Progress page
   ======================================== */
.progress-head { text-align: center; padding: 20px 8px 16px; }
.progress-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 300;
    font-size: 22px;
    color: var(--ink, #111);
    letter-spacing: -0.01em;
    margin: 0 0 6px 0;
}
.progress-sub {
    font-size: 12.5px;
    color: var(--muted, #6b6b6b);
    margin: 0;
}
.progress-card {
    background: #fff;
    border: 1px solid var(--line, #e9e9e7);
    border-radius: 14px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}
.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #bbb;
    transition: color 0.25s ease;
}
.progress-step.active { color: var(--ink, #111); font-weight: 500; }
.progress-step.done { color: var(--accent); }
.progress-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}
.progress-check, .progress-spinner, .progress-pending { display: none; line-height: 1; }
.progress-step .progress-pending { display: inline; color: #cfcfcd; font-size: 16px; }
.progress-step.active .progress-pending { display: none; }
.progress-step.active .progress-spinner { display: inline-block; }
.progress-step.done .progress-pending,
.progress-step.done .progress-spinner { display: none; }
.progress-step.done .progress-check {
    display: inline;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}
.progress-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #d6e2db;
    border-top-color: var(--accent);
    animation: progress-spin 0.9s linear infinite;
}
@keyframes progress-spin {
    to { transform: rotate(360deg); }
}
.progress-leave-note {
    margin-top: 16px;
    font-size: 11.5px;
    color: var(--muted, #6b6b6b);
    text-align: center;
    line-height: 1.5;
}
.error-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #f4d4ce;
    background: #fef2ee;
    border-radius: 12px;
}
.error-panel-title { font-weight: 700; color: var(--danger, #b3382c); margin-bottom: 6px; }
.error-panel-msg { font-size: 13px; margin-bottom: 12px; color: var(--ink, #111); }

/* ========================================
   PHASE 2.5 — Result page (Score + Comps tabs)
   ======================================== */
.result-tabs {
    display: flex;
    gap: 4px;
    background: #f0efed;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 14px;
}
.result-tab {
    flex: 1;
    appearance: none;
    background: transparent;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted, #6b6b6b);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.result-tab.active { background: #fff; color: var(--ink, #111); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

/* Show the math */
.show-math-btn {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.show-math-btn.expanded .caret { transform: rotate(180deg); }
.show-math-btn .caret { transition: transform 0.2s ease; display: inline-block; }
.show-math-panel {
    margin-top: 12px;
    padding: 16px 14px;
    background: #fff;
    border: 1px solid var(--line, #e9e9e7);
    border-radius: 14px;
}
.math-step { padding: 4px 0; }
.math-step-num {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted, #6b6b6b);
}
.math-step-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 400;
    font-size: 16px;
    margin: 2px 0 8px 0;
    color: var(--ink, #111);
}
.math-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    padding: 2px 0;
    gap: 12px;
}
.math-line-total {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #ddd;
    font-weight: 600;
}
.math-muted { color: var(--muted, #6b6b6b); }
.math-val { font-variant-numeric: tabular-nums; color: var(--ink, #111); }
.math-val-accent { color: var(--accent); font-weight: 700; }
.math-sub { font-size: 12px; color: var(--muted, #6b6b6b); margin-top: 4px; }
.math-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.math-tag {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
}
.math-warn {
    margin-top: 6px;
    font-size: 12px;
    color: #a8552b;
    background: #fdf6ed;
    padding: 6px 8px;
    border-radius: 6px;
}
.math-excl {
    font-size: 11.5px;
    color: var(--muted, #6b6b6b);
    margin-top: 2px;
}
.math-divider { height: 1px; background: var(--line, #e9e9e7); margin: 12px 0; }
.math-adj {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 4px 10px;
    padding: 4px 0;
    border-bottom: 1px dotted #eee;
    font-size: 12.5px;
}
.math-adj:last-of-type { border-bottom: none; }
.math-adj-label { font-weight: 500; color: var(--ink, #111); grid-column: 1; }
.math-adj-detail { font-size: 11.5px; color: var(--muted, #6b6b6b); grid-column: 1; }
.math-adj-pct { grid-column: 2; grid-row: 1 / span 2; font-weight: 700; font-variant-numeric: tabular-nums; }

.insights-loading { color: var(--muted, #6b6b6b); font-style: italic; }

.map-placeholder-tall {
    height: 220px;
    border-radius: 14px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    margin: 12px 0;
    border: 1px solid #d8e5dc;
}

/* Result comp rows */
.result-comp-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--line, #e9e9e7);
    border-radius: 12px;
    margin-bottom: 8px;
}
.result-comp-row.subject {
    background: var(--accent-light);
    border-color: #c7dcc9;
    position: relative;
}
.result-comp-row .you-badge {
    position: absolute;
    top: 8px;
    right: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 2px 6px;
    border-radius: 4px;
}
.result-comp-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.result-comp-link:hover {
    border-color: var(--accent, #1e5a3d);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.result-comp-row > div:first-child { min-width: 0; }
.result-comp-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--ink, #111);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-comp-sub { font-size: 11.5px; color: var(--muted, #6b6b6b); margin-top: 2px; }
.result-comp-rent { font-size: 14px; font-weight: 700; color: var(--ink, #111); }
.result-comp-psf { font-size: 11px; color: var(--muted, #6b6b6b); margin-top: 2px; text-align: right; }
.result-score-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
.result-score-green { background: var(--accent); }
.result-score-gold { background: #d4a574; }
.result-score-red { background: var(--danger, #b3382c); }

/* ========================================
   SCORE TAB
   ======================================== */
.verdict-head { padding: 8px 4px 12px; }

.verdict-eyebrow {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.verdict-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 300;
    font-size: 22px;
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.verdict-title-italic {
    display: block;
    font-style: italic;
    color: var(--accent);
}

.verdict-sub {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.verdict-divider {
    margin-top: 12px;
    height: 1px;
    background: var(--line);
}

.gauge-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 14px 16px;
    overflow: hidden;
}

.gauge-deco {
    position: absolute;
    color: #ccc;
    opacity: 0.5;
    pointer-events: none;
    font-size: 14px;
    line-height: 1;
}
.gauge-deco.tl { top: 12px; left: 14px; }
.gauge-deco.tr { top: 14px; right: 16px; }
.gauge-deco.bl { bottom: 60px; left: 18px; }
.gauge-deco.br { bottom: 64px; right: 18px; }

.gauge-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 6px;
    margin-bottom: -4px;
}

.gauge-label-l {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--danger);
}

.gauge-label-r {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.gauge-svg-wrap {
    display: flex;
    justify-content: center;
    margin-top: 4px;
}

.gauge-svg { width: 100%; max-width: 280px; height: auto; display: block; }

.gauge-bubble-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -22px;
}

.gauge-bubble {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.gauge-bubble-label {
    margin-top: 10px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.gauge-bubble-verdict {
    margin-top: 4px;
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 19px;
    color: var(--accent);
    line-height: 1.2;
}

/* KPI strip */
.kpi-strip {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 7px;
}

.kpi {
    background: var(--soft);
    border-radius: 10px;
    padding: 11px 8px;
    text-align: center;
}

.kpi-label {
    display: block;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.kpi-value {
    display: block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.kpi-value.pos { color: var(--accent); }
.kpi-value.neg { color: var(--danger); }

/* Comp-pool tier mismatch panel — soft amber to distinguish from green insights */
.mismatch-panel {
    background: #fdf8f0;
    border: 1px solid #e8d5a3;
    border-radius: 12px;
    padding: 14px;
}

.mismatch-eyebrow {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8a6d3b;
    margin-bottom: 6px;
}

.mismatch-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink);
}

/* Insights */
.insights-panel {
    background: var(--accent-light);
    border-radius: 12px;
    padding: 14px;
}

.insights-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.insights-eyebrow {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
}

.insights-ai-tag {
    font-size: 9px;
    font-weight: 500;
    color: var(--accent);
    opacity: 0.6;
    letter-spacing: 0.02em;
}

.insights-list {
    list-style: none;
    padding: 0;
}

.insights-list li {
    padding: 7px 0;
    font-size: 10px;
    line-height: 1.4;
    color: var(--ink);
    position: relative;
    padding-left: 16px;
    border-bottom: 1px solid rgba(30, 90, 61, 0.1);
}

.insights-list li:last-child { border-bottom: none; }

.insights-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ========================================
   COMPS TAB
   ======================================== */
.comps-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.control-block {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    position: relative;
}

.control-label {
    display: block;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.control-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink);
}

.control-value::after {
    content: '▾';
    font-size: 9px;
    color: var(--muted);
    margin-left: 6px;
}

.control-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    appearance: none;
    border: none;
    background: transparent;
}

.summary-strip {
    background: var(--ink);
    color: #fff;
    border-radius: 10px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.summary-cell { text-align: center; }

.summary-cell-label {
    display: block;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 4px;
}

.summary-cell-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.summary-cell-value.light-green { color: #8ed5a6; }

.listings-heading {
    font-size: 11.5px;
    color: var(--muted);
    margin: 2px 2px;
}

.listings { display: flex; flex-direction: column; gap: 8px; }

.listing-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    position: relative;
}

.listing-tile {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    background-size: cover;
    background-position: center;
}

.listing-info { flex: 1; min-width: 0; }

.listing-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-meta {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}

.listing-right {
    text-align: right;
    flex-shrink: 0;
}

.listing-rent {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.listing-psf {
    font-size: 10px;
    color: var(--muted);
    margin-top: 1px;
}

/* Inline % change span inside listing-meta subline 2.
   Decrease = red (landlord dropped price), Increase = green (landlord raised). */
.change-decrease { color: var(--danger); font-weight: 600; }
.change-increase { color: var(--accent); font-weight: 600; }
.change-flat { color: var(--muted); }

/* Tier badge (inline, sits at the end of subline 1) */
.tier-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 100px;
    margin-left: 6px;
    letter-spacing: 0.02em;
    vertical-align: middle;
}
.tier-badge-a { background: var(--accent-light); color: var(--accent); }
.tier-badge-b { background: #f5f0e8; color: #8a6d3b; }
.tier-badge-c { background: #fdf2f0; color: var(--danger); }

/* Subject (YOU) card has a green background — invert badge colors so they stay legible */
.listing-card.subject .tier-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* Subject (you) card */
.listing-card.subject {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.listing-card.subject .listing-name,
.listing-card.subject .listing-rent { color: #fff; }

.listing-card.subject .listing-meta,
.listing-card.subject .listing-psf { color: rgba(255,255,255,0.78); }

.listing-card.subject .listing-tile {
    background: rgba(255,255,255,0.18);
}

.you-badge {
    position: absolute;
    top: 7px;
    right: 8px;
    background: var(--ink);
    color: #fff;
    font-size: 7.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 2px 6px;
    border-radius: 100px;
    text-transform: uppercase;
}

.subject-score-badge {
    background: #fff;
    color: var(--accent);
    border-radius: 100px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    margin-top: 3px;
    display: inline-block;
}

.listings-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--muted);
}

.listings-empty .empty-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 4px;
}

.listings-empty .empty-sub {
    font-size: 11px;
    color: var(--muted);
}

/* ========================================
   PROFILE TAB
   ======================================== */
.user-card {
    position: relative;
    background: linear-gradient(135deg, var(--accent), #2d7a52);
    color: #fff;
    border-radius: 14px;
    padding: 18px;
    overflow: hidden;
}

.user-card-circle {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.15);
}

.user-name {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 300;
    font-size: 22px;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.user-meta {
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255,255,255,0.85);
}

.user-divider {
    margin: 14px 0 10px;
    height: 1px;
    background: rgba(255,255,255,0.2);
}

.user-stats { display: flex; flex-direction: column; gap: 6px; }

.user-stat {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
}

.user-stat-label { color: rgba(255,255,255,0.78); }
.user-stat-value { font-weight: 700; color: #fff; }
.user-stat-value.editable { display: inline-flex; align-items: center; gap: 6px; }
.user-stat-value .value-text.empty { font-weight: 500; opacity: 0.6; }
.user-stat-value .value-edit {
    background: none;
    border: none;
    color: rgba(255,255,255,0.55);
    padding: 0;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.user-stat-value .value-edit:hover { opacity: 1; color: rgba(255,255,255,0.95); }
.profile-inline-input {
    width: 110px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: #fff;
    font: inherit;
    font-weight: 700;
    padding: 1px 6px;
    outline: none;
}
.profile-inline-input:focus { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.18); }
.profile-inline-input::placeholder { color: rgba(255,255,255,0.45); font-weight: 500; }

/* Affordability */
.afford-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin: 6px 0 10px;
    letter-spacing: -0.01em;
}

.afford-input-wrap {
    position: relative;
}

.afford-input {
    width: 100%;
    padding: 10px 50px 10px 22px;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid transparent;
    border-radius: 8px;
    outline: none;
    min-height: 38px;
}
.afford-input:focus { border-color: var(--ink); background: #fff; }

.afford-input-prefix {
    position: absolute;
    left: 11px; top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--muted);
    pointer-events: none;
}

.afford-input-suffix {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--muted);
    pointer-events: none;
}

.afford-bands {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}

.afford-band {
    padding: 9px 8px;
    border-radius: 8px;
    text-align: center;
}

.afford-band-25 { background: var(--accent-light); }
.afford-band-30 { background: #fdf6e8; }
.afford-band-35 { background: #fbe8e0; }

.band-pct {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.band-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.afford-bar-wrap {
    margin-top: 14px;
    position: relative;
}

.afford-bar {
    position: relative;
    height: 8px;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 35%, var(--gold) 55%, var(--gold) 65%, var(--danger) 90%, var(--danger) 100%);
    overflow: visible;
}

.afford-marker {
    position: absolute;
    top: -5px;
    width: 18px;
    height: 18px;
    background: var(--ink);
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.afford-marker-label {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    background: var(--ink);
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
}

.afford-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 9px;
    color: var(--muted);
}

/* Toolkit */
.toolkit-head {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 6px 2px 2px;
}

.toolkit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.toolkit-tile {
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.15s;
}
.toolkit-tile:active { transform: scale(0.98); }

.toolkit-tile.dark {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.toolkit-tile.full-width { grid-column: span 2; flex-direction: row; align-items: center; }

.toolkit-tile.accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.toolkit-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.toolkit-tile.dark .toolkit-icon { background: rgba(255,255,255,0.15); }
.toolkit-tile.accent .toolkit-icon { background: rgba(255,255,255,0.15); }

.toolkit-title {
    font-size: 12.5px;
    font-weight: 700;
    color: inherit;
}

.toolkit-sub {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}
.toolkit-tile.dark .toolkit-sub,
.toolkit-tile.accent .toolkit-sub { color: rgba(255,255,255,0.78); }

.toolkit-meta {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--accent);
    margin-top: 4px;
}
.toolkit-tile.dark .toolkit-meta { color: #fff; }
.toolkit-tile.accent .toolkit-meta { color: #fff; }

.toolkit-tile-text { flex: 1; }

.renewal-days {
    text-align: right;
}
.renewal-days-num {
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: 24px;
    line-height: 1;
}
.renewal-days-label {
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.78;
    margin-top: 2px;
}

/* Rights */
.rights-card { padding: 14px; }

.rights-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.rights-eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.state-badge {
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 100px;
}

.rights-list { display: flex; flex-direction: column; }

.right-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    gap: 8px;
}

.right-row:last-child { border-bottom: none; }

.right-info { flex: 1; min-width: 0; }

.right-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink);
}

.right-sub {
    font-size: 8.5px;
    font-weight: 700;
    color: var(--accent);
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.right-chevron {
    color: var(--muted);
    font-size: 14px;
    flex-shrink: 0;
}

.right-row.open .right-chevron { transform: rotate(90deg); }

.right-body {
    display: none;
    padding: 8px 0 12px;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--muted);
}

.right-row.open + .right-body { display: block; }

.right-body p { margin-bottom: 6px; }

.right-body ul {
    padding-left: 18px;
    margin-bottom: 6px;
}

.right-body li {
    font-size: 11px;
    line-height: 1.55;
    margin-bottom: 3px;
}

.disclaimer {
    font-size: 10px;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: var(--soft);
    border-radius: 7px;
}

.source-link {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
}

/* ════════════════════════════════════════════
   HOME v5 — Redesigned home tab
   ════════════════════════════════════════════ */

/* v5 design tokens — scoped to the home tab so they don't bleed */
.home-v5 {
    --v5-ink:          #0f0f0f;
    --v5-muted:        #6b6b6b;
    --v5-subtle:       #adadad;
    --v5-accent:       #1e5a3d;
    --v5-accent-light: #e8f2ec;
    --v5-accent-xlight:#f2f8f4;
    --v5-soft:         #f0ebe4;
    --v5-bg:           #f5f2ed;
    --v5-card:         #ffffff;
    --v5-line:         #e5e0d8;
    --v5-line-soft:    #ede9e2;
    --v5-danger:       #b03428;
    --v5-danger-bg:    #fdf0ee;
    --v5-danger-line:  #e8b8b2;
    gap: 0;
    padding: 0 0 8px;
}

/* Override main background to v5 warm tone when home tab is active */
.home-v5 ~ * { /* noop selector to keep scope local */ }

/* When the home v5 page is rendered, paint the viewport bg */
body:has(.home-v5) .phone-viewport,
body:has(.home-v5) .main { background: var(--v5-bg, #f5f2ed); }

/* Hide the global header when on home v5 (greeting + address bar replace it) */
/* (Keep the header — base.html already provides a thin RentFair logo bar.)   */

/* Greeting */
.greeting.v5 {
    padding: 8px 22px 12px;
}
.greeting.v5 .greeting-small {
    font-size: 12px;
    font-weight: 500;
    color: var(--v5-muted);
}
.greeting.v5 .greeting-name {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 27px;
    font-weight: 300;
    font-style: italic;
    color: var(--v5-ink);
    line-height: 1.1;
    margin-top: 0;
}

/* Address bar */
.home-v5 .address-bar {
    position: relative;
    margin: 0 18px 12px;
    background: var(--v5-card);
    border: 1.5px solid var(--v5-line);
    border-radius: 14px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.home-v5 .addr-icon {
    width: 30px;
    height: 30px;
    background: var(--v5-accent);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.home-v5 .addr-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.home-v5 .addr-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--v5-subtle);
    margin-bottom: 1px;
}
.home-v5 .addr-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--v5-ink);
    padding: 0;
    line-height: 1.3;
}
.home-v5 .addr-input::placeholder {
    color: var(--v5-subtle);
    font-weight: 500;
}
.home-v5 .addr-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.home-v5 .addr-change {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--v5-accent);
    cursor: pointer;
    padding: 4px 6px;
}
.home-v5 .addr-clear {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 18px;
    color: var(--v5-subtle);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.home-v5 .addr-clear:hover { color: var(--v5-danger); }

.home-v5 .suggestions-dropdown.v5 {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--v5-card);
    border: 1.5px solid var(--v5-line);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    max-height: 240px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}
.home-v5 .suggestions-dropdown.v5.show { display: block; }

/* Map */
.home-v5 .map-wrap {
    position: relative;
    margin: 0 18px 14px;
    height: 130px;
    border-radius: 16px;
    overflow: hidden;
    border: 1.5px solid var(--v5-line);
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    background: #dde8dd;
}
.home-v5 .map-wrap .map { width: 100%; height: 100%; }
.home-v5 .map-placeholder.v5 {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--v5-muted);
    background: #dde8dd;
    z-index: 10;
}

/* Section row (label + step) */
.home-v5 .section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 22px 10px;
}
.home-v5 .section-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--v5-accent);
}
.home-v5 .section-step {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--v5-subtle);
}

/* MAIN CARD (Your Unit) */
.home-v5 .main-card {
    margin: 0 18px 11px;
    background: var(--v5-card);
    border: 1.5px solid var(--v5-line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.home-v5 .main-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--v5-line-soft);
}
.home-v5 .main-card-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--v5-ink);
}
.home-v5 .main-card-hint {
    font-size: 10px;
    font-weight: 500;
    color: var(--v5-subtle);
}

/* 4-col grid */
.home-v5 .field-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    border-bottom: 1px solid var(--v5-line-soft);
    align-items: stretch;
}
.home-v5 .field {
    padding: 12px 13px;
    border-right: 1px solid var(--v5-line-soft);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}
.home-v5 .field-last { border-right: none; }

.home-v5 .f-lbl {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--v5-subtle);
    margin-bottom: 6px;
    height: 12px;
    line-height: 12px;
}
.home-v5 .f-val {
    font-size: 17px;
    font-weight: 700;
    color: var(--v5-ink);
    letter-spacing: -0.03em;
    line-height: 1;
    height: 20px;
    display: flex;
    align-items: center;
    gap: 1px;
    min-width: 0;
}
.home-v5 .f-prefix {
    color: var(--v5-muted);
    font-size: 15px;
    font-weight: 700;
}
.home-v5 .f-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    color: var(--v5-ink);
    letter-spacing: -0.03em;
    width: 100%;
    min-width: 0;
    padding: 0;
    line-height: 1;
}
.home-v5 .f-input::placeholder {
    color: var(--v5-subtle);
    font-weight: 700;
}
/* Hide native number spinner */
.home-v5 .f-input::-webkit-outer-spin-button,
.home-v5 .f-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Custom dropdown */
.home-v5 .custom-select {
    position: relative;
    display: inline-block;
    width: 100%;
}
.home-v5 .select-display {
    font-size: 17px;
    font-weight: 700;
    color: var(--v5-ink);
    letter-spacing: -0.03em;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    user-select: none;
    height: 20px;
}
.home-v5 .select-caret {
    font-size: 9px;
    color: var(--v5-accent);
    opacity: 0.8;
    margin-top: 2px;
    flex-shrink: 0;
}
.home-v5 .select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: -12px;
    background: var(--v5-card);
    border: 1.5px solid var(--v5-line);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    min-width: 90px;
}
.home-v5 .select-dropdown.con-dropdown { min-width: 140px; }
.home-v5 .select-dropdown.open { display: block; }
.home-v5 .select-opt {
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--v5-ink);
    cursor: pointer;
    border-bottom: 1px solid var(--v5-line-soft);
    transition: background 0.1s;
    white-space: nowrap;
}
.home-v5 .select-opt:last-child { border-bottom: none; }
.home-v5 .select-opt:hover { background: var(--v5-soft); }
.home-v5 .select-opt.selected {
    color: var(--v5-accent);
    font-weight: 700;
}

/* Utilities + Concession row */
.home-v5 .util-con-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--v5-line-soft);
}
.home-v5 .util-cell {
    padding: 11px 14px;
    border-right: 1px solid var(--v5-line-soft);
    min-width: 0;
}
.home-v5 .util-cell-last { border-right: none; }
.home-v5 .uc-lbl {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--v5-subtle);
    margin-bottom: 5px;
}
.home-v5 .uc-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--v5-ink);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 2px;
}
.home-v5 .uc-prefix {
    color: var(--v5-muted);
    font-size: 15px;
    font-weight: 700;
}
.home-v5 .uc-input {
    font-size: 16px;
    font-weight: 700;
    color: var(--v5-ink);
    letter-spacing: -0.02em;
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    min-width: 0;
    font-family: inherit;
    padding: 0;
    line-height: 1;
}
.home-v5 .uc-input::placeholder {
    color: var(--v5-subtle);
    font-weight: 700;
}

/* Concession dropdown — colored states */
.home-v5 .con-display .sel-val {
    color: var(--v5-subtle);
    font-size: 15px;
    font-weight: 700;
}
.home-v5 .con-display .select-caret {
    color: var(--v5-subtle);
}
.home-v5 .con-select.has-value .con-display .sel-val {
    color: var(--v5-accent);
}
.home-v5 .con-select.has-value .con-display .select-caret {
    color: var(--v5-accent);
    opacity: 1;
}

/* Effective rent row */
.home-v5 .eff-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--v5-line-soft);
}
.home-v5 .eff-row.hidden { display: none; }
.home-v5 .eff-cell {
    padding: 9px 14px;
    border-right: 1px solid var(--v5-line-soft);
}
.home-v5 .eff-cell-last { border-right: none; }
.home-v5 .eff-lbl {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--v5-subtle);
    margin-bottom: 3px;
}
.home-v5 .eff-lbl.green { color: var(--v5-accent); }
.home-v5 .eff-val {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--v5-subtle);
    text-decoration: line-through;
}
.home-v5 .eff-val.green {
    color: var(--v5-accent);
    text-decoration: none;
}

/* AMENITIES CARD */
.home-v5 .amen-wrap {
    margin: 10px 18px 4px;
    background: var(--v5-card);
    border: 1.5px solid var(--v5-line);
    border-radius: 16px;
    overflow: hidden;
    overflow: clip;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.home-v5 .amen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px 10px;
    border-bottom: 1px solid var(--v5-line-soft);
}
.home-v5 .amen-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--v5-ink);
}
.home-v5 .amen-nav-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}
.home-v5 .a-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.22s ease;
    flex-shrink: 0;
}
.home-v5 .a-dot.on  { background: var(--v5-accent); }
.home-v5 .a-dot.off { background: var(--v5-line); }

.home-v5 .amen-track {
    display: flex;
    width: 100%;
    transform: translateX(0%);
    transition: transform 0.3s ease;
    touch-action: pan-y;
    align-items: stretch;
}
.home-v5 .amen-panel {
    display: block;
    flex: 0 0 100%;
    min-width: 0;
}
.home-v5 .amen-panel.active { display: block; }

/* Segmented controls */
.home-v5 .seg-row {
    padding: 11px 15px;
    border-bottom: 1px solid var(--v5-line-soft);
}
.home-v5 .seg-row:last-child { border-bottom: none; }
.home-v5 .seg-row-lbl {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--v5-subtle);
    margin-bottom: 7px;
}
.home-v5 .seg-pills {
    display: flex;
    background: var(--v5-soft);
    border-radius: 9px;
    padding: 3px;
    gap: 2px;
}
.home-v5 .seg-pill {
    flex: 1;
    text-align: center;
    padding: 7px 3px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--v5-muted);
    cursor: pointer;
    transition: all 0.13s;
    user-select: none;
}
.home-v5 .seg-pill.on {
    background: var(--v5-card);
    color: var(--v5-ink);
    box-shadow: 0 1px 4px rgba(0,0,0,0.09), 0 0 0 0.5px rgba(0,0,0,0.04);
}

/* Y/N toggle row */
.home-v5 .t-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 15px;
    border-bottom: 1px solid var(--v5-line-soft);
}
.home-v5 .t-row:last-child { border-bottom: none; }
.home-v5 .t-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--v5-ink);
}
.home-v5 .yn { display: flex; gap: 4px; }
.home-v5 .yn-btn {
    padding: 5px 13px;
    border-radius: 100px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    border: 1.5px solid var(--v5-line);
    color: var(--v5-muted);
    background: var(--v5-card);
    cursor: pointer;
    transition: all 0.13s;
    min-height: 0;
    line-height: 1.2;
}
.home-v5 .yn-btn.yes {
    background: var(--v5-accent);
    border-color: var(--v5-accent);
    color: #fff;
}
.home-v5 .yn-btn.no {
    background: var(--v5-danger-bg);
    border-color: var(--v5-danger-line);
    color: var(--v5-danger);
}

/* NOTES CARD */
.home-v5 .notes-wrap {
    margin: 10px 18px 11px;
    background: var(--v5-card);
    border: 1.5px solid var(--v5-line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.home-v5 .notes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 15px 9px;
    border-bottom: 1px solid var(--v5-line-soft);
}
.home-v5 .notes-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--v5-ink);
}
.home-v5 .notes-opt {
    font-size: 10px;
    font-weight: 500;
    color: var(--v5-subtle);
}
.home-v5 .notes-body {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    color: var(--v5-ink);
    line-height: 1.55;
    min-height: 64px;
    background: var(--v5-card);
    border: none;
    outline: none;
    resize: vertical;
}
.home-v5 .notes-body::placeholder {
    color: var(--v5-subtle);
    font-style: normal;
}
.home-v5 .notes-ai {
    padding: 8px 15px 10px;
    border-top: 1px solid var(--v5-line-soft);
    background: var(--v5-accent-xlight);
    display: flex;
    align-items: flex-start;
    gap: 7px;
}
.home-v5 .notes-ai.hidden { display: none; }
.home-v5 .ai-icon {
    font-size: 11px;
    color: var(--v5-accent);
    line-height: 1.4;
    flex-shrink: 0;
}
.home-v5 .ai-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--v5-accent);
    line-height: 1.4;
}
.home-v5 .ai-text strong { font-weight: 800; }

/* CTA */
.home-v5 .cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 18px 18px;
    padding: 16px;
    background: var(--v5-accent);
    color: #fff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(30,90,61,0.28), 0 2px 6px rgba(30,90,61,0.14);
    cursor: pointer;
    width: calc(100% - 36px);
    font-family: inherit;
    transition: opacity 0.15s;
}
.home-v5 .cta:active { opacity: 0.85; }
.home-v5 .cta:disabled { opacity: 0.7; cursor: default; }
.home-v5 .cta-text {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}
.home-v5 .cta-chip {
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.18);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    line-height: 1;
}

/* Error message inside the home v5 layout */
.home-v5 .error-msg {
    margin: 4px 18px 18px;
}
.home-v5 .field-error {
    margin: 4px 18px 0;
    font-size: 11px;
}
.home-v5 .field .field-error {
    margin: 4px 0 0;
}

/* Tighten main padding when the home v5 page is shown */
.main:has(.home-v5) { padding: 8px 0 80px; }

/* ════════════════════════════════════════════
   Portaled floating dropdowns — used by home (beds/baths/concession)
   and comps (radius/sort). Unscoped so the rules survive being moved
   to <body>, where the .home-v5 / .score-v6 ancestors no longer match.
   ════════════════════════════════════════════ */
.select-dropdown {
    display: none;
    background: #ffffff;
    border: 1.5px solid #e5e0d8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    z-index: 99999;
    min-width: 110px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.select-dropdown.open { display: block; }
.select-dropdown .select-opt {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #0f0f0f;
    cursor: pointer;
    border-bottom: 1px solid #ede9e2;
    transition: background 0.1s;
    white-space: nowrap;
}
.select-dropdown .select-opt:last-child { border-bottom: none; }
.select-dropdown .select-opt:hover { background: #f0ebe4; }
.select-dropdown .select-opt.selected {
    color: #1e5a3d;
    font-weight: 700;
    background: #f2f8f4;
}

