/* Place & Wire screens — scoped so the Plan wizard theme stays intact */
#place,
#wire {
  --pw-accent: #0f7fa0;
  --pw-accent-hover: #199fc4;
  --pw-van-fill: #1a1a1a;
  --pw-van-stroke: #3a3a3a;
  --pw-van-glass: #101820;
  --pw-zone: rgba(15, 127, 160, 0.2);
  --pw-zone-stroke: rgba(15, 127, 160, 0.55);
  --pw-zone-active: rgba(25, 159, 196, 0.35);
  background: #e8eef2;
  color: #13232d;
  padding-bottom: 48px;
}

#place .pw-top,
#wire .pw-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #dbe5eb;
  position: sticky;
  top: 0;
  z-index: 5;
}

#place .pw-brand,
#wire .pw-brand {
  font-weight: 700;
  color: #0b5f78;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

#place .pw-steps,
#wire .pw-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #5d7280;
}

#place .pw-steps .on,
#wire .pw-steps .on { color: #0b5f78; }
#place .pw-steps .done,
#wire .pw-steps .done { color: #16a34a; }

#place .pw-wrap,
#wire .pw-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

#place .pw-grid {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(340px, 1fr) minmax(200px, 240px);
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}

#wire .wire-result-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  #place .pw-grid,
  #wire .wire-result-grid { grid-template-columns: 1fr; }
}

#wire .wire-sheet-panel {
  margin-top: 16px;
  position: sticky;
  top: 52px;
  z-index: 4;
}

#wire .wire-sheet-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

#wire .wire-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#wire .wire-sheet th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #5d7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid #dbe5eb;
  white-space: nowrap;
}

#wire .wire-sheet td {
  padding: 10px;
  border-bottom: 1px solid #eef3f6;
  vertical-align: middle;
}

#wire .wire-sheet tr:last-child td { border-bottom: 0; }
#wire .wire-sheet .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
#wire .wire-sheet .part-name { font-weight: 700; color: #13232d; }
#wire .wire-sheet .part-sub { display: block; font-size: 12px; font-weight: 500; color: #5d7280; }
#wire .wire-sheet .len-input {
  width: 88px;
  min-height: 40px;
  border: 1px solid #c5d3db;
  border-radius: 8px;
  padding: 8px;
  font: inherit;
  font-family: ui-monospace, monospace;
  text-align: right;
}
#wire .wire-sheet .len-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
#wire .wire-sheet .size-cell strong {
  display: block;
  font-size: 15px;
  color: #0b5f78;
}
#wire .wire-sheet .size-cell small {
  color: #5d7280;
  font-size: 12px;
}
#wire .wire-sheet tr.hub-row { background: #f7fafc; }
#wire .wire-sheet tr.muted-row { opacity: 0.65; }

#place .pw-panel,
#wire .pw-panel {
  background: #fff;
  border: 1px solid #dbe5eb;
  border-radius: 14px;
  padding: 16px;
}

#place .pw-panel h2,
#place .pw-panel h3,
#wire .pw-panel h2,
#wire .pw-panel h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

#place .pw-lead,
#wire .pw-lead {
  color: #5d7280;
  font-size: 14px;
  margin: 0 0 12px;
}

