/* ═══════════════════════════════════════════════
   WORKSPACE — ⚙️ Settings panel
   Layout defaults · PIN-protected shortcuts (js/settings*.js)
   ═══════════════════════════════════════════════ */

/* ─── shell ─── */
#wsSettings {
  position: fixed; inset: 0; z-index: 9000; display: none;
  align-items: flex-start; justify-content: center; padding: 8vh 16px 16px;
  background: rgba(0, 0, 0, 0.28);
}
#wsSettings.open { display: flex; }
html.bp-decoy #wsSettings, html.door-quiet #wsSettings { display: none; }
.ws-dialog {
  width: 100%; max-width: 720px; max-height: 84vh; display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.ws-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ws-head h2 { flex: 1; margin: 0; font-size: var(--fs-h3); }
.ws-close { background: none; border: 0; box-shadow: none; font-size: var(--fs-h3); color: var(--text-soft); padding: 0 6px; }
.ws-close:hover { color: var(--pink); }

/* ─── tabs ─── */
.ws-tabs { display: flex; gap: 4px; padding: 8px 16px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.ws-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; box-shadow: none;
  padding: 8px 12px; font-weight: 700; color: var(--text-soft); white-space: nowrap;
}
.ws-tab.active { color: var(--pink); border-bottom-color: var(--pink); }
.ws-body { padding: 14px 16px 18px; overflow: auto; }
.ws-hint { font-size: var(--fs-body); color: var(--text-soft); margin: 0 0 12px; }

/* ─── layout rows ─── */
.ws-row {
  display: grid; grid-template-columns: minmax(14ch, 18ch) minmax(0, 1fr); align-items: center;
  gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.ws-row:last-child { border-bottom: 0; }
.ws-row .ws-label { font-weight: 700; }
.ws-row .ws-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ws-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ws-seg button { background: var(--surface); border: 0; box-shadow: none; padding: 5px 12px; font-weight: 700; color: var(--text-soft); }
.ws-seg button + button { border-left: 1px solid var(--border); }
.ws-seg button.on { background: var(--pink-soft); color: var(--pink); }
.ws-select, .ws-input {
  font: inherit; font-size: var(--fs-body); color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 8px; min-width: 0;
}
.ws-note { font-size: var(--fs-body); color: var(--text-soft); }
.ws-saved { font-size: var(--fs-body); color: var(--green); min-height: 1.5em; margin-top: 8px; }

/* ─── PIN gate ─── */
.ws-pin { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ws-pin .ws-input { width: 14ch; }
.ws-btn {
  border: 1px solid var(--pink); color: var(--pink); background: var(--surface);
  border-radius: var(--radius-sm); padding: 5px 14px; font-weight: 700; box-shadow: none;
}
.ws-btn:hover { background: var(--pink); color: #fff; }
.ws-btn.quiet { border-color: var(--border); color: var(--text-soft); }
.ws-btn.quiet:hover { background: var(--surface-alt); color: var(--text); }
.ws-error { color: #c62828; font-size: var(--fs-body); min-height: 1.5em; margin-top: 8px; }

/* ─── shortcut palette ─── */
.ws-search { width: 100%; margin-bottom: 10px; }
.ws-area { font-size: var(--fs-h4); font-weight: 800; margin: 14px 0 4px; }
.ws-key-row {
  display: grid; grid-template-columns: minmax(14ch, 1fr) minmax(0, auto) minmax(0, auto);
  align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border);
}
.ws-key-row > * { min-width: 0; }
.ws-keys { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.ws-kbd {
  font-size: var(--fs-body); padding: 1px 7px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 6px; background: var(--surface-alt); white-space: nowrap;
}
.ws-kbd.changed { border-color: var(--pink); }
.ws-key-actions { display: flex; gap: 6px; }
.ws-key-row.capturing { background: var(--pink-soft); }
.ws-lock { color: var(--text-soft); font-size: var(--fs-body); white-space: nowrap; }
@media (max-width: 640px) {
  .ws-row, .ws-key-row { grid-template-columns: 1fr; gap: 6px; }
  .ws-keys { justify-content: flex-start; }
}
