/* Katana builder — the approved design.
 *
 * Ported from the design handoff (handoff-clean/css/builder.css) with the
 * blocks the prototype never renders removed: its first-generation summary
 * drawer and upgrade cards, the old nagasa step, the mobile close-up view, the
 * disabled hotspots, and the placeholder chat panel (not in this milestone).
 *
 * Type is one pixel larger throughout than the design file: the client asked
 * for it after seeing the builder live (25 Sep). Every font-size here already
 * includes it.
 *
 * The prototype's stylesheet cannot render on its own — it reads the theme's
 * tokens from chrome.css. The plugin must work whatever theme is active, so
 * the tokens it uses are declared here, with the theme's own values. If the
 * theme defines them too, the theme wins, because these sit on :root and the
 * theme's stylesheet loads after.
 */

.skb-builder {
	--ink-900: #1a2d28; --ink-800: #233a34; --ink-700: #223330; --ink-600: #4a5a57;
	--ink-500: #6b7a77; --ink-400: #98a19f; --ink-300: #c5ccca; --ink-200: #e4e7e6;
	--ink-150: #eceeed; --ink-100: #f5f6f5;
	--brand-900: #01231f; --brand-700: #17433d;
	--accent-700: #a92b00; --accent-600: #c73100; --accent-500: #dc3809; --accent-100: #fef0ea;
	--ok-600: #0b8e6a; --ok-100: #e6f4ef; --sale-600: #c81b1b;
	--fg-secondary: var(--ink-600); --fg-tertiary: var(--ink-500);
	--border: var(--ink-200); --border-strong: var(--ink-300);
	--font-display: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
	--font-ui: "Inter", "Helvetica Neue", Arial, sans-serif;
	--sh-1: 0 1px 2px rgba(15, 26, 24, .06), 0 1px 1px rgba(15, 26, 24, .04);
	--sh-2: 0 2px 8px rgba(15, 26, 24, .06), 0 1px 2px rgba(15, 26, 24, .04);
	--r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;
	--fg-primary: var(--ink-900);
}

/* Base — the prototype's chrome.css, scoped to the builder.
 *
 * The prototype sits on the theme's base stylesheet: border-box sizing, Inter
 * at 16px on a 24px line, and buttons stripped back to plain text. Without it
 * everything renders a little tighter — rows lose height, buttons fall back to
 * the browser's font — which is what made the builder feel smaller than the
 * design. :where() keeps these at the weight of an element selector, as in the
 * prototype, so every class rule below still wins; the one class in front
 * keeps them ahead of the WordPress theme's own button and heading styles. */
.skb-builder, .skb-builder :where(*, *::before, *::after) { box-sizing: border-box; }
.skb-builder {
	font-family: var(--font-ui);
	font-size: 17px;
	line-height: 24px;
	color: var(--fg-primary);
	-webkit-font-smoothing: antialiased;
}
.skb-builder :where(img) { display: block; max-width: 100%; }
.skb-builder :where(a) { color: inherit; text-decoration: none; }
.skb-builder :where(button) { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; margin: 0; text-transform: none; box-shadow: none; }
.skb-builder :where(input, textarea, select) { font: inherit; color: inherit; }
.skb-builder :where(h1, h2, h3, h4, p, ul, dl, dd) { margin: 0; }
.skb-builder :where(ul) { padding: 0; list-style: none; }

/* ══════════════════════════════════════════════════════════════════
   CUSTOM KATANA BUILDER — responsive wizard (ShadowDancer)
   Ported from the polished-UI "Custom Katana Builder 3D" DC.
   Desktop: header progress → layered sword stage → option sheet.
   Mobile (≤640): compact header, sword strip, bottom option sheet.
   Data model: js/builder-data.js (BUILDER_STEPS + lockFor rules).
   ══════════════════════════════════════════════════════════════════ */
.b3d { height: 100vh; min-height: 660px; display: flex; flex-direction: column; background: #fff; font-family: var(--font-ui); color: var(--ink-900); overflow: hidden; position: relative; }

/* ── Header ── */
.b3d-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--border); position: relative; z-index: 40; }
.b3d-lockup { display: inline-flex; align-items: center; gap: 10px; background: transparent; border: none; padding: 4px 6px; cursor: pointer; border-radius: 999px; font-family: var(--font-ui); }
.b3d-lockup:hover { background: var(--ink-100); }
.b3d-lockup-main { display: inline-flex; align-items: center; gap: 10px; }
.b3d-lockup-back { display: none; align-items: center; gap: 9px; height: 34px; padding: 0 4px; color: var(--ink-900); font-size: 14.5px; font-weight: 600; font-family: var(--font-ui); white-space: nowrap; }
.b3d-lockup:hover .b3d-lockup-main { display: none; }
.b3d-lockup:hover .b3d-lockup-back { display: inline-flex; }
.b3d-lockup img { width: 34px; height: 34px; border-radius: 50%; object-fit: contain; flex: none; }
.b3d-lockup-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; gap: 4px; }
.b3d-lockup-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink-900); white-space: nowrap; }
.b3d-lockup-sub { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-tertiary); font-weight: 600; }

.b3d-progress { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(44vw, 620px); display: flex; gap: 18px; }
.b3d-sec { flex: 1; min-width: 0; }
.b3d-sec-label { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.005em; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b3d-sec.is-active .b3d-sec-label { color: var(--ink-900); }
.b3d-sec-track { display: block; height: 4px; border-radius: 2px; background: var(--ink-150); overflow: hidden; }
.b3d-sec-fill { display: block; height: 100%; background: var(--ink-900); border-radius: 2px; transition: width .35s cubic-bezier(.4,0,.2,1); }
.b3d-sec-meta { display: block; margin-top: 5px; font-size: 12px; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; }
.b3d-sec-pct { font-weight: 700; color: var(--ink-700); }

.b3d-head-actions { display: flex; align-items: center; gap: 6px; }
.b3d-hbtn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 15px; flex: none; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; color: var(--fg-secondary); font-family: var(--font-ui); font-size: 14.5px; font-weight: 600; }
.b3d-hbtn:hover { background: var(--ink-100); }

/* ── Stage ── */
.b3d-stage { flex: 1; position: relative; min-height: 210px; overflow: hidden; background: var(--ink-100); }
.b3d-view { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity .3s, transform .3s; }
.b3d-sword { position: relative; width: min(88vw, 1500px); }
/* Zoom (client's latest files, 21 Oct): the stage pans and zooms; see the
   zoom block in katana-ui.js. */
