/* Master-Cuts board builder */
.b-intro { padding-top: clamp(40px, 5vw, 64px); padding-bottom: 32px; }
.b-intro .display { font-size: clamp(40px, 5vw, 64px); }
.b-intro .lede { max-width: 640px; }

.builder { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px; padding-bottom: clamp(64px, 8vw, 112px); }
.b-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.b-side { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.b-block { display: flex; flex-direction: column; gap: 16px; }
.b-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; }
.b-head p { font-size: 15px; color: var(--muted); }

/* Preview */
.preview { background: #EBE2D3; border: 1px solid #DDD0BC; border-radius: 4px; padding: clamp(20px, 5vw, 56px); display: flex; flex-direction: column; align-items: center; gap: 20px; }
.preview-dims { font-size: 14px; font-weight: 500; letter-spacing: .04em; color: var(--muted); text-align: center; }
.board { position: relative; width: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; box-shadow: 0 24px 40px -18px rgba(40,25,15,.55), 0 2px 0 rgba(0,0,0,.12); }
.board.round { width: min(72%, 520px); aspect-ratio: 1 / 1; border-radius: 50%; }
.strip { display: block; width: 100%; flex: 1 1 0; min-height: 0; border: 0; padding: 0; margin: 0; cursor: pointer; box-shadow: inset 0 -1px 0 rgba(0,0,0,.16); }
.strip:hover { filter: brightness(1.08); }
.strip.sel { box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--ink); }
.strip:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.sheen { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,0) 45%, rgba(0,0,0,.10)); }
.board.endgrain { flex-direction: row; }
.eg-col { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; }
.eg-col .strip { box-shadow: inset -1px -1px 0 rgba(0,0,0,.14); }
.board.sq { border-radius: 3px; }
.paddle .body.sq { border-radius: 3px; }

/* Juice groove: a wide, shadowed channel like a carving board */
.groove { position: absolute; inset: 5%; pointer-events: none; border-radius: 16px; border: 8px solid rgba(60,28,8,.24); box-shadow: inset 0 3px 4px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.22), 0 -1px 0 rgba(255,255,255,.3); }
.board.sq .groove { border-radius: 8px; }
.round .groove { inset: 6.5%; border-radius: 50%; }

