@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Franklin:wght@500;600;700;800&display=swap');

:root {
  --ivory: #f7f2e9;
  --ivory-2: #efe7da;
  --paper: #fffdf8;
  --copper: #a75f3a;
  --copper-dark: #824328;
  --copper-soft: #d9a789;
  --ink: #22211e;
  --muted: #6f6a62;
  --line: #ded6ca;
  --green: #37594a;
  --green-dark: #253f35;
  --green-soft: #dfe8e1;
  --blue: #3e6170;
  --blue-soft: #e1ebef;
  --yellow: #a47322;
  --yellow-soft: #f5ead5;
  --red: #9a443c;
  --red-soft: #f3dfdc;
  --shadow-sm: 0 8px 24px rgba(41, 34, 26, .07);
  --shadow: 0 18px 50px rgba(41, 34, 26, .11);
  --radius: 18px;
  --radius-sm: 11px;
  --sidebar: 258px;
  --font-display: "Libre Franklin", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--ivory); font-family: var(--font-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
body.nav-open, body.sidebar-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { min-width: 0; font: inherit; }
button, .btn, a { -webkit-tap-highlight-color: transparent; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); line-height: 1.1; letter-spacing: -.035em; }
p { margin: 0; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
#services, #process, #reviews, #quote, #project-updates { scroll-margin-top: 96px; }
.section { padding: 100px 0; }
.section-kicker, .eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 15px; color: var(--copper); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.section-kicker::before, .eyebrow::before { content: ""; width: 25px; height: 2px; background: currentColor; }
.section-kicker.light { color: #e3b397; }
.section-head { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 45px; }
.section-head h2 { max-width: 680px; font-size: clamp(2rem, 4vw, 3.45rem); }
.section-head > p { max-width: 380px; color: var(--muted); font-size: 1.05rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 11px 19px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 700; transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--copper); box-shadow: 0 8px 20px rgba(167,95,58,.2); }
.btn-primary:hover { background: var(--copper-dark); box-shadow: 0 10px 24px rgba(130,67,40,.25); }
.btn-secondary { background: var(--ivory); border-color: var(--line); }
.btn-secondary:hover { background: var(--ivory-2); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.5); border-color: #c6b9a8; }
.btn-ivory { color: var(--green-dark); background: var(--ivory); }
.btn-lg { min-height: 52px; padding: 14px 23px; }
.btn-block { width: 100%; }
.btn-google { background: #fff; border-color: var(--line); }
.btn-google.disabled { cursor: default; opacity: .68; }
.btn-google.disabled:hover { transform: none; }
.google-g { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); font-weight: 800; color: #4285f4; }

/* Header / public */
.site-header { position: sticky; z-index: 50; top: 0; background: rgba(247,242,233,.92); border-bottom: 1px solid rgba(222,214,202,.75); backdrop-filter: blur(16px); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 78px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -.03em; }
.brand small { margin-top: 4px; color: var(--copper); font-size: .7rem; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; }
.brand-mark { position: relative; width: 42px; height: 38px; }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; position: absolute; left: 3px; border-left: 4px solid var(--copper); border-top: 4px solid var(--copper); transform: rotate(45deg) skew(-9deg,-9deg); }
.brand-mark::before { top: 10px; width: 26px; height: 26px; }
.brand-mark::after { top: 17px; left: 11px; width: 18px; height: 18px; opacity: .52; }
.brand-mark span { top: 24px; left: 19px; width: 10px; height: 10px; opacity: .25; }
.brand-inverse { color: #fff; }
.brand-inverse small { color: #e3b397; }
.site-nav { display: flex; align-items: center; gap: 30px; font-size: .92rem; font-weight: 600; }
.site-nav a:not(.nav-login) { color: #4e4a44; }
.site-nav a:not(.nav-login):hover { color: var(--copper); }
.nav-login { padding: 10px 16px; border: 1px solid var(--copper); border-radius: 8px; color: var(--copper); }
.nav-login:hover { color: #fff; background: var(--copper); }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-size: 1.4rem; }
.nav-toggle:hover { background: rgba(167,95,58,.08); }
.nav-backdrop, .sidebar-backdrop { display: none; }

/* Hero */
.hero { overflow: hidden; padding: 86px 0 108px; background: radial-gradient(circle at 85% 15%, rgba(205,151,117,.15), transparent 30%), var(--ivory); }
.hero-grid { display: grid; grid-template-columns: 1.03fr .97fr; gap: 60px; align-items: center; }
.hero-copy h1 { max-width: 720px; font-size: clamp(3rem, 6vw, 5.25rem); font-weight: 800; }
.hero-copy h1 em { color: var(--copper); font-style: normal; }
.hero-copy > p { max-width: 650px; margin-top: 25px; color: #5e5951; font-size: 1.18rem; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 34px; }
.trust-row { display: flex; gap: 36px; margin-top: 54px; padding-top: 28px; border-top: 1px solid var(--line); }
.trust-row div { display: flex; flex-direction: column; }
.trust-row strong { font-family: var(--font-display); }
.trust-row span { color: var(--muted); font-size: .82rem; }
.hero-visual { position: relative; min-height: 570px; border-radius: 180px 180px 20px 20px; background: linear-gradient(#d8ddd2 0 47%, #9aa38d 47% 66%, #4e614e 66%); box-shadow: var(--shadow); overflow: hidden; }
.sun-disc { position: absolute; top: 68px; right: 84px; width: 88px; height: 88px; border-radius: 50%; background: #f1d6a8; box-shadow: 0 0 0 20px rgba(241,214,168,.15); }
.mountain { position: absolute; bottom: 165px; width: 430px; height: 210px; background: #7f8d78; clip-path: polygon(0 100%, 28% 36%, 47% 66%, 68% 16%, 100% 100%); }
.mountain-one { left: -70px; opacity: .72; }
.mountain-two { right: -90px; bottom: 150px; background: #647462; opacity: .85; transform: scale(.86); }
.house-scene { position: absolute; right: 40px; bottom: 45px; left: 40px; height: 245px; }
.house-body { position: absolute; right: 45px; bottom: 0; left: 45px; height: 148px; background: #e6ded0; box-shadow: 0 18px 40px rgba(22,31,25,.2); }
.roof-plane { position: absolute; z-index: 2; top: 22px; right: 8px; left: 8px; height: 120px; background: repeating-linear-gradient(0deg, #4e4b46 0 9px, #44413d 9px 11px); clip-path: polygon(50% 0, 100% 83%, 94% 100%, 50% 23%, 6% 100%, 0 83%); filter: drop-shadow(0 10px 6px rgba(0,0,0,.18)); }
.window { position: absolute; top: 45px; left: 48px; width: 58px; height: 52px; border: 6px solid #f7f0e5; background: linear-gradient(90deg, transparent 46%, #f7f0e5 46% 54%, transparent 54%), linear-gradient(transparent 46%, #f7f0e5 46% 54%, transparent 54%), #8aa0a0; }
.door { position: absolute; right: 70px; bottom: 0; width: 52px; height: 92px; background: #875037; }
.chimney { position: absolute; z-index: 1; top: 14px; right: 105px; width: 36px; height: 90px; background: #8d6a57; }
.hero-card { position: absolute; z-index: 5; right: 18px; bottom: 20px; left: 18px; display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 14px; background: rgba(255,253,248,.92); box-shadow: 0 12px 35px rgba(18,25,20,.2); backdrop-filter: blur(10px); }
.hero-card-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--copper); font-weight: 800; }
.hero-card div { display: flex; flex-direction: column; }
.hero-card small { color: var(--muted); }

.intro-strip { border-top: 1px solid var(--line); background: var(--paper); }
.intro-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; align-items: end; }
.intro-grid h2 { font-size: clamp(2.2rem, 4vw, 3.75rem); }
.intro-grid p { max-width: 640px; color: var(--muted); font-size: 1.18rem; line-height: 1.85; }
.services-section { background: var(--paper); }
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.service-card { position: relative; min-height: 390px; padding: 32px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform .2s ease, box-shadow .2s ease; }
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-sm); }
.service-card.featured { color: #fff; background: var(--green-dark); border-color: var(--green-dark); }
.service-number { position: absolute; top: 22px; right: 24px; color: #aa9f91; font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.service-card.featured .service-number { color: #9caf9f; }
.service-icon { position: relative; width: 68px; height: 68px; margin: 36px 0 43px; border-radius: 50%; background: var(--ivory); }
.service-card.featured .service-icon { background: rgba(255,255,255,.1); }
.service-icon::before { content: ""; position: absolute; inset: 20px 14px; border-top: 5px solid var(--copper); border-left: 5px solid var(--copper); transform: rotate(45deg) skew(-8deg,-8deg); }
.repair-icon::after { content: "+"; position: absolute; right: 9px; bottom: 7px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--copper); font-weight: 800; }
.storm-icon::after { content: "↯"; position: absolute; right: 7px; bottom: 5px; color: var(--copper); font-size: 1.6rem; font-weight: 800; }
.metal-icon::before { box-shadow: 6px 6px 0 -2px var(--copper), 12px 12px 0 -4px var(--copper); }
.service-card h3 { font-size: 1.45rem; }
.service-card p { margin-top: 18px; color: var(--muted); }
.service-card.featured p { color: #cbd7ce; }
.service-card a { position: absolute; bottom: 28px; color: var(--copper); font-weight: 700; }
.service-card.featured a { color: #e9b89b; }
.process-section { color: #fff; background: var(--green-dark); }
.process-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 100px; }
.process-copy { position: sticky; top: 120px; align-self: start; }
.process-copy h2 { font-size: clamp(2.5rem, 5vw, 4.3rem); }
.process-copy p { max-width: 430px; margin: 25px 0 34px; color: #bac8bd; font-size: 1.08rem; }
.process-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(255,255,255,.15); }
.process-list li { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 31px 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.process-list > li > span { color: #dfa98a; font-family: var(--font-display); font-weight: 800; }
.process-list strong { display: block; margin-bottom: 8px; font-family: var(--font-display); font-size: 1.3rem; }
.process-list p { color: #bac8bd; }
.reviews-section { background: var(--ivory); }
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.testimonial-card, .testimonial-cta { min-height: 330px; margin: 0; padding: 34px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.stars { color: var(--copper); letter-spacing: .12em; }
.testimonial-card > p { margin: 34px 0; font-family: var(--font-display); font-size: 1.35rem; line-height: 1.55; }
.testimonial-card footer { display: flex; align-items: center; gap: 12px; }
.testimonial-cta { color: #fff; background: var(--copper); box-shadow: none; }
.testimonial-cta > span { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.testimonial-cta h3 { margin-top: 30px; font-size: 1.8rem; }
.testimonial-cta p { margin-top: 18px; color: #f4ded0; }
.testimonial-cta a { display: inline-block; margin-top: 34px; font-weight: 800; }
.quote-section { background: var(--paper); }
.quote-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 90px; align-items: start; }
.quote-copy { position: sticky; top: 120px; }
.quote-copy h2 { font-size: clamp(2.5rem, 5vw, 4rem); }
.quote-copy > p { margin-top: 22px; color: var(--muted); font-size: 1.08rem; }
.contact-stack { display: grid; gap: 20px; margin-top: 43px; padding-top: 35px; border-top: 1px solid var(--line); }
.contact-stack a, .contact-stack div { display: flex; flex-direction: column; }
.contact-stack span { color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.contact-stack strong { margin-top: 3px; font-size: 1.05rem; }
.quote-form { display: grid; gap: 20px; padding: 42px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ivory); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 8px; color: #47433e; font-size: .83rem; font-weight: 700; }
label small { color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; border: 1px solid #d3c9bc; border-radius: 9px; outline: 0; color: var(--ink); background: #fff; }
input, select { height: 47px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(167,95,58,.12); }
.quote-form > small { color: var(--muted); font-weight: 400; }
.site-footer { padding: 70px 0 25px; color: #fff; background: #1d2f29; }
.footer-grid { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 60px; }
.footer-grid > div { display: flex; flex-direction: column; align-items: start; gap: 10px; }
.footer-grid p, .footer-grid span, .footer-grid a { color: #b9c7bd; }
.footer-grid p { max-width: 400px; margin-top: 15px; }
.footer-grid > div > strong { margin-bottom: 10px; }
.footer-bottom { display: flex; justify-content: space-between; margin-top: 55px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); color: #91a197; font-size: .82rem; }

/* Login */
.login-section { display: grid; grid-template-columns: minmax(460px, .9fr) 1.1fr; min-height: calc(100vh - 79px); background: var(--paper); }
.login-panel { width: min(520px, calc(100% - 60px)); margin: auto; padding: 55px 0; }
.login-heading { margin: 58px 0 30px; }
.login-heading h1 { font-size: 3.35rem; }
.login-heading p { margin-top: 15px; color: var(--muted); }
.auth-form { display: grid; gap: 18px; }
.auth-divider { display: flex; align-items: center; gap: 15px; margin: 22px 0; color: #aaa195; font-size: .76rem; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth-note { margin-top: 10px; color: var(--muted); font-size: .78rem; text-align: center; }
code { padding: 2px 6px; border-radius: 5px; background: var(--ivory-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.demo-logins { margin-top: 26px; padding: 20px; border: 1px dashed #cbbdad; border-radius: 12px; background: var(--ivory); }
.demo-logins strong { display: block; }
.demo-logins p { margin: 4px 0 13px; color: var(--muted); font-size: .82rem; }
.demo-logins button { margin: 3px 5px 3px 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-size: .78rem; font-weight: 700; }
.login-help { margin-top: 24px; color: var(--muted); font-size: .83rem; text-align: center; }
.login-help a { color: var(--copper); font-weight: 700; }
.login-art { position: relative; min-height: 650px; background: linear-gradient(135deg, rgba(37,63,53,.15), rgba(37,63,53,.58)), repeating-linear-gradient(160deg, transparent 0 38px, rgba(255,255,255,.05) 39px 41px), linear-gradient(155deg, #899886 0 33%, #526655 33% 55%, #273f35 55%); overflow: hidden; }
.login-art::before { content: ""; position: absolute; right: -8%; bottom: -3%; width: 105%; height: 68%; background: repeating-linear-gradient(0deg, #454846 0 15px, #393d3a 15px 18px); clip-path: polygon(50% 0, 100% 74%, 100% 100%, 0 100%, 0 74%); filter: drop-shadow(0 25px 30px rgba(0,0,0,.3)); }
.login-art-overlay { position: absolute; z-index: 2; top: 80px; left: 70px; max-width: 500px; color: #fff; }
.login-art-overlay > span { color: #e3b397; font-size: .75rem; font-weight: 800; letter-spacing: .18em; }
.login-art-overlay h2 { margin-top: 20px; font-size: clamp(3rem, 5vw, 5rem); }
.login-art-overlay p { max-width: 400px; margin-top: 23px; color: #d4dfd7; font-size: 1.05rem; }

/* App shell */
.app-shell { min-height: 100vh; background: #f3efe8; }
.app-frame { display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; z-index: 40; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 30px 22px 22px; color: #fff; background: var(--green-dark); }
.sidebar .brand { margin: 0 10px 40px; }
.side-nav { display: grid; gap: 6px; }
.side-nav a { display: flex; align-items: center; gap: 13px; min-height: 45px; padding: 10px 13px; border-radius: 9px; color: #b7c6bc; font-size: .9rem; font-weight: 600; }
.side-nav a span { display: grid; place-items: center; width: 25px; color: #d8a283; font-size: 1.05rem; }
.side-nav a:hover, .side-nav a.active { color: #fff; background: rgba(255,255,255,.09); }
.sidebar-help { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding: 18px; border-radius: 12px; background: rgba(255,255,255,.07); }
.sidebar-help strong { margin-bottom: 4px; font-size: .82rem; }
.sidebar-help span, .sidebar-help a { color: #b7c6bc; font-size: .75rem; overflow-wrap: anywhere; }
.app-main { min-width: 0; }
.app-header { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.9); backdrop-filter: blur(14px); }
.app-header-copy { display: flex; flex-direction: column; }
.app-header-copy span { color: var(--muted); font-size: .72rem; }
.app-header-copy strong { font-family: var(--font-display); }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-menu > div:nth-child(2) { display: flex; flex-direction: column; line-height: 1.2; }
.user-menu strong { font-size: .82rem; }
.user-menu span { color: var(--muted); font-size: .7rem; }
.user-menu > a { display: grid; place-items: center; width: 44px; height: 44px; margin-left: 3px; border-radius: 9px; color: var(--muted); font-size: 1.05rem; }
.user-menu > a:hover { color: var(--copper); background: #f5e9e0; }
.avatar { display: grid; place-items: center; flex: 0 0 37px; width: 37px; height: 37px; border-radius: 50%; color: #fff; background: var(--green); font-size: .72rem; font-weight: 800; }
.avatar-copper { background: var(--copper); }
.sidebar-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-size: 1.4rem; }
.app-content { width: min(1440px, 100%); margin: 0 auto; padding: 38px 38px 70px; }
.flash { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding: 14px 16px; border: 1px solid; border-radius: 10px; box-shadow: var(--shadow-sm); }
.flash > span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #fff; font-weight: 800; }
.flash p { flex: 1; }
.flash button { flex: 0 0 44px; width: 44px; height: 44px; margin: -10px -9px -10px 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 1.2rem; }
.flash button:hover { background: rgba(0,0,0,.05); }
.flash-success { border-color: #bad0c0; background: #edf5ef; }
.flash-success > span { background: var(--green); }
.flash-error { border-color: #dbb2ad; background: #f9ecea; }
.flash-error > span { background: var(--red); }
.public-shell > .flash { position: relative; z-index: 5; width: min(620px, calc(100% - 40px)); margin: 24px auto 0; }

.welcome-row, .page-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.welcome-row h1, .page-head h1 { font-size: clamp(2rem, 4vw, 3.05rem); }
.welcome-row p, .page-head p { margin-top: 10px; color: var(--muted); }
.roomy-head { margin-bottom: 36px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-grid.customer-stats { grid-template-columns: repeat(3, 1fr); }
.stat-grid.three-stats { grid-template-columns: repeat(3, 1fr); }
.stat-card { position: relative; display: flex; align-items: center; gap: 15px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); box-shadow: 0 4px 14px rgba(41,34,26,.035); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: #cfb8a8; background: #fffaf4; box-shadow: var(--shadow-sm); }
.stat-card:focus-visible { outline: 3px solid rgba(167,95,58,.2); outline-offset: 2px; border-color: var(--copper); box-shadow: var(--shadow-sm); }
.stat-icon { display: grid; place-items: center; flex: 0 0 45px; width: 45px; height: 45px; border-radius: 12px; color: var(--copper); background: #f2e4db; font-size: 1.2rem; }
.stat-card > div { display: grid; flex: 1; min-width: 0; }
.stat-card small { color: var(--muted); font-size: .72rem; }
.stat-card strong { margin: 2px 0; overflow: hidden; font-family: var(--font-display); font-size: 1.45rem; text-overflow: ellipsis; white-space: nowrap; }
.stat-card em { color: #918a81; font-size: .67rem; font-style: normal; }
.stat-card > b { display: grid; place-items: center; flex: 0 0 29px; width: 29px; height: 29px; border-radius: 50%; color: var(--copper); background: #f5e9e0; opacity: .58; transition: transform .18s ease, opacity .18s ease, background .18s ease; }
.stat-card:hover > b, .stat-card:focus-visible > b { transform: translateX(3px); opacity: 1; background: #efdbce; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; margin-top: 20px; }
.dashboard-grid.lower-grid { grid-template-columns: 1.35fr .65fr; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 7px 22px rgba(41,34,26,.045); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px 19px; }
.panel-head h2 { font-size: 1.35rem; }
.panel-head .section-kicker { margin-bottom: 5px; font-size: .61rem; }
.panel-head > a { color: var(--copper); font-size: .8rem; font-weight: 800; }
.panel-head > span { color: var(--muted); font-size: .75rem; }
.project-list { padding: 0 16px 15px; }
.project-row { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 14px 10px; border-top: 1px solid #ebe5dc; }
.project-row:hover { background: #fbf8f2; }
.project-monogram { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; color: var(--copper); background: #f0e2d9; font-family: var(--font-display); font-size: .72rem; font-weight: 800; }
.project-monogram.small { width: 39px; height: 39px; border-radius: 9px; }
.project-main { min-width: 0; }
.project-main > strong, .project-main > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-main > strong { font-size: .86rem; }
.project-main > span { color: var(--muted); font-size: .71rem; }
.progress-line { height: 5px; margin-top: 9px; border-radius: 99px; background: #e9e2d8; overflow: hidden; }
.progress-line span { display: block; height: 100%; border-radius: inherit; background: var(--copper); }
.progress-line.large { height: 7px; }
.project-meta { display: flex; align-items: end; flex-direction: column; gap: 7px; }
.project-meta > strong { font-size: .8rem; }
.status { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 4px 8px; border-radius: 99px; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.status-success { color: var(--green); background: var(--green-soft); }
.status-info { color: var(--blue); background: var(--blue-soft); }
.status-warning { color: var(--yellow); background: var(--yellow-soft); }
.status-danger { color: var(--red); background: var(--red-soft); }
.status-neutral { color: #68645e; background: #eae6df; }
.mini-timeline { padding: 0 24px 19px; }
.mini-timeline article { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding: 12px 0; }
.mini-timeline article:not(:last-child)::before { content: ""; position: absolute; top: 28px; bottom: -12px; left: 5px; width: 1px; background: var(--line); }
.timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 5px; border: 3px solid #e9c8b5; border-radius: 50%; background: var(--copper); }
.mini-timeline small { display: block; color: var(--muted); font-size: .64rem; }
.mini-timeline strong { display: block; margin: 2px 0; font-size: .8rem; }
.mini-timeline p { color: var(--muted); font-size: .73rem; line-height: 1.45; }
.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; contain: inline-size; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); background: #faf7f1; font-size: .64rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
th, td { padding: 13px 16px; border-top: 1px solid #e8e1d8; white-space: nowrap; }
td { color: #5d5851; font-size: .77rem; }
td strong { color: var(--ink); }
td a:hover { color: var(--copper); }
.text-right { text-align: right; }
.table-empty { padding: 38px; color: var(--muted); text-align: center; }
.table-link { color: var(--copper); font-weight: 800; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 20px 20px; }
.quick-grid a, .quick-action-form button { display: grid; width: 100%; height: 100%; padding: 15px; border: 1px solid #e7dfd5; border-radius: 11px; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.quick-grid a:hover, .quick-action-form button:hover { border-color: #cfb8a8; background: #fcf7f2; }
.quick-grid a:focus-visible, .quick-action-form button:focus-visible { outline: 3px solid rgba(167,95,58,.2); outline-offset: 2px; border-color: var(--copper); }
.quick-grid a > span, .quick-action-form button > span { color: var(--copper); font-size: 1.2rem; }
.quick-action-form { margin: 0; }
.quick-grid strong { margin: 7px 0 3px; font-size: .77rem; }
.quick-grid small { color: var(--muted); font-size: .66rem; line-height: 1.4; }

/* Projects */
.project-toolbar, .quote-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 13px; margin-bottom: 20px; padding: 18px 22px; }
.project-toolbar label, .quote-toolbar label { flex: 0 1 245px; min-width: 190px; }
.project-toolbar .btn, .quote-toolbar .btn { flex: 0 0 auto; }
.toolbar-count { margin-left: auto; padding: 8px 11px; border-radius: 99px; color: var(--muted); background: #f2ece3; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.project-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.project-card { padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.project-card:focus-visible { outline: 3px solid rgba(167,95,58,.2); outline-offset: 2px; border-color: var(--copper); box-shadow: var(--shadow); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.project-card-top > span:last-child { color: var(--muted); font-size: .72rem; }
.project-card h2 { margin-top: 23px; font-size: 1.6rem; }
.project-card > p { margin-top: 6px; color: var(--muted); font-size: .82rem; }
.project-progress { margin-top: 27px; }
.project-progress > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.project-progress strong { color: var(--ink); }
.project-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; padding: 20px 0; border-top: 1px solid #e7dfd5; border-bottom: 1px solid #e7dfd5; }
.project-card-meta div { display: grid; }
.project-card-meta small, .next-step small { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.project-card-meta strong { margin-top: 4px; font-size: .82rem; }
.project-card-meta.has-schedule { grid-template-columns: repeat(2, minmax(0,1fr)); row-gap: 18px; }
.project-card-meta.has-schedule > div:nth-child(2) small, .project-card-meta.has-schedule > div:nth-child(3) small { color: var(--copper); }
.project-card-meta.has-schedule > div:nth-child(2) strong, .project-card-meta.has-schedule > div:nth-child(3) strong { font-family: var(--font-display); }
.next-step { margin-top: 20px; }
.next-step p { margin-top: 5px; font-weight: 700; }
.breadcrumb { display: flex; gap: 9px; margin-bottom: 22px; color: var(--muted); font-size: .75rem; }
.breadcrumb a { color: var(--copper); font-weight: 700; }
.record-tabs { display: flex; align-items: center; gap: 5px; margin-bottom: 18px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-sm); }
.record-tabs a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border-radius: 8px; color: #625d55; font-size: .75rem; font-weight: 800; white-space: nowrap; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.record-tabs a:hover { color: var(--copper); background: #f6eee7; }
.record-tabs a:focus-visible { outline: 2px solid rgba(167,95,58,.3); outline-offset: 1px; color: var(--copper); background: #f6eee7; }
.project-hero-panel { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 32px 34px 26px; border-radius: var(--radius); color: #fff; background: var(--green-dark); overflow: hidden; }
.project-hero-panel::after { content: ""; position: absolute; right: -100px; bottom: -150px; width: 350px; height: 350px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 50px rgba(255,255,255,.025), 0 0 0 100px rgba(255,255,255,.02); }
.project-hero-panel h1 { position: relative; z-index: 1; margin-top: 15px; font-size: clamp(2rem, 4vw, 3rem); }
.project-hero-panel p { position: relative; z-index: 1; margin-top: 7px; color: #b8c8bd; }
.project-percent { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: end; }
.project-percent strong { font-family: var(--font-display); font-size: 3rem; }
.project-percent span { color: #b8c8bd; font-size: .72rem; }
.hero-progress { position: relative; z-index: 1; grid-column: 1 / -1; height: 8px; margin-top: 5px; background: rgba(255,255,255,.14); }
.hero-progress span { background: #d38a61; }
.project-facts { position: relative; z-index: 1; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-top: 5px; padding-top: 21px; border-top: 1px solid rgba(255,255,255,.13); }
.project-facts div { display: grid; }
.project-facts small { color: #9eafa4; font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; }
.project-facts strong { margin-top: 3px; font-size: .78rem; }
.crm-panel { margin-top: 20px; overflow: hidden; scroll-margin-top: 100px; }
.crm-panel > .panel-head { align-items: end; }
.contact-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 9px; }
.contact-actions .btn { min-height: 39px; padding: 8px 13px; font-size: .72rem; }
.lifecycle-callout { display: flex; align-items: center; gap: 15px; margin: 0 26px 22px; padding: 15px 17px; border: 1px solid #d8bca9; border-left: 4px solid var(--copper); border-radius: 10px; background: #fbf1ea; }
.lifecycle-callout strong { flex: 0 0 auto; font-family: var(--font-display); font-size: .83rem; }
.lifecycle-callout span { color: #6e6259; font-size: .75rem; }
.crm-form { display: grid; gap: 16px; padding: 0 26px 27px; }
.crm-form fieldset { min-width: 0; margin: 0; padding: 20px; border: 1px solid #e2d9ce; border-radius: 12px; background: #fdfaf5; }
.crm-form legend { padding: 0 8px; color: var(--copper); font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.crm-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.crm-fields.three-columns { grid-template-columns: repeat(3, minmax(0,1fr)); }
.crm-fields.four-columns { grid-template-columns: repeat(4, minmax(0,1fr)); }
.crm-fields .wide-field { grid-column: span 2; }
.crm-fields.four-columns .wide-field { grid-column: span 3; }
.crm-form.schedule-required [data-schedule-date] { border-color: #bd8a6c; background: #fffaf6; box-shadow: inset 0 0 0 1px rgba(167,95,58,.08); }
.crm-form.schedule-required [data-schedule-date]:focus { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(167,95,58,.12); }
.crm-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 3px; }
.crm-actions small { color: var(--muted); font-size: .7rem; }
.project-detail-grid { display: grid; grid-template-columns: minmax(0,1fr) 390px; gap: 20px; margin-top: 20px; }
.project-detail-main, .project-detail-side { display: grid; align-content: start; gap: 20px; }
.next-step-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 28px; border-left: 5px solid var(--copper); }
.next-step-panel .section-kicker { margin-bottom: 8px; }
.next-step-panel h2 { max-width: 750px; font-size: 1.35rem; }
.next-date { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.full-timeline { padding: 0 28px 30px; }
.full-timeline article { position: relative; display: grid; grid-template-columns: 62px 1fr; gap: 15px; padding-bottom: 22px; }
.full-timeline article:not(:last-child)::before { content: ""; position: absolute; top: 49px; bottom: -8px; left: 28px; width: 2px; background: #e2d8cc; }
.timeline-marker { position: relative; z-index: 1; display: grid; place-items: center; width: 58px; height: 58px; border: 5px solid #f2e4dc; border-radius: 50%; color: #fff; background: var(--copper); font-size: .68rem; font-weight: 800; }
.timeline-card { padding: 19px 20px; border: 1px solid #e4dcd2; border-radius: 12px; background: #fdfaf5; }
.timeline-card-head { display: flex; justify-content: space-between; gap: 15px; }
.timeline-card-head > div { display: flex; flex-direction: column; }
.timeline-card-head strong { font-size: .82rem; }
.timeline-card-head div span { color: var(--muted); font-size: .66rem; }
.timeline-tags { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 7px; }
.timeline-card-head .timeline-tags span { color: inherit; }
.step-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 99px; color: var(--copper) !important; background: #f2e4db; font-size: .61rem !important; font-weight: 800; white-space: nowrap; }
.timeline-card > p { margin-top: 15px; color: #5f5a53; font-size: .82rem; }
.timeline-next { display: grid; margin-top: 17px; padding: 12px 14px; border-radius: 8px; background: #eee6dc; }
.timeline-next small { color: var(--muted); font-size: .59rem; letter-spacing: .08em; text-transform: uppercase; }
.timeline-next strong { margin-top: 3px; font-size: .76rem; }
.timeline-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 9px; margin-top: 15px; }
.timeline-photos > a, .timeline-photo-placeholder { position: relative; display: block; min-width: 0; aspect-ratio: 4 / 3; border: 1px solid #dfd5c9; border-radius: 9px; background: linear-gradient(145deg, #aeb7a9, #5a6a59); overflow: hidden; }
.timeline-photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.timeline-photos > a:hover img { transform: scale(1.04); }
.timeline-photos > a:focus-visible { outline: 3px solid rgba(167,95,58,.25); outline-offset: 2px; }
.timeline-photo-placeholder.placeholder-dry-in { background: linear-gradient(145deg, #c8c5b9, #777c75); }
.timeline-photo-placeholder.placeholder-flashing-detail { background: linear-gradient(145deg, #8e9890, #455449); }
.update-form-panel { overflow: hidden; }
.stack-form { display: grid; gap: 15px; padding: 0 24px 24px; }
.field-help { margin-top: -5px; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.file-selection-count { color: var(--copper); font-size: .68rem; font-weight: 700; }
.side-summary { overflow: hidden; }
.side-summary > a { display: grid; grid-template-columns: 39px 1fr auto; gap: 12px; align-items: center; padding: 16px 22px; border-top: 1px solid #e7dfd5; }
.side-summary > a:hover { background: #fbf7f1; }
.side-summary > a > span { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 9px; color: var(--copper); background: #f0e2d9; }
.side-summary a div { display: grid; }
.side-summary a strong { font-size: .78rem; }
.side-summary a small { color: var(--muted); font-size: .66rem; }
.side-summary b { color: var(--copper); }

/* Invoices */
.invoice-summary-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.invoice-summary-grid article { display: grid; padding: 23px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.invoice-summary-grid small { color: var(--muted); }
.invoice-summary-grid strong { margin-top: 3px; font-family: var(--font-display); font-size: 1.65rem; }
.invoice-table th, .invoice-table td { padding: 16px 18px; }
.invoice-builder { display: grid; gap: 22px; }
.invoice-details-panel, .line-items-panel, .invoice-notes-panel { box-shadow: var(--shadow-sm); }
.invoice-form-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 18px; padding: 4px 28px 30px; }
.line-items-panel { overflow: hidden; }
.line-items-head, .line-item { display: grid; grid-template-columns: minmax(280px, 1fr) 120px 160px 140px 36px; gap: 12px; align-items: center; }
.line-items-head { padding: 12px 29px; border-top: 1px solid #e6ddd2; border-bottom: 1px solid #e6ddd2; color: var(--muted); background: #faf7f1; font-size: .64rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.line-items { display: grid; gap: 10px; padding: 20px 28px; }
.line-item { padding-bottom: 10px; border-bottom: 1px solid #eee7dd; }
.line-field { display: block; min-width: 0; }
.line-field > span:first-child, .line-total > span { display: none; }
.line-field input { height: 43px; }
.line-total { min-width: 0; font-family: var(--font-display); font-weight: 800; text-align: right; }
.line-item output { display: block; overflow-wrap: anywhere; }
.line-item > button { width: 36px; height: 36px; border: 0; border-radius: 7px; color: var(--red); background: var(--red-soft); cursor: pointer; font-size: 1.2rem; }
.money-input { position: relative; display: block; }
.money-input b { position: absolute; z-index: 1; top: 11px; left: 12px; color: var(--muted); font-weight: 500; }
.money-input input { padding-left: 27px; }
.invoice-totals { display: grid; justify-content: end; gap: 6px; padding: 5px 28px 28px; }
.invoice-totals > div { display: grid; grid-template-columns: 130px 150px; gap: 25px; padding: 8px 0; }
.invoice-totals span { color: var(--muted); text-align: right; }
.invoice-totals strong { font-family: var(--font-display); font-size: 1.1rem; text-align: right; }
.invoice-totals .grand-total { border-top: 2px solid var(--ink); }
.invoice-totals .grand-total strong { color: var(--copper); font-size: 1.55rem; }
.invoice-notes-panel { padding: 25px 28px; }
.invoice-builder-actions { display: flex; justify-content: end; gap: 12px; }
.invoice-detail-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.invoice-detail-actions > a { color: var(--copper); font-size: .8rem; font-weight: 800; }
.print-invoice { max-width: 1000px; margin: 0 auto; padding: 52px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.print-invoice-head { display: flex; align-items: start; justify-content: space-between; padding-bottom: 35px; border-bottom: 2px solid var(--ink); }
.print-invoice-head > div { display: flex; flex-direction: column; align-items: end; }
.print-invoice-head > div span { color: var(--muted); font-size: .74rem; letter-spacing: .18em; }
.print-invoice-head > div strong { font-family: var(--font-display); font-size: 2.1rem; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1.2fr .8fr; gap: 35px; padding: 37px 0; }
.invoice-parties > div { display: flex; flex-direction: column; }
.invoice-parties small, .invoice-note small { margin-bottom: 8px; color: var(--copper); font-size: .62rem; font-weight: 800; letter-spacing: .12em; }
.invoice-parties strong { margin-bottom: 4px; }
.invoice-parties span { color: var(--muted); font-size: .78rem; }
.print-line-table th { color: #fff; background: var(--green-dark); }
.print-line-table th, .print-line-table td { padding: 14px 16px; }
.print-line-table th:nth-child(n+2), .print-line-table td:nth-child(n+2) { text-align: right; }
.print-total-area { display: grid; grid-template-columns: 1fr 350px; gap: 50px; margin-top: 40px; }
.invoice-note p { max-width: 430px; color: var(--muted); font-size: .8rem; }
.print-totals { display: grid; }
.print-totals > div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.print-totals span { color: var(--muted); }
.print-totals .balance { margin-top: 5px; padding: 16px; border: 0; color: #fff; background: var(--copper); }
.print-totals .balance span { color: #fff; }
.print-invoice-footer { display: flex; justify-content: space-between; margin-top: 65px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .76rem; }
.print-invoice-footer span { color: var(--muted); }

/* Messaging */
.messaging-layout { display: grid; grid-template-columns: 290px minmax(0,1fr); gap: 20px; min-height: 660px; }
.conversation-list { padding: 20px 12px; }
.conversation-list h2 { padding: 4px 12px 16px; font-size: 1.1rem; }
.conversation-list > a { display: flex; gap: 11px; align-items: center; padding: 12px; border-radius: 10px; }
.conversation-list > a:hover, .conversation-list > a.active { background: #f3eae0; }
.conversation-list a div { display: grid; min-width: 0; }
.conversation-list a strong, .conversation-list a small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-list a strong { font-size: .76rem; }
.conversation-list a small { color: var(--muted); font-size: .64rem; }
.message-panel { display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.message-panel > header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.message-panel > header div { display: grid; }
.message-panel > header strong { font-family: var(--font-display); }
.message-panel > header span { color: var(--muted); font-size: .7rem; }
.message-panel > header a { color: var(--copper); font-size: .75rem; font-weight: 800; }
.message-thread { display: flex; flex-direction: column; gap: 21px; max-height: 560px; padding: 28px; overflow-y: auto; background: #fbf8f2; }
.message-bubble { display: flex; gap: 11px; max-width: 77%; }
.message-bubble.mine { align-self: flex-end; flex-direction: row-reverse; }
.message-bubble > div:last-child { min-width: 0; }
.bubble-meta { display: flex; gap: 10px; align-items: baseline; margin: 0 5px 5px; }
.bubble-meta strong { font-size: .7rem; }
.bubble-meta span { color: var(--muted); font-size: .6rem; }
.message-bubble p { padding: 12px 15px; border: 1px solid var(--line); border-radius: 4px 13px 13px 13px; background: #fff; font-size: .8rem; }
.message-bubble.mine p { color: #fff; background: var(--copper); border-color: var(--copper); border-radius: 13px 4px 13px 13px; }
.message-compose { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; padding: 18px 22px; border-top: 1px solid var(--line); }
.message-compose textarea { min-height: 70px; }

/* Photos */
.photo-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 18px 22px; }
.photo-toolbar form { display: grid; grid-template-columns: repeat(3, minmax(145px,1fr)) auto auto; gap: 12px; align-items: end; flex: 1; min-width: 0; }
.visibility-key { display: flex; gap: 18px; color: var(--muted); font-size: .7rem; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.customer-dot { background: var(--copper); }
.team-dot { background: var(--green); }
.upload-panel { margin-bottom: 20px; }
.upload-form { display: grid; grid-template-columns: 1.15fr 1fr 1.15fr 1.3fr .9fr auto; gap: 14px; align-items: end; padding: 0 24px 14px; }
.upload-note { padding: 0 24px 22px; color: var(--muted); font-size: .7rem; }
.photo-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.photo-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.photo-image { position: relative; height: 230px; background: linear-gradient(145deg, #aeb7a9, #5a6a59); overflow: hidden; }
.photo-image img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-dry-in { background: linear-gradient(145deg, #c8c5b9, #777c75); }
.placeholder-flashing-detail { background: linear-gradient(145deg, #8e9890, #455449); }
.placeholder-roof { position: absolute; inset: 0; }
.placeholder-roof::before { content: ""; position: absolute; right: 5%; bottom: -3%; left: 5%; height: 77%; background: repeating-linear-gradient(0deg, #51504c 0 11px, #44433f 11px 13px); clip-path: polygon(50% 0, 100% 75%, 100% 100%, 0 100%, 0 75%); box-shadow: 0 20px 35px rgba(0,0,0,.25); }
.placeholder-dry-in .placeholder-roof::before { background: repeating-linear-gradient(45deg, #727a73 0 16px, #666e68 16px 18px); }
.placeholder-flashing-detail .placeholder-roof::before { clip-path: polygon(0 30%, 45% 4%, 100% 45%, 100% 100%, 0 100%); background: linear-gradient(125deg, #595c5a 0 48%, #aeb3b0 48% 53%, #454946 53%); }
.visibility-pill { position: absolute; top: 13px; right: 13px; padding: 6px 9px; border-radius: 99px; color: #fff; font-size: .61rem; font-weight: 800; backdrop-filter: blur(8px); }
.visibility-pill.customer { background: rgba(167,95,58,.9); }
.visibility-pill.team { background: rgba(37,63,53,.9); }
.photo-card-body { padding: 19px; }
.photo-card-body strong { font-family: var(--font-display); }
.photo-card-body p { min-height: 44px; margin-top: 8px; color: var(--muted); font-size: .78rem; }
.photo-card-body small { display: block; margin-top: 14px; color: #928a80; font-size: .64rem; }
.photo-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-tags span { display: inline-flex; align-items: center; min-height: 24px; max-width: 100%; padding: 4px 8px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: .61rem; font-weight: 800; overflow-wrap: anywhere; }
.photo-tags span:last-child { color: var(--copper); background: #f2e4db; }
.photo-update-link { display: inline-flex; margin-top: 14px; color: var(--copper); font-size: .7rem; font-weight: 800; }
.photo-update-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.photo-update-link:focus-visible { outline: 2px solid rgba(167,95,58,.25); outline-offset: 3px; border-radius: 3px; }
.full-span { grid-column: 1 / -1; }

/* Lead feedback, project access, and account administration */
.quote-feedback { margin: 0; box-shadow: none; }
.quote-feedback p { min-width: 0; overflow-wrap: anywhere; }
.quote-feedback:focus { outline: 3px solid rgba(167,95,58,.2); outline-offset: 3px; }
.quote-feedback button { flex: 0 0 auto; color: currentColor; }

.portal-access-callout { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 26px 22px; padding: 17px 18px; border: 1px solid #c4d2c7; border-left: 4px solid var(--green); border-radius: 10px; background: linear-gradient(105deg, #edf3ee, #f8faf6); }
.portal-access-callout > div { display: grid; min-width: 0; }
.portal-access-callout small { color: var(--green); font-size: .61rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.portal-access-callout strong { margin-top: 3px; font-family: var(--font-display); font-size: .84rem; overflow-wrap: anywhere; }
.portal-access-callout span { margin-top: 2px; color: #647068; font-size: .73rem; overflow-wrap: anywhere; }
.portal-access-callout .btn { flex: 0 0 auto; min-height: 39px; padding: 8px 13px; font-size: .72rem; white-space: nowrap; }

.invoice-project-callout { display: grid; grid-template-columns: auto minmax(160px,.7fr) minmax(220px,1fr); gap: 8px 18px; align-items: baseline; margin-bottom: 20px; padding: 16px 19px; border: 1px solid #d9c4b5; border-left: 4px solid var(--copper); border-radius: 11px; background: #fbf3ed; box-shadow: var(--shadow-sm); }
.invoice-project-callout[hidden] { display: none; }
.invoice-project-callout span { color: var(--copper); font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.invoice-project-callout strong { min-width: 0; font-family: var(--font-display); font-size: .88rem; overflow-wrap: anywhere; }
.invoice-project-callout small { min-width: 0; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }

.access-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.access-summary-grid article { position: relative; display: grid; min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: var(--shadow-sm); overflow: hidden; }
.access-summary-grid article::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--green); }
.access-summary-grid article:nth-child(2)::before { background: var(--copper); }
.access-summary-grid article:nth-child(3)::before { background: var(--yellow); }
.access-summary-grid article:nth-child(4)::before { background: #7f695c; }
.access-summary-grid small { color: var(--muted); font-size: .7rem; }
.access-summary-grid strong { margin-top: 2px; font-family: var(--font-display); font-size: 1.7rem; }

.user-admin-layout { display: grid; grid-template-columns: minmax(300px,.72fr) minmax(0,1.45fr); gap: 20px; align-items: start; }
.invite-user-panel { position: sticky; top: 98px; min-width: 0; overflow: hidden; scroll-margin-top: 98px; }
.panel-intro { margin: 0 24px 20px; padding: 14px 15px; border-radius: 9px; color: #5f665f; background: #edf2ed; font-size: .75rem; line-height: 1.55; }
.customer-job-picker { display: grid; gap: 12px; padding: 15px; border: 1px solid #d8cec2; border-radius: 11px; background: #faf7f1; }
.customer-job-picker[hidden] { display: none !important; }
.customer-job-picker > div:first-child { display: grid; gap: 3px; }
.customer-job-picker > div:first-child strong { font-family: var(--font-display); font-size: .8rem; }
.customer-job-picker > div:first-child small { color: var(--muted); font-size: .66rem; line-height: 1.45; }
.job-access-options { display: grid; gap: 8px; max-height: 290px; padding-right: 3px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c6b8a8 transparent; }
.job-access-options.detail-jobs { max-height: 440px; }
.job-access-options:empty::after { content: "No jobs are available to attach yet."; padding: 16px; border: 1px dashed #d6cabd; border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.55); font-size: .7rem; text-align: center; }
.job-access-option { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 11px; align-items: start; padding: 11px 12px; border: 1px solid #e0d7cc; border-radius: 9px; color: var(--ink); background: #fff; cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.job-access-option:hover { border-color: #cbb5a5; background: #fffaf6; }
.job-access-option:focus-within { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(167,95,58,.12); }
.job-access-option input[type="checkbox"], .confirm-reassign input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--copper); box-shadow: none; }
.job-access-option > span { display: grid; min-width: 0; gap: 2px; }
.job-access-option strong { min-width: 0; font-size: .73rem; line-height: 1.35; overflow-wrap: anywhere; }
.job-access-option small { min-width: 0; color: var(--muted); font-size: .62rem; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.job-access-option.unavailable, .job-access-option:has(input:disabled) { border-color: #e4ded6; color: #77716a; background: #f1eee8; cursor: not-allowed; opacity: .7; }
.job-access-option.unavailable:hover, .job-access-option:has(input:disabled):hover { border-color: #e4ded6; background: #f1eee8; }
.job-access-option.conflict { border-color: #d9aaa5; background: #fcf0ee; }
.job-access-option.conflict:hover, .job-access-option.conflict:focus-within { border-color: var(--red); background: #fae8e5; }
.job-access-option.conflict small { color: #82534e; }

.users-directory-panel { min-width: 0; overflow: hidden; }
.user-filter-bar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 0 22px 22px; }
.user-filter-bar label { flex: 1 1 105px; min-width: 0; }
.user-filter-bar label:first-child { flex: 2 1 160px; }
.user-filter-bar input, .user-filter-bar select { height: 42px; font-size: .76rem; }
.user-filter-bar .btn { flex: 0 0 auto; min-height: 42px; padding: 9px 13px; font-size: .72rem; }
.user-directory-list { border-top: 1px solid #e8e1d8; }
.user-directory-row { display: grid; grid-template-columns: 40px minmax(115px,1.45fr) repeat(3,minmax(58px,.7fr)) auto; gap: 10px; align-items: center; min-width: 0; padding: 15px 18px; border-bottom: 1px solid #ebe4da; transition: background .18s ease; }
.user-directory-row:last-child { border-bottom: 0; }
.user-directory-row:hover { background: #fbf8f2; }
.user-directory-row > .avatar { width: 40px; height: 40px; }
.user-directory-identity, .user-directory-row > div:not(.avatar) { min-width: 0; }
.user-directory-identity { display: grid; gap: 1px; }
.user-directory-identity strong, .user-directory-identity span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-directory-identity strong { font-size: .76rem; }
.user-directory-identity span { color: var(--muted); font-size: .64rem; }
.user-directory-row > div:not(.avatar):not(.user-directory-identity) { display: grid; align-content: center; gap: 3px; }
.user-directory-row > div:not(.avatar):not(.user-directory-identity) small { color: var(--muted); font-size: .56rem; font-weight: 700; letter-spacing: .05em; line-height: 1.25; text-transform: uppercase; }
.user-directory-row > div:not(.avatar):not(.user-directory-identity) strong { min-width: 0; font-size: .69rem; overflow-wrap: anywhere; }
.user-directory-row .status { justify-self: start; }
.user-directory-row > .btn { min-height: 36px; padding: 7px 10px; font-size: .67rem; white-space: nowrap; }

.user-detail-head { position: relative; display: flex; align-items: center; gap: 22px; margin-bottom: 20px; padding: 28px 30px; border-radius: var(--radius); color: #fff; background: linear-gradient(120deg, var(--green-dark), var(--green)); box-shadow: var(--shadow); overflow: hidden; }
.user-detail-head::after { content: ""; position: absolute; right: -65px; bottom: -145px; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 42px rgba(255,255,255,.035), 0 0 0 84px rgba(255,255,255,.02); }
.user-detail-head > * { position: relative; z-index: 1; }
.avatar.large-avatar { flex: 0 0 74px; width: 74px; height: 74px; border: 3px solid rgba(255,255,255,.28); background: var(--copper); box-shadow: 0 8px 22px rgba(0,0,0,.15); font-size: 1.05rem; }
.user-detail-head > div:last-child { min-width: 0; }
.user-detail-head .status { margin-bottom: 8px; }
.user-detail-head h1 { font-size: clamp(1.8rem,3.5vw,2.75rem); overflow-wrap: anywhere; }
.user-detail-head p { margin-top: 6px; color: #c9d6ce; font-size: .8rem; overflow-wrap: anywhere; }
.user-detail-grid { display: grid; grid-template-columns: minmax(0,.88fr) minmax(0,1.12fr); gap: 20px; align-items: start; }
.user-detail-grid > .panel { min-width: 0; overflow: hidden; }
.invite-delivery-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 18px 24px 24px; border-top: 1px solid #e8e1d8; background: #fcf9f4; }
.invite-delivery-actions form { margin: 0; }
.invite-delivery-actions .btn { min-height: 40px; padding: 8px 13px; font-size: .72rem; }
.invite-delivery-actions small { flex: 1 0 100%; color: var(--muted); font-size: .67rem; }
.confirm-reassign { display: flex; grid-template-columns: none; align-items: start; gap: 11px; padding: 13px 14px; border: 1px solid #dfc995; border-radius: 9px; color: #69562e; background: var(--yellow-soft); font-size: .7rem; line-height: 1.45; }
.confirm-reassign input[type="checkbox"] { accent-color: var(--yellow); }
.access-history { margin-top: 20px; overflow: hidden; }
.access-history > div:not(.panel-head) { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 26px; border-top: 1px solid #e8e1d8; }
.access-history > div:not(.panel-head) span { font-size: .76rem; font-weight: 700; }
.access-history > div:not(.panel-head) small { color: var(--muted); font-size: .66rem; text-align: right; }

.claim-account-section { display: grid; place-items: center; min-height: calc(100vh - 78px); padding: 64px 20px; background: radial-gradient(circle at 18% 8%, rgba(167,95,58,.13), transparent 30%), radial-gradient(circle at 85% 82%, rgba(55,89,74,.12), transparent 34%), var(--ivory); }
.claim-account-card { width: min(100%,620px); padding: 42px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.claim-account-card > .brand { margin-bottom: 38px; }
.claim-account-card > .brand + div h1 { margin-top: 7px; font-size: clamp(2rem,5vw,3rem); }
.claim-account-card > .brand + div p { margin-top: 14px; color: var(--muted); line-height: 1.7; }
.claim-account-card > .brand + div p strong { color: var(--ink); overflow-wrap: anywhere; }
.claim-identity { display: flex; align-items: center; gap: 13px; margin: 25px 0; padding: 15px 16px; border: 1px solid #dfd5c8; border-radius: 11px; background: #f8f3eb; }
.claim-identity > div { display: grid; min-width: 0; }
.claim-identity strong { font-family: var(--font-display); font-size: .82rem; overflow-wrap: anywhere; }
.claim-identity small { color: var(--muted); font-size: .67rem; }
.claim-help { display: block; margin-top: 20px; color: var(--muted); font-size: .68rem; line-height: 1.55; text-align: center; }
.claim-message { display: flex; align-items: center; flex-direction: column; justify-content: center; width: min(620px,calc(100% - 40px)); min-height: 430px; margin: 64px auto; padding: 52px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.claim-message > span { display: inline-flex; margin-bottom: 18px; padding: 6px 10px; border-radius: 99px; color: var(--red); background: var(--red-soft); font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.claim-message h1 { max-width: 490px; font-size: clamp(2rem,5vw,3rem); }
.claim-message p { max-width: 440px; margin-top: 15px; color: var(--muted); }
.claim-message .btn { margin-top: 27px; }

.mail-preview { overflow: hidden; }
.mail-preview dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin: 0; background: rgba(255,255,255,.13); }
.mail-preview dl > div { display: grid; min-width: 0; gap: 5px; padding: 20px 23px; color: #fff; background: var(--green-dark); }
.mail-preview dt { color: #b8c9be; font-size: .61rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.mail-preview dd { min-width: 0; margin: 0; font-size: .78rem; font-weight: 700; overflow-wrap: anywhere; }
.mail-preview pre { max-height: 590px; margin: 0; padding: 30px; color: #3f3c37; background: #fffdf9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .75rem; line-height: 1.7; white-space: pre-wrap; overflow: auto; overflow-wrap: anywhere; }

/* Quotes/testimonials */
.quote-admin-grid, .testimonial-admin-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.quote-admin-card, .testimonial-admin-card { padding: 25px; }
.quote-card-link { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.quote-card-link:hover { transform: translateY(-3px); border-color: #cfb8a8; background: #fffaf4; box-shadow: var(--shadow); }
.quote-card-link:focus-visible { outline: 3px solid rgba(167,95,58,.2); outline-offset: 2px; border-color: var(--copper); box-shadow: var(--shadow); }
.quote-admin-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.quote-admin-head > div { display: flex; align-items: center; gap: 9px; }
.quote-admin-head small { color: var(--muted); font-size: .64rem; }
.quote-admin-head select { height: 35px; font-size: .72rem; }
.quote-card-link .quote-admin-head > strong { color: var(--copper); font-size: .72rem; transition: transform .18s ease; }
.quote-card-link:hover .quote-admin-head > strong, .quote-card-link:focus-visible .quote-admin-head > strong { transform: translateX(3px); }
.quote-admin-card h2 { margin-top: 20px; font-size: 1.5rem; }
.quote-service { display: block; margin-top: 4px; color: var(--copper); font-size: .8rem; }
.quote-admin-card > p { min-height: 55px; margin-top: 17px; color: var(--muted); font-size: .8rem; }
.quote-contact { display: grid; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.quote-contact a { color: var(--ink); font-weight: 700; }
.testimonial-admin-card .stars { font-size: 1.1rem; }
.testimonial-admin-card blockquote { margin: 24px 0; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.5; }
.testimonial-admin-card footer { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; border-top: 1px solid var(--line); }
.testimonial-admin-card footer > div { display: grid; }
.testimonial-admin-card footer span { color: var(--muted); font-size: .67rem; }
.testimonial-admin-card form { display: flex; gap: 9px; margin-top: 20px; }
.testimonial-submit-panel { max-width: 760px; }
.testimonial-submit-panel .stack-form { padding-top: 26px; }

.empty-state { display: grid; place-items: center; padding: 50px 25px; text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 55px; height: 55px; margin-bottom: 13px; border-radius: 50%; color: var(--copper); background: #f1e3da; font-size: 1.4rem; }
.empty-state h3 { font-size: 1.2rem; }
.empty-state p { margin-top: 5px; color: var(--muted); }
.error-page { display: grid; place-items: center; min-height: 65vh; text-align: center; }
.error-code { color: var(--copper); font-family: var(--font-display); font-size: 6rem; font-weight: 800; }
.error-page h1 { max-width: 700px; margin-bottom: 25px; }

@media (max-width: 1180px) {
  .service-grid { grid-template-columns: repeat(2,1fr); }
  .service-card { min-height: 350px; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .stat-grid.three-stats { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid, .dashboard-grid.lower-grid { grid-template-columns: 1fr; }
  .project-detail-grid { grid-template-columns: minmax(0,1fr) 330px; }
  .crm-fields.four-columns { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .crm-fields.four-columns .wide-field { grid-column: span 2; }
  .photo-toolbar { align-items: stretch; flex-direction: column; }
  .upload-form { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .upload-form .btn { align-self: end; }
  .line-items-head, .line-item { grid-template-columns: minmax(220px,1fr) 95px 130px 110px 34px; }
  .photo-grid { grid-template-columns: repeat(2,1fr); }
  .user-admin-layout, .user-detail-grid { grid-template-columns: 1fr; }
  .invite-user-panel { position: static; }
}

@media (max-width: 960px) {
  .hero-grid, .intro-grid, .process-grid, .quote-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 520px; }
  .intro-grid, .process-grid, .quote-grid { gap: 45px; }
  .process-copy, .quote-copy { position: static; }
  .testimonial-grid { grid-template-columns: 1fr 1fr; }
  .testimonial-cta { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .login-section { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .app-frame { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; width: min(300px, 86vw); height: 100dvh; transform: translateX(-105%); visibility: hidden; overflow-y: auto; transition: transform .25s ease, visibility .25s; box-shadow: 15px 0 35px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .sidebar-toggle { display: block; }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; display: block; border: 0; background: rgba(20,31,27,.48); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, visibility .25s; }
  .sidebar-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }
  .app-header-copy { margin-right: auto; margin-left: 15px; }
  .project-detail-grid { grid-template-columns: 1fr; }
  .crm-fields.three-columns { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .upload-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .invoice-form-grid { grid-template-columns: 1fr 1fr; }
  .line-items-panel { overflow-x: auto; }
  .line-items-head, .line-item { min-width: 850px; }
  .messaging-layout { grid-template-columns: 220px minmax(0,1fr); }
  .project-facts { grid-template-columns: 1fr 1fr; }
  .user-directory-row { grid-template-columns: 40px minmax(150px,1.5fr) repeat(3,minmax(72px,.7fr)) auto; gap: 12px; }
  .access-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (min-width: 721px) and (max-width: 960px) {
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding: 14px; }
  .responsive-table tr { padding: 5px 14px; border: 1px solid #e5ddd3; border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(41,34,26,.035); }
  .responsive-table td { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 43px; padding: 10px 0; border-bottom: 1px solid #eee7dd; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .responsive-table td:last-child { border-bottom: 0; }
  .responsive-table td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
  .responsive-table .table-action { display: block; min-height: 0; padding: 12px 0; text-align: center; }
  .responsive-table .table-action::before { display: none; }
  .responsive-table .table-link { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; background: #f5e9e0; }
  .responsive-table .table-empty { grid-column: 1 / -1; display: block; padding: 28px 12px; border: 0; text-align: center; }
  .responsive-table .table-empty::before { display: none; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 28px, 1180px); }
  .section { padding: 70px 0; }
  .nav-wrap { position: relative; z-index: 2; }
  .site-nav { position: fixed; z-index: 2; top: 78px; right: 14px; left: 14px; display: none; max-height: calc(100dvh - 94px); flex-direction: column; align-items: stretch; gap: 4px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); overflow-y: auto; }
  .site-nav.open { display: flex; }
  .site-nav a { display: flex; align-items: center; min-height: 46px; padding: 10px 12px; }
  .site-nav .nav-login { justify-content: center; margin-top: 4px; }
  .nav-toggle { display: block; }
  .nav-backdrop { position: fixed; z-index: 1; inset: 78px 0 0; display: block; border: 0; background: rgba(20,31,27,.42); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s; }
  .nav-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }
  .hero { padding: 60px 0 75px; }
  .hero-grid { gap: 40px; }
  .hero-copy h1 { font-size: clamp(2.7rem, 13vw, 4rem); }
  .hero-copy > p { font-size: 1rem; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; white-space: normal; text-align: center; }
  .trust-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
  .trust-row span { font-size: .72rem; overflow-wrap: anywhere; }
  .hero-visual { min-height: 390px; border-radius: 110px 110px 18px 18px; }
  .house-scene { right: 10px; left: 10px; transform: scale(.92); transform-origin: bottom; }
  .section-head { display: grid; gap: 15px; }
  .service-grid, .testimonial-grid, .project-card-grid, .quote-admin-grid, .testimonial-admin-grid { grid-template-columns: 1fr; }
  .service-card { display: flex; flex-direction: column; min-height: 0; padding: 27px 23px; }
  .service-card a { position: static; margin-top: 28px; }
  .service-icon { margin: 28px 0 32px; }
  .testimonial-card, .testimonial-cta { min-height: 0; padding: 27px 23px; }
  .testimonial-cta { grid-column: auto; }
  .form-row { grid-template-columns: 1fr; }
  .quote-form { padding: 25px 20px; }
  .quote-feedback { padding: 13px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div:first-child { grid-column: auto; }
  .footer-bottom { gap: 15px; flex-direction: column; }
  .login-panel { width: min(100% - 36px, 520px); padding: 40px 0; }
  .login-heading { margin-top: 42px; }
  .login-heading h1 { font-size: 2.7rem; }
  .app-header { padding: 0 16px; }
  .app-header-copy { min-width: 0; }
  .app-header-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-header-copy span { display: none; }
  .user-menu > div:nth-child(2) { display: none; }
  .app-content { padding: 28px 15px 55px; }
  .welcome-row, .page-head { align-items: start; flex-direction: column; }
  .welcome-row .btn, .page-head .btn { width: 100%; }
  .stat-grid, .stat-grid.customer-stats, .stat-grid.three-stats, .invoice-summary-grid { grid-template-columns: 1fr; }
  .project-toolbar, .quote-toolbar { align-items: stretch; flex-direction: column; padding: 17px; }
  .project-toolbar label, .quote-toolbar label { flex-basis: auto; width: 100%; min-width: 0; }
  .project-toolbar .btn, .quote-toolbar .btn { width: 100%; }
  .toolbar-count { align-self: start; order: -1; margin-left: 0; }
  .quick-grid { grid-template-columns: 1fr; }
  .record-tabs { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
  .project-hero-panel { grid-template-columns: 1fr; padding: 25px 20px; }
  .project-percent { align-items: start; }
  .project-facts { grid-template-columns: 1fr 1fr; }
  .crm-panel > .panel-head { align-items: stretch; flex-direction: column; }
  .contact-actions { justify-content: stretch; }
  .contact-actions .btn { flex: 1; }
  .lifecycle-callout { align-items: start; flex-direction: column; gap: 5px; margin: 0 18px 18px; }
  .portal-access-callout { align-items: stretch; flex-direction: column; gap: 13px; margin: 0 18px 18px; }
  .portal-access-callout .btn { width: 100%; white-space: normal; }
  .crm-form { padding: 0 18px 21px; }
  .crm-form fieldset { padding: 17px 14px; }
  .crm-fields, .crm-fields.three-columns, .crm-fields.four-columns { grid-template-columns: 1fr; }
  .crm-fields .wide-field, .crm-fields.four-columns .wide-field { grid-column: auto; }
  .crm-actions { align-items: stretch; flex-direction: column; }
  .crm-actions .btn { width: 100%; }
  .next-step-panel { align-items: start; flex-direction: column; }
  .full-timeline { padding: 0 15px 22px; }
  .full-timeline article { grid-template-columns: 45px 1fr; gap: 9px; }
  .full-timeline article:not(:last-child)::before { left: 21px; }
  .timeline-marker { width: 45px; height: 45px; border-width: 4px; font-size: .58rem; }
  .timeline-card { padding: 15px; }
  .timeline-card-head { flex-direction: column; }
  .timeline-tags { justify-content: start; }
  .timeline-photos { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .invoice-form-grid { grid-template-columns: 1fr; padding-inline: 18px; }
  .invoice-project-callout { grid-template-columns: 1fr; gap: 3px; }
  .panel-head { align-items: flex-start; gap: 12px; padding-inline: 18px; }
  .panel-head .btn { min-height: 38px; padding: 8px 11px; font-size: .72rem; }
  .line-items-panel { overflow: visible; }
  .line-items-head { display: none; }
  .line-items { gap: 14px; padding: 0 18px 18px; }
  .line-item { position: relative; grid-template-columns: minmax(0,1fr) minmax(0,1fr); min-width: 0; gap: 13px; padding: 18px 14px 14px; border: 1px solid #e2d8cc; border-radius: 11px; background: #fffdf9; }
  .line-item > .line-field:first-child { grid-column: 1 / -1; padding-right: 43px; }
  .line-field > span:first-child, .line-total > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
  .money-input { display: block; }
  .line-total { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding-top: 11px; border-top: 1px solid #eee5da; text-align: left; }
  .line-total > span { margin: 0; }
  .line-item > button { position: absolute; top: 18px; right: 14px; width: 44px; height: 44px; }
  .invoice-totals { justify-content: stretch; padding-inline: 18px; }
  .invoice-totals > div { grid-template-columns: minmax(0,1fr) auto; gap: 18px; }
  .invoice-builder-actions { flex-direction: column-reverse; }
  .invoice-builder-actions .btn { width: 100%; }
  .print-invoice { padding: 28px 20px; }
  .invoice-parties { grid-template-columns: 1fr; gap: 23px; }
  .print-total-area { grid-template-columns: 1fr; gap: 25px; }
  .print-invoice-footer { gap: 13px; flex-direction: column; }
  .messaging-layout { grid-template-columns: 1fr; }
  .conversation-list { display: flex; gap: 5px; overflow-x: auto; }
  .conversation-list h2 { display: none; }
  .conversation-list > a { min-width: 200px; }
  .message-bubble { max-width: 92%; }
  .message-compose { grid-template-columns: 1fr; }
  .photo-toolbar { align-items: stretch; flex-direction: column; }
  .photo-toolbar form { grid-template-columns: 1fr; min-width: 0; }
  .photo-toolbar form .btn { width: 100%; }
  .visibility-key { flex-direction: column; gap: 4px; }
  .upload-form { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .access-summary-grid { grid-template-columns: 1fr; }
  .panel-intro { margin-inline: 18px; }
  .user-filter-bar { display: grid; grid-template-columns: 1fr; padding-inline: 18px; }
  .user-filter-bar label, .user-filter-bar label:first-child, .user-filter-bar .btn { width: 100%; }
  .user-directory-row { grid-template-columns: 40px minmax(0,1fr); gap: 10px 12px; align-items: start; padding: 17px 18px; }
  .user-directory-row > .avatar { grid-row: 1; }
  .user-directory-identity { align-self: center; }
  .user-directory-identity strong, .user-directory-identity span { white-space: normal; overflow-wrap: anywhere; }
  .user-directory-row > div:not(.avatar):not(.user-directory-identity) { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 8px; border-top: 1px solid #eee7de; }
  .user-directory-row > .btn { grid-column: 1 / -1; width: 100%; margin-top: 5px; }
  .user-detail-head { align-items: start; gap: 16px; padding: 23px 20px; }
  .avatar.large-avatar { flex-basis: 58px; width: 58px; height: 58px; font-size: .85rem; }
  .invite-delivery-actions { align-items: stretch; flex-direction: column; padding-inline: 18px; }
  .invite-delivery-actions .btn, .invite-delivery-actions form .btn { width: 100%; }
  .invite-delivery-actions small { flex-basis: auto; }
  .access-history > div:not(.panel-head) { align-items: start; flex-direction: column; gap: 3px; padding-inline: 18px; }
  .access-history > div:not(.panel-head) small { text-align: left; }
  .claim-account-section { padding: 38px 15px; }
  .claim-account-card { padding: 28px 20px; border-radius: 16px; }
  .claim-account-card > .brand { margin-bottom: 30px; }
  .claim-message { width: min(100% - 30px,620px); min-height: 360px; margin: 38px auto; padding: 38px 22px; border-radius: 16px; }
  .mail-preview dl { grid-template-columns: 1fr; }
  .mail-preview pre { padding: 20px 18px; font-size: .7rem; }
  input, select, textarea, .user-filter-bar input, .user-filter-bar select, .quote-admin-head select { font-size: 1rem; }

  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tbody { padding: 8px 14px 14px; }
  .responsive-table tr { margin-top: 10px; padding: 5px 14px; border: 1px solid #e5ddd3; border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(41,34,26,.035); }
  .responsive-table td { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 43px; padding: 10px 0; border-bottom: 1px solid #eee7dd; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .responsive-table td:last-child { border-bottom: 0; }
  .responsive-table td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
  .responsive-table td.text-right { text-align: right; }
  .responsive-table .table-action { display: block; min-height: 0; padding: 12px 0; text-align: center; }
  .responsive-table .table-action::before { display: none; }
  .responsive-table .table-link { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; background: #f5e9e0; }
  .responsive-table .table-empty { display: block; padding: 28px 12px; border: 0; text-align: center; }
  .responsive-table .table-empty::before { display: none; }

  .print-line-table, .print-line-table tbody, .print-line-table tr, .print-line-table td { display: block; width: 100%; }
  .print-line-table thead { display: none; }
  .print-line-table tr { margin-top: 13px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; }
  .print-line-table td { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid #eee7dd; text-align: right !important; white-space: normal; overflow-wrap: anywhere; }
  .print-line-table td:last-child { border-bottom: 0; }
  .print-line-table td::before { content: attr(data-label); color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
}

@media (max-width: 480px) {
  .container { width: min(100% - 24px, 1180px); }
  .section { padding: 58px 0; }
  .brand { gap: 9px; }
  .brand-mark { transform: scale(.9); transform-origin: left center; }
  .hero { padding: 48px 0 60px; }
  .hero-copy h1 { font-size: clamp(2.35rem, 12.5vw, 3.25rem); overflow-wrap: anywhere; }
  .eyebrow, .section-kicker { font-size: .65rem; letter-spacing: .11em; }
  .hero-visual { min-height: 330px; border-radius: 80px 80px 16px 16px; }
  .house-scene { bottom: 30px; transform: scale(.78); }
  .hero-card { right: 12px; bottom: 12px; left: 12px; padding: 13px; }
  .hero-card-icon { flex-basis: 36px; width: 36px; height: 36px; }
  .hero-card small { font-size: .7rem; line-height: 1.4; }
  .process-list li { grid-template-columns: 42px 1fr; gap: 10px; padding: 25px 0; }
  .quote-form { padding: 22px 15px; }
  .login-panel { width: min(100% - 28px, 520px); padding: 30px 0 42px; }
  .login-heading { margin: 38px 0 26px; }
  .login-heading h1 { font-size: 2.35rem; }
  .app-header { min-height: 70px; padding-inline: 10px; }
  .app-header-copy { margin-left: 8px; }
  .user-menu { gap: 7px; }
  .user-menu .avatar { flex-basis: 34px; width: 34px; height: 34px; }
  .user-menu > a { width: 44px; height: 44px; }
  .app-content { padding: 22px 10px 45px; }
  .page-head h1, .welcome-row h1 { font-size: 2rem; }
  .project-facts { grid-template-columns: 1fr; }
  .contact-actions { display: grid; grid-template-columns: 1fr; }
  .timeline-photos { grid-template-columns: 1fr; }
  .panel-head { flex-wrap: wrap; padding: 18px 14px; }
  .panel-head > div { min-width: 0; }
  .panel-head .btn { width: 100%; }
  .quote-admin-head { align-items: flex-start; flex-direction: column; }
  .line-items { padding-inline: 12px; }
  .line-item { grid-template-columns: 1fr; }
  .line-item > .line-field:first-child, .line-total { grid-column: 1; }
  .invoice-detail-actions { align-items: stretch; flex-direction: column; gap: 12px; }
  .invoice-detail-actions .btn { width: 100%; }
  .print-invoice { padding: 22px 14px; }
  .print-invoice-head { align-items: flex-start; flex-direction: column; gap: 24px; }
  .print-invoice-head > div { align-items: flex-start; }
  .message-panel > header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .message-thread { padding: 18px 12px; }
  .message-bubble { max-width: 100%; }
  .message-bubble p { overflow-wrap: anywhere; }
  .message-bubble .avatar { display: none; }
  .message-compose .btn { width: 100%; }
  .flash p { min-width: 0; overflow-wrap: anywhere; }
}

@media print {
  body { background: #fff !important; }
  .sidebar, .app-header, .no-print, .flash { display: none !important; }
  .app-frame { display: block; }
  .app-content { width: 100%; padding: 0; }
  .print-invoice { max-width: none; margin: 0; padding: 25px; border: 0; box-shadow: none; }
  .print-invoice a { text-decoration: none; }
  .print-line-table { display: table; }
  .print-line-table thead { display: table-header-group; }
  .print-line-table tbody { display: table-row-group; }
  .print-line-table tr { display: table-row; margin: 0; padding: 0; border: 0; }
  .print-line-table th, .print-line-table td { display: table-cell; width: auto; padding: 14px 16px; border: 0; }
  .print-line-table td::before { display: none; }
  @page { margin: .45in; }
}
