/* ============================================================
 * iExcellents · JeansTailor Designer — styles
 * Runs INSIDE the Lobo trade-tool shell (.iex-tool-shell): breadcrumb +
 * .cg-header + the 1220px unified column, same as LumenProof / PPWR / HS Code.
 * Tokens are taken from the theme so the tool reads as a sibling page:
 *   page #0d0d10 · panel rgba(21,22,27,.9) · hairline rgba(255,255,255,.06)
 *   text #f0f1f5 · secondary #9aa0aa · accent #1f80ff
 * ============================================================ */
:root {
  --blue: #1f80ff;
  --blue-dark: #0f62d8;
  --blue-soft: rgba(31, 128, 255, 0.10);
  --ink: #14161a;
  --ink2: #3d434e;
  --paper: #f7f8fa;
  --card: #ffffff;
  --card-2: #f2f4f7;
  --line: rgba(16, 18, 22, 0.08);
  --line-2: rgba(16, 18, 22, 0.14);
  --muted: #5b616e;
  --ok: #1d7a35;
  --err: #c62b22;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(16, 18, 22, 0.05), 0 10px 24px rgba(16, 18, 22, 0.06);
}

/* ---------- content surface ----------
 * Lobo's page setting paints this page White while the site chrome is black.
 * We fix that by painting ONLY the content band — body, #main-wrapper,
 * #content-wrapper and the fixed nav keep whatever the theme gives them, so
 * the nav strip stays theme-black exactly like every other page.
 * app.js does not touch theme nodes either; all offsets live inside
 * .iex-tool-shell. */
.content-module.post-wrapper,
.post-body,
.post-excerpt { background: var(--paper) !important; }

/* Lobo's page-title strip is KEPT (option A): it gives the dark band under the
   fixed nav that every other trade tool has. Do not hide it. */

/* breathing room inside our own container (the theme's spacer + 60px padding
   already keep the fixed nav clear, so this is only visual) */
.iex-tool-shell { padding-top: 8px; }

/* let the tool use the full content column */
article.hentry.four-fifth { width: 100% !important; max-width: 100% !important; }

/* ---------- shell integration (matches the other trade tools) ---------- */
.jd-app {
  max-width: 1220px; margin: 0 auto; width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans",
               "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.jd-app *, .jd-app *::before, .jd-app *::after { box-sizing: border-box; }
.jd-app ::selection { background: var(--blue-soft); }

/* standalone preview only: on WP the theme owns the canvas, and painting body
   would also repaint the nav strip (the nav is transparent over body) */
body:not(.wp-theme-lobo) { background: var(--paper); }

/* ---------- controls live in the shell header (no second toolbar) ---------- */
/* HIG › branding: the page title already names the product, so the app does
   not repeat its own brand bar underneath it — only the controls remain. */
.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
}
.jd-controls {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 14px; justify-content: flex-end;
}

