/* Shared colors for every foreman page. Existing layout rules stay in style.css. */
:root{--ink:#f5f5f5;--muted:#d0d3d9;--red:#ff5c65;--red-dark:#e73f4b;--line:#86353c;--paper:#000;--charcoal:#080808}
body.foreman-theme,body.foreman-theme .workspace{background:#000;color:#f5f5f5;color-scheme:dark}
body.foreman-theme :is(.topbar,.sidebar){background:#080808;border-color:#a42b36}
body.foreman-theme :is(.panel,.why-card,.material-row,.prep-template,.wide-notice,.missing-summary){background:#111;border-color:#a42b36;box-shadow:none;color:#f5f5f5}
body.foreman-theme :is(.hero,.email-preview pre){background:#080808;border:1px solid #a42b36;color:#f5f5f5}
body.foreman-theme :is(h1,h2,h3,h4,.section-kicker,.nav-label,.question-label,.concept-value){color:#ff5c65}
body.foreman-theme :is(p,li,small,.subtle,.field-help,.measurement-caption,.sample-caption,.small-label,.field,.optional,.scope-strip,.breadcrumbs,.breadcrumbs strong,.footer,.footer>span:first-child,.storage-note,.email-headers,.inspection-note,.inspection-location,.item-row-title,.prep-checks label,.demo-quiz label,.source-link span,.source-link strong){color:#d9dce2}
body.foreman-theme :is(.field input,.field select,.field textarea,.question-box){background-color:#fff;color:#111;border-color:#d12d3d;color-scheme:light}
body.foreman-theme .question-box textarea{background:transparent;color:#111}
body.foreman-theme :is(input,textarea)::placeholder{color:#5c616a;opacity:1}
body.foreman-theme :is(button,.primary,.secondary,.text-button,.example,.preview-badge,.icon-button,.missing-item,.email-launch,.skip){background:#fff!important;color:#111!important;border:2px solid #d12d3d;box-shadow:none}
body.foreman-theme :is(button,.primary,.secondary,.text-button,.example,.preview-badge,.icon-button,.missing-item,.email-launch):hover{background:#fff0f1!important;color:#111!important;border-color:#ff5c65}
body.foreman-theme .nav-item[aria-current=page]{background:#fff!important;color:#111!important;box-shadow:inset 5px 0 #d12d3d!important}
body.foreman-theme :is(.nav-item,.primary,.secondary,.icon-button,.example,.missing-item) svg{color:#bc1d2d}
body.foreman-theme .nav-count{background:#111;color:#fff}
body.foreman-theme .missing-item :is(strong,span){color:#111}
body.foreman-theme :is(.tag,.tag.amber,.tag.red,.context-tag,.concept-mark){background:#271015;color:#ffb6bd;border:1px solid #a42b36}
body.foreman-theme :is(.source-link,.layer-icon,.library-icon,.result-status-icon){background:#1c1012;color:#ff929a;border-color:#a42b36}
body.foreman-theme .source-link:hover{background:#301218;border-color:#ff5c65}
body.foreman-theme .library-card a{color:#ff929a}
body.foreman-theme :is(.form-divider,.missing-flag,.error){color:#ff929a}
body.foreman-theme :is(.needs-detail,.demo-quiz fieldset){background:#211014;border-color:#e74b5a}
body.foreman-theme .form-divider:after{background:#86353c}
body.foreman-theme :is(.submit-row,.workflow-section,.demo-quiz,.lookup-note,.result-foot,.scope-strip,.footer,.maker){border-color:#86353c}
body.foreman-theme .prep-checks input:checked+span{color:#aeb4be}
body.foreman-theme #quiz-result strong{color:#fff}
body.foreman-theme #toast{background:#fff;color:#111;border:2px solid #d12d3d}
body.foreman-theme :is(button,a,input,select,textarea):focus-visible{outline:3px solid #ff929a;outline-offset:3px}
@media(max-width:700px){body.foreman-theme .nav-item{border:1px solid #d12d3d;border-radius:6px}body.foreman-theme .nav-item[aria-current=page]{box-shadow:inset 0 -4px #d12d3d!important}}

/* Logo composition requested for the large banner; shared controls keep their layout. */
@font-face{font-family:ForemanDisplay;src:url('fonts/foreman-display.ttf') format('truetype');font-style:italic;font-weight:800;font-display:swap}
body.foreman-theme .nav-label{font-family:ForemanDisplay,Impact,'Arial Black',sans-serif;font-style:italic;font-weight:800;font-size:20px;letter-spacing:.3px;text-transform:uppercase;color:#f5f5f5;transform:skewX(-4deg);text-shadow:2px 2px 0 #a82230}
.hero.hero-emblem .hero-copy{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:24px;align-items:center}.banner-emblem{display:block;grid-column:2;grid-row:1;width:260px;height:210px;object-fit:contain;justify-self:end}.hero.hero-emblem p{grid-column:1;grid-row:1;margin:0;max-width:420px}
@media(max-width:1000px){.hero.hero-emblem .hero-copy{grid-template-columns:minmax(0,1fr) 210px;gap:16px}.banner-emblem{width:210px;height:180px}}
@media(max-width:700px){.hero.hero-emblem .hero-copy{grid-template-columns:minmax(0,1fr) 140px;gap:12px;text-align:left}.banner-emblem{width:140px;height:145px}.hero.hero-emblem p{font-size:13px;line-height:1.7}.hero.hero-emblem{padding:22px 18px}}
@media(max-width:375px){.hero.hero-emblem .hero-copy{grid-template-columns:minmax(0,1fr) 115px}.banner-emblem{width:115px;height:135px}}

/* Blend the logo's black matte into both dark headers without a rectangle. */
body.foreman-theme .banner-emblem,body.foreman-theme .header-foreman-logo{mix-blend-mode:screen;background:transparent;border-radius:0;border:0;box-shadow:none}

/* Centered transparent emblem over decorative sprinkler plan linework. */
body.foreman-theme .hero.hero-emblem{background-image:linear-gradient(90deg,#0007,#000b 35%,#000b 65%,#0007),url('sprinkler-blueprint.svg');background-size:cover;background-position:center;padding:22px 30px}
.hero.hero-emblem .hero-copy{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,340px) minmax(0,1fr);gap:24px;align-items:center}
body.foreman-theme .banner-emblem{grid-column:2;grid-row:1;width:100%;height:225px;object-fit:contain;justify-self:center;mix-blend-mode:normal;background:transparent}
.hero.hero-emblem p{grid-column:1;grid-row:1;margin:0;font-size:15px;max-width:270px;text-shadow:0 2px 5px #000}
.banner-notes{grid-column:3;grid-row:1;justify-self:end}.banner-notes .secondary{white-space:normal;text-align:left}
body.foreman-theme .header-foreman-logo{mix-blend-mode:normal;background:transparent}
@media(max-width:1100px){.hero.hero-emblem .hero-copy{grid-template-columns:minmax(0,1fr) 220px minmax(0,1fr);gap:14px}.hero.hero-emblem p{grid-column:1;grid-row:1;font-size:14px}.hero.hero-emblem .banner-notes{grid-column:3;grid-row:1;justify-self:end}.hero.hero-emblem .banner-emblem{grid-column:2;grid-row:1;height:200px}}
@media(max-width:700px){body.foreman-theme .hero.hero-emblem{padding:16px 18px 22px}.hero.hero-emblem .hero-copy{display:flex;flex-direction:column;gap:12px;text-align:center}.hero.hero-emblem .banner-emblem{width:min(100%,280px);height:190px;order:-1}.hero.hero-emblem p{font-size:14px;max-width:none}.hero.hero-emblem .banner-notes{align-self:center}.banner-notes .secondary{text-align:center}}

/* Original-quality plan library and touch-friendly full-screen photo viewer. */
.plan-library{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.plan-card{overflow:hidden}.plan-card-details{padding:20px}.plan-card-details h3{margin:0 0 7px;overflow-wrap:anywhere}.plan-card-details p{font-size:14px}.plan-card-details .item-buttons{margin-top:15px}.plan-thumbnail{display:block;width:100%;height:220px;padding:8px;border-radius:0!important;overflow:hidden}.plan-thumbnail img{display:block;width:100%;height:100%;object-fit:contain}.plan-viewer{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;border:0;padding:0;background:#07090c;color:#fff;overflow:hidden}.plan-viewer[open]{display:flex;flex-direction:column}.plan-viewer::backdrop{background:#000}.plan-viewer-header{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:15px 22px;border-bottom:1px solid #b32939;flex:none}.plan-viewer-header h2{font-size:18px;margin:0;max-width:65vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.plan-viewer-header p{font-size:14px;margin:3px 0 0}.plan-zoom-controls{display:flex;align-items:center;justify-content:center;gap:13px;padding:10px 18px;flex:none;flex-wrap:wrap}.plan-zoom-controls input{width:min(28vw,260px);accent-color:#d12d3d;min-height:40px}.plan-zoom-controls label,.plan-zoom-controls output{font-size:14px;color:#eee}.plan-zoom-controls output{min-width:48px}.plan-zoom-controls .secondary{min-width:44px}.plan-stage{position:relative;flex:1;min-height:0;overflow:hidden;touch-action:none;background:#171a20;cursor:grab;overscroll-behavior:contain}.plan-stage:active{cursor:grabbing}.plan-full-image{position:absolute;left:0;top:0;max-width:none;transform-origin:0 0;user-select:none;-webkit-user-select:none;pointer-events:none}.plan-thumbnail:focus-visible{outline-offset:-5px!important}body.foreman-theme button:disabled{opacity:.6;cursor:not-allowed}
@media(max-width:700px){.sidebar .nav-item{width:16.666666%;font-size:10px;padding-left:2px;padding-right:2px;min-width:0}.plan-library{grid-template-columns:1fr}.plan-viewer-header{padding:10px 12px;align-items:flex-start}.plan-viewer-header p{font-size:12px;max-width:55vw}.plan-viewer-header h2{max-width:55vw;font-size:16px}.plan-zoom-controls{gap:8px;padding:8px}.plan-zoom-controls input{width:22vw}.plan-zoom-controls label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.plan-zoom-controls .secondary{padding:9px 12px;font-size:13px}}

/* Blue blueprint linework behind the home banner. */
body.foreman-theme .hero.hero-organized{display:block;min-height:250px;padding:25px 30px;background-color:#070809;background-image:linear-gradient(90deg,#08090af2,#08090acc 28%,#08090a66 52%,#08090ae6),url('sprinkler-blueprint.svg');background-size:cover;background-position:center;border:1px solid #962d37}
@media(max-width:700px){body.foreman-theme .hero.hero-organized{padding:21px 18px;min-height:0;background-image:linear-gradient(180deg,#08090adf,#08090af5 52%,#08090a),url('sprinkler-blueprint.svg')}}

/* Blueprint file previews can display PDFs alongside plan photos. */
.plan-pdf-tile{display:grid;place-items:center;gap:8px;width:100%;height:100%;background:linear-gradient(135deg,#20242c,#0c0e12);color:#fff;font-weight:800;letter-spacing:1px}.plan-pdf-tile span{display:grid;place-items:center;width:54px;height:64px;border-radius:6px;background:#fff;color:#c52e3b;font-size:18px;box-shadow:0 5px 15px #0005}.plan-pdf-viewer{width:100%;height:100%;min-height:0;border:0;background:#fff}
@media(max-width:700px){.plan-pdf-viewer{min-height:0}}
.plan-pdf-fallback{position:absolute;right:12px;bottom:12px;margin:0;padding:8px 10px;border-radius:7px;background:#111d;color:#fff;font-size:13px;z-index:1}.plan-pdf-fallback a{color:#fff;text-decoration:underline}

/* Keep the headline and field-note action together; center the foreman mark. */
.hero-organized > h1.sr-only{margin:-1px}
.hero-organized .hero-copy{display:grid;width:100%;grid-template-columns:minmax(0,1fr) minmax(280px,380px);grid-template-rows:1fr auto;gap:12px 34px;align-items:center}
.hero-organized .hero-message{grid-column:1;grid-row:1;max-width:530px}
.hero-organized .hero-message h1{font-size:clamp(36px,3.2vw,48px);font-weight:750;letter-spacing:-1.9px}
.hero-organized .hero-message p{font-size:18px;line-height:1.6;max-width:500px}
.hero-organized .banner-emblem{grid-column:2;grid-row:1 / span 2;width:100%;height:230px;max-height:250px;justify-self:end}
.hero-organized .hero-actions{grid-column:1;grid-row:2;display:flex;justify-content:flex-start;justify-self:start;gap:12px;max-width:none;width:auto}
.hero-organized .hero-actions .secondary{width:auto;justify-content:center;min-width:180px}
.offline-badge{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;color:#427148;background:#f0f7f0;border:1px solid #d4e6d5;padding:6px 10px;border-radius:20px;font-size:12px;font-weight:650}
.offline-badge:before{content:'';width:7px;height:7px;border-radius:50%;background:#4f9658;flex:none}
.offline-badge[data-state="offline"]{color:#8b4d18;background:#fff5e8;border-color:#f2dfbf}
.offline-badge[data-state="offline"]:before{background:#df8a2c}
.offline-badge[data-state="error"]{color:#a11f2a;background:#fff2f3;border-color:#f0cdd1}
.offline-badge[data-state="error"]:before{background:#c92f3b}
@media(max-width:1100px){.hero-organized .hero-copy{grid-template-columns:minmax(0,1fr) 280px;gap:12px 22px}.hero-organized .banner-emblem{height:205px}.hero-organized .hero-message h1{font-size:38px}}
@media(max-width:700px){.hero-organized .hero-copy{grid-template-columns:minmax(0,1fr) 116px;grid-template-rows:1fr auto;gap:7px 10px}.hero-organized .hero-message{grid-column:1;grid-row:1;max-width:none}.hero-organized .hero-message h1{font-size:26px;line-height:1.08;letter-spacing:-.8px}.hero-organized .hero-message p{font-size:14px;line-height:1.45}.hero-organized .banner-emblem{grid-column:2;grid-row:1;width:116px;height:140px;max-height:none}.hero-organized .hero-actions{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:1fr 1fr;justify-self:stretch;gap:8px;width:100%}.hero-organized .hero-actions .secondary{min-width:0;width:100%;min-height:46px;padding:9px 8px;font-size:12px}.header-brand-tools{gap:6px}.offline-badge{font-size:10px;padding:5px 7px;gap:4px}.offline-badge:before{width:6px;height:6px}.header-foreman-logo{display:none}}
@media(max-width:380px){.hero-organized .hero-copy{grid-template-columns:minmax(0,1fr) 96px}.hero-organized .banner-emblem{width:96px;height:124px}.hero-organized .hero-message h1{font-size:23px}}

/* On-device scan review with four large, adjustable corner handles. */
.plan-scan-dialog{width:min(1100px,100vw);max-width:100vw;max-height:100dvh;margin:auto;padding:22px;background:#0b0d11;color:#fff;border:2px solid #bc293b;border-radius:12px;overflow:auto}.plan-scan-dialog::backdrop{background:#000d}.scan-dialog-top{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.scan-dialog-top h2{margin:0;font-size:23px}.scan-dialog-top p{margin:6px 0;font-size:16px}#scan-message{font-size:16px;min-height:25px}.scan-work-area{padding:24px;display:flex;justify-content:center;min-height:100px}.scan-corner-stage{position:relative;margin:auto}.scan-corner-stage>img{display:block;width:100%;height:auto;user-select:none;-webkit-user-select:none;pointer-events:none}.scan-corner-stage svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.scan-corner-stage [data-scan-corner]{position:absolute;transform:translate(-50%,-50%);width:44px;height:44px;border-radius:50%;padding:0;font-size:18px;font-weight:800;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}.scan-dialog-actions{display:flex;gap:12px;flex-wrap:wrap;margin:15px 0}.scan-preview img{display:block;max-width:100%;max-height:63dvh;object-fit:contain;background:white}.scan-preview[hidden],.scan-corner-stage[hidden],.scan-dialog-actions button[hidden]{display:none!important}
@media(max-width:700px){.plan-scan-dialog{padding:16px 12px;border-radius:0;width:100vw}.scan-dialog-top h2{font-size:20px}.scan-dialog-top p,#scan-message{font-size:14px}.scan-work-area{padding:24px}.scan-dialog-actions{gap:8px}.scan-dialog-actions button{flex:1;min-width:120px}.scan-dialog-top .secondary{white-space:nowrap;font-size:14px}}

/* Keep existing scan steps; only the photo area scrolls, never the actions. */
.plan-scan-dialog{padding:0;height:min(900px,100vh);height:min(900px,100dvh);overflow:hidden}.plan-scan-dialog[open]{display:flex;flex-direction:column}.scan-dialog-top{flex:none;padding:18px 22px;border-bottom:1px solid #86353c}.scan-scroll-area{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 22px 14px}.plan-scan-dialog .scan-dialog-actions{flex:none;display:flex;flex-wrap:wrap;margin:0;padding:14px 22px;padding-bottom:max(14px,env(safe-area-inset-bottom));background:#0b0d11;border-top:2px solid #bc293b;box-shadow:0 -6px 18px #0009;z-index:1}.scan-dialog-actions .primary{min-height:50px;font-weight:800}.scan-dialog-actions .secondary{min-height:48px}
@media(max-width:700px){.plan-scan-dialog{height:100vh;height:100dvh;max-height:100dvh;border:0;border-radius:0}.scan-dialog-top{padding:14px 12px}.scan-scroll-area{padding:0 12px 10px}.plan-scan-dialog .scan-dialog-actions{padding:10px 12px;padding-bottom:max(10px,env(safe-area-inset-bottom))}.scan-dialog-actions button{min-width:0;flex:1}.scan-dialog-actions .primary{flex:1.2}.scan-dialog-actions .secondary{font-size:13px}}
