/* ==========================================================================
   PCB Builder — styles
   Palette: Golden Summer Glow
   #0d3b66 Regal Navy · #faf0ca Lemon Chiffon · #f4d35e Royal Gold
   #ee964b Sandy Brown · #f95738 Tomato

   Scoped under .pcb-builder so Astra theme styles are never affected.
   ========================================================================== */

.pcb-builder {
  /* palette */
  --pcb-navy: #0d3b66;
  --pcb-chiffon: #faf0ca;
  --pcb-gold: #f4d35e;
  --pcb-sandy: #ee964b;
  --pcb-tomato: #f95738;

  /* semantic mapping */
  --pcb-bg: #ffffff;
  --pcb-surface: var(--pcb-chiffon);
  --pcb-surface-2: #f3e9c4;
  --pcb-border: #e6dcb8;
  --pcb-border-strong: #d6c99c;
  --pcb-text: var(--pcb-navy);
  --pcb-text-soft: #2c5a86;
  --pcb-text-mute: #6b8aa8;
  --pcb-accent: var(--pcb-navy);
  --pcb-accent-soft: #e8eef5;
  --pcb-ok: #1f7a4d;
  --pcb-ok-soft: #e4f3ea;
  --pcb-warn: #a55a00;
  --pcb-warn-soft: #fdeed6;
  --pcb-error: var(--pcb-tomato);
  --pcb-error-soft: #fde6e1;
  --pcb-radius: 12px;
  --pcb-radius-sm: 8px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  margin: 0 0 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--pcb-text);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}

.pcb-builder *,
.pcb-builder *::before,
.pcb-builder *::after { box-sizing: border-box; }

.pcb-builder button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

/* ------------------------------------------------------------------ panels */
.pcb-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.pcb-panel {
  background: var(--pcb-bg);
  border: 1px solid var(--pcb-border);
  border-radius: var(--pcb-radius);
  overflow: hidden;
}

.pcb-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--pcb-border);
  background: var(--pcb-surface);
}

.pcb-panel-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pcb-navy);
}

/* ------------------------------------------------------------- slot list */
/* One horizontal row of eight tiles, so the whole build is readable at a
   glance instead of as an eight-row list you have to scroll. Each tile is a
   small card: icon, category and chosen part. */
.pcb-build-panel {
  grid-column: 1 / -1;
}
.pcb-slots {
  display: grid;
  /* Eight tiles, one row. minmax(0, 1fr) rather than a fixed minimum: the row
     is full width (see .pcb-build-panel) so the tiles divide it evenly instead
     of wrapping into a second row at some arbitrary window width. */
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 14px;
}

.pcb-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 7px 7px;
  border: 1px solid var(--pcb-border);
  border-radius: var(--pcb-radius-sm);
  background: var(--pcb-bg);
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.pcb-slot:hover { background: var(--pcb-surface); border-color: var(--pcb-border-strong); }
.pcb-slot.is-active {
  background: var(--pcb-accent-soft);
  border-color: var(--pcb-navy);
  box-shadow: 0 0 0 1px var(--pcb-navy);
}
/* The active marker is a top bar now, not a left one: the tile is wider than
   it is tall, so a left edge would read as a stray border. */
.pcb-slot.is-active::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  border-radius: var(--pcb-radius-sm) var(--pcb-radius-sm) 0 0;
  background: var(--pcb-gold);
}

.pcb-slot-icon {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--pcb-radius-sm);
  background: var(--pcb-surface-2);
  color: var(--pcb-text-mute);
  overflow: hidden;
}
.pcb-slot.is-filled .pcb-slot-icon { background: var(--pcb-gold); color: var(--pcb-navy); }
/* The supplied part illustrations. `contain` keeps their own aspect ratio, and
   the drawn fallback stays inside the same 20px box so the tile never shifts. */
.pcb-slot-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* The drawn glyph sits in the same box as a supplied illustration, so a tile
   does not change size when the fallback is used. */
