/* Haisla Nation Housing Requests. Haisla Nation Design System: square corners, flat fills, no borders, Gotham with Montserrat as the web fallback. Light theme. */
@font-face{font-family:"Montserrat";font-weight:400;font-style:normal;font-display:swap;src:url(../fonts/montserrat-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"Montserrat";font-weight:600;font-style:normal;font-display:swap;src:url(../fonts/montserrat-latin-600-normal.woff2) format("woff2")}
@font-face{font-family:"Montserrat";font-weight:700;font-style:normal;font-display:swap;src:url(../fonts/montserrat-latin-700-normal.woff2) format("woff2")}
@font-face{font-family:"Montserrat";font-weight:800;font-style:normal;font-display:swap;src:url(../fonts/montserrat-latin-800-normal.woff2) format("woff2")}

:root{
  --bg:#f3f3f3; --surface:#ffffff; --surface-2:#ececed; --field:#ececed; --track:#dcdddf;
  --ink:#2c2e35; --heading:#000000; --muted:#5d5f64;
  --red:#e61e26; --accent:#c81a21; --accent-hover:#a6151b; --danger:#b8171e;
  --blue:#143980; --blue-hover:#102e68; --on:#ffffff;
  --warn-bg:#fdeecb; --warn-fg:#5e3f00;
  --s0-bg:#fdeecb; --s0-fg:#5e3f00; --s1-bg:#dcf0f2; --s1-fg:#0b5159; --s2-bg:#dde6f5; --s2-fg:#143980;
  --s3-bg:#e6e4f2; --s3-fg:#3d3a7a; --s4-bg:#f7e2d6; --s4-fg:#7d3410; --s5-bg:#dcebd2; --s5-fg:#2b5316;
  --s6-bg:#e3eef8; --s6-fg:#164e7a; --s7-bg:#1f5b44; --s7-fg:#ffffff;
  --core:"Gotham","Montserrat",Arial,Helvetica,sans-serif;
  --ease:cubic-bezier(.4,0,.2,1);
  color-scheme:light;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--core);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased}
