* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; padding-top: 1.5rem; padding-bottom: 3rem; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

a { color: var(--primary); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .75rem; }
h3 { margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--primary); letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { text-decoration: none; font-weight: 600; }
.nav-links a.btn { color: var(--button-text); }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; }

/* hero + cards */
.hero { padding: 3rem 0 2rem; max-width: 680px; }
.hero h1 { font-size: 2.4rem; }
.hero p { font-size: 1.1rem; color: var(--muted); }
.hero-actions { margin-top: 1.25rem; }
.grid { display: grid; gap: 1rem; margin: 1.5rem 0; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.card p { margin: .25rem 0; }
.stat { font-size: 2rem; font-weight: 800; margin: 0; }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 99px; background: var(--border); font-size: .85rem; font-weight: 700; }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); box-shadow: inset 0 0 0 1px var(--success); }

/* forms */
.auth-card { max-width: 440px; margin: 1rem auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; }
label { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"] {
    width: 100%;
    padding: .7rem .8rem;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    font: inherit;
    background: var(--surface-2);
}
.password-input { position: relative; }
.password-input input { padding-right: 3.5rem; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    display: inline-flex;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transform: translateY(-50%);
}
.password-toggle:hover { color: var(--primary); }
.password-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.password-toggle svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-slash { display: none; }
.password-toggle[aria-pressed="false"] .eye-slash { display: block; }
.password-field { position: relative; padding-bottom: 4rem; }
.password-policy-popup {
    position: absolute;
    top: calc(100% - 4rem + .35rem);
    left: 0;
    z-index: 30;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: .45rem .6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}
.password-policy-popup::before {
    position: absolute;
    top: -.35rem;
    left: .9rem;
    width: .6rem;
    height: .6rem;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    background: var(--surface-2);
    content: "";
    transform: rotate(45deg);
}
.password-policy-rules { display: flex; flex-wrap: wrap; gap: .3rem .8rem; margin: 0; padding: 0; list-style: none; }
.password-policy-rules li { display: flex; min-width: 0; gap: .25rem; align-items: flex-start; font-size: .78rem; line-height: 1.25; color: var(--text); }
.password-rule-icon { flex: 0 0 1rem; font-weight: 800; }
.password-policy-rules li.is-met { color: var(--ok-text); }
.password-policy-rules li.is-met .password-rule-icon { font-weight: 900; }
.password-policy-rules .password-rule-label { overflow-wrap: anywhere; }
.password-policy-popup [data-password-good] { margin: 0; color: var(--ok-text); font-size: .88rem; font-weight: 600; }
.password-confirm-field { margin-bottom: 1rem; }
.password-match-status { margin: .3rem 0 0; font-size: .88rem; }
.password-match-status.is-match { color: var(--ok-text); }
.password-match-status.is-mismatch { color: var(--error-text); }
.notes-page { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.notes-welcome { margin-bottom: 1rem; }
.notes-welcome h1 { margin-bottom: .35rem; }
.notes-welcome p { margin: .35rem 0; }
.notes-welcome > p:first-of-type { font-size: 1.08rem; }
.notes-welcome > p:last-child { color: var(--muted); }
.notes-welcome + .notes-navigation { margin-top: 1rem; }
.notes-welcome-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.notes-welcome-card h2 { margin: 0; }
.notes-welcome-card p { margin: .25rem 0 0; }
.notes-shortcut { margin: .4rem 0 1rem; }
.notes-navigation { margin-bottom: 1rem; }
.notes-navigation h2 { margin-top: 0; }
.notes-navigation input[type="search"] { width: 100%; }
.notes-toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .35rem 1rem; margin: .6rem 0; padding-left: 1.25rem; }
.notes-toc li { min-width: 0; overflow-wrap: anywhere; }
.notes-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.notes-management-notice { margin: 1rem 0; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.notes-content { display: grid; gap: .75rem; min-width: 0; }
.notes-topic { min-width: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.notes-topic > summary { padding: .9rem 1rem; cursor: pointer; color: var(--text); }
.notes-topic > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.notes-summary-title { font-size: 1.15rem; font-weight: 700; }
.notes-topic[open] > summary { border-bottom: 1px solid var(--border); }
.notes-topic-content { padding: .65rem 1rem 1rem; font-size: 1.03rem; line-height: 1.65; }
.notes-topic-content > :first-child { margin-top: .25rem; }
.notes-topic-content li { margin: .25rem 0; }
.notes-steps { padding-left: 1.5rem; }
.notes-callout { display: flex; gap: .65rem; align-items: flex-start; margin: 1rem 0; padding: .8rem 1rem; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 8px; background: var(--surface-2); }
.notes-callout.is-warning { border-left-color: var(--error-text); }
.notes-callout-icon { display: inline-flex; flex: 0 0 1.45rem; width: 1.45rem; height: 1.45rem; align-items: center; justify-content: center; border: 2px solid currentColor; border-radius: 50%; font-size: .9rem; font-weight: 800; line-height: 1; }
.notes-callout > div { min-width: 0; }
.notes-callout p { margin: .2rem 0 0; }
.notes-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding-left: 1.25rem; }
.notes-price-table { min-width: 28rem; }
.notes-faq dt { margin-top: .85rem; font-weight: 700; }
.notes-faq dt:first-child { margin-top: .25rem; }
.notes-faq dd { margin: .15rem 0 0 1rem; }
.notes-back-top { margin: 1rem 0 0; font-size: .9rem; }
.notes-filtered-out { display: none !important; }
input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
label.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .3rem; }