#place .van-stage {
  background: linear-gradient(165deg, #2a3238 0%, #1a1f24 55%, #12161a 100%);
  border-radius: 14px;
  padding: 10px 8px 12px;
  min-height: min(72vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#place .van-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 100 / 140;
}

#place .van-wrap[data-vehicle="motorhome"] { max-width: 560px; }
#place .van-wrap[data-vehicle="caravan"] { max-width: 480px; }
#place .van-wrap[data-vehicle="campervan"] { max-width: 500px; }

#place .van-svg { width: 100%; height: 100%; display: block; overflow: visible; }
#place .van-shadow { fill: rgba(0, 0, 0, 0.28); }
#place .van-body { fill: var(--pw-van-fill); stroke: var(--pw-van-stroke); stroke-width: 0.7; }
#place .van-floor { fill: #14181c; stroke: #2a3036; stroke-width: 0.35; }
#place .van-glass { fill: var(--pw-van-glass); stroke: #2a4050; stroke-width: 0.4; }
#place .van-cab { fill: rgba(16, 24, 32, 0.35); stroke: none; }
#place .van-door { fill: #22272c; stroke: #3a4046; stroke-width: 0.35; }
#place .van-seam { fill: none; stroke: #2a2e32; stroke-width: 0.35; stroke-dasharray: 1.2 1.2; }
#place .van-wheel { fill: #111; stroke: #3a3a3a; stroke-width: 0.45; }
#place .van-hitch { fill: #c5ccd2; stroke: #8a939b; stroke-width: 0.5; }
#place .van-hitch-arm { fill: #2a3036; stroke: #4a525a; stroke-width: 0.4; }
#place .van-caption {
  fill: rgba(200, 210, 218, 0.7);
  font-size: 3.6px;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#place .zone-group { cursor: pointer; }
#place .zone {
  fill: var(--pw-zone);
  stroke: var(--pw-zone-stroke);
  stroke-width: 0.55;
}
#place .zone.drop-ready { stroke-dasharray: 2 1; stroke: #199fc4; }
#place .zone.drop-blocked {
  fill: rgba(40, 44, 48, 0.35);
  stroke: #3a4046;
  opacity: 0.45;
  cursor: not-allowed;
}
#place .zone.drop-target { fill: var(--pw-zone-active); stroke: #199fc4; }
#place .zone-group:hover .zone:not(.drop-blocked) { fill: var(--pw-zone-active); stroke: #199fc4; }
#place .zone.occupied { fill: rgba(15, 127, 160, 0.38); }
#place .zone-label {
  fill: rgba(230, 240, 245, 0.88);
  font-size: 4px;
  font-weight: 650;
  font-family: system-ui, sans-serif;
  letter-spacing: 0.02em;
  pointer-events: none;
}

#place .place-token,
#wire .place-token {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--pw-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  padding: 4px 8px 4px 5px;
  border-radius: 999px;
  pointer-events: auto;
  cursor: grab;
  white-space: nowrap;
  max-width: 72%;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  z-index: 2;
  user-select: none;
  -webkit-user-select: none;
}
#place .place-token:active { cursor: grabbing; }
#place .place-token-icon,
#wire .place-token-icon {
  display: inline-flex;
  flex: none;
  width: 14px;
  height: 14px;
  color: inherit;
}
#place .place-token-icon svg,
#wire .place-token-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}
#place .place-token-label,
#wire .place-token-label {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
#place .place-token.more,
#wire .place-token.more {
  background: #0b5f78;
  font-size: 8px;
  padding: 3px 6px;
  gap: 0;
  pointer-events: none;
  cursor: default;
}
#wire .place-token.locked {
  cursor: default;
  pointer-events: none;
}

#wire .wire-map-panel {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
}
#wire .wire-stage { min-height: min(68vh, 680px); }
#wire .wire-legend {
  margin: 10px 4px 0;
  font-size: 12px;
  color: #5d7280;
  text-align: center;
}
#wire .wl-line {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 2px solid #3db4d4;
  vertical-align: middle;
  margin-right: 4px;
}
#wire .wl-fuse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5b301;
  vertical-align: middle;
  margin: 0 4px 0 2px;
}

#wire .wire-run {
  stroke: #3db4d4;
  stroke-width: 0.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 0 0.6px rgba(15, 127, 160, 0.45));
}
#wire .wire-run.pending {
  stroke: #6a7a86;
  stroke-dasharray: 2.2 1.6;
  stroke-width: 0.65;
  filter: none;
}
#wire .wire-run.warn { stroke: #e07a8a; }
#wire .wire-run.ok { stroke: #3db4d4; }

#wire .run-badge {
  fill: #0f7fa0;
  stroke: #d7f4fc;
  stroke-width: 0.35;
}
#wire .run-badge-num {
  fill: #fff;
  font-size: 2.8px;
  font-weight: 700;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}
