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

:root {
    --navy: #17202A;
    --green: #3E6B5B;
    --pale-green: #EAF1ED;
    --cream: #F7F5F1;
    --white: #FFFFFF;
    --gray: #6B7280;
    --light-gray: #E5E7EB;
    --text: #20252B;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overscroll-behavior: none;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--cream);
    color: var(--text);
}

button,
a {
    font-family: inherit;
}

.brand-home-link {
    color: inherit;
    text-decoration: none;
}

.app {
    height: 100vh;
    display: flex;
    overflow: hidden;
    min-height: 0;
    overscroll-behavior: none;
    overflow-x: hidden;
}


/* LICENSE ACTIVATION GATE */
body.license-locked { overflow: hidden; }
body.license-locked .app { visibility: hidden; pointer-events: none; }
.activation-gate { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--cream); overflow-y: auto; }
.activation-card { width: min(460px, 100%); padding: 46px 42px 38px; background: var(--white); border: 1px solid rgba(23,32,42,.08); border-radius: 20px; box-shadow: 0 28px 80px rgba(23,32,42,.10); text-align: center; }
.activation-logo { width: 56px; height: 56px; display: block; margin: 0 auto 22px; border-radius: 14px; }
.activation-eyebrow { color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.8px; margin-bottom: 10px; }
.activation-card h1 { color: var(--navy); font-size: clamp(30px,5vw,42px); line-height: 1.1; margin-bottom: 12px; }
.activation-intro { color: var(--gray); font-size: 15px; line-height: 1.6; margin-bottom: 28px; }
.activation-card form { text-align: left; }
.activation-card form > label { display: block; color: var(--navy); font-size: 12px; font-weight: 600; margin: 0 0 7px; }
.activation-card form > input { width: 100%; min-height: 48px; padding: 0 14px; margin-bottom: 18px; border: 1px solid var(--light-gray); border-radius: 10px; background: #fff; color: var(--text); font: inherit; outline: none; }
.activation-card form > input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(62,107,91,.10); }
.activation-card form > input:first-of-type { font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; letter-spacing: .4px; }
.activation-button { width: 100%; min-height: 50px; margin-top: 4px; border: 0; border-radius: 10px; background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: opacity .15s ease,transform .15s ease; }
.activation-button:hover:not(:disabled) { opacity: .92; }
.activation-button:active:not(:disabled) { transform: translateY(1px); }
.activation-button:disabled { opacity: .55; cursor: wait; }
.activation-error { margin-top: 14px; padding: 11px 12px; border-radius: 9px; background: #f9eaea; color: #8a3030; font-size: 13px; line-height: 1.5; }
.activation-purchase { display: flex; justify-content: center; gap: 5px; margin-top: 22px; color: var(--gray); font-size: 13px; }
.activation-purchase a { color: var(--navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.activation-language { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 26px; color: var(--gray); font-size: 12px; }
.activation-language select { min-height: 34px; padding: 0 8px; border: 1px solid var(--light-gray); border-radius: 7px; background: #fff; color: var(--text); font: inherit; font-size: 12px; }
.activation-gate.hidden { display: none; }
@media (max-width:520px) { .activation-gate { padding:16px; align-items:flex-start; } .activation-card { margin:auto 0; padding:36px 24px 30px; border-radius:16px; } }


/* SIDEBAR */

.sidebar {
    width: 250px;
    height: 100vh;
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--light-gray);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    margin-bottom: 45px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: block;
    object-fit: cover;
    border-radius: 10px;
    flex: 0 0 38px;
}

.brand-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--gray);
    margin-top: 3px;
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    text-decoration: none;
    color: var(--gray);
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;

    padding: 12px 13px;
    border-radius: 8px;

    font-size: 14px;
    font-weight: 500;

    transition: 0.15s ease;
}

.nav-item:hover {
    background: #F5F6F5;
    color: var(--text);
}

.nav-item.active {
    background: var(--pale-green);
    color: var(--green);
    font-weight: 600;
}

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-divider {
    height: 1px;
    background: var(--light-gray);
    margin-bottom: 18px;
}

.sidebar-button {
    width: 100%;
    border: none;
    background: var(--navy);
    color: white;

    padding: 11px 12px;
    border-radius: 7px;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
    margin-bottom: 8px;
}

.sidebar-button.secondary {
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--light-gray);
}


/* MAIN */

.main {
    flex: 1;
    min-width: 0;
    height: 100vh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-x: hidden;
    padding: 50px 60px;
    max-width: 1500px;
}

.topbar {
    margin-bottom: 35px;
}

.eyebrow,
.card-eyebrow,
.property-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--green);
}

h1 {
    font-size: 31px;
    letter-spacing: -0.8px;
    margin-top: 7px;
}

.intro {
    color: var(--gray);
    font-size: 14px;
    margin-top: 8px;
}


/* PROPERTY */

.property-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 14px;

    display: flex;
    overflow: hidden;

    margin-bottom: 20px;
}

.property-image {
    width: 42%;
    flex: 0 0 42%;
    height: 280px;
    min-height: 280px;
    max-width: 42%;
}

.image-placeholder {
    height: 100%;
    min-height: 280px;

    background: #E6E4DE;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #8A8A84;
    font-size: 13px;
}

.property-info {
    padding: 35px 40px;
    flex: 1 1 auto;
    min-width: 0;
}