/* Edge profile shown on the top view */
.edge-ov { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.edge-round .edge-ov { box-shadow: inset 0 0 5px 3px rgba(255,255,255,.22), inset 0 0 1px 1px rgba(0,0,0,.18); }
.edge-chamfer .edge-ov { box-shadow: inset 0 0 0 6px rgba(255,255,255,.16), inset 0 0 0 7px rgba(0,0,0,.12); }

.hang { position: absolute; right: 3.5%; top: 50%; width: 4.5%; aspect-ratio: 1 / 1; transform: translateY(-50%); border-radius: 50%; background: #EBE2D3; box-shadow: inset 0 2px 4px rgba(0,0,0,.4); pointer-events: none; }
.round .hang { right: auto; left: 50%; top: 5%; width: 6%; transform: translateX(-50%); }
.engr { position: absolute; right: 12%; bottom: 12%; max-width: 70%; font-family: var(--serif); font-weight: 600; font-size: clamp(13px, 2.3vw, 24px); letter-spacing: .05em; line-height: 1.1; text-align: right; color: rgba(45,20,8,.6); mix-blend-mode: multiply; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round .engr { right: 50%; bottom: 14%; transform: translateX(50%); text-align: center; }

/* End view (profile) */
.end-view { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.end-label { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.profile { position: relative; display: flex; min-height: 14px; box-shadow: 0 6px 10px -6px rgba(40,25,15,.5); }
.profile-in { position: relative; display: flex; width: 100%; height: 100%; overflow: hidden; }
.profile .seg { flex: 1 1 0; min-width: 0; box-shadow: inset -1px 0 0 rgba(0,0,0,.14); }
.prof-round .profile-in { border-radius: 7px 7px 2px 2px; }
.prof-round.rev .profile-in { border-radius: 7px; }
.prof-chamfer .profile-in { clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%, 0 6px); }
.prof-chamfer.rev .profile-in { clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px); }
.prof-square .profile-in { border-radius: 1px; }
.profile .grip { position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; transform: translate(-50%, -50%); border-radius: 999px; background: linear-gradient(180deg, rgba(25,12,5,.7), rgba(25,12,5,.35)); box-shadow: inset 0 3px 4px rgba(0,0,0,.5); }
.profile .notch { position: absolute; top: 0; width: 6%; height: 18%; background: rgba(25,12,5,.35); border-radius: 0 0 6px 6px; }
.profile .foot { position: absolute; bottom: -8px; width: 7%; height: 8px; background: #2A2420; border-radius: 0 0 3px 3px; }

.paddle { position: relative; width: 100%; }
.paddle .body { position: absolute; left: 0; top: 0; bottom: 0; width: 77%; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 40px -18px rgba(40,25,15,.55); }
.paddle .handle { position: absolute; left: 76.5%; width: 23.5%; top: 33%; height: 34%; border-radius: 0 999px 999px 0; overflow: hidden; box-shadow: 0 24px 40px -18px rgba(40,25,15,.55); }
.paddle .handle-inner { position: absolute; left: 0; right: 0; top: -97.06%; height: 294.12%; display: flex; flex-direction: column; }
.paddle .hole { position: absolute; right: 20%; top: 50%; height: 40%; aspect-ratio: 1 / 1; transform: translateY(-50%); border-radius: 50%; background: #EBE2D3; box-shadow: inset 0 2px 4px rgba(0,0,0,.35); pointer-events: none; }
.paddle .loop { position: absolute; right: -3.5%; top: 38%; width: 9%; height: 24%; border: 3px solid #5A3520; border-left: 0; border-radius: 0 999px 999px 0; pointer-events: none; }

/* Wood palette */
.wood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(112px, 100%), 1fr)); gap: 12px; }
.wood-btn { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; text-align: left; background: transparent; border: 2px solid transparent; border-radius: 4px; cursor: pointer; color: var(--text); }
.wood-btn:hover { background: rgba(255,253,248,.6); }
.wood-btn[aria-pressed="true"] { background: var(--card); border-color: var(--ink); }
.wood-btn .chip { display: block; width: 100%; height: 52px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.wood-btn .n { font-size: 14px; font-weight: 600; line-height: 1.2; }
.wood-btn .d { font-size: 12px; color: var(--muted); line-height: 1.3; }

/* Presets */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.preset-btn { display: flex; flex-direction: column; gap: 10px; padding: 10px; text-align: left; background: transparent; border: 2px solid var(--line); border-radius: 4px; cursor: pointer; color: var(--text); }
.preset-btn[aria-pressed="true"] { background: var(--card); border-color: var(--ink); }
.preset-btn .mini { display: flex; flex-direction: column; width: 100%; height: 64px; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.preset-btn .mini span { display: block; flex: 1 1 0; }
.preset-btn .n { font-size: 15px; font-weight: 600; line-height: 1.2; }
.preset-btn .d { font-size: 13px; color: var(--muted); line-height: 1.3; }

/* Rows */
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.row-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid #DDD0BC; }
.row-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; border-bottom: 1px solid #DDD0BC; }
.row-item.sel { background: #EFE5D4; }
.row-num { width: 56px; font-size: 13px; font-weight: 600; color: var(--muted); }
.row-wood { display: flex; align-items: center; gap: 10px; min-height: 44px; min-width: 170px; padding: 0 12px 0 6px; background: var(--card); border: 1px solid var(--line-2); border-radius: 2px; cursor: pointer; color: var(--text); font-size: 14px; font-weight: 500; }
.row-wood .chip { width: 32px; height: 28px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.row-widths { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 300px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--line-2); border-radius: 2px; cursor: pointer; color: var(--muted); }
.add-row { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; background: transparent; border: 1px dashed #A8987F; border-radius: 2px; cursor: pointer; color: var(--text); font-size: 15px; font-weight: 600; }

/* Chips (shared toggle button) */
.opt { min-height: 44px; padding: 0 14px; border-radius: 2px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
.opt[aria-pressed="true"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* Side panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.panel-title { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.shape-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.shape-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 6px 12px; font-size: 14px; font-weight: 600; }
.shape-btn .ic { display: flex; align-items: center; height: 36px; }
.ic-rect { width: 52px; height: 34px; border-radius: 5px; border: 2px solid currentColor; }
.ic-body { width: 40px; height: 34px; border-radius: 5px; border: 2px solid currentColor; }
.ic-handle { width: 14px; height: 12px; border: 2px solid currentColor; border-left: 0; border-radius: 0 8px 8px 0; }
.ic-round { width: 36px; height: 36px; border-radius: 50%; border: 2px solid currentColor; }
.size-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.size-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; min-height: 60px; text-align: left; }
.size-btn .s1 { font-size: 15px; font-weight: 600; }
.size-btn .s2 { font-size: 13px; opacity: .85; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }

.panel-sub { margin: 0; font-size: 14px; font-weight: 600; }
.check-hint { margin: -8px 0 8px 30px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.check-hint[hidden] { display: none; }
.panel-note { font-size: 14px; color: var(--muted); line-height: 1.5; }
.opt:disabled { opacity: .45; cursor: not-allowed; }
.field-wrap.light { margin: 2px 0 10px 30px; }
.field-wrap.light label { color: var(--text); }
.field.light { background: #fff; color: var(--text); border-color: var(--line-2); }
.field.light::placeholder { color: #7D7268; }
.check[hidden], .field-wrap[hidden], .panel-note[hidden] { display: none; }

.summary { background: var(--ink); color: var(--on-dark); border-radius: 4px; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.summary dl { margin: 0; border-top: 1px solid var(--ink-line); }
.summary dl div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--ink-line); }
.summary dt { color: var(--on-dark-muted); }
.summary dd { margin: 0; font-weight: 600; text-align: right; }
.summary .field { background: #2A2420; }
.summary .btn { width: 100%; }