h1,h2,h3{color:var(--heading);margin:0;line-height:1.15;text-wrap:balance;font-weight:700}
h1{font-size:28px}
h2{font-size:19px}
h3{font-size:16px}
p{margin:0}
a{color:var(--blue)}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.wrap{max-width:1240px;margin:0 auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.num{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
.small{font-size:13px}
.stack{display:flex;flex-direction:column;gap:16px}
.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.spacer{flex:1}
.inline{display:inline}
.sub{color:var(--muted);margin-top:4px}
.head{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;justify-content:space-between;margin-bottom:20px}
.hint{font-size:13px;color:var(--muted)}
.empty{color:var(--muted);font-size:14px}

/* Staff header */
.top{background:var(--surface)}
.top .wrap{display:flex;align-items:center;gap:20px;flex-wrap:wrap;padding-block:12px}
.lockup{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-decoration:none;color:var(--heading)}
.lockup img{width:125px;height:auto;display:block}
.lockup b{font-size:12px;font-weight:700;letter-spacing:.02em;color:var(--muted);padding-left:44px;line-height:1}
.nav{display:flex;gap:2px;flex-wrap:wrap}
.nav a{padding:9px 11px;font-weight:600;font-size:14px;color:var(--muted);text-decoration:none}
.nav a:hover{color:var(--heading)}
.nav a[aria-current="page"]{color:var(--heading);box-shadow:inset 0 -3px 0 var(--red)}
.navcount{display:inline-block;min-width:20px;padding:1px 6px;margin-left:6px;background:var(--red);color:var(--on);font-size:11px;font-weight:700;text-align:center}
.who{display:flex;align-items:center;gap:10px;font-size:13px;flex-wrap:wrap}
.who form{display:inline}
main{padding-block:24px 64px}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;cursor:pointer;padding:10px 18px;font-weight:600;font-size:15px;background:var(--accent);color:var(--on);text-decoration:none;transition:background-color 140ms var(--ease)}
.btn:hover{background:var(--accent-hover)}
.btn:active{transform:scale(.98)}
.btn.blue{background:var(--blue)}
.btn.blue:hover{background:var(--blue-hover)}
.btn.quiet{background:var(--surface-2);color:var(--ink)}
.btn.quiet:hover{background:var(--track)}
.btn.small{padding:7px 12px;font-size:13px}
.btn[disabled]{opacity:.45;cursor:not-allowed;transform:none}
.btns{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.linkbtn{border:0;background:none;padding:0;color:var(--blue);font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:3px;font-size:inherit}

/* Forms */
.form{display:grid;gap:16px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field>span,.lbl{font-weight:600;font-size:14px;color:var(--heading)}
.field>span em{font-style:normal;font-weight:400;color:var(--muted)}
.field>span.hint{font-weight:400;font-size:13px;color:var(--muted)}
input[type=text],input[type=email],input[type=tel],input[type=date],input[type=number],input[type=password],input:not([type]),select,textarea{width:100%;background:var(--field);border:0;padding:10px 12px;min-height:44px;border-radius:0}
.card input[type=text],.card input[type=email],.card input[type=tel],.card input[type=date],.card input[type=number],.card input[type=password],.card input:not([type]),.card select,.card textarea{background:var(--field)}
.on-grey input,.on-grey select,.on-grey textarea{background:var(--surface)!important}
textarea{min-height:110px;resize:vertical}
input[type=file]{font-size:14px;max-width:100%}
.row2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.row3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.choices{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.choice{position:relative}
.choice input{position:absolute;opacity:0;inset:0;cursor:pointer;margin:0}
.choice span{display:block;padding:11px 12px;background:var(--field);font-size:14px;font-weight:500;cursor:pointer;height:100%}
.choice input:checked+span{background:var(--blue);color:var(--on)}
.choice input:focus-visible+span{outline:2px solid var(--blue);outline-offset:2px}
.check{display:flex;gap:10px;align-items:flex-start;cursor:pointer}
.check input{width:18px;height:18px;margin:2px 0 0;accent-color:var(--blue);flex:none}
.field-error{color:var(--danger);font-size:13px;font-weight:600}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

/* Surfaces */
.card{background:var(--surface);padding:20px 22px;min-width:0}
.card.top-accent{box-shadow:inset 0 4px 0 var(--red)}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.flash{background:var(--surface);box-shadow:inset 0 4px 0 var(--blue);padding:14px 16px;margin-bottom:20px;font-weight:600}
.errors{background:var(--surface);box-shadow:inset 0 4px 0 var(--red);padding:14px 16px;margin-bottom:20px;color:var(--danger)}
.errors ul{margin:0;padding-left:18px}
.notice{background:var(--warn-bg);color:var(--warn-fg);padding:14px 16px;font-size:14px}
.notice.info{background:var(--s1-bg);color:var(--s1-fg)}
.samplebadge{display:inline-block;font-size:12px;font-weight:600;background:var(--warn-bg);color:var(--warn-fg);padding:3px 8px}

/* Case list */
.tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.tile{background:var(--surface);padding:16px 18px;display:flex;flex-direction:column;gap:2px;text-decoration:none;color:inherit;transition:background-color 140ms var(--ease)}
.tile:hover{background:var(--surface-2)}
.tile .n{font-size:32px;font-weight:800;color:var(--heading);font-variant-numeric:tabular-nums;line-height:1.1}
.tile .t{font-size:14px;font-weight:600;color:var(--heading)}
.tile .d{font-size:13px;color:var(--muted)}
.tile.alert .n{color:var(--danger)}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{background:var(--surface);padding:7px 12px;font-size:13px;font-weight:600;color:var(--ink);text-decoration:none}
.chip[aria-current="true"]{background:var(--ink);color:var(--surface)}
.chip .c{opacity:.65;margin-left:4px;font-variant-numeric:tabular-nums}
.table-wrap{overflow-x:auto;background:var(--surface)}
table.data{width:100%;border-collapse:collapse;font-size:14px;min-width:760px}
table.data th{text-align:left;font-weight:600;font-size:13px;color:var(--muted);padding:12px 14px;background:var(--surface-2)}
table.data td{padding:13px 14px;vertical-align:middle}
table.data tbody tr:nth-child(even){background:#f8f8f8}
table.data tbody tr.link{cursor:pointer}
table.data tbody tr.link:hover{background:var(--surface-2)}
table.data td.num,table.data th.num{text-align:right;font-variant-numeric:tabular-nums}
.ref{font-weight:700;color:var(--heading);text-decoration:none}
.pill{display:inline-block;padding:3px 9px;font-size:12px;font-weight:700;white-space:nowrap}
.st0{background:var(--s0-bg);color:var(--s0-fg)} .st1{background:var(--s1-bg);color:var(--s1-fg)} .st2{background:var(--s2-bg);color:var(--s2-fg)}
.st3{background:var(--s3-bg);color:var(--s3-fg)} .st4{background:var(--s4-bg);color:var(--s4-fg)} .st5{background:var(--s5-bg);color:var(--s5-fg)}
.st6{background:var(--s6-bg);color:var(--s6-fg)} .st7{background:var(--s7-bg);color:var(--s7-fg)}
.st-blue{background:var(--blue);color:var(--on)}
.prio{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600}
.prio::before{content:"";width:8px;height:8px;border-radius:999px;background:var(--track)}
.prio.urgent{color:var(--danger)}
.prio.urgent::before{background:var(--red)}
.unassigned{color:var(--danger);font-weight:600}
.pager{display:flex;gap:8px;justify-content:space-between;align-items:center;margin-top:16px;font-size:13px}
.pager a,.pager span.dis{background:var(--surface);padding:7px 12px;text-decoration:none;font-weight:600}
.pager span.dis{color:var(--muted)}

/* Case file */
.casehead{background:var(--surface);padding:20px 22px;display:flex;gap:16px 28px;flex-wrap:wrap;align-items:flex-start}
.casehead .main{flex:1 1 320px;min-width:0}
.casehead h1{font-size:24px;margin-top:6px}
.facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px 20px;flex:2 1 460px;align-items:end}
.facts .k{font-size:12px;color:var(--muted)}
.facts .v{font-weight:600;color:var(--heading);font-size:14px}
.facts select{min-height:36px;padding:6px 8px;font-size:14px;font-weight:600}
.stepper{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;margin-top:12px}
.stepper div{padding:10px 8px 9px;background:var(--surface);font-size:12px;font-weight:600;color:var(--muted);position:relative}
.stepper div::before{content:"";position:absolute;inset:0 0 auto;height:4px;background:var(--track)}
.stepper div.done{color:var(--ink)}
.stepper div.done::before{background:var(--s7-bg)}
.stepper div.now{color:var(--heading)}
.stepper div.now::before{background:var(--red)}
.stepper .n{display:block;font-size:11px;font-weight:500;opacity:.8}
.casegrid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;margin-top:16px;align-items:start}
.stagecard{background:var(--surface);padding:20px 22px;box-shadow:inset 0 4px 0 var(--red)}
.stagecard.complete{box-shadow:inset 0 4px 0 var(--s7-bg)}
.checklist{list-style:none;margin:14px 0 0;padding:0;display:flex;flex-direction:column;gap:2px}
.checklist li{background:var(--surface-2);padding:11px 12px}
.checklist form{margin:0}
.checklist .checkbtn{all:unset;display:flex;gap:10px;align-items:flex-start;cursor:pointer;width:100%}
.checklist .checkbtn[disabled]{cursor:not-allowed}
.checklist .box{width:18px;height:18px;flex:none;margin-top:2px;background:var(--surface);display:grid;place-items:center;box-shadow:inset 0 0 0 2px var(--muted)}
.checklist .on .box{background:var(--blue);box-shadow:none}
.checklist .on .box::after{content:"";width:10px;height:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg) translate(1px,-1px)}
.checklist .locked{opacity:.65}
.checklist .req{font-size:12px;color:var(--muted);margin:4px 0 0 28px;display:block}
.checkbtn:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.tabs{display:flex;gap:2px;overflow-x:auto;background:var(--surface-2);padding:4px}
.tabs a{padding:9px 14px;font-weight:600;font-size:14px;color:var(--muted);white-space:nowrap;text-decoration:none}
.tabs a[aria-current="page"]{background:var(--surface);color:var(--heading)}
.tabpanel{background:var(--surface);padding:20px 22px}
.dl{display:grid;grid-template-columns:170px minmax(0,1fr);gap:10px 16px;font-size:14px;margin:0}
.dl dt{color:var(--muted)}
.dl dd{margin:0;overflow-wrap:anywhere;white-space:pre-line}
.est{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:14px;background:var(--surface-2)}
.est+.est{margin-top:4px}
.est .amt{font-size:18px;font-weight:800;color:var(--heading);font-variant-numeric:tabular-nums}
.est.approved{background:var(--s5-bg);color:var(--s5-fg)}
.est.approved .amt{color:var(--s5-fg)}
.est.not_chosen{opacity:.6}
.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px}
.ph{aspect-ratio:4/3;max-width:100%;background:var(--surface-2);position:relative;display:flex;align-items:flex-end;overflow:hidden;text-decoration:none;color:var(--ink)}
.ph img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ph span{position:relative;z-index:1;background:var(--surface);font-size:12px;padding:5px 8px;font-weight:600;margin:6px;max-width:calc(100% - 12px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ph .tag{position:absolute;top:0;left:0;margin:6px}
.thread{display:flex;flex-direction:column;gap:10px}
.msg{max-width:85%;padding:12px 14px;background:var(--surface-2);white-space:pre-line;overflow-wrap:anywhere}
.msg.mine{align-self:flex-end;background:var(--blue);color:var(--on)}
.msg.internal{background:var(--warn-bg);color:var(--warn-fg)}
.msg .meta{font-size:12px;opacity:.85;margin-bottom:4px;white-space:normal}
.history{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px;font-size:14px}
.history li{display:grid;grid-template-columns:120px minmax(0,1fr);gap:12px}
.history .d{color:var(--muted);font-variant-numeric:tabular-nums;font-size:13px}
.history .hwho{font-weight:600;color:var(--heading)}
.side{display:flex;flex-direction:column;gap:16px}
.kv{display:flex;flex-direction:column;gap:12px;font-size:14px}
.kv .k{font-size:12px;color:var(--muted)}
.kv .v{color:var(--heading);font-weight:600}

/* Tasks */
.tasklist{display:flex;flex-direction:column;gap:2px}
.task{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:12px 14px;background:var(--surface-2)}
.task form{margin:0}
.task .tt{font-weight:600;color:var(--heading)}
.task.isdone .tt{text-decoration:line-through;color:var(--muted);font-weight:500}
.task .sub2{font-size:13px;color:var(--muted)}
.task select{min-height:34px;padding:5px 8px;font-size:13px;width:auto;background:var(--surface)}
.tickbtn{all:unset;cursor:pointer;width:20px;height:20px;background:var(--surface);box-shadow:inset 0 0 0 2px var(--muted);display:grid;place-items:center}
.tickbtn.on{background:var(--blue);box-shadow:none}
.tickbtn.on::after{content:"";width:10px;height:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg) translate(1px,-1px)}
.tickbtn:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.due{font-size:13px;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums}
.due.over{color:var(--danger)}
.addtask{display:grid;grid-template-columns:minmax(0,1fr) 190px 170px auto;gap:8px;align-items:end}

/* Units, rooms, inspections, contractors */
.split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:16px;align-items:start}
.list{display:flex;flex-direction:column;gap:2px}
.listrow{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:14px;align-items:center;padding:13px 16px;background:var(--surface);text-decoration:none;color:inherit}
.listrow:hover,.listrow[aria-current="true"]{background:var(--surface-2)}
.listrow b{color:var(--heading)}
.roomchips{display:flex;flex-wrap:wrap;gap:6px}
.roomchip{background:var(--surface-2);padding:6px 10px;font-size:13px;font-weight:600;color:var(--heading);display:inline-flex;gap:6px;align-items:center}
.roomchip .c{font-weight:500;color:var(--muted);font-variant-numeric:tabular-nums}
.roomrow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:6px 8px;background:var(--surface-2)}
.roomrow form{margin:0}
.roomcheck{display:grid;grid-template-columns:minmax(150px,200px) minmax(0,1fr);gap:8px 12px;align-items:center;padding:8px 10px;background:var(--surface-2)}
.roomcheck input[type=text]{min-height:38px;padding:7px 10px;background:var(--surface)}
.insprec{display:flex;flex-direction:column;gap:10px;padding:16px;background:var(--surface-2)}
.insprec .flag{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:10px 12px;background:var(--surface)}
.insprec form{margin:0}
.warn{color:var(--danger);font-weight:600}

