/* =============================================
   Access Product Inc. — Vault Designer
   Loaded after style.css; reuses its tokens.
   ============================================= */

.dsg-page {
  padding: calc(var(--navbar-height) + 2.5rem) 1.5rem 5rem;
  max-width: 1180px;
  margin: 0 auto;
}

/* --- Staff gate (under construction) ---
   Both wrappers are toggled with the hidden attribute by designer-gate.js. */
#dsgApp[hidden], #dsgGate[hidden] { display: none !important; }

.dsg-gate-card {
  max-width: 560px;
  margin: 1.5rem auto 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
}
@media (max-width: 480px) { .dsg-gate-card { padding: 1.4rem; } }

.dsg-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgba(255, 69, 0, 0.12);
  border: 1px solid rgba(255, 69, 0, 0.45);
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dsg-gate-card .section-title { margin-bottom: 0.75rem; }
.dsg-gate-card p { color: var(--color-muted); line-height: 1.65; margin-bottom: 0.9rem; }
.dsg-gate-card p a { color: var(--color-accent); }

.dsg-gate-form { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--color-border); }

.dsg-gate-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.dsg-gate-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.dsg-gate-input {
  flex: 1 1 14rem;
  min-width: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
}
.dsg-gate-input:focus { outline: none; border-color: var(--color-accent); }
.dsg-gate-input[aria-invalid="true"] { border-color: #d13438; }

.dsg-gate-card .dsg-gate-error { color: #ff6b6e; font-size: 0.85rem; margin: 0.6rem 0 0; }

.dsg-head { margin-bottom: 2rem; }
.dsg-head .section-title { margin-bottom: 0.5rem; }
.dsg-head p { color: var(--color-muted); max-width: 640px; }

/* --- Step indicator --- */
.dsg-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 2.5rem;
  flex-wrap: wrap;
}

.dsg-crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.15rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  transition: color var(--transition);
}

.dsg-crumb:disabled { cursor: not-allowed; opacity: 0.45; }
.dsg-crumb:not(:disabled):hover { color: var(--color-text); }
.dsg-crumb.is-active { color: var(--color-accent); }
.dsg-crumb.is-done { color: var(--color-text); }

.dsg-crumb-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: all var(--transition);
}

.dsg-crumb.is-active .dsg-crumb-num {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-white);
}

.dsg-crumb.is-done .dsg-crumb-num {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.dsg-steps-sep {
  width: 26px;
  height: 2px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* --- Step panels --- */
.dsg-step { display: none; }
.dsg-step.is-active { display: block; animation: dsgFade 0.3s ease; }

@keyframes dsgFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* --- Step 1: product picker --- */
.dsg-products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 900px) { .dsg-products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .dsg-products { grid-template-columns: 1fr; } }

.dsg-product {
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.dsg-product:not(.is-disabled):hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-card);
}

.dsg-product.is-disabled { cursor: not-allowed; opacity: 0.5; }

.dsg-product-img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-surface-2);
  overflow: hidden;
}

.dsg-product-img img { width: 100%; height: 100%; object-fit: cover; }

.dsg-soon {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(13, 17, 23, 0.85);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
}

.dsg-product-body { padding: 1rem 1.1rem 1.2rem; flex: 1; display: flex; flex-direction: column; }

.dsg-product-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-white);
  margin-bottom: 0.2rem;
}

.dsg-product-variant {
  font-size: 0.72rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.dsg-product-blurb {
  font-size: 0.82rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

/* --- Step 2 layout --- */
.dsg-build {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .dsg-build { grid-template-columns: 1fr; gap: 1.5rem; }
}

.dsg-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.dsg-panel-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
  margin-bottom: 0.9rem;
}

/* --- Module palette --- */
.dsg-palette { display: flex; flex-direction: column; gap: 0.7rem; }

/* Long option lists (BTC Custom) scroll inside the panel instead of pushing
   the stage off screen. */
.dsg-palette.is-compact {
  gap: 0.3rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-right: -0.35rem;
}

.dsg-palette.is-compact::-webkit-scrollbar { width: 6px; }
.dsg-palette.is-compact::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 100px;
}