.property-info h2 {
    font-size: 18px;
    margin-top: 7px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.property-address {
    color: var(--gray);
    font-size: 14px;
    margin-top: 6px;
}

.property-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;

    margin-top: 55px;
}

.property-details span {
    display: block;
    font-size: 9px;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 6px;
}

.property-details strong {
    font-size: 14px;
}

/* Room count & features use the full width of the property details area. */
#dashboard-room-layout-wrapper {
    grid-column: 1 / -1;
    min-width: 0;
}

#dashboard-room-layout-wrapper strong {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
}


/* STATS */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;

    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 11px;

    padding: 22px;
}

.stat-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--gray);

    margin-bottom: 13px;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    font-weight: 600;
}

.stat-description {
    display: block;
    font-size: 11px;
    color: var(--gray);
    margin-top: 3px;
}


/* LOWER */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ==========================================
   DASHBOARD — RECENT ACTIVITY & TIMELINE
========================================== */

#recent-activity {
    border-top: none;
    padding-top: 10px;
    text-align: left;
    min-height: 150px;

    display: flex;
    align-items: flex-start;
}

.dashboard-latest-event {
    width: 100%;
}

.dashboard-latest-event-label {
    color: var(--green);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.4px;
    margin-bottom: 12px;
}

.dashboard-latest-event-name {
    color: var(--text);
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.dashboard-latest-event-date {
    color: var(--gray);
    font-size: 12px;
    margin-top: 8px;
}


#dashboard-timeline {
    border-top: none;
    padding: 10px 0 0;
    min-height: 150px;

    display: flex;
    align-items: flex-start;
}

.dashboard-timeline-summary {
    width: 100%;
}

.dashboard-timeline-years {
    color: var(--text);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.6px;
    line-height: 1.2;
}

.dashboard-timeline-count {
    color: var(--gray);
    font-size: 12px;
    margin-top: 10px;
}

.content-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 11px;
    min-height: 260px;
    padding: 25px;
}

.card-header {
    margin-bottom: 12px;
}

.card-header h3 {
    font-size: 17px;
    margin-top: 5px;
}

.empty-state {
    border-top: 1px solid var(--light-gray);
    padding-top: 35px;
    text-align: center;
}

.empty-icon {
    width: 35px;
    height: 35px;
    margin: 0 auto 12px;

    border: 1px solid var(--light-gray);
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--green);
}

.empty-state h4 {
    font-size: 14px;
}

.empty-state p {
    max-width: 300px;
    margin: 8px auto;
    font-size: 12px;
    line-height: 1.6;
    color: var(--gray);
}

#recent-activity,
#dashboard-timeline {
    min-height: 190px;
}

/* TIMELINE */

.timeline-empty {
    position: relative;
    border-top: 1px solid var(--light-gray);
    padding-top: 30px;
    padding-left: 20px;
}

.timeline-line {
    position: absolute;
    left: 4px;
    top: 32px;
    bottom: 0;

    width: 1px;
    background: var(--light-gray);
}

.timeline-content {
    font-size: 13px;
}

.timeline-content p {
    color: var(--gray);
    font-size: 12px;
    line-height: 1.6;
    margin-top: 7px;
}


/* FOOTER */

.footer {
    display: flex;
    justify-content: space-between;

    margin-top: 40px;
    padding-top: 20px;

    border-top: 1px solid var(--light-gray);

    color: var(--gray);
    font-size: 10px;
    letter-spacing: 0.4px;
}


/* MOBILE */

@media (max-width: 800px) {

    .app {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        padding: 18px;
    }

    .brand {
        margin-bottom: 20px;
    }

    .navigation {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar-bottom {
        margin-top: 20px;
    }

    .main {
        padding: 30px 18px;
    }

    h1 {
        font-size: 25px;
    }

    .property-card {
        display: block;
    }

    .property-image {
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
        height: 280px;
    }

    .property-details {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 35px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

.dashboard-latest-event-name {
    font-size: 22px;
}

.property-info h2 {
    font-size: 21px;
}

.dashboard-timeline-years {
    font-size: 27px;
}

    .footer {
        flex-direction: column;
        gap: 8px;
    }
}
/* PAGE NAVIGATION */

.hidden {
    display: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.form-card {
    max-width: 900px;
}

.form-card h3 {
    margin-bottom: 25px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.form-grid-full {
    grid-column: 1 / -1;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 8px;

    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
}

.form-grid input,
.form-grid select {
    width: 100%;
    border: 1px solid var(--light-gray);
    border-radius: 7px;

    padding: 12px;

    background: white;
    color: var(--text);

    font-family: inherit;
    font-size: 13px;

    outline: none;
}

.form-grid input:focus,
.form-grid select:focus {
    border-color: var(--green);
}

.primary-action {
    border: none;
    background: var(--navy);
    color: white;

    padding: 11px 16px;

    border-radius: 7px;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}
.timeline-back-button {
    border: none;
    background: transparent;
    color: var(--gray);

    padding: 0;

    font-family: inherit;
    font-size: 12px;
    font-weight: 500;

    cursor: pointer;
}


.timeline-back-button:hover {
    color: var(--text);
}

.renovation-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timeline-page-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.form-card .primary-action {
    margin-top: 28px;
}


/* Make navigation buttons look like links */

.nav-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}


/* Mobile form */

@media (max-width: 800px) {

    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
    }

    .page-header > div {
        min-width: 0;
    }

    .page-header .primary-action {
        flex-shrink: 0;
        margin-top: 0;
    }

    #renovations .renovation-header-actions {
        margin-right: 0;
        padding-right: 0;
    }

}
/* LANGUAGE */

.language-selector {
    margin-bottom: 18px;
}

.language-selector label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 7px;
}