/* Reports */
.bars{display:flex;flex-direction:column;gap:10px}
.bar{display:grid;grid-template-columns:170px minmax(0,1fr) 92px;gap:12px;align-items:center;font-size:14px}
.bar .track{height:14px;background:var(--surface-2)}
.bar .fill{display:block;height:100%;background:var(--blue)}
.bar .fill.slow{background:var(--red)}
.bar .val{text-align:right;font-weight:700;font-variant-numeric:tabular-nums;color:var(--heading)}
.stat{background:var(--surface);padding:16px 18px}
.stat b{display:block;font-size:30px;line-height:1.1;color:var(--heading);font-variant-numeric:tabular-nums}
.stat span{color:var(--muted);font-size:13px}

/* Sign in pages */
.auth{min-height:100vh;display:grid;place-items:center;padding-block:40px}
.auth .card{width:100%;max-width:440px;box-shadow:inset 0 4px 0 var(--red)}
.auth .logo{display:block;width:170px;margin:0 0 22px}
.codes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:15px;background:var(--surface-2);padding:16px;margin:12px 0}
.qr{background:var(--surface);display:inline-block;padding:8px}
.qr svg{display:block;width:200px;height:200px}
.secret{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:14px;background:var(--surface-2);padding:8px 10px;display:inline-block;letter-spacing:.05em;word-break:break-all}

