/* Tech Pack builder v2 (2026-10-31), /tech-pack/build/. Loads after tp-build.css and tp-pack-ask.css, which stay as they are
   (live and cached), and uses their tokens. Every rule is scoped under .tpb.
   Parts: the Pantone finder link, the two-tone panel rows that open swatches, the fabric step's material chips, the
   artwork's "Keep proportions" lock with its height field and side handles, and the Fit step's drawing from the numbers
   (the focused row, its line on the drawing, the first fit's outline, and on phones the drawing that stays on screen). */

/* ---------- color: the Pantone finder link sits under the code field ---------- */
.tpb .pms-find{margin-top:-4px}
/* it opens a new tab: an arrow for the eye (the words are for screen readers) */
.tpb .pms-find .nt{display:inline-block;margin-left:3px;font-size:12px;text-decoration:none}

/* ---------- two-tone panels: each row is a button; the open one shows the swatches under it ---------- */
.tpb .prows{border-top:1px solid var(--line)}
.tpb .prow2{border-bottom:1px solid var(--line)}
.tpb .prow-b{width:100%;min-height:48px;display:grid;grid-template-columns:minmax(0,1fr) auto 14px;gap:10px;align-items:center;
  padding:8px 2px;border:0;background:transparent;text-align:left;font-size:14px;color:var(--ink);border-radius:var(--r-s)}
.tpb .prow-b:hover{background:var(--mist)}
.tpb .prow-b .nm{min-width:0}
.tpb .prow-b .val{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);min-width:0}
.tpb .prow-b .vt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px}
.tpb .prow-b .c{width:24px;height:24px;border-radius:7px;border:1px solid rgba(0,0,0,.14);flex:none}
.tpb .prow-b .chev{width:8px;height:8px;border-right:2px solid var(--ink);border-bottom:2px solid var(--ink);transform:rotate(45deg);
  margin:-4px auto 0;transition:transform .2s}
.tpb .prow-b[aria-expanded="true"] .chev{transform:rotate(-135deg);margin-top:4px}
.tpb .prow-b[aria-expanded="true"] .nm{font-weight:700}
.tpb .pnl{padding:6px 2px 16px}
.tpb .pnl .sws{grid-template-columns:repeat(auto-fill,minmax(58px,1fr));gap:10px 8px}
.tpb .pnl .swb .c{width:42px;height:42px;border-radius:10px}
.tpb .pnl .swb.custom .c::after{inset:13px}
/* "Same as body": the body color with a line through it, so it reads as "no color of its own" */
.tpb .pnl .swb.same .c{overflow:hidden}
.tpb .pnl .swb.same .c::after{content:"";position:absolute;left:-4px;right:-4px;top:50%;height:2px;background:var(--orange-ui);transform:rotate(-45deg)}

/* ---------- fabric: material chips above the weight cards ---------- */
.tpb .chips.mats{margin-top:6px}
.tpb .chips.mats .chip{padding:8px 14px;min-height:40px}

/* ---------- artwork: the lock, a fourth field, the stretched image and the side handles ---------- */
.tpb .checkbox.lock{align-items:center;font-weight:700;color:var(--ink)}
.tpb .checkbox.lock input{margin-top:0}
/* embroidery: the lock stays on (up to 12 cm wide, the height in proportion), with its note under it */
.tpb .checkbox.lock input:disabled{cursor:not-allowed}
.tpb .checkbox.lock:has(input:disabled){color:var(--muted)}
.tpb .fine.lock-note{margin-top:-6px}
.tpb .nums.nums--4{grid-template-columns:repeat(4,minmax(0,1fr))}
.tpb .fine.stretch{margin-top:-4px}
.tpb .art.free img{object-fit:fill}
.tpb .art .h.n,.tpb .art .h.s{left:50%;width:20px;height:10px;margin-left:-10px;border-radius:999px;cursor:ns-resize}
.tpb .art .h.n{top:-5px}
.tpb .art .h.s{bottom:-5px}
.tpb .art .h.e,.tpb .art .h.w{top:50%;width:10px;height:20px;margin-top:-10px;border-radius:999px;cursor:ew-resize}
.tpb .art .h.e{right:-5px}
.tpb .art .h.w{left:-5px}
/* touch screens: a larger, invisible hit area round each side handle, reaching mostly outward so the middle of a small artwork
   still drags it; the handle looks the same */
@media (any-pointer:coarse){
  .tpb .art .h.n::before,.tpb .art .h.e::before,.tpb .art .h.s::before,.tpb .art .h.w::before{content:"";position:absolute;inset:-12px}
  .tpb .art .h.n::before{bottom:-3px}
  .tpb .art .h.s::before{top:-3px}
  .tpb .art .h.e::before{left:-3px}
  .tpb .art .h.w::before{right:-3px}
  /* the corners stay on top of those areas, so a short artwork keeps its corner resize */
  .tpb .art .h.nw,.tpb .art .h.ne,.tpb .art .h.sw,.tpb .art .h.se{z-index:1}
}