.language-selector select {
    width: 100%;
    padding: 9px 10px;

    border: 1px solid var(--light-gray);
    border-radius: 7px;

    background: white;
    color: var(--text);

    font-size: 11px;
    font-family: inherit;
}


/* PROPERTY PHOTO */

.photo-upload-field {
    grid-column: 1 / -1;
}

.photo-upload-field input {
    padding: 10px !important;
}

.photo-upload-field small {
    font-size: 10px;
    color: var(--gray);
    font-weight: 400;
    line-height: 1.5;
}
/* ==========================================
   RENOVATION FORM
========================================== */

.renovation-form {
    margin-bottom: 20px;
}

.form-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}

.form-card-header h3 {
    font-size: 18px;
    margin-top: 5px;
}

.close-button {
    border: none;
    background: transparent;
    color: var(--gray);

    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    padding: 0 4px;
}

.close-button:hover {
    color: var(--text);
}

.full-width-field {
    grid-column: 1 / -1;
}

.full-width-field textarea {
    width: 100%;

    border: 1px solid var(--light-gray);
    border-radius: 7px;

    padding: 12px;

    background: white;
    color: var(--text);

    font-family: inherit;
    font-size: 13px;

    resize: vertical;
    outline: none;
}

.full-width-field textarea:focus {
    border-color: var(--green);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 28px;
}

.secondary-action {
    border: 1px solid var(--light-gray);
    background: white;
    color: var(--gray);

    padding: 11px 16px;

    border-radius: 7px;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.secondary-action:hover {
    background: #F7F7F6;
}


/* ==========================================
   RENOVATION RECORD
========================================== */

.renovation-record {
    background: var(--white);

    border: 1px solid var(--light-gray);
    border-radius: 11px;

    padding: 25px;

    margin-bottom: 15px;
}

.renovation-record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 18px;
}

.renovation-record-title {
    font-size: 17px;
    font-weight: 600;
}

.renovation-record-date {
    color: var(--gray);
    font-size: 11px;
    margin-top: 5px;
}

.renovation-cost {
    font-size: 17px;
    font-weight: 600;
}

.renovation-record-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 20px;

    padding-top: 18px;

    border-top: 1px solid var(--light-gray);
}

.record-detail span {
    display: block;

    color: var(--gray);

    font-size: 9px;
    letter-spacing: 1px;

    margin-bottom: 6px;
}

.record-detail strong {
    font-size: 12px;
    font-weight: 500;
}

.renovation-description {
    color: var(--gray);

    font-size: 12px;
    line-height: 1.6;

    margin-top: 18px;
}

.record-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;

    margin-top: 18px;
}

.delete-record {
    border: none;
    background: transparent;

    color: var(--gray);

    font-size: 11px;

    cursor: pointer;
}

.delete-record:hover {
    color: #9A4A4A;
}


/* ==========================================
   PHOTO PREVIEW
========================================== */

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 10px;
}

.photo-preview-item {
    width: 65px;
    height: 65px;

    object-fit: cover;

    border-radius: 6px;
    border: 1px solid var(--light-gray);
}



/* ==========================================
   NEW FILE SELECTION PREVIEW
========================================== */

.new-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.new-file-preview-item {
    position: relative;
    width: 78px;
}

.new-file-preview-item img {
    display: block;
    width: 78px;
    height: 62px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--light-gray);
}

.new-file-preview-name {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 800px) {

    .renovation-record-details {
        grid-template-columns: 1fr 1fr;
    }

}

