/* Shared document mechanics; each selected layout supplies its own typography and composition. */
/* One paper size for every look: US letter, 8.5in x 11in at 96px per inch. */
:root{--page-w:816px;--page-h:1056px;--page-pad:68px}
@media(max-width:860px){:root{--page-pad:48px}}
/* Logo size knobs, read by every header and look. Square marks use --logo-h; wide ones --logo-w and --logo-wh (max height).
   The vendor's Logo size (body.logo-s / -l / -xl) swaps the set; phones scale by --logo-k. Sizes are caps: a small upload never grows past its own size. */
:root{--logo-h:96px;--logo-w:260px;--logo-wh:110px;--logo-k:1}
body.logo-s{--logo-h:64px;--logo-w:180px;--logo-wh:76px}
body.logo-l{--logo-h:128px;--logo-w:340px;--logo-wh:144px}
body.logo-xl{--logo-h:160px;--logo-w:420px;--logo-wh:176px}
@media(max-width:600px){:root{--logo-k:.75}}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;color-scheme:light}
body{background:var(--ground,#f2f3f2);color:var(--ink,#252927);font:400 15px/1.5 var(--sans,'Hanken Grotesk',sans-serif);-webkit-font-smoothing:antialiased}
::selection{background:var(--soft,#e7ebe8);color:var(--ink)}
a{color:inherit;text-underline-offset:4px}
a:focus-visible{outline:2px solid var(--accent,#283b32);outline-offset:5px}
.eqh{--bt:var(--page-pad);--bl:var(--page-pad);--br:var(--page-pad)}
.d-wrap{max-width:calc(var(--page-w) + 48px);margin:0 auto;padding:36px 24px 40px}
.d-document{position:relative;min-height:var(--page-h);padding:var(--page-pad);background:var(--paper,#fff);border:1px solid var(--line,#dde0dc);border-radius:2px;overflow-wrap:anywhere}
.d-mast{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:28px;border-bottom:1px solid var(--line);padding-bottom:30px;margin-bottom:28px}
.d-identity{display:flex;flex-wrap:wrap;gap:12px 16px;align-items:center;min-width:0;max-width:65%}
.d-identity>div{flex:1 1 150px;min-width:0}
.d-monogram{display:flex;align-items:center;justify-content:center;flex:none;width:40px;height:40px;border:1px solid var(--accent);color:var(--accent);font:500 24px/1 var(--display,var(--sans));border-radius:2px}
.d-logo{display:block;width:auto;height:auto;max-width:min(calc(var(--logo-w) * var(--logo-k)),100%);max-height:calc(var(--logo-h) * var(--logo-k));object-fit:contain;flex:none}
.d-name{font-size:21px;font-weight:650;line-height:1.18;letter-spacing:-.02em;color:var(--accent,var(--ink))}
.d-contact{font-size:12px;line-height:1.5;color:var(--muted,#626a65);white-space:pre-line;margin-top:6px}
.d-title{min-width:0}
.d-mast>.d-title{min-width:auto}
/* A word breaks mid-letter only when it is wider than the page itself; long emails and links in the contact lines still break anywhere. */
h1,.d-name{overflow-wrap:break-word}
h1{font:500 46px/1.08 var(--display,var(--sans));letter-spacing:-.025em;color:var(--ink)}
.sheet h1{font-size:34px}
.d-intro{margin-top:12px;font-size:14px;color:var(--muted);white-space:pre-line;max-width:60ch}
.d-details{display:flex;flex-wrap:wrap;gap:22px 32px;margin-bottom:32px}
.d-client{flex:1;min-width:130px}
.d-label,.d-facts dt{display:block;font:500 10px/1.5 var(--sans);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.d-client p{font-size:21px;line-height:1.35;font-weight:500;margin-top:4px}
.d-facts{flex:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 24px;min-width:200px}
.d-facts>div{min-width:0}
.d-facts dd{font-size:13px;margin-top:3px;line-height:1.5}
.d-column-head{display:flex;justify-content:space-between;gap:16px;border-bottom:1px solid var(--ink);padding:0 0 9px;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.d-row{display:flex;gap:14px;align-items:baseline;padding:17px 0;border-bottom:1px solid var(--line)}
.d-row.has-photo{align-items:center}
.d-row img,.d-product img{display:block;flex:none;width:56px;height:56px;border-radius:2px;object-fit:cover}
.d-item-copy{flex:1;min-width:0}
.d-item-name{display:block;font-size:15px;font-weight:550;line-height:1.4}
.d-math{display:block;font-size:12px;color:var(--muted);white-space:pre-line;margin-top:4px;line-height:1.5}
.d-amount{font-size:14px;font-weight:500;font-variant-numeric:lining-nums tabular-nums;text-align:right;max-width:45%}
.d-amount small{display:block;font-size:11px;font-weight:400;color:var(--muted);margin-top:3px}
.d-index{font:400 12px/1.5 var(--mono,var(--sans));color:var(--accent);flex:none;min-width:24px}
.d-table-wrap{overflow-x:auto;max-width:100%}
.d-table{width:100%;border-collapse:collapse;table-layout:fixed;text-align:left}
.d-table th{font-size:10px;line-height:1.4;font-weight:500;text-transform:uppercase;letter-spacing:.06em;padding:10px 0;border-bottom:1px solid var(--ink);color:var(--muted);vertical-align:bottom}
.d-table th:first-child{width:42%}
.d-table th:nth-child(2):not(:last-child){width:10%}
.d-table th:nth-child(3):not(:last-child){width:24%}
.d-table th:last-child{width:24%}
.sheet .d-table th:first-child{width:70%}
.sheet .d-table th:last-child{width:30%}
.d-table td{padding:15px 0;border-bottom:1px solid var(--line);vertical-align:top;font-size:13px}
.d-table .d-num small{white-space:normal}
.d-table .d-num{white-space:nowrap;text-align:right;font-variant-numeric:lining-nums tabular-nums;padding-left:10px}
.d-product{display:flex;align-items:flex-start;gap:12px;min-width:0}
.d-product .d-item-name{font-size:14px}
.d-summary{margin:24px 0 0 auto;max-width:340px;break-inside:avoid}
.d-sum-row{display:flex;justify-content:space-between;gap:20px;color:var(--muted);font-size:13px;line-height:1.5;padding:6px 0;font-variant-numeric:lining-nums tabular-nums}
.d-sum-row>span:last-child{color:var(--ink);text-align:right;flex-shrink:0}
.d-grand{display:flex;justify-content:space-between;gap:18px;align-items:baseline;border-top:1px solid var(--ink);margin-top:10px;padding-top:16px;color:var(--accent)}
.d-grand>span{font-size:14px;font-weight:550}
.d-grand strong{font:600 32px/1.15 var(--display,var(--sans));font-variant-numeric:lining-nums tabular-nums;letter-spacing:-.02em;text-align:right}
.d-note{margin-top:30px;padding-top:18px;border-top:1px solid var(--line)}
.d-note h2{font:500 10px/1.5 var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.d-note p,.d-footnote{font-size:13px;line-height:1.65;white-space:pre-line;margin-top:8px}
.d-valid{margin-top:20px;font-size:12px;color:var(--muted)}
.d-footer{margin-top:30px;padding-top:18px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.d-credit{margin:24px auto 0;text-align:center;font-size:11px;color:var(--muted)}
.d-credit a{display:inline-block;text-decoration:none;border:1px solid var(--line);padding:7px 11px;border-radius:2px;background:var(--paper)}
.d-credit a:hover{color:var(--ink);border-color:var(--accent)}
.d-section{margin-top:28px}
.d-section:first-child{margin-top:0}
.d-section h2{font:500 22px/1.2 var(--display,var(--sans));color:var(--accent);padding-bottom:14px;border-bottom:1px solid var(--line)}
.d-split{display:grid;grid-template-columns:minmax(120px,1fr) minmax(0,2.6fr);gap:30px}
.d-split>.d-details{display:block;padding-right:22px;border-right:1px solid var(--line);margin:0}
.d-split .d-facts{display:block;min-width:0;margin-top:24px}
.d-split .d-facts>div{margin-top:18px}
.d-split .d-client{min-width:0}
.d-main{min-width:0}
.d-split.no-details,.d-opening.no-details{display:block}
.d-main>.d-title{margin-bottom:28px}
.d-opening{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:32px;margin-bottom:28px}
.d-opening .d-details{margin-bottom:0;display:block}
.d-opening .d-facts{margin-top:18px}
.d-rail{min-width:0}
.d-party-mark{flex:none;display:block}
.d-party-mark circle:first-child{fill:#bd4936}.d-party-mark circle:nth-child(2){fill:#e8b737}.d-party-mark circle:last-child{fill:#4d81ad}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.eq-expired{margin:0 0 16px;padding:12px 16px;border:1px solid #a63a2c;border-left-width:4px;border-radius:2px;background:#fdf0ed;color:#68180d;font:500 15px/1.5 var(--sans,'Hanken Grotesk',sans-serif);overflow-wrap:anywhere}
.eq-expired b{font-weight:700}
@media(max-width:860px){.d-wrap{padding:16px 16px 28px}.d-document{min-height:0}}
@media(max-width:600px){
 .d-wrap{padding:16px 16px 28px}.d-document{padding:26px 20px}.d-mast{gap:18px;flex-wrap:wrap;margin-bottom:22px;padding-bottom:22px}.d-identity{max-width:100%}.d-name{font-size:19px}h1{font-size:36px}.sheet h1{font-size:29px}.d-details{gap:20px;margin-bottom:24px}.d-facts{min-width:0;flex-basis:100%;gap:12px 20px}.d-client{min-width:0}.d-client p{font-size:19px}.d-row{gap:10px}.d-row img,.d-product img{width:42px;height:42px}.d-item-name{font-size:14px}.d-amount{font-size:13px}.d-table td{font-size:12px}.d-table th{font-size:9px;letter-spacing:0}.d-table .d-num{padding-left:6px}.d-product{display:block}.d-product img{margin-bottom:8px}.d-table .d-item-name{font-size:13px}.d-table .d-math{font-size:11px}.d-summary{max-width:none}.d-grand strong{font-size:28px}.d-split{display:block}.d-split>.d-details{display:flex;flex-wrap:wrap;gap:20px;padding:0 0 22px;margin-bottom:24px;border-right:0;border-bottom:1px solid var(--line)}.d-split .d-facts{display:grid;margin-top:0;flex-basis:100%}.d-split .d-facts>div{margin:0}.d-opening{grid-template-columns:1fr;gap:20px}.d-opening .d-details{display:flex}.d-opening .d-facts{margin:0}.d-grand{gap:10px}
}
/* Phones: a quote's or invoice's item table (Item, Qty, Unit price, Amount) becomes stacked rows. The item and its photo
   take the whole row; Qty and Unit price sit together under it, and the line's amount stands on its own at the right, so
   every figure is whole without sideways scrolling. The header row stays for screen readers; each figure shows its own
   column name instead (the "/ ''" alt text keeps those names from being read twice). Desktop and print keep the table. */
@media(max-width:600px){
 .quote .d-table,.quote .d-table tbody{display:block;width:100%}
 .quote .d-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 .quote .d-table tr{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:end;column-gap:18px;padding:15px 0;border-bottom:1px solid var(--line)}
 .quote .d-table td{display:block;min-width:0;padding:0;border:0}
 .quote .d-table td:first-child{grid-column:1/-1;margin-bottom:10px}
 .quote .d-table td.d-num{padding-left:0;text-align:left}
 .quote .d-table td.d-num:empty{display:none}
 .quote .d-table td.d-amount{grid-column:3;max-width:none;text-align:right}
 .quote .d-table td.d-num:before{display:block;margin-bottom:2px;font:500 9px/1.4 var(--label-font,var(--sans));letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
 .quote .d-table td:nth-child(2):before{content:'Qty';content:'Qty' / ''}
 .quote .d-table td:nth-child(3):before{content:'Unit price';content:'Unit price' / ''}
 .quote .d-table td.d-amount:before{content:'Amount';content:'Amount' / ''}
 /* A price sheet's table keeps its two columns; the price column gets a little more room for a six-figure price. */
 .sheet .d-table th:first-child{width:60%}
 .sheet .d-table th:last-child{width:40%}
}
/* Big screens: the whole letter sheet scales up like zooming a document to fit. Client documents only; print has its own scale. */
@media screen and (min-width:1500px){.d-wrap{zoom:1.15}}
@media screen and (min-width:1800px){.d-wrap{zoom:1.25}}
@media screen and (min-width:2200px){.d-wrap{zoom:1.4}}
@page{size:letter;margin:.5in}
@media print{
 :root{--page-pad:0px}html{zoom:.9}
 body{background:#fff;color:#111;font-size:11pt;print-color-adjust:exact;-webkit-print-color-adjust:exact}.d-wrap{max-width:none;width:auto;padding:0}.d-document{width:auto;min-height:0;border:0;padding:0;background:#fff;box-shadow:none;border-radius:0}.d-credit{font-size:8pt;margin-top:14px}.d-credit a{border:0;padding:0;background:none}.d-row,.d-table tr,.d-summary,.d-note,.d-grand,.inv-due,.inv-pay,.inv-stamp,.d-details{break-inside:avoid}.d-mast,.d-section h2,.d-column-head{break-after:avoid}.d-table-wrap{overflow:visible}.d-table thead{display:table-header-group}.d-footer{font-size:9pt}.d-grand,.d-details,.d-note,.d-row.d-party-mark{print-color-adjust:exact;-webkit-print-color-adjust:exact}
}
/* A light (white) logo would vanish on the paper: a small dark plate behind it. */
img.on-ink{box-sizing:border-box;background:var(--ink,#252927);padding:6px 8px;border-radius:3px}
