/* ─────────────────────────────────────────────
   Inspector (issue #29): the selected part's values and controls, at the
   top of the right-hand panel above the chat. Built by js/inspector.js.
───────────────────────────────────────────── */

#inspector {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  max-height: 45%;
  overflow-y: auto;
}
#inspector[hidden] { display: none; }

.inspector-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.inspector-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
}

#inspector-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

#inspector-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspector-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspector-key {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: capitalize;
}

.inspector-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
}
.inspector-input:focus { border-color: var(--accent); }

.inspector-slider {
  flex: 1;
  accent-color: var(--accent);
}

.inspector-check {
  accent-color: var(--accent);
  cursor: pointer;
}
.inspector-check:disabled { cursor: not-allowed; }

.inspector-unit {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.inspector-hint {
  font-size: 11px;
  color: #15803d;
}

.inspector-error {
  font-size: 11px;
  color: var(--danger);
}

.inspector-hint[hidden],
.inspector-error[hidden] { display: none; }

/* A value that doesn't apply in the part's mode (a supply's CH2 in series):
   greyed, its input disabled, its note beside the name (#127). */
.inspector-off {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  font-style: italic;
  text-transform: none;
  color: var(--text-muted);
}
.inspector-off[hidden] { display: none; }

.inspector-row-disabled { opacity: 0.5; }
.inspector-row-disabled .inspector-input {
  color: var(--text-muted);
  background: #f3f4f6;
  cursor: not-allowed;
}

.inspector-empty {
  font-size: 11px;
  color: var(--text-muted);
}

/* A part's pin-out (#132): a top-view DIP diagram under the rows. The body
   is drawn behind the pin numbers; the names and legs sit outside it. */
.inspector-pinout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 4px;
}

.pinout-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.pinout-chip {
  --pin-name: 44px;
  --pin-leg:  8px;
  --pin-num:  22px;
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 20px;
  row-gap: 3px;
  padding: 12px 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.pinout-body {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--pin-name) + var(--pin-leg));
  right: calc(var(--pin-name) + var(--pin-leg));
  background: #1f2937;
  border-radius: 4px;
}

.pinout-notch {
  position: absolute;
  top: 0;
  left: 50%;
  width: 14px;
  height: 7px;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 0 0 7px 7px;
}

.pinout-pin {
  position: relative;
  display: flex;
  align-items: center;
  height: 16px;
}

.pinout-name {
  box-sizing: border-box;
  width: var(--pin-name);
  color: var(--text-primary);
  white-space: nowrap;
}
.pinout-left  .pinout-name { text-align: right; padding-right: 4px; }
.pinout-right .pinout-name { text-align: left;  padding-left: 4px; }

.pinout-leg {
  width: var(--pin-leg);
  height: 4px;
  background: #9ca3af;
}

.pinout-num {
  width: var(--pin-num);
  text-align: center;
  color: #f9fafb;
  font-weight: 600;
}