@media (max-width: 500px) {

    .renovation-record-details {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions button {
        width: 100%;
    }

}
/* ==========================================
   HOME BOOK — MINIMAL TIMELINE
   ========================================== */

.home-timeline {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
    padding: 40px 0 60px;
}


/* ------------------------------------------
   YEAR
   ------------------------------------------ */

.timeline-year {
    position: relative;
    margin-bottom: 72px;
}

.timeline-year:last-child {
    margin-bottom: 0;
}


.timeline-year-label {
    position: relative;
    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 86px;
    height: 86px;

    margin: 0 auto 48px;

    border-radius: 50%;

    background: var(--white, #ffffff);

    color: var(--navy, #172536);

    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.03em;
}


/* ------------------------------------------
   VERTICAL LINE
   ------------------------------------------ */

.timeline-events {
    position: relative;

    display: flex;
    flex-direction: column;

    gap: 0;

    padding: 0;
}


.timeline-events::before {
    content: "";

    position: absolute;

    top: -48px;
    bottom: 0;

    left: 50%;

    width: 1px;

    background: #d9dedb;

    transform: translateX(-50%);
}


/* ------------------------------------------
   EVENT
   ------------------------------------------ */

.timeline-event {
    position: relative;

    display: grid;
    grid-template-columns: 1fr 28px 1fr;

    align-items: center;

    width: 100%;

    min-height: 72px;

    padding: 10px 0;

    border: 0;
    border-radius: 0;

    background: transparent;

    color: inherit;

    text-align: left;

    cursor: pointer;

    font-family: inherit;

    appearance: none;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}


/* ------------------------------------------
   MONTH + NAME
   ------------------------------------------ */

.timeline-event-month {
    grid-column: 1;

    justify-self: end;

    padding-right: 22px;

    color: #6f7975;

    font-size: 12px;
    font-weight: 500;

    letter-spacing: 0.04em;

    text-align: right;
}


.timeline-event-name {
    grid-column: 1;

    justify-self: end;

    max-width: 280px;

    padding-right: 22px;

    margin-top: 20px;

    color: var(--text, #172536);

    font-size: 15px;
    font-weight: 600;

    line-height: 1.35;

    text-align: right;
}


/* ------------------------------------------
   DOT
   ------------------------------------------ */

.timeline-event-dot {
    grid-column: 2;
    grid-row: 1 / span 2;

    justify-self: center;

    position: relative;
    z-index: 2;

    width: 9px;
    height: 9px;

    border: 2px solid #ffffff;

    border-radius: 50%;

    background: #8b9591;

    box-shadow: 0 0 0 1px #cdd3d0;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


/* ------------------------------------------
   ALTERNATING SIDES
   ------------------------------------------ */

.timeline-event:nth-child(even) {
    direction: rtl;
}

.timeline-event:nth-child(even) .timeline-event-month,
.timeline-event:nth-child(even) .timeline-event-name {
    grid-column: 3;

    justify-self: start;

    padding-right: 0;
    padding-left: 22px;

    text-align: left;

    direction: ltr;
}


/* ------------------------------------------
   HOVER / FOCUS
   ------------------------------------------ */

.timeline-event:hover {
    background: rgba(4, 150, 102, 0.035);
}

.timeline-event:hover .timeline-event-dot {
    background: #049666;

    transform: scale(1.25);

    box-shadow:
        0 0 0 1px #049666,
        0 0 0 5px rgba(4, 150, 102, 0.08);
}


.timeline-event:focus-visible {
    outline: 2px solid #049666;
    outline-offset: 4px;
}


/* ------------------------------------------
   EMPTY STATE
   ------------------------------------------ */

.timeline-empty {
    padding: 70px 30px;

    text-align: center;

    color: #6f7975;
}


.timeline-empty-title {
    margin-bottom: 8px;

    color: var(--text, #172536);

    font-size: 16px;
    font-weight: 600;
}


.timeline-empty-text {
    max-width: 420px;

    margin: 0 auto;

    font-size: 14px;
    line-height: 1.6;
}


/* ------------------------------------------
   MOBILE
   ------------------------------------------ */

@media (max-width: 700px) {

    .home-timeline {
        padding: 30px 10px 50px;
    }


    .timeline-year {
        margin-bottom: 56px;
    }


    .timeline-year-label {
        width: 72px;
        height: 72px;

        margin-bottom: 38px;

        font-size: 21px;
    }


    .timeline-events::before {
        top: -38px;
    }


    .timeline-event {
        grid-template-columns: 1fr 24px 1fr;

        min-height: 64px;
    }


    .timeline-event-month {
        padding-right: 14px;

        font-size: 11px;
    }


    .timeline-event-name {
        max-width: 180px;

        padding-right: 14px;

        margin-top: 17px;

        font-size: 14px;
    }


    .timeline-event:nth-child(even) .timeline-event-month,
    .timeline-event:nth-child(even) .timeline-event-name {
        padding-left: 14px;
    }


    .timeline-event-dot {
        width: 8px;
        height: 8px;
    }

}

/* ==========================================
   DASHBOARD — INVESTMENT CARD
========================================== */

.stat-card:has(#total-investment) {
    grid-column: span 4;
}

/* ==========================================
   DASHBOARD — TIMELINE ALIGNMENT
========================================== */

#dashboard-timeline {
    justify-content: flex-start;
}

.dashboard-timeline-summary {
    text-align: center;
}

#recent-activity,
#dashboard-timeline {
    min-height: 150px;
    align-items: flex-start;
}

/* ==========================================
   MOBILE MENU DRAWER
========================================== */

.mobile-menu-overlay {
    display: none;
}


@media (max-width: 800px) {

    .sidebar {
        display: flex;

        position: fixed;

        top: 0;
        left: 0;

        width: 280px;
        height: 100vh;

        z-index: 300;

        transform: translateX(-100%);

        transition:
            transform 0.25s ease;

        box-shadow:
            12px 0 30px rgba(0, 0, 0, 0.08);
    }


    .sidebar.mobile-open {
        transform: translateX(0);
    }


    .mobile-menu-overlay {
        display: block;

        position: fixed;

        inset: 0;

        background: rgba(23, 32, 42, 0.35);

        z-index: 250;

        opacity: 0;

        pointer-events: none;

        transition:
            opacity 0.25s ease;
    }


    .mobile-menu-overlay.active {
        opacity: 1;

        pointer-events: auto;
    }

}

/* ==========================================
   MOBILE NAVIGATION
========================================== */

.mobile-topbar {
    display: none;
}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 800px) {

    .mobile-topbar {
        height: 64px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        padding: 0 18px;

        background: var(--white);
        border-bottom: 1px solid var(--light-gray);

        position: sticky;
        top: 0;
        z-index: 100;
    }


    .mobile-menu-button {
        width: 38px;
        height: 38px;

        border: none;
        background: transparent;

        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;

        gap: 5px;

        padding: 8px;

        cursor: pointer;
    }


    .mobile-menu-button span {
        display: block;

        width: 18px;
        height: 2px;

        background: var(--navy);

        border-radius: 2px;
    }


    .mobile-brand {
        display: flex;
        align-items: center;

        gap: 9px;
    }


    .mobile-brand-mark {
        width: 30px;
        height: 30px;
        display: block;
        object-fit: cover;
        border-radius: 8px;
        flex: 0 0 30px;
    }


    .mobile-brand-name {
        font-size: 11px;
        font-weight: 700;

        letter-spacing: 1.4px;

        color: var(--text);
    }


    .sidebar {
        display: none;
    }


    .main {
        width: 100%;
        max-width: none;

        height: calc(100vh - 64px);

        padding: 28px 18px;
    }

}

/* ==========================================
   MOBILE MENU — FINAL OVERRIDE
========================================== */

@media (max-width: 800px) {

    .sidebar {
        display: flex !important;

        position: fixed !important;

        top: 0 !important;
        left: 0 !important;

        width: 280px !important;
        height: 100vh !important;

        z-index: 400 !important;

        background: var(--white) !important;

        transform: translateX(-100%) !important;

        transition:
            transform 0.25s ease !important;

        overflow-y: auto !important;

        visibility: visible !important;
    }


    .sidebar.mobile-open {
        transform: translateX(0) !important;
    }


    .mobile-menu-overlay {
        display: block !important;

        position: fixed !important;

        inset: 0 !important;

        z-index: 300 !important;

        background: rgba(23, 32, 42, 0.35) !important;

        opacity: 0;

        pointer-events: none;

        transition:
            opacity 0.25s ease;
    }


    .mobile-menu-overlay.active {
        opacity: 1;

        pointer-events: auto;
    }

}

/* ==========================================
   MOBILE MENU — SINGLE COLUMN
========================================== */

@media (max-width: 800px) {

    .navigation {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }

}

/* ==========================================
   MOBILE — STATS 2 × 2
========================================== */

@media (max-width: 800px) {

    .stats {
        display: grid !important;
        width: 100% !important;
        max-width: 100% !important;

        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        gap: 15px !important;
    }

    .stat-card {
        width: 100% !important;
        min-width: 0 !important;
    }

}

/* ==========================================
   MOBILE — DASHBOARD EMPTY STATES
========================================== */

@media (max-width: 800px) {

    /* Recent Activity */

    #recent-activity {
        text-align: center;
        justify-content: center;
        align-items: center;
    }


    #recent-activity .empty-state {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 10px;
    }


    #recent-activity .empty-state h4 {
        margin: 0;
        max-width: 280px;
    }


    #recent-activity .empty-state p {
        margin: 0;
        max-width: 300px;
    }


    /* Home Timeline */

    #dashboard-timeline {
        text-align: center;
        justify-content: center;
        align-items: center;
    }


    #dashboard-timeline .empty-state {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 10px;
    }


    #dashboard-timeline .empty-state h4 {
        margin: 0;
        max-width: 300px;
    }


    #dashboard-timeline .empty-state p {
        margin: 0;
        max-width: 320px;
    }

}