.b3d-zoom { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; transform-origin: 50% 50%; }   /* will-change only while zooming: see apply() */
.b3d-stage.is-zoomable { cursor: zoom-in; }
.b3d-stage.is-zoomed { cursor: grab; }
.b3d-stage.is-panning, .b3d-stage.is-panning * { cursor: grabbing !important; }
.b3d-zctl { position: absolute; right: 16px; bottom: 16px; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 18px rgba(11,19,16,.08); cursor: default; }
.b3d-zctl button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--ink-900); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.b3d-zctl button:hover:not(:disabled) { background: var(--ink-100); }
.b3d-zctl button:disabled { opacity: .3; cursor: default; }
.b3d-zlvl { min-width: 34px; padding: 1px 0; text-align: center; font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg-secondary); }
.b3d-zhint { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 5; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.94); font-size: 12px; color: var(--fg-secondary); pointer-events: none; white-space: nowrap; transition: opacity .4s; }
.b3d-zhint.is-out { opacity: 0; }
/* Phone: pinch, drag and double-tap on the stage, no buttons, a hint until the first pinch. */
.b3dm-pinch { display: none; }
@media (max-width: 640px) {
	.b3d-stage.is-zoomable { touch-action: none; cursor: default; }
	.b3d-zctl, .b3d-zhint { display: none; }
	.b3dm-pinch { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 5; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(26,45,40,.82); color: #fff; font-size: 10.5px; font-weight: 500; line-height: 1.3; white-space: nowrap; pointer-events: none; animation: b3dmPinchIn .35s ease both; transition: opacity .4s; }
	.b3dm-pinch.is-out { opacity: 0; }
	.b3dm-pinch svg { flex: none; animation: b3dmPinch 1.6s ease-in-out infinite; }
}
@keyframes b3dmPinch { 0%, 100% { transform: scale(.85); } 50% { transform: scale(1.12); } }
@keyframes b3dmPinchIn { from { opacity: 0; transform: translate(-50%, -4px); } }
.b3d-sword-layers { position: relative; width: 100%; aspect-ratio: 1926/209; }
.b3d-sword-layers img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Real Airtable layer renders (2560×800, sword band x352–2200 / y368–544) — shown
   EXACTLY as delivered: handle left, edge up, no flips (the stage's placeholder
   flip is disabled in JS when real layers render). Zoomed 1.33× with the window
   centered on the sword band. */
.b3d-sword-layers img.b3d-real, .b3dm-layers img.b3d-real { position: absolute; inset: auto; left: -16.3%; top: -168.3%; width: 133%; height: auto; max-width: none; max-height: none; transform: none; }
.b3d-sword-shadow { position: absolute; left: 6%; right: 6%; bottom: -24px; height: 22px; background: radial-gradient(ellipse at 50% 0%, rgba(15,26,24,.13) 0%, rgba(15,26,24,0) 70%); filter: blur(6px); }
.b3d-warn { position: absolute; left: 28px; bottom: 28px; max-width: min(440px, calc(100% - 56px)); display: flex; align-items: flex-start; gap: 9px; z-index: 40; font-size: 13.5px; line-height: 17px; color: var(--ink-900); }
.b3d-warn svg { flex: none; margin-top: 1px; }
.b3d-warn strong { color: var(--ink-900); font-weight: 700; }
.b3d-warn[hidden] { display: none !important; }   /* plugin: display:flex above beat the attribute */
.b3d-toast { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px); opacity: 0; transition: opacity .25s, transform .25s; background: var(--ink-900); color: #fff; font-size: 14px; line-height: 18px; padding: 10px 16px; border-radius: 10px; max-width: 540px; text-align: center; box-shadow: 0 10px 30px rgba(15,26,24,.28); pointer-events: none; z-index: 50; }
.b3d-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── Option sheet ── */
/* Fixed sheet height: nagasa (slider) and upgrades bodies are shorter than the card
   rail, and any change here would move the stage — and the layered sword PNGs — up or
   down. 308px = the tallest case (card layout). Mobile resets this to flex: 1. */
.b3d-sheet { flex: none; position: relative; background: #fff; border-top: 1px solid var(--border); z-index: 35; height: 308px; }
/* Fixed side columns: the row's width must not depend on its contents, or showing
   "Skip to last step" would widen the right cell and shift the centred row left. */
.b3d-navrow { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); z-index: 65; display: grid; grid-template-columns: 150px auto 150px; align-items: center; column-gap: 10px; }
.b3d-navrow > div { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.b3d-navrow > div:first-child { justify-content: flex-end; }
.b3d-navbtn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); cursor: pointer; box-shadow: var(--sh-1); font-size: 13.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-900); font-family: var(--font-ui); white-space: nowrap; }
.b3d-navbtn:hover { background: var(--ink-100); }
.b3d-navbtn--right { justify-self: start; }
.b3d-navbtn--left { justify-self: end; }
.b3d-summary-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 18px; border-radius: 999px; background: #fff; color: var(--ink-900); border: 1px solid var(--border-strong); cursor: pointer; font-family: var(--font-ui); font-size: 15px; font-weight: 600; box-shadow: var(--sh-1); white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.b3d-summary-btn:hover { border-color: var(--ink-400); }
.b3d-summary-btn.is-done { background: var(--accent-500); color: #fff; border-color: var(--accent-500); box-shadow: 0 4px 14px rgba(240,61,13,.28); }
.b3d-summary-btn.is-done:hover { background: var(--accent-600); }
.b3d-skip { border-color: var(--ok-100) !important; background: var(--ok-100) !important; color: var(--ok-600) !important; }
.b3d-summary-sub { color: var(--ink-900); font-variant-numeric: tabular-nums; font-weight: 700; }
.b3d-summary-dot { color: var(--fg-tertiary); font-weight: 600; }
.b3d-summary-btn.is-done .b3d-summary-dot { color: rgba(255,255,255,.6); }
.b3d-summary-btn.is-done .b3d-summary-sub { color: #fff; }
@keyframes b3dRise { 0% { opacity: 0; transform: translate(-50%, 8px); } 18% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -22px); } }
@keyframes b3dSink { 0% { opacity: 0; transform: translate(-50%, -8px); } 18% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 22px); } }
.b3d-flash { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); font-size: 14px; font-weight: 700; pointer-events: none; white-space: nowrap; }
.b3d-flash--up { color: var(--accent-600); animation: b3dRise 1.1s cubic-bezier(.2,.7,.2,1) forwards; }
.b3d-flash--down { color: var(--accent-600); top: auto; bottom: -26px; animation: b3dSink 1.1s cubic-bezier(.2,.7,.2,1) forwards; }

