/* ══ Dialogs, design pass 2026-10-12: Data & logins (backend-panel.js) and Colours (colours.js) ══
   Calm and flat: one lead sentence, plain sections, lime only on the one main action, 1px lines. */

/* ── shared ── */
.be-modal, .cl-modal { width: min(560px, 100%); border-radius: var(--r-lg, 16px); box-shadow: 0 24px 64px -24px rgba(0,0,0,.8); }
.be-modal .mh, .cl-modal .mh { padding: var(--s5) var(--s5) var(--s1); }
.be-modal .mh h3, .cl-modal .mh h3 { font-family: var(--sans); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.be-modal .mb, .cl-modal .mb { padding: var(--s2) var(--s5) var(--s5); gap: var(--s4); }

/* ── Data & logins ── */
.be.bp { display: flex; flex-direction: column; gap: var(--s4); }
.bp-lead, .cl-lead { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.bp-acts { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.bp-acts .btn { height: 38px; }
.bp-sm { height: 30px !important; font-size: 12.5px; padding: 0 10px; }
.bp-sec { display: flex; flex-direction: column; gap: var(--s2); }
.bp-h { margin: 0; font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.bp-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.bp-list > * + * { border-top: 1px solid var(--line); }
.bp-item { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); width: 100%; min-height: 52px; padding: var(--s2) var(--s4); background: transparent; border: 0; color: inherit; text-align: left; font: inherit; }
.bp-sec > .bp-item { border: 1px solid var(--line); border-radius: var(--r-md); }
.bp-pick { cursor: pointer; }
.bp-pick:hover:not(:disabled) { background: var(--panel-2); }
.bp-pick:disabled { cursor: progress; }
.bp-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bp-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-main small { color: var(--muted); font-size: 12.5px; }
.bp-item .pill { flex: none; font-weight: 600; letter-spacing: 0; }
.bp-prog { flex-basis: 100%; display: flex; align-items: center; gap: var(--s2); font-size: 12.5px; color: var(--muted); }
.bp-table .be-rows { border-top: 1px solid var(--line); padding: var(--s2) var(--s4) var(--s3); }
.bp-empty { margin: 0; padding: var(--s3) var(--s4); color: var(--muted); font-size: 13px; }
.bp-sec > .bp-empty { padding: 0; }
.bp-fold { border-top: 1px solid var(--line); padding-top: var(--s3); }
.bp-fold > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.bp-fold > summary:hover { color: var(--text); }
.bp-fold[open] > summary { margin-bottom: var(--s3); }
.bp-fold .hint { margin: 0 0 var(--s2); font-size: 12.5px; color: var(--muted); }
.bp-new { display: block; }
.bp-new[open] { display: flex; flex-direction: column; gap: var(--s3); }
.bp-new[open] > summary { margin-bottom: 0; }
.bp-new .field input, .bp-new .field select { height: 38px; border-radius: var(--r-sm); }
.bp-new .field input:focus, .bp-new .field select:focus { box-shadow: none; }
.bp-inline { display: flex; gap: var(--s2); }
.bp-inline input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg); color: inherit; }
.bp-inline .btn { height: 38px; }
.bp-foot { display: flex; justify-content: flex-start; }
.be.bp .be-check { border: 1px solid var(--line); background: transparent; border-radius: var(--r-md); padding: var(--s3) var(--s4); font-size: 13px; }
.be.bp .be-check li span { background: none; width: auto; height: auto; color: var(--ok); }
.be.bp .be-check li.fail span { background: none; color: var(--err); }
.be.bp .be-log { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); }
.be.bp .be-loading { padding: var(--s3) var(--s4); }
.be.bp .be-keys { padding-top: 0; border-top: 0; gap: var(--s2); }
.be.bp .sec-row { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); background: transparent; }
.be.bp .be-grid td { border-bottom-color: var(--line); }

/* ── Colours ── */
.cl-modal { width: min(520px, 100%); }
.cl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.cl-tile { display: flex; align-items: center; gap: var(--s2); min-width: 0; height: 44px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.cl-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-tile:hover { border-color: var(--line-2); background: var(--panel-2); }
.cl-tile[aria-pressed="true"] { border-color: var(--text); background: var(--panel-2); }
.cl-dot { display: inline-block; width: 20px; height: 20px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.cl-change { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); }
.cl-change[hidden] { display: none; }
.cl-change-t { margin: 0; font-size: 13px; color: var(--muted); }
.cl-change-t b { color: var(--text); font-weight: 600; }
.cl-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); gap: 6px; }
.cl-sw { height: 28px; border-radius: var(--r-sm); border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.cl-sw[aria-checked="true"] { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.cl-change-f { display: flex; justify-content: flex-end; }
.cl-change-f .btn { height: 36px; }
.cl-all { border-top: 1px solid var(--line); padding-top: var(--s3); }
.cl-all > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.cl-all > summary:hover { color: var(--text); }
.cl-all[open] > summary { margin-bottom: var(--s3); }
.cl-hexes { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.cl-hex { display: flex; align-items: center; gap: var(--s3); padding: 6px var(--s3); }
.cl-hex + .cl-hex { border-top: 1px solid var(--line); }
.cl-hex input[type=color] { width: 26px; height: 26px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.cl-hex input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.cl-hex input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.cl-hex input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
.cl-hex code { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.cl-hex .cl-n { flex: 1; color: var(--muted); font-size: 12.5px; }
.cl-hex .btn { height: 30px; font-size: 12.5px; padding: 0 10px; }

@media (max-width: 520px) {
  .be-modal .mh, .cl-modal .mh { padding: var(--s4) var(--s4) var(--s1); }
  .be-modal .mb, .cl-modal .mb { padding: var(--s2) var(--s4) var(--s4); }
  .cl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bp-acts .btn { flex: 1; justify-content: center; }
}
.bp-item a.btn { text-decoration: none; }
.key-state { font-size: 12px; color: var(--muted); }
.key-state.on { color: var(--ok); }
.key-state.warn { color: var(--warn); }
