/* AULER Site. Fonts are the ones on aulerai.com; colors are the brand guide's black and greys on a light page. What differs from the guide, and why, is in DESIGN.md.
   Logical properties throughout, so the same rules serve English (LTR) and Persian (RTL). */
@font-face{font-family:Archivo;src:url(fonts/archivo-wordmark.woff2) format("woff2");font-weight:100 900;font-stretch:62% 125%;font-display:swap}
/* Anybody draws + = × − at half size, so both text fonts leave those four signs to the next font in line */
@font-face{font-family:Anybody;src:url(fonts/anybody-latin-wdth.woff2) format("woff2");font-weight:100 900;font-stretch:50% 150%;font-display:swap;unicode-range:U+0-2A,U+2C-3C,U+3E-D6,U+D8-2211,U+2213-10FFFF}
@font-face{font-family:Lahzeh;src:url(fonts/lahzeh-400.woff2) format("woff2");font-weight:400;font-display:swap;unicode-range:U+0-2A,U+2C-3C,U+3E-D6,U+D8-2211,U+2213-10FFFF}
@font-face{font-family:Lahzeh;src:url(fonts/lahzeh-600.woff2) format("woff2");font-weight:600;font-display:swap;unicode-range:U+0-2A,U+2C-3C,U+3E-D6,U+D8-2211,U+2213-10FFFF}
@font-face{font-family:Lahzeh;src:url(fonts/lahzeh-800.woff2) format("woff2");font-weight:800;font-display:swap;unicode-range:U+0-2A,U+2C-3C,U+3E-D6,U+D8-2211,U+2213-10FFFF}
@font-face{font-family:"IBM Plex Mono";src:url(fonts/plex-mono-400.woff2) format("woff2");font-weight:400;font-display:swap}