#wire .fuse-dot {
  fill: #f5b301;
  stroke: #1a1a1a;
  stroke-width: 0.35;
}
#wire .fuse-dot.pending { fill: #7a8b96; }
#wire .fuse-label {
  fill: #f5d76e;
  font-size: 2.6px;
  font-weight: 700;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}
#wire .fuse-mark rect {
  fill: #f5b301;
  stroke: #1a1a1a;
  stroke-width: 0.3;
}
#wire .fuse-mark text {
  fill: #1a1a1a;
  font-size: 2.7px;
  font-weight: 800;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}
#wire .fuse-mark.pending rect { fill: #9aa8b2; }
#wire .fuse-mark.pending text { fill: #fff; }
#wire .fuse-box-badge rect {
  fill: #0b5f78;
  stroke: #7fe0f7;
  stroke-width: 0.35;
}
#wire .fuse-box-badge text {
  fill: #fff;
  font-size: 2.7px;
  font-weight: 700;
  font-family: system-ui, sans-serif;
}

#wire .wire-run-legend {
  margin: 10px 8px 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #dbe5eb;
  border-radius: 12px;
  font-size: 12.5px;
  color: #13232d;
}
#wire .wire-run-legend ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
#wire .wire-run-legend li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 6px 0;
  border-bottom: 1px solid #eef3f6;
}
#wire .wire-run-legend li:last-child { border-bottom: 0; }
#wire .wire-run-legend li span {
  flex: 1 1 100%;
  color: #5d7280;
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
}
#wire .wire-run-legend li.ok b { color: #0b5f78; }
#wire .wire-run-legend li.warn b { color: #c81b3a; }

#wire .main-fuse rect {
  fill: #0b5f78;
  stroke: #7fe0f7;
  stroke-width: 0.35;
}
#wire .main-fuse text {
  fill: #fff;
  font-size: 3px;
  font-weight: 700;
  font-family: system-ui, sans-serif;
}

#wire .van-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 100 / 140;
}
#wire .van-svg { width: 100%; height: 100%; display: block; }
#wire .van-shadow { fill: rgba(0, 0, 0, 0.28); }
#wire .van-body { fill: var(--pw-van-fill); stroke: var(--pw-van-stroke); stroke-width: 0.7; }
#wire .van-floor { fill: #14181c; stroke: #2a3036; stroke-width: 0.35; }
#wire .van-glass { fill: var(--pw-van-glass); stroke: #2a4050; stroke-width: 0.4; }
#wire .van-cab { fill: rgba(16, 24, 32, 0.35); }
#wire .van-door { fill: #22272c; stroke: #3a4046; stroke-width: 0.35; }
#wire .van-seam { fill: none; stroke: #2a2e32; stroke-width: 0.35; stroke-dasharray: 1.2 1.2; }
#wire .van-wheel { fill: #111; stroke: #3a3a3a; stroke-width: 0.45; }
#wire .van-hitch { fill: #c5ccd2; stroke: #8a939b; stroke-width: 0.5; }
#wire .van-hitch-arm { fill: #2a3036; stroke: #4a525a; stroke-width: 0.4; }
#wire .van-caption {
  fill: rgba(200, 210, 218, 0.7);
  font-size: 3.6px;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#wire .zone {
  fill: var(--pw-zone);
  stroke: var(--pw-zone-stroke);
  stroke-width: 0.55;
  pointer-events: none;
}
#wire .zone.occupied { fill: rgba(15, 127, 160, 0.38); }
#wire .zone-label {
  fill: rgba(230, 240, 245, 0.88);
  font-size: 4px;
  font-weight: 650;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}
#place .kit-item,
#wire .wire-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #dbe5eb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
  cursor: grab;
}
#place .kit-item:active { cursor: grabbing; }
#place .kit-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: #e8f6fb;
  color: #0b5f78;
  font-size: 12px;
  font-weight: 700;
}
#place .kit-item-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: inherit;
}
#place .kit-item-icon svg { width: 18px; height: 18px; display: block; }
#place .kit-item-title { line-height: 1; }