.pcb-slot-icon-drawn { display: grid; place-items: center; width: 20px; height: 20px; }
.pcb-slot-icon-drawn svg { width: 20px; height: 20px; }

.pcb-slot-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  min-width: 0;
}
.pcb-slot-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--pcb-text-mute);
  line-height: 1.2;
}
.pcb-slot-value {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--pcb-text);
  /* Two lines is the most a tile can hold; clamped rather than ellipsed so a
     long SKU stays readable instead of becoming "Core i9-149…". */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
/* A chosen part sits on gold, so the filled state is the tile's own colour
   rather than a badge — it reads at a glance across eight tiles. */
.pcb-slot.is-filled { background: var(--pcb-gold); border-color: var(--pcb-sandy); }
.pcb-slot.is-filled .pcb-slot-label { color: #7a4400; }
.pcb-slot:not(.is-filled) .pcb-slot-value {
  color: var(--pcb-text-mute);
  font-weight: 500;
  font-style: italic;
}
/* The spec line does not fit a tile any more: the picker cards and the parts
   list below the fold carry it. */
.pcb-slot-spec { display: none; }

.pcb-slot-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: auto;
  width: 100%;
}
.pcb-slot-count { font-size: 10px; color: var(--pcb-text-mute); }
/* A slot whose imported list has not loaded yet. Says "more on open" rather
   than a curated-only number that is about to be replaced. */
.pcb-slot-count.is-pending { font-style: italic; opacity: .72; }

.pcb-slot-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; line-height: 1;
  color: var(--pcb-text-mute);
  background: var(--pcb-surface-2);
  transition: background .12s, color .12s;
}
.pcb-slot-remove:hover { background: var(--pcb-error-soft); color: var(--pcb-error); }

/* --------------------------------------------------------------- picker */
.pcb-picker-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-bottom: 1px solid var(--pcb-border);
}

.pcb-input,
.pcb-select {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--pcb-border-strong);
  border-radius: var(--pcb-radius-sm);
  background: var(--pcb-bg);
  color: var(--pcb-text);
  min-width: 0;
}
.pcb-input { flex: 1 1 220px; }
.pcb-input:focus,
.pcb-select:focus { outline: 2px solid var(--pcb-navy); outline-offset: -1px; border-color: var(--pcb-navy); }

.pcb-picker-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--pcb-text-soft);
  white-space: nowrap;
}

/* ------------------------------------------------------------- funnel */
/* The guided chooser: one row per attribute, coarsest first. Rows wrap, so the
   funnel costs a few lines on a phone instead of pushing the cards off screen. */
.pcb-funnel {
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--pcb-border);
  background: linear-gradient(180deg, rgba(250, 240, 202, .55), rgba(250, 240, 202, 0));
}
.pcb-funnel[hidden] { display: none; }

.pcb-step { display: flex; gap: 10px; padding: 4px 0; align-items: flex-start; }
.pcb-step + .pcb-step { border-top: 1px dashed var(--pcb-border); }

.pcb-step-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 0 0 96px;
  padding-top: 4px;
}
.pcb-step-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--pcb-text-mute);
}
.pcb-step.is-set .pcb-step-label { color: var(--pcb-navy); }
.pcb-step-clear {
  font: inherit;
  font-size: 10.5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pcb-sandy);
  text-decoration: underline;
  cursor: pointer;
}
.pcb-step-clear:hover { color: var(--pcb-terracotta); }

.pcb-step-opts { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }

.pcb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  padding: 5px 8px;
  border: 1px solid var(--pcb-border-strong);
  border-radius: 999px;
  background: var(--pcb-bg);
  color: var(--pcb-text);
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.pcb-chip:hover { border-color: var(--pcb-navy); }
.pcb-chip.is-active {
  background: var(--pcb-navy);
  border-color: var(--pcb-navy);
  color: var(--pcb-chiffon);
}
.pcb-chip.is-active .pcb-chip-count { color: rgba(250, 240, 202, .82); }
/* A value with no parts behind it stays visible but struck through: silent
   removal would make the visitor think the part does not exist at all. */