/* ==========================================
   MOBILE — DASHBOARD STAT CARDS
========================================== */

@media (max-width: 800px) {

    .stats {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

        width: 100% !important;
        max-width: 100% !important;

        gap: 15px !important;
    }


    .stats .stat-card {
        width: 100% !important;
        min-width: 0 !important;
        grid-column: auto !important;
    }


    /* Total Investment — full width */

    .stats .stat-card:has(#total-investment) {
        grid-column: 1 / -1 !important;
    }

}

/* ==========================================
   MOBILE — DASHBOARD ACTIVITY
========================================== */

@media (max-width: 800px) {

    #recent-activity {
        display: flex !important;

        flex-direction: column !important;

        align-items: center !important;

        justify-content: flex-start !important;

        text-align: center !important;
    }


    #recent-activity .empty-state {
        width: 100% !important;

        display: flex !important;

        flex-direction: column !important;

        align-items: center !important;

        justify-content: center !important;

        text-align: center !important;

        margin-top: 30px !important;

        gap: 10px !important;
    }


    #recent-activity .empty-state h4 {
        margin: 0 !important;

        max-width: 280px !important;

        text-align: center !important;
    }


    #recent-activity .empty-state p {
        margin: 0 !important;

        max-width: 300px !important;

        text-align: center !important;
    }

}

/* ==========================================
   MOBILE — DASHBOARD TIMELINE EMPTY STATE
========================================== */

@media (max-width: 800px) {

    #dashboard-timeline {
        display: flex !important;

        flex-direction: column !important;

        align-items: center !important;

        justify-content: flex-start !important;

        text-align: center !important;
    }


    #dashboard-timeline .empty-state {
        width: 100% !important;

        display: flex !important;

        flex-direction: column !important;

        align-items: center !important;

        justify-content: center !important;

        text-align: center !important;

        margin-top: 30px !important;

        gap: 10px !important;
    }


    #dashboard-timeline .empty-state h4 {
        margin: 0 !important;

        max-width: 300px !important;

        text-align: center !important;
    }


    #dashboard-timeline .empty-state p {
        margin: 0 !important;

        max-width: 320px !important;

        text-align: center !important;
    }

}