/* ---------- top row: identity left, controls right (one line) ---------- */
.jd-top {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 0 0 18px;
}
.jd-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jd-eyebrow {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.jd-name {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1.15;
  letter-spacing: -0.02em; color: var(--ink); font-weight: 700;
}

/* iOS segmented control */
.seg {
  display: inline-flex;
  background: rgba(16, 18, 22, 0.06);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  background: transparent; color: var(--ink); border: 0;
  padding: 5px 16px; min-height: 28px; cursor: pointer; font-size: 0.85em;
  border-radius: 7px; font-weight: 500;
  transition: background 160ms ease, color 160ms ease;
}
.seg button:active { transform: scale(0.97); }
.seg button.active {
  background: #ffffff; color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 18, 22, 0.16);
}
.lang-btn {
  background: transparent; color: var(--ink); border: 0;
  border-radius: 8px; padding: 5px 12px; min-height: 28px; cursor: pointer;
  font-size: 0.85em; font-weight: 500;
}
.lang-btn:hover { background: rgba(16, 18, 22, 0.06); }
.lang-btn.active { background: var(--blue-dark); color: #fff; font-weight: 600; }

/* ---------- layout: one centred column pair ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 36%, 420px);
  gap: 24px; align-items: start; padding: 0 0 28px;
}
.panel { min-width: 0; }
.preview-col { position: sticky; top: 160px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* the shell is edge-to-edge on phones; give the tool a 14px gutter so the
     breadcrumb, title strip and cards never touch the glass */
  .iex-tool-shell { padding-left: 14px !important; padding-right: 14px !important; }
  .layout { padding: 0 0 24px; }
  .preview-col { position: static; order: -1; width: 100%; }
  .jd-top { gap: 12px; margin-bottom: 14px; }
  #tagline { margin-top: 0; }
  #how { padding: 14px 14px 4px; }
  .card { padding: 16px; }
  .preview-tools { gap: 6px; }
  #steps-nav:not(.jd-progress) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-txt small { display: none; }
  .layout { grid-template-columns: 1fr; }
  .preview-col { position: static; }
  .measure-layout { flex-direction: column; }
  .measure-diagram-wrap { flex: 1 1 auto; max-width: 100%; }
  #mold-viewer { height: min(600px, 115vw); }
  .summary-table th { width: 42%; }
  #submit-btn { flex: 1 1 100%; }
  /* 16px inputs prevent iOS Safari auto-zoom on focus */
  .form-grid input, .form-grid textarea, .measure-field input, .extra-row input[type=text] { font-size: 16px; }
}

/* touch targets: comfortable hit areas on coarse pointers (HIG ≥28pt, aim 44pt) */
@media (pointer: coarse) {
  /* HIG: 44x44 pt is the comfortable mobile target; 28x28 is the floor */
  .btn, .btn-sm, .opt-btn, .seg button, .lang-btn, .choice-btns .opt-btn {
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  }
  .opt-btn { padding: 9px 18px; }
  .btn { padding: 12px 24px; }
  .btn-sm { padding: 9px 14px; }
  .seg button { padding: 7px 16px; }
  .lang-btn { padding: 7px 12px; }
  .preview-tools .btn { padding: 8px 14px; }
  .step-chip { padding: 12px 14px; }
  .color-btn { width: 36px; height: 36px; }
  .fabric-card { min-height: 44px; }
}

/* ---------- progress rail (legacy .step-chip cards, kept for old pages) ----------
 * :not(.jd-progress) so the v1.6 dot row — which reuses #steps-nav as its
 * mount point — is never forced into this 4-column grid. */
#steps-nav:not(.jd-progress) {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin: 0 0 18px;
}
.step-chip {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-top: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; min-height: 54px; cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.step-chip:hover { border-color: rgba(31, 128, 255, 0.5); }
.step-chip:active { transform: scale(0.99); }
.step-chip.active { border-color: var(--blue); background: rgba(31, 128, 255, 0.09); }
.sc-num {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(16, 18, 22, 0.07); color: var(--ink);
  font-size: 0.78em; font-weight: 700;
}
.step-chip.active .sc-num { background: var(--blue-dark); color: #fff; }
.step-chip.done .sc-num { background: rgba(29, 122, 53, 0.12); color: #1d7a35; }
.sc-txt { min-width: 0; }
.sc-txt strong { display: block; font-size: 0.84em; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-txt small { color: var(--muted); font-size: 0.78em; }

/* ---------- step bodies ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-top: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 20px; margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.hidden { display: none !important; }
.card h4, .preview-card h4 { margin: 0 0 12px; font-size: 0.98em; font-weight: 700; letter-spacing: -0.01em; }

/* fabric */
.fabric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
.fabric-card {
  border: 2px solid transparent; border-radius: 12px; overflow: hidden;
  cursor: pointer; background: var(--card-2); outline: 1px solid var(--line);
  transition: transform 160ms ease, border-color 160ms ease;
}
.fabric-card:hover { transform: translateY(-2px); }
.fabric-card:active { transform: scale(0.98); }
.fabric-card.active { border-color: var(--blue); outline-color: transparent; }
.fabric-swatch { height: 70px; }
.fabric-photo { width: 100%; height: 70px; object-fit: cover; display: block; }
.fabric-name { font-size: 0.8em; font-weight: 600; padding: 7px 9px 0; }
.fabric-meta { font-size: 0.78em; color: var(--muted); padding: 2px 9px 9px; }
.fabric-cat { font-size: 0.78em; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 16px 0 8px; }


/* ---------- fabric presentation (craft pass) ----------
 * group titles become eyebrows so they sit below the step title in hierarchy;
 * names get a two-line box so cards share a baseline even when a name wraps. */
.fabric-group h4 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--muted); margin: 20px 0 10px;
}
.fabric-group:first-child h4 { margin-top: 4px; }
.fabric-grid { gap: 12px; }
.fabric-name {
  font-size: 0.8em; font-weight: 600; padding: 8px 10px 0;
  min-height: 2.6em; line-height: 1.3;
}
.fabric-meta {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); padding: 4px 10px 10px;
}

/* options */
.opt-group { margin-bottom: 16px; }
.opt-label { font-weight: 600; font-size: 0.88em; margin-bottom: 7px; }
.opt-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-btn {
  border: 1px solid var(--line); background: var(--card-2); border-radius: 980px;
  padding: 6px 15px; cursor: pointer; font-size: 0.85em; color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease, transform 100ms ease;
}
.opt-btn:active { transform: scale(0.96); }
.opt-btn:hover { border-color: var(--blue); }
.opt-btn.active {
  /* blue-dark, not blue: white on #1f80ff is 3.76:1, below the 4.5:1 floor */
  background: var(--blue-dark); color: #fff; border-color: var(--blue-dark); font-weight: 600;
}
.opt-btn.disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

/* extras */
.extra-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.extra-name { font-size: 0.85em; width: 150px; }
.extra-row input[type=text] {
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; width: 160px;
  font-family: inherit; font-size: 0.9em;
}
.extra-row input[type=text]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.choice-btns { display: inline-flex; gap: 7px; flex-wrap: wrap; }
.choice-btns .opt-btn { font-size: 0.8em; padding: 5px 13px; }
.color-btns { display: inline-flex; gap: 7px; }
.color-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--card-2); box-shadow: 0 0 0 1px var(--line);
  cursor: pointer; padding: 0;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.color-btn:active { transform: scale(0.9); }
