/* Cut-to-length calculator on the product page. Everything is scoped to the form so the theme is not affected. */
#cut-stage-form.dynamic-cut-proof{--accent:#c22128;--ink:#303030;--line:#dedede;--bad:#982127;font:16px/1.5 Arial,Helvetica,sans-serif;color:var(--ink);max-width:none;margin:0;padding:16px 0;border-top:1px solid var(--line);text-align:left}
#cut-stage-form.dynamic-cut-proof *{box-sizing:border-box}
#cut-stage-form.dynamic-cut-proof h3{font-size:20px;line-height:1.25;margin:0 0 14px;font-weight:bold}
#cut-stage-form.dynamic-cut-proof p{margin:8px 0 14px}
#cut-stage-form.dynamic-cut-proof .muted{color:#616161;font-size:14px}
/* The rules, stated before the lengths are entered: a quiet box with a short list. The list is styled here in full,
   because themes give lists their own bullets, floats and paddings. */
#cut-stage-form.dynamic-cut-proof .rules{background:#f6f6f6;border-left:4px solid var(--accent);padding:12px 14px;margin:0 0 16px;font-size:14px;line-height:1.45}
#cut-stage-form.dynamic-cut-proof .rules strong{display:block;font-size:15px;margin:0 0 6px}
#cut-stage-form.dynamic-cut-proof .rules ul{margin:0;padding:0 0 0 18px;list-style:disc outside}
#cut-stage-form.dynamic-cut-proof .rules li{display:list-item;margin:0 0 4px;padding:0;list-style:disc outside;float:none;width:auto;overflow-wrap:anywhere}
#cut-stage-form.dynamic-cut-proof .rules li::before{content:none}
#cut-stage-form.dynamic-cut-proof .rules li:last-child{margin-bottom:0}
/* The weight of the list, under its price: what the delivery charge is worked out from. */
#cut-stage-form.dynamic-cut-proof .quote .weight{font-size:14px;color:#444;margin:10px 0 0}
#cut-stage-form.dynamic-cut-proof .quote .weight[hidden]{display:none}
/* The theme's own .row (negative margins and clearing pseudo-elements) must not leak into the grid. */
/* Length, quantity and Remove share one line, also on a phone: a cut list of several lengths stays short. */
#cut-stage-form.dynamic-cut-proof #rows .row{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) auto;gap:10px;align-items:end;margin:0 0 8px;padding:0;float:none;width:auto;scroll-margin:140px 0 16px}
#cut-stage-form.dynamic-cut-proof #rows .row::before,#cut-stage-form.dynamic-cut-proof #rows .row::after{content:none;display:none}
#cut-stage-form.dynamic-cut-proof label{display:block;font-size:14px;font-weight:bold;margin:0;float:none;width:auto;text-align:left}
/* 16px in the fields: an iPhone zooms the whole page when a field with smaller text is tapped. */
#cut-stage-form.dynamic-cut-proof input[type=number]{display:block;width:100%;min-width:0;padding:11px;border:1px solid #aaa;font:inherit;font-size:16px;border-radius:3px;min-height:46px;height:auto;background:#fff;color:var(--ink)}
#cut-stage-form.dynamic-cut-proof input[aria-invalid=true]{border-color:var(--bad);box-shadow:inset 0 0 0 1px var(--bad)}
#cut-stage-form.dynamic-cut-proof button{font:inherit;border:1px solid #aaa;border-radius:3px;background:#fff;color:var(--ink);min-height:46px;padding:10px 14px;cursor:pointer;width:auto;text-transform:none}
#cut-stage-form.dynamic-cut-proof button:disabled{cursor:not-allowed;color:#666;background:#eee;border-color:#aaa}
#cut-stage-form.dynamic-cut-proof .add{margin:4px 0 18px}
#cut-stage-form.dynamic-cut-proof fieldset{border:0;padding:0;margin:0 0 20px;min-width:0}
#cut-stage-form.dynamic-cut-proof legend{font-weight:bold;font-size:16px;margin:0 0 8px;border:0;width:auto;padding:0}
#cut-stage-form.dynamic-cut-proof .choice{border:1px solid var(--line);padding:12px;margin:8px 0;display:flex;align-items:flex-start;gap:10px;font-weight:normal;cursor:pointer}
#cut-stage-form.dynamic-cut-proof .choice input{accent-color:var(--accent);width:18px;height:18px;margin:3px 0 0;flex:none;position:static}
#cut-stage-form.dynamic-cut-proof .choice small{display:block;font-size:13px;color:#616161}
#cut-stage-form.dynamic-cut-proof .choice:has(input:checked){border-color:var(--accent);background:#fff7f7}
#cut-stage-form.dynamic-cut-proof :focus-visible{outline:3px solid var(--bad);outline-offset:3px}
/* What has to be corrected. The page script puts it in the row concerned, under the offcut question, or under Calculate,
   and scrolls it onto the screen; the top margin (here and on the rows) keeps it clear of the theme's header, which stays on screen. */