/* ==========================================
   DASHBOARD — EMPTY ACTIVITY
========================================== */

#recent-activity:has(.empty-icon) {
    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    gap: 10px;

    min-height: 190px;

    padding: 30px;
}


#recent-activity:has(.empty-icon) h4 {
    margin: 0;

    text-align: center;
}


#recent-activity:has(.empty-icon) p {
    margin: 0 auto;

    max-width: 360px;

    text-align: center;
}

/* ==========================================
   DASHBOARD — EMPTY TIMELINE
========================================== */

#dashboard-timeline {
    padding: 30px 0 0 !important;
    text-align: center !important;
}


#dashboard-timeline .dashboard-timeline-empty {
    width: 100% !important;

    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;

    justify-content: center !important;

    text-align: center !important;

    margin: 0 !important;

    padding: 0 !important;

    gap: 0 !important;
}


#dashboard-timeline .dashboard-timeline-empty h4 {
    margin: 0 !important;

    color: var(--text) !important;

    font-family: inherit !important;

    font-size: 14px !important;

    font-weight: 600 !important;

    line-height: 1.4 !important;

    text-align: center !important;
}


#dashboard-timeline .dashboard-timeline-empty p {
    max-width: 360px !important;

    margin: 8px auto 0 !important;

    color: var(--gray) !important;

    font-family: inherit !important;

    font-size: 12px !important;

    font-weight: 400 !important;

    line-height: 1.6 !important;

    text-align: center !important;
}


#dashboard-timeline .dashboard-timeline-empty .empty-icon {
    margin: 0 auto 12px !important;
}

/* ==========================================
   DOCUMENT FILTERS
========================================== */

.document-filters {
    display: flex;
    align-items: center;
    gap: 4px;

    margin-bottom: 24px;
}


.document-filter {
    border: 1px solid transparent;

    background: transparent;

    color: var(--gray);

    padding: 8px 14px;

    border-radius: 7px;

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}


.document-filter:hover {
    background: #F1F3F1;

    color: var(--text);
}


.document-filter.active {
    background: var(--navy);

    color: white;

    border-color: var(--navy);
}


@media (max-width: 800px) {

    .document-filters {
        width: 100%;

        overflow-x: auto;

        gap: 4px;

        margin-bottom: 22px;

        padding-bottom: 2px;
    }


    .document-filter {
        flex-shrink: 0;

        padding: 8px 13px;

        font-size: 11px;
    }

}

/* ==========================================
   CUSTOM FILE INPUT
========================================== */

.custom-file-input {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 42px;
}

.custom-file-control {
    display: none;
}

.custom-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #D9DEDC;
    border-radius: 7px;
    background: #FFFFFF;
    color: var(--text);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.custom-file-button:hover {
    background: #F1F3F1;
    border-color: #C9D0CC;
}

.custom-file-name {
    min-width: 0;
    color: var(--gray);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
   PROPERTY PHOTO PREVIEW
========================================== */

.property-photo-preview {
    margin-top: 12px;
    width: 180px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #D9DEDC;
    background: #F1F3F1;
}

.property-photo-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* ==========================================
   UNSAVED CHANGES MODAL
========================================== */

#unsaved-changes-modal:not(.hidden) {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex !important;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.unsaved-changes-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(15, 27, 39, 0.35);
}

.unsaved-changes-dialog {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 440px;

    padding: 30px;

    background: #FFFFFF;
    border: 1px solid #D9DEDC;
    border-radius: 12px;

    box-shadow: 0 20px 60px rgba(15, 27, 39, 0.18);
}

.unsaved-changes-dialog h2 {
    margin: 8px 0 10px;
}

.unsaved-changes-dialog p {
    margin: 0;

    color: var(--gray);
    font-size: 13px;
    line-height: 1.6;
}

.unsaved-changes-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 26px;
}

.record-updated{margin-top:16px;color:var(--gray);font-size:10px;}
.edit-existing-files,.edit-existing-receipt{margin-top:24px;padding-top:18px;border-top:1px solid var(--light-gray);}
.edit-existing-files-title{margin-bottom:10px;color:var(--gray);font-size:9px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;}
.edit-existing-files-list{display:flex;flex-direction:column;gap:8px;}
.edit-existing-file{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--light-gray);border-radius:7px;background:#FAFAF8;font-size:12px;}
.edit-existing-file>span:first-child{min-width:0;font-weight:600;color:var(--text);}
.edit-existing-file-name{flex:1;min-width:0;overflow:hidden;color:var(--gray);font-size:10px;text-overflow:ellipsis;white-space:nowrap;}
.edit-existing-file .secondary-action{flex-shrink:0;padding:7px 10px;font-size:10px;}
.sidebar-button.danger{background:transparent;color:#A35B5B;border:1px solid #E4CACA;}
.sidebar-button.danger:hover{background:#FBF3F3;}
@media (max-width:800px){.monetary-stat-card{grid-column:1 / -1 !important;}.edit-existing-file{align-items:flex-start;flex-wrap:wrap;}.edit-existing-file-name{flex-basis:100%;order:3;}}

/* ==========================================
   DASHBOARD — THREE COST CARDS ON ONE ROW
========================================== */

@media (min-width: 801px) {

    .stats {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .stats .stat-card:nth-child(-n + 4) {
        grid-column: span 3;
    }

    .stats .monetary-stat-card {
        grid-column: span 4 !important;
    }

}


/* ==========================================
   HOME PROFILES
========================================== */
.profile-switcher {
    margin: 22px 0 20px;
    padding: 14px;
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    background: rgba(255,255,255,0.55);
}

.profile-switcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.profile-switcher-header > span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--gray);
    text-transform: uppercase;
}

.profile-rename-button {
    border: none;
    background: transparent;
    color: var(--gray);
    font: inherit;
    font-size: 10px;
    cursor: pointer;
    padding: 2px 0;
}

.profile-rename-button:hover { color: var(--text); }

.profile-list { display: grid; gap: 5px; }

.profile-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: 7px;
    padding: 8px 9px;
    font: inherit;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
}