.pcb-chip.is-empty { opacity: .42; cursor: not-allowed; text-decoration: line-through; }
.pcb-chip-count { font-size: 11px; color: var(--pcb-text-mute); font-variant-numeric: tabular-nums; }
.pcb-chip-more { border-style: dashed; color: var(--pcb-sandy); }
.pcb-chip-more:hover { color: var(--pcb-navy); }

.pcb-more { grid-column: 1 / -1; display: flex; justify-content: center; padding: 6px 0 2px; }
.pcb-funnel-reset { flex: 0 0 auto; }

.pcb-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  padding: 12px 14px;
  /* No inner scrollbar: a scroll area inside a page that already scrolls
     traps the wheel and hides the parts a shopper came to compare. All cards
     are laid out; the page carries the scroll. */
  max-height: none;
  overflow: visible;
}

.pcb-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--pcb-border);
  border-radius: var(--pcb-radius-sm);
  background: var(--pcb-bg);
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.pcb-card:hover { border-color: var(--pcb-navy); box-shadow: 0 2px 10px rgba(13, 59, 102, .12); }
.pcb-card.is-selected { border-color: var(--pcb-navy); background: var(--pcb-surface); box-shadow: inset 0 0 0 1px var(--pcb-gold); }
.pcb-card.is-blocked {
  cursor: not-allowed;
  opacity: .62;
  background: #fbf6e4;
}
.pcb-card.is-blocked:hover { border-color: var(--pcb-border); box-shadow: none; }
.pcb-card:focus-visible { outline: 2px solid var(--pcb-navy); outline-offset: 2px; }

.pcb-card-head { display: flex; flex-direction: column; gap: 1px; }
.pcb-card-brand {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--pcb-sandy);
}
.pcb-card-name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.pcb-card-spec { font-size: 12px; color: var(--pcb-text-soft); }

.pcb-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.pcb-card-reason {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--pcb-error);
}

.pcb-card-link {
  font-size: 10px;
  font-weight: 800;
  color: var(--pcb-navy);
  text-decoration: none;
  border-bottom: 1px solid var(--pcb-gold);
  padding-bottom: 1px;
  white-space: nowrap;
}
.pcb-card-link:hover { color: var(--pcb-tomato); border-bottom-color: var(--pcb-tomato); }

.pcb-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 100px;
  white-space: nowrap;
}
.pcb-badge-ok { background: var(--pcb-gold); color: var(--pcb-navy); }
.pcb-badge-warn { background: var(--pcb-warn-soft); color: var(--pcb-warn); }
.pcb-badge-block { background: var(--pcb-error-soft); color: var(--pcb-error); }

.pcb-empty { padding: 24px 16px; color: var(--pcb-text-mute); font-size: 14px; }
.pcb-empty-reset { margin-top: 8px; }

/* ------------------------------------------------------- selected parts */
/* Lives inside .pcb-main, directly under the picker, so it always sits below
   the search bar and shares its width — whatever the number of parts. One row
   per part on a single line (category, model, link): with a single
   column the panel would otherwise be 436px tall on a full build. */
.pcb-parts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0 4px;
}
.pcb-part {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--pcb-border);
  font-size: 13px;
}
.pcb-part:last-child { border-bottom: 0; }
/* Inline, not stacked: the label is a fixed-width gutter so the model names
   line up down the panel. */