/* flash */
.flash { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; }
.flash-error { background: var(--error-bg); color: var(--error-text); }
.flash-success { background: var(--ok-bg); border-left: 4px solid var(--success); color: var(--ok-text); }
.flash-info { background: var(--info-bg); color: var(--info-text); }

.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.setting-switch-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 200px); align-items: center; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.setting-switch-row label { font-weight: 700; }
.setting-switch-row p { margin: .2rem 0 0; }
.field-actions { display: flex; align-items: flex-end; }
.compact-filter { min-width: min(100%, 280px); align-items: end; }
.grant-revoke { min-width: 180px; }
.grant-revoke > summary { cursor: pointer; list-style: none; }
.grant-revoke > summary::-webkit-details-marker { display: none; }
.grant-revoke form { min-width: 220px; margin-top: .65rem; }
.growth-chart, .trend-chart { display: grid; gap: .75rem; }
.growth-month { min-width: 0; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.chart-row, .trend-row { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr auto; gap: .5rem; align-items: center; font-size: .9rem; }
.bar-track { height: .7rem; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar { height: 100%; background: var(--primary); border-radius: inherit; min-width: 1px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

@media print {
    .site-header, .site-footer, .no-print, .flash { display: none !important; }
    body { display: block; background: #fff; color: #000; }
    main { padding: 0; }
    .container { max-width: none; padding: 0; }
    .card { border-color: #aaa; break-inside: avoid; }
    .table-wrap { overflow: visible; }
    .app-sidebar, .app-topbar, .notes-controls, .notes-search-control, .notes-back-top { display: none !important; }
    .notes-navigation { border: 0; padding: 0; }
    .notes-content > details.notes-filtered-out { display: block !important; }
    .notes-topic > .notes-topic-content { display: block !important; }
    .notes-topic { break-inside: avoid; color: #000; background: #fff; }
    .notes-topic > summary { list-style: none; }
}

html:not(.js) .notes-search-control { display: none; }

@media (max-width: 600px) {
    .hero h1 { font-size: 1.8rem; }
    .nav { height: auto; min-height: 60px; align-items: flex-start; padding-top: .65rem; padding-bottom: .65rem; gap: .5rem; }
    .nav-links { justify-content: flex-end; flex-wrap: wrap; gap: .45rem .7rem; font-size: .9rem; }
    .chart-row, .trend-row { grid-template-columns: 1fr; gap: .25rem; }
    .setting-switch-row { grid-template-columns: 1fr; gap: .5rem; }
    .grant-revoke form { min-width: 0; }
    .password-policy-popup { width: 100%; max-width: 100%; }
    .notes-topic-content { padding-right: .75rem; padding-left: .75rem; }
    .notes-toc { grid-template-columns: 1fr; }
}

/* ---------- Step 2: properties, photos, forms ---------- */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

select, textarea, input[type="number"], input[type="url"] {
width: 100%; padding: .7rem .8rem; border: 1px solid var(--control-border); border-radius: 8px; font: inherit; background: var(--surface-2);
}
textarea { resize: vertical; }
select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
input:disabled, select:disabled { background: var(--disabled-bg); color: var(--disabled-text); }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head.tight { align-items: baseline; margin-bottom: .5rem; }
.btn-row, .form-actions, .page-actions, .hero-actions, .decision-actions, .upload-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: .65rem;
}
.page-actions { margin: 0 0 1rem; }
.crumbs { margin: 0 0 .5rem; }
.crumbs a { text-decoration: none; font-weight: 600; }
.card + .card { margin-top: 1rem; }
.section-title { margin: 2rem 0 .25rem; }

fieldset.card { margin: 0 0 1rem; }
legend { font-weight: 800; padding: 0 .4rem; }
.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.field-row.three { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.hint { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
.choice-row { display: flex; gap: 1.5rem; }
label.choice { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin: .3rem 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .2rem .75rem; }
.check-grid label.check { margin: .3rem 0; }
.form-actions { margin-top: 1rem; }
.form-actions > form { flex: 0 1 auto; margin: 0; }
.btn-row > *, .table-actions > * { max-width: 100%; }
.btn-row > .btn-block { flex-basis: 100%; }

.badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge-bad { background: var(--error-bg); color: var(--error-text); }
.badge-accent, .badge-featured, .badge-free { background: var(--accent-bg); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }

.property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.property-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; }
.property-card:hover { border-color: var(--primary); }
.property-card .photo { border-radius: 0; }
.property-card-body { padding: 1rem; }
.property-card-body h3 { margin: 0 0 .15rem; }
.property-card-body p { margin: .25rem 0; }

/* Every photo is the same 4:3 box, whatever the original shape or the screen size */
.photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--border); margin: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-editable { aspect-ratio: auto; overflow: visible; background: var(--surface); }
.photo-editable > a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px 8px 0 0; }
.photo-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; }
.photo-grid, .preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; margin: .75rem 0; }
.preview-grid:empty { display: none; }
.photo-tag { position: absolute; top: 6px; left: 6px; font-size: .75rem; font-weight: 700; padding: .1rem .55rem; border-radius: 99px; }
.photo-actions { display: flex; justify-content: flex-start; gap: .4rem; flex-wrap: wrap; padding: .45rem; border: 1px solid var(--control-border); border-top: 0; border-radius: 0 0 8px 8px; background: var(--surface); }
.photo-actions form { margin: 0; }
.photo-actions .btn-secondary { background: var(--surface); border-color: var(--control-border); color: var(--text); }
.upload-row { margin-top: .5rem; }
.file-btn { margin: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
button:disabled, input:disabled { cursor: not-allowed; }

.todo { margin: .25rem 0 0; padding-left: 1.2rem; color: var(--error-text); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
details.more { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .75rem; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.remove-form { margin-top: 1rem; }
.link-danger { min-height: 44px; max-width: 100%; padding: .35rem .55rem; border: 0; box-sizing: border-box; background: none; font: inherit; font-weight: 600; color: var(--error-text); text-align: left; white-space: normal; cursor: pointer; text-decoration: underline; }

/* Keep header links on one line on narrow phones */
.nav-links a, .link-button { white-space: normal; }
@media (max-width: 480px) {
    .nav-links { gap: .7rem; font-size: .92rem; }
    .brand { font-size: 1.2rem; }
}

/* ---- Step 3: admin verification + notifications ---- */
.stack { display: flex; flex-direction: column; gap: .6rem; }
.stack label { font-weight: 700; }
.stack textarea { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--control-border); border-radius: 8px; resize: vertical; box-sizing: border-box; }
.nav-badge { display: inline-block; min-width: 1.3rem; padding: 0 .4rem; border-radius: 99px; background: var(--error-text); color: var(--button-text); font-size: .78rem; font-weight: 700; text-align: center; line-height: 1.3rem; }

.filter-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 .9rem; }
.filter-tabs .tab { display: inline-flex; min-height: 44px; max-width: 100%; align-items: center; justify-content: center; box-sizing: border-box; text-decoration: none; padding: .4rem .85rem; border: 1px solid var(--control-border); border-radius: 99px; color: inherit; font-weight: 600; text-align: center; white-space: normal; }
.filter-tabs .count { opacity: .75; font-weight: 700; margin-left: .2rem; }
.search-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.search-row input[type=search] { flex: 1 1 240px; font: inherit; padding: .5rem .7rem; border: 1px solid var(--control-border); border-radius: 8px; }

.admin-list { display: flex; flex-direction: column; gap: .75rem; }
.admin-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 1rem; align-items: center; padding: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: inherit; }
.admin-row:hover { border-color: var(--primary); }
.admin-row h3 { margin: 0 0 .15rem; }
.admin-row p { margin: .2rem 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.25rem 0; }

.review-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 1.25rem; align-items: start; }
.review-photos .card, .review-side .card { margin-bottom: 1rem; }
.review-side .decision { border-color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { min-height: 44px; max-width: 100%; box-sizing: border-box; font: inherit; font-size: .82rem; padding: .4rem .65rem; border: 1px solid var(--control-border); border-radius: 99px; background: var(--surface); white-space: normal; cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.decision-actions .btn { flex: 1 1 120px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: .6rem 0; border-top: 1px solid var(--border); }
.history li:first-child { border-top: 0; padding-top: 0; }
.history p { margin: .2rem 0; }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { padding: .6rem .75rem; border-left: 3px solid transparent; border-top: 1px solid var(--border); }
.notif-list li:first-child { border-top: 0; }
.notif-list li.unread { border-left-color: var(--primary); background: var(--unread); }
.notif-list p { margin: .2rem 0; }
.notifications { margin-bottom: 1rem; }

@media (min-width: 901px) { .review-side { position: sticky; top: calc(68px + 1rem); } }
@media (max-width: 900px) {
    .review-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .admin-row { grid-template-columns: 96px 1fr; }
    .admin-row-action { grid-column: 1 / -1; text-align: center; }
}

/* ---- Step 4: public property search and details ---- */
.home-search { max-width: 760px; margin: 1.25rem 0; }
.home-search h2 { margin: 0; font-size: 1.2rem; }
.listing-filters { margin: 0 0 1.25rem; }
.filter-amenities { border: 0; padding: 0; margin: 1rem 0 0; }
.filter-amenities legend { padding: 0; }
.public-property-grid { margin: 1rem 0; }
.property-card h2 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 .15rem; }
.listing-price { font-size: 1.15rem; font-weight: 800; color: var(--primary-dark); }
.listing-price span { font-size: .9rem; font-weight: 500; color: var(--muted); }
.empty-state { margin: 1.25rem 0; }
.public-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 1.25rem; align-items: start; }
.detail-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.detail-gallery .photo { border-radius: var(--radius); }
.detail-section { margin-top: 1rem; }
.detail-section h2, .detail-sidebar h2 { font-size: 1.2rem; margin: 0 0 .65rem; }
.detail-sidebar { position: sticky; top: calc(60px + 1rem); }
.detail-sidebar .card { margin-bottom: 1rem; }
.unit-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; margin-top: .75rem; }
.public-unit-type { padding: 1rem; }
.public-unit-type .facts { grid-template-columns: max-content 1fr; }
.unit-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; }
.unit-photo-grid .photo { border-radius: 7px; }
.detail-amenities, .chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-static { display: inline-block; padding: .2rem .6rem; border: 1px solid var(--border); border-radius: 99px; background: var(--bg); font-size: .86rem; }
.preserve-lines { white-space: pre-line; }
.contact-actions { align-self: center; }
.report-card form label { margin-top: .8rem; }