.profile-item:hover { background: rgba(4,150,102,0.05); }
.profile-item.active { border-color: var(--light-gray); background: white; font-weight: 600; }
.profile-item-icon { color: var(--gray); font-size: 13px; }
.profile-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-add-button {
    width: 100%;
    margin-top: 7px;
    border: 1px dashed var(--light-gray);
    background: transparent;
    color: var(--gray);
    border-radius: 7px;
    padding: 8px;
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}
.profile-add-button:hover { color: var(--text); border-color: var(--green); }
.profile-add-button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 800px) {
    .profile-switcher { margin-top: 14px; }
}


/* ==========================================
   PROFILE SWITCHER - ACTIVE PROFILE + PHOTO
========================================== */
.profile-item {
    position: relative;
    border: 1px solid transparent;
    background: transparent;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.profile-item.active {
    border-color: rgba(4, 150, 102, .28);
    background: rgba(4, 150, 102, .07);
    box-shadow: inset 3px 0 0 var(--green);
}
.profile-item.active .profile-item-name { font-weight: 700; }
.profile-item-thumb {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cream, #f4f2ed);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}
.profile-item-thumb.has-image { background-color: transparent; }
.profile-item-icon { color: var(--gray); font-size: 13px; line-height: 1; }
.profile-item-check {
    margin-left: auto;
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
}

/* ==========================================
   DATE PICKER
========================================== */
.date-input-error {
    display: none;
    margin-top: 6px;
    color: #b42318;
    font-size: 11px;
    line-height: 1.35;
}
.date-input-error.visible { display: block; }
.date-input-invalid { border-color: #b42318 !important; }

.date-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.date-picker-modal.hidden { display: none; }
.date-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 25, 35, .28);
    backdrop-filter: blur(3px);
}
.date-picker-dialog {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    background: #fff;
    border: 1px solid var(--light-gray);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0,0,0,.16);
    overflow: hidden;
}
.date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--light-gray);
}
.date-picker-eyebrow {
    margin-bottom: 5px;
    color: var(--gray);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.date-picker-header strong {
    font-size: 20px;
    letter-spacing: .1px;
}
.date-picker-close {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--gray);
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.date-picker-close:hover { background: rgba(0,0,0,.04); color: var(--text); }

.date-picker-wheels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1.35fr);
    align-items: start;
    gap: 0;
    padding: 18px 26px 12px;
}
.date-wheel-column {
    position: relative;
    min-width: 0;
}
.date-picker-column-title {
    margin-bottom: 7px;
    color: var(--gray);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .8px;
    text-align: center;
    text-transform: uppercase;
}
.date-picker-slash {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 16px;
    color: #a9a9a9;
    font-size: 22px;
    font-weight: 400;
}
.date-wheel {
    position: relative;
    height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
}
.date-wheel::-webkit-scrollbar { display: none; }
.date-wheel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 96px;
    height: 48px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    pointer-events: none;
}
.date-wheel-item {
    width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #b8b8b8;
    font: inherit;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -.4px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: color .15s ease, opacity .15s ease, transform .15s ease;
}
.date-wheel-item:hover:not(.date-wheel-spacer) { color: #777; }
.date-wheel-item.selected {
    color: #111;
    font-weight: 700;
}
.date-wheel-spacer {
    pointer-events: none;
    cursor: default;
}
.date-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--light-gray);
}
.date-picker-footer .date-picker-done { margin-left: auto; }

@media (max-width: 800px) {
    .date-picker-modal { padding: 10px; align-items: flex-end; }
    .date-picker-dialog {
        width: 100%;
        border-radius: 18px 18px 12px 12px;
    }
    .date-picker-header { padding: 17px 17px 14px; }
    .date-picker-wheels {
        grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr) 14px minmax(0, 1.25fr);
        padding: 14px 10px 10px;
    }
    .date-picker-slash {
        height: 240px;
        font-size: 18px;
    }
    .date-wheel-item { font-size: 22px; }
    .date-picker-footer { padding: 12px 15px 15px; }
}


