/* Areas & trades, filters, tags, rollup, Owner's View, one-page Homeowner update */
:root { --c-ns: #e3e7eb; --c-ip: #ffd98a; --c-done: #7fcf98; --c-blk: #f08a8a; }

/* filter bar + tags */
.filter-bar { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; margin: 0 0 1rem; }
.filter-field { display: flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); }
.filter-field select, .sc-add select, .sc-add input, .sc-sub select { min-height: 44px; font: inherit; padding: .3rem .6rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.tag-chips { display: flex; gap: .35rem; flex-wrap: wrap; margin: .1rem 0 .3rem; }
.tag { font-size: .78rem; padding: .1rem .55rem; border-radius: 99px; background: #eef1f4; color: #3b4753; border: 1px solid var(--line); }
.tag.area { background: #e6f0fb; border-color: #c3d9f2; } .tag.trade { background: #f3ecfb; border-color: #dccbf0; }
.tag.shared { background: #e3f4e8; border-color: #b9e0c4; color: var(--ok); } .tag.internal { background: #f4f4f4; color: #666; }
.photo-internal { display: flex; align-items: center; gap: .3rem; font-size: .85rem; min-height: 40px; }

/* grid heatmap */
.hm-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heatmap { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: .85rem; }
.heatmap th { font-weight: 600; text-align: left; }
.hm-col { height: 118px; vertical-align: bottom; padding: 0; width: 46px; min-width: 46px; }
.hm-col span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; white-space: nowrap; padding-bottom: 4px; font-size: .8rem; color: var(--muted); }
.hm-row { white-space: nowrap; padding-right: .6rem; min-width: 120px; }
.hm-corner { font-size: .75rem; color: var(--muted); vertical-align: bottom; }
.hm-total { text-align: center; font-size: .8rem; color: var(--muted); white-space: nowrap; padding: 0 .3rem; } .hm-total b { color: var(--ink); }
.hm-cell-td { padding: 0; }
.hm-cell, .hm-swatch { border: 0; border-radius: 8px; font: inherit; }
.hm-cell { width: 100%; min-width: 44px; min-height: 44px; cursor: pointer; display: grid; place-items: center; line-height: 1; padding: 0; color: #24313d; }
.hm-cell small { display: block; font-size: .65rem; margin-top: 2px; }
.hm-not-started { background: var(--c-ns); } .hm-in-progress { background: var(--c-ip); } .hm-done { background: var(--c-done); } .hm-blocked { background: var(--c-blk); }
.hm-na { background: repeating-linear-gradient(45deg, #fafafa, #fafafa 4px, #f0f0f0 4px, #f0f0f0 8px); cursor: pointer; }
.hm-cell:focus-visible { outline: 3px solid var(--info); outline-offset: 1px; }
.hm-legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .85rem; margin: .3rem 0 .6rem; }
.hm-swatch { display: inline-grid; place-items: center; width: 22px; height: 22px; vertical-align: middle; font-style: normal; font-size: .8rem; }
.hm-foot td, .hm-foot th { border-top: 1px solid var(--line); }

/* rollup (overview) */
.rollup-top { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; }
.rollup-big { flex: 1 1 320px; } .rollup-big b { font-size: 2.6rem; line-height: 1; color: var(--accent); } .rollup-big span { margin-left: .5rem; color: var(--muted); }
.rollup-counts { display: flex; gap: .5rem 1rem; flex-wrap: wrap; align-items: center; flex: 1 1 320px; }
.rollup-counts .count { padding: .25rem .7rem; border-radius: 99px; background: #eef1f4; }
.rollup-counts .st-done { background: #d8f0df; } .rollup-counts .st-in-progress { background: #fff0c7; } .rollup-counts .st-blocked { background: #fde0e0; }
.area-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .3rem 1.4rem; margin: .5rem 0 1rem; }
.area-bar { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: .6rem; }
.ab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress.sm { height: 10px; margin: 0; } .progress.sm.st-blocked > div { background: var(--bad); } .progress.sm.st-done > div { background: var(--ok); }
.rollup h4 { margin: .6rem 0 .2rem; }

/* areas & trades editor */
.sc-subnav { margin-bottom: 1rem; }
.sc-add { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; } .sc-add input { flex: 1 1 220px; }
.sc-row-main { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.sc-name { flex: 1 1 200px; min-height: 44px; font: inherit; font-weight: 700; padding: .3rem .6rem; border: 1.5px solid transparent; border-radius: 10px; background: transparent; }
.sc-name:hover, .sc-name:focus { border-color: var(--line); background: #fff; }
.sc-weight { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; } .sc-weight input { width: 4.5rem; min-height: 44px; font: inherit; padding: .2rem .4rem; border: 1.5px solid var(--line); border-radius: 10px; }
.sc-sub { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .9rem; margin: .4rem 0; }
.sc-prog { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; } .sc-prog .progress { flex: 1; }
.phase-list { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .4rem 0; }
.phase { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .2rem .4rem .2rem .7rem; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; }
.phase.done { background: #e3f4e8; border-color: #b9e0c4; } .phase.done span { text-decoration: line-through; color: var(--muted); }
.phase input { width: 22px; height: 22px; }
.phase-x { border: 0; background: none; min-width: 36px; min-height: 36px; font-size: .9rem; color: var(--muted); cursor: pointer; }
.switch-row { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem; border: 1.5px solid var(--line); border-radius: 12px; margin: .8rem 0; cursor: pointer; }
.switch-row input { width: 26px; height: 26px; flex: none; } .switch-row small { display: block; }
.row-link.as-btn { width: 100%; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; min-height: 52px; }

/* ===== Owner's View: calm, big type ===== */
body:has(.owner-view) .topbar { display: none; }
.owner-view { max-width: 980px; margin: 0 auto; font-size: 1.2rem; line-height: 1.5; }
.ov-bar { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.ov-hero { background: linear-gradient(135deg, #1f3a4d, #2d5a73); color: #fff; border-radius: 22px; padding: 2rem 2.2rem; margin-bottom: 1.2rem; }
.ov-hero h1 { font-size: 2.4rem; margin: 0; } .ov-kicker { color: #bcd3e0; margin: 0 0 .2rem; font-size: 1.1rem; } .ov-address { color: #d4e2eb; margin: .2rem 0 1rem; }
.ov-pct b { font-size: 5rem; line-height: 1; } .ov-pct span { font-size: 1.5rem; margin-left: .6rem; color: #d4e2eb; }
.ov-progress { height: 26px; background: rgba(255,255,255,.22); border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.ov-progress > div { height: 100%; background: #ffb454; border-radius: 99px; }
.ov-progress.sm { height: 14px; background: #e5e9ed; margin: .3rem 0; } .ov-progress.sm > div { background: var(--accent); } .ov-progress.sm.st-done > div { background: var(--ok); } .ov-progress.sm.st-blocked > div { background: var(--bad); }
.ov-target { margin: .4rem 0 0; font-size: 1.15rem; }
.ov-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.4rem 1.6rem; margin-bottom: 1.1rem; }
.ov-card h2 { font-size: 1.6rem; margin-bottom: .7rem; } .ov-card h3 { font-size: 1.25rem; }
.ov-item { border-left: 6px solid var(--accent); padding: .3rem 0 .3rem 1rem; margin-bottom: .8rem; } .ov-item p { margin: .2rem 0; }
.ov-meta { display: flex; gap: 1.2rem; align-items: baseline; flex-wrap: wrap; color: var(--muted); } .ov-cost { font-size: 1.5rem; color: var(--ink); }
.ov-hint { color: var(--muted); font-size: 1rem; } .ov-ok { color: var(--ok); font-weight: 600; }
.ov-table { width: 100%; border-collapse: collapse; } .ov-table th { text-align: left; color: var(--muted); font-size: .95rem; padding: .4rem .6rem; border-bottom: 2px solid var(--line); }
.ov-table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; } .ov-table small { display: block; color: var(--muted); font-size: .95rem; } .ov-table tr.is-overdue td:first-child { border-left: 5px solid var(--bad); }
.ov-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.ov-area { border: 1px solid var(--line); border-radius: 16px; padding: .8rem 1rem; } .ov-area-top { display: flex; justify-content: space-between; font-size: 1.2rem; } .ov-area small { color: var(--muted); font-size: 1rem; }
.ov-timeline, .ov-delays { list-style: none; padding: 0; margin: 0; } .ov-timeline li { display: grid; grid-template-columns: 150px 1fr auto; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); align-items: center; } .ov-delays li { padding: .5rem 0 .5rem 1rem; border-left: 5px solid var(--warn); margin-bottom: .5rem; }
.owner-view .photo-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } .owner-view .photo figcaption { font-size: 1rem; }
.ov-contact { text-align: center; padding: 1.6rem 1rem 2.5rem; } .btn.big { min-height: 56px; font-size: 1.15rem; padding: .6rem 1.4rem; }

/* ===== Homeowner update: US-letter page ===== */
.letter-holder { overflow-x: auto; padding-bottom: 1rem; }
.letter { --u-ink: #17233a; width: 8.5in; height: 11in; margin: 0 auto; background: #fff; color: var(--u-ink); box-shadow: 0 2px 14px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; font: 9.5pt/1.3 -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; position: relative; }
.letter h1 { font-size: 20pt; margin: 0; } .letter h2 { font-size: 8.5pt; text-transform: uppercase; letter-spacing: .05em; color: #62707d; border-bottom: 1px solid #d9dee3; padding-bottom: 2px; margin: 0 0 4px; } .letter p { margin: 0; }
.u-head { background: #17233a; color: #fff; padding: .3in .5in .2in; display: flex; justify-content: space-between; gap: .3in; flex: none; }
.u-head p { color: #d2d8de; font-size: 10pt; } .u-head .u-sub { color: #fff; margin-top: 3px; } .u-example { align-self: flex-start; font-weight: 700; color: #ffc878; font-size: 9pt; }
.u-overall { display: flex; align-items: center; gap: .25in; padding: .14in .5in 0; flex: none; }
.u-pct b { font-size: 32pt; color: #c65d3b; line-height: 1; } .u-pct span { margin-left: 6px; color: #62707d; font-size: 11pt; }
.u-bar-wrap { flex: 1; } .u-bar-wrap p { color: #62707d; font-size: 8.5pt; margin-bottom: 3px; }
.u-bar { height: 14px; background: #e5e9ed; border-radius: 99px; overflow: hidden; } .u-bar > div { height: 100%; background: #c65d3b; border-radius: 99px; } .u-bar.sm { height: 8px; } .u-bar.sm.st-done > div { background: #1c7c3c; } .u-bar.sm.st-blocked > div { background: #c62828; }
.u-mid { display: grid; grid-template-columns: 3.4in 1fr; gap: .25in; padding: .14in .5in 0; flex: none; height: 3in; min-height: 0; }
.u-sec { min-height: 0; overflow: hidden; }
.u-area { display: grid; grid-template-columns: 1.5in 1fr 34px; gap: 6px; align-items: center; height: 17px; } .u-area span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .u-area b { text-align: right; }
.u-photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; } .u-photo-grid figure { margin: 0; min-width: 0; } .u-photo-grid img { width: 100%; height: 1.06in; object-fit: cover; border-radius: 3px; background: #e5e9ed; display: block; }
.u-photo-grid figcaption { font-size: 6.5pt; color: #62707d; height: 1.7em; overflow: hidden; line-height: 1.15; margin-top: 1px; }
.u-note { margin: .12in .5in 0; padding: 6px 10px; background: #f8f4ec; border: 1px solid #c65d3b; border-radius: 5px; flex: none; max-height: .85in; overflow: hidden; } .u-note b { color: #c65d3b; font-size: 8pt; text-transform: uppercase; } .u-note p { white-space: pre-wrap; }
.u-two { display: grid; grid-template-columns: 1fr 1fr; gap: .25in; padding: .12in .5in 0; flex: none; height: 2in; min-height: 0; }
.u-list { list-style: none; margin: 0; padding: 0; } .u-list li { padding-left: 11px; position: relative; margin-bottom: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .u-list li::before { content: '•'; position: absolute; left: 0; color: #c65d3b; font-weight: 700; }
.u-list .u-empty, .u-empty { color: #62707d; font-style: italic; } .u-list .u-more, .u-more { color: #62707d; font-style: italic; font-size: 8pt; } .u-list .u-more::before, .u-list .u-empty::before { content: ''; }
.u-foot { margin-top: auto; border-top: 1px solid #d9dee3; margin-left: .5in; margin-right: .5in; padding: .08in 0 .3in; display: flex; justify-content: space-between; align-items: flex-end; flex: none; } .u-foot small { color: #62707d; font-size: 7.5pt; }

@media print {
  html, body { background: #fff !important; height: auto !important; }
  body:has(.letter) main, body:has(.letter) .page, body:has(.letter) .tab-panel { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .letter-holder { overflow: visible; padding: 0; }
  .letter { box-shadow: none; margin: 0; width: 8.5in; height: 10.96in; break-after: avoid; break-inside: avoid; page-break-after: avoid; }
  body:has(.owner-view) .ov-card { break-inside: avoid; }
}
@media (max-width: 760px) { .area-bar { grid-template-columns: 100px 1fr 40px; } .ov-timeline li { grid-template-columns: 1fr; } .ov-hero h1 { font-size: 1.8rem; } .ov-pct b { font-size: 3.6rem; } }