.dsg-mod-group {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-accent);
  padding: 0.75rem 0 0.15rem;
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.dsg-mod-group:first-child { padding-top: 0; }

.dsg-palette.is-compact .dsg-mod {
  padding: 0.5rem 0.65rem;
  gap: 0.6rem;
  align-items: center;
}

.dsg-palette.is-compact .dsg-mod-icon { width: 24px; height: 24px; }
.dsg-palette.is-compact .dsg-mod-name { font-size: 0.82rem; }
.dsg-palette.is-compact .dsg-mod-meta { font-size: 0.65rem; }

.dsg-mod {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: grab;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}

.dsg-mod:hover, .dsg-mod:focus-visible {
  border-color: var(--color-accent);
  transform: translateY(-1px);
  outline: none;
}

.dsg-mod.is-armed {
  border-color: var(--color-accent);
  background: rgba(255, 69, 0, 0.1);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.dsg-mod.is-dragging { opacity: 0.45; }
.dsg-mod.is-full { opacity: 0.45; }

.dsg-mod-icon {
  width: 34px; height: 34px;
  color: var(--color-accent);
  flex-shrink: 0;
}
.dsg-mod-icon svg { width: 100%; height: 100%; }

.dsg-mod-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }

.dsg-mod-name { font-weight: 600; font-size: 0.88rem; color: var(--color-white); }

.dsg-mod-meta {
  font-size: 0.7rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.dsg-mod-desc { font-size: 0.76rem; color: var(--color-muted); line-height: 1.5; }

.dsg-mod-add {
  font-size: 1.3rem;
  color: var(--color-muted);
  line-height: 1;
  align-self: center;
}

.dsg-hint {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border);
  line-height: 1.6;
}