/* Floating pick / drag chip — icon + short title only */
.place-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: #0f7fa0;
  color: #fff;
  font: 700 13px/1.1 system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(11, 95, 120, 0.35);
  pointer-events: none;
  white-space: nowrap;
  will-change: transform;
}
.place-ghost.on,
.place-ghost.drag-image { display: inline-flex; }
.place-ghost-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: #fff;
}
.place-ghost-icon svg { width: 22px; height: 22px; display: block; }
.place-ghost-label { letter-spacing: 0.01em; }

#place #kitList.return-ready {
  outline: 2px dashed #0f7fa0;
  outline-offset: 4px;
  border-radius: 10px;
  min-height: 48px;
}
#place #kitList.return-target {
  outline-color: #199fc4;
  background: #e8f6fb;
}

#place .kit-item.placed {
  background: #eef1f3;
  border-color: #d0d7dc;
  color: #8a97a1;
  cursor: pointer;
  opacity: 0.9;
}
#place .kit-item.placed b { color: #6b7a85; }
#place .kit-item.placed small { color: #8a97a1; }
#place .kit-item.placed:hover {
  border-color: #b0bcc4;
  background: #e6eaed;
}
#place .kit-item.picking { box-shadow: 0 0 0 2px #0f7fa0; }
#place .kit-item.placed.picking { box-shadow: none; }
#place .kit-item b,
#wire .wire-card b { display: block; font-size: 14px; }
#place .kit-item small,
#wire .wire-card small { color: #5d7280; font-size: 12px; }

#place .pw-btn,
#wire .pw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
  margin-top: 10px;
  text-decoration: none;
  box-sizing: border-box;
}

#place .pw-btn-primary,
#wire .pw-btn-primary { background: #0f7fa0; color: #fff; }
#place .pw-btn-secondary,
#wire .pw-btn-secondary { background: #e8f6fb; color: #0b5f78; }

#place .pick-label {
  font-size: 13px;
  font-weight: 600;
  color: #0b5f78;
  margin: 0 0 10px;
}

#wire .wire-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 700px) {
  #wire .wire-summary { grid-template-columns: 1fr 1fr; }
}

#wire .wire-summary .kpi {
  background: #fff;
  border: 1px solid #dbe5eb;
  border-radius: 10px;
  padding: 12px;
  font-size: 18px;
  font-weight: 700;
}

#wire .wire-summary .kpi small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #5d7280;
  margin-top: 2px;
}

#wire .run-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e6edf1;
  font-size: 14px;
}

#wire .run-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#wire .run-input input {
  width: 72px;
  min-height: 40px;
  border: 1px solid #c5d3db;
  border-radius: 8px;
  padding: 8px;
  font-family: ui-monospace, monospace;
  text-align: right;
}

#wire .wire-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: #5d7280;
}

#wire .wire-metrics strong { display: block; color: #13232d; font-size: 13px; }

#wire .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  background: #e8eef2;
}

#wire .badge.ok { background: #e8f8ee; color: #16a34a; }
#wire .badge.warn { background: #fde8ec; color: #c81b3a; }

#wire .compat-list,
#wire .notes {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: #5d7280;
}

#wire .compat-list li.ok { color: #16a34a; }
#wire .compat-list li.bad { color: #c81b3a; }
#wire .compat-list li.warn { color: #b45309; }

#place .toast,
#wire .toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #0f7fa0;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
}

#place .toast.on,
#wire .toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#wire details.fold {
  margin-top: 14px;
  border-top: 1px solid #dbe5eb;
  padding-top: 10px;
}
#wire details.fold summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #13232d;
}
#wire .tech {
  font-size: 13px;
  color: #5d7280;
}
#wire .tech table {
  width: 100%;
  border-collapse: collapse;
}
#wire .tech td {
  padding: 4px 0;
  border-bottom: 1px solid #edf2f5;
}
#wire .tech td:last-child {
  text-align: right;
  color: #13232d;
  font-variant-numeric: tabular-nums;
}
#wire .disclaimer {
  font-size: 12px;
  color: #5d7280;
}

#wire .list-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e6edf1;
  font-size: 13px;
}

#wire .list-line span {
  font-family: ui-monospace, monospace;
  color: #5d7280;
  font-size: 12px;
  text-align: right;
}

#wire .wire-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