/* Need help pill */
.b3d-needhelp { position: relative; height: 36px; padding: 0 15px 0 8px; border-radius: 999px; border: none; background: #1e3a32; color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: 13.5px; font-weight: 500; }
.b3d-needhelp-ic { position: relative; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.b3d-needhelp-dot { position: absolute; top: -1px; right: -1px; width: 8px; height: 8px; border-radius: 50%; background: #34d399; border: 2px solid #1e3a32; }
@keyframes b3dChatRise { from { opacity: 0; transform: translateY(-10px) scaleY(.92); } to { opacity: 1; transform: none; } }
@keyframes b3dChatSink { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-10px) scaleY(.92); } }
@keyframes b3dChatDots { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
@keyframes b3dChatSheet { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes b3dChatSheetOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(28px); } }

/* ── Review (Your build) full-page overlay — 1:1 with 3D builder DC ── */
.b3d-review { position: fixed; inset: 0; z-index: 90; display: none; }
.b3d-review.is-open { display: flex; flex-direction: column; background: #fff; }
.b3d-rev-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: clamp(11px, 2.6vw, 18px) clamp(14px, 3vw, 32px); border-bottom: 1px solid var(--border); }
.b3d-rev-title { display: flex; align-items: baseline; gap: 14px; }
.b3d-rev-title b { font-family: var(--font-display); font-weight: 500; font-size: 24px; color: var(--ink-900); }
.b3d-rev-title span { font-size: 14.5px; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; }
.b3d-rev-back { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; flex: none; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-family: var(--font-ui); font-size: 14.5px; font-weight: 600; color: var(--ink-900); }
.b3d-rev-back:hover { background: var(--ink-100); }
.b3d-rev-body { flex: 1; overflow-y: auto; padding: 22px clamp(14px, 3vw, 32px) 24px; }
.b3d-rev-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 16px 18px; align-items: start; align-content: start; }
.b3d-rev-col { min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fff; box-shadow: var(--sh-1); }
.b3d-rev-col-head { display: flex; align-items: center; justify-content: space-between; background: var(--ink-100); border-radius: 8px; padding: 7px 12px; margin-bottom: 6px; }
.b3d-rev-col-head > span:first-child { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ink-900); }
.b3d-rev-count { font-size: 11.5px; font-weight: 600; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; }
/* Upgrades: one compact full-width strip under the section columns, single edit button. */
.b3d-rev-col--ups { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 clamp(14px, 3vw, 32px) 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.b3d-rev-upchips { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.b3d-rev-upchip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--ink-100); font-size: 13px; color: var(--ink-900); }
.b3d-rev-upchip b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.b3d-rev-upchip.is-empty { background: transparent; color: var(--fg-tertiary); padding-left: 0; }
.b3d-rev-upedit { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--border-strong); background: #fff; color: var(--ink-800); font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.b3d-rev-upedit:hover { background: var(--ink-100); }
.b3d-rev-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; min-width: 0; }
.b3d-rev-row.is-empty { cursor: default; opacity: .68; }
.b3d-rev-row.is-invalid { background: #fdeaea; }
.b3d-rev-dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: var(--ink-150); box-shadow: inset 0 0 0 1px rgba(15,26,24,.12); }
.b3d-rev-label { font-size: 14px; color: var(--fg-secondary); flex: none; width: 116px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b3d-rev-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.b3d-rev-val { font-size: 14px; font-weight: 500; color: var(--ink-900); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.b3d-rev-val.is-empty { color: var(--ink-400); font-style: italic; }
.b3d-rev-val.is-invalid { color: var(--sale-600); font-weight: 600; font-style: normal; }
.b3d-rev-right { flex: none; display: flex; align-items: center; gap: 8px; }
.b3d-rev-nums { display: flex; flex-direction: column; align-items: flex-end; }
.b3d-rev-delta { font-size: 12.5px; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; }
.b3d-rev-lead { font-size: 11.5px; color: var(--fg-tertiary); white-space: nowrap; }
/* Plugin (client, 4 Oct): price and extra time go under the option's name,
   and the option's name lines up with the part's name. */
.b3d-rev-row { align-items: flex-start; }
.b3d-rev-row .b3d-rev-dot { margin-top: 3px; }
.b3d-rev-row .b3d-rev-label, .b3d-rev-row .b3d-rev-val { line-height: 18px; }
/* As the client's latest design: "+$800 · +10–18 weeks" sits right after the
   option's name when there is room and wraps beneath it as one piece when
   there is not, so the dot never dangles. */
.b3d-rev-mid { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 2px; }
.b3d-rev-val { display: inline; -webkit-line-clamp: unset; overflow: visible; }
.b3d-rev-meta { flex: none; display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.b3d-rev-meta .b3d-rev-delta + .b3d-rev-lead::before { content: "\00B7"; margin-right: 6px; color: var(--ink-300); }
.b3d-rev-row.is-invalid .b3d-rev-dot { background: var(--sale-600); box-shadow: none; }
.b3d-rev-edit { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-900); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; background: #fff; cursor: pointer; font-family: var(--font-ui); transition: background .12s, border-color .12s; }
.b3d-rev-edit:hover { background: var(--ink-100); border-color: var(--ink-400); }
.b3d-rev-lock { display: inline-flex; align-items: center; justify-content: center; color: var(--ink-400); }
.b3d-rev-foot { flex: none; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px 26px; padding: 14px clamp(16px, 2.6vw, 32px) 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.b3d-rev-note { position: relative; flex: 1 1 280px; min-width: 240px; max-width: 460px; }
.b3d-rev-note-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-family: var(--font-ui); transition: border-color .15s, background .15s; }
.b3d-rev-note-btn:hover { border-color: var(--ink-400); background: var(--ink-100); }
.b3d-rev-note-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--ink-100); display: inline-flex; align-items: center; justify-content: center; color: var(--fg-secondary); }
.b3d-rev-note-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.b3d-rev-note-txt b { font-size: 11px; letter-spacing: .11em; text-transform: uppercase; font-weight: 700; color: var(--fg-tertiary); }
.b3d-rev-note-txt > span { font-size: 13.5px; line-height: 16px; color: var(--fg-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b3d-rev-note.is-filled .b3d-rev-note-txt > span { color: var(--ink-900); }
.b3d-rev-note-add { flex: none; font-size: 12.5px; font-weight: 600; color: var(--ink-900); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; background: #fff; font-family: var(--font-ui); }

/* Total + free-shipping (in-progress state) */
.b3d-rev-total { display: flex; align-items: baseline; gap: 14px; }
.b3d-rev-total-num { font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.b3d-rev-ship { font-size: 14.6px; font-weight: 600; color: var(--fg-secondary); font-variant-numeric: tabular-nums; }
.b3d-rev-ship.is-free { color: var(--ok-600); }

/* Add-to-cart (complete state) */
.b3d-rev-cart { display: flex; flex-direction: column; align-items: center; gap: 9px; position: relative; }
.b3d-rev-cart-btn { height: 45px; padding: 0 26px; flex: none; margin-left: 4px; white-space: nowrap; border-radius: 999px; border: none; font-family: var(--font-ui); font-size: 16.5px; font-weight: 600; cursor: pointer; background: #DF4100; color: #fff; box-shadow: 0 4px 14px rgba(240,61,13,.25); }
.b3d-rev-est { display: inline-flex; align-items: center; gap: 7px; font-size: 13.6px; font-weight: 600; color: var(--fg-secondary); cursor: help; position: relative; }
.b3d-rev-est-q { width: 19px; height: 19px; border-radius: 50%; border: none; background: var(--ink-100); color: var(--fg-secondary); font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.b3d-rev-est.is-open .b3d-rev-est-q, .b3d-rev-est-q:hover { background: var(--ink-900); color: #fff; }

/* Notes popover */
.b3d-notespop { position: absolute; left: 0; bottom: calc(100% + 14px); width: 390px; max-width: 86vw; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 44px -14px rgba(15,26,24,.32); padding: 14px 16px 13px; z-index: 20; text-align: left; cursor: auto; }
.b3d-notespop::after { content: ""; position: absolute; top: 100%; left: 42px; width: 12px; height: 12px; background: #fff; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: translate(-50%,-50%) rotate(45deg); }
.b3d-notespop-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.b3d-notespop-head b { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--ink-900); }
.b3d-notespop-count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; }
.b3d-notespop-x { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--ink-100); color: var(--fg-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.b3d-notespop-x:hover { background: var(--ink-150); }
.b3d-notespop-ta { width: 100%; box-sizing: border-box; min-height: 96px; resize: vertical; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-family: var(--font-ui); font-size: 14px; line-height: 20px; color: var(--ink-900); background: #fff; outline: none; }
.b3d-notespop-ta:focus { border-color: var(--ink-400); }
.b3d-notespop-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.b3d-notespop-foot span { font-size: 12px; line-height: 15px; color: var(--fg-tertiary); }
.b3d-notespop-done { flex: none; height: 30px; padding: 0 16px; border-radius: 999px; border: none; background: var(--ink-900); color: #fff; font-family: var(--font-ui); font-size: 13px; font-weight: 600; cursor: pointer; }

/* Estimated-time popover */
.b3d-estpop { position: absolute; right: 0; bottom: calc(100% + 12px); width: 360px; max-width: 70vw; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 44px -14px rgba(15,26,24,.32); padding: 15px 17px; z-index: 20; text-align: left; cursor: auto; }
.b3d-estpop::after { content: ""; position: absolute; top: 100%; right: 44px; width: 12px; height: 12px; background: #fff; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: translateY(-50%) rotate(45deg); }
.b3d-estpop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.b3d-estpop-head b { font-family: var(--font-ui); font-size: 13.5px; font-weight: 700; color: var(--ink-900); }
.b3d-estpop-x { flex: none; width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--ink-100); color: var(--fg-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.b3d-estpop-x:hover { background: var(--ink-150); }
.b3d-estpop p { margin: 0; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--fg-secondary); }

.b3d-sheet-body { height: 100%; box-sizing: border-box; padding: 30px 28px 18px; display: flex; flex-direction: column; gap: 12px; }
.b3d-part-head { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; height: 32px; }
.b3d-part-title { flex: none; white-space: nowrap; font-size: 19px; font-weight: 600; color: var(--ink-900); letter-spacing: -.01em; }
.b3d-part-counter { flex: none; font-size: 14px; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; }
.b3d-part-optional { flex: none; white-space: nowrap; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-tertiary); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.b3d-help { flex: none; position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); color: var(--fg-tertiary); font-size: 12px; font-weight: 700; cursor: help; }
.b3d-help:hover { border-color: var(--ink-900); color: var(--ink-900); }
/* The step's "?" text (katana-ui.js showTip): a box on the page itself,
   placed by hand, styled like the theme's own tooltips (client, 10 Nov). */
.skb-tip { position: fixed; z-index: 100000; width: 300px; max-width: calc(100vw - 24px); box-sizing: border-box; margin: 0; padding: 14px 16px; border-radius: 6px; background: rgba(0, 0, 0, .8); color: #fff; font-size: 14px; font-weight: 400; line-height: 1.5; letter-spacing: normal; text-align: left; text-transform: none; white-space: normal; pointer-events: none; -webkit-font-smoothing: antialiased; }
.skb-tip[hidden] { display: none; }
.skb-tip::after { content: ""; position: absolute; top: 100%; left: var(--skb-tip-arrow, 50%); margin-left: -7px; border: 7px solid transparent; border-top-color: rgba(0, 0, 0, .8); }
.skb-tip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: rgba(0, 0, 0, .8); }

/* Fixed-height slider row — always present so the sheet height (and the layered
   sword image above it) never moves between parts. */
.b3d-groups { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; height: 30px; margin-left: 4px; }
.b3d-groups-track { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: 30px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.b3d-groups-track::-webkit-scrollbar { display: none; }
/* Edge fades: the only affordance that there are more tabs — no arrow buttons. */
.b3d-groups-track.has-more-r { mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 34px), transparent 100%); }
.b3d-groups-track.has-more-l { mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 34px), transparent 100%); }
.b3d-groups-track.has-more-l.has-more-r { mask-image: linear-gradient(to right, transparent 0, #000 34px, #000 calc(100% - 34px), transparent 100%); }
.b3d-gtab { flex: none; white-space: nowrap; height: 29px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--fg-secondary); }
.b3d-gtab.is-active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
/* A length preset a chosen part rules out: struck through, as the design. */
.b3d-gtab.is-off { color: var(--fg-tertiary); opacity: .6; cursor: not-allowed; }
.b3d-gtab-lock { display: inline-block; vertical-align: -1px; margin-right: 6px; }
/* Lengths a chosen part rules out: hatched on the track, as the design. */
.b3d-track-lock { position: absolute; top: 15px; height: 10px; pointer-events: none;
	background: repeating-linear-gradient(135deg, var(--ink-300, #b3bdbc) 0 1.5px, transparent 1.5px 5px); }
.b3d-lenfam .b3d-track-lock { top: 10px; }
.b3d-gtab.has-pick { border-color: var(--accent-500); box-shadow: inset 0 0 0 1px var(--accent-500); }
.b3d-gtab.has-pick::after { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-500); margin-left: 6px; vertical-align: 1px; }
.b3d-gtab.is-active.has-pick { box-shadow: none; border-color: var(--ink-900); }
.b3d-gtab.is-active.has-pick::after { background: var(--accent-500); }
.b3d-gtab:focus { outline: none; }
.b3d-gtab:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }

/* Card rail */
.b3d-cards { display: flex; gap: 12px; overflow-x: scroll; padding: 3px 1px 8px; scroll-behavior: smooth; }
.b3d-cards, .b3d-scroll { scrollbar-width: thin; }
.b3d-cards::-webkit-scrollbar, .b3d-scroll::-webkit-scrollbar { height: 5px; width: 5px; }
.b3d-cards::-webkit-scrollbar-thumb, .b3d-scroll::-webkit-scrollbar-thumb { background: var(--ink-150); border-radius: 99px; }
.b3d-card { position: relative; width: 152px; flex: 0 0 152px; border-radius: 7px; background: #fff; overflow: hidden; border: 1px solid var(--border); display: flex; flex-direction: column; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .12s; }
.b3d-card.is-selected { border: 2px solid var(--accent-500); box-shadow: 0 0 0 3px rgba(240,61,13,.13); }
.b3d-card.is-locked { border: 1px dashed var(--border-strong); opacity: .5; cursor: not-allowed; }
.b3d-card:not(.is-locked):not(.is-selected):hover { border-color: var(--ink-400); }
.b3d-thumb { position: relative; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); overflow: hidden; background: var(--ink-100); }
.b3d-thumb.is-color { background: #fff; }
.b3d-color-fill { position: absolute; inset: 0; }
.b3d-metal { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: rgba(255,255,255,.85); text-shadow: 0 1px 2px rgba(0,0,0,.5); box-shadow: inset 0 1px 3px rgba(255,255,255,.35), inset 0 -2px 4px rgba(0,0,0,.3); }
.b3d-chip-label { font-family: var(--font-display); font-weight: 500; font-size: 18px; color: var(--ink-900); text-align: center; padding: 0 10px; line-height: 1.18; overflow-wrap: anywhere; }
.b3d-rec { position: absolute; top: 6px; left: 6px; z-index: 4; background: #16a34a; color: #fff; border-radius: 3px; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; padding: 2px 5px; }
.b3d-card.is-selected .b3d-rec { background: var(--accent-500); }
.b3d-badges { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; align-items: center; z-index: 4; }
.b3d-badge-lock { background: #fff; border: 1px solid var(--border-strong); color: var(--fg-tertiary); border-radius: 4px; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; padding: 2px 5px; display: inline-flex; align-items: center; gap: 3px; }
.b3d-badge-days, .b3d-badge-check { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.b3d-badge-days { background: #fff; border: 1.5px solid var(--ink-400); color: var(--ink-700); }
.b3d-badge-check { background: var(--accent-500); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.22); }
.b3d-info-btn { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.94); border: 1px solid var(--border); color: var(--ink-900); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.18); font-size: 14px; font-weight: 700; z-index: 5; }
.b3d-card-foot { height: 52px; box-sizing: border-box; padding: 8px 10px 9px; display: flex; flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 8px; }
.b3d-card-foot.is-long { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 8px; }
.b3d-card-name { font-size: 14px; font-weight: 500; color: var(--ink-900); line-height: 1.25; overflow: hidden; }
.b3d-card-foot:not(.is-long) .b3d-card-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.b3d-card-foot.is-long .b3d-card-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.b3d-card-price { font-size: 13px; font-weight: 600; white-space: nowrap; flex-shrink: 0; line-height: 15px; color: var(--fg-tertiary); }
.b3d-card-price.is-up { color: var(--ink-900); }
.b3d-card.is-selected .b3d-card-price.is-up { color: var(--accent-700); }
.b3d-info-added { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 14px; border-radius: 9px; background: var(--ink-100); color: var(--ink-900); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.b3d-info-added svg { color: var(--fg-tertiary); }
.b3d-info-select.is-remove { background: #fff; color: #dc2626; border: 1px solid #dc2626; box-shadow: none; }
.b3d-info-select.is-remove:hover:not(:disabled) { background: #dc2626; border-color: #dc2626; color: #fff; box-shadow: 0 8px 24px rgba(220,38,38,.35); }
.b3d-nagasa-tag { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--fg-tertiary); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.b3d-track { position: relative; height: 40px; margin: 0 16px; cursor: pointer; user-select: none; touch-action: none; }
.b3d-track-bg { position: absolute; top: 18px; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--ink-150); }
.b3d-track-fill { position: absolute; top: 18px; left: 0; height: 4px; border-radius: 2px; background: var(--ink-900); }
.b3d-tick { position: absolute; top: 15px; width: 2px; height: 10px; border-radius: 1px; background: var(--border-strong); transform: translateX(-50%); cursor: pointer; }
.b3d-tick.is-invalid { opacity: .25; }
.b3d-knob { position: absolute; top: 9px; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--ink-900); box-shadow: 0 2px 8px rgba(0,0,0,.22); pointer-events: none; }
.b3d-marks { position: relative; height: 20px; margin: 0 16px 6px; }
.b3d-mark { position: absolute; transform: translateX(-50%); font-size: 11.5px; color: var(--fg-tertiary); white-space: nowrap; }

/* Blade & Handle Length (merged step: preset tabs in header + rulers) */
.b3d-lengths { display: flex; flex-direction: column; gap: 12px; padding: 2px 6px 4px; min-height: 0; }
.b3d-len-note { margin: -4px 2px 0; font-size: 13px; line-height: 16px; color: var(--fg-secondary); flex: none; }
.b3d-len-note.is-ok { color: var(--ok-600); }
.b3d-lenfam-pr { font-size: 13px; font-weight: 600; color: var(--fg-secondary); font-variant-numeric: tabular-nums; }
.b3d-lenfam-pr.is-up { color: var(--accent-700); }
.b3d-lenfam { flex: none; }
.b3d-lenfam-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 2px; }
.b3d-lenfam-kicker { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--fg-tertiary); }
.b3d-lenfam.is-primary .b3d-lenfam-kicker { color: var(--ink-900); }
.b3d-lenfam-val { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; color: var(--ink-900); }
.b3d-lenfam .b3d-marks { height: 16px; margin-bottom: 2px; }
.b3d-lenfam .b3d-track { height: 30px; }
.b3d-lenfam .b3d-track-bg, .b3d-lenfam .b3d-track-fill { top: 13px; }
.b3d-lenfam .b3d-tick { top: 10px; }
.b3d-lenfam .b3d-knob { top: 4px; }
.b3d-lenfam:not(.is-primary) .b3d-track { height: 26px; }
.b3d-lenfam:not(.is-primary) .b3d-track-bg, .b3d-lenfam:not(.is-primary) .b3d-track-fill { top: 12px; height: 3px; }
.b3d-lenfam:not(.is-primary) .b3d-tick { top: 8.5px; }
.b3d-lenfam:not(.is-primary) .b3d-knob { top: 4.5px; width: 18px; height: 18px; }
@keyframes b3dSlideIn { from { transform: translateX(100%); } to { transform: none; } }

/* ── Info drawer ── */
.b3d-info { position: fixed; inset: 0; z-index: 95; display: none; align-items: center; justify-content: center; padding: 32px; }
.b3d-info.is-open { display: flex; }
.b3d-info-scrim { position: absolute; inset: 0; background: rgba(12,14,18,.45); }
.b3d-info-wrap { position: relative; width: 100%; max-width: 1020px; display: flex; flex-direction: column; gap: 14px; }
.b3d-info-card { display: flex; background: #fff; border-radius: 16px; overflow: hidden; height: min(64vh, 520px); box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.b3d-info-photo { flex: 0 0 auto; aspect-ratio: 1 / 1; height: 100%; background: repeating-linear-gradient(135deg, rgba(15,26,24,.03) 0 12px, rgba(15,26,24,.015) 12px 24px), var(--ink-100); display: flex; align-items: center; justify-content: center; font-size: 12px; letter-spacing: .16em; color: var(--fg-tertiary); font-family: var(--font-mono, ui-monospace, monospace); }
.b3d-info-main { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; }
.b3d-info-x { position: absolute; top: 14px; right: 14px; z-index: 3; width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--ink-900); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.b3d-info-x:hover { background: var(--ink-100); }
.b3d-info-head { flex: none; padding: 22px 56px 14px 26px; border-bottom: 1px solid var(--border); margin: 0 0 0 0; }
.b3d-info-counter { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; margin-bottom: 5px; }
.b3d-info-name { font-family: var(--font-display); font-size: 23px; line-height: 1.15; font-weight: 600; color: var(--ink-900); margin: 0; }
.b3d-info-price { font-size: 14px; font-weight: 600; color: var(--ink-900); margin-top: 7px; }
.b3d-info-price-days { display: none; font-weight: 500; color: var(--fg-tertiary); }
.b3d-info-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 26px 20px; }
.b3d-info-text { font-size: 15px; line-height: 1.6; color: var(--ink-800, #233a34); margin: 0 0 16px; }
.b3d-info-note { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; color: var(--fg-secondary); }
.b3d-info-grades { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.b3d-grade { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px; }
.b3d-grade-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-tertiary); font-weight: 600; }
.b3d-grade-track { height: 6px; border-radius: 3px; background: var(--ink-150); overflow: hidden; }
.b3d-grade-fill { display: block; height: 100%; background: var(--ink-900); border-radius: 3px; }
.b3d-grade-scale { font-size: 12px; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; }
.b3d-info-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.b3d-info-select { min-width: 200px; height: 48px; padding: 0 34px; border-radius: 999px; border: none; background: var(--accent-500); color: #fff; font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: .01em; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 20px rgba(240,61,13,.32); transition: background .15s, box-shadow .15s; }
.b3d-info-select:hover:not(:disabled) { background: var(--accent-600); box-shadow: 0 8px 24px rgba(240,61,13,.4); }
.b3d-info-select:disabled { background: var(--border-strong); box-shadow: none; cursor: not-allowed; }
.b3d-info-arrow { flex: none; width: 48px; height: 48px; border-radius: 999px; border: none; background: #fff; color: var(--ink-900); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.b3d-info-arrow:hover:not(:disabled) { background: var(--ink-100); }
.b3d-info-arrow:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 640px) {
  .b3d-head { display: none; }
  .b3d-progress { display: none; }
  .b3d-stage { min-height: 150px; flex: 0 0 32vh; }
  .b3d-sword { width: 108%; }
  .b3d-warn { display: none; }
  .b3d-sheet { flex: 1; height: auto; min-height: 0; display: flex; flex-direction: column; }
  .b3d-navrow { position: static; transform: none; margin: 0; padding: 12px 14px 0; width: 100%; display: flex; justify-content: space-between; gap: 8px; }
  .b3d-navbtn--left, .b3d-navbtn--right { justify-self: auto; }
  .b3d-sheet-body { padding: 12px 14px 16px; overflow-y: auto; flex: 1; }
  .b3d-part-title { font-size: 16px; }
  .b3d-cards{ gap: 10px; }
  .b3d-info { padding: 16px; }
  /* Mobile popup: compact photo, X floats on the image, photo stays pinned
     while the text below scrolls. */
  .b3d-info-card { flex-direction: column; height: auto; max-height: 84vh; position: relative; }
  .b3d-info-photo { flex: none; height: auto; width: 100%; aspect-ratio: 1/1; max-height: 46vh; }
  .b3d-info-main { min-height: 0; position: static; flex: 1; display: flex; flex-direction: column; }
  .b3d-info-x { top: 10px; right: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
  .b3d-info-head { padding: 11px 18px 9px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "counter counter" "name price"; align-items: baseline; column-gap: 12px; }
  .b3d-info-counter { grid-area: counter; margin-bottom: 2px; font-size: 11px; }
  .b3d-info-name { grid-area: name; font-size: 18px; }
  .b3d-info-price { grid-area: price; margin-top: 0; font-size: 15px; white-space: nowrap; }
  /* time stacked under the price, lighter so the pair reads as one block */
  .b3d-info-price-days { display: block; font-size: 12.5px; letter-spacing: .01em; margin-top: 2px; text-align: right; }
  .b3d-info-price { line-height: 1.25; }
  .b3d-info-note { display: none; }
  .b3d-info-body { padding: 10px 18px 26px; }
  .b3d-info-select { min-width: 0; flex: 1; padding: 0 16px; }
  .b3d-info-arrow { width: 44px; height: 44px; }
  .b3d-rev-cols { grid-template-columns: 1fr; }
  .b3d-rev-head, .b3d-rev-body, .b3d-rev-foot { padding-left: 14px; padding-right: 14px; }
  .b3d-rev-foot { flex-direction: column; align-items: stretch; }
  .b3d-rev-cart { align-items: stretch; }
  .b3d-rev-cart-btn { width: 100%; }
  .b3d-rev-row { grid-template-columns: auto 1fr auto auto; }
  .b3d-rev-label { display: none; }
  .b3d-needhelp { bottom: 12px; right: 12px; }
  /* Blade & Handle length step: smaller values, lighter tags */
  .b3d-nagasa-label { font-size: 18px; }
  .b3d-lenfam-val { font-size: 14px; }
  .b3d-lenfam-head { flex-wrap: wrap; gap: 6px 8px; row-gap: 4px; margin-bottom: 4px; }
  .b3d-nagasa-tag { font-size: 9.5px; letter-spacing: .06em; padding: 1px 7px; }
}

/* ═══════════ MOBILE — dedicated layout (1:1 with the 3D builder DC) ═══════════ */
.b3dm { height: 100dvh; display: flex; flex-direction: column; background: #fff; }
.b3dm-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #fff; z-index: 40; }
.b3dm-back { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: none; padding: 4px 6px 4px 2px; cursor: pointer; font-family: var(--font-ui); text-align: left; }
.b3dm-back img { width: 28px; height: 28px; border-radius: 50%; object-fit: contain; flex: none; }
.b3dm-back .nm { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; gap: 3px; }
.b3dm-back .nm b { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: var(--ink-900); white-space: nowrap; }
.b3dm-back .nm small { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-tertiary); font-weight: 600; }
.b3dm-head-actions { display: flex; align-items: center; gap: 7px; }
.b3dm-chat { height: 34px; padding: 0 13px 0 8px; border-radius: 999px; border: none; background: #1e3a32; color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-ui); font-size: 13.5px; font-weight: 500; letter-spacing: -.005em; }
.b3dm-chat .bub { position: relative; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.b3dm-chat .bub i { position: absolute; top: -1px; right: -1px; width: 8px; height: 8px; border-radius: 50%; background: #34d399; border: 2px solid #1e3a32; }
.b3dm-reset { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--fg-secondary); }
.b3dm-sumbar { flex: none; width: 100%; display: flex; align-items: center; gap: 12px; background: #fff; border: none; border-bottom: 1px solid var(--border); padding: 9px 14px; cursor: pointer; font-family: var(--font-ui); text-align: left; }
.b3dm-sumbar-price { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink-900); font-variant-numeric: tabular-nums; flex: none; }
.b3dm-sumbar-progress { flex: 1; display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.b3dm-sumbar-track { flex: 1; display: block; height: 4px; border-radius: 3px; background: var(--ink-100); overflow: hidden; }
.b3dm-sumbar-track span { display: block; height: 100%; transition: width .3s; }
.b3dm-sumbar-pct { flex: none; font-size: 12px; font-weight: 700; color: var(--fg-secondary); font-variant-numeric: tabular-nums; }
.b3dm-sumbar-chev { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-900); }
.b3dm-stage { flex: 1; position: relative; min-height: 130px; overflow: hidden; background: var(--ink-100); }
.b3dm-view { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 22px; box-sizing: border-box; transition: opacity .3s; }
.b3dm-drawn { position: relative; width: 132%; flex: none; transform-origin: center center; transition: transform .4s cubic-bezier(.4,0,.2,1); }
.b3dm-layers { position: relative; width: 100%; aspect-ratio: 1926/209; }
.b3dm-layers img { position: absolute; inset: 0; width: 100%; height: 100%; }
.b3dm-sheet { flex: none; position: relative; background: #fff; border-top: 1px solid var(--border); z-index: 35; display: flex; flex-direction: column; height: 41%; }
.b3dm-navpills { position: absolute; top: -14px; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; z-index: 65; }
.b3dm-navpills .l, .b3dm-navpills .r { flex: 1; display: flex; }
.b3dm-navpills .r { justify-content: flex-end; }
.b3dm-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); cursor: pointer; box-shadow: var(--sh-1); font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-900); font-family: var(--font-ui); white-space: nowrap; }
.b3dm-pill--skip { border-color: var(--ok-100); background: var(--ok-100); color: var(--ok-600); padding: 0 13px; }
.b3dm-sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding: 22px 14px 12px; }
.b3dm-sheet-pad { flex: none; height: 14px; }
.b3dm-parthead { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .b3d-gtab { font-size: 13px; height: 28px; }
  .b3d-card-name { font-size: 13px; }
  .b3d-chip-label { font-size: 13px; }
  .b3d-metal { font-size: 13px; }
  .b3d-card-price { font-size: 12px; }
}
.b3dm-parttitle { font-size: 17px; font-weight: 600; color: var(--ink-900); letter-spacing: -.01em; font-family: var(--font-ui); }
.b3dm-groups { display: flex; align-items: center; gap: 7px; overflow-x: auto; flex: none; padding-bottom: 2px; min-height: 30px; scrollbar-width: none; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 18px), transparent 100%); }
.b3dm-groups::-webkit-scrollbar { display: none; }
.b3dm-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.b3dm-sheet .b3d-cards { display: flex; gap: 10px; overflow-x: auto; padding: 2px 1px 6px; scroll-behavior: smooth; grid-template-columns: none; }
.b3dm-sheet .b3d-card { flex: 0 0 132px; width: 132px; }
.b3dm-sheet .b3d-lengths { padding: 4px 2px 10px; }

/* Mobile summary popovers (notes / est) anchor above the footer */
.b3dm .b3d-notespop, .b3dm .b3d-estpop { position: absolute; bottom: calc(100% - 4px); left: 16px; right: 16px; top: auto; width: auto; z-index: 70; }

/* ── Daishō upsell modal (1:1 with 3D builder DC) ── */
.b3d-daisho { position: fixed; inset: 0; z-index: 120; }
.b3d-daisho-scrim { position: absolute; inset: 0; background: rgba(15,26,24,.4); }
.b3d-daisho-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none; }
.b3d-daisho-card { position: relative; pointer-events: auto; width: 460px; max-width: 94vw; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(15,26,24,.5); animation: b3dDaishoIn .2s ease; }
@keyframes b3dDaishoIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.b3d-daisho-x { position: absolute; top: 14px; right: 14px; z-index: 3; width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink-900); }
.b3d-daisho-x:hover { background: var(--ink-100); }
.b3d-daisho-visual { position: relative; height: 204px; background: var(--ink-100); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 0 34px; border-bottom: 1px solid var(--border); }
.b3d-daisho-bladelabel { flex: none; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-tertiary); width: 64px; }
.b3d-daisho-off { position: absolute; top: 15px; left: 16px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sale-600); background: #fdeaea; border-radius: 5px; padding: 3px 9px; }
.b3d-daisho-copy { padding: 22px 28px 24px; text-align: center; }
.b3d-daisho-title { font-family: var(--font-display); font-weight: 500; font-size: 23px; line-height: 1.2; color: var(--ink-900); }
.b3d-daisho-sub { margin: 10px auto 16px; max-width: 352px; font-size: 14.5px; line-height: 20px; color: var(--fg-secondary); }
.b3d-daisho-sub strong { color: var(--ink-900); }
.b3d-daisho-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-align: left; }
.b3d-daisho-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; }
.b3d-daisho-row + .b3d-daisho-row { border-top: 1px solid var(--border); }
.b3d-daisho-row.is-total { padding: 14px 16px; background: var(--ink-100); }
.b3d-daisho-rl { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg-secondary); }
.b3d-daisho-rv { font-size: 15px; font-weight: 600; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.b3d-daisho-strike { font-size: 12px; font-weight: 600; }
.b3d-daisho-was { text-decoration: line-through; color: var(--fg-tertiary); margin-right: 4px; }
.b3d-daisho-now { color: var(--sale-600); }
.b3d-daisho-save { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sale-600); background: #fdeaea; border-radius: 5px; padding: 3px 9px; }
.b3d-daisho-tl { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--ink-900); }
.b3d-daisho-tv { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.b3d-daisho-btns { display: flex; gap: 10px; margin-top: 20px; }
.b3d-daisho-yes { flex: 1.4; height: 44px; border-radius: 11px; border: 1.5px solid var(--accent-500); background: #fff; cursor: pointer; font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--accent-600); }
.b3d-daisho-yes:hover { background: var(--accent-50); }
.b3d-daisho-no { flex: 1; height: 44px; border-radius: 11px; border: none; background: var(--accent-500); cursor: pointer; font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: #fff; box-shadow: 0 4px 14px rgba(240,61,13,.28); }
.b3d-daisho-no:hover { filter: brightness(1.05); }

/* ── Compatibility / conflict dialog (1:1 with 3D builder DC) ── */
.b3d-conflict { position: fixed; inset: 0; z-index: 130; }
.b3d-conflict-scrim { position: absolute; inset: 0; background: rgba(15,26,24,.42); }
.b3d-conflict-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none; }
.b3d-conflict-card { position: relative; pointer-events: auto; width: 340px; max-width: 92vw; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(15,26,24,.5); animation: b3dDaishoIn .18s ease; }
.b3d-conflict-body { padding: 22px 22px 18px; text-align: center; }
.b3d-conflict-ic { width: 44px; height: 44px; margin: 0 auto 13px; border-radius: 50%; background: #fdeaea; display: flex; align-items: center; justify-content: center; }
.b3d-conflict-title { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink-900); margin-bottom: 8px; }
.b3d-conflict-txt { margin: 0; font-size: 14px; line-height: 19px; color: var(--fg-secondary); }
.b3d-conflict-txt .is-cause { color: var(--ink-900); font-weight: 700; }
.b3d-conflict-txt .is-steps { color: var(--sale-600); font-weight: 700; }
.b3d-conflict-note { margin: 10px 0 0; font-size: 12.5px; line-height: 16px; color: var(--fg-tertiary); }
.b3d-conflict-ok { width: 100%; height: 48px; border: none; border-top: 1px solid var(--border); background: #fff; cursor: pointer; font-family: var(--font-ui); font-size: 16px; font-weight: 600; color: var(--accent-600); }
.b3d-conflict-ok:hover { background: var(--ink-100); }

/* ── Layer-swap loading: the shown sword holds until every new layer file has
   loaded; a small pulse pill sits on the stage meanwhile, and the swap lands
   with a soft fade. ── */
/* Above the price change that rises from the Summary button at the same moment. */
.b3d-swapload { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; padding: 9px 15px; background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--sh-2); z-index: 60; pointer-events: none; animation: b3dSwapIn .25s ease both; }
.b3d-swapload span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-400); animation: b3dSwapDot 1.05s ease-in-out infinite; }
.b3d-swapload span:nth-child(2) { animation-delay: .16s; }
.b3d-swapload span:nth-child(3) { animation-delay: .32s; }
@keyframes b3dSwapDot { 0%, 100% { opacity: .3; transform: translateY(0); } 45% { opacity: 1; transform: translateY(-3px); } }
@keyframes b3dSwapIn { from { opacity: 0; transform: translate(-50%, 5px); } to { opacity: 1; transform: translate(-50%, 0); } }
.b3d-sword-layers img.b3d-fade, .b3dm-layers img.b3d-fade { animation: b3dLayerIn .4s ease both; }
@keyframes b3dLayerIn { from { opacity: 0; } to { opacity: 1; } }

/* First-load skeleton: flat silhouette of the sword, gently pulsing */
.b3d-skel-img { filter: opacity(.09) !important; animation: b3dSkelPulse 1.5s ease-in-out infinite; }
@keyframes b3dSkelPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes b3dHotPulse { 0% { opacity: .8; transform: scale(.6); } 75% { opacity: 0; transform: scale(1.7); } 100% { opacity: 0; transform: scale(1.7); } }

/* ══════════════════════════════════════════════════════════════════
   PLUGIN ADDITIONS
   Elements the prototype drew with inline styles or placeholders, plus the
   mobile layout. The design's own mobile screen was a second set of markup;
   this builds the same screen out of the one layout we render.
   ══════════════════════════════════════════════════════════════════ */

/* Add-ons progress: dots instead of a bar (was inline-styled in the prototype) */
.b3d-sec-dots { display: flex; align-items: center; gap: 4px; height: 4px; }
.b3d-sec-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-200); }
.b3d-sec-dot.is-on { background: var(--ink-900); }

/* Real option photos, where the prototype had a grey "PHOTO" placeholder.
   Most are shot on white; multiplied over the design's #f5f6f5 the white
   becomes that grey and the part itself is left as it was, so every card and
   the popup sit on the same background as the design's placeholders. */
.b3d-card-photo { width: 100%; height: 100%; object-fit: cover; display: block; mix-blend-mode: multiply; }
.b3d-info-photo.has-photo { background: #f5f6f5; position: relative; }

/* Photos load in over the design grey: cards fade in once they arrive (with a
   soft shimmer until then), the popup shows a spinner until its photo is in. */
.b3d-card-photo { opacity: 0; transition: opacity .25s ease; }
.b3d-card-photo.is-in { opacity: 1; }
.b3d-card-photo.is-broken { visibility: hidden; }
.b3d-thumb:has(> .b3d-card-photo:not(.is-in))::before {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.55) 50%, transparent 80%) #f5f6f5;
	background-size: 200% 100%; animation: b3dShimmer 1.2s ease-in-out infinite;
}
@keyframes b3dShimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.b3d-info-photo img { transition: opacity .2s ease; }
.b3d-info-photo.is-loading img { opacity: 0; }
.b3d-photo-spin { display: none; }
.b3d-info-photo.is-loading .b3d-photo-spin {
	display: block; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px;
	border-radius: 50%; border: 2.5px solid rgba(26,45,40,.14); border-top-color: var(--ink-900);
	animation: b3dSpin .8s linear infinite;
}
@keyframes b3dSpin { to { transform: rotate(360deg); } }
.b3d-info-photo img { width: 100%; height: 100%; object-fit: cover; display: block; mix-blend-mode: multiply; }
.b3d-chip-label.is-small { font-size: 15px; }

/* A message raised while the summary or a popup covers the stage. */
.b3d-toast.is-over { position: fixed; z-index: 140; max-width: calc(100vw - 32px); }

/* Between a laptop and a phone. The design covers wide screens and phones
   (<=640px); in between, its four section bars are squeezed between the logo
   and the buttons. Found at iPad sizes: labels cut off at 1024 wide (tipped
   over by the +1px type) and the bars running over the logo and Reset at 768.
   Wide tablets keep the design's 12px labels on tighter spacing; narrower
   ones give the bars their own row under the logo and buttons. */
@media (min-width: 641px) and (max-width: 1100px) {
	.b3d-progress { gap: 12px; }
	.b3d-sec-label { font-size: 12px; }
	.b3d-sec-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 641px) and (max-width: 1000px) {
	.b3d-head { flex-wrap: wrap; row-gap: 10px; }
	.b3d-progress { position: static; transform: none; order: 3; width: 100%; gap: 16px; }
	.b3d-sec-label { font-size: 13px; }
}

/* Need help: the dot is green while the chat is available, red when the bot
   has written and the chat is closed. */
.b3d-needhelp .b3d-needhelp-ic { position: relative; }
.b3d-needhelp.has-unread .b3d-needhelp-dot { background: var(--sale-600); }

/* A line the rules changed for the customer — the brief asks for these to be
   marked in the summary, because it is the last place they would notice. */
.b3d-rev-changed { font-style: normal; font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
	text-transform: uppercase; color: var(--accent-600); margin-left: 6px; white-space: nowrap; }

@media (max-width: 640px) {
	/* The rules above hide the desktop shell, because the prototype replaced it
	   with a separate mobile DOM at this width. We render one layout, so bring
	   the shell back, compact. */
	.b3d-head { display: flex; padding: 8px 12px; gap: 10px; }
	.b3d-lockup { padding: 2px 4px; gap: 8px; }
	.b3d-lockup:hover .b3d-lockup-main { display: inline-flex; }
	.b3d-lockup-back { display: none !important; }   /* a hover swap means nothing on touch */
	.b3d-lockup-logo { width: 26px; height: 26px; }
	.b3d-lockup-name { font-size: 14px; }
	.b3d-lockup-sub { font-size: 10px; }
	.b3d-head-actions { gap: 6px; margin-left: auto; }
	.b3d-hbtn, .b3d-needhelp { height: 32px; padding: 0 10px; font-size: 13px; position: static; }
	.b3d-needhelp-ic { display: none; }

	/* These carry real information; the prototype hid them only because its
	   mobile markup showed them elsewhere. */
	.b3d-warn { display: flex; font-size: 12.5px; padding: 6px 10px; }
	.b3d-warn.is-locks { display: none; }   /* the design keeps the phone's stage clear of it */
	.b3d-info-note { display: flex; }
	.b3d-rev-label { display: block; width: auto; }

	/* The sword goes diagonal, as the mobile design does, so a long blade fills
	   a narrow screen. */
	.b3d-stage { flex: 0 0 34vh; }
	.b3d-sword { width: 128%; transform: rotate(47deg); transform-origin: center center;
		transition: transform .4s cubic-bezier(.4, 0, .2, 1); }

	/* width:100% plus padding overflowed the screen and clipped "Next". */
	.b3d-navrow { display: flex; align-items: center; justify-content: space-between; gap: 8px;
		width: auto; box-sizing: border-box; }
	/* Back and Next each keep a fixed slot, present or not, so the summary
	   button between them is the same width on every step. */
	.b3d-navrow > div { flex: 0 0 76px; gap: 6px; min-width: 0; }
	.b3d-navrow > .b3d-navbtn--left { justify-content: flex-start; }
	.b3d-navrow > .b3d-navbtn--right { justify-content: flex-end; }
	.b3d-navbtn { height: 30px; padding: 0 10px; font-size: 13px; }
	.b3d-skip { display: none; }                      /* no room; Next covers it */
	.b3d-summary-btn { flex: 1 1 0; min-width: 0; justify-content: center; }

	.b3d-part-head { height: auto; flex-wrap: wrap; row-gap: 8px; }
	.b3d-card { width: 132px; flex: 0 0 132px; }
	.b3d-rev-cols { grid-template-columns: 1fr; }
	.b3d-rev-row { grid-template-columns: 10px 1fr auto; }
	.b3d-lengths { gap: 14px; }
}

/* A length the rules rule out: a shorter, paler mark the knob will not settle
   on. Two pixels wide is too little for an icon, so it reads by contrast. */
.b3d-tick.is-blocked { height: 5px; top: 17px; background: var(--ink-200); cursor: not-allowed; }

/* Plugin (client, 4 Oct): the estimate note is a hover card with no close
   button. Shown on hover or keyboard focus where there is a mouse, and by a
   tap (.is-open) on touch screens. */
.b3d-rev-est .b3d-estpop { display: none; }
.b3d-rev-est.is-open .b3d-estpop { display: block; }
@media (hover: hover) {
	.b3d-rev-est:hover .b3d-estpop, .b3d-rev-est:focus-within .b3d-estpop { display: block; }
	.b3d-rev-est:hover .b3d-rev-est-q { background: var(--ink-900); color: #fff; }
	/* a bridge over the gap, so the card stays while the pointer moves up to it */
	.b3d-rev-est .b3d-estpop::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; }
}
.b3d-estpop p + p { margin-top: 8px; }
.b3d-estpop { white-space: normal; }

/* Plugin (client, 4 Oct): extra time as a grey chip beside the price in the
   option popup, as in the design. */
.b3d-info-price { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.b3d-info-lead { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
	background: var(--ink-100); color: var(--fg-secondary); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.b3d-info-lead svg { flex: none; }
@media (max-width: 640px) {
	.b3d-info-price { justify-content: flex-end; gap: 6px; }
	.b3d-info-lead { font-size: 11.5px; padding: 2px 7px; }
}

/* ══════════ Plugin (client, 4 Oct): the phone layout of the mobile design ══════════
   One DOM still, but at ≤640px it now takes the mobile design's shape: header
   with an icon-only Reset (room for the chat button), a summary bar with the
   price and the progress over every part, the whole sword on the diagonal,
   the nav as pills over the edge of the stage, and the summary opening under
   the bar with the design's compact footer. */
.b3dm-sumbar[data-sumbar], .b3d-rev-count-m, .b3d-skip--m, .b3d-viewsum { display: none; }
.skb-has-overlay .b3d-sheet-body { overflow: hidden; }
.b3d-rev-body, .b3d-info-body, .b3d-info-card { overscroll-behavior: contain; }

@media (max-width: 640px) {
	.b3d { height: 100vh; height: 100dvh; min-height: 0; }

	.b3d-head { padding: 8px 12px; }
	.b3d-lockup-logo { width: 28px; height: 28px; }
	.b3d-lockup-name { font-size: 14.5px; }
	.b3d-lockup-sub { font-size: 9.5px; }
	.b3d-head { gap: 6px; padding: 8px 10px; }
	/* The lockup gives way before the buttons do: on the narrowest phones the
	   brand name ends in an ellipsis rather than pushing the chat off screen. */
	.b3d-lockup { flex: 0 1 auto; min-width: 0; padding: 2px; gap: 6px; }
	.b3d-lockup-main { min-width: 0; gap: 7px; }
	.b3d-lockup-txt { min-width: 0; overflow: hidden; }
	.b3d-lockup-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
	.b3d-head-actions { gap: 6px; flex: none; }
	.b3d-hbtn-txt { display: none; }
	.b3d-hbtn[data-act="reset"] { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 50%; }
	.b3d-needhelp { height: 34px; padding: 0 11px 0 6px; gap: 6px; font-size: 13px; white-space: nowrap; }
	.b3d-needhelp-ic { display: inline-flex; width: 22px; height: 22px; }

	.b3dm-sumbar[data-sumbar] { display: flex; position: relative; z-index: 39; }

	.b3d-stage { flex: 1 1 0; min-height: 120px; }
	.b3d-view { padding-bottom: 16px; }
	.b3d-sheet { flex: none; height: 41%; min-height: 250px; display: flex; flex-direction: column; }
	.b3d-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 14px 12px; gap: 9px; }

	.b3d-navrow { position: absolute; top: -14px; left: 0; right: 0; transform: none; margin: 0; padding: 0 14px;
		width: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; z-index: 65; }
	.b3d-navrow > div { flex: 1 1 0; display: flex; min-width: 0; }
	.b3d-navrow > .b3d-navbtn--right { justify-content: flex-end; }
	.b3d-summary-btn { display: none; }
	.b3d-navbtn { height: 28px; padding: 0 12px; gap: 6px; font-size: 12px; }
	.b3d-navrow > div .b3d-skip { display: none; }
	.b3d-skip--m, .b3d-viewsum { display: inline-flex; flex: none; }

	.b3d-review { top: var(--b3dm-top, 0px); }
	.b3d-rev-head { display: none; }
	.b3d-rev-body { padding: 12px 16px 24px; }
	/* Option names line up in one column, as in the design. */
	.b3d-rev-label { display: block; flex: none; width: 108px; }   /* "Fuchi & Kashira" in full (client, 10 Nov) */
	.b3d-rev-count-m { display: block; font-size: 12.5px; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; margin-bottom: 12px; }
	.b3d-rev-foot.is-phone { display: block; padding: 14px 16px 18px; }
	.b3dm-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
	.b3d-rev-foot.is-phone .b3d-rev-total { gap: 8px; min-width: 0; }
	.b3d-rev-foot.is-phone .b3d-rev-total-num { font-size: 18px; white-space: nowrap; }
	.b3d-rev-foot.is-phone .b3d-rev-ship { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.b3d-rev-foot.is-phone .b3d-rev-est { position: static; font-size: 13px; white-space: nowrap; }
	.b3d-rev-foot.is-phone .b3d-rev-cart-btn { display: block; width: 100%; margin: 10px 0 0; height: 45px; font-size: 15.5px; }
	.b3d-rev-foot.is-phone .b3d-estpop, .b3d-rev-foot.is-phone .b3d-notespop {
		position: absolute; left: 16px; right: 16px; top: auto; bottom: calc(100% - 4px); width: auto; max-width: none; z-index: 70; }
	.b3d-rev-foot.is-phone .b3d-estpop::after, .b3d-rev-foot.is-phone .b3d-notespop::after { display: none; }
	.b3dm-notelink { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; white-space: nowrap;
		font-size: 13.5px; font-weight: 600; color: var(--ink-900); text-decoration: underline; text-underline-offset: 3px;
		text-decoration-color: var(--ink-400); }
	.b3dm-notelink.is-filled svg { color: var(--ok-600); }
}

/* Plugin (client, 4 Oct): the daishō offer shows the customer's own sword over
   a copy about two thirds as long, or the picture chosen in the settings. */
.b3d-daisho-visual { overflow: hidden; }
.b3d-daisho-pair { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.b3d-daisho-sword { width: 100%; display: flex; align-items: center; gap: 12px; }
.b3d-daisho-sword.is-short { width: 66%; margin-left: auto; margin-right: auto; }
.b3d-daisho-art { flex: 1; min-width: 0; position: relative; }
.b3d-daisho-art .b3d-sword-layers { width: 100%; }
.b3d-daisho-art img.is-leaving, .b3d-daisho-art img.is-loading { display: none; }
.b3d-daisho-img { display: block; max-width: 100%; max-height: 172px; object-fit: contain; }
@media (max-width: 640px) {
	.b3d-daisho-visual { height: 170px; padding: 0 18px; }
	.b3d-daisho-copy { padding: 18px 18px 20px; }
	.b3d-daisho-btns { flex-direction: column-reverse; }
	.b3d-daisho-yes, .b3d-daisho-no { flex: none; width: 100%; }
}

/* Plugin (client's latest files, 6 Oct): the Summary button turns red with a
   warning while a part needs picking again. */
.b3d-summary-btn.has-conflict { background: #fdf1f0; border-color: #f2c4bf; color: var(--ink-900); }
.b3d-summary-btn.has-conflict:hover { border-color: #e59a92; }
.b3d-summary-btn.has-conflict .b3d-summary-sub { color: var(--sale-600); }
.b3d-summary-alert { display: inline-flex; align-items: center; color: var(--sale-600); flex: none; margin-left: 2px; }
/* A locked option's popup names what it clashes with. */
.b3d-info-note.is-lock { display: inline-flex; width: auto; align-items: center; padding: 8px 12px 8px 10px; gap: 8px; margin-top: 12px;
	border: 1px solid var(--border); border-radius: 6px; background: var(--ink-100); color: var(--fg-secondary); font-size: 13px; font-weight: 500; }
.b3d-info-note.is-lock b { font-weight: 600; color: var(--ink-900); }
.b3d-info-note.is-lock svg { color: var(--ink-700); flex: none; }

@media (max-width: 640px) {
	/* The latest files drop the phone's top summary bar: Summary sits between
	   Back and Next as on a computer, and Skip floats over the stage above. */
	.b3dm-sumbar[data-sumbar] { display: none; }
	.b3d-summary-btn { display: inline-flex; flex: none; height: 28px; padding: 0 8px 0 12px; gap: 6px; font-size: 12px; }
	.b3d-summary-btn svg { width: 10px; height: 10px; }
	.b3d-navrow > div { flex: 1 1 0; }
	.b3d-navrow .b3d-skip--m { position: absolute; top: -50px; left: 50%; transform: translateX(-50%); z-index: 65; }
	.b3d-rev-count-m { display: flex; align-items: center; justify-content: space-between; }
	.b3d-rev-count-x { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid var(--border); background: #fff;
		display: inline-flex; align-items: center; justify-content: center; color: var(--ink-900); }
	.b3d-info-note.is-lock { display: inline-flex; font-size: 12px; }
}

/* ══════════ Plugin (client, 6 Oct) ══════════ */

/* Computer: the stage had far more air around the sword than it needs, so the
   option tray takes some of it — the cards grow with the window's height,
   never below the design's 152px. The tray is always the card plus 156px. */
@media (min-width: 641px) {
	.skb-builder { --skb-card: clamp(152px, calc(40vh - 160px), 216px); }
	.b3d-sheet { height: calc(var(--skb-card) + 156px); }
	.b3d-card { width: var(--skb-card); flex: 0 0 var(--skb-card); }
}

/* Taps: no double-tap zoom on fast Back/Next taps; a finger on a card can
   still scroll the tray up and down; the page never bounces behind. */
.skb-builder { touch-action: manipulation; }
.b3d-cards { touch-action: pan-x pan-y; overscroll-behavior-x: contain; }
.b3d-sheet-body { overscroll-behavior: contain; }

.b3d-part-head .b3d-help { padding: 0; background: #fff; }

@media (max-width: 640px) {
	.b3d-sheet-body { padding-bottom: 15px; }              /* the card bottoms were cut */
	/* The stage centres the sword with flex, which shrank it back to the
	   stage's width: the size worked out for the diagonal never showed. */
	.b3d-stage .b3d-sword { flex: none; }
	/* Back at the far left, as Next is at the far right (a desktop rule for
	   the grid layout was pushing it inwards). */
	.b3d-navrow > div.b3d-navbtn--left:first-child { justify-content: flex-start; }
	.b3d-part-counter { display: none; }                   /* "6 / 13" goes on a phone */
	.b3d-rev-val { font-size: 13px; }
	/* Option popup: a smaller name, the extra time under the price. */
	.b3d-info-name { font-size: 16px; }
	.b3d-info-price { flex-direction: column; align-items: flex-end; gap: 4px; }
	/* A long option name gets the card's whole width, and the price sits under
	   it on the right; the tray evens the cards' heights out. */
	.b3d-card-foot { height: auto; min-height: 52px; }
	.b3d-card-foot.is-long { flex-direction: column; align-items: stretch; gap: 3px; }
	.b3d-card-foot.is-long .b3d-card-price { align-self: flex-end; }
	.b3d-card-foot.is-long .b3d-card-name { -webkit-line-clamp: 2; }
}

/* The theme sizes every h1–h4 with !important (custom.css: h3 24px, 22px on
   phones), which beat the popup name's own size. Ours wins again, only here. */
.skb-builder .b3d-info-name { font-size: 23px !important; }
@media (max-width: 640px) {
	.skb-builder .b3d-info-name { font-size: 16px !important; }
}

/* The step's "?" text on a phone: anchored to the step header, full width,
   so it never runs off the screen whatever the step's name. */
@media (max-width: 640px) {
	.b3d-part-head { position: relative; }
	.b3d-part-head .b3d-help { position: static; }
}

/* The sword's layers carry their own z-index from Airtable (the fuchi/kashira
   is 70). Kept in their own stacking context, every layer stays under the
   zoom controls, the hints, the toast and the warning. */
.b3d-stage > .b3d-view { isolation: isolate; z-index: 0; }

/* ══════════ Plugin (client, 6 Oct evening): the phone, again ══════════ */
@media (max-width: 640px) {
	/* The sword's angle is worked out for the stage (fitSword); turning
	   towards it from the stylesheet's 47° would spin it as the page opens. */
	.b3d-stage .b3d-sword { transition: none; }

	/* The last step has no "View summary": the Summary pill in the middle opens it. */
	.b3d-viewsum { display: none; }

	/* The tray is exactly as tall as the step needs, with a little air under
	   the cards (and over the iPhone's home bar when there is one): every
	   other pixel goes to the sword (client, 6 Oct evening). It only scrolls
	   on a step taller than two thirds of the screen. */
	.b3d-sheet { height: auto; min-height: 0; max-height: 66%; }
	.b3d-sheet-body { flex: 0 1 auto; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
	.b3d-cards { padding-bottom: 3px; }   /* phones draw no scrollbar under the cards */
	.b3d-stage .b3d-sword.is-fitted { transition: width .3s ease, transform .3s ease; }

	/* A finger on a card scrolls the cards sideways and nothing else, the
	   rail never animates under it, and a press does not start the iPhone's
	   image preview or text selection. */
	.b3d-cards { touch-action: pan-x; scroll-behavior: auto; }
	.b3d-card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
	.b3d-card-photo { pointer-events: none; -webkit-user-drag: none; }

	/* Every card: the name first, the price on its own line under it,
	   at the same height on every card. */
	.b3d-card-foot, .b3d-card-foot.is-long { flex: 1 0 auto; flex-direction: column; align-items: stretch; gap: 4px; min-height: 0; }
	.b3d-card-foot .b3d-card-name, .b3d-card-foot.is-long .b3d-card-name { -webkit-line-clamp: 2; }
	.b3d-card-foot .b3d-card-price, .b3d-card-foot.is-long .b3d-card-price { align-self: flex-start; margin-top: auto; }

	.b3d-part-head { z-index: 5; }

	/* The summary's count and × stay at the top while it scrolls. */
	.b3d-rev-body { padding-top: 0; }
	.b3d-rev-count-m { position: sticky; top: 0; z-index: 3; background: #fff; margin: 0; padding: 12px 0 10px; }
}

/* The option popup on a phone (client, 6 Oct evening): one fixed height that
   fits the screen Safari actually shows (dvh, not vh, which ignores its
   toolbars), the same for every option so paging does not jump; the photo
   keeps its share and a long description scrolls inside. */
@media (max-width: 640px) {
	.b3d-info-wrap { max-height: 100%; }
	.b3d-info-card { flex: 0 1 auto; min-height: 0; max-height: none;
		height: min(620px, calc(100vh - 94px)); height: min(620px, calc(100dvh - 94px)); }
	.b3d-info-photo { flex: none; aspect-ratio: auto; width: 100%; height: 46%; max-height: none; }
	.b3d-info-photo img { object-fit: contain; }
	.b3d-info-main { flex: 1 1 0; min-height: 0; }
	.b3d-info-body { flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
	/* The extra time beside the price when the name leaves room (fitInfoHead). */
	.b3d-info-head.is-inline .b3d-info-price { flex-direction: row; align-items: center; gap: 8px; }
}

/* The daishō pair (client, 6 Oct evening): the wakizashi is the same sword
   with a shorter blade and handle, at the katana's thickness (daishoPairHTML),
   and the two lie further apart, filling the picture. Each sword is cropped
   to what is drawn; the wakizashi's row is as much shorter as its sword. */
.b3d-daisho-visual { padding: 0 34px; }
.b3d-daisho-visual .b3d-daisho-pair { height: 100%; align-items: stretch; justify-content: space-evenly; gap: 0; padding: 30px 0 8px; box-sizing: border-box; }
.b3d-daisho-pair .b3d-daisho-sword { width: 100%; gap: 12px; }
.b3d-daisho-pair .b3d-daisho-sword.is-short { width: calc(76px + (100% - 76px) * var(--skb-wak, .7)); margin: 0 auto; }
.b3d-daisho-pair .b3d-daisho-bladelabel { width: 64px; text-align: right; }
.b3d-daisho-pair .b3d-daisho-art { flex: 1 1 0; min-width: 0; position: relative; overflow: hidden; }
/* The wakizashi: pieces of the katana's own picture, side by side, each
   clipped to its width only, so a piece moved up or down is not cut. */
.b3d-daisho-pair .b3d-daisho-art.is-wak { display: flex; overflow: visible; }
.b3d-daisho-seg { position: relative; flex: none; height: 100%; clip-path: inset(-60% 0 -60% -1.5px); }   /* reaches under its left neighbour: no hairline at the join */
.b3d-daisho-frame { position: absolute; }
.b3d-daisho-frame img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
@media (max-width: 640px) {
	.b3d-daisho-visual { padding: 0 18px; }
	.b3d-daisho-pair .b3d-daisho-bladelabel { width: 58px; font-size: 9.5px; }
	.b3d-daisho-pair .b3d-daisho-sword { gap: 8px; }
	.b3d-daisho-pair .b3d-daisho-sword.is-short { width: calc(66px + (100% - 66px) * var(--skb-wak, .7)); }
}

/* Phone (client, 6 Oct evening): a step's option tabs always on their own
   line under its name, whatever the name's length. */
@media (max-width: 640px) {
	.b3d-part-head .b3d-groups { flex: 0 0 100%; min-width: 0; margin-left: 0; }
	.b3d-part-head .b3d-groups:has(> .b3d-groups-track:empty) { display: none; }
}

/* The design's swap loader (client, 26 Oct): while a picked part's files load,
   the sword holds and a small pill of pulsing dots sits on the stage. */
/* Above the price change that rises from the Summary button at the same moment. */
.b3d-swapload { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); display: none; align-items: center; gap: 5px; padding: 9px 15px; background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 6px 18px rgba(11,19,16,.08); z-index: 60; pointer-events: none; }
.b3d-swapload.is-on { display: flex; animation: b3dSwapIn .25s ease both; }
.b3d-swapload span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-400); animation: b3dSwapDot 1.05s ease-in-out infinite; }
.b3d-swapload span:nth-child(2) { animation-delay: .16s; }
.b3d-swapload span:nth-child(3) { animation-delay: .32s; }
@keyframes b3dSwapDot { 0%, 100% { opacity: .3; transform: translateY(0); } 45% { opacity: 1; transform: translateY(-3px); } }
@keyframes b3dSwapIn { from { opacity: 0; transform: translate(-50%, 5px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* Phone: at the top, clear of the "Skip to last step" pill at the bottom. */
@media (max-width: 640px) {
	.b3d-swapload { bottom: auto; top: 12px; padding: 7px 12px; }
}