/* SETTINGS */
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;max-width:980px}
.settings-card{padding:26px;text-align:center}
.settings-card h2{margin:7px 0 10px}
.settings-card p{margin:0;color:#66706C;line-height:1.65}
.settings-link{display:inline-block;margin-top:16px;font-weight:700;color:#3E6B5B;text-decoration:none;word-break:break-word}
.settings-link:hover{text-decoration:underline}
.settings-support-email{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:16px}
.settings-support-email .settings-link{margin-top:0}
.settings-copy-button{border:1px solid #D9DDDA;background:#fff;color:#17202A;border-radius:8px;padding:7px 10px;font:600 12px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;cursor:pointer}
.settings-copy-button:hover{transform:translateY(-1px)}
.settings-policy-links{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px 18px;margin-top:18px}
.settings-policy-links a{color:#3E6B5B;font-size:12px;font-weight:600;text-decoration:none}
.settings-policy-links a:hover{text-decoration:underline}
.settings-language-control{display:flex;justify-content:center;margin-top:18px}
.settings-language-control select{min-width:180px;border:1px solid var(--light-gray);border-radius:8px;background:#fff;color:var(--text);padding:10px 12px;font:500 13px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.footer-version{font-size:9px;opacity:.7}
.form-grid-full small{font-size:10px;font-weight:400;color:var(--gray);line-height:1.5}
.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}
@media(max-width:700px){.settings-grid{grid-template-columns:1fr}.settings-card{padding:22px}.settings-policy-links{gap:8px 14px}}


/* ROOM COUNT & FEATURES */
.property-layout-field { display: flex; flex-direction: column; gap: 10px; }
.room-layout-controls { display: flex; align-items: center; }
.room-count-control select { min-width: 180px; border: 1px solid var(--light-gray); border-radius: 8px; background: #fff; color: var(--text); padding: 11px 12px; font: 500 13px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.room-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 12px; }
.room-feature-option { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 9px 11px; border: 1px solid var(--light-gray); border-radius: 8px; background: #fff; color: var(--text); font-size: 13px; cursor: pointer; }
.room-feature-option input { width: 16px; height: 16px; accent-color: var(--green); flex: 0 0 auto; }
.dashboard-room-layout { min-width: 0; }
.dashboard-room-layout strong { display: block; word-break: break-word; }
@media(max-width:900px){ .room-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:700px){ .room-feature-grid{grid-template-columns:1fr;} .room-count-control select{width:100%;} .room-layout-controls{width:100%;} }


/* FILE VIEWER — avoids browser popup blockers for IndexedDB-backed files */
.homebook-file-viewer{position:fixed;inset:0;z-index:11000;display:flex;align-items:center;justify-content:center;padding:24px}
.homebook-file-viewer-backdrop{position:absolute;inset:0;background:rgba(15,21,19,.68);backdrop-filter:blur(8px)}
.homebook-file-viewer-dialog{position:relative;z-index:1;width:min(1100px,100%);height:min(88vh,900px);display:flex;flex-direction:column;background:#fff;border:1px solid rgba(20,30,26,.12);border-radius:14px;overflow:hidden;box-shadow:0 28px 90px rgba(0,0,0,.28)}
.homebook-file-viewer-toolbar{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 14px 10px 18px;border-bottom:1px solid var(--light-gray);background:#fafaf8}
.homebook-file-viewer-toolbar strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:var(--text)}
.homebook-file-viewer-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.homebook-file-viewer-download{display:inline-flex;align-items:center;padding:8px 11px;border-radius:7px;background:var(--navy);color:#fff;text-decoration:none;font-size:11px;font-weight:600}
.homebook-file-viewer-close{width:34px;height:34px;border:1px solid var(--light-gray);border-radius:7px;background:#fff;color:var(--gray);font-size:22px;line-height:1;cursor:pointer}
.homebook-file-viewer-close:hover{color:var(--text);background:#f7f7f6}
.homebook-file-viewer-content{flex:1;min-height:0;background:#eceeea;display:flex;align-items:center;justify-content:center;padding:18px}
.homebook-file-viewer-content img{display:block;max-width:100%;max-height:100%;object-fit:contain;border-radius:7px;box-shadow:0 10px 35px rgba(0,0,0,.14);background:#fff}
.homebook-file-viewer-content iframe{width:100%;height:100%;border:0;border-radius:7px;background:#fff}
@media(max-width:700px){.homebook-file-viewer{padding:8px}.homebook-file-viewer-dialog{height:94vh;border-radius:11px}.homebook-file-viewer-toolbar{padding-left:12px}.homebook-file-viewer-download{padding:8px 9px}.homebook-file-viewer-content{padding:8px}}

/* Mobile: keep the renovation add button aligned with the other page actions. */
@media (max-width: 800px) {
    #renovations .renovation-header-actions {
        position: relative;
        width: auto;
        flex: 0 0 auto;
        align-items: center;
    }

    #renovations .renovation-header-actions .primary-action {
        margin-right: 0;
    }

    #maintenance .timeline-page-header-actions,
    #purchases .timeline-page-header-actions {
        position: relative;
        width: auto;
        flex: 0 0 auto;
        align-items: center;
    }

    #maintenance .timeline-page-header-actions .primary-action,
    #purchases .timeline-page-header-actions .primary-action {
        margin-right: 0;
    }

    #maintenance .timeline-page-header-actions .timeline-back-button,
    #purchases .timeline-page-header-actions .timeline-back-button {
        position: absolute;
        right: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        white-space: nowrap;
    }

    #renovations .timeline-back-button {
        position: absolute;
        right: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        white-space: nowrap;
    }
}
