/*
 * xinyaele.store — wire harness builder.
 *
 * Loaded only on /harness-builder/ by wp-content/mu-plugins/xinya-harness-builder.php.
 * Every design token is inherited from the theme stylesheet, which is declared
 * as a dependency, so nothing is redeclared here.
 */

/* The theme centres page bodies in a reading column; the builder needs the
   full catalogue width for the form and the specification panel. */
.shx-page--harness-builder { max-width: 100%; }
.shx-page--harness-builder > h1 { max-width: 34ch; }

.shx-hb { margin: 0; }

/* ---------- two-column shell ---------- */

.shx-hb__layout {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1180px) {
  .shx-hb__layout { grid-template-columns: minmax(0, 1fr) minmax(324px, 396px); gap: 34px; }
}
@media (min-width: 1700px) {
  .shx-hb__layout { grid-template-columns: minmax(0, 1fr) minmax(380px, 452px); gap: 44px; }
}

/* ---------- form ---------- */

.shx-hb__form { display: grid; gap: 14px; min-width: 0; }

.shx-hb__group {
  border: var(--rule) solid var(--line);
  border-top: 3px solid var(--accent);
  background: var(--white);
}
.shx-hb__group[open] { border-color: var(--line); }

.shx-hb__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  cursor: pointer;
  list-style: none;
  background: var(--white);
  transition: background-color .15s ease;
}
.shx-hb__summary::-webkit-details-marker { display: none; }
.shx-hb__summary:hover { background: var(--paper); }

.shx-hb__no {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--accent);
  flex: 0 0 auto;
}
.shx-hb__stitle {
  font-family: var(--font-head);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .015em;
  color: var(--ink);
  flex: 1 1 auto;
}
.shx-hb__stitle::after {
  content: "+";
  float: right;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--muted);
  margin-left: 12px;
}
.shx-hb__group[open] .shx-hb__stitle::after { content: "\2212"; }

/* Tick marker once a group has anything filled in. */
.shx-hb__done {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: var(--rule) solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: transparent;
}
.shx-hb__group.is-filled .shx-hb__done {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}
.shx-hb__group.is-filled .shx-hb__done::after { content: "\2713"; }

.shx-hb__body { padding: 4px 20px 22px; }

.shx-hb__lead {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 78ch;
  margin: 0 0 18px;
  padding-bottom: 16px;
  border-bottom: var(--rule) dotted var(--line);
}

.shx-hb__grid {
  display: grid;
  gap: 18px 22px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 234px), 1fr));
  align-items: start;
}

/* ---------- fields ---------- */

.shx-hb__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.shx-hb__field--wide,
.shx-hb__field--multi,
.shx-hb__field--chips { grid-column: 1 / -1; }

.shx-hb__lbl {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.shx-hb input[type="text"],
.shx-hb input[type="number"],
.shx-hb select,
.shx-hb textarea {
  width: 100%;
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: var(--white);
  border: var(--rule) solid var(--line);
  padding: 10px 12px;
  border-radius: 0;
  appearance: none;
  min-width: 0;
}
.shx-hb select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.shx-hb textarea { resize: vertical; line-height: 1.55; }
.shx-hb input:focus,
.shx-hb select:focus,
.shx-hb textarea:focus { border-color: var(--navy); outline: 2px solid var(--accent); outline-offset: 1px; }
.shx-hb input::placeholder,
.shx-hb textarea::placeholder { color: #9AA7B2; }

.shx-hb__numbox { display: flex; align-items: stretch; }
.shx-hb__numbox input { flex: 1 1 auto; }
.shx-hb__unit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: var(--rule) solid var(--line);
  border-left: 0;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}

/* radio chips */
.shx-hb__chips { display: flex; flex-wrap: wrap; gap: 7px; }
.shx-hb__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .03em;
  cursor: pointer;
  padding: 8px 13px;
  border: var(--rule) solid var(--line);
  background: var(--paper);
  color: var(--navy);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.shx-hb__chip:hover { border-color: var(--navy); }
.shx-hb__chip input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.shx-hb__chip:has(input:checked) {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.shx-hb__chip.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.shx-hb__chip:has(input:focus-visible),
.shx-hb__chip:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

/* preset buttons on number fields */
.shx-hb__chips--preset { margin-top: 2px; }
.shx-hb__chip--btn {
  padding: 5px 10px;
  font-size: 11.5px;
  background: var(--white);
  color: var(--muted);
}
.shx-hb__chip--btn:hover { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* checkbox groups */
.shx-hb__checks {
  display: grid;
  gap: 6px 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr));
}
.shx-hb__check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
  padding: 5px 0;
}
.shx-hb__check input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.shx-hb__check--single {
  align-items: center;
  border: var(--rule) solid var(--line);
  background: var(--paper);
  padding: 12px 14px;
  font-size: 14px;
}
.shx-hb__check--single input { margin-top: 0; }

/* ---------- specification panel ---------- */

