/* Wire Harness CAD — tool-specific styles. Relies on /shared/styles.css for vars + theme. */
html, body.wh { height: 100%; }
body.wh {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---- top bar ---- */
.wh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-wrap: wrap;
}
.wh-brand { display: inline-flex; align-items: center; gap: 10px; }
.wh-brand .mark { width: 34px; height: 34px; margin: 0; border-radius: 9px; font-size: 0.82rem; }
.wh-title { font-weight: 800; letter-spacing: -0.01em; }
.wh-pill {
  font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); background: var(--code-bg); padding: 2px 7px; border-radius: 999px;
}
.wh-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wh-group { display: inline-flex; gap: 2px; background: var(--code-bg); padding: 3px; border-radius: 10px; }
.wh-tools button {
  font: inherit; font-size: 0.84rem; font-weight: 650;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  padding: 6px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.wh-tools button:hover { background: var(--panel); }
.wh-tools button.on { background: var(--accent); color: var(--accent-ink); }
.wh-tools button:disabled { opacity: 0.4; cursor: not-allowed; }
.wh-tools button:disabled:hover { background: transparent; }
.wh-tools .theme-toggle { background: var(--panel); border: 1px solid var(--border); }

/* ---- main split ---- */
.wh-main { flex: 1; display: flex; min-height: 0; }
.wh-canvas { position: relative; flex: 1; min-width: 0; overflow: hidden; background: var(--bg); }
#svg { width: 100%; height: 100%; display: block; cursor: default; touch-action: none; }
#svg.panning { cursor: grabbing; }
#svg.wire-mode { cursor: crosshair; }

.wh-hud {
  position: absolute; left: 12px; bottom: 12px;
  display: flex; gap: 8px; align-items: center;
  font-size: 0.74rem; color: var(--muted);
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px;
  pointer-events: none; backdrop-filter: blur(6px);
}
.wh-hud b { color: var(--ink); font-variant-numeric: tabular-nums; }
.wh-toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-size: 0.82rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow); z-index: 5;
}

/* ---- side panel ---- */
.wh-panel {
  width: 312px; flex: none; border-left: 1px solid var(--border);
  background: var(--panel); padding: 16px; overflow-y: auto;
}
.wh-panel h3 { margin: 0 0 4px; font-size: 0.95rem; }
.wh-panel .muted { color: var(--muted); font-size: 0.84rem; line-height: 1.5; }
.wh-panel .empty { margin-top: 8px; }
.wh-field { margin-top: 14px; }
.wh-field > label { display: block; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 5px; }
.wh-field input[type="text"], .wh-field select {
  width: 100%; font: inherit; font-size: 0.88rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.wh-field input:focus, .wh-field select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; border-color: var(--accent); }
.wh-row { display: flex; gap: 8px; }
.wh-row > * { flex: 1; }

.pin-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.pin-item { display: flex; align-items: center; gap: 7px; }
.pin-item .pin-no { width: 22px; text-align: center; font-size: 0.72rem; font-weight: 800; color: var(--muted); }
.pin-item input { flex: 1; font: inherit; font-size: 0.82rem; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; color: var(--ink); }
.pin-item button { border: 1px solid var(--border); background: var(--bg); color: var(--muted); border-radius: 7px; width: 28px; height: 30px; cursor: pointer; }
.pin-item button:hover { color: #e23b3b; border-color: #e23b3b; }

.swatches { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 6px; }
.swatch { aspect-ratio: 1; border-radius: 7px; border: 1px solid var(--border); cursor: pointer; position: relative; }
.swatch.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.swatch.none { display: grid; place-items: center; font-size: 0.7rem; color: var(--muted); }

.btn {
  font: inherit; font-size: 0.86rem; font-weight: 650; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--ink);
  border-radius: 9px; padding: 9px 12px; width: 100%; margin-top: 14px;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger:hover { border-color: #e23b3b; color: #e23b3b; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); color: var(--accent-ink); }

.kbd { font-size: 0.7rem; background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--muted); }
.legend-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.82rem; color: var(--muted); }

@media (max-width: 760px) {
  .wh-panel { display: none; }
}