/* --- Finishes --- */
.dsg-finishes { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.dsg-finish {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.dsg-finish:hover { border-color: var(--color-accent); }
.dsg-finish.is-active { border-color: var(--color-accent); color: var(--color-accent); }

.dsg-swatch {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}

/* --- The unit track --- */
.dsg-stage {
  /* Grid items default to min-width:auto, which lets a wide track push the whole
     page sideways instead of scrolling inside .dsg-track-wrap. */
  min-width: 0;
  /* The connector picker hangs off the stage, not the track: .dsg-track-wrap
     scrolls, and a scroll container clips a popover on BOTH axes. */
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.dsg-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.dsg-unit-name { font-family: var(--font-display); font-size: 1.05rem; color: var(--color-white); }
.dsg-unit-sub { font-size: 0.78rem; color: var(--color-muted); }

/* A 9-bay unit is wider than the stage, so the track scrolls. Keep the
   scrollbar visible so it is obvious there is more unit off to the right. */
.dsg-track-wrap {
  overflow-x: auto;
  padding-bottom: 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-surface-2);
}

.dsg-track-wrap::-webkit-scrollbar { height: 8px; }
.dsg-track-wrap::-webkit-scrollbar-track {
  background: var(--color-surface-2);
  border-radius: 100px;
}
.dsg-track-wrap::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 100px;
}
.dsg-track-wrap::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

.dsg-track {
  --dsg-finish: #c8ccd0;
  --dsg-finish-body: #9aa1a8;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #23272c 0%, #15181c 100%);
  border: 1px solid var(--color-border);
  min-width: var(--dsg-track-min, 660px);
}

/* Fixed hardware — visibly not a bay */
.dsg-fixed {
  flex: 0 0 62px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.6rem 0.3rem;
  border-radius: 6px;
  background: repeating-linear-gradient(
    45deg,
    rgba(139,148,158,0.07),
    rgba(139,148,158,0.07) 4px,
    transparent 4px,
    transparent 8px
  ), var(--color-surface-2);
  border: 1px dashed var(--color-border);
  color: var(--color-muted);
  cursor: not-allowed;
  text-align: center;
}

.dsg-fixed-icon { width: 22px; height: 22px; opacity: 0.75; }
.dsg-fixed-icon svg { width: 100%; height: 100%; }
.dsg-fixed-name { font-size: 0.65rem; font-weight: 600; }
.dsg-fixed-tag {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

/* Configurable bays */
.dsg-bay {
  --span: 1;
  flex: var(--span) 1 0;
  min-width: calc(72px * var(--span));
  /* Real modules are portrait (roughly 3:5), so the bay is tall enough for a
     face drawing to read properly rather than being letterboxed. */
  min-height: 132px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.1rem 0.4rem;
  border-radius: 6px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.dsg-bay:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.dsg-bay.is-empty {
  background: rgba(13, 17, 23, 0.55);
  border: 1px dashed var(--color-border);
  color: var(--color-muted);
  cursor: pointer;
}

.dsg-bay.is-empty:hover { border-color: var(--color-accent); color: var(--color-text); }

.dsg-bay.is-filled {
  background: linear-gradient(180deg, var(--dsg-finish) 0%, var(--dsg-finish-body) 100%);
  border: 1px solid rgba(0,0,0,0.35);
  color: #14171a;
  cursor: grab;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 6px rgba(0,0,0,0.35);
}

/* --- Modules with a face drawing ---
   The drawing IS the bay face, so the tile loses its padding and the label
   becomes a translucent strip across the bottom. Modules without a drawing
   keep the icon treatment above. */
.dsg-bay.is-filled.has-image {
  padding: 0;
  overflow: hidden;
  background: #3a3a3c;
  justify-content: flex-end;
}

/* The face fills the bay; the drawing inside it is the plate. */
.dsg-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
}
.dsg-face:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }

.dsg-bay-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.dsg-bay.has-image .dsg-bay-label {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  padding: 2px 2px 3px;
  /* fades into the plate rather than cutting across the lower port */
  background: linear-gradient(180deg, rgba(10,12,14,0) 0%, rgba(10,12,14,0.82) 45%, rgba(10,12,14,0.92) 100%);
  color: #e6edf3;
  font-size: 0.6rem;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.dsg-bay.has-image .dsg-bay-num {
  z-index: 1;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  opacity: 0.9;
}

.dsg-bay.has-image .dsg-bay-remove { z-index: 2; }

.dsg-bay.is-filled:active { cursor: grabbing; }
.dsg-bay.is-dragging { opacity: 0.4; }

.dsg-bay.is-valid { box-shadow: inset 0 0 0 2px var(--color-accent); }
.dsg-bay.is-invalid { box-shadow: inset 0 0 0 2px #d13438; }
.dsg-bay.is-over.is-valid { background: rgba(255, 69, 0, 0.22); transform: translateY(-2px); }
.dsg-bay.is-over.is-invalid { background: rgba(209, 52, 56, 0.18); }

.dsg-bay-num {
  position: absolute;
  top: 4px; left: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  opacity: 0.6;
}

.dsg-bay-icon { width: 26px; height: 26px; }
.dsg-bay-icon svg { width: 100%; height: 100%; }

.dsg-bay-label { font-size: 0.72rem; font-weight: 600; }

.dsg-bay-remove {
  position: absolute;
  top: 3px; right: 4px;
  width: 18px; height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}

.dsg-bay.is-filled:hover .dsg-bay-remove,
.dsg-bay.is-filled:focus-within .dsg-bay-remove { opacity: 1; }
.dsg-bay-remove:hover { background: #d13438; }

/* --- The fitted outlet ---
   Reads as a real module (it is one), but carries the fixed hardware's cursor
   and hatch so it is plainly not something the customer can drag away. */
.dsg-bay.is-locked,
.dsg-bay.is-locked:active { cursor: not-allowed; }

.dsg-bay.is-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(
    45deg,
    rgba(13,17,23,0.16),
    rgba(13,17,23,0.16) 4px,
    transparent 4px,
    transparent 8px
  );
  box-shadow: inset 0 0 0 1px rgba(13,17,23,0.45);
}

.dsg-bay.is-locked .dsg-bay-label { z-index: 2; }

.dsg-bay-tag {
  position: absolute;
  top: 4px; right: 5px;
  z-index: 2;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(13,17,23,0.6);
  color: #e6edf3;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Split plates ---
   A one-bay plate that can carry two connectors is drawn as two stacked
   halves, matching the physical part: each half is its own drawing, and an
   empty half is the control that fills it. */
.dsg-bay.is-split {
  padding: 0;
  overflow: hidden;
  flex-direction: column;
  justify-content: stretch;
  /* .dsg-bay centres its children; in a column flex that shrinks each half to
     the width of its own label instead of spanning the plate. */
  align-items: stretch;
  gap: 0;
  /* The charcoal faceplate is painted here, once, across both halves. The
     half drawings are transparent so this reads as ONE plate with two
     cut-outs rather than two plates butted together. Keep these stops in step
     with the `plate` and `sheen` gradients in docs/module-drawings/plate.js. */
  background:
    linear-gradient(90deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.02) 35%, rgba(0,0,0,0.10) 100%),
    linear-gradient(180deg, #5a5a5c 0%, #4d4d4f 50%, #434345 100%);
}

.dsg-half {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

/* the seam where the two halves meet */
.dsg-half + .dsg-half { box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.55); }

.dsg-half:hover { box-shadow: inset 0 0 0 2px var(--color-accent); }
.dsg-half + .dsg-half:hover {
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.55), inset 0 0 0 2px var(--color-accent);
}
.dsg-half:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }

.dsg-half-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* contain, not cover: the drawing is a transparent connector over the bay's
     own faceplate, so cropping it would clip the jack rather than the plate. */
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.dsg-half-icon {
  width: 20px;
  height: 20px;
  margin-bottom: auto;
  margin-top: auto;
  color: var(--color-muted);
}
.dsg-half-icon svg { width: 100%; height: 100%; }

.dsg-half-label {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1px 2px 2px;
  text-align: center;
  background: linear-gradient(180deg, rgba(10,12,14,0) 0%, rgba(10,12,14,0.82) 45%, rgba(10,12,14,0.92) 100%);
  color: #e6edf3;
  font-size: 0.55rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

/* An empty half reads as an invitation, not as a broken plate. */
.dsg-half.is-open {
  background: repeating-linear-gradient(
    45deg,
    rgba(13,17,23,0.22),
    rgba(13,17,23,0.22) 4px,
    transparent 4px,
    transparent 8px
  ), rgba(13, 17, 23, 0.42);
  box-shadow: inset 0 0 0 1px rgba(13,17,23,0.35);
  justify-content: center;
  gap: 0.15rem;
}
.dsg-half.is-open .dsg-half-icon,
.dsg-half.is-open .dsg-half-label { color: #d5dae0; }
.dsg-half.is-open .dsg-half-label { background: none; }
.dsg-half.is-open:hover { box-shadow: inset 0 0 0 2px var(--color-accent); }
.dsg-half.is-open:hover .dsg-half-icon,
.dsg-half.is-open:hover .dsg-half-label { color: #fff; }

.dsg-half-remove {
  position: absolute;
  top: 2px; right: 3px;
  z-index: 2;
  width: 15px; height: 15px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}
.dsg-half:hover .dsg-half-remove,
.dsg-half:focus-within .dsg-half-remove { opacity: 1; }
.dsg-half-remove:hover { background: #d13438; }

/* The locked plate keeps its hatch above the halves. */
.dsg-bay.is-locked .dsg-half { cursor: not-allowed; }
.dsg-bay.is-locked .dsg-half:hover { box-shadow: none; }

/* --- Standard configuration (products with a preset) ---
   Every plate is fixed, but unlike the fitted outlet on a configurable unit it
   is not hatched: the whole unit is the standard product, so it should read as
   the product rather than as a row of disabled controls. */
.dsg-bay.is-preset,
.dsg-bay.is-preset:active { cursor: default; }
.dsg-bay.is-preset .dsg-half { cursor: default; pointer-events: none; }

.dsg-preset-text { font-size: 0.85rem; color: var(--color-text); line-height: 1.6; margin-bottom: 0.9rem; }
.dsg-preset-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.45rem; }
.dsg-preset-list li { display: flex; gap: 0.6rem; font-size: 0.8rem; color: var(--color-text); line-height: 1.45; }
.dsg-preset-bay { flex: 0 0 4.4rem; color: var(--color-accent); font-weight: 600; white-space: nowrap; }
.dsg-preset-cta { width: 100%; justify-content: center; }

/* --- Country field on a Country Specific Outlet row of the design listing --- */
.dsg-country { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-top: 0.45rem; }
.dsg-country-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}
.dsg-required { color: #d13438; }
.dsg-country-input {
  flex: 1 1 10rem;
  min-width: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}
.dsg-country-input:focus { outline: none; border-color: var(--color-accent); }
.dsg-country-input[aria-invalid="true"] { border-color: #d13438; box-shadow: 0 0 0 1px rgba(209,52,56,0.35); }

/* --- Cord length --- */
.dsg-cords { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.dsg-cord {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.55rem 0.8rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.dsg-cord:hover { border-color: var(--color-accent); }
.dsg-cord.is-active { border-color: var(--color-accent); color: var(--color-accent); }
.dsg-cord-name { font-size: 0.8rem; font-weight: 600; }
.dsg-cord-note { font-size: 0.62rem; color: var(--color-muted); line-height: 1.3; }

/* --- Connector picker ---
   A popover anchored under the plate position it was opened from. */
.dsg-picker {
  position: absolute;
  z-index: 30;
  width: 260px;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.dsg-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dsg-picker-sub { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--color-muted); }

.dsg-picker-body { overflow-y: auto; padding: 0.3rem; }

.dsg-picker-group {
  padding: 0.4rem 0.4rem 0.2rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.dsg-picker-opt {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.45rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--color-text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.dsg-picker-opt:hover { background: var(--color-surface-2); }
.dsg-picker-opt:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.dsg-picker-opt.is-active { border-color: var(--color-accent); color: var(--color-accent); }

.dsg-picker-icon { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; }
.dsg-picker-icon svg { width: 100%; height: 100%; }
.dsg-picker-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.dsg-picker-name { font-size: 0.74rem; font-weight: 600; }
.dsg-picker-desc { font-size: 0.62rem; line-height: 1.35; color: var(--color-muted); }

.dsg-picker-empty { padding: 0.7rem; margin: 0; font-size: 0.7rem; color: var(--color-muted); }

.dsg-picker-clear {
  border: none;
  border-top: 1px solid var(--color-border);
  background: none;
  padding: 0.5rem;
  color: #d13438;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.dsg-picker-clear:hover { background: rgba(209, 52, 56, 0.12); }

/* A connector sharing a plate is listed under the plate it shares. */
.dsg-row-shared td:first-child { border-left: 2px solid var(--color-border); }
.dsg-row-shared td:nth-child(2) { padding-left: 1.4rem; }

/* --- Capacity --- */
.dsg-capacity { margin-top: 1.25rem; }

.dsg-cap-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.dsg-cap-text { font-size: 0.85rem; font-weight: 600; color: var(--color-white); }
.dsg-cap-note { font-size: 0.75rem; color: var(--color-muted); }

.dsg-cap-track {
  height: 5px;
  background: var(--color-surface-2);
  border-radius: 100px;
  overflow: hidden;
}

.dsg-cap-bar {
  height: 100%;
  width: 0;
  background: var(--color-accent);
  border-radius: 100px;
  transition: width 0.3s ease;
}

.dsg-size-note {
  font-size: 0.73rem;
  color: var(--color-muted);
  line-height: 1.55;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--color-border);
}

.dsg-size-note:empty { display: none; }

/* --- Configuration issues --- */
.dsg-issues { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.85rem; }
.dsg-issues.is-empty { display: none; }

.dsg-issue {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
}

.dsg-issue-icon {
  width: 17px; height: 17px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.dsg-issue.is-error { border-color: rgba(209,52,56,0.5); background: rgba(209,52,56,0.10); }
.dsg-issue.is-error .dsg-issue-icon { background: #d13438; color: #fff; }

.dsg-issue.is-warning { border-color: rgba(255,69,0,0.4); background: rgba(255,69,0,0.08); }
.dsg-issue.is-warning .dsg-issue-icon { background: var(--color-accent); color: #fff; }

#dsgQuote.is-blocked {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#dsgQuote.is-blocked:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: none;
  box-shadow: none;
}

.dsg-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  align-items: center;
}

.dsg-link-btn {
  background: none;
  border: none;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.2rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dsg-link-btn:hover { color: var(--color-accent); }

/* --- Step 3: review --- */
.dsg-review { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2rem; align-items: start; }

@media (max-width: 900px) { .dsg-review { grid-template-columns: 1fr; } }

.dsg-review-head h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-white);
  margin-bottom: 0.25rem;
}

.dsg-review-sub { font-size: 0.82rem; color: var(--color-muted); margin-bottom: 1.25rem; }

.dsg-mini-track {
  display: flex;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, #23272c 0%, #15181c 100%);
  border: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.dsg-mini {
  --span: 1;
  flex: var(--span) 1 0;
  min-width: calc(52px * var(--span));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.55rem 0.25rem;
  border-radius: 4px;
  text-align: center;
}

.dsg-mini span { width: 18px; height: 18px; }
.dsg-mini span svg { width: 100%; height: 100%; }
.dsg-mini em { font-style: normal; font-size: 0.6rem; font-weight: 600; }

.dsg-mini-fixed {
  flex: 0 0 48px;
  min-width: 48px;
  background: var(--color-surface-2);
  border: 1px dashed var(--color-border);
  color: var(--color-muted);
}

.dsg-mini-filled {
  background: var(--dsg-finish, #c8ccd0);
  color: #14171a;
}

.dsg-mini-empty {
  background: rgba(13,17,23,0.55);
  border: 1px dashed var(--color-border);
  color: var(--color-muted);
}

.dsg-part-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

.dsg-part-table th {
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.dsg-part-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.dsg-part-table td:first-child { width: 62px; color: var(--color-accent); font-weight: 600; }
.dsg-part-table td:last-child { width: 84px; color: var(--color-muted); font-size: 0.78rem; }
.dsg-row-fixed td { color: var(--color-muted); }
.dsg-row-fixed td:first-child { color: var(--color-muted); }
.dsg-row-blank td { color: var(--color-muted); }

.dsg-summary-pre {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
  margin-bottom: 1rem;
}

.dsg-share-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.dsg-share-input {
  flex: 1;
  min-width: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.72rem;
  padding: 0.5rem 0.7rem;
}

.dsg-handoff { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.dsg-handoff-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.is-copied { border-color: var(--color-accent) !important; color: var(--color-accent) !important; }

/* --- Saved designs --- */
.dsg-save-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.dsg-save-input {
  flex: 1;
  min-width: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.5rem 0.7rem;
}

.dsg-save-input:focus { outline: none; border-color: var(--color-accent); }

.dsg-saved-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.dsg-saved-meta { display: flex; flex-direction: column; min-width: 0; }
.dsg-saved-meta strong { font-size: 0.85rem; color: var(--color-white); }
.dsg-saved-meta span { font-size: 0.73rem; color: var(--color-muted); }
.dsg-saved-actions { display: flex; gap: 0.5rem; align-items: center; }

.dsg-empty { font-size: 0.82rem; color: var(--color-muted); }

/* --- Toast --- */
.dsg-toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 200%);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  color: var(--color-text);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  box-shadow: var(--shadow-card);
  z-index: 2000;
  max-width: min(520px, calc(100vw - 2rem));
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.dsg-toast.show { transform: translate(-50%, 0); opacity: 1; }
.dsg-toast.warn { border-left-color: #d13438; }

/* --- Mobile: stack the track vertically --- */
@media (max-width: 700px) {
  .dsg-track {
    flex-direction: column;
    min-width: 0;
  }
  .dsg-track-wrap { overflow-x: visible; }
  .dsg-fixed { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 0.6rem; padding: 0.5rem 0.8rem; }
  .dsg-fixed-tag { margin-left: auto; }
  .dsg-bay {
    flex: 0 0 auto;
    min-width: 0;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.7rem;
    padding: 0.75rem 0.9rem;
    min-height: calc(46px * var(--span));
  }
  /* "4-5" must not wrap into the Fitted tag, and it has to sit above the
     plate drawing now that the drawing covers the whole bay. */
  .dsg-bay-num {
    position: relative;
    z-index: 2;
    opacity: 0.7;
    min-width: 34px;
    white-space: nowrap;
    /* has-image bays justify to flex-end, which in a row would push the number
       across the plate and under the Fitted tag. */
    margin-right: auto;
  }
  /* Laid out as a wide, short row, `cover` slices a portrait plate drawing in
     half. Contain shows the whole receptacle. */
  .dsg-bay-img { object-fit: contain; object-position: center; }
  .dsg-bay-remove { opacity: 1; top: 50%; right: 8px; transform: translateY(-50%); }
  .dsg-bay-tag { top: 50%; right: 8px; transform: translateY(-50%); }
  /* Laid out as a row, a plate's two positions sit side by side. */
  .dsg-bay.is-split { flex-direction: row; }
  .dsg-half + .dsg-half { box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.55); }
  .dsg-half + .dsg-half:hover {
    box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.55), inset 0 0 0 2px var(--color-accent);
  }
  .dsg-picker { width: min(260px, calc(100vw - 3rem)); }
  .dsg-mini-track { flex-direction: column; }
  .dsg-mini { flex-direction: row; justify-content: flex-start; gap: 0.5rem; min-width: 0; }
  .dsg-mini-fixed { flex: 0 0 auto; }
}

/* --- Print: clean one-page spec sheet ---
   Printing is offered from step 3 only. Everything that is a control rather
   than part of the configuration is dropped, including the whole right-hand
   handoff column. */
/* --- Disclaimer ---
   Part of the design card, not the handoff column, so it survives the print
   stylesheet and lands on the page a customer hands to someone else. */
.dsg-disclaimer {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: 6px;
  background: var(--color-surface-2);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.dsg-disclaimer ul { margin: 0; padding-left: 1.1rem; }
.dsg-disclaimer li { margin: 0.15rem 0; }
.dsg-disclaimer ul + ul { margin-top: 0.5rem; }

.dsg-disclaimer-title {
  margin: 0 0 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
}

.dsg-disclaimer-headline {
  margin: 0.6rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-text);
}

@media print {
  .site-navbar, .mobile-nav, .site-footer, .dsg-steps, .dsg-toast,
  .back-link, .dsg-head p, .dsg-head .section-eyebrow,
  .dsg-actions, .dsg-panel, .dsg-issues { display: none !important; }

  /* Keep the disclaimer on the page, in ink, with the design it describes. */
  .dsg-disclaimer {
    display: block !important;
    page-break-inside: avoid;
    background: #fff !important;
    border: 1px solid #999 !important;
    border-left: 3px solid #ff4500 !important;
    color: #333 !important;
  }
  .dsg-disclaimer-title,
  .dsg-disclaimer-headline { color: #000 !important; }
  .dsg-disclaimer-headline { border-top: 1px solid #ccc !important; }

  /* the handoff / summary / saved column */
  .dsg-review > div:last-child { display: none !important; }

  body {
    background: #fff !important;
    color: #14171a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .dsg-page { padding: 0; max-width: none; }
  .dsg-review { grid-template-columns: 1fr; gap: 1rem; display: block; }

  .dsg-head { margin-bottom: 0.75rem; }
  .dsg-head .section-title,
  .dsg-review-head h3 { color: #000 !important; font-size: 1.15rem; }
  .dsg-review-sub { color: #444 !important; }

  .dsg-part-table { page-break-inside: avoid; }
  .dsg-part-table td { color: #14171a !important; }
  .dsg-country-input {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #000 !important;
    padding: 0 !important;
  }
  .dsg-country-label { color: #555 !important; }
  .dsg-part-table th { color: #555 !important; }
  .dsg-row-fixed td, .dsg-row-blank td { color: #666 !important; }
  .dsg-part-table td:first-child { color: #ff4500 !important; }
  .dsg-part-table th, .dsg-part-table td { border-bottom: 1px solid #ccc; }

  .dsg-mini-track {
    background: #fff !important;
    border: 1px solid #999;
    page-break-inside: avoid;
  }
  .dsg-mini-filled { background: #d8dbde !important; color: #000 !important; border: 1px solid #999; }
  .dsg-mini-fixed, .dsg-mini-empty {
    background: #fff !important;
    border: 1px dashed #999;
    color: #555 !important;
  }
}
