/* Workspace settings view (item #3783, views/settings.js). Per-view
   stylesheet, the routed-view convention: loaded from index.html after
   chat.css so it inherits the entry's token palette. Everything here is
   .mm-set*; the tile is chat.css's .mm-ws-tile (the ONE tile rule — the
   page draws no second one), the buttons are the portal's .btn (app.css,
   already linked), and the segmented cells re-base the portal's
   .st-seg / .ns-cell metrics (wp-settings.css, which this entry does not
   load) onto the artboard's card row. Tokens only — no colour here is not
   one of the entry's own, so both of chat.css's theme blocks (the dark
   :root and :root[data-theme="light"]) cover this sheet. */

.mm-set {
  box-sizing: border-box; height: 100%; overflow-y: auto;
  padding: 32px 36px 48px;
}

/* -- the header ------------------------------------------------------------- */
.mm-set-head {
  display: flex; align-items: center; gap: 12px;
  max-width: 760px; margin: 0 auto 12px;
}
.mm-set-title { flex: 1; min-width: 0; font-size: 19px; font-weight: 700; margin: 0; }

/* -- the stacked sections (the portal's settings page shape) ---------------- */
.mm-set-main { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.mm-set-sec {
  padding: 16px 18px 18px; border-radius: 10px;
  background: var(--mm-card); border: 1px solid var(--border-soft);
}
.mm-set-sec-title { font-size: 13.5px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.mm-set-hint { font-size: 11.5px; line-height: 1.4; color: var(--text-dim); }
.mm-set-sec-hint { margin-bottom: 12px; }
.mm-set-body { display: flex; flex-direction: column; gap: 10px; }
.mm-set-state { color: var(--text-dim); font-size: 13px; padding: 6px 0; }
.mm-set-error { color: var(--danger); }
.mm-set-note {
  margin-top: 4px; padding: 10px 12px; font-size: 12px; line-height: 1.4; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: 8px;
}

/* -- identity: the read-only tile beside the two fields --------------------- */
.mm-set-identity { display: flex; align-items: flex-start; gap: 16px; }
.mm-set-tile-col { flex: none; padding-top: 22px; }
.mm-set-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mm-set-label { font-size: 12px; font-weight: 600; color: var(--text); margin-top: 4px; }
.mm-set-field {
  box-sizing: border-box; width: 100%; font: inherit; font-size: 13px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 7px;
  padding: 7px 10px;
}
.mm-set-field:focus { outline: none; border-color: var(--focus); }
.mm-set-field[disabled] { color: var(--text-dim); cursor: default; }
.mm-set-desc { resize: vertical; min-height: 72px; line-height: 1.4; }
.mm-set-tile-note { margin-top: 2px; }
/* The swatches (#3800): a fieldset of native radios in labels; each face is
   chat.css's .mm-ws-tile (the ONE tile rule), so the two theme tokens paint
   it. Tokens only here: the ring is the accent, the focus ring --focus. */
.mm-set-swatches { border: 0; margin: 4px 0 0; padding: 0; min-width: 0; }
.mm-set-swatches legend { padding: 0; margin-bottom: 6px; }
.mm-set-swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-set-swatch { position: relative; display: inline-flex; flex: none; padding: 3px; border-radius: 8px; cursor: pointer; }
.mm-set-swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.mm-set-swatch input:checked + .mm-set-swatch-face {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent-fill);
}
.mm-set-swatch input:focus-visible + .mm-set-swatch-face {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--focus);
}
.mm-set-swatch input:disabled { cursor: default; }
.mm-set-swatch input:disabled + .mm-set-swatch-face { opacity: .6; }
/* The changed-elsewhere line (#3847): a hint, hidden until a row lands mid-edit. */
.mm-set-elsewhere { margin-top: 2px; }
.mm-set-actions { display: flex; justify-content: flex-end; }
.mm-set-save { font-size: 12px; font-weight: 650; padding: 5px 14px; }

/* -- notifications: state line, two tier rows × three cells ----------------- */
.mm-set-nstate { display: flex; align-items: center; gap: 10px; }
.mm-set-badge {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim);
}
.mm-set-badge.on { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.mm-set-clear { font-size: 11.5px; padding: 3px 10px; }
.mm-set-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
}
.mm-set-row-title { font-size: 13px; font-weight: 600; color: var(--text); }
.mm-set-row-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.mm-set-cells { display: flex; flex-wrap: wrap; gap: 14px; }
.mm-set-cell { display: flex; flex-direction: column; gap: 4px; }
.mm-set-cell-label { font-size: 11px; color: var(--muted); }
.mm-set-cell.dead .mm-set-cell-label { opacity: .55; }
.mm-set-cell-hint { font-size: 10.5px; color: var(--text-dim); font-style: italic; }
.mm-set-seg {
  display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden;
  background: var(--mm-card);
}
.mm-set-segbtn {
  font: inherit; font-size: 11.5px; padding: 4px 10px; cursor: pointer;
  color: var(--text-dim); background: none; border: none; border-right: 1px solid var(--border);
}
.mm-set-segbtn:last-child { border-right: none; }
.mm-set-segbtn:hover:not([disabled]) { color: var(--text); }
.mm-set-segbtn.active { color: var(--accent-ink); background: var(--accent-soft); }
.mm-set-segbtn[disabled] { cursor: default; opacity: .55; }

/* -- on the web: one row per destination that exists ------------------------- */
.mm-set-link {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 9px 12px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--text);
}
.mm-set-link:hover { border-color: var(--accent); }
.mm-set-link-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mm-set-link-label { font-size: 13px; font-weight: 600; }
.mm-set-link-sub { font-size: 11.5px; color: var(--text-dim); }
.mm-set-link-arrow { flex: none; color: var(--text-dim); font-size: 13px; }