/* ---------- fit: the drawing from the numbers. The focused row has an orange bar; its line and value show on the drawing ---------- */
/* the bar sits in the card's padding, so the focused row's content never moves */
.tpb .mrow{position:relative}
.tpb .mrow.on::before{content:"";position:absolute;left:-12px;top:0;bottom:0;width:3px;background:var(--orange)}
.tpb .mrow .cl{grid-column:1/-1;margin:0;font-size:12.5px;line-height:1.4;color:var(--orange-ink);font-weight:700}
.tpb .mrow .cl:empty{display:none}
.tpb .mrow .cl.soft{color:var(--muted);font-weight:400}
/* the line sits in its own layer over the placed artwork; the artwork fades while the visitor measures */
.tpb .flatbox svg.dimtop{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.tpb .ed.fitpin .art{opacity:.4}
.tpb .flat .ghost{stroke:var(--orange-ui);opacity:.55}
.tpb .flat .scale{stroke:var(--faint)}
.tpb .flat .scale-t{fill:var(--muted)}
/* the first fit's outline: a toggle beside Front and Back, and its key in the caption */
.tpb .cmp{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--paper);border-radius:999px;padding:5px 12px 5px 10px;
  font-size:13px;font-weight:700;color:var(--muted);min-height:34px}
.tpb .cmp[aria-pressed="true"]{color:var(--ink);border-color:var(--stone)}
.tpb .cmp .ln{width:22px;height:0;border-top:2px dashed var(--orange-ui);opacity:.7}
.tpb .cmp[aria-pressed="false"] .ln{opacity:.25}
.tpb .stage__cap .lg{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.tpb .stage__cap .lg i{width:18px;border-top:2px dashed var(--orange-ui);opacity:.7}

/* laptops: the price box stays beside the color chips (never on a row of its own); on the Fit step, where the fit does not change the
   price, its fine print steps aside, and on a short screen the caption and the box too, so the drawing gets the height */
@media (min-width:821px){
  .tpb .stage__foot .price{flex:1 1 280px;max-width:460px;margin-left:auto}
  .tpb .ed.fitpin .price .basis,.tpb .ed.fitpin .price .lt{display:none}
}
@media (min-width:821px) and (max-height:820px){
  .tpb .ed.fitpin .stage__cap,.tpb .ed.fitpin .stage__foot .price{display:none}
}
@media (min-width:1600px){
  .tpb .flatbox{width:min(100%,760px,calc((100cqh - 4px) * var(--arn,1.2)))}
}

@media (max-width:820px){
  /* phones. .pin: the drawing stays under the editor's bar (the Fit step while its measurement rows are on screen, the Color step
     while a two-tone row is open), and the tabs stop sticking so they don't slide under it. On the Fit step the sizes hang on
     .fitpin, so pinning there changes position only and scrolling never moves the rows. On the Color step pinning also makes the
     drawing smaller (26vh, no caption, colors or price); the script keeps the row that opened or closed where it was (keepRow) */
  .tpb .ed.pin .stage{position:sticky;top:calc(env(safe-area-inset-top,0px) + 61px);z-index:16;border-bottom:1px solid var(--line)}
  .tpb .ed.pin .tabs{position:static}
  .tpb .ed.fitpin .fig{height:34vh;min-height:200px}
  .tpb .ed.fitpin.typing .fig{height:22vh;min-height:150px}
  .tpb .ed.pin:not(.fitpin) .fig{height:26vh;min-height:170px}
  .tpb .ed.fitpin .stage__cap,.tpb .ed.fitpin .stage__foot,.tpb .ed.pin .stage__cap,.tpb .ed.pin .stage__foot{display:none}
  /* a field the keyboard moves to scrolls clear of the pinned drawing */
  .tpb .ed.fitpin .mrow{scroll-margin-top:calc(env(safe-area-inset-top,0px) + 61px + 34vh + 70px)}
  /* one control row on the drawing: the outline toggle shrinks to its dashed key and keeps its name as aria-label */
  .tpb .ed.fitpin .stage__top,.tpb .ed.pin .stage__top{flex-wrap:nowrap;gap:6px;padding:8px 12px 0}
  .tpb .ed.fitpin .cmp{padding:0 10px;min-width:44px;justify-content:center}
  .tpb .ed.fitpin .cmp #eCmpT{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .tpb .ed.fitpin .stage__top .seg button{padding-inline:11px}
}
/* touch: the new controls are 44 px tall */
@media (any-pointer:coarse){
  .tpb .chips.mats .chip,.tpb .cmp,.tpb #ePanel .seg button{min-height:44px}
  .tpb .stage__top .seg button{min-height:44px}
  .tpb .checkbox.lock{min-height:44px}
  .tpb .pms-find a{display:inline-flex;align-items:center;min-height:44px}
  .tpb .mrow input{min-height:44px}
}
@media (max-width:420px){
  .tpb .nums.nums--4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tpb .prow-b .vt{max-width:110px}
}

/* ---------- fabric swatches (sw-*, about 176 x 102 px): near their own size, as a swatch on the card, never stretched to the
   4:3 box, which blew them up 2.8-3.2x on 2x and 3x screens; the caption sits under the swatch, not over it ---------- */
.tpb .card .ph:has(> img[src*="/sw-"]){background:var(--mist);grid-template-rows:minmax(0,1fr) auto;place-items:center;row-gap:5px;padding:12px 8px 7px}
.tpb .card .ph:has(> img[src*="/sw-"]) > img{position:static;width:clamp(100px,82%,150px);height:auto;max-height:100%;aspect-ratio:176/102;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.08),0 1px 3px rgba(0,0,0,.16);filter:saturate(.4)}
.tpb .card .ph:has(> img[src*="/sw-"]) .cap{background:none;padding:0;text-align:center;color:var(--muted);line-height:1.25}
@media (max-width:420px){
  .tpb .card .ph:has(> img[src*="/sw-"]){padding:8px 6px 6px}
  .tpb .card .ph:has(> img[src*="/sw-"]) > img{width:min(100px,80%)}
}
/* photo captions and the card tag at the 11 px floor (tp-build.css:229 and :235 set 10.5 px) */
.tpb .card .ph .cap,.tpb .card .tag{font-size:11px}
/* label and care cards without a photo: a line drawing in the builder's flat style, so the tile never reads as a missing image */
.tpb .card[data-label="ours"] .ph:not(:has(img)){background:var(--mist) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 120'%3E%3Cg transform='translate(0 15)'%3E%3Cg fill='none' stroke='%231d1d1f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 44 48 20q32 34 64 0l42 24'/%3E%3Cpath d='M56 20q24 26 48 0'/%3E%3C/g%3E%3Crect x='64' y='50' width='32' height='20' rx='2' fill='%23fff' stroke='%23e55605' stroke-width='1.6' stroke-dasharray='4 3'/%3E%3Cpath d='M71 58h18M74 63h12' stroke='%23e55605' stroke-width='1.6' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E") center/78% auto no-repeat}
.tpb .card[data-care="none"] .ph:not(:has(img)){background:var(--mist) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 120'%3E%3Crect x='62' y='22' width='36' height='76' rx='2' fill='none' stroke='%239a9a96' stroke-width='1.6' stroke-dasharray='4 3'/%3E%3C/svg%3E") center/78% auto no-repeat}

/* ---------- review: "Get your pack" (pack download, 2026-10-31): the email, "Email me the link" with the answer under it, "or",
   WhatsApp. With the mailbox not set up, WhatsApp alone (solid). The buttons take the card's width ---------- */
.tpb .dl .pill{width:100%;white-space:normal;text-align:center}
.tpb .dl .pill svg{flex:none}
.tpb .dl .fld input{font-size:16px}
.tpb .dl-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px}
.tpb .dl-or::before,.tpb .dl-or::after{content:"";flex:1 1 0;height:1px;background:var(--line)}
/* the answer, under the button: a status line that is always there, so a screen reader hears each new one; empty, it takes no room */
.tpb .dl-msg{display:flex;gap:10px;align-items:flex-start;margin:0;background:var(--wash);border-radius:var(--r-s);padding:12px 14px;font-size:14px;line-height:1.45;color:var(--text);overflow-wrap:anywhere}
.tpb .dl-msg:empty{padding:0;background:none;margin-top:-12px} /* no second gap under the button while it is empty */
.tpb .dl-msg svg{flex:none;margin-top:1px;color:var(--orange-ink)}
.tpb .dl-msg b{color:var(--ink)}
/* phones: a field focused for the answer lands clear of the editor's bar (61 px) and its tabs (50 px), with 16 px of air (gate C M5) */
@media (max-width:820px){.tpb .dl .fld input{scroll-margin-top:calc(env(safe-area-inset-top,0px) + 127px)}}
/* the contact row: each label beside its value, and "Copy the pack summary" on its own line, 44 px on touch (gate C M6) */
.tpb .dl .copy{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 10px;align-items:center;justify-items:start}
.tpb .dl .copy .linkbtn{grid-column:1/-1}
@media (any-pointer:coarse){.tpb .dl .copy .linkbtn{min-height:44px}}
/* the pack page's copy has no images: an uploaded file's sheet names it, then says it is not in that copy. A long file name breaks
   anywhere rather than push the sheet wider than a phone */
.tpb .sheet .nofile{display:block;margin-top:2px}
.tpb .sheet .kv dd{overflow-wrap:anywhere}