/* Member side */
.m-wrap{max-width:680px;margin:0 auto;padding-block:20px 56px}
.m-head{display:flex;align-items:center;gap:12px;padding-block:8px 20px;justify-content:space-between}
.m-head a{display:block}
.m-head img{width:140px;height:auto;display:block}
.m-head .title{font-weight:700;font-size:14px;color:var(--heading)}
.panel{background:var(--surface);padding:24px}
.hero{background:var(--blue);color:var(--on);padding:28px 24px 26px;position:relative;overflow:hidden}
.hero h1{color:var(--on);font-size:30px;max-width:16ch}
.hero p{margin-top:10px;max-width:46ch;opacity:.92}
.hero .waves{position:absolute;right:-60px;bottom:-30px;width:340px;opacity:.2;pointer-events:none}
.bigchoice{display:grid;gap:12px}
.bigchoice a{display:flex;flex-direction:column;gap:4px;background:var(--surface);padding:20px 22px;text-decoration:none;color:inherit;transition:background-color 140ms var(--ease)}
.bigchoice a:hover{background:var(--surface-2)}
.bigchoice b{font-size:18px;color:var(--heading)}
.bigchoice .go{color:var(--accent);font-weight:700;font-size:14px;margin-top:6px}
.formsec{display:flex;flex-direction:column;gap:18px}
.formsec+.formsec{margin-top:30px}
.refbox{background:var(--surface-2);padding:18px 20px;display:grid;grid-template-columns:1fr 1fr;gap:16px}
.refbox .k{font-size:13px;color:var(--muted)}
.refbox .v{font-size:26px;font-weight:800;color:var(--heading);letter-spacing:.04em}
.ptimeline{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.ptimeline li{display:grid;grid-template-columns:28px 1fr;gap:12px;padding-bottom:18px;position:relative}
.ptimeline li::before{content:"";position:absolute;left:13px;top:24px;bottom:0;width:2px;background:var(--track)}
.ptimeline li:last-child::before{display:none}
.ptimeline .dot{width:28px;height:28px;border-radius:999px;background:var(--track);display:grid;place-items:center;color:var(--muted);font-size:13px;font-weight:700}
.ptimeline li.done .dot{background:var(--s7-bg);color:var(--s7-fg)}
.ptimeline li.done::before{background:var(--s7-bg)}
.ptimeline li.now .dot{background:var(--red);color:var(--on)}
.ptimeline b{display:block;color:var(--heading)}
.m-foot{position:relative;margin-top:72px;height:56px;background:var(--red)}
.m-foot .circle{position:absolute;left:50%;top:0;transform:translate(-50%,-50%);width:80px;height:80px;border-radius:999px;background:var(--surface);display:grid;place-items:center}
.m-foot img{width:70px;height:70px;display:block}
.m-foot-text{background:var(--red);color:var(--on);text-align:center;font-size:13px;padding:0 16px 20px}

/* Contractor brief (screen and print) */
.briefwrap{display:grid;grid-template-columns:300px minmax(0,1fr);gap:16px;align-items:start}
.sheet{background:#fff;color:#2c2e35;max-width:816px;width:100%;min-height:1056px;box-shadow:0 12px 40px rgba(0,0,0,.18);display:flex;flex-direction:column}
.sheet .body{padding:48px 56px 24px;display:flex;flex-direction:column;gap:22px;flex:1}
.sheet h3{color:#000;font-size:16px;margin-bottom:8px}
.sheet-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}
.sheet-head img{width:150px;height:auto}
.sheet-head .meta{font-size:13px;color:#5d5f64;text-align:right}
.sheet-head .meta b{color:#000}
.sheet-title{font-size:28px;font-weight:800;color:#000;line-height:1.1}
.sheet p{font-size:14px;line-height:1.55}
.sheet .sgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 20px}
.sheet .sgrid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.sheet .sgrid.four{grid-template-columns:2fr 1fr 1.3fr .7fr}
.sheet .notes{margin:8px 0 0;padding-left:18px;font-size:14px;line-height:1.55}
.sheet .k{font-size:12px;color:#5d5f64}
.sheet .v{font-size:14px;font-weight:600;color:#000}
.sheet .photos{grid-template-columns:repeat(3,minmax(0,1fr))}
.sheet .ph{background:#f3f3f3}
.sheet .callout{background:#f3f3f3;padding:16px 18px}
.sheet-foot{position:relative;height:56px;background:var(--red);margin-top:64px;flex:none}
.sheet-foot .circle{position:absolute;left:50%;top:0;transform:translate(-50%,-50%);width:96px;height:96px;border-radius:999px;background:#fff;display:grid;place-items:center}
.sheet-foot img{width:86px;height:86px;display:block}
.prewrap{white-space:pre-line}
@media print{
  @page{size:letter;margin:0}
  body{background:#fff}
  .noprint,.top,.flash,.errors{display:none!important}
  main{padding:0}
  .wrap{max-width:none;padding:0}
  .briefwrap{display:block}
  .sheet{box-shadow:none;max-width:none;min-height:100vh}
  .sheet-foot,.sheet-foot .circle{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

@media (max-width:980px){
  .casegrid,.split,.briefwrap{grid-template-columns:minmax(0,1fr)}
  .tiles,.g4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g3{grid-template-columns:minmax(0,1fr)}
  .stepper{grid-template-columns:repeat(4,minmax(0,1fr))}
  .g2{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:620px){
  h1{font-size:24px}
  .hero h1{font-size:25px}
  input,select,textarea{font-size:16px!important}
  .panel,.card,.tabpanel,.stagecard,.casehead{padding:18px 16px}
  .row2,.row3,.refbox{grid-template-columns:1fr}
  .dl{grid-template-columns:1fr;gap:2px 0}
  .dl dd{margin-bottom:10px}
  .stepper{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bar{grid-template-columns:100px minmax(0,1fr) 80px}
  .est{grid-template-columns:minmax(0,1fr) auto}
  .est .act{grid-column:1/-1}
  .history li{grid-template-columns:1fr;gap:0}
  .addtask{grid-template-columns:1fr}
  .task{grid-template-columns:auto minmax(0,1fr)}
  .task>.c3,.task>.due{grid-column:2}
  .roomcheck{grid-template-columns:1fr}
  .sheet{min-height:0}
  .sheet .body{padding:28px 20px 16px}
  .sheet .sgrid,.sheet .sgrid.three,.sheet .sgrid.four,.sheet .photos{grid-template-columns:1fr 1fr}
  .lockup img{width:104px}
}

/* Header dropdowns */
.top .wrap{flex-wrap:nowrap}
.nav{align-items:center;flex-wrap:nowrap}
.menu{position:relative}
.menu summary{list-style:none;cursor:pointer;padding:9px 11px;font-weight:600;font-size:14px;color:var(--muted);display:flex;align-items:center;gap:6px;white-space:nowrap;user-select:none}
.menu summary::-webkit-details-marker{display:none}
.menu summary:hover,.menu[open] summary{color:var(--heading)}
.menu summary[aria-current="page"]{color:var(--heading);box-shadow:inset 0 -3px 0 var(--red)}
.menu .caret{width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-2px)}
.menu[open] .caret{transform:rotate(-135deg) translateY(-1px)}
.menu-list{position:absolute;top:calc(100% + 6px);left:0;min-width:200px;background:var(--surface);box-shadow:0 12px 40px rgba(0,0,0,.18);padding:6px;display:flex;flex-direction:column;z-index:30}
.menu.right .menu-list{left:auto;right:0}
.menu-list a,.menu-list button{display:block;text-align:left;width:100%;padding:10px 12px;font-weight:600;font-size:14px;color:var(--ink);text-decoration:none;background:none;border:0;cursor:pointer;font-family:inherit}
.menu-list a:hover,.menu-list button:hover{background:var(--surface-2)}
.menu-list a[aria-current="page"]{box-shadow:inset 3px 0 0 var(--red);background:var(--surface-2)}
.menu-list form{margin:0}
.menu-note{display:block;padding:8px 12px 10px;font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.nav a{white-space:nowrap}
@media (max-width:980px){
  .top .wrap{flex-wrap:wrap;row-gap:4px}
  .nav{order:5;width:100%;flex-wrap:wrap;margin-left:-11px}
  /* On small screens an open group expands in place under the menu instead of floating */
  .nav .menu[open]{flex-basis:100%}
  .nav .menu-list{position:static;box-shadow:none;background:var(--surface-2);min-width:0;margin:0 0 8px 11px}
  .menu.right .menu-list{max-width:calc(100vw - 32px)}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* Fleet: vehicle status, QR card */
.st-red{background:var(--red);color:var(--on)}
.st-grey{background:var(--surface-2);color:var(--muted)}
.qrcard{display:flex;flex-direction:column;align-items:center;gap:10px}
.qrcard img{width:220px;height:auto;display:block;background:#fff}
.qrcard form{margin:0;text-align:center}

/* Driver pages (opened from the QR code) */
body.driver{background:var(--surface)}
.d-bar{height:64px;background:var(--blue);color:var(--on);display:flex;align-items:center;justify-content:space-between;padding:0 max(20px,env(safe-area-inset-left,0px));font-weight:700;font-size:17px}
.d-unit{font-size:14px;font-weight:600}
.d-main{max-width:520px;margin:0 auto;padding:24px 20px 48px;display:flex;flex-direction:column;gap:20px}
.d-head{display:flex;flex-direction:column;gap:6px}
.d-head h1{font-size:34px}
.d-tiles{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.d-tiles .tile{background:var(--bg)}
.d-tiles .t{font-size:19px;font-weight:700}
.d-stop{background:var(--red);color:var(--on);margin:-24px -20px 0;padding:40px 24px;display:flex;flex-direction:column;gap:16px;min-height:calc(100vh - 64px)}
.d-stop h1{color:var(--on);font-size:34px}
.d-stop p{font-size:17px;line-height:1.45}
.d-btn{display:flex;align-items:center;justify-content:center;min-height:56px;padding:0 16px;font-size:17px;font-weight:700;text-decoration:none;background:var(--red);color:var(--on)}
.d-btn .d-sub{font-size:15px;font-weight:600;white-space:nowrap}
.d-btn.light{flex-direction:column;padding:12px 16px;background:var(--surface);color:var(--accent-hover);margin-top:auto}

/* Driver flow */
.d-main form{display:flex;flex-direction:column;gap:20px}
.d-field{display:flex;flex-direction:column;gap:8px}
.d-field>span,.d-label{font-size:14px;font-weight:600;color:var(--heading)}
.d-field .hint{font-size:13px}
.driver input[type=text],.driver input[type=number],.driver input[type=time],.driver textarea,.driver select{background:var(--bg);min-height:52px;font-size:17px}
.driver textarea{min-height:96px}
.d-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.d-seg{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.d-seg.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.d-seg.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.d-seg label{position:relative}
.d-seg input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.d-seg span{display:flex;align-items:center;justify-content:center;text-align:center;min-height:48px;padding:6px 8px;background:var(--bg);font-weight:600;font-size:15px;cursor:pointer}
.d-seg input:checked+span{background:var(--blue);color:var(--on)}
.d-seg input:focus-visible+span{outline:2px solid var(--blue);outline-offset:2px}
.d-choice{display:flex;flex-direction:column;gap:10px}
.d-choice label{position:relative;display:block}
.d-choice input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.d-choice .c{display:flex;flex-direction:column;gap:4px;padding:16px;background:var(--bg);cursor:pointer}
.d-choice .c b{font-size:17px;color:var(--heading)}
.d-choice .c span{font-size:14px}
.d-choice input:checked+.c.minor{background:var(--warn-bg)}
.d-choice input:checked+.c.minor b{color:var(--warn-fg)}
.d-choice input:checked+.c.major{background:var(--red);color:var(--on)}
.d-choice input:checked+.c.major b{color:var(--on)}
.d-choice input:focus-visible+.c{outline:2px solid var(--blue);outline-offset:2px}
.d-check{display:flex;gap:12px;align-items:flex-start;background:var(--bg);padding:14px;font-size:15px;line-height:1.4;cursor:pointer}
.d-check input{width:22px;height:22px;margin:0;flex:none;accent-color:var(--blue)}
.d-actions{display:flex;flex-direction:column;gap:12px;margin-top:4px}
.d-btn.blue{background:var(--blue)}
.d-btn.quiet{background:var(--surface-2);color:var(--ink)}
.d-btn.problem{background:var(--surface-2);color:var(--accent-hover)}
button.d-btn{border:0;width:100%;font-family:inherit;cursor:pointer}
.d-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.d-pair .d-btn{min-height:64px}
.d-progress{height:6px;background:var(--surface-2);margin:-24px -20px 0}
.d-progress i{display:block;height:100%;background:var(--red)}
.d-step{font-size:14px;color:var(--muted);font-weight:600}
.d-item h1{font-size:30px}
.d-item p{font-size:17px;line-height:1.45}
.d-ref{width:100%;height:auto;display:block;background:var(--bg)}
.d-note{background:var(--bg);padding:12px 14px;font-size:14px;line-height:1.4}
.d-list{display:flex;flex-direction:column;gap:8px;font-size:14px;margin:0;padding:0;list-style:none}
.d-list li{display:flex;gap:10px;align-items:center}
.d-list .ok{color:var(--blue);font-weight:700}
.d-list .bad{color:var(--accent-hover);font-weight:700}
.d-list .todo{color:var(--muted)}
.d-card{background:var(--bg);padding:14px;display:flex;gap:12px;align-items:flex-start}
.d-card .t{font-size:15px;font-weight:600;color:var(--heading)}
.d-card .s{font-size:13px;color:var(--muted)}
.tag-minor{background:var(--warn-bg);color:var(--warn-fg);font-size:12px;font-weight:700;padding:4px 8px;flex:none}
.tag-major{background:var(--red);color:var(--on);font-size:12px;font-weight:700;padding:4px 8px;flex:none}
.tag-damage{background:var(--surface-2);color:var(--ink);font-size:12px;font-weight:700;padding:4px 8px;flex:none}
.d-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.d-counts div{padding:14px 12px;display:flex;flex-direction:column;gap:2px;background:var(--bg)}
.d-counts b{font-size:26px;line-height:1.1;color:var(--heading)}
.d-counts .good{background:var(--blue);color:var(--on)}.d-counts .good b{color:var(--on)}
.d-counts .warn{background:var(--warn-bg);color:var(--warn-fg)}.d-counts .warn b{color:var(--warn-fg)}
.d-kv{display:flex;flex-direction:column;gap:8px;font-size:15px}
.d-kv div{display:flex;justify-content:space-between;gap:12px}
.d-kv span{color:var(--muted)}
.d-kv b{color:var(--heading);text-align:right}
.d-van{position:relative;background:var(--bg);aspect-ratio:3/4;max-height:420px;margin:0 auto;width:100%}
.d-van svg{position:absolute;inset:0;width:100%;height:100%}
.d-zone{position:absolute;transform:translate(-50%,-50%);min-width:44px;min-height:44px;padding:6px 10px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:600;text-decoration:none;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.2;max-width:34%}
.d-zone.has{background:var(--muted);color:var(--on)}
.d-zone.new{background:var(--red);color:var(--on)}
.d-zone[aria-current="true"]{outline:3px solid var(--blue)}
.d-file input[type=file]{font-size:15px;padding:12px;background:var(--bg);width:100%}
.d-main .errors,.d-main .flash{margin:0}
.d-done{display:flex;flex-direction:column;gap:16px}
.d-done .big{width:72px;height:72px;background:var(--blue);color:var(--on);display:grid;place-items:center}
.visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.d-back{width:44px;height:44px;margin-left:-12px;display:flex;align-items:center;justify-content:center;color:var(--on)}
.d-title{flex:1}
.d-bar{gap:4px}
[hidden]{display:none!important}
.d-field>span.hint{font-weight:400;color:var(--muted);font-size:13px}

/* Phase 3: damage map on the vehicle page */
.damagemap{display:grid;grid-template-columns:200px minmax(0,1fr);gap:16px;align-items:start}
.damagemap .d-van{max-height:270px;background:var(--surface-2)}
.damagemap .d-zone{min-width:28px;min-height:28px;padding:2px 6px;font-size:13px}
@media (max-width:640px){.damagemap{grid-template-columns:1fr}.damagemap .d-van{max-width:200px}}