.pcb-part-main { display: flex; align-items: baseline; gap: 10px; flex: 1 1 auto; min-width: 0; }
.pcb-part-slot {
  flex: 0 0 92px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--pcb-text-mute);
}
.pcb-part-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcb-part-link {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--pcb-navy);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--pcb-gold);
}
.pcb-part-link:hover { background: var(--pcb-sandy); color: #fff; }

/* ------------------------------------------------------------- rig panel */
.pcb-rig-panel { position: sticky; top: 20px; align-self: start; }

.pcb-rig-wrap {
  padding: 12px;
  background: linear-gradient(180deg, var(--pcb-chiffon), #f7eecb);
  border-bottom: 1px solid var(--pcb-border);
}

#pcb-rig { width: 100%; height: auto; display: block; }

/* --- 3D canvas (pcb-rig-3d.js) ---------------------------------------- */
/* The canvas keeps the same 1.35:1 ceiling as the SVG so the sidebar
   layout does not shift when the 3D module takes over. */
#pcb-rig-host {
  position: relative;
  width: 100%;
  aspect-ratio: 1.35 / 1;
  max-height: 420px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 64% 34%, #263c52 0, #142335 46%, #0d1724 100%);
  box-shadow: inset 0 0 0 1px rgba(244, 211, 94, .16);
}
#pcb-rig-host > #pcb-rig {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #f6f2e2;
}
#pcb-rig-3d {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* let OrbitControls own the gestures on mobile */
}
#pcb-rig-host.pcb-3d-active > #pcb-rig { visibility: hidden; }
#pcb-rig-host.pcb-3d-active::after {
  content: "Drag to rotate · Scroll to zoom";
  position: absolute;
  right: 9px;
  bottom: 8px;
  z-index: 2;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(7, 14, 23, .64);
  color: rgba(255, 255, 255, .68);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .02em;
  pointer-events: none;
  backdrop-filter: blur(5px);
}
.pcb-rig-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, .75);
  background: rgba(13, 23, 36, .86);
  pointer-events: none;
}

/* --- open case illustration ------------------------------------------- */
#pcb-rig .rig-case-body {
  fill: #fffdf5;
  stroke: var(--pcb-border-strong);
  stroke-width: 2.5;
}
#pcb-rig .rig-front {
  fill: var(--pcb-surface-2);
  stroke: var(--pcb-border-strong);
  stroke-width: 1.2;
}
#pcb-rig .rig-shroud {
  stroke: var(--pcb-border-strong);
  stroke-width: 1.2;
  stroke-dasharray: 6 4;
  opacity: .7;
}
#pcb-rig .rig-fan {
  fill: none;
  stroke: var(--pcb-text-mute);
  stroke-width: 1.2;
  opacity: .5;
}
#pcb-rig .rig-fan-blade {
  stroke: var(--pcb-text-mute);
  stroke-width: 1;
  opacity: .38;
}

/* the board is a neutral surface, not a highlight */
#pcb-rig .rig-board {
  fill: #f6f2e2;
  stroke: #cbbd92;
  stroke-width: 1.6;
  transition: fill .25s ease, stroke .25s ease;
}
#pcb-rig .rig-part.is-on.rig-mb .rig-board {
  fill: #eef0e6;
  stroke: var(--pcb-navy);
  stroke-width: 2;
}

/* empty slots: dashed ghost showing where the part goes */
#pcb-rig .rig-shape {
  fill: #fffdf5;
  stroke: #b9a97a;
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
  opacity: .85;
  transition: fill .25s ease, stroke .25s ease, opacity .25s ease;
}
#pcb-rig .rig-detail {
  fill: none;
  stroke: #c4b58a;
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
  opacity: .8;
  transition: opacity .25s ease, stroke .25s ease;
}
#pcb-rig .rig-fin {
  stroke: #c4b58a;
  stroke-width: 1.2;
  opacity: .7;
  transition: opacity .25s ease, stroke .25s ease;
}