@media (max-width: 800px) {
    .public-detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
}
@media (max-width: 480px) {
    .nav { height: auto; min-height: 60px; padding-top: .5rem; padding-bottom: .5rem; flex-wrap: wrap; }
    .nav-links { gap: .5rem; flex-wrap: wrap; justify-content: flex-end; font-size: .88rem; }
    .nav-links .btn-small { padding: .3rem .6rem; }
    .detail-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .contact-actions { width: 100%; }
    .contact-actions .btn { flex: 1; text-align: center; }
}

/* ---- Step 6: property management ---- */
input[type="date"], input[type="month"], input[type="search"] {
    width: 100%;
    padding: .7rem .8rem;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    font: inherit;
    background: var(--surface-2);
}
input[type="date"]:focus, input[type="month"]:focus, input[type="search"]:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.management-stat-label { margin: 0; font-size: 1rem; }
.management-property-list { list-style: none; padding: 0; margin: 0; }
.management-property-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.management-property-list li:first-child { border-top: 0; }
.management-units { display: flex; flex-direction: column; gap: .75rem; }
.management-unit { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.unit-edit-form { align-items: end; margin-bottom: .5rem; }
.management-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.tenant-form-card { max-width: 620px; }
.tenant-avatar { display: flex; width: 46px; height: 46px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ok-bg); color: var(--primary-dark); font-size: 1.25rem; font-weight: 800; }
.tenant-list .admin-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
.tenant-list .admin-row h2, .arrears-list .admin-row h2 { font-size: 1.05rem; margin: 0; }
.tenant-list .admin-row p, .arrears-list .admin-row p { margin: .2rem 0; overflow-wrap: anywhere; }
.balance-summary { display: flex; flex-direction: column; text-align: right; }
.balance-summary strong { font-size: 1.55rem; }
.table-scroll { width: 100%; overflow-x: auto; }
.management-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.management-table th, .management-table td { padding: .65rem .55rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.management-table th { font-size: .9rem; background: var(--bg); white-space: nowrap; }
.management-table td { overflow-wrap: anywhere; }
.table-actions { align-items: flex-start; }
.table-actions > details, .table-actions > form, .table-actions > a { min-width: 0; max-width: 100%; }
.table-note { display: block; font-size: .85rem; }
.voided-row { color: var(--muted); text-decoration: line-through; }
.voided-row .badge, .voided-row button, .voided-row a { text-decoration: none; }
.inline-details { margin-top: .35rem !important; }
.inline-details form { min-width: 220px; padding: .5rem 0; }
.inline-details textarea { min-height: 70px; }
.rent-month-form { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.rent-month-form label { margin: 0; }
.rent-month-form input { max-width: 220px; }
.arrears-filters { align-items: end; margin-bottom: 1rem; }
.arrears-filters label { margin-top: 0; }
.arrears-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.move-out-card { margin: 1rem 0; }
.move-out-card .field-row { align-items: end; }
.move-out-card input { max-width: 240px; }

@media (max-width: 760px) {
    .management-two-column { grid-template-columns: 1fr; }
    .table-actions { flex-direction: column; align-items: stretch; }
    .balance-summary { text-align: left; }
    .tenant-list .admin-row { grid-template-columns: 46px minmax(0, 1fr); }
    .tenant-list .admin-row-action { grid-column: 2; text-align: left; }
    .arrears-list .admin-row { grid-template-columns: 46px minmax(0, 1fr); }
    .arrears-actions { grid-column: 2; align-items: flex-start; }
    .management-property-list li { align-items: flex-start; }
}
@media (max-width: 480px) {
    .management-unit { padding: .75rem; }
    .unit-edit-form { grid-template-columns: 1fr; }
    .management-table { min-width: 620px; }
    .rent-month-form { align-items: stretch; }
    .rent-month-form input { max-width: none; }
}
/* ---- Step 5: billing and payments ---- */
.bill-list { display: flex; flex-direction: column; }
.bill-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .75rem 0; border-top: 1px solid var(--border); }
.bill-list .bill-row:first-child, .card > .bill-row:first-of-type { border-top: 0; padding-top: 0; }
.bill-row p { margin: .2rem 0; }
.pay-card { max-width: 520px; margin-left: auto; margin-right: auto; }
.plans { border: 0; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .6rem; }
.plans legend { font-weight: 700; padding: 0; margin-bottom: .4rem; }
.plan { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); margin: 0; font-weight: 400; }
.plan:has(input:checked) { border-color: var(--primary); }
.plan input { width: auto; margin: 0; }
.plan-body { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; flex: 1; }
.plan-price { margin-left: auto; font-weight: 800; }
.spinner { width: 34px; height: 34px; margin: 1rem auto; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fake-box { margin-top: 1rem; text-align: left; border-style: dashed; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* Homepage */
.home-hero {
    width: 100%;
    padding: clamp(2.5rem, 6vw, 5rem) 0;
    background: linear-gradient(125deg, var(--info-bg), transparent 70%);
}
.home-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3.5rem);
}
.home-hero-copy { min-width: 0; }
.home-hero-copy h1 { max-width: 12ch; font-size: clamp(2.4rem, 4.5vw, 4rem); line-height: 1.08; }
.home-eyebrow { margin: 0 0 .45rem; color: var(--primary-dark); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.home-promise { max-width: 38rem; margin: 0; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.2rem); }
.home-trust-line { margin: 1rem 0 0; color: var(--muted); font-size: .92rem; }
.home-search { min-width: 0; padding: clamp(1rem, 2.5vw, 1.5rem); }
.home-search h2 { margin: 0 0 .25rem; }
.home-search .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.home-search .field-row > div { min-width: 0; }
.home-search label { margin-top: .65rem; }
.home-search .btn-block { margin-top: 1.25rem; }
.home-skyline { max-width: 550px; margin: 1rem 0 0; opacity: .9; }
.home-skyline svg { width: 100%; height: auto; }
.home-section { padding-top: clamp(2.75rem, 5vw, 4.5rem); padding-bottom: clamp(2.75rem, 5vw, 4.5rem); }
.home-section-heading { max-width: 720px; margin-bottom: 1.25rem; }
.home-section-heading h2, .home-management-grid h2, .home-final-cta h2 { margin: 0 0 .45rem; font-size: clamp(1.65rem, 3vw, 2.25rem); }
.home-section-heading > p:last-child { margin-bottom: 0; }
.home-section-heading-row { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .8rem 1.25rem; max-width: none; }
.home-track-grid, .home-pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.home-track { height: 100%; }
.home-track h3 { font-size: 1.15rem; }
.home-steps { display: grid; gap: .8rem; margin: 1rem 0 0; padding: 0; list-style: none; counter-reset: home-step; }
.home-steps li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); align-items: start; gap: .6rem; counter-increment: home-step; }
.home-steps li::before { content: counter(home-step, decimal-leading-zero); display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; background: var(--accent-bg); color: var(--accent-text); font-size: .8rem; font-weight: 800; }
.home-featured-grid { margin-top: 0; }
.home-property-card { min-width: 0; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.home-property-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 12px 28px -20px var(--text); }
.home-listing-location { margin: 0 0 .2rem !important; color: var(--primary-dark); font-size: .82rem; font-weight: 700; }
.home-property-card .property-card-body h3 { font-size: 1.15rem; }
.home-property-card .muted { overflow-wrap: anywhere; }
.home-empty-state { margin: 0; }
.home-empty-state h3 { margin-bottom: .35rem; }
.home-empty-state p { margin: 0 0 .9rem; }
.home-benefit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.home-benefit { padding: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: transform .18s ease, border-color .18s ease; }
.home-benefit:hover { transform: translateY(-2px); border-color: var(--accent); }
.home-benefit-mark { display: grid; width: 2.4rem; height: 2.4rem; margin-bottom: .8rem; place-items: center; border-radius: 50%; background: var(--ok-bg); color: var(--ok-text); font-size: 1.2rem; font-weight: 800; }
.home-benefit h3 { font-size: 1.05rem; }
.home-benefit p { margin: .35rem 0 0; color: var(--muted); }
.home-management-band { padding: clamp(2.5rem, 5vw, 4rem) 0; background: var(--info-bg); }
.home-management-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(240px, .9fr); align-items: center; gap: 2rem; }
.home-management-grid > div { max-width: 42rem; }
.home-management-grid p:not(.home-eyebrow) { color: var(--muted); }
.home-feature-list, .home-trust-list { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.home-feature-list li, .home-trust-list li { position: relative; padding-left: 1.7rem; }
.home-feature-list li::before, .home-trust-list li::before { content: "✓"; position: absolute; left: 0; color: var(--ok-text); font-weight: 900; }
.home-pricing-grid { align-items: stretch; }
.home-pricing-card h3 { margin-bottom: .75rem; }
.home-pricing-card dl { display: grid; gap: .55rem; margin: 0; }
.home-pricing-card dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding-top: .55rem; border-top: 1px solid var(--border); }
.home-pricing-card dt { color: var(--muted); }
.home-pricing-card dd { margin: 0; font-weight: 800; text-align: right; }
.home-trial-note { margin: 1rem 0 0; padding: .85rem 1rem; border-radius: 8px; background: var(--accent-bg); color: var(--accent-text); }
.home-trust-panel { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; gap: 2rem; }
.home-trust-panel h2 { margin: 0; }
.home-trust-list { padding: 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.home-review-summary { color: var(--muted); }
.home-review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.home-review-card { min-width: 0; }
.home-review-card blockquote { margin: .55rem 0 1rem; overflow-wrap: anywhere; }
.home-review-card > p:last-child { margin-bottom: 0; }
.home-review-rating { color: var(--accent-text); font-weight: 800; }
.home-review-rating span { color: var(--accent-hover); }
.home-review-link { margin: 1rem 0 0; }
.home-faq-list { display: grid; gap: .6rem; }
.home-faq-list details { padding: .15rem 1rem; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.home-faq-list summary { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; font-weight: 700; }
.home-faq-list summary::-webkit-details-marker { display: none; }
.home-faq-list summary::after { content: "+"; flex: none; color: var(--primary); font-size: 1.3rem; }
.home-faq-list details[open] summary::after { content: "−"; }
.home-faq-list details p { margin: 0 0 1rem; color: var(--muted); }
.home-final-cta { padding: clamp(2rem, 4vw, 3.25rem) 0; background: var(--info-bg); }
.home-final-cta-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.25rem; }
.home-final-cta h2 { max-width: 24ch; }

/* Shared site footer */
.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 2.5rem 0 1rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: .92rem;
}
.footer-grid { display: grid; grid-template-columns: minmax(180px, 1.35fr) repeat(3, minmax(120px, .8fr)) minmax(165px, 1fr); gap: 1.5rem; }
.footer-brand, .footer-column { min-width: 0; }
.footer-brand-link { display: inline-flex; align-items: center; gap: .45rem; color: var(--primary); }
.footer-brand-link .brand-mark { width: 30px; height: 30px; }
.footer-brand > p { max-width: 18rem; margin: .7rem 0 0; }
.footer-heading { margin: .2rem 0 .65rem; color: var(--text); font-size: 1rem; }
.footer-link-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; overflow-wrap: anywhere; }
.footer-link-list a, .footer-links a, .footer-bottom a { color: var(--primary); text-decoration: none; }
.footer-link-list a:hover, .footer-links a:hover, .footer-bottom a:hover { text-decoration: underline; text-underline-offset: .15em; }
.footer-contact p { margin: 0; }
.footer-bottom, .footer-compact-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1.25rem; margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.footer-copyright { margin: 0; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
.site-footer-compact { padding: 1rem 0; }
.site-footer-compact .footer-compact-row { margin-top: 0; padding-top: 0; border-top: 0; }

@media (max-width: 900px) {
    .home-benefit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
    .footer-brand > p { max-width: 38rem; }
}
@media (max-width: 680px) {
    .home-hero-grid, .home-management-grid, .home-trust-panel { grid-template-columns: minmax(0, 1fr); }
    .home-hero-grid { gap: 1.5rem; }
    .home-skyline { max-width: 440px; margin-inline: auto; }
    .home-search .field-row { grid-template-columns: minmax(0, 1fr); }
    .home-track-grid, .home-pricing-grid, .home-review-grid { grid-template-columns: minmax(0, 1fr); }
    .home-benefit-grid { grid-template-columns: minmax(0, 1fr); }
    .home-final-cta-inner { align-items: flex-start; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 1rem; }
    .footer-brand, .footer-contact { grid-column: 1 / -1; }
    .footer-bottom, .footer-compact-row { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .home-property-card, .home-benefit { transition: none; }
    .home-property-card:hover, .home-benefit:hover { transform: none; }
}