:root {
    color-scheme: light;
    --ink: #17211b;
    --muted: #66736c;
    --line: #dfe7e2;
    --paper: #ffffff;
    --canvas: #f4f7f5;
    --brand: #194f38;
    --brand-dark: #103c2a;
    --accent: #d8efe3;
    --danger: #9f2f2f;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--canvas);
    color: var(--ink);
}
button, input, textarea, select { font: inherit; }
a { color: var(--brand); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #83c9a5;
    outline-offset: 3px;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 44px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    background: var(--brand-dark);
    color: white;
}
.brand {
    color: white;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: .01em;
    white-space: nowrap;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
.brand img {
    height: 48px;
    width: auto;
    display: block;
    mix-blend-mode: lighten;
}
.auth-logo {
    display: block;
    width: min(280px, 100%);
    height: auto;
    margin: 0 auto 18px;
}
.app-nav {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px 10px;
    min-width: 0;
    overflow-x: auto;
}
.app-nav a {
    color: #cde4d8;
    font-weight: 700;
    text-decoration: none;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0 4px;
    flex: 0 0 auto;
}
.app-nav a[aria-current="page"] {
    color: white;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.topbar-end {
    display: flex;
    flex: 0 0 auto;
    margin-left: auto;
    align-items: center;
    gap: 2px;
}
.account-menu {
    position: relative;
    flex: 0 0 auto;
}
.admin-menu > summary { color: #cde4d8; }
.admin-menu[data-current="true"] > summary { color: white; }
.account-menu > summary {
    list-style: none;
    cursor: pointer;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    color: white;
    font-weight: 700;
    white-space: nowrap;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #cde4d8;
}
.account-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% - 2px);
    z-index: 30;
    min-width: 220px;
    padding: 6px 0;
    background: white;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(16, 60, 42, .18);
}
.account-menu-panel a,
.account-menu-panel button {
    display: block;
    width: 100%;
    min-height: 36px;
    margin: 0;
    padding: 8px 14px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--ink);
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.account-menu-panel a:hover,
.account-menu-panel button:hover { background: #edf3ef; }
.admin-menu-group {
    margin: 8px 14px 2px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    color: #5d6f66;
}
.stream-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}
.stream-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    color: inherit;
    font-weight: 800;
    text-decoration: none;
}
.stream-chip.is-current {
    background: var(--brand);
    color: white;
    border-color: transparent;
}
.expertise-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.inline-form { display: inline; }
.link-button {
    min-height: 44px;
    padding: 8px;
    border: 0;
    background: none;
    color: #cde4d8;
    cursor: pointer;
}
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.page-shell { width: min(1100px, calc(100% - 28px)); margin: 0 auto; padding: 14px 0 40px; }
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 8px 22px rgba(20, 52, 37, .05);
}
.auth-card { width: min(440px, 100%); padding: 38px; }
.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; }
h2 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); }
.page-heading { margin-bottom: 14px; }
.lead-queue-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.lead-queue-heading .muted { margin: 8px 0 0; }
.form-stack, .form-grid { display: grid; gap: 20px; margin-top: 26px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 8px; font-weight: 700; }
label span { color: var(--muted); font-size: 12px; font-weight: 500; }
input, textarea, select {
    width: 100%;
    border: 1px solid #bdc9c2;
    border-radius: 9px;
    padding: 12px 13px;
    background: white;
    color: var(--ink);
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); }
button {
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    padding: 12px 20px;
    background: var(--brand);
    color: white;
    font-weight: 800;
    cursor: pointer;
}
button:hover { background: var(--brand-dark); }
.actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.alert { margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: #fde8e8; color: var(--danger); }
.workspace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.workspace-grid .full { grid-column: 1 / -1; }
.relationship-file { display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr); gap: 24px; align-items: start; }
.workspace-sticky { position: sticky; top: 8px; z-index: 8; display: grid; gap: 10px; }
.stage-rail { min-width: 0; }
.stage-rail ol { margin: 0; padding: 8px; list-style: none; background: #edf3ef; border: 1px solid var(--line); border-radius: 14px; }
.stage-step { border-radius: 10px; }
.stage-step > a, .stage-step > span { display: block; padding: 12px; color: var(--ink); font-weight: 750; text-decoration: none; }
.stage-step > a:hover { background: white; }
.stage-step.active { background: white; box-shadow: 0 4px 14px rgba(20, 52, 37, .08); }
.stage-step.active > a { color: var(--brand-dark); }
.stage-step small { display: block; padding: 0 12px 12px 38px; color: var(--muted); line-height: 1.35; }
.stage-marker { display: inline-grid; width: 20px; place-items: center; color: var(--brand); }
.stage-file { min-width: 0; overflow-x: auto; }
.stage-block { scroll-margin-top: 12px; }
.relationship-file .stage-block { display: none; }
.relationship-file .stage-block.stage-recorded,
.relationship-file .stage-block:has(#current-stage) { display: block; }
.relationship-file .stage-follow { display: none; }
.relationship-file .stage-block.stage-recorded + .stage-follow,
.relationship-file .stage-block:has(#current-stage) + .stage-follow { display: block; }
.file-picture { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.file-picture h2 { margin: 0 0 10px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-dark); }
.file-picture dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
.file-picture dt { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.file-picture dd { margin: 2px 0 0; font-weight: 700; }
.file-picture a { color: inherit; text-decoration: none; }
.file-picture a:hover { color: var(--brand); }
@media (max-width: 720px) {
    .file-picture dl { grid-template-columns: 1fr; }
}
.stage-block:target { outline: 3px solid #83c9a5; outline-offset: 6px; border-radius: 16px; }
.stage-block > .card { margin-bottom: 20px; }
.visit-history { margin: 12px 0 16px; }
.visit-history > summary { cursor: pointer; color: var(--brand); font-weight: 800; }
.history-disclosure { margin-top: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.history-disclosure > summary { color: var(--brand); font-weight: 800; cursor: pointer; }
.history-disclosure .card { margin-top: 16px; box-shadow: none; }
.stage-notice { margin: 0 0 20px; padding: 16px 18px; border-radius: 12px; border-left: 4px solid var(--danger); background: #fff0f0; }
.stage-notice strong { display: block; font-size: 18px; }
.stage-notice p { margin: 7px 0 0; line-height: 1.5; }
.stage-notice details { margin-top: 12px; }
.stage-notice summary { color: var(--brand); font-weight: 750; cursor: pointer; }
.stage-notice code { display: inline-block; margin-top: 8px; }
.stage-notice.success { position: sticky; top: 10px; z-index: 5; border-left-color: #2f8a55; background: #eaf7ee; box-shadow: 0 8px 24px rgba(20, 52, 37, .12); }
.stage-notice.success strong { color: #21613c; }
.stage-notice.error { position: sticky; top: 10px; z-index: 5; box-shadow: 0 8px 24px rgba(73, 20, 20, .14); }
.stage-notice.error + * :is(input, select, textarea)[aria-describedby="stage-correction"]:focus,
.stage-file :is(input, select, textarea)[aria-describedby="stage-correction"]:focus {
  outline: 3px solid #b42318;
  outline-offset: 3px;
}
.data-grid-wrap { width: 100%; margin: 14px 0 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.data-grid { width: 100%; min-width: 560px; border-collapse: collapse; background: white; font-size: 14px; }
.data-grid th, .data-grid td { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-grid th:last-child, .data-grid td:last-child { border-right: 0; }
.data-grid tbody tr:last-child td { border-bottom: 0; }
.data-grid th { background: #edf3ef; color: var(--brand-dark); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
.data-grid .number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-grid tbody tr:nth-child(even) { background: #f8faf9; }
/* Phones: a table marked stack-on-phone shows each row as a small card (no sideways scroll). */
@media (max-width: 600px) {
  .data-grid-wrap:has(.stack-on-phone) { overflow-x: visible; border: 0; }
  .data-grid.stack-on-phone { min-width: 0; }
  .data-grid.stack-on-phone thead { display: none; }
  .data-grid.stack-on-phone, .data-grid.stack-on-phone tbody, .data-grid.stack-on-phone tr, .data-grid.stack-on-phone td { display: block; width: 100%; box-sizing: border-box; }
  .data-grid.stack-on-phone tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: white; }
  .data-grid.stack-on-phone td { border-right: 0; border-bottom: 1px solid var(--line); }
  .data-grid.stack-on-phone td:last-child { border-bottom: 0; }
  .data-grid.stack-on-phone td[data-label]:not([data-label="Question"]):not([data-label="Change"])::before { content: attr(data-label) ": "; font-weight: 600; color: var(--brand-dark); }
  .data-grid.stack-on-phone td[data-label="Question"] { font-weight: 600; }
}
.confirmation-row { grid-template-columns: auto 1fr; align-items: start; padding: 14px; border: 1px solid #d7c27a; border-radius: 9px; background: #fff9e8; }
.confirmation-row input { width: auto; margin-top: 3px; }
.confirmation-row span { color: var(--ink); font-size: 14px; font-weight: 700; }
.quick-action { margin: 14px 0; }
.quick-action > summary { color: var(--brand-dark); font-size: 15px; font-weight: 800; cursor: pointer; }
.quick-action[open] > summary { margin-bottom: 8px; }
.work-menu {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    margin: 0 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f7f9f8;
    overflow-x: auto;
}
.work-menu a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-right: 1px solid var(--line);
    color: var(--ink);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.work-menu a:last-child { border-right: 0; }
.work-menu a:hover { background: white; }
.customer-panel { margin-top: 14px; }
.customer-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 4px; }
.customer-search label { color: var(--brand-dark); font-weight: 800; }
.customer-list { margin: 0; padding: 0; list-style: none; }
.customer-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    align-items: start;
}
.customer-kind {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 4px;
    background: #edf3ef;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}
.customer-kind-organization { background: #e7eef8; color: #1d3b70; }
.customer-kind-property { background: #f4eee3; color: #6a4b16; }
.customer-kind-unrecorded { background: #eee; color: #66736c; }
.customer-primary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
}
.customer-preferred { color: var(--muted); font-size: 13px; }
.customer-metrics { margin: 4px 0 0; font-size: 12px; }
.customer-referral { margin: 4px 0 0; color: var(--brand-dark); font-size: 12px; font-weight: 700; }
.customer-address { margin: 2px 0 0; font-size: 13px; }
.customer-status {
    display: grid;
    justify-items: end;
    gap: 4px;
    min-width: 88px;
    padding-top: 2px;
    text-align: right;
}
.customer-stage {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}
.customer-stage-paid { background: #e7f6ec; color: #21613c; }
.customer-more { margin-top: 4px; }
.customer-more > summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 750;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}
.follow-up-board { margin: 0 0 10px; }
.follow-up-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 8px;
}
.pipeline-board {
    margin: 0 0 16px;
    padding: 16px 16px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(180deg, #f7faf8 0%, #eef4f0 100%);
}
.pipeline-board-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 8px 18px;
    margin: 0 0 14px;
}
.pipeline-board-head .eyebrow {
    margin: 0 0 2px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.pipeline-board-head h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.01em;
}
.pipeline-board-head .muted {
    margin: 0;
    max-width: 28rem;
    font-size: 13px;
    line-height: 1.4;
}
.pipeline-columns {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(168px, 1fr);
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
}
.pipeline-column {
    display: flex;
    flex-direction: column;
    min-height: 220px;
    max-height: 420px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: 0 1px 0 rgba(20, 52, 37, .04);
    scroll-snap-align: start;
    overflow: hidden;
}
.pipeline-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #f8fbf9;
}
.pipeline-column-head h3 {
    margin: 0;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.pipeline-count {
    min-width: 24px;
    min-height: 24px;
    padding: 0 7px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.pipeline-empty {
    margin: auto 0;
    padding: 24px 12px;
    text-align: center;
    font-size: 12px;
}
.pipeline-list {
    flex: 1 1 auto;
    margin: 0;
    padding: 8px;
    list-style: none;
    overflow-y: auto;
}
.pipeline-list li { margin: 0 0 6px; }
.pipeline-list li:last-child { margin-bottom: 0; }
.pipeline-card {
    display: grid;
    gap: 3px;
    min-height: 52px;
    padding: 12px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f4f7f5;
    color: var(--ink);
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}
.pipeline-card strong {
    font-size: 13px;
    font-weight: 750;
    line-height: 1.3;
    word-break: break-word;
}
.pipeline-card span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}
.pipeline-card:hover {
    border-color: #b7d0c2;
    background: white;
}
.pipeline-card:hover strong { color: var(--brand-dark); }
.pipeline-column[data-pipeline="leads"] .pipeline-column-head { border-top: 3px solid #6b8f7c; }
.pipeline-column[data-pipeline="customer"] .pipeline-column-head { border-top: 3px solid #194f38; }
.pipeline-column[data-pipeline="visit"] .pipeline-column-head { border-top: 3px solid #2f6b4f; }
.pipeline-column[data-pipeline="estimate"] .pipeline-column-head { border-top: 3px solid #3d7a5c; }
.pipeline-column[data-pipeline="accepted"] .pipeline-column-head { border-top: 3px solid #2f8a55; }
.pipeline-column[data-pipeline="project"] .pipeline-column-head { border-top: 3px solid #1d5c3d; }
.pipeline-column[data-pipeline="invoice"] .pipeline-column-head { border-top: 3px solid #8a6b2f; }
.pipeline-column[data-pipeline="paid"] .pipeline-column-head { border-top: 3px solid #21613c; }
.pipeline-column[data-pipeline="paid"] .pipeline-count {
    background: #e7f6ec;
    color: #21613c;
}
@media (max-width: 900px) {
    .pipeline-columns {
        grid-auto-columns: minmax(200px, 72vw);
    }
    .pipeline-board-head { align-items: start; }
}
@media (max-width: 720px) {
    .topbar {
        min-height: 52px;
        padding: 0 10px;
        gap: 8px;
    }
    .brand img { height: 40px; }
    .app-nav {
        gap: 0 6px;
        -webkit-overflow-scrolling: touch;
    }
    .app-nav a {
        min-height: 44px;
        padding: 0 8px;
        font-size: 14px;
    }
    .account-menu > summary {
        min-height: 44px;
        /* BUS-013 Revision 13 (N11): wrap the name onto two short lines
           instead of cutting it off. */
        max-width: 9.5rem;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.15;
        font-size: 13px;
        text-align: right;
    }
    .page-shell {
        width: min(100% - 16px, 1100px);
        padding: 10px 0 48px;
    }
    .card { padding: 16px; }
    .pipeline-board { padding: 12px; border-radius: 12px; }
    .pipeline-columns {
        grid-auto-columns: minmax(210px, 78vw);
        gap: 8px;
    }
    .pipeline-column { min-height: 240px; max-height: 60vh; }
    .pipeline-card { min-height: 56px; padding: 14px 12px; }
    .customer-row {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 8px;
    }
    .customer-status {
        grid-column: 2;
        justify-items: start;
        text-align: left;
        padding-top: 0;
    }
    .follow-up-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .attention-summary {
        flex-wrap: wrap;
    }
    .attention-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .form-grid,
    .form-stack {
        gap: 12px;
    }
    input,
    select,
    textarea {
        font-size: 16px;
        min-height: 44px;
    }
    textarea { min-height: 96px; }
    button,
    .button-link {
        width: 100%;
        min-height: 48px;
    }
    .actions {
        justify-content: stretch;
    }
    .actions button { flex: 1 1 auto; }
    .relationship-file {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .workspace-sticky {
        position: static;
        top: auto;
    }
    .stage-rail ol {
        display: flex;
        width: max-content;
        min-width: 100%;
        gap: 4px;
        padding: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .stage-step { flex: 0 0 auto; }
    .stage-step > a,
    .stage-step > span {
        min-height: 44px;
        padding: 10px 12px;
        white-space: nowrap;
    }
    .stage-step small { display: none; }
    .visit-stream-types,
    .type-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .visit-stream-types > label,
    .type-tabs a {
        min-height: 44px;
        flex: 0 0 auto;
    }
    .billing-summary,
    .project-progress {
        grid-template-columns: 1fr;
    }
    .auth-card { margin: 16px auto; padding: 22px 18px; }
}
.desk-stream-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}
.desk-stream {
  display: inline-block;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border-right: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.desk-stream:last-child { border-right: 0; }
.desk-stream.is-selected,
.desk-stream[aria-current="page"] {
  background: var(--brand-dark);
  color: #fff;
}
.desk-strip h2 { margin: 0 0 10px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark); }
.desk-count-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 0;
    margin: 0;
    line-height: 1.6;
}
.desk-count { white-space: nowrap; margin-right: 2px; }
.desk-count-label { color: var(--muted); font-weight: 700; font-size: 13px; }
.desk-count strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.desk-sep { color: var(--line); margin: 0 6px; }
.desk-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.desk-appointments td.desk-hours {
    font-size: 13px;
    color: var(--muted);
    max-width: 14rem;
    overflow-wrap: anywhere;
}
.desk-coverage-days {
    margin-top: 8px;
    font-size: 13px;
}
.desk-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: end;
    margin: 0 0 12px;
}
.desk-filter label {
    display: grid;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}
.desk-filter input[type="date"] {
    font: inherit;
    font-weight: 500;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}
.desk-filter button {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--brand-dark);
    border-radius: 8px;
    background: var(--brand-dark);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}
.desk-filter-reset {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    color: var(--brand-dark);
    font-weight: 750;
    text-decoration: none;
}
.desk-sort {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
.desk-sort:hover,
.desk-sort:focus {
    color: var(--brand-dark);
    text-decoration: underline;
}
.desk-sort-mark {
    white-space: pre;
}
.desk-count-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.desk-count-link:hover,
.desk-count-link:focus {
    color: var(--brand-dark);
}
.desk-detail {
    border-color: var(--brand-dark);
}
.desk-detail-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 8px;
}
.desk-detail-list li {
    line-height: 1.4;
}
.role-picker {
    display: grid;
    gap: 8px;
}
.role-permission-preview {
    margin-top: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9f8;
}
.role-permission-preview-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 750;
    color: var(--brand-dark);
}
.role-permission-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 6px;
}
.role-permission-list li {
    line-height: 1.35;
}
.role-permission-list code {
    font-size: 12px;
    color: var(--muted);
}
.role-permission-scope {
    margin: 0 0 8px;
    font-size: 13px;
}
.role-permission-outside {
    opacity: 0.55;
}
.role-permission-outside em {
    font-style: normal;
    font-size: 12px;
    color: var(--muted);
}
.role-permission-matrix th,
.role-permission-matrix td {
    text-align: center;
    vertical-align: middle;
}
.role-permission-matrix th[scope="row"] {
    text-align: left;
    white-space: nowrap;
}
.role-matrix-cell {
    display: inline-flex;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    align-items: center;
    margin: 0;
}
.role-matrix-partial {
    background: #f3f0e6;
}
.role-matrix-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}
.role-matrix-detail-grid {
    display: grid;
    gap: 10px;
    text-align: left;
    padding: 8px 0;
}
.role-matrix-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
}
.role-matrix-detail-row > span {
    min-width: 11rem;
    font-weight: 600;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.effective-access {
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9f8;
}
.effective-access h3 {
    margin: 0 0 8px;
    font-size: 14px;
}
.effective-access-stream {
    margin: 0 0 8px;
}
.effective-access-stream strong {
    display: block;
    margin-bottom: 2px;
}
.effective-access ul {
    margin: 0;
    padding-left: 1.2rem;
}
.advanced-overrides summary {
    cursor: pointer;
    font-weight: 650;
    margin-bottom: 8px;
}
.desk-tool {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9f8;
    color: var(--brand-dark);
    font-weight: 750;
    text-decoration: none;
}
.crew-day .card { max-width: 40rem; }
.crew-visit-list { margin-top: 12px; }
.crew-visit-list li { border-top: 1px solid var(--line); padding: 0; }
.crew-visit-link {
    display: grid;
    gap: 4px;
    min-height: 72px;
    padding: 14px 4px;
    color: var(--ink);
    text-decoration: none;
}
.crew-visit-link strong { font-size: 16px; }
.crew-visit-link span { color: var(--muted); font-size: 14px; }
.crew-visit-meta { font-weight: 700; color: var(--brand-dark) !important; }
.crew-visit-facts { margin: 0 0 18px; }
.crew-surface .topbar .admin-menu { display: none; }
.type-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
}
.type-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: white;
    color: var(--ink);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.type-tabs a span {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.type-tabs a[aria-current="page"] {
    border-color: var(--brand);
    background: var(--accent);
    color: var(--brand-dark);
}
.attention-summary {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
}
.summary-count {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: white;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
.summary-count strong { color: var(--brand-dark); font-size: 16px; font-variant-numeric: tabular-nums; }
.summary-count span { color: var(--muted); font-size: 12px; font-weight: 750; }
.anchor-target, .stage-land { scroll-margin-top: 12px; }
.anchor-target:target { outline: 3px solid #83c9a5; outline-offset: 5px; border-radius: 4px; }
.next-action-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 24px; padding: 22px 24px; border: 1px solid #d7c27a; border-radius: 14px; background: #fff9e8; }
.next-action-card h2, .next-action-card p { margin-top: 0; }
.next-action-card p:last-child { margin-bottom: 0; }
.stage-review { margin: -8px 0 24px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stage-review > summary { padding: 14px 18px; color: var(--brand); font-weight: 800; cursor: pointer; }
.stage-review > summary span { display: inline-grid; min-width: 24px; height: 24px; margin-left: 6px; place-items: center; border-radius: 999px; background: #e3f2e8; color: #21613c; font-size: 12px; }
.stage-review ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 0; padding: 0 18px 18px; list-style: none; }
.stage-review li { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: #f5f8f6; }
.stage-review li small { display: block; margin-top: 3px; color: var(--muted); }
.stage-review-check { display: inline-grid; flex: 0 0 24px; height: 24px; place-items: center; border-radius: 999px; background: #d9efe1; color: #21613c; font-weight: 900; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 18px; border-radius: 9px; background: var(--brand); color: white; font-weight: 800; text-decoration: none; white-space: nowrap; }
.audit-details { margin-top: 8px; color: var(--muted); font-size: 13px; }
.audit-details summary { cursor: pointer; }
.audit-details code { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.task-disclosure { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.task-disclosure > summary { padding: 13px 15px; color: var(--brand); font-weight: 800; cursor: pointer; }
.task-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.task-disclosure > p { margin: 14px 15px 0; }
.task-disclosure > .form-grid { margin: 0; padding: 15px; }
.project-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 18px 0; padding: 0; list-style: none; counter-reset: project-step; }
.project-progress li { display: grid; align-content: start; gap: 6px; min-height: 74px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9f8; color: var(--muted); font-size: 12px; font-weight: 750; }
.project-progress li span { display: inline-grid; width: 23px; height: 23px; place-items: center; border-radius: 999px; background: #e6ebe8; }
.project-progress li.complete { background: #eef8f1; color: #21613c; }
.project-progress li.complete span { background: #d5eddd; }
.invoice-context { margin: 8px 0 14px; color: var(--muted); }
.billing-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.billing-summary div { padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9f8; }
.billing-summary dt { font-size: 11px; }
.billing-summary dd { font-size: 18px; font-variant-numeric: tabular-nums; }
.contact-method-list { display: grid; gap: 9px; margin: 16px 0; }
.contact-method-list > div { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9f8; }
.contact-type { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.preferred-badge { padding: 4px 8px; border-radius: 999px; background: #d9efe1; color: #21613c; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.record-history { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--line); background: #f8faf9; color: var(--muted); font-size: 13px; }
.record-history > summary { color: var(--brand); font-weight: 750; cursor: pointer; }
.record-history p { margin: 9px 0 0; }
.action-guidance { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid #d7c27a; background: #fff9e8; color: #594d25; font-size: 13px; line-height: 1.45; }
.billing-complete { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 9px; background: #e8f6ed; color: #21613c; }
.billing-complete span { display: inline-grid; flex: 0 0 25px; height: 25px; place-items: center; border-radius: 999px; background: #cfe9d8; font-weight: 900; }
.back-link { display: inline-block; margin-bottom: 24px; text-decoration: none; font-weight: 700; }
dl { margin: 0; }
dl div { padding: 12px 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
dd { margin: 5px 0 0; font-weight: 700; }
.clean-list { margin: 0; padding: 0; list-style: none; }
.clean-list li { padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.section-intro { margin-top: -6px; color: var(--muted); }
.timeline { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.timeline li { padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 9px; background: #fbfcfb; }
.timeline time { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.contact-lines { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 13px; }
.contact-lines span { padding: 5px 8px; border-radius: 7px; background: #eef3f0; }
.follow-up-heading { margin-top: 16px; }
.attention-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.attention-grid .card { padding: 12px 14px; }
.attention-grid .clean-list li { padding: 8px 0; }
.count-badge { display: inline-grid; place-items: center; min-width: 28px; min-height: 28px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--brand-dark); font-size: 14px; }
.intake-review-page { padding-bottom: 140px; }
.intake-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 24px;
    padding: 14px 18px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 -8px 28px rgba(20, 52, 37, .12);
}
.intake-action-bar form { margin: 0; }
.intake-action-bar .mark-as { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.intake-action-bar .mark-as span { font-weight: 800; }
/* The sticky bar floats over the bottom of the lead page. Reserve its height
   so Tab, browser validation and "Save final information" scroll clear of it;
   an open Spam/Irrelevant fold-out makes the bar taller. */
html:has(.intake-action-bar) { scroll-padding-bottom: 110px; }
html:has(.intake-action-bar details[open]) { scroll-padding-bottom: 430px; }
button.secondary { background: white; color: var(--brand-dark); border: 1px solid var(--line); }
button.secondary:hover { background: #edf3ef; }
.customer-context {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #edf3ef;
    box-shadow: 0 8px 24px rgba(20, 52, 37, .08);
}
.lead-facts-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.lead-facts-head h2 { margin: 0; }
.lead-facts-note { margin: 0 0 16px; }
.typed-capture-icon { position: relative; flex: 0 0 auto; }
.typed-capture-icon > summary {
    list-style: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: white;
    font-size: 18px;
}
.typed-capture-icon > summary::-webkit-details-marker { display: none; }
.typed-capture-icon[open] > summary { background: #edf3ef; }
.typed-capture-panel {
    position: absolute;
    right: 0;
    top: 46px;
    z-index: 6;
    width: min(360px, 80vw);
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(20, 52, 37, .12);
}
.typed-capture-panel h3 { margin: 0 0 8px; font-size: 14px; }
.record-display { display: grid; gap: 10px; margin: 0 0 16px; }
.record-display > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; align-items: baseline; }
.record-display dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.record-display dd { margin: 0; font-size: 16px; font-weight: 650; }
.property-record { list-style: none; }
.property-head { margin: 0 0 12px; }
.property-head h3 { margin: 0 0 4px; font-size: 20px; }
.property-address { margin: 0; font-size: 16px; line-height: 1.45; }
.property-children { margin-top: 8px; padding: 12px 14px 4px; border-left: 3px solid var(--accent); background: #f8fbf9; border-radius: 0 12px 12px 0; }
.property-children h4 { margin: 16px 0 8px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-dark); }
.property-children section:first-child h4 { margin-top: 0; }
.customer-context .capture-status { margin: 0 0 6px; }
.workspace-sticky .page-heading { margin: 0; }
.workspace-sticky .page-heading h2 { margin: 0; font-size: clamp(18px, 3vw, 24px); }
.stage-file .lead-extra { margin-top: 12px; }
.stage-file .lead-extra > summary { cursor: pointer; color: var(--brand); font-weight: 800; }
.stage-file .lead-extra .card { margin-top: 12px; box-shadow: none; }
.stage-file .lead-extra dl { display: grid; gap: 8px; margin: 12px 0 0; }
.stage-file .card > .capture-status { margin-top: 4px; }
.stage-file .card > .capture-facts { margin: 8px 0 14px; }
.intake-snapshot { margin: 18px 0 0; padding: 16px; border-radius: 12px; background: #edf3ef; }
.intake-snapshot .typed-capture { margin: 0; }
.caller-history { margin: 0 0 18px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: #fbfcfb; }
.caller-history h3 { margin: 0 0 8px; font-size: 16px; }
.intake-snapshot h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark); }
.intake-snapshot dl { margin: 0; display: grid; gap: 8px; }
.intake-snapshot div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.intake-snapshot dt { color: var(--muted); font-size: 12px; font-weight: 700; }
@media (max-width: 700px) {
    .topbar { padding: 0 10px; gap: 8px; flex-wrap: nowrap; }
    .page-shell { width: min(100% - 16px, 1100px); padding-top: 10px; }
    .form-grid, .workspace-grid { grid-template-columns: 1fr; }
    .relationship-file { grid-template-columns: 1fr; }
    .workspace-sticky { top: 0; padding-bottom: 8px; background: var(--canvas); }
    .stage-rail { overflow-x: auto; }
    .stage-rail ol { display: flex; width: max-content; min-width: 100%; }
    .stage-block, .anchor-target, .stage-land { scroll-margin-top: 11rem; }
    .stage-step { min-width: 150px; }
    .attention-grid { grid-template-columns: 1fr; }
    .customer-search { grid-template-columns: 1fr; }
    .customer-row { grid-template-columns: 28px minmax(0, 1fr); }
    .customer-status { justify-items: start; text-align: left; grid-column: 2; }
    .attention-summary { flex-wrap: wrap; }
    .project-progress { grid-template-columns: 1fr; }
    .project-progress li { display: flex; align-items: center; min-height: 0; }
    .billing-summary { grid-template-columns: 1fr; }
    .contact-method-list > div { grid-template-columns: 1fr; }
    .preferred-badge { justify-self: start; }
    .next-action-card { align-items: stretch; flex-direction: column; }
    .button-link { width: 100%; }
    .workspace-grid .full { grid-column: auto; }
    .card { padding: 22px; }
    .actions { justify-content: stretch; }
    .actions button { flex: 1 1 auto; }
    .intake-action-bar { position: static; }
    html:has(.intake-action-bar), html:has(.intake-action-bar details[open]) { scroll-padding-bottom: 0; }
    .intake-action-bar .mark-as { margin-left: 0; width: 100%; }
    .intake-review-page { padding-bottom: 24px; }
}
.capture-review {
    width: min(52rem, calc(100% - 28px));
    margin: 20px auto 72px;
    padding: 24px 22px 28px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(20, 52, 37, .05);
}
.capture-decide-head { margin: 0 0 18px; }
.capture-decide-head h1 { margin: 0 0 8px; font-size: 1.45rem; }
.capture-brief {
    margin: 0 0 22px;
    padding: 16px 16px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f7faf8;
}
.capture-brief-contact { margin: 6px 0 12px; font-weight: 750; }
.capture-brief-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    margin: 0;
}
.capture-brief-facts div { min-width: 0; }
.capture-brief-facts dt {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.capture-brief-facts dd { margin: 0; font-weight: 700; line-height: 1.4; }
.capture-brief-hint { margin: 12px 0 0; }
.capture-brief-note {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--paper);
    border: 1px solid var(--line);
}
.capture-brief-note .eyebrow { display: block; margin-bottom: 6px; }
.capture-brief-note .typed-capture { display: block; white-space: pre-wrap; }
.capture-accept-block { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
    .capture-brief-facts { grid-template-columns: 1fr; }
}
.capture-review.property-review {
    width: min(960px, calc(100% - 28px));
}
.capture-review.visit-review {
    width: min(1180px, calc(100% - 20px));
    margin-top: 12px;
    padding: 0 0 22px;
    background: #f7faf8;
    border: 2px solid var(--brand-dark);
    border-radius: 12px;
    box-shadow: none;
}
.visit-stream-pin,
.visit-identity-float {
    position: sticky;
    top: 44px;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 18px;
    align-items: center;
    margin: 0;
    padding: 10px 16px;
    max-height: none;
    overflow: hidden;
    background: var(--brand-dark);
    color: #e8f3ec;
    border: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 8px 18px rgba(16, 32, 24, .18);
}
.visit-stream-pin-who,
.visit-stream-pin-reach {
    display: grid;
    gap: 1px;
    margin: 0;
    min-width: 0;
}
.visit-stream-pin-who strong {
    color: white;
    font-size: 15px;
    font-weight: 800;
}
.visit-stream-pin-who span,
.visit-stream-pin-reach span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 650;
}
.visit-stream-pin-reach { justify-items: end; text-align: right; }
.visit-stream-board { padding: 12px 14px 8px; }
.visit-stream-types {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.visit-stream-types > input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
.visit-stream-types > label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
}
.visit-stream-types > label small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}
.visit-stream-types > input:checked + label {
    background: var(--brand);
    color: white;
    border-color: transparent;
}
.visit-stream-types > input:checked + label small { color: #d8efe3; }
.visit-stream-slices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 10px 0 12px;
    padding: 8px;
    background: #eef3f0;
    border-radius: 12px;
}
.visit-stream-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    font-weight: 800;
    font-size: 13px;
}
.visit-stream-total {
    border-color: var(--brand);
    background: var(--accent);
    color: var(--brand);
}
.visit-stream-op { font-weight: 800; padding: 0 2px; }
.visit-stream-sheet {
    border: 2px solid #eef3f0;
    border-radius: 12px;
    padding: 14px;
    background: white;
}
.visit-stream-panels > section { display: none; }
.visit-stream-board:has(> .visit-stream-types > input[value="customer"]:checked) .visit-stream-panels > [data-visit-tab="customer"],
.visit-stream-board:has(> .visit-stream-types > input[value="property"]:checked) .visit-stream-panels > [data-visit-tab="property"],
.visit-stream-board:has(> .visit-stream-types > input[value="work"]:checked) .visit-stream-panels > [data-visit-tab="work"],
.visit-stream-board:has(> .visit-stream-types > input[value="matches"]:checked) .visit-stream-panels > [data-visit-tab="matches"],
.visit-stream-board:has(> .visit-stream-types > input[value="calendar"]:checked) .visit-stream-panels > [data-visit-tab="calendar"] {
    display: block;
}
.visit-stream-board:has(> .visit-stream-types > input:checked) .visit-stream-sheet {
    border-color: #2f5c45;
}
.visit-stream .postal-envelope {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.visit-stream .visit-property-dossier,
.visit-stream .visit-prior-work,
.visit-stream .capture-matches,
.visit-stream .sales-calendar {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.visit-stream #stage-visits {
    margin: 0 14px 8px;
}
.visit-slot-card {
    margin: 0;
    padding: 16px 14px 14px;
    border: 2px solid #2f5c45;
    border-radius: 12px;
    background: white;
}
.visit-week-days,
.visit-day-hours {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.visit-week-days > input,
.visit-day-hours > input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
.visit-week-days > label,
.visit-day-hours > label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 48px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
}
.visit-week-days > label span {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.visit-week-days > input:checked + label,
.visit-day-hours > input:checked + label {
    background: var(--brand);
    color: white;
    border-color: transparent;
}
.visit-day-hours > label span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.visit-day-hours > input:disabled + label {
    background: #e7ebe8;
    color: #7d8680;
    cursor: not-allowed;
    text-decoration: line-through;
}
.visit-day-hours > input:disabled + label span {
    text-decoration: none;
    color: #7d8680;
}
.visit-week-days > input:checked + label span { color: #d8efe3; }
.visit-week-days > label .visit-open-count {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}
.visit-week-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.visit-week-nav .eyebrow { margin: 0; text-align: center; }
.visit-week-nav button {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.visit-week-nav button:disabled { color: var(--muted); cursor: default; }
.visit-week-board[hidden] { display: none; }
.visit-hours { margin: 12px 0 8px; }
.visit-day-hours { display: none; }
.visit-week-board:has(.visit-week-days > input[value="0"]:checked) .visit-day-hours[data-day="0"],
.visit-week-board:has(.visit-week-days > input[value="1"]:checked) .visit-day-hours[data-day="1"],
.visit-week-board:has(.visit-week-days > input[value="2"]:checked) .visit-day-hours[data-day="2"],
.visit-week-board:has(.visit-week-days > input[value="3"]:checked) .visit-day-hours[data-day="3"],
.visit-week-board:has(.visit-week-days > input[value="4"]:checked) .visit-day-hours[data-day="4"],
.visit-week-board:has(.visit-week-days > input[value="5"]:checked) .visit-day-hours[data-day="5"],
.visit-week-board:has(.visit-week-days > input[value="6"]:checked) .visit-day-hours[data-day="6"] {
    display: flex;
}
.visit-book-selected { margin: 8px 0 12px; font-weight: 700; }
.visit-book-typed { max-width: 16rem; }
.my-hours .who { display: flex; flex-direction: column; gap: 4px; max-width: 18rem; margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.my-hours select { min-height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: white; color: var(--ink); }
.my-hours-month,
.my-hours-weekdays,
.my-hours-grid { display: grid; gap: 4px; }
.my-hours-month { grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 8px; }
.my-hours-month h2 { margin: 0; text-align: center; }
#my-hours-prev { justify-self: start; }
#my-hours-next { justify-self: end; }
.my-hours-weekdays, .my-hours-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.my-hours-weekdays { margin-bottom: 4px; color: var(--muted); font-size: 12px; text-align: center; }
.my-hours-nav, button.my-hours-day {
    min-height: 44px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}
button.my-hours-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
}
button.my-hours-day small { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
a.my-hours-nav:hover, button.my-hours-day:hover { background: #edf3ef; color: var(--ink); }
button.my-hours-day.is-open, button.my-hours-day.is-open:hover { background: var(--accent); color: var(--ink); }
button.my-hours-day.is-selected { outline: 2px solid var(--brand); }
.my-hours-day.is-empty { visibility: hidden; }
.my-hours-panel { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.my-hours-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 8px 12px;
    margin-top: 8px;
}
.my-hours-block label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.my-hours-block input { width: 100%; }
.my-hours-block .my-hours-remove { grid-column: 1 / -1; justify-self: start; width: auto; }
.my-hours-repeat {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    column-gap: 8px;
    row-gap: 8px;
    margin-top: 8px;
}
.my-hours-repeat label { display: contents; }
.my-hours-repeat input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; }
.my-hours-repeat input[type="date"] { grid-column: 2; width: min(100%, 16rem); }
.my-hours-lock { margin: 8px 0 0; font-weight: 800; }
.my-hours-add, .my-hours-remove { min-height: 36px; }
.my-hours button:disabled, .my-hours input:disabled { background: #e7ebe8; color: #3e4a44; cursor: not-allowed; }
#my-hours-store { display: none; }
.notice { margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: var(--accent); }
.visit-identity-bar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px 12px;
    align-items: center;
}
.visit-identity-bar .eyebrow { margin: 0; }
.visit-lead-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 16px;
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid #e4dccb;
}
.visit-lead-facts dt {
    margin: 0;
    color: #6a6458;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.visit-lead-facts dd { margin: 3px 0 0; font-weight: 700; line-height: 1.35; }
.visit-lead-facts .typed-capture {
    display: block;
    max-height: 4.6em;
    overflow: auto;
    white-space: pre-wrap;
    font-weight: 600;
}
.visit-lead-hint { margin: 10px 0 0; }
.error-log-footer {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: 12px;
    width: min(960px, calc(100% - 28px));
    margin: 0;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 12px 16px;
    border-radius: 12px;
    border-left: 4px solid var(--danger);
    background: #fff0f0;
    box-shadow: 0 8px 24px rgba(73, 20, 20, .14);
}
.error-log-footer p { margin: 0; flex: 1 1 220px; }
.error-log-footer strong { color: var(--danger); }
.error-log-footer a {
    font-weight: 800;
    white-space: nowrap;
}
.error-log-footer form { margin: 0; }
.error-log-footer button {
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid var(--danger);
    border-radius: 8px;
    background: white;
    color: var(--danger);
    font-weight: 800;
    cursor: pointer;
}
body:has(.error-log-footer) { padding-bottom: 84px; }
body:has(.property-review.has-stage-banner) .error-log-footer { bottom: 88px; }
.page-status-footer {
    margin: 22px 0 0;
    padding: 10px 2px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}
.page-status-footer strong { color: var(--brand-dark); }
.property-review.has-stage-banner { padding-bottom: 96px; }
.property-review .stage-banner {
    position: fixed;
    z-index: 7;
    left: 50%;
    bottom: 12px;
    width: min(960px, calc(100% - 28px));
    margin: 0;
    transform: translateX(-50%);
    padding: 14px 18px;
    border-radius: 12px;
    border-left: 4px solid #2f8a55;
    background: #eaf7ee;
    box-shadow: 0 8px 24px rgba(20, 52, 37, .12);
    line-height: 1.45;
}
.property-review .stage-banner strong {
    display: inline;
    font-size: 1rem;
}
.property-review .stage-banner.error {
    border-left-color: var(--danger);
    background: #fff0f0;
    box-shadow: 0 8px 24px rgba(73, 20, 20, .14);
}
.property-review .stage-banner code {
    display: inline;
    margin-left: 8px;
}
.customer-stage-box {
    position: sticky;
    top: 10px;
    z-index: 6;
    margin: 0 0 14px;
    padding: 8px 12px 10px;
    border-radius: 12px;
    border-left: 4px solid var(--brand);
    background: #f4f7fb;
    box-shadow: 0 8px 24px rgba(20, 52, 37, .12);
}
.customer-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.customer-stage-box .eyebrow { margin: 0; font-size: 11px; line-height: 1.2; }
.customer-stage-box strong { display: block; font-size: 16px; line-height: 1.2; }
.customer-stage-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
    margin: 4px 0 0;
}
.customer-stage-facts div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
    padding: 1px 0;
    border-top: 0;
}
.customer-stage-facts dt {
    margin: 0;
    color: #6a6458;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.customer-stage-facts dd { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.25; }
.customer-fact-wide { grid-column: 1 / -1; }
.customer-note summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    list-style: none;
}
.customer-note summary::-webkit-details-marker { display: none; }
.customer-note .typed-capture {
    display: block;
    margin-top: 4px;
    max-height: 6.5em;
    overflow: auto;
    font-weight: 600;
}
.house-read { margin: 0 0 8px; }
.customer-stage-box h2 { display: inline; margin: 0; font-size: 0.95rem; line-height: 1.25; }
.customer-service-address {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e4dccb;
}
.customer-service-address .property-address { display: inline; margin: 0; }
.customer-service-address .property-address::before { content: " Â· "; font-weight: 600; }
.customer-service-address .property-saved-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.visit-handoff {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(16rem, .85fr);
    gap: 22px 28px;
    align-items: start;
}
.postal-envelope {
    background: #fbf7ee;
    border: 1px solid #d8d0bf;
    border-radius: 0;
    padding: 18px 20px 16px;
    box-shadow: 0 10px 24px rgba(48, 38, 18, .06);
}
.postal-envelope address,
.postal-address {
    display: grid;
    justify-items: start;
    gap: 2px;
    margin: 8px 0 0;
    font-style: normal;
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Times, serif;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 700;
    text-align: left;
}
.postal-address .addr-name { font-size: 1.15em; }
.postal-address .addr-line,
.postal-address .addr-contact { font-weight: 650; }
.postal-address .addr-contact { font-family: inherit; font-size: 15px; }
.postal-stamp {
    margin: 0;
    color: #6a6458;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
}
.visit-property-dossier {
    margin: 0 0 18px;
    padding: 16px 16px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}
.visit-property-dossier h2 { margin: 0 0 6px; font-size: 1.2rem; }
.visit-property-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin: 12px 0 0;
}
.visit-property-facts dt {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.visit-property-facts dd { margin: 2px 0 0; font-weight: 700; }
.visit-slot-card .eyebrow { margin-bottom: 4px; }
.visit-prior-work {
    margin: 0 0 16px;
    padding: 14px 14px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfb;
}
.visit-prior-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.visit-prior-list li { display: grid; gap: 1px; }
.visit-prior-kind {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.capture-match-work { margin: 8px 0 0; }
.visit-handoff-rail .capture-matches,
.visit-handoff-rail .sales-calendar,
.visit-handoff-rail .visit-prior-work {
    margin: 0 0 16px;
    padding: 14px 14px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfb;
}
.sales-calendar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sales-calendar-list li { display: grid; gap: 2px; }
.sales-calendar-list span { color: var(--muted); font-size: 13px; font-weight: 700; }
@media (max-width: 860px) {
    .visit-handoff,
    .visit-property-facts,
    .visit-lead-facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .visit-lead-facts { grid-template-columns: 1fr; }
    .visit-identity-bar { grid-template-columns: 1fr auto; }
}
.capture-review .form-grid { margin-top: 18px; }
.capture-review textarea[readonly] { min-height: 88px; resize: vertical; }
.capture-matches {
    margin: 0 0 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff8f0;
}
.capture-matches .eyebrow { margin-bottom: 10px; }
.capture-gaps {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff4e8;
    border: 1px solid #f0d9c2;
    font-size: 13px;
    line-height: 1.4;
}
.capture-gaps strong { display: block; margin-bottom: 2px; }
.capture-choice-help { margin: 0 0 14px; }
.capture-brief-meta { margin: 4px 0 8px; font-size: 13px; }
.capture-activity { margin: 14px 0 0; }
.capture-activity ul {
    margin: 6px 0 0;
    padding-left: 1.1rem;
}
.capture-activity li { margin: 0 0 4px; font-size: 13px; font-weight: 650; }
.capture-history {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}
.capture-match {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.capture-match a { font-weight: 800; text-decoration: none; }
.capture-match a:hover { text-decoration: underline; }
.capture-match-type { color: var(--brand-dark); font-size: 13px; font-weight: 800; }
.capture-match-why { color: var(--muted); font-size: 13px; font-weight: 650; }
.capture-match-open {
    margin-top: 4px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.capture-program {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eef8f1;
    color: var(--ink);
    font-weight: 650;
    line-height: 1.45;
}
.capture-program strong { display: block; margin-bottom: 4px; color: var(--brand-dark); }
.capture-accept {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}
.capture-accept button { width: 100%; }
.capture-who {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin: 0;
}
.capture-who strong { font-size: 1.15rem; }
.capture-who span { color: var(--muted); font-size: 13px; font-weight: 750; }
.customer-recorded {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.missing-customer-fields {
    margin-top: 12px;
}
.customer-recorded-copy { min-width: 0; }
.customer-recorded-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 0 0 auto;
}
.customer-recorded .eyebrow { margin-bottom: 6px; }
.house-model { margin-top: 18px; }
.offer-attic {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.house-stack {
    display: grid;
    gap: 8px;
    max-width: 960px;
    margin-top: 12px;
}
.house-storey {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}
.house-storey-index {
    min-height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #e8efe9;
    font-weight: 800;
    font-size: 13px;
}
.house-storey-cells {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border: 2px solid var(--brand-dark, #1f4d36);
    border-radius: 10px;
    overflow: visible;
    background: #f7faf8;
}
.house-storey-cells > input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
.house-storey-cells > label {
    flex: 1 1 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 12px 10px;
    text-align: left;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    border-right: 1px solid var(--line);
}
.house-storey-bar {
    display: flex;
    flex: 1 1 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 48px;
    padding: 8px 10px;
}
.house-storey-name {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    font-weight: 800;
    font-size: 13px;
}
.house-storey-count { color: var(--muted); font-weight: 650; font-size: 12px; }
.floor-parts { display: flex; flex-direction: column; gap: 8px; flex: 1 1 100%; min-width: 0; }
.floor-part-add { position: relative; flex: 0 0 auto; }
.floor-part-add > summary {
    list-style: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--brand);
    border-radius: 999px;
    background: white;
    color: var(--brand);
    font-weight: 800;
    cursor: pointer;
}
.floor-part-add > summary::-webkit-details-marker { display: none; }
.floor-part-menu { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.floor-part-choice,
.floor-part-chip {
    font: inherit;
    color: inherit;
    border: 1px solid var(--line);
    background: white;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 700;
    cursor: pointer;
}
.floor-part-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; }
.floor-part-chips > .attic-tab-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
.floor-part-chips > .floor-part-chip { display: none; }
.floor-parts.has-attic .floor-part-chips > .floor-part-chip[data-part="attic"],
.floor-parts.has-stream-painting .floor-part-chips > .floor-part-chip[data-part="painting"],
.floor-parts.has-stream-flooring .floor-part-chips > .floor-part-chip[data-part="flooring"],
.floor-parts.has-stream-electrical .floor-part-chips > .floor-part-chip[data-part="electrical"],
.floor-parts.has-stream-rooms .floor-part-chips > .floor-part-chip[data-part="rooms"] { display: inline-flex; }
.floor-parts:has(.floor-part-chips > input[data-part="attic"]:checked) .floor-part-chips > .floor-part-chip[data-part="attic"],
.floor-parts:has(.floor-part-chips > input[data-part="painting"]:checked) .floor-part-chips > .floor-part-chip[data-part="painting"],
.floor-parts:has(.floor-part-chips > input[data-part="flooring"]:checked) .floor-part-chips > .floor-part-chip[data-part="flooring"],
.floor-parts:has(.floor-part-chips > input[data-part="electrical"]:checked) .floor-part-chips > .floor-part-chip[data-part="electrical"],
.floor-parts:has(.floor-part-chips > input[data-part="rooms"]:checked) .floor-part-chips > .floor-part-chip[data-part="rooms"] {
    display: inline-flex;
}
.floor-part-chips > input:checked + .floor-part-chip {
    background: var(--brand);
    color: white;
    border-color: transparent;
}
.floor-parts.has-attic .floor-part-menu [data-part="attic"],
.floor-parts:has(> .floor-part-chips > input[data-part="painting"]:checked) .floor-part-menu [data-part="painting"],
.floor-parts:has(> .floor-part-chips > input[data-part="flooring"]:checked) .floor-part-menu [data-part="flooring"],
.floor-parts:has(> .floor-part-chips > input[data-part="electrical"]:checked) .floor-part-menu [data-part="electrical"],
.floor-parts:has(> .floor-part-chips > input[data-part="rooms"]:checked) .floor-part-menu [data-part="rooms"] {
    display: none;
}
.floor-part-panels > section { display: none; }
.floor-parts:has(.floor-part-chips > input[data-part="attic"]:checked) > .floor-part-panels > [data-part="attic"],
.floor-parts:has(.floor-part-chips > input[data-part="painting"]:checked) > .floor-part-panels > [data-part="painting"],
.floor-parts:has(.floor-part-chips > input[data-part="flooring"]:checked) > .floor-part-panels > [data-part="flooring"],
.floor-parts:has(.floor-part-chips > input[data-part="electrical"]:checked) > .floor-part-panels > [data-part="electrical"],
.floor-parts:has(.floor-part-chips > input[data-part="rooms"]:checked) > .floor-part-panels > [data-part="rooms"] {
    display: block;
}
.floor-line-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.floor-line-tools > details > summary {
    list-style: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    cursor: pointer;
}
.floor-line-tools > details > summary::-webkit-details-marker { display: none; }
.floor-line-tools svg { width: 16px; height: 16px; display: block; }
.floor-line-delete > summary { color: var(--danger, #9b2c2c); }
.floor-line-tools > details { position: relative; }
.floor-line-tools > details[open] > form {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 5;
    width: min(320px, 80vw);
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    box-shadow: 0 8px 24px rgba(20, 40, 30, 0.12);
}
.floor-stream-form select {
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font: inherit;
    font-weight: 700;
    padding: 4px 8px;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.house-model-menu { position: relative; flex: 0 0 auto; }
.house-model-menu > summary {
    list-style: none;
    cursor: pointer;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--brand-dark, #1f4d36);
    border-radius: 999px;
    background: white;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--brand-dark, #1f4d36);
}
.house-model-menu > summary::-webkit-details-marker { display: none; }
.house-model-menu[open] > summary { background: #edf3ef; }
.house-model-choices {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 8;
    min-width: 140px;
    padding: 6px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(20, 52, 37, .12);
}
.house-model-choices a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--brand-dark, #1f4d36);
    font-weight: 800;
    text-decoration: none;
}
.house-model-choices a:hover { background: #edf3ef; }
.house-work-window {
    display: none;
}
.house-work-window:target {
    display: grid;
    place-items: center;
    position: fixed;
    inset: 0;
    z-index: 40;
    padding: 16px;
}
.house-work-scrim {
    position: absolute;
    inset: 0;
    background: rgba(20, 52, 37, .35);
}
.house-work-panel {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(90vh, 720px);
    overflow: auto;
    padding: 16px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(20, 52, 37, .2);
}
.house-work-panel.attic-work-panel {
    width: min(960px, 100%);
    max-height: min(92vh, 900px);
}
.house-work-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.house-work-head h2 { margin: 0; font-size: 1.2rem; }
.house-work-head .muted { margin: 4px 0 0; }
.house-work-close {
    flex: 0 0 auto;
    font-weight: 800;
    color: var(--brand-dark, #1f4d36);
}
.attic-recorded { margin: 0 0 16px; }
.attic-recorded-item {
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfb;
}
.attic-recorded-item > p { margin: 0 0 8px; }
.attic-size-block { margin: 0 0 10px; }
.attic-size-list { list-style: none; margin: 0 0 8px; padding: 0; }
.attic-size-list li { margin: 0 0 4px; }
.attic-size-total { margin: 0 0 10px; font-weight: 800; }
.attic-char-block { margin: 0 0 10px; }
.attic-char-list { list-style: none; margin: 0 0 8px; padding: 0; }
.attic-char-list li { margin: 0 0 4px; }
.attic-char-form .confirmation-row { margin-bottom: 0; }
.attic-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 8px; }
.attic-tab-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    padding: 0 0 2px;
    border-bottom: 1px solid var(--line);
}
.attic-tab-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.attic-tab-bar > label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #eef3f0;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.attic-tab-bar > input:checked + label,
.attic-tab-bar > input:checked + .attic-tab-add {
    background: white;
}
.attic-tab-add {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 2.2em;
    justify-content: center;
}
.attic-tab-add span { font-weight: 900; }
.attic-tab-delete {
    display: none;
    position: sticky;
    right: 0;
    z-index: 1;
    margin-left: auto;
    align-items: stretch;
}
.attic-tab-delete button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2em;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #f6ecec;
    font-weight: 800;
    cursor: pointer;
}
.attic-tab-panels {
    flex: 1 1 100%;
    padding: 12px 0 0;
}
.attic-add-layer {
    margin: 8px 0 0;
}
.attic-add-layer summary {
    cursor: pointer;
    font-weight: 700;
}
.attic-add-layer form { margin-top: 10px; }
.attic-grid {
    --attic-line: #eef3f0;
    --attic-active-line: #2f5c45;
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 14px;
    font-size: 14px;
}
.attic-grid caption {
    caption-side: top;
    text-align: left;
    font-weight: 800;
    margin: 0 0 6px;
}
.attic-grid th,
.attic-grid td {
    border: 2px solid var(--attic-line);
    padding: 6px 8px;
    text-align: right;
    white-space: nowrap;
}
.attic-grid th:first-child,
.attic-grid td:first-child { text-align: left; }
.attic-grid tbody tr.attic-grid-summary { font-weight: 800; background: #f4f7f5; }
.attic-tab-panels > section { display: none; }
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="1"]:checked) > .attic-tab-panels > [data-floor-tab="1"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="2"]:checked) > .attic-tab-panels > [data-floor-tab="2"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="3"]:checked) > .attic-tab-panels > [data-floor-tab="3"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="4"]:checked) > .attic-tab-panels > [data-floor-tab="4"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="5"]:checked) > .attic-tab-panels > [data-floor-tab="5"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="6"]:checked) > .attic-tab-panels > [data-floor-tab="6"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="7"]:checked) > .attic-tab-panels > [data-floor-tab="7"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="8"]:checked) > .attic-tab-panels > [data-floor-tab="8"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="add"]:checked) > .attic-tab-panels > [data-floor-tab="add"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="1"]:checked) > .attic-tab-panels > [data-measure-tab="1"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="2"]:checked) > .attic-tab-panels > [data-measure-tab="2"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="3"]:checked) > .attic-tab-panels > [data-measure-tab="3"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="4"]:checked) > .attic-tab-panels > [data-measure-tab="4"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="5"]:checked) > .attic-tab-panels > [data-measure-tab="5"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="6"]:checked) > .attic-tab-panels > [data-measure-tab="6"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="7"]:checked) > .attic-tab-panels > [data-measure-tab="7"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="8"]:checked) > .attic-tab-panels > [data-measure-tab="8"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="whole"]:checked) > .attic-tab-panels > [data-measure-tab="whole"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="add"]:checked) > .attic-tab-panels > [data-measure-tab="add"] {
    display: block;
}
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="1"]:checked) > .attic-tab-bar > .attic-tab-delete[data-floor-tab="1"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="2"]:checked) > .attic-tab-bar > .attic-tab-delete[data-floor-tab="2"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="3"]:checked) > .attic-tab-bar > .attic-tab-delete[data-floor-tab="3"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="4"]:checked) > .attic-tab-bar > .attic-tab-delete[data-floor-tab="4"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="5"]:checked) > .attic-tab-bar > .attic-tab-delete[data-floor-tab="5"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="6"]:checked) > .attic-tab-bar > .attic-tab-delete[data-floor-tab="6"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="7"]:checked) > .attic-tab-bar > .attic-tab-delete[data-floor-tab="7"],
.attic-type-tabs:has(> .attic-tab-bar > input[data-floor-tab="8"]:checked) > .attic-tab-bar > .attic-tab-delete[data-floor-tab="8"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="1"]:checked) > .attic-tab-bar > .attic-tab-delete[data-measure-tab="1"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="2"]:checked) > .attic-tab-bar > .attic-tab-delete[data-measure-tab="2"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="3"]:checked) > .attic-tab-bar > .attic-tab-delete[data-measure-tab="3"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="4"]:checked) > .attic-tab-bar > .attic-tab-delete[data-measure-tab="4"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="5"]:checked) > .attic-tab-bar > .attic-tab-delete[data-measure-tab="5"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="6"]:checked) > .attic-tab-bar > .attic-tab-delete[data-measure-tab="6"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="7"]:checked) > .attic-tab-bar > .attic-tab-delete[data-measure-tab="7"],
.attic-measure-tabs:has(> .attic-tab-bar > input[data-measure-tab="8"]:checked) > .attic-tab-bar > .attic-tab-delete[data-measure-tab="8"] {
    display: inline-flex;
}
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="1"]:checked) > .attic-plan > .attic-slice-sep,
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="2"]:checked) > .attic-plan > .attic-slice-sep,
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="3"]:checked) > .attic-plan > .attic-slice-sep,
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="4"]:checked) > .attic-plan > .attic-slice-sep,
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="5"]:checked) > .attic-plan > .attic-slice-sep,
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="6"]:checked) > .attic-plan > .attic-slice-sep,
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="7"]:checked) > .attic-plan > .attic-slice-sep,
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="8"]:checked) > .attic-plan > .attic-slice-sep {
    display: inline;
}
.attic-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    background: #f7faf8;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
}
.attic-board .attic-recorded-item {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.attic-type-rail {
    position: static;
    z-index: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-self: stretch;
    width: auto;
    border-bottom: 0;
    background: transparent;
    overflow: visible;
}
.attic-type-rail > label,
.attic-type-rail > .attic-tab-delete button {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    min-height: 36px;
}
.attic-type-rail > label:not(.attic-tab-add) {
    flex: 0 1 auto;
    min-height: 36px;
    writing-mode: horizontal-tb;
    transform: none;
    justify-content: center;
    padding: 8px 14px;
}
.attic-type-rail > .attic-tab-add {
    position: static;
    flex: 0 0 auto;
    align-self: center;
    margin-left: 8px;
}
.attic-type-rail > .attic-type-end {
    flex: 1 1 auto;
    min-width: 8px;
}
.attic-type-rail > .attic-tab-delete {
    position: static;
    margin-left: 8px;
    margin-top: 0;
}
.attic-type-rail > .attic-tab-delete .attic-bin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    min-width: 0;
    height: 36px;
    padding: 0 12px;
    color: #17211b;
    font-weight: 800;
    white-space: nowrap;
}
.attic-type-rail > .attic-tab-delete .attic-bin svg {
    display: block;
    flex: 0 0 auto;
}
.attic-type-rail > input:checked + label {
    background: var(--brand);
    color: white;
    border-color: transparent;
}
.attic-measure-tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}
.attic-plan {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-self: stretch;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 56px;
    max-height: none;
    border-bottom: 0;
    padding: 8px;
    background: #eef3f0;
    border-radius: 12px;
    overflow: visible;
}
.attic-plan > label {
    justify-content: center;
    min-width: max-content;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    text-align: center;
    white-space: nowrap;
}
.attic-plan > .attic-square-tile {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    height: auto;
    min-height: 40px;
    box-sizing: border-box;
}
.attic-plan-op {
    flex: 0 0 auto;
    align-self: center;
    font-weight: 800;
    padding: 0 2px;
}
.attic-plan > .attic-plan-eq {
    margin-left: 0;
    padding-left: 2px;
}
.attic-plan > input:checked + label {
    background: var(--accent);
    color: var(--brand);
    border-color: var(--brand);
}
.attic-plan > .attic-slice-add {
    position: static;
    align-self: center;
    flex: 0 0 auto;
    width: auto;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    margin-left: auto;
    padding: 0 14px;
    border: 1px dashed var(--brand);
    border-radius: 999px;
    background: white;
    color: var(--brand);
    font-weight: 900;
    box-sizing: border-box;
}
.attic-plan > input:checked + .attic-slice-add {
    background: var(--accent);
    color: var(--brand);
    border-style: solid;
    border-color: var(--brand);
}
.attic-plan > .attic-whole-chip {
    flex: 0 0 auto;
    align-self: center;
    min-width: max-content;
    min-height: 40px;
    border-radius: 999px;
    white-space: nowrap;
}
.attic-measure-tabs > .attic-read {
    display: none;
    grid-column: 1;
    grid-row: 3;
    flex: none;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: visible;
}
.attic-measure-tabs.attic-whole-form:has(> .attic-plan > input[data-measure-tab="whole"]:checked) > .attic-read,
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="add"]:checked) > .attic-read {
    display: block;
    grid-row: 2;
}
.attic-measure-tabs.attic-whole-form:has(> .attic-plan > input[data-measure-tab="whole"]:checked) > .attic-sheets,
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="add"]:checked) > .attic-sheets {
    grid-row: 3;
}
.attic-count-edit {
    width: 4.2em;
    margin: 0;
    padding: 2px 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    text-align: right;
    font: inherit;
}
.attic-count-form > button { margin-top: 8px; }
.attic-read .property-step { font-size: 1.05rem; }
.attic-read .attic-char-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
}
.attic-read .attic-char-list li {
    margin: 0;
    padding-top: 6px;
    border-top: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
}
.attic-read .insulation-layers {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    margin: 8px 0;
    padding: 0;
    list-style: none;
}
.attic-read .insulation-layers li {
    margin: 0;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--accent);
}
.attic-read .attic-add-layer { margin: 8px 0 0; }
.attic-read .attic-add-layer summary {
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.attic-read .form-grid { margin-top: 10px; gap: 10px; }
.attic-sheets {
    grid-column: 1;
    grid-row: 2;
    display: block;
    min-width: 0;
}
.attic-sheet {
    max-height: none;
    overflow: visible;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.attic-sheets .attic-grid {
    margin: 0;
    background: white;
    border-collapse: collapse;
    overflow: visible;
}
.attic-square-cols th {
    background: #f7faf8;
    vertical-align: bottom;
    text-align: center;
    font-size: 12px;
    font-weight: 750;
}
.attic-grid-summary th,
.attic-grid-summary td {
    background: #f4f7f5;
    font-weight: 800;
}
.attic-counts-side,
.attic-sheets .attic-square-cols > :nth-child(8),
.attic-sheets .attic-grid-summary > :nth-child(8) {
    width: 6.5rem;
    min-width: 6.5rem;
    max-width: 6.5rem;
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
    box-sizing: border-box;
}
.attic-square-title-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.attic-square-heading {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}
.attic-slice-total {
    flex: 0 0 auto;
    font-weight: 800;
}
.attic-square-heading .attic-size-edit,
.attic-square-heading .attic-size-sub {
    margin-left: auto;
}
.attic-square-delete-form {
    margin-left: auto;
    flex: 0 0 auto;
}
.attic-square-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    margin: 0;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: #17211b;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}
.attic-square-delete svg { display: block; }
.attic-size-sub {
    margin-left: 8px;
    font-weight: 450;
    color: #66736c;
}
.attic-square-heading .attic-size-show,
.attic-square-heading .attic-size-sub,
.attic-square-heading .attic-size-form {
    margin-left: 0;
}
.attic-size-show {
    margin-left: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #66736c;
    font: inherit;
    font-weight: 450;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.attic-size-form:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}
.attic-size-form input {
    width: 5em;
    margin: 0;
    min-height: 32px;
}
.attic-size-update { margin: 0; }
.attic-insul .attic-layer-grid {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: transparent;
}
.attic-insul .attic-layer-grid th,
.attic-insul .attic-layer-grid td {
    border: 0;
    border-bottom: 2px solid var(--attic-line);
    padding: 6px 0;
    text-align: left;
    background: transparent;
    white-space: normal;
    font-weight: 450;
}
.attic-insul .attic-layer-grid td { text-align: right; }
.attic-layer-remove-form {
    display: inline-flex;
    margin: 0 0 0 6px;
    vertical-align: middle;
}
.attic-layer-remove {
    visibility: hidden;
    width: 22px;
    min-height: 22px;
    margin: 0;
    padding: 2px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #17211b;
    cursor: pointer;
}
.attic-layer-grid tr:hover .attic-layer-remove,
.attic-layer-grid tr:focus-within .attic-layer-remove {
    visibility: visible;
}
.attic-layer-remove:hover,
.attic-layer-remove:focus-visible {
    background: var(--canvas);
    color: var(--danger);
}
.attic-layer-total {
    text-align: left;
    white-space: nowrap;
    vertical-align: bottom;
    font-weight: 650;
}
.attic-layer-total .attic-r-value,
.attic-layer-total .attic-layer-depth {
    display: inline;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}
.attic-layer-total .attic-layer-depth {
    margin-left: 0.4em;
}
.attic-square-gap td {
    height: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 0;
    line-height: 0;
}
.attic-summary-gap td {
    height: 5px;
}
.attic-grid .col {
    display: block;
    font-size: 0.75rem;
    font-weight: 650;
    text-align: left;
}
td.attic-insul {
    background: var(--accent);
    vertical-align: top;
    text-align: left;
    white-space: normal;
    width: 26%;
}
.attic-insul-card {
    padding: 8px 10px;
    background: var(--paper);
    border: 2px solid var(--attic-line);
    border-radius: 8px;
}
.attic-insul-card .property-step {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 750;
}
.attic-insul-card .insulation-layers,
.attic-insul-card p {
    margin: 0 0 6px;
}
.attic-insul-card .muted {
    margin: 0;
}
.attic-insul-card .insulation-layers {
    padding: 0;
    list-style: none;
}
.attic-record-label {
    margin: 0 0 4px;
    font-weight: 650;
    text-align: left;
}
.attic-record-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}
.attic-record-line select,
.attic-record-line input {
    min-height: 32px;
    margin: 0;
}
.attic-record-line input[name="depth_value"] { width: 6em; }
.attic-record-line button {
    min-height: 32px;
    padding: 2px 12px;
}
.attic-square-counts > th {
    vertical-align: middle;
    white-space: nowrap;
}
.attic-counts-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.attic-sheet-save {
    min-height: 26px;
    margin: 0;
    padding: 1px 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
}
.attic-sheet-save[hidden] {
    display: inline-block;
    visibility: hidden;
}
.attic-sheet-save:hover { background: var(--brand-dark); }
.attic-sheets tr[data-measure-tab] { cursor: pointer; }
.attic-sheets th label { cursor: pointer; }
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="1"]:checked) .attic-sheets tbody.attic-slice[data-measure-tab="1"],
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="2"]:checked) .attic-sheets tbody.attic-slice[data-measure-tab="2"],
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="3"]:checked) .attic-sheets tbody.attic-slice[data-measure-tab="3"],
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="4"]:checked) .attic-sheets tbody.attic-slice[data-measure-tab="4"],
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="5"]:checked) .attic-sheets tbody.attic-slice[data-measure-tab="5"],
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="6"]:checked) .attic-sheets tbody.attic-slice[data-measure-tab="6"],
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="7"]:checked) .attic-sheets tbody.attic-slice[data-measure-tab="7"],
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="8"]:checked) .attic-sheets tbody.attic-slice[data-measure-tab="8"],
.attic-measure-tabs:has(> .attic-plan > input[data-measure-tab="whole"]:checked) .attic-sheets tbody.attic-slice[data-measure-tab="whole"] {
    outline: 3px solid var(--attic-active-line);
    outline-offset: -3px;
}
.attic-sheets td.attic-insul,
.attic-sheets .attic-square-record > td {
    background: var(--accent) !important;
    border-color: var(--attic-line) !important;
    box-shadow: none;
}
.attic-sheets .attic-square-record .attic-record-line select,
.attic-sheets .attic-square-record .attic-record-line input {
    background: var(--paper);
}
@media (max-width: 720px) {
    .attic-measure-tabs,
    .attic-sheets { grid-template-columns: 1fr; }
    .attic-plan {
        grid-column: 1;
        grid-row: 1;
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
        max-width: none;
    }
    .attic-sheets { grid-column: 1; }
    .attic-measure-tabs > .attic-read { grid-column: 1; }
    .attic-type-rail { overflow: visible; }
}
.attic-area-live {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #edf3ef;
    font-weight: 800;
}
.house-storey-cells > label:last-of-type { border-right: none; }
.house-storey-cells > input:checked + label {
    background: white;
    box-shadow: inset 0 0 0 2px var(--brand, #2e6b4a);
}
.house-storey-cells > .house-area-detail {
    display: none;
    flex: 1 0 100%;
    padding: 14px;
    background: white;
    border-top: 1px solid var(--line);
}
.house-storey-cells > input:checked + label + .house-area-detail {
    display: block;
}
.house-storey-add .house-storey-index { background: white; }
.house-work-add {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.property-saved h2 { margin: 0 0 4px; font-size: 1.2rem; }
.property-saved-head {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.insulation-layers { margin: 0 0 10px; padding-left: 1.2rem; }
.attic-area-line td { color: var(--muted); font-weight: 700; }
.property-review .property-address { margin: 0 0 12px; color: var(--muted); }
.property-review .customer-service-address .property-address { display: inline; margin: 0; }
.house-next {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 22px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.house-next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.house-next-note { color: var(--muted); font-size: 13px; }
.button-link.is-disabled {
    background: #d5ddd8;
    color: #5e6b63;
    pointer-events: none;
}
.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--brand);
    color: white;
    font-weight: 800;
    text-decoration: none;
}
.visit-property-line {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}
.visit-property-line .eyebrow { margin: 0 0 4px; }
.visit-property-line .property-address { margin: 0 0 8px; }
.visit-review .card,
.assessment-review .card { margin-top: 0; }
.assessment-review .visit-appointment p { margin: 0 0 8px; }
.assessment-before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.assessment-before,
.assessment-after {
    padding: 12px;
    border-radius: 10px;
    min-width: 0;
}
.assessment-before { background: #f3f4f3; }
.assessment-after { background: #eef8f1; border: 1px solid var(--accent); }
@media (max-width: 700px) {
    .assessment-before-after { grid-template-columns: 1fr; }
}
.assessment-review .house-model > h2 { margin: 0 0 4px; }
.assessment-review .attic-board { margin-top: 12px; }
.assessment-review .attic-type-rail { margin: 0 0 12px; }
.assessment-review .attic-place {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    color: inherit;
    font-weight: 800;
    text-decoration: none;
}
.assessment-review .attic-place.is-current {
    background: var(--brand);
    color: white;
    border-color: transparent;
}
.upgrade-report { margin-top: 16px; }
.upgrade-report h3 { margin: 0 0 4px; font-size: 18px; }
.upgrade-report-place { margin: 14px 0 6px; font-weight: 800; }
.upgrade-report-grid {
    width: 100%;
    border-collapse: collapse;
    background: white;
}
.upgrade-report-grid th,
.upgrade-report-grid td {
    border: 2px solid #eef3f0;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    white-space: normal;
}
.upgrade-report-grid th { background: #f7faf8; }
.upgrade-report-grid th .eyebrow { margin: 0; }
.upgrade-report-grid .count { width: 5em; text-align: right; font-weight: 800; }
.upgrade-report-detail {
    display: block;
    margin-top: 4px;
    color: #5d6f66;
    font-weight: 650;
}
.assessment-review .attic-board .upgrade-saved {
    margin: 8px 0 0;
    padding: 8px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}
.assessment-review .attic-square-title-bar { margin: 0 0 8px; }
.assessment-review .upgrade-place { margin: 0 0 12px; }
.assessment-review .upgrade-board,
.upgrade-saved { overflow-x: auto; margin: 0 0 12px; }
.assessment-review .upgrade-grid,
.upgrade-saved-row {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.assessment-review .upgrade-grid thead th { text-align: center; }
.assessment-review .upgrade-grid tbody th { text-align: left; }
.assessment-review .upgrade-grid th,
.assessment-review .upgrade-grid td {
    border: 2px solid #eef3f0;
    padding: 6px 8px;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}
.assessment-review .upgrade-grid th:first-child {
    text-align: left;
    font-weight: 800;
}
.upgrade-saved {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}
.upgrade-saved-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}
.upgrade-line {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    max-width: 100%;
}
.upgrade-count { font-weight: 800; }
.upgrade-qty {
    width: 4.2em;
    margin: 0;
    padding: 2px 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    text-align: right;
    font: inherit;
}
.upgrade-glance { justify-content: flex-start; width: 100%; }
.upgrade-glance > p {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upgrade-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: inherit;
    cursor: pointer;
    list-style: none;
}
.upgrade-icon::-webkit-details-marker { display: none; }
.upgrade-icon svg { width: 16px; height: 16px; display: block; }
.upgrade-pop { position: relative; }
.upgrade-pop > .upgrade-panel {
    display: none;
}
.upgrade-pop[open] > .upgrade-panel {
    display: block;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 8;
    width: min(280px, 70vw);
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    box-shadow: 0 8px 24px rgba(20, 40, 30, 0.12);
    text-align: left;
    white-space: normal;
}
.upgrade-panel p { margin: 0 0 8px; }
.upgrade-panel p:last-child { margin-bottom: 0; }
.upgrade-panel select { width: 100%; }
.assessment-review .upgrade-col.is-invalid {
    box-shadow: inset 0 0 0 2px #9b2c2c;
    background: #fff6f5;
}
.assessment-review .upgrade-correction { color: #9b2c2c; font-weight: 700; }
.assessment-review .upgrade-picks {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.assessment-review .upgrade-add[hidden] { display: none; }
.assessment-review .upgrade-sheet .actions { margin-top: 12px; }
.upgrade-arrange {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}
.upgrade-arrange button {
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    color: inherit;
    font: inherit;
    font-weight: 700;
}
.upgrade-arrange button[aria-pressed="true"] {
    background: var(--brand);
    border-color: transparent;
    color: white;
}
.upgrade-stack { display: flex; flex-direction: column; }
.upgrade-stack.is-below .upgrade-pair { grid-template-columns: minmax(0, 1fr); }
.upgrade-group { margin: 18px 0 10px; font-size: 16px; }
.upgrade-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 12px;
    align-items: start;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 2px solid #c5d5cc;
    border-radius: 14px;
    background: white;
}
.upgrade-insulation {
    border-color: #194f38;
    background: #f4faf6;
    margin-bottom: 8px;
}
.upgrade-insulation .eyebrow { margin: 0 0 4px; }
.upgrade-insulation-found { margin: 0 0 4px; font-weight: 650; }
.insulation-recommend { width: 100%; border-collapse: collapse; margin-top: 8px; }
.insulation-recommend th,
.insulation-recommend td {
    padding: 8px 10px;
    border-bottom: 1px solid #d5e4db;
    text-align: left;
    vertical-align: middle;
}
.insulation-recommend th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: #3d5c4c; }
.insulation-span { margin: 8px 0 0; font-weight: 700; color: #136c8d; }
.insulation-addon td { background: #f3f8e7; }
.insulation-addon .muted { display: block; font-size: 12px; }
.insulation-addon input:disabled + span { color: #8aa09a; }
.insulation-pick { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.insulation-pick input { width: 1.1rem; height: 1.1rem; }
.upgrade-insulation-hint { margin: 0 0 12px; }
.upgrade-offer-line { margin: 0 0 8px; font-weight: 700; }
.upgrade-offer-pick { display: block; margin: 0 0 8px; font-weight: 700; }
.upgrade-offer-pick select { display: block; width: min(100%, 28rem); margin-top: 4px; }
.upgrade-work h3 { margin: 0 0 8px; font-size: 16px; }
.upgrade-found {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-weight: 800;
}
.upgrade-need { font-weight: 800; }
.assessment-review .upgrade-pair .upgrade-picks { align-items: flex-start; }
.assessment-review .upgrade-pair .upgrade-line { justify-content: flex-start; }
.upgrade-final {
    min-width: 0;
    background: white;
    border: 2px solid #eef3f0;
    border-radius: 12px;
    padding: 10px;
}
.upgrade-final table { width: 100%; border-collapse: collapse; }
.upgrade-final td {
    padding: 6px 8px;
    border-bottom: 1px solid #eef3f0;
    text-align: left;
    vertical-align: top;
    white-space: normal;
}
.upgrade-final td[colspan] { font-weight: 700; }
.upgrade-final .total {
    width: 7.5em;
    text-align: right;
    font-weight: 800;
    white-space: nowrap;
}
.upgrade-final-empty { margin: 0; color: #5d6f66; }
.upgrade-final [hidden] { display: none; }
@media (max-width: 800px) {
    .upgrade-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
    .upgrade-saved-row { grid-template-columns: 1fr; }
}
.visit-history { margin-top: 16px; }
.visit-appointment {
    position: relative;
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}
.visit-appointment-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.visit-appointment time {
    display: block;
    margin: 0 0 4px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
}
.visit-appointment .eyebrow { margin: 0 0 4px; }
.visit-appointment .muted { margin: 0; }
.visit-note {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 0;
}
.visit-note-copy { min-width: 0; }
.visit-note-copy > p { margin: 0; }
.visit-note-copy .muted { margin-top: 4px; }
.visit-appointment .timeline { margin-top: 12px; }
.property-guide { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 18px; }
.property-step { margin: 0 0 6px; font-weight: 800; }
.saved-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.saved-chips li {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #eef8f1;
    font-size: 13px;
    font-weight: 700;
}
.attic-saved {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfb;
    display: grid;
    gap: 10px;
}
.attic-saved > p { margin: 0; }
.lead-capture-page .page-heading h1 { font-size: clamp(22px, 3vw, 30px); }
.lead-capture-grid { gap: 12px; margin-top: 12px; }
.capture-scratch-frame {
    position: relative;
    display: block;
}
.capture-scratch textarea {
    min-height: 148px;
    padding-bottom: 44px;
    font-size: 16px;
    line-height: 1.4;
    resize: vertical;
}
.lead-extra { margin-top: 4px; }
.lead-extra > summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 800;
}
/* ------------------------------------------------------------------
   BUS-013 Revision 14: the lead page (/leads/{id}) in plain cards.
   Replaces the cream "Atticare File" style. Status chip, summary with the
   match strip, Next step card with one panel per action, sectioned
   details with one Save changes, one History timeline.
   ------------------------------------------------------------------ */
.lp { width: min(980px, calc(100% - 24px)); }
.lp .page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.lp .page-heading .muted { margin: 6px 0 0; }
.lp-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; background: #fff4e8; color: #8a5a12; border: 1px solid #f0d9c2; }
.lp-status.is-active { background: var(--accent); color: var(--brand-dark); border-color: #cfe0d6; }
.lp-status.is-out { background: #fde8e8; color: var(--danger); border-color: #f3c9c9; }
.lp-head-end { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lp-stack { display: grid; gap: 14px; }
.lp-stack > .card { margin: 0; }
.lp-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.lp-summary div { min-width: 0; }
.lp-summary dt { color: var(--muted); font-size: 12px; font-weight: 600; margin: 0 0 3px; }
.lp-summary dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.lp-summary .lp-wide { grid-column: span 2; }
.lp-owner-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line, #e5e7eb); }
.lp-summary a, .lp-match a { color: var(--brand); }
.lp-match { margin: 14px 0 0; padding: 10px 12px; border: 1px solid #e4d2b0; border-radius: 10px; background: #fff7ea; }
.lp-match p { margin: 0; }
.lp-match a { font-weight: 800; }
.lp-match .capture-history { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.lp-match .capture-match { padding: 0; border: 0; background: transparent; }
.lp-section { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.lp-section:first-of-type { border-top: 0; padding-top: 0; }
.lp-section h2 { margin: 0 0 2px; }
.lp-section .form-grid { margin-top: 10px; gap: 12px; }
.lp-actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.lp-actions-row .lp-label { font-weight: 800; margin-right: 2px; }
.lp-actions-row .lp-sep { flex: 1 1 auto; }
.lp-actions-row > form { display: inline; margin: 0; }
.lp-note { margin: 0; font-size: 13px; }
button.secondary.is-open { background: var(--accent); border-color: #cfe0d6; }
.lp-panel { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f7faf8; }
.lp-panel h3 { margin: 0 0 4px; font-size: 16px; }
.lp-panel .form-grid { margin-top: 8px; gap: 12px; }
.lp-panel[hidden] { display: none; }
.lp details.lead-extra { margin-top: 12px; }
.lp-programs .program-checkmarks { display: grid; gap: 6px; }
.lp-programs input { width: auto; flex: 0 0 auto; }
.lp-timeline { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 0; }
.lp-timeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.lp-timeline time { color: var(--muted); font-size: 13px; font-weight: 650; }
.lp-timeline .muted { font-size: 13px; }
.lp-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin: 10px 0 0; }
.lp-kv > div { min-width: 0; }
.lp-kv > div.full { grid-column: 1 / -1; }
.lp-kv dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.lp-kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.lp-kv dd.typed-capture { font-weight: 400; white-space: pre-wrap; }
@media (max-width: 760px) {
    .lp-summary, .lp-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lp .form-grid { grid-template-columns: 1fr; }
    .lp-timeline li { grid-template-columns: 1fr; }
    .lp-actions-row .lp-sep { display: none; }
    .lp-actions-row .lp-label { width: 100%; }
    .lp-actions-row > form:first-child, .lp-actions-row > form:first-child button { width: 100%; }
    .lp-actions-row button.secondary { flex: 1 1 40%; }
}
.lead-programs {
    margin: 4px 0 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f7faf8;
}
.lead-programs > summary { margin-bottom: 8px; }
.program-checkmarks {
    display: grid;
    gap: 8px;
    margin: 8px 0 0;
}
.program-checkmarks label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-weight: 650;
    line-height: 1.35;
}
.program-checkmarks input {
    width: auto;
    flex: 0 0 auto;
    margin-top: 3px;
}
.lead-extra .form-grid { margin-top: 12px; }
input.is-autofilled, textarea.is-autofilled { background: #eef8f1; }
.capture-tips,
.capture-hint {
    position: absolute;
    left: 10px;
    right: 10px;
    margin: 0;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    line-height: 1.3;
}
.capture-tips {
    bottom: 6px;
    color: var(--muted);
    font-weight: 650;
}
.capture-hint {
    bottom: 22px;
    color: #8a5a12;
    font-weight: 650;
}
.capture-status { margin: 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.capture-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.capture-facts li {
    display: inline-flex;
    gap: 6px;
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid #cfe0d6;
    border-radius: 999px;
    background: #eef8f1;
    color: #21613c;
    font-size: 12px;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.capture-facts strong { color: var(--brand-dark); }
dd.typed-capture,
.typed-capture {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
body.quote-page { background: var(--canvas); }
.quote-bar { display: flex; align-items: center; min-height: 56px; padding: 0 20px; background: var(--brand); color: white; }
.quote-bar p { margin: 0; font-weight: 800; letter-spacing: .04em; }
.quote-sheet { width: min(720px, calc(100% - 32px)); margin: 28px auto 48px; padding: 28px 28px 24px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 28px rgba(20, 52, 37, .06); }
.quote-sheet h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 36px); }
.quote-lead { margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.quote-alert { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: #fde8e8; color: var(--danger); font-weight: 800; }
.quote-status { margin: 0 0 18px; padding: 14px 16px; border-radius: 12px; font-weight: 800; }
.quote-status.is-accepted { background: #eaf7ee; color: #21613c; }
.quote-status.is-declined, .quote-status.is-closed { background: #edf3ef; color: var(--ink); }
.quote-lines { margin: 8px 0 18px; }
.quote-lines table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.quote-lines th, .quote-lines td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.quote-lines th { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.quote-lines td:first-child { font-weight: 700; }
.quote-lines th.number, .quote-lines .number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-totals { display: grid; gap: 8px; margin: 0 0 16px; }
.quote-totals div { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: baseline; }
.quote-totals dt { color: var(--muted); }
.quote-totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.quote-totals .is-total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 18px; }
.quote-totals .is-total dt, .quote-totals .is-total dd { color: var(--ink); font-weight: 800; }
.quote-until { margin: 0; color: var(--muted); }
.quote-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.quote-actions button { min-width: 12rem; }
@media (max-width: 640px) {
    .quote-sheet { width: min(100% - 16px, 720px); margin-top: 16px; padding: 20px 16px; }
    .quote-lines thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
    .quote-lines tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .quote-lines td { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border: 0; }
    .quote-lines td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .quote-lines .number { text-align: right; }
    .quote-actions { flex-direction: column; }
    .quote-actions button { width: 100%; }
}
#atticare-quote-root { display: block; width: 100%; }
.quote-tools { width: min(100%, 794px); margin: 12px auto 0; display: block; }
.quote-tools form, .quote-tools p { margin: 0; }
.quote-step { margin: 0 0 16px; }
.quote-step form, .quote-finished { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.quote-step label { display: grid; gap: 4px; font-weight: 800; }
.quote-step input[type="date"] { font: inherit; font-weight: 500; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.quote-step p, .quote-finished p { flex-basis: 100%; margin: 6px 0 0; max-width: 40rem; }
.quote-kept { flex-basis: 100%; }
.quote-kept h2 { font-size: 1rem; margin: 8px 0; }
.quote-kept ul { margin: 0; padding-left: 1.2rem; }
.quote-tools .muted { flex-basis: 100%; }
.quote-discount { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.quote-discount legend { font-weight: 800; padding: 0 4px; }
.quote-discount input[type="radio"] { margin-right: 4px; }
#quote-discount-value { width: 8rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; }
.quote-amount { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.quote-amount input { width: 8rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; font-weight: 500; }
#quote-save-dialog { border: 0; border-radius: 10px; padding: 20px; max-width: 28rem; }
#quote-save-dialog::backdrop { background: rgba(23, 33, 27, .35); }
#quote-save-dialog .actions { display: flex; gap: 8px; justify-content: flex-end; }
.paper-office { width: min(100%, 860px); margin: 12px auto 0; }
.paper-office > summary { cursor: pointer; font-weight: 800; color: var(--brand); }
@media print {
    @page { size: A4; margin: 0; }
    body:has(#stage-estimates #current-stage) {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    body:has(#stage-estimates #current-stage) .topbar,
    body:has(#stage-estimates #current-stage) .back-link,
    body:has(#stage-estimates #current-stage) .page-heading,
    body:has(#stage-estimates #current-stage) .workspace-sticky,
    body:has(#stage-estimates #current-stage) .quote-tools,
    body:has(#stage-estimates #current-stage) .house-next,
    body:has(#stage-estimates #current-stage) .paper-office,
    body:has(#stage-estimates #current-stage) .history-disclosure,
    body:has(#stage-estimates #current-stage) .stage-block:not(#stage-estimates) { display: none !important; }
    body:has(#stage-estimates #current-stage) .relationship-file,
    body:has(#stage-estimates #current-stage) .stage-file,
    body:has(#stage-estimates #current-stage) #stage-estimates,
    body:has(#stage-estimates #current-stage) #atticare-quote-root {
        display: block !important;
        overflow: visible !important;
        width: 210mm !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
    }
    body:has(#stage-invoices #current-stage) .topbar,
    body:has(#stage-invoices #current-stage) .back-link,
    body:has(#stage-invoices #current-stage) .page-heading,
    body:has(#stage-invoices #current-stage) .workspace-sticky,
    body:has(#stage-invoices #current-stage) .invoice-print,
    body:has(#stage-invoices #current-stage) .invoice-tools,
    body:has(#stage-invoices #current-stage) .invoice-office,
    body:has(#stage-invoices #current-stage) .history-disclosure,
    body:has(#stage-invoices #current-stage) #invoices > h2,
    body:has(#stage-invoices #current-stage) .stage-block:not(#stage-invoices) { display: none !important; }
    body:has(#stage-invoices #current-stage) #stage-invoices,
    body:has(#stage-invoices #current-stage) [data-invoice-sheet] {
        display: block !important;
        overflow: visible !important;
        width: 210mm !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ------------------------------------------------------------------
   BUS-013 Revision 13: shared field label pattern.
   Required names bold, optional names normal weight; the detail sits in
   an "i" tooltip (title on hover, the bubble on hover/focus/tap, and a
   visually hidden description tied to the control for screen readers).
   Markup: .field > .field-head > label.field-name.is-required|is-optional
           + button.field-tip[data-tip][title][aria-label]
   ------------------------------------------------------------------ */
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field-head { display: flex; align-items: center; gap: 6px; position: relative; }
label.field-name, .field-name { display: inline; color: var(--ink); font-size: 14px; }
.field-name.is-required { font-weight: 800; }
.field-name.is-optional { font-weight: 400; }
label .field-name { color: var(--ink); font-size: 14px; }
label .field-name.is-optional { font-weight: 400; }
label .field-name.is-required { font-weight: 800; }
.field-tip {
    position: relative;
    min-height: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    flex: 0 0 22px;
    border: 1px solid #b9c8bf;
    border-radius: 50%;
    background: white;
    color: var(--brand);
    font: italic 700 13px/20px Georgia, "Times New Roman", serif;
    text-align: center;
    cursor: help;
}
.field-tip:hover { background: var(--accent); }
.field-tip::before {
    /* Tap target of about 40px without making the icon bigger. */
    content: "";
    position: absolute;
    inset: -9px;
}
.field-tip::after {
    content: attr(data-tip);
    position: absolute;
    z-index: 25;
    left: 50%;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: min(18rem, 80vw);
    padding: 8px 10px;
    border-radius: 8px;
    background: #17211b;
    color: white;
    font: 400 13px/1.35 Inter, ui-sans-serif, system-ui, sans-serif;
    text-align: left;
    white-space: normal;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease;
}
.field-tip:hover::after,
.field-tip:focus-visible::after,
.field-tip[aria-expanded="true"]::after { opacity: 1; visibility: visible; }
@media (max-width: 720px) {
    /* On a phone the tip spans the label row so it never runs off screen. */
    .field-head { position: relative; }
    .field-tip { position: static; }
    .field-tip::before { inset: auto; width: 40px; height: 40px; margin: -9px 0 0 -9px; }
    .field-tip::after { left: 0; right: 0; width: auto; max-width: none; transform: none; }
}
.field-pair { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; }
.field-check .check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
}
.field-check { grid-template-columns: auto 1fr; align-items: center; column-gap: 6px; }
.field-check .check-label input { width: 22px; height: 22px; margin: 0; flex: 0 0 22px; }
.field-check .field-wording { grid-column: 1 / -1; margin: 0; font-size: 13px; }

/* New lead (BUS-013 Revision 13): sections, questions panel, buttons. */
.lead-new-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: 16px;
    align-items: start;
    margin-top: 12px;
}
.lead-new-layout > .lead-new-form { grid-column: 1; grid-row: 1; margin: 0; }
.lead-new-layout > .caller-questions-panel { grid-column: 2; grid-row: 1; position: sticky; top: 60px; }
.lead-section {
    margin: 4px 0 0;
    padding: 12px 14px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    min-width: 0;
}
.lead-section > legend {
    padding: 0 6px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.lead-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}
.lead-more-details > .lead-section-grid { margin-top: 12px; }
.lead-section .lead-programs { margin: 0; }
.lead-record-actions { justify-content: flex-start; flex-wrap: wrap; }
/* BUS-013 Revision 13 (N16): Clear and Cancel are quiet secondary actions. */
.button-link.button-quiet {
    background: white;
    color: var(--brand-dark);
    border: 1px solid var(--line);
    font-weight: 700;
}
.button-link.button-quiet:hover { background: #edf3ef; }
/* BUS-013 Revision 13 (N9): grey format example on the label line. */
.field-example {
    margin-left: 6px;
    color: var(--muted);
    font-weight: 400;
    font-size: 0.86em;
    white-space: nowrap;
}
.field-name.capture-name { font-weight: 700; }
.capture-status:empty { display: none; }
.field-fixed-value {
    margin: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px dashed var(--line);
    border-radius: 9px;
    background: #f5f7f6;
    font-weight: 700;
}
.lead-recorded-notice {
    border-left: 5px solid #2e8b57;
    background: #dff3e7;
    color: #134a2c;
}
.caller-questions { margin: 0; padding: 14px 16px; }
.caller-questions > summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 800;
}
.caller-questions ul { margin: 10px 0 0; display: grid; gap: 6px; }
.caller-question {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    line-height: 1.3;
    cursor: pointer;
}
.caller-question input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 18px; }
.caller-question span { color: var(--ink); font-size: 14px; font-weight: 400; }
.caller-question input:checked + span { color: var(--muted); text-decoration: line-through; }
.caller-questions-foot { margin: 10px 0 0; font-size: 12px; }
@media (max-width: 900px) {
    .lead-new-layout { grid-template-columns: minmax(0, 1fr); }
    .lead-new-layout > .caller-questions-panel { grid-column: 1; grid-row: 1; position: static; }
    .lead-new-layout > .lead-new-form { grid-row: 2; }
}
@media (max-width: 720px) {
    .lead-section-grid { grid-template-columns: minmax(0, 1fr); }
    .lead-section { padding: 10px 10px 12px; }
    .lead-section-grid > .full { grid-column: auto; }
    .lead-record-actions button { flex: 1 1 100%; }
}

/* Desk (BUS-013 Revision 13): Today's notes and the 4 PM calls reminder. */
.desk-daily-note { border-left: 5px solid #d9a521; }
.desk-daily-note h2 { margin-top: 0; }
.desk-daily-note-body { font-size: 16px; line-height: 1.5; white-space: normal; }
.desk-daily-note > .muted { margin: 8px 0 0; font-size: 13px; }
.desk-daily-note-edit { margin-top: 12px; }
.desk-daily-note-edit .form-grid { margin-top: 12px; }
.desk-note-history { margin: 6px 0 0; font-size: 14px; }
.desk-calls-reminder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-left: 5px solid #2e6fb5;
    background: #eef5fc;
}
.desk-calls-reminder h2 { margin: 0 0 4px; font-size: 18px; }
.desk-calls-reminder p { margin: 0; }
.desk-calls-done { font-weight: 700; color: #134a2c; }

/* BUS-013 Revision 16: Leads work queue (walkthrough page 3, mockup v5). */
.wq-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.wq-tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line, #d6dbd8); text-decoration: none; color: var(--ink, #1d2b25); font-weight: 700; font-size: 14px; background: #fff; }
.wq-tabs a.on { background: var(--brand-dark, #17402f); color: #fff; border-color: var(--brand-dark, #17402f); }
.wq-tabs .n { font-weight: 600; opacity: .75; margin-left: 6px; }
.wq-search label { display: block; margin-bottom: 5px; font-size: 14px; }
.wq-search label .field-name { font-weight: 700; }
.wq-search label .muted { font-weight: 400; }
.wq-search-row { display: flex; gap: 10px; align-items: center; }
.wq-search-row input { flex: 1 1 auto; min-width: 0; }
.wq-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: 14px; }
.wq-filter .lp-label { font-weight: 800; margin-right: 2px; }
.wq-filter a { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line, #d6dbd8); text-decoration: none; color: var(--ink, #1d2b25); }
.wq-filter a.on { border-color: var(--brand-dark, #17402f); font-weight: 700; }
.wq-table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.wq-table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line, #e5e7eb); }
.wq-table th:nth-child(1) { width: 56%; }
.wq-table th:nth-child(2) { width: 15%; }
.wq-table th:nth-child(3) { width: 14%; }
.wq-received { white-space: nowrap; }
.wq-table td { padding: 10px; border-bottom: 1px solid #eef0ef; vertical-align: top; }
.wq-table tr:hover td { background: #f6f8f7; }
.wq-l1, .wq-l2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wq-l1 a { font-weight: 800; color: var(--brand-dark, #17402f); text-decoration: none; font-size: 15px; }
.wq-l1 a:hover { text-decoration: underline; }
.wq-sub { color: var(--muted); font-size: 13px; }
.wq-l1 .wq-sub { font-size: 14px; }
.wq-l2 { font-size: 13px; margin-top: 3px; }
.wq-un { color: #7a5200; font-weight: 700; }
.wq-sep { color: var(--muted); margin: 0 6px; }
.wq-reason[title] { cursor: help; border-bottom: 1px dotted #b8beba; }
.wq-flag { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: #fff4dc; color: #7a5200; font-size: 11px; font-weight: 700; white-space: nowrap; }
.wq-chip { font-size: 12px; padding: 2px 9px; }
.wq-list > p.muted:first-child { margin-top: 0; }
.wq-list nav.actions { margin-top: 10px; }
@media (max-width: 760px) {
    .wq-table, .wq-table tbody, .wq-table tr, .wq-table td { display: block; width: auto; }
    .wq-table thead, .wq-table .wq-hide-m { display: none; }
    .wq-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid #eef0ef; }
    .wq-table td { border: 0; padding: 0; }
    .wq-table td.wq-caller { grid-column: 1 / 3; }
    .wq-l1, .wq-l2 { white-space: normal; }
    .wq-received { text-align: right; }
    .wq-search-row { flex-wrap: wrap; }
    .wq-search-row button { width: 100%; }
}

/* BUS-013 Revision 17: Decide this customer (walkthrough page 4). */
.capture-review .capture-lp { margin: 0 auto; padding-bottom: 24px; }
.cp-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; padding: 0; list-style: none; }
.cp-steps li { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); background: #fff; }
.cp-steps li span { font-weight: 800; margin-right: 2px; }
.cp-steps li.on { background: var(--brand-dark, #17402f); color: #fff; border-color: var(--brand-dark, #17402f); }
.capture-lp .capture-brief { margin: 0 0 12px; }
.capture-lp .capture-gaps { background: #fff4dc; border: 1px solid #f0d9a8; border-radius: 10px; padding: 8px 12px; font-size: 14px; margin: 10px 0 0; }
.capture-lp .lp-next .muted { margin: 4px 0 0; }
.cp-form .form-grid { margin-top: 10px; gap: 12px; }
.cp-form .lp-section + .lp-section { margin-top: 16px; }
.cp-readonly { margin: 6px 0 0; font-weight: 700; }
.cp-form textarea[readonly] { background: #f6f8f7; }
.cp-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.cp-actions .muted { margin: 0 auto 0 0; font-size: 13px; flex: 1 1 260px; }
.capture-lp .capture-program { margin: 0; font-size: 13px; }
@media (max-width: 760px) {
    .cp-actions button { width: 100%; }
}
.capture-review:has(> .capture-lp) { width: auto; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.capture-lp .capture-brief { padding: 0; border: 0; border-radius: 0; background: none; }
.capture-lp .page-shell, .capture-review .capture-lp.page-shell { margin-top: 20px; }

/* BUS-013 Revision 18: book the home visit (walkthrough page 5). */
.cp-steps li.done { background: var(--accent); color: var(--brand-dark, #17402f); border-color: #cfe0d6; }
.visit-review:has(> .capture-lp) .postal-envelope { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; }
.capture-lp .postal-envelope .postal-address { font-family: inherit; }
.capture-lp .postal-envelope .addr-name { font-size: 18px; font-weight: 800; }
.capture-lp #stage-visits > .card { margin: 0; }
.visit-on-file h2 { margin: 0 0 4px; }
.visit-on-file-links { margin: 0 0 8px; font-size: 14px; }
.visit-on-file details { border-top: 1px solid var(--line); padding: 8px 0; }
.visit-salesperson select { width: 100%; max-width: 420px; }
.visit-fit { margin: 6px 0 0; font-size: 13px; padding: 6px 10px; border-radius: 8px; background: #f6f8f7; }
.visit-fit.is-ok { background: #e3f3ea; color: var(--brand-dark, #17402f); }
.visit-fit.is-note { background: #eef3f8; color: #24425f; }
.visit-fit.is-tight { background: #fff4dc; color: #7a5200; font-weight: 700; }
/* BUS-013 Revision 18 fix: page 5 customer card stacks (no flex row of thin columns); phone shows once, in the facts. */
.visit-summary-card .postal-envelope.customer-recorded { display: block; margin: 14px 0 0; padding: 0 0 0; border-bottom: 0; }
.visit-summary-card .visit-identity-bar { grid-template-columns: auto auto 1fr; }
.visit-summary-card .visit-identity-bar .customer-recorded-actions { justify-self: end; }
.visit-summary-card .postal-address { margin-top: 6px; }
.visit-summary-card .postal-address .addr-contact { display: none; }
.visit-summary-card .visit-lead-facts { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.visit-summary-card .visit-lead-hint { font-size: 13px; }
@media (max-width: 560px) {
    .visit-summary-card .visit-lead-facts { grid-template-columns: 1fr 1fr; }
}

/* BUS-013 Revision 19: agent-grouped visit slots + day route panel */
.agent-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.agent-card { border: 1px solid #dfe7e2; border-radius: 12px; background: #fff; padding: 12px 14px; }
.agent-card.is-file { border-color: #cfe0d6; background: #f7fbf8; }
.agent-head h3 { margin: 0; font-size: 16px; }
.agent-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #e3f3ea; color: #17402f; font-size: 11px; font-weight: 700; vertical-align: middle; }
.agent-meta { font-size: 13px; color: var(--muted, #66736c); margin: 4px 0 0; }
.agent-fit { margin: 8px 0 10px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: #f6f8f7; color: #17402f; }
.agent-fit.is-ok { background: #e3f3ea; }
.agent-fit.is-note { background: #eef3f8; color: #24425f; }
.agent-fit.is-tight { background: #fff4dc; color: #7a5200; font-weight: 700; }
.slot-suggested { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: #17402f; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.agent-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; margin-top: 10px; align-items: start; }
.agent-left h4, .agent-right h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #66736c); }
.route { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.route li { display: grid; grid-template-columns: 54px 1fr; gap: 8px; align-items: start; padding: 8px 10px; border-radius: 10px; border: 1px solid #dfe7e2; background: #f6f8f7; font-size: 13px; }
.route li .t { font-weight: 800; color: #17402f; }
.route li .where { line-height: 1.35; }
.route li .city { color: var(--muted, #66736c); font-size: 12px; }
.route-empty { padding: 10px 12px; border-radius: 10px; background: #f6f8f7; color: var(--muted, #66736c); font-size: 13px; margin: 0; }
.map-off { color: #86550e; font-size: 12px; font-weight: 700; }
.addr-status { color: #86550e; font-size: 12px; margin-top: 4px; display: block; }
.addr-status a { color: #86550e; font-weight: 800; }
.addr-editor { margin-top: 8px; padding: 12px; background: #fffaf0; border: 1px solid #e7d4ac; border-radius: 8px; }
.addr-editor[hidden] { display: none; }
.addr-editor h4 { margin: 0; color: #17402f; font-size: 14px; }
.addr-kicker { margin: 6px 0; font-size: 12px; color: #66736c; }
.addr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.addr-grid .wide { grid-column: 1 / -1; }
.addr-grid label { font-size: 12px; font-weight: 700; color: #394d40; min-width: 0; }
.addr-grid input, .addr-grid select { width: 100%; min-width: 0; box-sizing: border-box; margin-top: 4px; }
.edit-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.edit-actions button { min-height: 42px; }
.addr-form-target { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.route li .where { min-width: 0; }
.visit-book.form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.duration-picker { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; background: none; min-width: 0; }
.duration-picker legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.visit-type-chips { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; min-width: 0; flex: 1 1 auto; }
.visit-type-chip { position: relative; flex: 0 0 auto; margin: 0; }
.visit-type-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.visit-type-chip span { display: inline-block; padding: 6px 10px; border-radius: 999px; border: 1px solid #cfe0d6; background: #fff; color: #17402f; font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.visit-type-chip input:checked + span { background: #17402f; color: #fff; border-color: #17402f; }
.visit-type-chip input:focus-visible + span { outline: 2px solid #17402f; outline-offset: 2px; }
#visit-duration-label { flex: 0 0 auto; font-size: 13px; white-space: nowrap; }
#visit-other-minutes { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; margin: 0; font-size: 12px; font-weight: 700; white-space: nowrap; }
#visit-other-minutes input { width: 64px; margin: 0; }
.duration-picker [hidden] { display: none !important; }
.visit-tag { display: inline-block; margin-left: 6px; background: #e3f3ea; border-radius: 4px; padding: 2px 5px; color: #17402f; font-size: 10px; font-weight: 700; }
.travel-chip { list-style: none; margin: 2px 0 2px 54px; font-size: 12px; color: #66736c; }
.slot-mark.is-clash { display: block; color: #8a1f1f; font-size: 10px; font-weight: 800; }
.slot-mark.is-tight { color: #b26a00; font-weight: 800; }
.visit-clash { margin: 10px 0; padding: 10px 12px; border-radius: 10px; }
.visit-clash.is-blocked { background: #fde8e8; color: #7a1616; }
.visit-clash.is-warning { background: #fff4dc; color: #7a5200; }
.visit-clash button { margin-right: 8px; }
.visit-hold { margin: 10px 0; padding: 10px 12px; border-radius: 10px; }
.visit-hold.is-mine { background: #e7f6ee; color: #17402f; }
.visit-hold.is-other { background: #f4f1ea; color: #5c5346; }
.visit-day-hours > input:checked + label.is-mine,
.visit-day-hours > label.is-mine {
    background: #17402f;
    color: #fff;
    border-color: #17402f;
    text-decoration: none;
}
.visit-day-hours > input:disabled + label.is-held,
.visit-day-hours > input:checked + label.is-held,
.visit-day-hours > label.is-held {
    position: relative;
    box-sizing: border-box;
    width: auto;
    min-width: 72px;
    max-width: 132px;
    min-height: 48px;
    height: 58px;
    margin-bottom: 18px;
    padding: 4px 6px;
    overflow: visible;
    background: repeating-linear-gradient(-45deg, #f7f4ee, #f7f4ee 5px, #e3dacb 5px, #e3dacb 10px);
    color: #5c5346;
    border: 1px dashed #a89880;
    border-style: dashed;
    cursor: not-allowed;
    text-decoration: none;
}
.visit-day-hours > label.is-held span,
.visit-day-hours > input:disabled + label.is-held span {
    color: #5c5346;
    text-decoration: none;
}
.visit-day-hours > label .slot-hold,
.visit-day-hours > label.is-held .slot-hold,
.visit-day-hours > label.is-mine .slot-hold {
    display: flex;
    justify-content: center;
    max-width: 100%;
    margin-top: 1px;
    overflow: hidden;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
    text-decoration: none;
    white-space: nowrap;
}
.visit-day-hours > label .slot-hold,
.visit-day-hours > label .slot-hold-prefix,
.visit-day-hours > label .slot-hold-name {
    text-transform: none;
}
.visit-day-hours > label .slot-hold-prefix { flex: none; }
.visit-day-hours > label .slot-hold-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.visit-day-hours > label.is-held .release-hold,
.visit-day-hours > input:disabled + label.is-held .release-hold {
    position: absolute;
    top: calc(100% + 1px);
    left: 50%;
    z-index: 1;
    display: block;
    width: max-content;
    max-width: 76px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: none;
    color: #17402f;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0;
    text-align: center;
    text-decoration: underline;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
    transform: translateX(-50%);
}
#visit-hold-cancel { margin-left: 8px; background: #fff; color: #17402f; border: 1px solid #17402f; }
.directions-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.directions-open { min-height: 32px; padding: 4px 10px; border: 1px solid #17402f; border-radius: 999px; background: #fff; color: #17402f; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.directions-stop { margin-top: 4px; }
#directions-sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(20, 32, 26, .35); }
#directions-sheet[hidden] { display: none; }
.directions-sheet-card { width: min(420px, 100%); margin-bottom: 8px; padding: 16px; border-radius: 16px; background: #fff; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.directions-sheet-card p { margin: 0 0 10px; font-weight: 800; }
.directions-sheet-card a, .directions-sheet-card button { display: block; width: 100%; margin: 8px 0 0; min-height: 44px; border-radius: 10px; border: 1px solid #d5ddd8; background: #fff; color: #17402f; font: inherit; font-weight: 800; text-align: center; text-decoration: none; line-height: 44px; cursor: pointer; }
.my-day-stops { list-style: none; margin: 0; padding: 0; }
.my-day-stops li { display: flex; gap: 10px; margin: 0 0 12px; }
.my-day-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #17402f; color: #fff; font-weight: 800; text-align: center; line-height: 28px; }
.my-day-stops strong, .my-day-stops span { display: block; }
@media (max-width: 760px) {
  .directions-day, .directions-bar .directions-open { width: 100%; min-height: 48px; font-size: 15px; }
}
.map-source { border: 0; margin: 12px 0; padding: 12px; background: #f4f8f5; border-radius: 10px; }
.map-source legend { font-weight: 800; }
.source-choice { display: block; margin: 4px 0; }
.visit-type-admin { padding: 16px 18px 18px; }
.visit-type-admin table { width: 100%; margin: 8px 0 16px; }
.visit-type-admin table input, .visit-type-admin table select { width: 100%; max-width: 120px; }
.visit-type-admin .travel-buffer { display: block; max-width: 280px; margin: 0 0 12px; }
.visit-type-admin .travel-buffer input { width: 88px; margin-right: 6px; }
@media (max-width: 760px) {
  .visit-type-chips { flex-wrap: wrap; max-height: 4.8em; }
}
@media (max-width: 480px) {
  .addr-grid { grid-template-columns: 1fr; }
  .addr-grid .wide { grid-column: auto; }
  .route li { grid-template-columns: 40px minmax(0, 1fr); }
}
.map-panel { margin-top: 12px; border-top: 1px solid #dfe7e2; padding-top: 10px; }
.map-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.map-toolbar h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #66736c); }
.map-toggle { border: 1px solid #cfe0d6; background: #fff; color: #17402f; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.map-frame { height: 240px; margin-top: 8px; border-radius: 10px; border: 1px solid #dfe7e2; background: #e7efe9; }
.map-missing { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; color: #8a5a12; }
.map-missing:empty { display: none; }
.map-note { margin: 6px 0 0; font-size: 12px; color: var(--muted, #66736c); }
.agent-card:not(.is-map-open) .map-body { display: none; }
.map-pin-icon { background: transparent; border: 0; }
.map-pin { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 1px 3px rgba(0,0,0,.28); }
.map-pin.stop { background: #17402f; }
.map-pin.new { background: #c45c26; width: auto; min-width: 42px; padding: 0 7px; border-radius: 999px; }
.map-tip { background: #fff; border: 1px solid #dfe7e2; color: #17402f; font-size: 11px; font-weight: 700; box-shadow: none; }
@media (max-width: 760px) {
  .map-frame { height: 180px; }
}
.v-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .agent-split { grid-template-columns: 1fr; }
}


/* BUS-013 Revision 20: modeling white-card notes + progress hints */
.cp-steps .step-hint{display:block;font-size:.72rem;font-weight:500;color:#6b7c72;margin-top:2px}
.assessment-label-chip .sub{font-size:.85rem;font-weight:600;color:#194f38;background:#e8f3ec;border-radius:999px;padding:.25rem .65rem;margin-left:.35rem}
.property-review .page-shell.lp,
.assessment-review .page-shell.lp{width:min(1100px,calc(100% - 28px));margin:0 auto;padding:14px 0 48px}
.property-review .lp-stack > .card,
.assessment-review .lp-stack > .card{border-radius:16px}
.notes-board{display:grid;gap:14px;margin:0 0 14px}
@media (min-width:900px){.notes-board{grid-template-columns:1.2fr .9fr}}
.notes-card{background:#fff;border:1px solid #e4ebe6;border-radius:14px;padding:16px 18px;box-shadow:0 4px 14px rgba(25,79,56,.05)}
.notes-card h3{margin:0 0 6px;font-size:1.05rem}
.notes-card .notes-scope{display:inline-block;font-size:.75rem;border-radius:999px;padding:.2rem .55rem;margin-left:6px;vertical-align:middle}
.notes-scope.agents{background:#e8f3ec;color:#194f38}
.notes-scope.install{background:#f3eee8;color:#6a4a28;border:1px solid #e2d2be}
.notes-card.install-crew{background:#fcfaf7;border-color:#e8dccb}
.note-list{list-style:none;margin:10px 0 12px;padding:0;display:grid;gap:10px}
.note-list li{border:1px solid #e8eee9;border-radius:10px;padding:10px 12px;background:#fbfcfb}
.note-list .note-meta{font-size:.78rem;color:#6b7c72;margin:0 0 4px}
.note-list p{margin:0;white-space:pre-wrap}
.file-note-form textarea{width:100%;min-height:72px;border:1px solid #cfd9d3;border-radius:10px;padding:10px 12px;font:inherit;resize:vertical}
.notes-actions{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin-top:10px;flex-wrap:wrap}
.notes-actions .muted{margin-right:auto;font-size:.82rem}
.property-review .house-model,
.property-review nav.house-next,
.assessment-review .house-model,
.assessment-review .visit-property-line{background:#fff;border:1px solid #e4ebe6;border-radius:14px;padding:16px 18px;margin:0 0 14px;box-shadow:0 4px 14px rgba(25,79,56,.05)}
.property-review nav.house-next{display:flex;gap:12px;align-items:center;flex-wrap:wrap}

/* BUS-013 Revision 21: Estimate white-card shell (quote logic unchanged). */
.visit-review .card,
.assessment-review .card,
.estimate-review .card { margin-top: 0; }
.estimate-review .lp-stack > .quote-tools,
.estimate-review .lp-stack > .paper-office,
.estimate-review .lp-stack > #atticare-quote-root,
.estimate-review .lp-stack > nav.house-next {
  background: #fff;
  border: 1px solid #e4ebe6;
  border-radius: 14px;
  padding: 16px 18px;
  margin: 0 0 14px;
  box-shadow: 0 4px 14px rgba(25, 79, 56, 0.05);
}
.estimate-review .lp-stack > #atticare-quote-root {
  padding: 0;
  overflow: hidden;
}
.estimate-review .quote-tools,
.estimate-review .paper-office {
  width: auto;
  max-width: none;
  margin: 0 0 14px;
}

/* BUS-013 Revision 22: Service project white-card shell (flows unchanged). */
.estimate-review .card,
.project-review .card { margin-top: 0; }
.project-review .lp-stack > section.card.full,
.project-review .lp-stack > nav.house-next {
  background: #fff;
  border: 1px solid #e4ebe6;
  border-radius: 14px;
  padding: 16px 18px;
  margin: 0 0 14px;
  box-shadow: 0 4px 14px rgba(25, 79, 56, 0.05);
}
.project-review .project-progress {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.project-review .project-progress li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e4ebe6;
}
.project-review .project-progress li.complete { background: #e8f3ec; }
.project-review .project-progress li.pending { background: #f7f8f7; color: #5a6660; }

/* BUS-013 Revision 23: A6102 invoice paper. Description wraps on words, not anywhere. */
.invoice-review .template-card {
  background: #fff;
  border: 1px solid #e0e8e2;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(25, 79, 56, .06);
  padding: 26px;
  margin: 0 0 16px;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
}
.invoice-review .template-card h2 { margin: 0 0 5px; }
.invoice-review .subtle { color: #68766e; font-size: 13px; }
.invoice-review .toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.invoice-review .pill { color: #176e91; background: #e5f5fb; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.invoice-review .paper-head { display: grid; grid-template-columns: 1fr 150px 1fr; gap: 20px; align-items: start; padding-bottom: 24px; border-bottom: 2px solid #09a2ce; min-width: 0; }
.invoice-review .paper-head > * { min-width: 0; }
.invoice-review .paper-head img { width: 190px; max-width: 100%; }
.invoice-review .invoice-id { text-align: center; border: 1px solid #a6cf32; }
.invoice-review .invoice-id strong { display: block; background: #a6cf32; color: #fff; padding: 7px; }
.invoice-review .invoice-id span { display: block; padding: 8px; }
.invoice-review .contact { text-align: right; font-size: 12px; line-height: 1.5; }
.invoice-review .contact b { font-size: 14px; }
.invoice-review .blue { color: #009fd0; }
.invoice-review .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; padding: 24px 0; min-width: 0; }
.invoice-review .facts > * { min-width: 0; }
.invoice-review .facts h3,
.invoice-review .project-heading { font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; color: #009bc6; margin: 0 0 12px; }
.invoice-review .fact { display: flex; gap: 10px; border-bottom: 1px solid #d8eaf0; padding: 7px 0; font-size: 13px; }
.invoice-review .fact label { color: #68766e; min-width: 91px; }
.invoice-review .fact span { flex: 1; min-width: 0; overflow-wrap: break-word; word-break: normal; }
.invoice-review .template-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; min-width: 0; }
.invoice-review .template-table th { background: #edf7f9; text-align: left; color: #28748a; font-weight: 600; padding: 12px 9px; border-top: 2px solid #05a4d1; border-bottom: 1px solid #cbe0e6; }
.invoice-review .template-table td {
  padding: 18px 9px;
  vertical-align: top;
  border-bottom: 1px solid #e2e9e4;
  overflow-wrap: break-word;
  word-break: normal;
  word-wrap: break-word;
  hyphens: manual;
  line-height: 1.6;
}
.invoice-review .template-table th:nth-child(1) { width: 13%; }
.invoice-review .template-table th:nth-child(2),
.invoice-review .template-table th:nth-child(3) { width: 9%; }
.invoice-review .template-table th:nth-child(5),
.invoice-review .template-table td:last-child { width: 16%; }
.invoice-review .template-table td:last-child { text-align: right; white-space: nowrap; }
.invoice-review .line-title { display: block; color: #087b9d; font-weight: 600; margin-bottom: 4px; }
.invoice-review .template-table .blank-row td { height: 30px; padding: 4px 9px; border-bottom: 1px solid #f0f4ef; }
.invoice-review .lower { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 24px; min-width: 0; }
.invoice-review .lower > * { min-width: 0; }
.invoice-review .notes { background: #f5fafc; border: 1px solid #d9edf5; border-radius: 9px; padding: 16px; min-height: 130px; font-size: 13px; }
.invoice-review .notes h3 { margin: 0 0 12px; font-size: 14px; }
.invoice-review .total-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #e5edd9; font-size: 13px; }
.invoice-review .total-row.grand { font-size: 16px; font-weight: bold; background: #f3f8e7; padding: 12px; }
.invoice-review .total-row.balance { font-weight: bold; color: #136c8d; }
.invoice-review .payment-box { border: 1px solid #dbe7dd; border-radius: 9px; padding: 15px; margin-top: 18px; font-size: 13px; }
.invoice-review .payment-box h3 { font-size: 13px; margin: 0 0 12px; }
.invoice-review .methods { display: flex; gap: 15px; flex-wrap: wrap; margin: 12px 0; color: #4c6053; }
.invoice-review .paid-area { position: relative; min-height: 150px; padding-top: 14px; }
.invoice-review .stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-12deg);
  color: #1590c0;
  border: 4px solid currentColor;
  border-radius: 14px;
  padding: 8px 22px;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px currentColor;
  opacity: .82;
  margin: 22px 0 8px 10px;
  font-family: Georgia, "Times New Roman", serif;
}
.invoice-review .stamp .s-main { font-size: 40px; font-weight: 800; letter-spacing: 8px; line-height: 1; padding-left: 8px; }
.invoice-review .stamp .s-sub { font: 700 9px/1.3 Arial, sans-serif; letter-spacing: 2px; text-transform: uppercase; border-top: 1.5px solid currentColor; margin-top: 5px; padding-top: 4px; }
.invoice-review .stamp .s-date { font: 700 10px/1.2 Arial, sans-serif; letter-spacing: 1px; }
.invoice-review .paid-line { margin: 2px 0 0; font-size: 13px; font-weight: 700; line-height: 1.3; }
.invoice-review .warranty { border: 1px solid #d5e0d8; border-radius: 8px; padding: 8px 12px; margin-top: 14px; font-size: 12px; line-height: 1.4; }
.invoice-review .warranty h3 { margin: 0 0 4px; font-size: 12px; }
.invoice-review .warranty p { margin: 0; }
.invoice-review .invoice-footer { margin-top: 8px; }
.invoice-note-editor { margin-bottom: 14px; }
.invoice-note-editor textarea { width: 100%; }
.deposit-card article { border: 1px solid #d7e3ea; border-radius: 12px; padding: 12px 14px; margin: 8px 0; background: #f7fbfd; }
.deposit-voided { text-decoration: line-through; opacity: .72; }
.deposit-form { display: grid; gap: 12px; margin-top: 12px; }
.deposit-form .methods { display: flex; gap: 12px; flex-wrap: wrap; border: 0; padding: 0; margin: 0; }
.deposit-form input[type="radio"] { width: 18px; height: 18px; margin: 0; }
.deposit-form label.check { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.deposit-links { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.deposit-links button.deposit-void-open { border: 0; background: transparent; color: #176e91; font: inherit; font-weight: 700; padding: 0; min-height: 0; cursor: pointer; }
.deposit-void { display: grid; gap: 8px; margin-top: 8px; max-width: 28rem; }
.deposit-void[hidden] { display: none; }
.deposit-void-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.deposit-receipt { margin-bottom: 16px; }
.deposit-amount { font-size: 28px; margin: 12px 0; }
.deposit-applied { margin: 0 0 8px; font-size: 12px; color: #4c6053; }
@media print {
  body:has(.deposit-receipt) .deposit-card,
  body:has(.deposit-receipt) .topbar,
  body:has(.deposit-receipt) .page-heading { display: none !important; }
}
.invoice-review .stamp-slot {
  display: inline-block;
  border: 2px dashed #b9d6e2;
  border-radius: 14px;
  color: #8aa9b6;
  padding: 18px 26px;
  margin: 22px 0 8px;
  font-size: 12px;
  letter-spacing: 2px;
}
.invoice-review .footer { text-align: center; font-size: 12px; color: #627066; border-top: 1px solid #dce8de; margin-top: 25px; padding-top: 18px; line-height: 1.8; }
.invoice-review .template-footer-art { display: block; width: 100%; max-width: 100%; height: auto; margin-top: 22px; }
.invoice-review .end-of-page { font-size: 11px; text-align: center; color: #708077; margin: 8px 0 0; }
.invoice-review .edit-note { padding: 10px 14px; background: #f5f8f5; border-radius: 8px; font-size: 13px; margin-bottom: 20px; }
.invoice-review .invoice-actions .actions,
.invoice-review .invoice-tools { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; align-items: center; }
.invoice-review a.secondary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #fff;
  color: #194f38;
  border: 1px solid #cadbd0;
  text-decoration: none;
  font-weight: 800;
}
.invoice-review .invoice-actions fieldset.methods { border: 0; margin: 12px 0; padding: 0; display: flex; gap: 15px; flex-wrap: wrap; }
.invoice-review .invoice-actions fieldset.methods legend { font-size: 13px; color: #68766e; margin-bottom: 8px; }
@media (max-width: 600px) {
  .invoice-review .template-card { padding: 12px; }
  .invoice-review .paper-head { grid-template-columns: 1fr 100px; gap: 15px; }
  .invoice-review .contact { grid-column: 1 / -1; text-align: left; }
  .invoice-review .paper-head img { width: 150px; }
  .invoice-review .facts,
  .invoice-review .lower { grid-template-columns: 1fr; gap: 20px; }
  .invoice-review .template-table { font-size: 11px; }
  .invoice-review .template-table th,
  .invoice-review .template-table td { padding: 10px 4px; }
  .invoice-review .template-table td:last-child { white-space: normal; }
  .invoice-review .fact { flex-wrap: wrap; }
  .invoice-review .fact label { min-width: 82px; }
}
@media print {
  body:has(.invoice-review) .topbar,
  body:has(.invoice-review) .page-heading,
  body:has(.invoice-review) .visit-summary-card,
  body:has(.invoice-review) .invoice-actions,
  body:has(.invoice-review) .invoice-note-editor { display: none !important; }
  body:has(.invoice-review) .page-shell.lp { width: 100%; margin: 0; padding: 0; }
  body:has(.invoice-review) .template-card { box-shadow: none; border: 0; }
  body:has(.invoice-review) .template-footer-art { break-inside: avoid; }
}

.message-template-head,
.mail-dialog-card .actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.message-template-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; margin-top: 12px; }
.message-template-list { display: grid; gap: 8px; align-content: start; }
.message-template-list a { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #d7e3ea; border-radius: 12px; text-decoration: none; color: inherit; background: #f7fbfd; }
.message-template-list a span { color: #68766e; font-size: 12px; }
.placeholder-row { display: flex; flex-wrap: wrap; gap: 6px; }
.placeholder-chip { border: 1px solid #b7d3e0; background: #eef7fb; color: #176e91; border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.mail-dialog { border: 0; padding: 0; background: transparent; }
.mail-dialog::backdrop { background: rgba(20, 40, 48, .45); }
.mail-dialog-card { width: min(560px, calc(100vw - 32px)); background: #fff; border-radius: 16px; padding: 18px 20px; }
.mail-dialog-card h2 { margin: 0 0 6px; }
.mail-dialog-card label { display: grid; gap: 4px; margin: 10px 0; font-size: 13px; }
.mail-dialog-card input, .mail-dialog-card textarea { width: 100%; font: inherit; }
.mail-attach { display: flex !important; align-items: center; gap: 8px; }
.invoice-actions [data-kind="invoice"] { background: #e5f5fb; color: #176e91; }
.year-built { margin: 12px 0 4px; }
.year-built form { margin: 0; }
.year-built-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; }
.year-built-row > label:not(.check) { width: 8.5rem; }
.year-built-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: 0 0 18px; accent-color: #17402f; }
.year-built-row label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 650; min-height: 44px; }
.year-built-age { margin: 8px 0 0; font-weight: 700; }
.year-built-history { margin-top: 8px; }
.year-built-history ul { margin: 8px 0 0; padding-left: 18px; }
@media (max-width: 700px) {
    .year-built-row > label:not(.check) { width: 100%; }
    .year-built-row input[name="year_built"] { width: 8rem; }
}
