:root {
    --ink: #18212f;
    --muted: #5c6878;
    --brand: #155e75;
    --brand-dark: #0e4557;
    --surface: #ffffff;
    --soft: #f1f5f4;
    --line: #d6dfdf;
    --danger: #a61b1b;
    --success: #166534;
    --warning: #854d0e;
    --radius: 0.75rem;
    --shadow: 0 12px 35px rgb(15 23 42 / 8%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f8faf9;
    line-height: 1.55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
a { color: var(--brand); text-underline-offset: 0.2em; }
a:hover { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
img { max-width: 100%; }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -5rem;
    z-index: 20;
    padding: 0.75rem 1rem;
    background: var(--ink);
    color: white;
}
.skip-link:focus { top: 1rem; }
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem max(1rem, calc((100vw - 72rem) / 2));
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.site-header nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--ink); font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.brand img { width: 2.25rem; height: 2.25rem; flex: none; }
.container { width: min(72rem, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 5rem; }
.site-footer { padding: 2rem max(1rem, calc((100vw - 72rem) / 2)); background: var(--ink); color: white; }
.site-footer a { color: #a5f3fc; }
.hero { padding: 2rem 0 2.5rem; max-width: 48rem; }
.hero.compact { padding: 1rem 0; }
.hero h1, .page-heading h1 { font-size: clamp(2rem, 6vw, 3.5rem); line-height: 1.05; margin: 0.25rem 0 1rem; letter-spacing: -0.035em; }
.hero.compact h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.hero p:last-child { color: var(--muted); font-size: 1.1rem; }
.eyebrow { color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; font-size: 0.76rem; margin: 0; }
.card-grid { display: grid; gap: 1rem; }
.property-card, .admin-panel, .auth-card, .detail-section {
    padding: clamp(1.1rem, 4vw, 2rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.property-card { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; }
.property-card h2 { margin: 0.25rem 0; }
.property-address { color: var(--muted); margin: 0.35rem 0 1rem; }
.property-address strong { color: var(--ink); }
.property-photo-frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 0.2rem);
    background: var(--soft);
}
.property-photo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.property-photo-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    padding: 1rem;
    color: var(--muted);
    background:
        linear-gradient(135deg, transparent 48%, rgb(92 104 120 / 8%) 49%, rgb(92 104 120 / 8%) 51%, transparent 52%),
        var(--soft);
    font-weight: 700;
    text-align: center;
}
.property-photo-detail { max-width: 56rem; margin-bottom: 1.5rem; }
.photo-editor { display: grid; gap: 1rem; }
.admin-photo-preview { max-width: 32rem; }
.admin-property-grid { display: grid; gap: 1rem; margin-top: 1.5rem; }
.admin-property-grid .admin-panel { box-shadow: none; }
.property-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.property-card-heading h2 { margin: 0.25rem 0; }
.property-statuses { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.property-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 0; }
.property-facts.large { margin: 1.5rem 0; max-width: 42rem; }
.property-facts div { padding: 0.75rem; background: var(--soft); border-radius: 0.5rem; }
dt { font-weight: 700; color: var(--muted); font-size: 0.82rem; }
dd { margin: 0.2rem 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 2.75rem;
    border: 1px solid var(--brand);
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--brand);
    color: white;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: var(--brand-dark); color: white; }
.button-secondary { background: white; color: var(--brand); }
.button-secondary:hover { background: var(--soft); color: var(--brand-dark); }
.button-danger { border-color: var(--danger); background: var(--danger); }
.button-small { min-height: 2.25rem; padding: 0.45rem 0.75rem; }
.button-large { min-height: 3.25rem; padding-inline: 1.4rem; }
.link-button { border: 0; padding: 0; background: none; color: var(--brand); text-decoration: underline; cursor: pointer; }
.danger { color: var(--danger); }
.inline-form { display: inline; }
.notice, .error-summary {
    padding: 1rem 1.2rem;
    margin: 1rem 0 1.5rem;
    border-left: 0.3rem solid var(--brand);
    border-radius: 0.35rem;
    background: #ecfeff;
}
.notice.warning { border-color: var(--warning); background: #fffbeb; }
.notice.success { border-color: var(--success); background: #f0fdf4; }
.notice.error, .error-summary { border-color: var(--danger); background: #fef2f2; }
.reference { font-family: ui-monospace, monospace; overflow-wrap: anywhere; font-weight: 700; }
.empty-state { padding: 3rem 1rem; text-align: center; background: var(--soft); border-radius: var(--radius); }
.application-form { display: grid; gap: 1.25rem; margin-top: 2rem; }
.wizard-step { display: grid; gap: 1.25rem; }
.js .wizard-step[hidden], .wizard-header[hidden] { display: none; }
.wizard-header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: grid;
    gap: 0.65rem;
    padding: max(0.8rem, env(safe-area-inset-top)) 1rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgb(255 255 255 / 96%);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}
.wizard-header h2 { margin: 0; font-size: 1.2rem; }
.wizard-count { margin: 0; color: var(--brand); font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.wizard-header progress { width: 100%; height: 0.65rem; accent-color: var(--brand); }
.wizard-controls { display: none; }
.js .wizard-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: flex-end; }
.required-legend { margin: 0; font-weight: 700; }
.required-marker { color: var(--danger); font-weight: 900; }
.conditional-note { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.conditional-inactive { opacity: 0.65; }
fieldset { min-width: 0; margin: 0; padding: clamp(1rem, 4vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: white; }
legend { padding: 0 0.5rem; font-size: 1.3rem; font-weight: 800; }
.form-grid { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.field label, .label, .property-picker label { font-weight: 720; }
.field label:has(input) { display: grid; gap: 0.35rem; }
input, select, textarea {
    width: 100%;
    min-height: 2.8rem;
    border: 1px solid #8b99a8;
    border-radius: 0.4rem;
    padding: 0.65rem 0.75rem;
    background: white;
    color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 3px solid #67e8f9;
    outline-offset: 2px;
}
[aria-invalid="true"] { border-color: var(--danger); }
.hint, .muted { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0; }
.field-error { color: var(--danger); font-weight: 700; margin: 0; font-size: 0.9rem; }
.choice { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0.4rem 1rem 0.4rem 0; font-weight: 500; }
.choice input, .consent input { width: 1.2rem; min-height: 1.2rem; accent-color: var(--brand); }
.consent { display: flex; align-items: flex-start; gap: 0.7rem; font-weight: 650; margin: 1rem 0; }
.repeat-card { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--soft); }
.adult-card:first-child { border-color: var(--brand); }
.repeat-heading, .page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.repeat-heading h3 { margin: 0; }
[data-add-row], [data-remove-row] { display: none; }
.js [data-add-row], .js [data-remove-row] { display: inline-flex; }
.info-disclosure { margin-top: 1rem; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 0.5rem; }
.info-disclosure summary { color: var(--brand); font-weight: 800; cursor: pointer; }
.info-disclosure .prose { margin-top: 0.75rem; white-space: pre-line; }
.upload-notice { margin-bottom: 1rem; }
.file-list { display: grid; gap: 0.4rem; margin: 0; padding-left: 1.25rem; }
.file-list li { overflow-wrap: anywhere; }
.review-summary { display: grid; gap: 1rem; }
.review-card { padding: 1rem; border: 1px solid var(--line); border-radius: 0.5rem; }
.review-card h3 { margin: 0; }
.review-grid { display: grid; gap: 0.75rem; margin: 1rem 0 0; }
.review-grid div { min-width: 0; }
.review-grid dd { overflow-wrap: anywhere; }
.js .no-js-review { display: none; }
.submit-row { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; padding: 1.5rem; background: var(--ink); color: white; border-radius: var(--radius); }
.auth-card { max-width: 30rem; margin: 3rem auto; }
.auth-card h1 { margin-top: 0.25rem; }
.status-tabs { display: flex; gap: 0.5rem; margin: 1.5rem 0; overflow-x: auto; padding-bottom: 0.25rem; }
.status-tabs a { white-space: nowrap; padding: 0.55rem 0.8rem; border-radius: 99rem; background: var(--soft); text-decoration: none; font-weight: 700; }
.status-tabs a[aria-current="page"] { color: white; background: var(--brand); }
.status-tabs span { opacity: 0.8; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 99rem; background: #e2e8f0; font-size: 0.82rem; font-weight: 750; }
.status-new { background: #dbeafe; color: #1e40af; }
.status-reviewing { background: #fef3c7; color: #854d0e; }
.status-approved { background: #dcfce7; color: #166534; }
.status-denied { background: #fee2e2; color: #991b1b; }
.status-form, .property-picker { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; }
.status-form select, .property-picker select { width: auto; min-width: 12rem; }
.detail-section { margin: 1rem 0; box-shadow: none; }
.detail-grid { display: grid; gap: 1rem; }
.detail-grid div { break-inside: avoid; }
.detail-grid dd { overflow-wrap: anywhere; }
.repeat-detail { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.repeat-detail:last-child { border: 0; }
.audit-timeline { display: grid; gap: 1rem; padding-left: 1.5rem; }
.audit-timeline > li { padding: 1rem; border-left: 0.25rem solid var(--brand); background: var(--soft); }
.audit-timeline h3 { margin: 0; }
.audit-changes { display: grid; gap: 0.75rem; }
.audit-changes div { padding-top: 0.75rem; border-top: 1px solid var(--line); }
.audit-changes dd { margin-left: 0; overflow-wrap: anywhere; }
.danger-zone { margin: 2rem 0; padding: 1rem; border: 1px solid #fca5a5; border-radius: var(--radius); background: #fff7f7; }
.danger-zone summary { color: var(--danger); font-weight: 800; cursor: pointer; }
.lease-layout { display: grid; gap: 1.5rem; margin-top: 2rem; }
.toc { align-self: start; padding: 1rem; background: var(--soft); border-radius: var(--radius); }
.toc h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.toc nav { display: grid; gap: 0.35rem; }
.lease-sections { display: grid; gap: 1rem; }
.lease-sections article { scroll-margin-top: 1rem; padding: clamp(1rem, 4vw, 2rem); background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.lease-sections h2 { margin-top: 0; }
.prose { white-space: normal; overflow-wrap: anywhere; }
.back-link { font-size: 0.9rem; }
.listing-links { margin-top: 1.5rem; padding: 1rem 1.25rem; background: var(--soft); border-radius: var(--radius); }
.listing-links h2 { margin: 0; font-size: 1.15rem; }
.listing-links ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0.75rem 0 0; padding-left: 1.2rem; }
.user-security { margin-top: 1.5rem; box-shadow: none; }
.user-security h2 { margin-top: 0; }
.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; }
.print-header { margin: 1rem 0; }
.lease-document { max-width: 8.5in; margin: 1.5rem auto; padding: clamp(1.25rem, 4vw, 3rem); background: white; border: 1px solid var(--line); box-shadow: var(--shadow); }
.lease-document > header { text-align: center; }
.lease-document > header p { text-align: left; }
.lease-document h1 { font-family: Georgia, serif; font-size: 2rem; }
.lease-document h2 { margin-top: 1.5rem; font-family: Georgia, serif; font-size: 1.15rem; }
.lease-document p { line-height: 1.65; }
.lease-document address { margin: 1rem 0; font-style: normal; font-weight: 700; line-height: 1.5; }
.lease-term { break-inside: avoid; }
.lease-signatures { break-inside: avoid; margin-top: 2rem; }
.signature-line { display: grid; grid-template-columns: minmax(0, 1fr) 8rem; gap: 2rem; margin-top: 3rem; }
.signature-line span { padding-top: 0.35rem; border-top: 1px solid #111827; }

@media (min-width: 44rem) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wizard-header { grid-template-columns: minmax(0, 1fr) minmax(14rem, 24rem); align-items: center; }
    .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-2 { grid-column: span 2; }
    .submit-row { flex-direction: row; align-items: center; gap: 1rem; }
    .lease-layout { grid-template-columns: 16rem minmax(0, 1fr); }
    .photo-editor { grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 1fr); align-items: start; }
    .toc { position: sticky; top: 1rem; }
}

@media (max-width: 43.99rem) {
    .user-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .user-table, .user-table tbody, .user-table tr, .user-table td { display: block; width: 100%; }
    .user-table tr { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
    .user-table tr:last-child { border-bottom: 0; }
    .user-table td { display: grid; grid-template-columns: minmax(6rem, 0.4fr) minmax(0, 1fr); gap: 0.75rem; padding: 0.45rem 0; border: 0; overflow-wrap: anywhere; }
    .user-table td::before { content: attr(data-label); color: var(--muted); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
}

@media print {
    @page { margin: 0.65in; }
    :root { background: white; font-size: 10pt; }
    .site-header, .site-footer, .print-hide, .danger-zone, script { display: none !important; }
    .container { width: 100%; padding: 0; }
    .detail-section { padding: 0.6rem 0; border: 0; box-shadow: none; break-inside: avoid; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .print-header { border-bottom: 2px solid #000; }
    .lease-document { max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
    .lease-document h1 { font-size: 18pt; }
    .lease-document h2 { font-size: 11pt; }
    .lease-document p { line-height: 1.45; }
    a { color: black; text-decoration: none; }
}
