/* Cut List Optimiser. Colours, spacing and type follow the approved mock-up,
   docs/mockups/official-cut-list-optimiser.html, in its New view. */
:root{
  --ink:#1d1d1f; --ink2:#6e6e73; --line:#e5e5ea; --field:#d2d2d7; --soft:#f5f5f7;
  --green:#093b32; --green-h:#0f4a3f; --tint:#e8efed; --amber:#b25e09; --dash:#c7c7cc;
  --red:#b42318;
  --panel:#f5f5f7; --pline:#dcdce0;   /* step panels */
  --rpanel:#f1f6f4; --rline:#d8e3de;  /* the results panel */
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;background:#fff;color:var(--ink);font-family:'Archivo',system-ui,-apple-system,'Segoe UI',sans-serif;font-size:16px;line-height:1.4;-webkit-font-smoothing:antialiased;overflow-x:hidden}
button,input,select,output{font:inherit;color:inherit}
a{color:var(--green);text-decoration:none}
a:hover{text-decoration:underline;text-underline-offset:3px}
a:focus-visible,button:focus-visible,select:focus-visible,[role="radio"]:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
[hidden]{display:none!important}
p{margin:0}

/* ---------- header ---------- */
.wrap{max-width:948px;margin:0 auto;padding:0 24px}
.site{border-bottom:1px solid var(--line)}
.head-in{display:flex;align-items:center;justify-content:space-between;gap:16px;height:56px}
.logo{display:block;line-height:0}
.logo svg{display:block;width:84px;height:auto}
.head-links{display:flex;align-items:center;gap:24px;font-size:15px;font-weight:500}

/* ---------- title ---------- */
.title{padding-top:16px}
.title h1{margin:0;font-size:26px;line-height:1.2;font-weight:600;letter-spacing:-0.02em}
.title p{margin-top:2px;font-size:15px;color:var(--ink2)}

/* ---------- steps: each on a light panel ---------- */
.steps{margin-top:16px;display:flex;flex-direction:column;gap:14px}
.step{background:var(--panel);border-radius:18px;padding:18px 20px 20px}
.step-k{display:inline-block;margin-bottom:6px;padding:4px 10px;border-radius:999px;background:var(--green);color:#fff;font-size:12.5px;line-height:1.2;font-weight:600;letter-spacing:.01em}
.step h2{margin:0 0 12px;font-size:20px;line-height:1.25;font-weight:600;letter-spacing:-0.015em}
.lead{margin:-4px 0 10px;font-size:15px;color:var(--ink2);text-wrap:pretty}

/* step 1: worktops */
.slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.slot-wrap{position:relative;min-width:0}
.slot-wrap>.slot{height:100%}
.slot{position:relative;display:flex;align-items:center;gap:12px;width:100%;min-height:72px;border:1px solid var(--line);border-radius:14px;padding:11px 8px 11px 12px;background:#fff;text-align:left}
.thumb{display:block;flex:none;object-fit:cover}
.thumb.tile{background:var(--line)}
.slot .thumb{width:44px;height:44px;border-radius:10px}
.slot-txt{min-width:0;flex:1}
.slot-name{font-weight:600;line-height:1.25;padding-right:28px}
.slot-sub{display:flex;align-items:center;gap:6px;font-size:15px;color:var(--ink2);line-height:1.3;margin-top:1px}
.slot .rm{position:absolute;top:6px;right:4px;width:32px;height:40px;flex:none}
.slot.empty{justify-content:center;gap:8px;border:1.5px dashed var(--dash);background:rgba(255,255,255,.6);color:var(--green);font-weight:500;cursor:pointer;padding:11px 12px;transition:border-color .2s,background-color .2s}
.slot.empty:hover{border-color:var(--green);background:#fff}
.slot.multi{flex-wrap:wrap;row-gap:8px}
.thk-row{flex-basis:100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.thk-row>span{font-size:15px;font-weight:500}
.seg{display:inline-flex;border:1px solid var(--field);border-radius:9px;padding:2px;background:#fff}
.seg button{height:26px;padding:0 6px;border:0;border-radius:7px;background:none;font-size:15px;color:var(--ink2);cursor:pointer;font-variant-numeric:tabular-nums;white-space:nowrap;transition:background-color .2s,color .2s}
.seg button:hover{color:var(--ink)}
.seg button[aria-checked="true"]{background:var(--tint);color:var(--green);font-weight:600;box-shadow:inset 0 0 0 1px var(--green)}
.slot-note{margin-top:8px;font-size:15px;color:var(--ink2)}
.slot-pic{flex:none;display:block;padding:0;border:0;background:none;border-radius:10px;line-height:0;cursor:zoom-in}
.slot-pic img{transition:opacity .2s}
.slot-pic:hover img{opacity:.85}
.slot-ph{display:inline-block;margin-top:2px;font-size:15px;line-height:1.3;font-weight:500;color:var(--green)}
#hWorktops:focus{outline:none}

/* the pick list */
.picker{position:absolute;left:0;top:calc(100% + 6px);z-index:30;width:max(100%,360px);max-width:calc(100vw - 32px);background:#fff;border:1px solid var(--line);border-radius:14px;padding:6px;box-shadow:0 8px 24px rgba(0,0,0,.08)}
.slot-wrap:nth-child(3) .picker{left:auto;right:0}
.pk-search{display:block;width:100%;height:40px;margin-bottom:4px;border:1px solid var(--field);border-radius:10px;padding:0 12px;font-size:16px;background:#fff;outline:none;transition:border-color .2s,box-shadow .2s}
.pk-search:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(9,59,50,.12)}
.pk-list{max-height:min(360px,60vh);overflow-y:auto;overscroll-behavior:contain}
.picker button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:40px;padding:6px 10px;border:0;background:none;border-radius:8px;font-size:16px;text-align:left;cursor:pointer}
.picker button:hover:not([disabled]){background:var(--soft)}
.picker button[disabled]{color:var(--ink2);cursor:default}
.picker small{font-size:15px;color:var(--ink2);white-space:nowrap}
.pk-n{display:flex;align-items:center;gap:10px;min-width:0}
.pk-n .thumb{width:32px;height:32px;border-radius:8px}
.pk-n img.thumb{background:var(--soft)}
.pk-none{padding:8px 10px;font-size:15px;color:var(--ink2)}

/* step 2: sizes */
.sizes-body{display:grid;grid-template-columns:minmax(0,1fr) 262px;gap:28px;align-items:start}
.phead,.prow{display:grid;grid-template-columns:20px minmax(0,1fr) minmax(0,1fr) 112px 36px;grid-template-areas:"n l w q x";column-gap:10px;align-items:center}
.phead{font-size:15px;color:var(--ink2);margin-bottom:5px;line-height:1.2}
.phead .h-l{grid-area:l}.phead .h-w{grid-area:w}.phead .h-q{grid-area:q}
.prow+.prow{margin-top:8px}
.pnum{grid-area:n;font-weight:500;color:var(--ink2);text-align:center}
.fld{position:relative;display:block}
.fld.l{grid-area:l}.fld.w{grid-area:w}
.fld input{width:100%;height:44px;border:1px solid var(--field);border-radius:10px;padding:0 38px 0 12px;font-size:16px;background:#fff;font-variant-numeric:tabular-nums;outline:none;transition:border-color .2s,box-shadow .2s,background-color .6s}
.fld input:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(9,59,50,.12)}
.fld input.bad{border-color:var(--red);box-shadow:0 0 0 3px rgba(180,35,24,.12)}
.fld i{position:absolute;right:11px;top:50%;transform:translateY(-50%);font-style:normal;font-size:15px;color:var(--ink2);pointer-events:none}
.stp{grid-area:q;display:flex;align-items:center;height:44px;border:1px solid var(--field);border-radius:10px;background:#fff}
.stp.bad{border-color:var(--red);box-shadow:0 0 0 3px rgba(180,35,24,.12)}
.stp button{width:34px;height:100%;border:0;background:none;cursor:pointer;display:grid;place-items:center;color:var(--green);border-radius:10px;flex:none}
.stp output{flex:1;text-align:center;font-variant-numeric:tabular-nums}
.rm{grid-area:x;width:36px;height:44px;border:0;background:none;cursor:pointer;color:var(--ink2);display:grid;place-items:center;border-radius:10px;padding:0}
.rm:hover{color:var(--ink)}
.add{display:inline-block;margin-top:9px;font-weight:500}

/* the Length and Width drawing */
.guide{margin:0;background:#fff;border-radius:14px;padding:12px 14px}
.guide-art{line-height:0;min-height:20px}
.guide-art svg{display:block}
.guide figcaption{margin-top:6px;font-size:15px;line-height:1.35;text-wrap:pretty}

/* "How does this work?": the green band between Step 1 and Step 2 (docs/mockups/how-it-works-popup.html, Design 1) */
.how-q{flex:none;width:22px;height:22px;border-radius:50%;background:var(--green);color:#fff;display:grid;place-items:center;font-size:14px;font-weight:600;line-height:1}
.how-band{display:flex;align-items:center;gap:14px;width:100%;padding:14px 16px 14px 18px;border:1px solid #bcd2ca;border-radius:18px;background:var(--tint);text-align:left;cursor:pointer;transition:border-color .2s}
.how-band:hover{border-color:var(--green)}
.how-band .how-q{width:38px;height:38px;font-size:21px}
.hb-txt{flex:1;min-width:0}
.hb-txt b{display:block;font-size:17px;line-height:1.3;font-weight:600;letter-spacing:-0.01em;color:var(--ink)}
.hb-txt span{display:block;font-size:15px;line-height:1.35;color:#3f4a47;text-wrap:pretty}
.hb-go{flex:none;display:inline-flex;align-items:center;gap:8px;height:42px;padding:0 20px;border-radius:999px;background:var(--green);color:#fff;font-size:15px;font-weight:500;transition:background .2s}
.how-band:hover .hb-go{background:var(--green-h)}

/* ---------- the button ---------- */
.go{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}
.btn{display:inline-flex;align-items:center;justify-content:center;height:48px;padding:0 28px;border-radius:999px;background:var(--green);color:#fff;font-size:16px;font-weight:500;border:0;cursor:pointer;text-decoration:none;transition:background .2s}
.btn:hover{background:var(--green-h);text-decoration:none}
.go .btn{min-width:240px}
.go-note{font-size:15px;color:var(--ink2)}
.go-note.err{color:var(--red);font-weight:500}

/* after a size change the old prices fade until the button is pressed */
.stale-note{display:none;margin:0 0 12px;padding:10px 14px;border-radius:12px;background:#fff;border:1px solid var(--rline);font-size:15px;font-weight:500}
body.stale .stale-note{display:block}
#results,#detail{transition:opacity .25s}
body.stale #results,body.stale #detail{opacity:.38;pointer-events:none}

/* ---------- your results ---------- */
.step.results{background:var(--rpanel)}
.step.results .step-k{background:#fff;color:var(--green);box-shadow:inset 0 0 0 1px var(--green)}
.res-empty{background:#fff;border-radius:14px;padding:22px 16px;text-align:center;color:var(--ink2);font-size:15px}
.res-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.res{position:relative;min-width:0;border:1px solid var(--field);border-radius:14px;background:#fff;padding:14px 16px}
.res[role="radio"]{cursor:pointer;transition:border-color .2s,box-shadow .2s}
.res[role="radio"]:hover{border-color:#aeaeb2}
.res[aria-checked="true"]{border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green)}
.res-head{display:flex;align-items:center;gap:12px}
.res .thumb{width:44px;height:44px;border-radius:10px}
.res-name{font-weight:600;line-height:1.25}
.res-sub{font-size:15px;color:var(--ink2);line-height:1.3}
.res-low{margin-top:12px;font-size:15px;font-weight:600;color:var(--green);line-height:20px}
.res-low.off{visibility:hidden}
.res-gap{height:12px}
.res-total{font-size:30px;line-height:1.15;font-weight:600;letter-spacing:-0.02em;color:var(--green);font-variant-numeric:tabular-nums;white-space:nowrap}
.res-line{margin-top:1px;font-size:15px;color:var(--ink2);font-variant-numeric:tabular-nums}
.res-oos{margin-top:2px;font-size:15px;color:var(--amber)}
.res-pick{margin-top:10px;font-size:15px;font-weight:500;color:var(--green);display:flex;align-items:center;gap:6px}
.res[aria-checked="true"] .res-pick{font-weight:600}
.res-wait{font-size:17px;line-height:34px;font-weight:500;color:var(--ink2);animation:pulse 1.6s ease-in-out infinite}
.res-msg{margin-top:4px;font-size:15px;line-height:1.35;text-wrap:pretty}
.res-retry{display:inline-block;margin-top:6px;font-size:15px;font-weight:600}
.res-more{border:1.5px dashed var(--dash);border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center;color:var(--ink2);font-size:15px;padding:16px}
.res-more a{font-weight:500}
@keyframes pulse{50%{opacity:.45}}
#hResults:focus{outline:none}

/* the saving line on a card, and the line after a size change */
.res-save{margin-top:12px;padding-top:10px;border-top:1px solid var(--line);font-size:15px;font-variant-numeric:tabular-nums;text-wrap:pretty}
.res-save a{font-weight:600;white-space:nowrap}
.res-save b{font-weight:600;color:var(--green)}
.res-prob{margin-top:6px;font-size:15px;line-height:1.35;color:var(--ink2);text-wrap:pretty}
.applied{margin:0 0 10px;font-size:15px;background:#fff;border-radius:10px;padding:8px 12px;text-wrap:pretty}
.applied a{font-weight:600;margin-left:4px}
.fld input.flash{background-color:var(--tint)}

/* the chosen worktop: two plans when the engines disagree */
.plans{margin-bottom:14px}
.pills{display:flex;flex-wrap:wrap;gap:8px}
.pills button{height:38px;padding:0 16px;border:1px solid var(--rline);border-radius:999px;background:rgba(255,255,255,.6);font-size:15px;color:var(--ink2);cursor:pointer;font-variant-numeric:tabular-nums;white-space:nowrap;transition:background-color .2s,border-color .2s,color .2s}
.pills button:hover{color:var(--ink);background:#fff}
.pills button[aria-checked="true"]{background:#fff;border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green);color:var(--green);font-weight:600}
.plans-note{margin-top:8px;font-size:15px;color:var(--ink2);text-wrap:pretty}

/* the chosen worktop: boards to buy */
.detail{margin-top:16px}
.d-list h3,.cuts-h{margin:0 0 8px;font-size:18px;line-height:1.25;font-weight:600;letter-spacing:-0.01em}
.d-list h3 span{font-weight:400;color:var(--ink2)}
.boards{list-style:none;margin:0;padding:0;border-top:1px solid var(--rline)}
.boards li{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:8px 0;border-bottom:1px solid var(--rline)}
.b-name{font-weight:500}
.b-name a{color:inherit;text-decoration:underline;text-decoration-color:var(--dash);text-underline-offset:3px}
.b-name a:hover{text-decoration-color:currentColor}
.b-for{font-size:15px;color:var(--ink2)}
.b-oos{font-size:15px;color:var(--amber)}
.b-price{font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}
.probs li{align-items:center;padding:10px 0}
.probs p{text-wrap:pretty}
.btn-s{flex:none;height:40px;padding:0 18px;font-size:15px}

/* the two ways to buy */
.buy{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.buy-card{background:#fff;border-radius:14px;padding:16px 18px 18px}
.buy-card h4{margin:0;font-size:17px;line-height:1.3;font-weight:600;letter-spacing:-0.01em}
.buy-price{margin-top:2px;font-size:22px;line-height:1.25;font-weight:600;letter-spacing:-0.01em;color:var(--green);font-variant-numeric:tabular-nums}
.buy-price span{font-size:15px;font-weight:500;letter-spacing:0;color:var(--ink2)}
.nsteps{list-style:none;counter-reset:n;margin:10px 0 0;padding:0}
.nsteps li{counter-increment:n;position:relative;padding-left:22px;font-size:15px;line-height:1.35;text-wrap:pretty}
.nsteps li+li{margin-top:6px}
.nsteps li::before{content:counter(n) ".";position:absolute;left:0;top:0;font-size:14px;font-weight:600;color:var(--green);font-variant-numeric:tabular-nums}
.nsteps a,.buy-note a{font-weight:600}
.buy-note{margin-top:10px;font-size:15px;line-height:1.35;text-wrap:pretty}

/* "Send this to our sales team": the strip under the ways to buy, and its form on the sheet (the mock-up's) */
.talk{display:flex;align-items:center;justify-content:space-between;gap:12px 24px;margin-top:12px;background:rgba(255,255,255,.6);border-radius:14px;padding:12px 12px 12px 18px}
.talk p{font-size:15px;text-wrap:pretty}
.talk .btn{flex:none}
.sheet label.f{display:block;margin-top:10px;font-size:15px;font-weight:500}
.sheet label.f span{font-weight:400;color:var(--ink2)}
.sheet .tx{display:block;width:100%;height:44px;margin-top:4px;border:1px solid var(--field);border-radius:10px;padding:0 12px;font-size:16px;font-weight:400;background:#fff;outline:none;transition:border-color .2s,box-shadow .2s}
.sheet textarea.tx{height:64px;padding:10px 12px;resize:vertical;line-height:1.35}
.sheet .tx:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(9,59,50,.12)}
.sheet .tx.bad{border-color:var(--red);box-shadow:0 0 0 3px rgba(180,35,24,.12)}
.sum{margin-top:14px;background:var(--soft);border-radius:12px;padding:10px 14px;font-size:15px;font-variant-numeric:tabular-nums}
.sum span{display:block;color:var(--ink2)}
.sales-fine{margin-top:8px;font-size:13px;color:var(--ink2);text-wrap:pretty}
.sales-msg{margin-top:12px;font-size:15px;font-weight:500;color:var(--red);text-wrap:pretty}
.sheet-act .btn{min-width:120px}
.sheet-act .btn[aria-disabled="true"]{opacity:.6;cursor:default}
.hp{position:absolute;left:-10000px;top:0;width:1px;height:1px;overflow:hidden}
/* "Download PDF": the second call to action, an outline pill beside the solid green one */
.pdf-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-top:16px}
.btn-2{gap:8px;padding:0 24px;background:#fff;color:var(--green);border:1.5px solid var(--green)}
.btn-2:hover{background:var(--tint)}
.btn-2 svg{flex:none}
.btn-2[aria-disabled="true"],.btn-2[aria-disabled="true"]:hover{background:#fff;border-color:var(--field);color:var(--ink2);cursor:default}   /* busy: grey, not faded */
.pdf-note{font-size:15px;font-weight:500;color:var(--red)}
.pdf-note:empty{display:none}
.fine{margin-top:10px;font-size:15px;color:var(--ink2);text-wrap:pretty}

/* the cutting drawings */
.cuts{margin-top:16px}
.detail .cuts{margin-top:24px}
.legend{display:flex;flex-wrap:wrap;gap:6px 20px;font-size:15px;color:var(--ink2);margin-bottom:10px}
.sw{display:inline-block;width:18px;height:12px;border-radius:3px;vertical-align:-1px;margin-right:8px}
.sw-p{background:var(--tint);border:1px solid var(--green)}
.sw-o{border:1px solid #aeaeb2;background:repeating-linear-gradient(45deg,#f7f7f8 0 3px,#d2d2d7 3px 4px)}
.dcards{display:grid;grid-template-columns:repeat(var(--n,3),minmax(0,1fr));gap:12px}
.dcard{margin:0;background:#fff;border:1px solid transparent;border-radius:14px;padding:14px}
.draw{line-height:0;min-height:20px}
.draw svg{display:block;max-width:100%}
.dcap{margin-top:8px;font-size:15px;color:var(--ink2)}
.cutcost{margin-top:10px;font-size:15px;color:var(--ink2);text-wrap:pretty}

/* "See how": the sheet with the size advice */
.sheet-bg{position:fixed;inset:0;z-index:200;background:rgba(29,29,31,.32);display:flex;align-items:center;justify-content:center;padding:24px;opacity:0;transition:opacity .25s}
.sheet-bg.on{opacity:1}
.sheet{width:100%;max-width:460px;max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);overflow-y:auto;overscroll-behavior:contain;background:#fff;border-radius:20px;padding:24px 24px 22px;transform:translateY(12px);transition:transform .35s cubic-bezier(.2,.7,.2,1)}
.sheet:focus{outline:none}
.sheet-bg.on .sheet{transform:none}
.sheet h3{margin:0 0 14px;font-size:20px;line-height:1.25;font-weight:600;letter-spacing:-0.015em}
.sizes{display:flex;align-items:center;gap:14px;background:var(--soft);border-radius:14px;padding:14px 16px}
.sizes+.sizes{margin-top:8px}
.sizes>div{flex:1}
.sizes small,.new-tot small{display:block;font-size:15px;color:var(--ink2)}
.sizes strong{font-size:19px;font-weight:600;font-variant-numeric:tabular-nums}
.sizes svg{flex:none}
.new-tot{margin-top:14px}
.new-tot strong{display:block;font-size:30px;line-height:1.15;font-weight:600;letter-spacing:-0.02em;color:var(--green);font-variant-numeric:tabular-nums}
.new-tot span{font-size:15px;color:var(--ink2)}
.why{margin-top:10px;text-wrap:pretty}
.all{margin-top:4px;font-size:15px;color:var(--ink2)}
.sheet-act{display:flex;flex-wrap:wrap;align-items:center;gap:10px 28px;margin-top:16px;font-weight:500}
.sheet-act a:first-child{font-weight:600}

/* "How does this work?": the pop-up, on the same sheet (the mock-up's) */
.sheet.hw{max-width:780px;padding:20px 24px 0;scroll-padding:8px 0 92px}   /* the bottom space is the button row's own; a focused link stops above that row (84px) and its focus ring (8px) */
.hw-cols{display:grid;grid-template-columns:minmax(0,1fr) 316px;gap:28px;align-items:start;margin-top:16px}
.hw-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.sheet.hw h3{margin:0}
.hw-lead{margin-top:6px;font-size:16px;line-height:1.4;text-wrap:pretty}
.hw-steps{list-style:none;margin:0;padding:0;counter-reset:hw}
.hw-steps>li{position:relative;padding-left:40px;counter-increment:hw}
.hw-steps>li+li{margin-top:16px}
.hw-steps>li::before{content:counter(hw);position:absolute;left:0;top:0;width:28px;height:28px;border-radius:50%;background:var(--green);color:#fff;display:grid;place-items:center;font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}
.hw-steps h4{margin:0;font-size:17px;line-height:28px;font-weight:600;letter-spacing:-0.01em}
.hw-steps p{margin-top:1px;font-size:15px;line-height:1.4;text-wrap:pretty}
.hw-steps p+p{margin-top:8px}
.hw-steps p b{font-weight:600}
.hw-steps p a{font-weight:600}
/* the example drawing */
.hw-art{margin:0;background:var(--soft);border-radius:14px;padding:12px 14px 14px}
.hw-eg{font-size:15px;font-weight:600;color:var(--ink);margin-bottom:8px}
.hw-cap{font-size:14px;line-height:1.3;color:var(--ink2);margin-bottom:5px}
.hw-chips{display:flex;flex-wrap:wrap;gap:6px}
.hw-chips span{display:inline-flex;align-items:center;gap:8px;height:30px;padding:0 10px 0 8px;border-radius:8px;background:#fff;border:1px solid var(--field);font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}
.hw-chips b,.hw-board i{font-style:normal;font-weight:600;color:var(--green)}
.hw-arrow{display:flex;align-items:center;gap:8px;margin:8px 0 8px 2px;font-size:14px;font-weight:500;color:var(--green)}
.hw-board{display:flex;height:38px;border:1px solid #aeaeb2;border-radius:3px;overflow:hidden;background:repeating-linear-gradient(45deg,#f7f7f8 0 3px,#d2d2d7 3px 4px)}
.hw-board+.hw-cap{margin-top:10px}
.hw-board i,.hw-board u{min-width:0;display:flex;align-items:center;justify-content:center;font-size:15px;text-decoration:none;white-space:nowrap;overflow:hidden}
.hw-board i{background:var(--tint);box-shadow:inset 0 0 0 1px var(--green);border-right:2px solid #fff}
.hw-board u{font-size:14px;color:var(--ink2)}
.hw-board u span{background:#f7f7f8;border-radius:6px;padding:1px 6px}
.hw-art figcaption{margin-top:10px;font-size:14px;line-height:1.35;color:var(--ink2);text-wrap:pretty}
/* good to know */
.hw-notes{list-style:none;margin:16px 0 0;padding:12px 0 0;border-top:1px solid var(--line)}
.hw-notes li{position:relative;padding-left:22px;font-size:15px;line-height:1.4;color:var(--ink2);text-wrap:pretty}
.hw-notes li+li{margin-top:6px}
.hw-notes li svg{position:absolute;left:0;top:4px}
.hw-notes a{font-weight:600}
/* the button row sticks to the foot when the sheet scrolls; the line shows only while more is under it (app.js markMore) */
.sheet.hw .sheet-act{position:sticky;bottom:0;margin:4px -24px 0;padding:12px 24px 24px;background:#fff;transition:box-shadow .2s}
.sheet.hw.more .sheet-act{box-shadow:0 -1px 0 var(--line),0 -10px 16px -14px rgba(29,29,31,.28)}
.sheet.hw .sheet-act .btn{min-width:140px}

/* the photo viewer (photos.js), from the mock-up */
.ph{position:relative;width:100%;max-width:960px;max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);overflow-y:auto;background:#fff;border-radius:20px;padding:16px 24px 20px;transform:translateY(12px);transition:transform .35s cubic-bezier(.2,.7,.2,1)}
.sheet-bg.on .ph{transform:none}
.ph:focus{outline:none}
.ph-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:8px}
.ph-head h3{margin:0;font-size:20px;line-height:1.25;font-weight:600;letter-spacing:-0.015em}
.ph-x{flex:none;width:44px;height:44px;margin-right:-10px;padding:0;border:0;background:none;border-radius:50%;display:grid;place-items:center;cursor:pointer;color:var(--ink)}
.ph-x span{width:32px;height:32px;border-radius:50%;background:var(--soft);display:grid;place-items:center;transition:background-color .2s}
.ph-x:hover span{background:#e8e8ed}
.ph-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.ph-tabs button{height:34px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:15px;color:var(--ink2);cursor:pointer;font-variant-numeric:tabular-nums;transition:background-color .2s,border-color .2s,color .2s}
.ph-tabs button:hover{color:var(--ink)}
.ph-tabs button[aria-pressed="true"]{background:#f1f6f4;border-color:#f1f6f4;color:var(--green);font-weight:500}
.ph-stage{position:relative;height:clamp(240px,calc(100vh - 360px),60vh);background:var(--soft);border-radius:14px;overflow:hidden;touch-action:pan-y}
.ph-img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .25s}
.ph-img.on{opacity:1}
.ph-none{position:absolute;inset:0;display:grid;place-items:center;padding:24px;text-align:center;font-size:15px;color:var(--ink2)}
.ph-nav{position:absolute;top:50%;width:44px;height:44px;margin-top:-22px;padding:0;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);display:grid;place-items:center;cursor:pointer;transition:border-color .2s}
.ph-nav:hover{border-color:var(--dash)}
.ph-nav.prev{left:12px}
.ph-nav.next{right:12px}
.ph-count{margin-top:10px;text-align:center;font-size:15px;color:var(--ink2);font-variant-numeric:tabular-nums}
.ph-strip{position:relative;display:flex;gap:8px;margin-top:8px;padding:4px;overflow-x:auto;scrollbar-width:thin}
.ph-strip button{flex:none;width:56px;height:56px;padding:0;border:0;border-radius:10px;overflow:hidden;background:var(--soft);cursor:pointer}
.ph-strip button:first-child{margin-left:auto}
.ph-strip button:last-child{margin-right:auto}
.ph-strip button.gap{margin-left:10px}
.ph-strip button[aria-current="true"]{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--green)}
.ph-strip img{width:100%;height:100%;object-fit:cover;display:block;opacity:0;transition:opacity .2s}
.ph-strip img.ok{opacity:1}
.ph-foot{margin-top:10px;text-align:center;font-size:15px;font-weight:500}

/* the PDF sheet (pdf.js): on the page but clear while html2canvas draws it */
.pdf-sheet{position:absolute;left:0;top:0;z-index:-1;width:760px;padding:28px 32px;background:#fff;opacity:0;pointer-events:none}
.pdf-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.pdf-logo svg{display:block;width:96px;height:auto}
.pdf-date{font-size:15px;color:var(--ink2)}
.pdf-sheet h1{margin:0;font-size:24px;line-height:1.2;font-weight:600;letter-spacing:-0.02em}
.pdf-sub{font-size:15px;color:var(--ink2)}
.pdf-sheet h2{margin:20px 0 8px;font-size:17px;line-height:1.25;font-weight:600}
.pdf-pieces{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px 28px;font-size:15px;font-variant-numeric:tabular-nums}
.pdf-pieces b{font-weight:600;margin-right:8px}
.pdf-sheet .boards,.pdf-sheet .boards li{border-color:var(--line)}
.pdf-tots{display:flex;gap:12px;margin-top:14px}
.pdf-tots div{flex:1;background:var(--soft);border-radius:12px;padding:10px 14px}
.pdf-tots span{display:block;font-size:15px;font-weight:600}
.pdf-tots strong{font-size:20px;font-weight:600;color:var(--green);font-variant-numeric:tabular-nums}
.pdf-tots small{font-size:14px;font-weight:500;color:var(--ink2)}
.pdf-draws{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.pdf-draws figure{margin:0}
.pdf-draws svg{display:block}
.pdf-draws figcaption{margin-top:6px;font-size:14px;color:var(--ink2)}
.pdf-fine{margin-top:10px;font-size:14px;color:var(--ink2)}

.fade{animation:fadeUp .5s cubic-bezier(.2,.7,.2,1) both}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.fade,.res-wait{animation:none}.sheet-bg,.sheet,.ph,.ph-img,.ph-strip img,.slot-pic img{transition:none}}

/* ---------- help line and footer ---------- */
.help{margin:28px auto 0;padding:0 24px;text-align:center;font-size:15px;color:var(--ink2)}
/* ---------- upstands and splashbacks (upstands.js) ---------- */
.help.ups-line{margin-top:6px}
.ups{margin-top:14px}
#hUps:focus{outline:none}
.ups-pick{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 20px;margin-bottom:12px}
.ups-f{display:flex;flex-direction:column;gap:5px;min-width:0;max-width:100%}
.ups-f>span{font-size:15px;color:var(--ink2);line-height:1.2}
.ups-f select{width:340px;max-width:100%;height:44px;border:1px solid var(--field);border-radius:10px;padding:0 36px 0 12px;font-size:16px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5l4 4 4-4' fill='none' stroke='%23093b32' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;-webkit-appearance:none;appearance:none;cursor:pointer}
.ups-f .seg{padding:3px}
.ups-f .seg button{height:36px;padding:0 14px}
.seg button[disabled]{color:var(--dash);cursor:default}
.ups-dim{margin:-2px 0 12px;font-size:15px;color:var(--ink2);text-wrap:pretty}
.uhead,.urow{display:grid;grid-template-columns:20px minmax(0,1fr) 112px 36px;column-gap:10px;align-items:center}
.uhead{font-size:15px;color:var(--ink2);margin-bottom:5px;line-height:1.2}
.uhead .h-l{grid-column:2}.uhead .h-q{grid-column:3}
.urow>*{grid-area:auto}
.urow+.urow{margin-top:8px}
.ups-links{display:flex;flex-wrap:wrap;gap:6px 20px;margin-top:9px;font-weight:500}
.ups .go{margin-top:16px}
.ups-deep{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin-top:12px;padding:12px 14px;border-radius:12px;background:#fff;font-size:15px}
.ups-out{margin-top:18px;transition:opacity .25s}
.ups-out.stale{opacity:.38;pointer-events:none}
.ups .boards,.ups .boards li{border-color:var(--pline)}
.ubars{display:flex;flex-direction:column;gap:10px}
.ubar{margin:0;background:#fff;border-radius:14px;padding:14px}
.ubar-track{display:flex;height:34px;border:1px solid #aeaeb2;border-radius:3px;overflow:hidden;background:repeating-linear-gradient(45deg,#f7f7f8 0 3px,#d2d2d7 3px 4px)}
.useg,.uoff{min-width:0;display:flex;align-items:center;justify-content:center;padding:0 4px;font-size:14px;white-space:nowrap;overflow:hidden;font-variant-numeric:tabular-nums}
.useg{background:var(--tint);box-shadow:inset 0 0 0 1px var(--green);border-right:2px solid #fff;color:var(--green);font-weight:600}
.uoff{color:var(--ink2)}
.uoff b{font-weight:400;background:#f7f7f8;border-radius:6px;padding:1px 6px}

footer{margin-top:18px;border-top:1px solid var(--line);padding:16px 24px 28px;text-align:center;font-size:13px;color:var(--ink2)}
footer p{margin:2px auto;max-width:900px;text-wrap:pretty}
footer .ver{margin-top:8px;font-size:11px;color:#aeaeb2}
/* the counting notice (track.js fills it and shows it) */
footer .count{margin-bottom:8px;font-size:12px}
footer .count a{color:inherit;text-decoration:underline;text-underline-offset:2px;white-space:nowrap}

/* ---------- narrower screens ---------- */
/* up to an upright tablet (iPad mini 744, iPad 768, 810, 820): the Length and Width drawing goes under the rows,
   so the size boxes have room for the number and its "mm" */
@media (max-width:820px){
  .sizes-body{display:block}
  .guide{margin-top:12px}
}
@media (max-width:760px){
  .hw-cols{grid-template-columns:minmax(0,1fr);gap:16px}
  .how-band{flex-wrap:wrap}
}
@media (max-width:720px){
  .slots,.res-grid{grid-template-columns:minmax(0,1fr)}
  /* stacked, one empty "Add a worktop" box at a time: the worktops picked, then the first empty box
     (the pick list always opens there). A browser without :has() drops this rule and shows all three. */
  .slot-wrap:has(>.slot.empty)~.slot-wrap:has(>.slot.empty){display:none}
  .res-more{grid-column:auto!important}
  .res-low.off{display:none}
  .buy{grid-template-columns:minmax(0,1fr)}
  .talk{flex-direction:column;align-items:stretch;padding:14px}
  .talk .btn{width:100%}
  .pdf-row .btn-2{width:100%}
  .probs li{flex-direction:column;align-items:flex-start;gap:8px}
}
@media (max-width:600px){
  .wrap,.help{padding-left:16px;padding-right:16px}
  footer{padding-left:16px;padding-right:16px}
  .head-links{gap:16px}
  .title h1{font-size:23px}
  .step{padding:14px 12px 16px}
  /* Step 2 on a phone: the unit goes in the column heads, so the whole number fits in its box,
     and the minus, plus and remove buttons are 32 wide. The boxes keep "in mm" for screen readers. */
  .phead,.prow{grid-template-columns:14px minmax(0,1fr) minmax(0,1fr) 86px 32px;column-gap:6px}
  .phead{align-items:end}
  .phead .h-l::after,.phead .h-w::after{content:" (mm)"}
  .stp button{width:32px;height:44px}   /* over the box's 1px border: 44 high */
  .rm{width:32px}
  .fld input{padding:0 32px 0 10px}
  .fld i{right:9px}
  #pieces .fld input{padding:0 8px}
  #pieces .fld i{display:none}
  #pieces .fld input{text-overflow:ellipsis}   /* a number that does not fit ends in "...", so it looks cut */
  /* "Add a piece" and the upstands panel's "Add a length": a 44px high tap area, the words where they were.
     It starts 2px above the words, 7px clear of the size boxes (a phone pulls a tap toward a near link),
     and makes up the height downward. "Clear" empties every length, so it keeps its own small size. */
  .add,.ups-links [data-act=uadd]{position:relative}
  .add::after,.ups-links [data-act=uadd]::after{content:"";position:absolute;left:-8px;right:-8px;top:-2px;bottom:-19.6px}
  /* the thickness buttons: 36px high, apart, each with its own edge */
  .thk-row{gap:6px 8px}
  .thk-row .seg{gap:6px;padding:0;border:0;border-radius:0;background:none}
  .thk-row .seg button{height:36px;padding:0 8px;border:1px solid var(--field);border-radius:9px;background:#fff}
  .thk-row .seg button[aria-checked="true"]{background:var(--tint);border-color:var(--green)}
  .res-total{font-size:28px}
  .dcards{grid-template-columns:minmax(0,1fr)!important}
  .sheet-bg{align-items:flex-end;padding:0}
  .sheet{border-radius:20px 20px 0 0;padding:22px 18px 26px;max-height:100vh;max-height:100dvh}
  .sheet.hw{padding:18px 18px 0;scroll-padding-bottom:94px}   /* the row is 86px here */
  .sheet.hw .sheet-act{margin:4px -18px 0;padding:12px 18px 26px}
  .hb-go{flex:1 1 100%;justify-content:center}   /* "Show me how" on its own line, full width */
  /* the band, shorter: the round "?", "How does this work?" and the pill; its second line goes
     (the button's name is then "How does this work? Show me how") */
  .how-band{gap:8px 12px;padding:12px 14px}
  .how-band .how-q{width:34px;height:34px;font-size:19px}
  .hb-txt span{display:none}
  /* "Show my prices" and "Update my prices", here and in the upstands panel: full width, the note under it */
  .go .btn{width:100%}
  /* links in a line of text: a 40px high tap area from padding, which does not change the line, so no word moves;
     position lifts the padding over the lines next to it, which would otherwise take the taps */
  .res-save a,.applied a,.nsteps a,.buy-note a,.b-name a,.fine a,.hw-steps p a,.hw-notes a{position:relative;padding:12px 0}
  .res-save a{padding-bottom:2px}   /* "See how": 13px clear of the card's "Choose this worktop" under it */
  .nsteps a{z-index:1}   /* each step's line is itself lifted (its number), and the next one would take the bottom of the area */
  /* links on a line of their own: the same from an invisible layer over them */
  .slot-ph,.res-more a,.res-retry{position:relative}
  .slot-ph::after{content:"";position:absolute;left:-6px;right:-6px;top:-20.5px;bottom:0}   /* nothing below the words: the thickness buttons are 8px under them */
  .res-more a::after,.res-retry::after{content:"";position:absolute;left:-10px;right:-10px;top:-10px;bottom:-10px}
  .uhead,.urow{grid-template-columns:14px minmax(0,1fr) 86px 32px;column-gap:6px}
  .ups-f,.ups-f select{width:100%}
  .sizes{flex-direction:column;align-items:flex-start;gap:8px}
  .sizes svg{transform:rotate(90deg)}
}
@media (max-width:640px){
  .ph-bg{align-items:flex-end;padding:0}
  .ph{max-width:none;max-height:100vh;max-height:100dvh;border-radius:20px 20px 0 0;padding:12px 16px 22px}
  .ph-stage{height:44vh}
  .ph-nav.prev{left:8px}
  .ph-nav.next{right:8px}
}
/* the smallest phones (320 wide, or 390 zoomed to 130%): tighter gaps between the boxes, so a 4 digit
   length still fits; the minus and the cross keep 6px from their neighbours (2px margins in wider columns) */
@media (max-width:359px){
  .phead,.prow{grid-template-columns:12px minmax(0,1fr) minmax(0,1fr) 88px 34px;column-gap:4px}
  .prow .stp{margin-left:2px}
  .prow .rm{justify-self:end}
  #pieces .fld input{padding:0 4px}
  /* the upstands panel: here the last row's minus sits right over the end of "Clear", and a phone pulls a tap
     beside a link onto it; "Clear" empties every length, so it goes on its own line under "Add a length",
     far from the minus, with room for the "Add a length" tap area above it */
  .ups-links{flex-direction:column;align-items:flex-start;gap:26px}
}

/* print: the page as it is, without a sheet over it (app.js lets the page go on beforeprint too) */
@media print{.sheet-bg{display:none!important}body{position:static!important;top:auto!important;padding-right:0!important}}