.color-btn.active { box-shadow: 0 0 0 2px var(--blue); transform: scale(1.12); }

/* measurements */
.measure-layout { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.measure-diagram-wrap { flex: 0 0 190px; }
.measure-diagram {
  width: 100%; max-width: 190px; height: auto;
  border-radius: 12px; background: #f2f2f4; padding: 6px; box-sizing: border-box;
}
.measure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; flex: 1 1 260px; }
.measure-field { display: flex; flex-direction: column; font-size: 0.85em; gap: 4px; }
.measure-field input {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-family: inherit;
}
.measure-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.tip {
  font-size: 0.8em; color: var(--ink2);
  background: var(--blue-soft); border-left: 3px solid var(--blue);
  padding: 9px 13px; border-radius: 0 10px 10px 0;
}

/* quote */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.form-grid label { display: flex; flex-direction: column; font-size: 0.85em; gap: 4px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px;
  font-family: inherit; font-size: 0.92em;
}
.form-grid input:focus, .form-grid textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.summary-table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.summary-table th { text-align: left; width: 200px; color: var(--muted); font-weight: 600; padding: 6px 8px; vertical-align: top; }
.summary-table td { padding: 6px 8px; border-top: 1px solid var(--line); }

/* nav buttons */
.nav-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.status { padding: 10px 14px; border-radius: 12px; font-size: 0.85em; line-height: 1.5; }
.status.sending { background: var(--blue-soft); border: 1px solid var(--blue); }
.status.ok { background: rgba(29, 122, 53, 0.08); color: #1d7a35; border: 1px solid rgba(29, 122, 53, 0.3); }
.status.error { background: rgba(198, 43, 34, 0.07); color: #c62b22; border: 1px solid rgba(198, 43, 34, 0.28); }
.status a { color: inherit; font-weight: 700; }
.btn {
  border: 0; border-radius: 980px; padding: 10px 22px;
  font-size: 0.9em; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: transform 100ms ease, background 160ms ease, box-shadow 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-dark { background: #f5f5f7; color: #0b0b0d; }
.btn-dark:hover { background: #d1d1d6; }
.btn-gold { background: var(--blue-dark); color: #fff; }
.btn-gold:hover { background: #0b56c0; }
.btn-ghost { background: #ffffff; border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* submit row (production order actions) */
.submit-row-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.submit-row-btns .status { width: 100%; }


/* ---------- form fields: dark surface, light text (HIG: one surface, one look) ---------- */
.form-grid input, .form-grid textarea,
.measure-field input, .extra-row input[type=text] {
  background: var(--card-2);
  border: 1px solid var(--line-2);
  color: var(--ink);
  border-radius: 10px;
  font-family: inherit;
}
.form-grid input::placeholder, .form-grid textarea::placeholder,
.measure-field input::placeholder, .extra-row input[type=text]::placeholder {
  color: #8a909c;
}
.form-grid input:focus, .form-grid textarea:focus,
.measure-field input:focus, .extra-row input[type=text]:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
/* keep autofill from repainting fields light */
.form-grid input:-webkit-autofill, .form-grid textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
}

/* ---------- preview ---------- */
.preview-card {
  background: var(--card); border: 1px solid var(--line);
  border-top: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-card);
}
.canvas-wrap {
  background: #eef1f5; border-radius: 14px; text-align: center; overflow: hidden;
  position: relative;
}
#preview-canvas { width: 100%; max-width: 340px; height: auto; display: inline-block; }
#preview-canvas-3d {
  width: 100%; max-width: 340px; aspect-ratio: 1 / 2; display: none;
  touch-action: none; cursor: grab; background: #eef1f5; margin: 0 auto;
}
#preview-canvas-3d:active { cursor: grabbing; }
#mold-viewer {
  width: 100%; max-width: none; height: auto; aspect-ratio: 4 / 5;
  max-height: 68vh; display: none;
  background: #eef1f5; margin: 0 auto;
}
#mold-viewer.on { display: block; }
.mold-note {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 5;
  background: rgba(29, 29, 31, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff; font-size: 0.78em; line-height: 1.35;
  padding: 5px 10px; border-radius: 8px; pointer-events: none;
}
.viewer3d-fallback {
  padding: 18px; font-size: 0.8em; color: var(--muted);
  background: var(--card-2); border: 1px dashed var(--line);
  border-radius: 10px; margin-top: 10px;
}

/* preview tools: one segmented mode row + one compact action row */
.preview-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.preview-tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.preview-tools .lbl { font-size: 0.76em; color: var(--muted); }
.preview-tools .btn.active { background: var(--blue-dark); color: #fff; border-color: var(--blue-dark); }
.preview-tools .btn { border-radius: 8px; }

/* price box removed — production-order flow carries no prices */
.info-strip { margin-top: 10px; font-size: 0.8em; color: var(--muted); }
.info-strip .gold { color: var(--blue-dark); font-weight: 600; }

/* ---------- footer ---------- */
#footer-note { padding: 18px 0 8px; font-size: 0.85em; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- print design sheet ---------- */
#print-sheet { display: none; }
@media print {
  /* the tool now lives inside the theme shell, so hide the shell and the site
     chrome rather than "everything that is a child of body" */
  #header, #main-wrapper > header, #content-wrapper, .iex-tool-shell,
  .jd-app, #footer-note { display: none !important; }
  body { background: #fff !important; }
  #print-sheet { display: block !important; }
  #print-sheet { display: block; position: relative; padding: 24px; color: #000; }
  #print-sheet .wm {
    position: fixed; top: 40%; left: -20%; width: 140%; text-align: center;
    font-size: 42px; color: rgba(0, 0, 0, 0.06); transform: rotate(-30deg); font-weight: 800;
    letter-spacing: 6px; pointer-events: none; z-index: 0;
  }
  #print-sheet .ps-head { display: flex; justify-content: space-between; border-bottom: 3px solid #000; padding-bottom: 8px; margin-bottom: 16px; }
  #print-sheet h2 { font-size: 1.1em; }
  #print-sheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
  #print-sheet th { text-align: left; width: 180px; padding: 4px 6px; color: #333; }
  #print-sheet td { padding: 4px 6px; border-top: 1px solid #ccc; }
  #print-sheet .ps-body { display: flex; gap: 24px; }
  #print-sheet .ps-left { flex: 1; }
  #print-sheet .ps-right img { width: 260px; }
  #print-sheet .ps-foot { margin-top: 24px; font-size: 10px; color: #555; border-top: 1px solid #999; padding-top: 8px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .fabric-card:hover, .step-chip:hover { transform: none; }
}

/* ---------- phones: progress rail 2-up, labels allowed to wrap ----------
 * Placed at the end of the file on purpose: the base #steps-nav rule is an ID
 * selector further down than the 900px block, so an override inside that block
 * loses on source order. */
@media (max-width: 1100px) {
  /* one column: give the step panel the full width, but keep the 3D preview at
     a sane size instead of letting it fill 1,000px of glass */
  .layout { grid-template-columns: 1fr; }
  .preview-col { position: static; }
  .preview-card { max-width: 520px; margin: 0 auto; }
  #mold-viewer { max-height: none; }
}

@media (max-width: 900px) {
  body.page-id-2747 #steps-nav:not(.jd-progress) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.page-id-2747 .sc-txt strong { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
  body.page-id-2747 .step-chip { min-height: 58px; }
}


/* ============================================================
   v1.6 configurator layout — stage left, accordion sidebar right
   ============================================================ */
.jd-cfg {
  --panel: #14161b; --panel2: #191c22;
  /* dark scope for the configurator, independent of the page theme */
  --ink: #f0f1f5; --ink2: #c9ccd4; --muted: #9aa0aa;
  --card: #14161b; --card-2: #191c22;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  color: var(--ink);
  background: #0d0e12; border-radius: 14px; padding: 12px 12px 10px;
}
.jd-brand {
  display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap;
  padding: 1px 0 12px;
}
.jd-brand b { font-size: 14.5px; color: var(--ink); letter-spacing: .2px; }
.jd-brand b span { color: #9aa1ad; }
.jd-brand em { font-style: normal; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.jd-body { display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 0; min-width: 0; }
.jd-body > * { min-width: 0; }

/* ---- stage ---- */
.jd-stage {
  /* the panel must end above the fold: Lobo's fixed header plus the page
     heading already eat ~290px, and the CTA lives at the bottom of the rail */
  position: relative; height: min(calc(100vh - 300px), 820px); min-height: 540px;
  border-radius: 14px 0 0 14px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 38%, #23262e 0%, #14161b 42%, #0b0c0f 100%);
}
#mold-viewer { width: 100%; height: 100%; display: block; background: transparent; }
.jd-stage .model-credit {
  position: absolute; left: 16px; top: 14px; right: auto; max-width: 360px; margin: 0; z-index: 6;
  font-size: 9.5px; line-height: 1.5; color: #7d8695; background: rgba(11,12,15,.55);
  padding: 6px 9px; border-radius: 8px; backdrop-filter: blur(4px);
}
.jd-stage .model-credit b { color: #a8b0bd; font-weight: 600; }

.jd-viewmode {
  position: absolute; left: 16px; top: 96px; z-index: 8; display: flex; gap: 4px;
  background: rgba(20,22,27,.86); border: 1px solid var(--line); border-radius: 9px; padding: 4px;
}
.jd-viewmode button, .jd-views button, .jd-orbit button {
  background: transparent; border: 0; color: #c7ccd6; font: inherit; font-size: 11.5px;
  padding: 5px 10px; border-radius: 6px; cursor: pointer; transition: background .14s, color .14s, transform .1s;
}
.jd-viewmode button:hover, .jd-views button:hover, .jd-orbit button:hover { background: rgba(255,255,255,.08); color: #fff; }
.jd-viewmode button.active, .jd-views button.active, .jd-orbit button.active { background: var(--blue-dark); color: #fff; font-weight: 600; }

.jd-tech { position: absolute; inset: 0; display: none; z-index: 7; text-align: center;
  background: linear-gradient(#e9edf2 1px, transparent 1px) 0 0/100% 24px,
              linear-gradient(90deg, #e9edf2 1px, transparent 1px) 0 0/24px 100%, #f7f9fb;
  padding: 56px 0 62px; }
.jd-tech.on { display: block; }
.jd-tech img { height: calc(100% - 10px); width: auto; max-width: 80%; object-fit: contain;
  background: #fff; border-radius: 2px; filter: drop-shadow(0 6px 18px rgba(16,18,22,.10)); }
.jd-tech-meta { position: absolute; left: 16px; bottom: 12px; margin: 0; font-size: 10px; color: #77808d; letter-spacing: .04em; }

.jd-views, .jd-orbit {
  position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 6;
  background: rgba(20,22,27,.86); border: 1px solid var(--line);
  border-radius: 10px; padding: 5px; backdrop-filter: blur(8px);
}
.jd-views { bottom: 56px; }
.jd-orbit { bottom: 12px; }
.jd-hint { position: absolute; left: 16px; bottom: 14px; margin: 0; font-size: 10.5px; color: #6f7887; z-index: 6; }

/* ---- sidebar ---- */
.jd-side {
  background: var(--panel); border: 1px solid var(--line); border-left: 0;
  border-radius: 0 14px 14px 0; display: flex; flex-direction: column;
  height: min(calc(100vh - 300px), 820px); min-height: 540px;
}
.jd-progress, #steps-nav.jd-progress {
  display: flex; align-items: center; gap: 0; grid-template-columns: none;
  padding: 10px 14px; flex: 0 0 auto; margin: 0;
  flex-wrap: nowrap; white-space: nowrap; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.jd-progress .dot { flex: 0 0 18px;
  width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; line-height: 1; background: #20242c; color: #8b94a2; cursor: pointer;
  transition: background .18s, color .18s; flex-shrink: 0;
}
.jd-progress .dot:hover { background: #2b3038; color: #cfd4dd; }
.jd-progress .dot.done { background: var(--blue-dark); color: #fff; }
.jd-progress .dot.active { box-shadow: 0 0 0 3px rgba(15,98,216,.22); }
.jd-progress i { flex: 1 1 auto; min-width: 6px; max-width: 26px; height: 1px; background: var(--line-2); }
.jd-progress .prog-txt { flex: 0 0 auto; font-size: 10.5px; color: var(--muted); margin-left: auto; padding-left: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.jd-scroll { flex: 1 1 auto; overflow-y: auto; padding: 8px 14px 12px; min-height: 0; }
.jd-sec { border-bottom: 1px solid var(--line); }
.jd-sec h3 {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 0; cursor: pointer;
  font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: #c9cfd9; font-weight: 700;
  user-select: none; white-space: nowrap; overflow: hidden;
}
.jd-sec h3 i {
  width: 18px; height: 18px; border-radius: 50%; background: rgba(31,128,255,.16); color: #67a8ff;
  font-style: normal; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 18px;
}
.jd-sec h3 .zh { color: #6f7887; font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 10.5px; }
.jd-sec h3 .caret { margin-left: auto; font-size: 10px; color: #6f7887; transition: transform .2s cubic-bezier(.2,.7,.3,1); }
.jd-sec.collapsed h3 .caret { transform: rotate(-90deg); }
.jd-sec .jd-sec-body {
  overflow: hidden; max-height: 4000px; opacity: 1;
  transition: max-height .26s cubic-bezier(.2,.7,.3,1), opacity .2s ease; padding-bottom: 12px;
}
.jd-sec.collapsed .jd-sec-body { max-height: 0; opacity: 0; padding-bottom: 0; }

/* controls inside the sidebar */
.jd-side .opt-group { margin-bottom: 12px; }
.jd-side .opt-label { font-size: 10.5px; color: var(--muted); font-weight: 600; margin: 9px 0 5px; }
.jd-side .opt-btns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px; }
.jd-side .opt-btn { padding: 6px 9px; font-size: 11.5px; border-radius: 8px; text-align: left;
  background: var(--card-2); color: var(--ink); border: 1px solid var(--line); }
.jd-side .extra-row { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 10px; }
.jd-side .extra-name { font-size: 10.5px; color: var(--muted); }
.jd-side .color-btns { display: flex; gap: 6px; }
.jd-side .color-btn { width: 26px; height: 26px; }
.jd-side .fabric-group h4 { font-size: 9.5px; letter-spacing: .1em; margin: 10px 0 5px; color: var(--muted); }
.jd-side .fabric-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.jd-side .fabric-card { border-radius: 8px; }
.jd-side .fabric-photo, .jd-side .fabric-swatch { height: 52px; }
.jd-side .fabric-name { font-size: 10.5px; padding: 5px 6px 6px; min-height: 0; line-height: 1.25; }
.jd-side .fabric-meta { display: none; }
.jd-side .measure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.jd-side .measure-field { font-size: 10px; color: var(--muted); }
.jd-side .measure-field input { width: 100%; box-sizing: border-box; padding: 7px 9px; font-size: 12.5px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--ink); border-radius: 8px; }
.jd-side .summary-table { width: 100%; font-size: 11px; }
.jd-side .summary-table th { width: 44%; padding: 4px 6px; }

/* sticky CTA */
.jd-foot { flex: 0 0 auto; border-top: 1px solid var(--line); background: #111318; padding: 10px 14px 12px; border-radius: 0 0 14px 0; }
.jd-foot .sum { font-size: 11px; color: var(--muted); margin-bottom: 8px; line-height: 1.45; }
.jd-foot .sum b { color: #e6e9ef; font-weight: 600; }
.jd-foot .cta {
  width: 100%; border: 0; border-radius: 10px; padding: 12px 14px; cursor: pointer;
  background: var(--blue-dark); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700;
  letter-spacing: .02em; transition: background .16s, box-shadow .16s, transform .1s;
}
.jd-foot .cta:hover { background: #0b56c0; box-shadow: 0 6px 18px rgba(15,98,216,.35); }
.jd-foot .cta:active { transform: scale(.99); }
.jd-foot .fine { margin: 7px 0 0; font-size: 9.5px; color: #69717e; line-height: 1.45; }

@media (max-width: 1100px) {
  .jd-body { grid-template-columns: 1fr; }
  .jd-stage { height: 52vh; min-height: 380px; border-radius: 14px 14px 0 0; }
  .jd-side { height: auto; max-height: none; border-left: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; }
  .jd-scroll { overflow: visible; }
  .jd-foot { position: sticky; bottom: 0; border-radius: 0 0 14px 14px; }
  .jd-tech { padding: 48px 0 56px; }
}

/* ---- phones: nothing in the panel may push the page wider than the screen ---- */
@media (max-width: 640px) {
  .jd-cfg { padding: 10px 8px 8px; }
  .jd-brand b { font-size: 13px; }
  .jd-brand em { font-size: 9px; letter-spacing: .1em; }
  .jd-progress { padding: 9px 10px; }
  .jd-scroll { padding: 6px 10px 96px; } /* slack so the sticky CTA never covers the last row */
  .jd-foot { padding: 9px 10px 10px; }
  .jd-foot .cta { font-size: 11.5px; padding: 11px 8px; line-height: 1.25; }
  .jd-stage { border-radius: 12px 12px 0 0; height: 58vh; min-height: 340px; }
  .jd-side { border-radius: 0 0 12px 12px; }
  .jd-stage .model-credit { left: 10px; right: 10px; top: 10px; max-width: none; font-size: 8.5px; }
  .jd-viewmode { left: 10px; top: auto; bottom: 104px; }
  .jd-views { bottom: 52px; padding: 4px; max-width: calc(100% - 16px); overflow-x: auto; }
  .jd-views button, .jd-orbit button, .jd-viewmode button { white-space: nowrap; }
  .jd-orbit { bottom: 10px; }
  .jd-views button, .jd-orbit button, .jd-viewmode button { padding: 4px 7px; font-size: 10.5px; }
  .jd-hint { display: none; }
  .jd-sec h3 { font-size: 10.5px; gap: 6px; }
  .jd-sec h3 .zh { display: none; }
}

/* ==========================================================================
   THEME DEFENCE — Lobo's `.single-post .post-body h3 / p / img` rules carry
   specificity 0-2-1 and were beating our plain component classes (headings
   rendered at 32px, body copy at 17px, and every image forced to
   width:134% with margin-left:-35%, which pushed the technical flat off
   centre). Everything below re-asserts our values from `.iex-tool-shell`
   (0-3-x) so it wins on specificity, no !important needed.
   Font FAMILIES are deliberately left to the theme (Lekton for headings,
   Open Sans for text) — only the metrics are ours.
   ========================================================================== */

.iex-tool-shell .jd-cfg { font-family: inherit; }
.iex-tool-shell .jd-cfg img {
  width: auto; height: auto; max-width: 100%;
  margin: 0; padding: 0; border: 0; border-radius: 0;
}

/* section headers */
.iex-tool-shell .jd-sec > h3 {
  font-family: inherit;
  font-size: 11.5px; line-height: 1.25; letter-spacing: .06em;
  margin: 0; padding: 11px 0; font-weight: 700; text-transform: uppercase;
}
.iex-tool-shell .jd-side .fabric-group > h4 {
  font-family: inherit;
  font-size: 9.5px; line-height: 1.3; letter-spacing: .1em;
  margin: 10px 0 5px; font-weight: 600; text-transform: uppercase;
}

/* copy */
.iex-tool-shell .jd-side p,
.iex-tool-shell .jd-foot p,
.iex-tool-shell .jd-stage p {
  font-family: inherit;
  font-size: 10.5px; line-height: 1.55; margin: 0;
}
.iex-tool-shell .jd-side .tip {
  font-size: 10.5px; line-height: 1.55; margin: 4px 0 10px;
  padding: 7px 9px; border-left: 2px solid var(--blue-dark); border-radius: 0 6px 6px 0;
  background: rgba(31,128,255,.07); color: var(--ink2);
}
.iex-tool-shell .jd-side .opt-label,
.iex-tool-shell .jd-side .extra-name,
.iex-tool-shell .jd-side .measure-field { font-size: 10.5px; line-height: 1.3; }
.iex-tool-shell .jd-side .measure-field input { font-size: 12.5px; }
.iex-tool-shell .jd-foot .sum { font-size: 11px; line-height: 1.45; }
.iex-tool-shell .jd-foot .fine { font-size: 9.5px; line-height: 1.45; }
.iex-tool-shell .jd-stage .model-credit { font-size: 9.5px; line-height: 1.5; }
.iex-tool-shell .jd-stage .jd-hint { font-size: 10.5px; }
.iex-tool-shell .jd-stage .jd-tech-meta { font-size: 10px; }
.iex-tool-shell .jd-side .summary-table { font-size: 11px; }

/* lists inside the rail */
.iex-tool-shell .jd-side ul,
.iex-tool-shell .jd-side ol { margin: 0; padding-left: 14px; }
.iex-tool-shell .jd-side li { font-size: 10.5px; line-height: 1.5; }

/* fabric thumbnails must stay inside their card */
.iex-tool-shell .jd-side .fabric-photo,
.iex-tool-shell .jd-side .fabric-swatch {
  width: 100%; height: 52px; margin: 0; object-fit: cover; display: block;
}

/* ---- technical flat: centred, fully visible, never cropped ---- */
.iex-tool-shell .jd-stage .jd-tech {
  display: none;
  padding: 0;
}
.iex-tool-shell .jd-stage .jd-tech.on {
  display: flex; align-items: center; justify-content: center;
  padding: 52px 24px 60px;
}
.iex-tool-shell .jd-stage .jd-tech img {
  position: static;
  width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  margin: 0; display: block; object-fit: contain; object-position: center;
  background: #fff; border-radius: 2px;
  filter: drop-shadow(0 6px 18px rgba(16,18,22,.10));
}

/* ---- caret + CTA polish (Lekton has no ▾ glyph — it fell back to §) ---- */
.iex-tool-shell .jd-sec > h3 .caret {
  width: 7px; height: 7px; flex: 0 0 7px; font-size: 0; line-height: 0;
  border-right: 1.5px solid #6f7887; border-bottom: 1.5px solid #6f7887;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s cubic-bezier(.2,.7,.3,1);
}
.iex-tool-shell .jd-sec.collapsed > h3 .caret { transform: rotate(-45deg) translateX(-2px); }

.iex-tool-shell .jd-foot .cta {
  font-size: 11px; line-height: 1.35; letter-spacing: .01em;
  word-break: keep-all; padding: 11px 10px;
}

/* ---------- scrollbar: native Windows arrows were ugly on the dark rail ---------- */
.jd-scroll { scrollbar-width: thin; scrollbar-color: #333a45 transparent; }
.jd-scroll::-webkit-scrollbar { width: 12px; }
.jd-scroll::-webkit-scrollbar-track { background: transparent; }
.jd-scroll::-webkit-scrollbar-thumb {
  background: #2c323c; border-radius: 999px;
  border: 4px solid transparent; background-clip: content-box;
}
.jd-scroll::-webkit-scrollbar-thumb:hover { background: #3d4450; background-clip: content-box; }
.jd-scroll::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