#cut-stage-form.dynamic-cut-proof .problem{margin:10px 0 0;padding:10px 12px;background:#fdf3f3;border-left:4px solid var(--bad);color:#7a1a1f;font-size:15px;font-weight:bold;scroll-margin:140px 0 16px}
#cut-stage-form.dynamic-cut-proof #rows .row .problem{grid-column:1/-1;margin:0}
#cut-stage-form.dynamic-cut-proof .quote{background:#f6f6f6;border:1px solid var(--line);padding:18px;margin:18px 0}
/* The figures keep to one line; the wording beside them wraps when the screen is narrow. */
#cut-stage-form.dynamic-cut-proof dl{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 0;margin:0}
#cut-stage-form.dynamic-cut-proof dt{overflow-wrap:anywhere;font-weight:normal;float:none;width:auto;text-align:left;padding-right:12px}
#cut-stage-form.dynamic-cut-proof dd{margin:0;text-align:right;white-space:nowrap}
#cut-stage-form.dynamic-cut-proof .total{font-size:20px;font-weight:bold;border-top:1px solid #ccc;padding-top:12px;margin-top:8px}
#cut-stage-form.dynamic-cut-proof .primary{background:var(--accent);color:#fff;border-color:var(--accent)}
#cut-stage-form.dynamic-cut-proof .primary:disabled{background:#eee;color:#666;border-color:#aaa}
#cut-stage-form.dynamic-cut-proof .full{width:100%}
#cut-stage-form.dynamic-cut-proof .quote .status{font-size:13px;color:#616161;margin:10px 0 0;min-height:1.4em}
#cut-stage-form.dynamic-cut-proof .quote .status.ok{font-size:15px;font-weight:bold;color:#1d5a23}
#cut-stage-form.dynamic-cut-proof .quote .status.bad{font-size:15px;font-weight:bold;color:#7a1a1f}
/* After Calculate the page script scrolls the basket button onto the screen when it is not there. The margin keeps it off the edge;
   the script makes the lower margin larger when the shop has buttons floating over that corner of the screen. */
#cut-stage-form.dynamic-cut-proof #put-cut{scroll-margin:20px}
/* "View basket" appears after a cut list was added: a full-width button, easy to hit with a thumb. */
#cut-stage-form.dynamic-cut-proof #stage-basket-link{display:block;padding:10px 14px;min-height:46px;border:1px solid var(--accent);border-radius:3px;background:#fff;color:var(--accent);font-weight:bold;text-align:center;text-decoration:none;scroll-margin:20px}
#cut-stage-form.dynamic-cut-proof #stage-basket-link[hidden]{display:none}
/* After "Reorder" the page scrolls to the form; the margin keeps its title clear of a sticky header. */
#cut-stage-form.dynamic-cut-proof{scroll-margin-top:140px}
#cut-stage-form.dynamic-cut-proof .again{padding:10px 12px;margin:0 0 14px;background:#f2f7f1;border-left:4px solid #2e6b34;font-size:14px}
.dynamic-cut-unavailable{padding:12px 16px;background:#fff6e8;border-left:4px solid #986516;margin:12px 0}
@media(max-width:720px){
#cut-stage-form.dynamic-cut-proof #rows .row{gap:8px}
#cut-stage-form.dynamic-cut-proof .remove{padding:10px 12px}
#cut-stage-form.dynamic-cut-proof .quote{padding:14px}
}
/* Narrower than any current phone (320px still gets the one-line row): Remove goes under its row, and the figures may wrap. */
@media(max-width:299px){
#cut-stage-form.dynamic-cut-proof #rows .row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
#cut-stage-form.dynamic-cut-proof .remove{grid-column:1/-1;justify-self:start}
#cut-stage-form.dynamic-cut-proof dl{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
#cut-stage-form.dynamic-cut-proof dd{white-space:normal;overflow-wrap:anywhere}
}