/* filled: solid, inked in the palette */
#pcb-rig .rig-part.is-on .rig-shape {
  fill: var(--pcb-gold);
  stroke: var(--pcb-sandy);
  stroke-width: 2;
  stroke-dasharray: none;
  opacity: 1;
}
#pcb-rig .rig-part.is-on .rig-detail {
  stroke: var(--pcb-navy);
  stroke-dasharray: none;
  opacity: .55;
}
#pcb-rig .rig-part.is-on .rig-fin {
  stroke: var(--pcb-navy);
  opacity: .35;
}
#pcb-rig .rig-part.is-on.rig-case .rig-case-body {
  fill: #fffdf5;
  stroke: var(--pcb-navy);
  stroke-width: 3;
}
#pcb-rig .rig-part.is-on.rig-gpu .rig-shape { fill: var(--pcb-sandy); stroke: #c9762f; }
#pcb-rig .rig-part.is-on.rig-psu .rig-shape { fill: var(--pcb-navy); stroke: #08243f; }
#pcb-rig .rig-part.is-on.rig-psu .rig-detail,
#pcb-rig .rig-part.is-on.rig-psu .rig-fin { stroke: var(--pcb-chiffon); opacity: .8; }
#pcb-rig .rig-part.is-on.rig-cooler .rig-shape { fill: var(--pcb-tomato); stroke: #c93f22; }
#pcb-rig .rig-part.is-on.rig-ram .rig-shape { fill: #2c5a86; stroke: var(--pcb-navy); }
#pcb-rig .rig-part.is-on.rig-storage .rig-shape { fill: #d9e2ec; stroke: var(--pcb-navy); stroke-width: 2; }
#pcb-rig .rig-part.is-on.rig-storage .rig-detail { stroke: var(--pcb-navy); stroke-dasharray: none; opacity: .6; }

/* numbered badge */
#pcb-rig .rig-badge circle {
  fill: var(--pcb-navy);
  stroke: #fff;
  stroke-width: 1.5;
}
#pcb-rig .rig-badge text {
  fill: var(--pcb-chiffon);
  font-size: 10px;
  font-weight: 800;
  text-anchor: middle;
}

/* --- legend ------------------------------------------------------------ */
/* Eight fixed rows, no inner scroll: the legend is exactly as tall as the
   build, and the panel must never hide a part name behind a scrollbar. */
.pcb-rig-legend {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-bottom: 1px solid var(--pcb-border);
}
.pcb-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  opacity: .55;
}
.pcb-legend-row.is-filled { opacity: 1; }
.pcb-legend-n {
  flex: 0 0 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--pcb-surface-2);
  color: var(--pcb-text-mute);
  font-size: 9.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.pcb-legend-row.is-filled .pcb-legend-n { background: var(--pcb-navy); color: var(--pcb-chiffon); }
/* One line per part: number, category, then the exact model. Eight rows read
   as a list you can scan instead of a column of stacked labels. */
.pcb-legend-body {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.pcb-legend-slot {
  flex: 0 0 auto;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--pcb-text-mute);
}
.pcb-legend-name {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--pcb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The full name lives in "Selected parts" below; the legend only has to name
   the part on the drawing, so it stays on one line here. */
/* The affiliate link lives on the legend row, next to the part it belongs to:
   one list of parts, not two. */
.pcb-legend-link {
  flex: 0 0 auto;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--pcb-navy);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 100px;
  background: var(--pcb-gold);
  transition: background .12s, color .12s;
}
.pcb-legend-link:hover { background: var(--pcb-sandy); color: #fff; }
.pcb-legend-row:not(.is-filled) .pcb-legend-name {
  font-weight: 500;
  font-style: italic;
  color: var(--pcb-text-mute);
}

/* --------------------------------------------------------------- summary */
.pcb-summary { padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.pcb-total-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.pcb-total-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--pcb-text-mute); }
.pcb-total { font-size: 23px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--pcb-navy); }
.pcb-total[data-estimate] { font-size: 20px; }
.pcb-progress-text { font-size: 12px; color: var(--pcb-text-soft); font-variant-numeric: tabular-nums; }

.pcb-progress-track {
  height: 5px;
  border-radius: 100px;
  background: var(--pcb-surface-2);
  overflow: hidden;
}
.pcb-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--pcb-gold), var(--pcb-sandy));
  transition: width .25s ease;
}