.shx-hb__panel { min-width: 0; }
@media (min-width: 1180px) {
  .shx-hb__panel { position: sticky; top: 88px; }
  .shx-hb__panel-inner {
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

.shx-hb__panel-inner {
  border: var(--rule) solid var(--line);
  border-top: 3px solid var(--navy);
  background: var(--white);
  padding: 20px 20px 22px;
}

.shx-hb__ptitle {
  font-family: var(--font-head);
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: .015em;
  margin: 0 0 12px;
  color: var(--ink);
}

.shx-hb__pmetre { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.shx-hb__bar {
  flex: 1 1 auto;
  height: 5px;
  background: var(--paper);
  border: var(--rule) solid var(--line);
  display: block;
}
.shx-hb__barfill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.shx-hb__pmetretxt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* recommended cable */
.shx-hb__wire { margin: 0 0 18px; padding-bottom: 16px; border-bottom: var(--rule) solid var(--line); }
.shx-hb__wirehead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.shx-hb__wiretitle {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.shx-hb__wirecount {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}
.shx-hb__wirelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.shx-hb__wireitem {
  border-left: 3px solid var(--line);
  padding: 1px 0 1px 11px;
}
.shx-hb__wireitem:first-child { border-left-color: var(--accent); }
.shx-hb__wirestyle {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
}
.shx-hb__wirestyle:hover { color: var(--accent); }
.shx-hb__wirename {
  display: block;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
  margin: 1px 0 3px;
}
.shx-hb__wirespec {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--navy);
}
.shx-hb__wirebadge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--navy);
  padding: 2px 6px;
  margin-left: 6px;
}
.shx-hb__wiremore {
  margin: 11px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.shx-hb__wiremore b { color: var(--ink); }
.shx-hb__wirenone {
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid #B91C1C;
  background: var(--paper);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* specification list */
.shx-hb__spec { margin: 0 0 18px; display: grid; gap: 0; }
.shx-hb__specgroup {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 16px 0 0;
  padding-bottom: 5px;
  border-bottom: var(--rule) solid var(--line);
}
.shx-hb__specgroup:first-child { margin-top: 0; }
.shx-hb__specdt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 9px 0 1px;
}
.shx-hb__specdd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: 3px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.shx-hb__specempty {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* actions */
.shx-hb__actions { display: grid; gap: 9px; }
.shx-hb__actions .shx-btn {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  width: 100%;
  text-align: center;
}
.shx-hb__pnote {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--navy);
  min-height: 0;
}
.shx-hb__pnote.is-warn { color: #B91C1C; }
.shx-hb__pfoot {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: var(--rule) dotted var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- page furniture around the tool ---------- */

.shx-page--harness-builder > div > p,
.shx-page--harness-builder > div > h2,
.shx-page--harness-builder > div > ul { max-width: 96ch; }
.shx-page--harness-builder > div > h2 {
  font-family: var(--font-head);
  font-size: 28px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .01em;
  margin: 46px 0 14px;
}
.shx-page--harness-builder > div > p { margin: 0 0 20px; }
.shx-page--harness-builder > div > h3 {
  font-family: var(--font-head);
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: .015em;
  margin: 34px 0 10px;
  max-width: 96ch;
}

/* Long-form option reference tables inside the page copy. */
.shx-hb-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 14.5px;
  max-width: 96ch;
}
.shx-hb-table th,
.shx-hb-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: var(--rule) solid var(--line);
  vertical-align: top;
}
.shx-hb-table th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-width: 2px;
  border-bottom-color: var(--ink);
}
.shx-hb-table td:first-child { white-space: nowrap; font-weight: 600; color: var(--navy); }

/* Crawlable entry points into the builder. */
.shx-hb-presets {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 262px), 1fr));
  max-width: none;
}
.shx-hb-presets li {
  border: var(--rule) solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--paper);
  padding: 13px 15px 14px;
}
.shx-hb-presets a {
  display: block;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
  margin-bottom: 4px;
}
.shx-hb-presets a:hover { color: var(--accent); text-decoration: underline; }
.shx-hb-presets span { display: block; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* FAQ accordion (the theme's .shx-faq ships with the harness stylesheet,
   which is not loaded on this page). */
.shx-hb-faq { max-width: 96ch; display: grid; gap: 8px; }
.shx-hb-faq details { border: var(--rule) solid var(--line); background: var(--white); }
.shx-hb-faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.shx-hb-faq summary::-webkit-details-marker { display: none; }
.shx-hb-faq summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--muted);
  flex: 0 0 auto;
}
.shx-hb-faq details[open] summary::after { content: "\2212"; }
.shx-hb-faq details[open] summary { border-bottom: var(--rule) dotted var(--line); }
.shx-hb-faq p { margin: 0; padding: 14px 18px 16px; font-size: 14.5px; line-height: 1.65; color: var(--muted); }

/* The quote form sits under the builder; keep it on the same rhythm. */
.shx-builder-page .shx-rfq { margin-top: 46px; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .shx-hb__panel-inner { margin-top: 4px; }
}
@media (max-width: 700px) {
  .shx-hb__summary { padding: 14px 15px; }
  .shx-hb__stitle { font-size: 16px; }
  .shx-hb__body { padding: 2px 15px 20px; }
  .shx-hb__panel-inner { padding: 17px 15px 19px; }
  .shx-hb__chip { flex: 1 1 auto; justify-content: center; }
  .shx-hb__checks { grid-template-columns: 1fr; }
  .shx-hb-table { font-size: 13.5px; }
  .shx-hb-table th, .shx-hb-table td { padding: 9px 8px; }
  .shx-hb-table td:first-child { white-space: normal; }
}

/* Respect a dark colour scheme without breaking the printed sheet. */
@media (prefers-reduced-motion: reduce) {
  .shx-hb__barfill { transition: none; }
}