:root{
  /* light theme: names keep their roles (ink = page, graphite = card, paper = text and primary) */
  --ink:#F4F4F5;--graphite:#FFFFFF;--raised:#EEEEF0;--line:#E4E4E7;--line-2:#D4D4D8;--steel:#5F5F67;--paper:#0B0B0F;--white:#26262E;
  --warn:#A3431F;--warn-bg:#FBEDE7;--ok:#2F6B4F;--ok-bg:#E6F2EB;
  /* the middle grey of charts: at least 3:1 against both the empty track and the black part */
  --chart:#7E7E86;
  --f-text:Anybody,Lahzeh,"Helvetica Neue",Arial,sans-serif;
  --f-brand:Archivo,"Helvetica Neue",Arial,sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,Menlo,monospace;
  --stretch:112%;--track:.12em;--lh:1.55;
  --gutter:clamp(16px,3.5vw,40px);--radius:16px;--r-ctl:12px;
  --main-pt:26px;--dock-h:64px;
  color-scheme:light;
}
/* Lahzeh's equal-width digits are spread far apart, so Persian numbers keep their natural width */
html[lang=fa] *{font-variant-numeric:normal!important}
/* Persian: Lahzeh, no letter-spacing (it breaks the joins), taller lines */
html[lang=fa]{--f-text:Lahzeh,Anybody,Tahoma,sans-serif;--f-mono:Lahzeh,"IBM Plex Mono",monospace;--stretch:100%;--track:0;--lh:1.85}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--ink);color:var(--paper);font:400 15.5px/var(--lh) var(--f-text);font-stretch:100%;-webkit-font-smoothing:antialiased;overflow-x:clip}
::selection{background:var(--line-2);color:var(--paper)}
:focus-visible{outline:2px solid var(--paper);outline-offset:2px}
:is(a[href],button:enabled,.btn,summary,select):active{opacity:.7}
select,label:has(>input:is([type=checkbox],[type=radio])),input:is([type=checkbox],[type=radio]){cursor:pointer}
:disabled:disabled{cursor:not-allowed}
:disabled[aria-busy=true]{cursor:progress}
a{color:inherit}
strong{font-weight:600}
h1,h2,h3,p{margin:0}
h1{font-weight:800;font-size:clamp(24px,3vw,30px);line-height:1.1;font-stretch:var(--stretch);letter-spacing:-.01em;overflow-wrap:anywhere}
html[lang=fa] h1{letter-spacing:0;line-height:1.35}
[hidden]{display:none!important}
/* a slow connection shows something is happening; a fast one never sees it */
body.loading::before{content:"";position:fixed;inset:0 0 auto;height:3px;z-index:40;background:linear-gradient(90deg,transparent,var(--paper),transparent);opacity:0;animation:slide 1.1s .35s linear infinite}
@keyframes slide{0%{opacity:1;transform:translateX(-100%)}100%{opacity:1;transform:translateX(100%)}}
@media (prefers-reduced-motion:reduce){body.loading::before{animation:none;opacity:1;background:var(--paper)}}
.skip{position:absolute;inset-inline-start:-999px}
.skip:focus{inset-inline-start:16px;top:12px;z-index:20;background:var(--paper);color:#fff;padding:8px 12px}

.eyebrow,th,.badge,.pill{font:600 12.5px/1.4 var(--f-text);color:var(--steel)}
/* labels people read while filling a form: plain text, not tracked capitals */
.field-label,.kpi-label{font:600 13px/1.4 var(--f-text);color:var(--steel)}
.eyebrow a{text-decoration:none}
.eyebrow a:hover{color:var(--paper)}
.muted{color:var(--steel)}
.small{font-size:13px}
.hint{display:block;font-size:12.5px;color:var(--steel);margin-top:5px;line-height:1.5}
.center{text-align:center}
.grow{flex:1 1 auto;min-width:0}
.strong{font-weight:600}
/* a second, quieter line under a name */
.line{display:block;font-weight:400}
.narrow{max-width:820px}
/* a sign that stands alone on a button: system font, a little larger */
.sym,details.settings>summary::after{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:1.15em;line-height:1}

/* --- top bar --- */
.bar{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;min-height:60px;padding:8px var(--gutter);background:rgba(255,255,255,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none}
.mark{font:700 19px/1 var(--f-brand);font-stretch:125%;letter-spacing:.2em;direction:ltr}
.product{font:400 12px var(--f-mono);letter-spacing:.14em;text-transform:uppercase;color:var(--steel);padding-inline-start:10px;border-inline-start:1px solid var(--line-2)}
#nav{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#nav>a{padding:8px 10px;text-decoration:none;color:var(--steel);font-size:14px}
#nav>a:hover{color:var(--paper)}
.nav-account{display:inline-flex;align-items:center;gap:6px}
.nav-account .icon{display:none}
.banner{padding:10px var(--gutter);background:var(--warn-bg);color:var(--warn);border-bottom:1px solid var(--line);font-size:14px;text-align:center}

main{max-width:1320px;margin:0 auto;padding:var(--main-pt) var(--gutter) 90px}
main,.proj-main{outline:none}
#foot{display:flex;flex-wrap:wrap;justify-content:center;gap:0 20px;padding:0 var(--gutter) 20px;font-size:13.5px;color:var(--steel)}
#foot a{display:inline-flex;align-items:center;min-height:44px}
#foot a:hover{color:var(--paper)}
.legal{max-width:720px;margin:0 auto}
.legal h2{font-size:17px;margin:26px 0 8px}
.legal ul{margin:0;padding-inline-start:20px;display:flex;flex-direction:column;gap:8px}
.legal .notice{margin:14px 0 0}
.page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.page-head .eyebrow{margin-bottom:6px}

/* --- project: grouped tool sidebar on desktop; app bar + bottom bar on phones and tablets (below) --- */
.proj{display:grid;grid-template-columns:204px minmax(0,1fr);gap:clamp(20px,3vw,40px);align-items:start}
.side{position:sticky;top:84px;display:flex;flex-direction:column;max-height:calc(100vh - 100px);overflow-y:auto;padding-bottom:12px}
/* the group names are for screen readers; people see the space between the groups */
.side h2,.tool-grid h2{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%)}
.side section{position:relative}
.side section+section{margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
.side .tool-list{display:flex;flex-direction:column;gap:2px}
.side a{display:flex;align-items:center;gap:12px;min-height:42px;padding:6px 12px;border-radius:12px;text-decoration:none;color:var(--white);font-size:14.5px;line-height:1.3}
.side a:hover{background:var(--raised)}
.side a.on{background:var(--line);color:var(--paper);font-weight:600}
.side .icon{flex:none;width:20px;height:20px;color:var(--steel)}
.side a.on .icon{color:var(--paper)}
.proj-head{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.proj-title{flex:1 1 auto;min-width:0}
/* a long name with no spaces breaks instead of pushing the screen wider; table columns keep their width */
body{overflow-wrap:break-word}
:is([dir=auto],bdi):not(table *){overflow-wrap:anywhere}
/* names are dir=auto (Persian or English); keep them aligned with the page, not with their own script */
.proj-title>*,.project-card>*{text-align:left}
html[dir=rtl] :is(.proj-title,.project-card)>*{text-align:right}
.proj-title h1{font-size:clamp(24px,2.4vw,28px)}
.proj-title p{font-size:13.5px}
.round{flex:none;display:inline-grid;place-items:center;width:42px;height:42px;border-radius:999px;border:1px solid var(--line-2);background:var(--graphite);color:var(--paper);text-decoration:none}
.round:hover{border-color:var(--steel)}
html[dir=rtl] a.round[href="#/"] .icon{transform:scaleX(-1)}
.phone-only{display:none!important}

/* --- layout --- */
.stack{display:flex;flex-direction:column;gap:16px;min-width:0}
.split{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:16px;align-items:start}
.two-col{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:16px;align-items:start;margin-top:16px}
.sticky{position:sticky;top:84px}
@media (max-width:980px){.split,.two-col{grid-template-columns:1fr}.sticky{position:static}}
.split.map-first{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
@media (max-width:980px){.split.map-first{grid-template-columns:minmax(0,1fr)}}
/* the screen's parts on one side, what people do there on the other */
.tools{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;align-items:center}
.tools>.segmented{margin-inline-end:auto}
.narrow>.segmented{margin-bottom:16px}
/* the calculators: plain tabs, so they don't read as one more switch of the screen below */
.tabs{display:flex;gap:22px;margin-bottom:16px;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none}
.tabs a{flex:none;display:inline-flex;align-items:center;min-height:44px;border-bottom:2px solid transparent;color:var(--steel);font-size:14.5px;text-decoration:none;white-space:nowrap}
.tabs a:hover{color:var(--paper)}
.tabs a.on{color:var(--paper);font-weight:600;border-color:var(--paper)}
.part.off{display:none}
/* the roof table needs room for the material names */
.split:has(.part:not(.off) .roof){grid-template-columns:minmax(0,1.9fr) minmax(0,1fr)}
.roof td.cover{width:100%}
.roof td.num input{width:120px}
@media (max-width:1279px){.split:has(.part:not(.off) .roof){grid-template-columns:minmax(0,1fr)}.split:has(.part:not(.off) .roof)>.sticky{position:static}}
.card{background:var(--graphite);border:1px solid var(--line);border-radius:var(--radius);padding:clamp(16px,2.4vw,22px);min-width:0}
.card-title{font-size:16px;font-weight:600;margin-bottom:12px}
.sub{font-size:14px;font-weight:600;margin:20px 0 10px}
.tab-body>*+*{margin-top:16px}

/* --- key numbers: one strip, not a row of boxes --- */
.kpis{display:flex;flex-wrap:wrap;gap:1px;background:var(--line);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.kpi{flex:1 1 160px;display:flex;flex-direction:column;gap:2px;background:var(--graphite);padding:16px 20px;min-width:0}
.kpi strong{font-size:clamp(19px,2.2vw,24px);font-weight:800;line-height:1.3;font-stretch:var(--stretch);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
html[dir=rtl] .kpi strong{text-align:right}
.kpi.hot strong{color:var(--warn)}
.kpi-sub{font-size:12.5px;color:var(--steel);line-height:1.5}
.card .kpis{gap:14px 24px;background:none;border:0;border-radius:0}
.card .kpi{flex-basis:120px;padding:0}
.card .kpi strong{font-size:19px}

/* --- forms --- */
.task-list+.field,.card>.field:first-child:has(+.task-list){margin-bottom:14px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
input,textarea,select{width:100%;font:inherit;font-size:15px;color:var(--paper);background:var(--graphite);border:1px solid var(--line-2);border-radius:var(--r-ctl);padding:10px 12px;min-height:46px}
textarea{resize:vertical;line-height:1.6}
select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--steel) 50%),linear-gradient(135deg,var(--steel) 50%,transparent 50%);background-position:calc(100% - 18px) 50%,calc(100% - 13px) 50%;background-size:5px 5px;background-repeat:no-repeat;padding-inline-end:34px}
[dir=rtl] select{background-position:13px 50%,18px 50%}
/* checkboxes and radios keep the page's own focus outline */
:is(input:not([type=checkbox],[type=radio]),textarea,select):focus{border-color:var(--paper);outline:none;box-shadow:0 0 0 1px var(--paper)}
/* an empty dir=auto field counts as left-to-right */
html[dir=rtl] :is(input,textarea):not([dir=ltr]):placeholder-shown{direction:rtl}
input:disabled{opacity:.6}
input.num{font-variant-numeric:tabular-nums;font-family:var(--f-mono)}
html[lang=fa] input.num{font-family:inherit}
input:is([type=checkbox],[type=radio]){width:20px;height:20px;min-height:0;padding:0;accent-color:var(--paper);flex:none}
input[type=file]{border-style:dashed;padding:9px;font-size:14px}
input[type=date]{direction:ltr}
.date-wrap{display:flex;flex-direction:column}
/* Jalali date: day, month, year */
.jdate{display:grid;grid-template-columns:minmax(3.4em,.7fr) minmax(5.6em,1.3fr) minmax(4.2em,.9fr);gap:6px}
.jdate select{padding-inline:8px;background-image:none;text-align:center}
.file-pick{position:relative;overflow:hidden;flex:1 1 220px;min-width:0;border-style:dashed}
/* a field stacks its parts, so the 220px above would be a height */
.field>.file-pick{flex:none}
.file-pick span{overflow:hidden;text-overflow:ellipsis}
.file-pick input{position:absolute;inset:0;opacity:0;min-height:0;cursor:pointer;font-size:0}
.file-pick:focus-within{outline:2px solid var(--paper);outline-offset:2px}
.more-row{margin-top:18px}
.grid-form{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px;align-items:end}
.grid-form>button,.grid-form>.row-actions{justify-self:start}
.sheet .grid-form{grid-template-columns:1fr 1fr}
.sheet .grid-form>:is(button,.row-actions){grid-column:1/-1;justify-self:stretch}
.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px}
.grid-3{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-top:14px}
.grid-5{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}
.inline-form{display:flex;gap:10px;flex-wrap:wrap;align-items:end}
.inline-form>*{flex:1 1 200px}
.inline-form>button{flex:0 0 auto}
.check{display:flex;align-items:center;gap:8px;min-height:44px}
/* 44px to tap, 24px of room in the row */
.tap{display:grid;place-items:center;flex:none;width:44px;height:44px;margin:-12px -10px}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.row>input{flex:1 1 220px}
.row-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}
.add-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
table+.add-row,.table-wrap+.add-row{margin-top:14px}
details.settings>summary,details>summary{cursor:pointer;list-style:none}
details>summary::-webkit-details-marker{display:none}
details.settings>summary{font-weight:600;display:flex;justify-content:space-between;align-items:center;gap:14px}
details.settings>summary::after{content:"+";color:var(--steel)}
details.settings[open]>summary::after{content:"–"}
details.settings>summary+*{margin-top:14px}
/* a fold inside a card: quieter than one that is a card itself */
details.fold{margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
details.fold>summary{font-weight:400;font-size:14px;color:var(--steel)}
.answer{margin-top:16px;padding:12px 16px;border-radius:var(--r-ctl);background:var(--ink);font-weight:600}
.hint:empty,.warn-line:empty{display:none}

/* --- buttons --- */
button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font:600 14.5px/1 var(--f-text);background:var(--paper);color:#fff;border:1px solid var(--paper);border-radius:var(--r-ctl);padding:0 18px;min-height:46px;cursor:pointer;white-space:nowrap;text-decoration:none}
button:hover,.btn:hover{background:var(--white)}
button:disabled{opacity:.5}
button.ghost,.btn.ghost{background:transparent;color:var(--paper);border-color:var(--line-2)}
button.ghost:hover,.btn.ghost:hover{border-color:var(--steel);background:var(--raised)}
button.ghost,.btn.ghost{background:var(--graphite)}
button.small,.btn.small{min-height:36px;padding:0 12px;font-size:13.5px;border-radius:10px}
button.danger:hover{border-color:var(--paper)}
button.quiet{background:none;border-color:transparent;color:var(--steel)}
button.quiet:hover{background:var(--raised);color:var(--paper)}
button.wide{width:100%}
.segmented{display:inline-flex;gap:2px;padding:3px;background:var(--raised);border-radius:var(--r-ctl);max-width:100%;overflow-x:auto;scrollbar-width:none}
.segmented button{flex:none;background:transparent;color:var(--steel);border:0;border-radius:9px;min-height:38px;padding:0 16px;font:600 14px/1 var(--f-text)}
.segmented button:hover{background:rgba(255,255,255,.6)}
.segmented button.on{background:var(--graphite);color:var(--paper);box-shadow:0 1px 3px rgba(16,16,24,.12)}
.more{display:inline-block;margin-top:10px;font-size:14px;color:var(--steel);text-decoration:none}
.more:hover{color:var(--paper)}

/* --- badges, lists --- */
.badge{display:inline-block;padding:3px 10px;border:1px solid var(--line-2);border-radius:999px;white-space:nowrap}
.badge.strong,.pill{color:var(--warn);background:var(--warn-bg);border-color:transparent}
.badge.ok{color:var(--ok);background:var(--ok-bg);border-color:transparent}
.pill{display:inline-block;padding:3px 10px;border-radius:999px;white-space:nowrap}
.rows{list-style:none;margin:0;padding:0}
.rows>li{display:flex;align-items:center;gap:10px 14px;flex-wrap:wrap;padding:14px 0;border-top:1px solid var(--line)}
.rows>li:first-child{border-top:0;padding-top:0}
.rows>li:last-child{padding-bottom:0}
.rest>.rows{margin-top:10px}
.rest>.rows>li:first-child{border-top:1px solid var(--line);padding-top:14px}
.pay-result{padding:10px 14px;margin-bottom:12px;border-radius:var(--r-ctl);background:var(--warn-bg);color:var(--warn)}
.pay-result.paid{background:var(--ok-bg);color:var(--ok)}
.empty{padding:22px 4px;color:var(--steel);display:flex;flex-direction:column;gap:14px;align-items:flex-start}
.steps{margin:0;padding-inline-start:20px;display:flex;flex-direction:column;gap:10px}
.steps a{font-weight:600}

.rem>.grow{flex:1 1 220px}
.rem-name{display:flex;flex-wrap:wrap;align-items:center;gap:2px 10px}
.rem .warn-line{display:block}
.pill.soon{background:var(--raised);color:var(--steel)}
.row-actions:empty{display:none}

/* --- projects --- */
.project-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}
.project-card{display:flex;flex-direction:column;gap:6px;padding:18px 20px;background:var(--graphite);border:1px solid var(--line);border-radius:var(--radius);text-decoration:none;min-height:128px}
.project-card:hover{border-color:var(--steel)}
.project-card strong{font-size:18px;line-height:1.35}
.project-card .badge{align-self:flex-start;margin-top:auto}
.page-head>button{flex:none}

/* --- auth --- */
.auth{display:grid;grid-template-columns:1.1fr 1fr;gap:clamp(24px,5vw,72px);align-items:center;min-height:calc(100vh - 200px);max-width:1100px;margin:0 auto}
.auth-pitch h2{font-size:clamp(22px,3vw,32px);font-weight:800;line-height:1.25;font-stretch:var(--stretch);margin:10px 0 22px}
.ticks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.ticks li{padding-inline-start:22px;position:relative;color:var(--steel)}
.ticks li::before{content:"";position:absolute;inset-inline-start:0;top:.7em;width:10px;height:1px;background:var(--paper)}
.auth-card{background:var(--graphite);border:1px solid var(--line);border-radius:var(--radius);padding:clamp(20px,3vw,32px);display:flex;flex-direction:column;gap:16px}
.auth-card h1{font-size:clamp(22px,3vw,30px)}
.auth-links{display:flex;gap:16px;flex-wrap:wrap;font-size:14px}
@media (max-width:820px){.auth{grid-template-columns:1fr}.auth-pitch{order:2}}

/* --- AI --- */
.ai-tag{font:600 11px/1 var(--f-text);padding:4px 7px;border-radius:999px;background:var(--paper);color:#fff}
.proposal{border-top:1px solid var(--line);padding-top:12px;display:flex;flex-direction:column;gap:10px}
.proposal .rows input.num{width:120px;flex:none}

/* --- tables --- */
.table-wrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}
th{text-align:start;padding:8px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
td.num,th.num{text-align:end}
table.results{margin-top:4px}
table.est input.num{width:120px;min-height:34px;padding:4px 8px}
.bar-cell{width:20%}
/* phones: each row of a wide table becomes a small card, so nothing scrolls sideways */
@media (max-width:760px){
  table.cards,.cards tbody,.cards tfoot{display:block}
  .cards thead{display:none}
  .cards tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 14px;padding:12px 0;border-bottom:1px solid var(--line)}
  .cards :is(td,th){display:block;padding:0;border:0;text-align:start;white-space:normal;overflow-wrap:anywhere}
  .cards :is(td,th):not([data-label]){grid-column:1/-1}
  .cards td:empty{display:none}
  .cards td:has(.jdate){grid-column:1/-1}
  .cards td.bar-cell{width:100%}
  .cards td[data-label]::before{content:attr(data-label);display:inline-block;width:100%;font-weight:400;font-size:12.5px;color:var(--steel)}
  .cards td input,.cards td select{width:100%!important}
  .cards.roof tr{grid-template-columns:44px 1fr 1fr;align-items:center}
  .cards.roof .tap{margin:0}
  .cards.roof td:first-child{grid-column:1}
  .cards.roof td.cover,.cards.roof td:last-child{grid-column:2/-1}
  .cards.roof td:nth-child(3){grid-column:2}
  .cards tbody:first-of-type tr:first-child{padding-top:0}
}

/* --- map --- */
/* isolated, or the map's own layers sit on top of the app bars */
.map{position:relative;isolation:isolate;height:min(62vh,520px);min-height:340px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--raised);margin-top:12px}
/* said only to people who move on the map by keyboard */
.map:not(:focus-visible)+#map-keys{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%)}
.map.drawing{cursor:crosshair}
.map.drawing .leaflet-grab{cursor:crosshair}
/* where Enter puts the next corner */
.map.drawing:focus-visible::after{content:"";position:absolute;inset:0;margin:auto;z-index:1000;width:28px;height:28px;border:2px solid #fff;border-radius:50%;outline:2px solid var(--paper);background:radial-gradient(circle,var(--paper) 2px,#fff 2px 4px,transparent 4px);pointer-events:none}
.map-tools{display:flex;gap:6px;flex-wrap:wrap;align-items:end;margin-top:10px}
.coord-form{display:flex;gap:6px;align-items:end;flex:1 1 240px}
.coord-form .field{flex:1}
.coord-form input{min-height:34px;padding:6px 10px;font-size:13.5px}
/* black inside white inside black: it shows on dark and light ground alike */
.vertex{background:var(--paper);border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px var(--paper)}
.leaflet-container{font-family:var(--f-text)}
.leaflet-control-layers,.leaflet-bar a{background:var(--graphite)!important;color:var(--paper)!important;border-color:var(--line)!important}
.leaflet-control-attribution{background:rgba(255,255,255,.8)!important;color:var(--steel)!important}
.leaflet-control-attribution a{color:var(--paper)!important}
.heat{display:block;max-width:100%;margin-top:12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--graphite)}

/* --- schedule --- */
.gantt{display:flex;flex-direction:column;gap:6px;overflow-x:auto}
.gantt-scale{display:flex;justify-content:space-between;font:400 12px var(--f-mono);color:var(--steel);padding-inline-start:min(34%,220px)}
.gantt-row{display:grid;grid-template-columns:min(34%,220px) 1fr;gap:10px;align-items:center;min-width:520px}
.gantt-name{font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gantt-track{position:relative;height:22px;background:var(--ink);border:1px solid var(--line);border-radius:6px;overflow:hidden}
.gantt-bar{position:absolute;top:3px;bottom:3px;border-radius:4px;background:var(--chart)}
.gantt-bar.done{background:var(--paper)}
.gantt-bar.late{background:var(--warn)}
.gantt-today{position:absolute;top:-4px;bottom:-4px;width:2px;background:var(--paper)}
.keys{display:flex;flex-wrap:wrap;gap:4px 18px;margin-bottom:8px;font-size:13px;color:var(--steel)}
.key{position:static;display:inline-block;width:14px;height:10px;margin-inline-end:8px;border-radius:3px}
.key.gantt-today{width:2px;height:14px;vertical-align:-2px}
.key.cut{background:var(--warn)}
.key.fill{background:#3B6EA5}
.heat+.keys{margin-top:8px}
.task-list{list-style:none;margin:0;padding:0}
.task-list>li{border-top:1px solid var(--line)}
.task-list>li:first-child{border-top:0}
.task-list>li:first-child summary{padding-top:2px}
.task-list>li:last-child summary{padding-bottom:2px}
.task-list summary{padding:14px 0}
/* the row opens */
.task-list summary::after{content:"";flex:none;width:7px;height:7px;margin-inline:4px;border:solid var(--steel);border-width:0 2px 2px 0;transform:rotate(45deg) translate(-2px,-2px)}
.task-list details[open]>summary::after{transform:rotate(225deg) translate(-2px,-2px)}
.task-list summary{display:flex;gap:14px;align-items:center}
.task-detail{padding:4px 0 16px;display:flex;flex-direction:column;gap:12px}

/* --- warehouse: one line per material --- */
.stock-name{flex:1 1 0;min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}
.stock-plan{flex:0 1 260px;display:flex;flex-direction:column;gap:6px}
.stock-num{flex:0 0 130px;text-align:end;font-variant-numeric:tabular-nums}
.stock-num strong{font-size:19px;margin-inline-end:6px}
.neg{color:var(--warn)}
@media (max-width:760px){
  .task-list summary.stock{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px 12px}
  .stock-plan{grid-row:2;grid-column:1/-1}
}
.meter{position:relative;display:block;height:6px;border-radius:3px;overflow:hidden;background:var(--line)}
.meter span{position:absolute;inset-block:0;inset-inline-start:0}
.meter-in{background:var(--chart)}
.meter-used{background:var(--paper)}
.facts{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;margin:0;font-size:14px}
.kpis+.facts:not(:empty){margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
.task-detail .facts{max-width:420px}
.facts dt{color:var(--steel)}
.facts dd{margin:0;text-align:end;font-variant-numeric:tabular-nums}
.moves{list-style:none;margin:0;padding:0}
.moves li{display:grid;grid-template-columns:minmax(64px,auto) minmax(0,1fr);gap:10px;align-items:baseline;padding:10px 0;border-top:1px solid var(--line)}
.moves li:first-child{border-top:0}
.moves li>.muted{grid-column:2}
.moves .qty{font-family:var(--f-mono);font-variant-numeric:tabular-nums;text-align:end}
.moves li:has(>button){grid-template-columns:minmax(64px,auto) minmax(0,1fr) auto}
.moves li>button{grid-column:3;grid-row:1/span 2;align-self:center}
.moves .gone :is(.qty,strong){text-decoration:line-through}
.moves .qty.in{color:var(--ok)}
.moves .qty.out{color:var(--steel)}
@media (max-width:760px){
  .gantt-scale{padding:0}
  .gantt-row{grid-template-columns:minmax(0,1fr);gap:2px;min-width:0}
}

/* --- daily --- */
.reports{list-style:none;margin:0;padding:0}
.reports li{padding:14px 0;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:6px}
.reports li:first-child{border-top:0;padding-top:0}
.reports li:last-child{padding-bottom:0}
.reports header{display:flex;gap:10px;align-items:flex-start}
.reports .issue{padding-inline-start:12px;border-inline-start:3px solid var(--warn)}

/* --- toast --- */
#toast{position:fixed;inset-inline:16px;bottom:18px;margin:auto;max-width:520px;border-radius:var(--radius);box-shadow:0 8px 24px rgba(16,16,24,.18);background:var(--paper);color:#fff;padding:13px 16px;font-size:14.5px;opacity:0;transform:translateY(8px);transition:opacity .2s,transform .2s;pointer-events:none;z-index:30}
#toast.show{opacity:1;transform:none}
#toast.error{background:var(--warn)}
@media (prefers-reduced-motion:reduce){#toast{transition:none}}

/* --- sheets: tools grid and "new project" slide up from the bottom on phones, centred on desktop --- */
.dock{display:none}
.sheet{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:none;max-height:88vh;overflow-y:auto;border:0;border-radius:22px 22px 0 0;background:var(--graphite);color:var(--paper);padding:8px 0 calc(16px + env(safe-area-inset-bottom));box-shadow:0 -8px 30px rgba(16,16,24,.12)}
.sheet::backdrop{background:rgba(16,16,24,.4)}
.sheet-head{position:relative;display:flex;justify-content:space-between;align-items:center;padding:14px var(--gutter) 8px}
.sheet-head::before{content:"";position:absolute;top:0;inset-inline:0;margin:auto;width:40px;height:4px;border-radius:2px;background:var(--line-2)}
.sheet-head strong{font-size:18px}
.sheet-body{padding:8px var(--gutter) 4px}
@media (min-width:1024px){.sheet-body{padding-inline:24px}.sheet-head{padding-inline:24px}.sheet>.sheet-head{padding-top:18px}}
.tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:8px var(--gutter) 4px}
.tool-grid :is(section,.tool-list){display:contents}
.tool-grid a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:92px;padding:12px 6px;border-radius:16px;background:var(--ink);text-decoration:none;text-align:center;font-size:13px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
.tool-grid a .icon{width:26px;height:26px}
.tool-grid a.on{background:var(--paper);color:#fff}
@media (min-width:1024px){.sheet{inset:0;margin:auto;width:calc(100% - 32px);max-width:480px;height:fit-content;border-radius:20px;padding-bottom:20px}.sheet-head::before{display:none}}

/* --- phones and tablets: the project gets its own app bar and a bottom bar; the sidebar goes into the Tools sheet --- */
@media (max-width:1023px){
  .proj{display:block}
  .side{display:none}
  body.in-project .bar{display:none}
  .proj-head{position:sticky;top:0;z-index:10;gap:6px;min-height:60px;margin:calc(-1 * var(--main-pt)) calc(-1 * var(--gutter)) 16px;padding:8px calc(var(--gutter) - 6px);background:rgba(255,255,255,.94);backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
  .proj-head h1{font-size:17px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .proj-head p{font-size:12px;line-height:1.4;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .proj-head .round{border:0;background:none;width:44px;height:44px}
  .proj-head .round:hover{background:var(--raised)}
  .phone-only{display:inline-grid!important}
  main{padding-bottom:calc(var(--dock-h) + 40px + env(safe-area-inset-bottom))}
  .dock{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);position:fixed;inset-inline:0;bottom:0;z-index:15;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
  .dock>a,.dock>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:52px;padding:0 2px;background:none;border:0;border-radius:0;color:var(--steel);font:600 11.5px/1.2 var(--f-text);text-decoration:none;white-space:nowrap;min-width:0}
  .dock>button:hover{background:none}
  .dock-ic{position:relative;display:grid;place-items:center;width:58px;height:30px;border-radius:999px;transition:background .15s}
  .dock .on{color:var(--paper)}
  .dock .on .dock-ic{background:var(--line)}
  .dock-badge{position:absolute;top:-3px;inset-inline-end:6px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--warn);color:#fff;font:700 11px/18px var(--f-text);text-align:center}
  #toast{bottom:calc(var(--dock-h) + 12px + env(safe-area-inset-bottom))}
}
@media (max-width:760px){
  :root{--main-pt:16px}
  body{font-size:15px}
  .bar{flex-wrap:nowrap;min-height:56px;padding-block:6px}
  .product,.wide-only{display:none!important}
  #nav{flex-wrap:nowrap;gap:2px}
  .nav-account span{display:none}
  .nav-account .icon{display:block}
  #nav>a.nav-account{padding:10px}
  .banner{font-size:13px;padding-block:7px}
  h1{font-size:24px}
  .page-head{margin-bottom:14px;align-items:center}
  .page-head .muted{font-size:13.5px}
  /* 16px stops iPhone Safari zooming into a field on tap; controls are thumb-sized */
  input,textarea,select{font-size:16px;min-height:48px}
  button,.btn{min-height:48px}
  .card{padding:16px}
  .kpi{flex-basis:40%;padding:12px 14px}
  /* the parts and "more" on one row, the buttons under them */
  .tools>.segmented{flex:1 1 calc(100% - 56px);min-width:0}
  .tools>button:not(.icon-btn),.tools:not(:has(.segmented))>.icon-btn{order:1}
  .tools>.segmented>*{flex:1 0 auto}
  .tools>button:not(.icon-btn){flex:1 1 auto}
  .inline-form>button,.grid-form>button{flex-basis:100%;justify-self:stretch}
  .project-grid{grid-template-columns:1fr}
}
@media (prefers-reduced-motion:reduce){.dock-ic{transition:none}}

/* --- print: clean black on white, no chrome --- */
@media print{
  :root{--ink:#fff;--graphite:#fff;--raised:#fff;--line:#bbb;--line-2:#999;--steel:#555;--paper:#000;--white:#000;color-scheme:light}
  body{background:#fff;color:#000}
  .skip,.bar,.side,.round,.dock,.sheet,.banner,#foot,#toast,.tools,.segmented,.tabs,.actions,.map-tools,button,.btn,details.settings:not(.prints),.add-row{display:none!important}
  .part.off{display:flex}
  .map{height:360px}
  .split,.two-col,.proj{grid-template-columns:1fr}
  .proj-head{position:static;margin:0 0 16px;padding:0;border:0;background:none}
  .sticky{position:static}
  .card,.kpi{break-inside:avoid}
  a{text-decoration:none}
}

/* --- assistant chat: bubbles, confirm cards and a composer that stays on screen above the phone dock --- */
.chat{display:flex;flex-direction:column;gap:16px;max-width:820px;margin-inline:auto;min-height:calc(100vh - 190px)}
.chat-hello{display:flex;flex-direction:column;gap:10px;margin-block:auto;padding:8px 0}
.chat-hello h2{font-size:clamp(20px,3vw,26px);font-weight:800;line-height:1.3}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.chips button{height:auto;min-height:40px;padding:8px 14px;line-height:1.4;text-align:start;font-weight:400;white-space:normal;border-radius:999px}
.chat-log{display:flex;flex-direction:column;gap:12px}
.msg{max-width:min(88%,640px);padding:11px 14px;border-radius:18px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}
.msg.me{align-self:flex-end;background:var(--paper);color:#fff;border-end-end-radius:4px}
.msg.bot{align-self:flex-start;background:var(--graphite);border:1px solid var(--line);border-end-start-radius:4px}
.attached{display:inline-flex;align-items:center;gap:6px}
.attached .icon{flex:none;width:18px;height:18px}
.bot-name{display:block;font:700 12px/1.4 var(--f-text);color:var(--steel);margin-bottom:3px}
.typing::after{content:"";display:inline-block;width:1.4em;text-align:start;animation:dots 1.2s steps(4) infinite}
@keyframes dots{0%{content:""}25%{content:"."}50%{content:".."}75%{content:"..."}}
@media (prefers-reduced-motion:reduce){.typing::after{animation:none;content:"…"}}
.act{white-space:normal;margin-top:10px;border:1px solid var(--line-2);border-radius:var(--radius);background:var(--ink);padding:12px 14px}
.act>strong{display:block;margin-bottom:8px;line-height:1.5}
.act dl{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:0 0 12px;font-size:14px}
.act dt{color:var(--steel)}
.act dd{margin:0;overflow-wrap:anywhere}
.act .row{gap:8px}
.act.done{border-color:#B9DCC8;background:var(--ok-bg)}
.act.done .act-status{color:var(--ok)}
.act.failed{border-color:#EBC3B3;background:var(--warn-bg)}
.act.failed .act-status{color:var(--warn)}
.act.cancelled>strong{color:var(--steel);text-decoration:line-through}
.act-status{font-size:13.5px;font-weight:600}
.msg-links{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;white-space:normal}
.composer{position:sticky;bottom:0;z-index:4;margin-top:auto;display:flex;flex-direction:column;gap:8px;padding:12px 0 16px;background:linear-gradient(transparent,var(--ink) 16px)}
.composer-row{display:flex;gap:6px;align-items:flex-end;background:var(--graphite);border:1px solid var(--line-2);border-radius:24px;padding:6px;box-shadow:0 2px 10px rgba(16,16,24,.06)}
.composer-row:focus-within{border-color:var(--paper);box-shadow:0 0 0 1px var(--paper)}
.composer .warn-line:empty{display:none}
/* messages must not cover the box people are typing in */
body:has(.composer) #toast{bottom:110px}
body:has(.composer) #foot{display:none}
body:not(:has(.composer)) main{padding-bottom:40px}
.composer textarea{border:0;box-shadow:none;background:transparent;min-height:44px;max-height:180px;resize:none;padding:10px 6px}
.composer textarea:focus{box-shadow:none}
.icon-btn{flex:none;width:44px;height:44px;min-height:44px;padding:0;border-radius:999px}
html[dir=rtl] .send .icon{transform:scaleX(-1)}
.files{display:flex;gap:6px;flex-wrap:wrap}
.badge.file{display:inline-flex;align-items:center;gap:4px;text-transform:none;letter-spacing:0;font-size:13px}
.badge.file button{min-height:22px;height:22px;padding:0 6px;border:0}
@media (max-width:1023px){
  .composer{bottom:calc(var(--dock-h) + env(safe-area-inset-bottom))}
  body:has(.composer) #toast{bottom:calc(var(--dock-h) + 100px + env(safe-area-inset-bottom))}
  body.in-project #foot{padding-bottom:calc(var(--dock-h) + 20px + env(safe-area-inset-bottom))}
  /* the composer rests just above the bottom bar even before the first message */
  .chat{min-height:calc(100dvh - 76px - var(--dock-h) - env(safe-area-inset-bottom));margin-bottom:-40px}
}
@media (max-width:760px){.msg{max-width:94%}.composer textarea{min-height:44px}}
@media print{.composer,.chips{display:none!important}}

/* --- the estimate: reading progress, trust report and its traces on other screens --- */
.reading{display:flex;flex-direction:column;gap:10px}
.meter.big{height:10px;border-radius:5px}
.meter.big span{transition:width .6s}
.meter.busy span{animation:pulse 1.6s ease-in-out infinite}
@keyframes pulse{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.meter.busy span{animation:none}.meter.big span{transition:none}}
.sheet-list,.check-list{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.sheet-list li{display:flex;gap:10px;align-items:flex-start}
.sheet-list .grow{flex:1;min-width:0;overflow-wrap:anywhere}
html[dir=rtl] .sheet-list .grow{text-align:right}
.check-list .check{align-items:flex-start}
.card h3{font-size:14.5px;margin:14px 0 0}
.element summary{gap:12px}
.element .source{margin:0}
input[aria-invalid=true]{border-color:var(--warn)}
.section-box{flex:none;width:68px;display:flex;justify-content:center}
.section{max-width:100%;height:auto}
.section .concrete{fill:var(--raised);stroke:var(--steel)}
.section .block{fill:none;stroke:var(--line-2)}
.section .tie{fill:none;stroke:var(--chart)}
.section .bar{fill:var(--paper)}
.source{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:4px}
.warn-line{color:var(--warn);font-size:13.5px}
.notice{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;margin-top:12px;padding:12px 14px;border:1px solid #EBC3B3;background:var(--warn-bg);border-radius:var(--radius)}
.notice .grow{flex:1 1 220px}
.stack>.notice{margin-top:0}
.card>.kpis+.warn-line{margin-top:10px}
.card>.chips{margin-top:12px}
.chips a.btn{height:auto;min-height:40px;white-space:normal;line-height:1.4}
.btn .ai-tag,button .ai-tag{margin-inline-end:8px}
button:not(.ghost)>.ai-tag,.btn:not(.ghost)>.ai-tag{background:#fff;color:var(--paper)}

/* --- drawing viewer: the sheet fills the screen; the white image keeps drawings readable --- */
.viewer{position:fixed;inset:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--raised);color:var(--paper)}
.viewer[open]{display:flex;flex-direction:column}
.viewer-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 12px 8px;padding-top:calc(8px + env(safe-area-inset-top));background:var(--graphite);border-bottom:1px solid var(--line)}
.viewer-bar .grow{flex:1;min-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.viewer-stage{flex:1;overflow:auto;display:flex;touch-action:pan-x pan-y;cursor:grab;overscroll-behavior:contain}
.viewer-stage img{margin:auto;max-width:none;flex:none;height:auto;background:#fff;user-select:none}
.viewer-msg{margin:auto;padding:16px;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;cursor:auto}

/* --- thumbs: everything to tap is at least 44px --- */
@media (max-width:1023px),(pointer:coarse){
  button.small,.btn.small{min-height:44px;min-width:44px;padding:0 12px}
  :is(.chips,.segmented) button,.chips a.btn{min-height:44px}
  .side a{min-height:44px}
  .round{width:44px;height:44px}
  #nav>a{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}
  #foot a{justify-content:center;min-width:44px}
  .brand{min-height:44px}
  details>summary{padding-block:12px}
  .more{margin-top:0;padding-block:12px}
  :is(.auth-links,.steps,main p,.banner) a:not(.btn){padding-block:15px}
  .banner a{display:inline-block;min-width:44px}
  .steps{gap:22px}
  .coord-form input,table.est input.num{min-height:44px}
  .badge.file button{min-height:44px;height:44px;margin-inline-end:-10px}
  .leaflet-bar a,.leaflet-touch .leaflet-bar a{width:44px;height:44px;line-height:44px}
  .leaflet-control-layers label>span{display:flex;align-items:center;gap:8px;min-height:44px}
  .vertex::before{content:"";position:absolute;inset:-15px}
}