.pcb-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pcb-metric {
  padding: 8px;
  border-radius: var(--pcb-radius-sm);
  background: var(--pcb-surface);
  border: 1px solid var(--pcb-border);
}
.pcb-metric-label { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--pcb-text-mute); }
.pcb-metric-value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pcb-navy); }

.pcb-status {
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: var(--pcb-radius-sm);
  background: var(--pcb-surface);
  color: var(--pcb-text-soft);
  text-align: center;
}
.pcb-status.is-ok { background: var(--pcb-gold); color: var(--pcb-navy); }
.pcb-status.is-warn { background: var(--pcb-warn-soft); color: var(--pcb-warn); }
.pcb-status.is-error { background: var(--pcb-error-soft); color: var(--pcb-error); }

.pcb-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.pcb-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--pcb-text-soft);
}
.pcb-check-dot {
  flex: 0 0 6px;
  width: 6px; height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--pcb-text-mute);
}
.pcb-check.is-ok .pcb-check-dot { background: var(--pcb-ok); }
.pcb-check.is-warn .pcb-check-dot { background: var(--pcb-sandy); }
.pcb-check.is-error .pcb-check-dot { background: var(--pcb-tomato); }
.pcb-check.is-error .pcb-check-text { color: var(--pcb-error); font-weight: 600; }
.pcb-check.is-warn .pcb-check-text { color: var(--pcb-warn); }
.pcb-check.is-info .pcb-check-dot { background: var(--pcb-navy); }

/* Collapsed "passed" checks: a text button, not a scroll area. */
.pcb-check-more { list-style: none; }
.pcb-check-toggle {
  font-size: 11px;
  font-weight: 700;
  color: var(--pcb-text-soft);
  padding: 2px 0;
  border-bottom: 1px dashed var(--pcb-border-strong);
}
.pcb-check-toggle:hover { color: var(--pcb-navy); border-bottom-color: var(--pcb-navy); }

.pcb-actions { display: flex; gap: 8px; }
.pcb-btn {
  flex: 1 1 auto;
  padding: 8px 14px;
  border-radius: var(--pcb-radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: background .12s, border-color .12s, color .12s;
}
.pcb-btn-primary { background: var(--pcb-navy); color: var(--pcb-chiffon); }
.pcb-btn-primary:hover { background: #0a2e50; }
.pcb-btn-ghost {
  background: var(--pcb-bg);
  color: var(--pcb-text-soft);
  border: 1px solid var(--pcb-border-strong);
}
.pcb-btn-ghost:hover { border-color: var(--pcb-navy); color: var(--pcb-navy); }

/* ------------------------------------------------------------ responsive */
/* The build row is 8 tiles across the full width. It only steps down when
   eight columns would make a tile narrower than its 38px icon, which happens
   around 1000px: 4 x 2 there, 2 x 4 on a phone. Above that it stays one row. */
@media (max-width: 1000px) {
  .pcb-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .pcb-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .pcb-builder { grid-template-columns: 1fr; }
  .pcb-rig-panel { position: static; }
}

@media (max-width: 600px) {
  .pcb-builder { font-size: 14px; }
  .pcb-cards { grid-template-columns: 1fr; }
  /* The tile spacing tightens up; the icon stays 38px because the supplied
     illustrations are the point of the row. */
  .pcb-slots { gap: 6px; padding: 12px; }
  .pcb-slot { padding: 10px 6px 8px; }
  .pcb-slot-spec { display: none; }
  .pcb-total { font-size: 22px; }
  .pcb-picker-tools { flex-wrap: wrap; }
  .pcb-input { flex-basis: 100%; }
}

/* Astra / theme overrides that would otherwise leak in */
.pcb-builder h2,
.pcb-builder h3 { margin: 0; }
.pcb-builder ul { margin: 0; }
.pcb-builder svg { max-width: none; }
