/* Family settings card and switch. Promoted from the scui settings card and
   Timeliner/Mini toggles; usable by host rows and shared settings sections. */
.settings-card, .scui-sec--settings:not(.scui-sec--host) {
  --settings-text: var(--color-warm-text);
  --settings-sub: var(--color-warm-text-dim);
  --settings-surface: var(--color-bg-panel);
  color: var(--settings-text);
  font-family: var(--font-settings);
  border: none; border-radius: 0; overflow: visible; margin-block: 10px;
}
/* Settings stay dark in today's hosts. Explicit light surfaces opt into the
   same component, without changing the meaning of the parchment text token. */
[data-theme="light"] .settings-card, .settings-card[data-theme="light"],
[data-theme="light"] .scui-sec--settings:not(.scui-sec--host) {
  --settings-text: var(--color-text-dark);
  --settings-sub: var(--color-text-dark-dim);
  --settings-surface: var(--color-parchment);
}
.settings-card > .settings-card__head,
.scui-sec--settings:not(.scui-sec--host) > .scui-sec__head {
  display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box;
  font: 12px var(--font-settings); letter-spacing: .2em; text-transform: uppercase;
  color: var(--color-text-accent); background: var(--settings-surface);
  border: 1px solid var(--color-border-panel); border-radius: 10px;
  padding: 12px 14px; margin: 0 0 10px; cursor: pointer; list-style: none;
}
.settings-card__head::-webkit-details-marker { display: none; }
.settings-card__head .scui-sec__heading,
.scui-sec--settings:not(.scui-sec--host) > .scui-sec__head .scui-sec__heading { flex: 1; font-size: 12px; font-weight: 400; }
/* The group triangle: 2em of the 12px head = 24px (was inherited, 12px; Casey 2026-11-01). line-height .5 keeps its line box at the
   old 12px, so the head's row height does not grow; the head's align-items:center centres the glyph. */
.settings-card__head .scui-sec__chev,
.scui-sec--settings:not(.scui-sec--host) > .scui-sec__head .scui-sec__chev { color: var(--settings-sub); font-size: 2em; line-height: .5; }
.settings-card[open] > .settings-card__head,
.scui-sec--settings:not(.scui-sec--host) > .scui-sec__head[aria-expanded="true"] {
  border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0;
}
.settings-card > .settings-card__body,
.scui-sec--settings:not(.scui-sec--host) > .scui-sec__body {
  border: 1px solid var(--color-border-panel); border-top: none;
  border-radius: 0 0 10px 10px; padding: 6px 14px 10px; margin-bottom: 10px;
  background: var(--settings-surface); color: var(--settings-text);
}
.settings-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-border-panel); }
.settings-row > div:first-child { flex: 1; min-width: 0; }
.settings-row__title { font: 16px var(--font-info); color: var(--settings-text); }
.settings-row__sub { font: 13px var(--font-settings); color: var(--settings-sub); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.settings-actions { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.settings-action { min-height: 40px; min-width: 40px; padding: 8px 12px; border: 1px solid var(--color-border-panel); border-radius: 8px; font: inherit; color: var(--settings-text); background: var(--settings-surface); cursor: pointer; }
.settings-action:disabled { opacity: .4; cursor: default; }
/* Every "Copy …" diagnostics button is green — one class, one token (Casey, 2026-10-06). */
.settings-action--copy { background: var(--color-green); border-color: var(--color-green); color: var(--color-text-on-accent); }
.settings-toggle, .tog-sw, .tl-tog-sw { position: relative; display: inline-flex; align-items: center; width: 50px; height: 40px; flex: 0 0 auto; cursor: pointer; }
.settings-toggle input, .tog-sw input, .tl-tog-sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.settings-toggle .tog-track, .tog-sw .tog-track, .tl-tog-sw .tl-tog-track { position: absolute; inset: 6px 0; width: 50px; height: 28px; border-radius: 14px; background: var(--color-border-panel); pointer-events: none; }
.settings-toggle .tog-thumb, .tog-sw .tog-thumb, .tl-tog-sw .tl-tog-thumb { position: absolute; top: 9px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--color-text-on-accent); transition: transform .2s; pointer-events: none; }
.settings-toggle input:checked ~ .tog-track, .tog-sw input:checked ~ .tog-track, .tl-tog-sw input:checked ~ .tl-tog-track { background: var(--color-green); }
.settings-toggle input:checked ~ .tog-thumb, .tog-sw input:checked ~ .tog-thumb, .tl-tog-sw input:checked ~ .tl-tog-thumb { transform: translateX(22px); }
.settings-toggle input:focus-visible ~ .tog-track, .tog-sw input:focus-visible ~ .tog-track, .tl-tog-sw input:focus-visible ~ .tl-tog-track { outline: 2px solid var(--color-text-accent); outline-offset: 3px; }

/* Settings rows, steppers and action buttons (sf-u5a, style-frontier C4): Jam Buddy's look, once, for every app that links this file
   (Timeliner, Mini, Jam Buddy, Ear Tuner, Microbreaker, Tune Hub). Every section is a collapsible group (js/settings-card.js). The fills are
   `background-color`, never the `background` shorthand: Jam Buddy layers a dome `background-image` on these buttons and a shorthand
   would wipe it. settings.css loads after an app's own sheet in six apps, so an app rule that restyles a border here must out-rank it;
   Jam Buddy links it before jam.css, so there its own rule wins by order. */
.s-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; gap: 12px; border-bottom: 1px solid var(--color-hairline);
}
.s-label { font-size: 15px; font-weight: 600; color: var(--color-warm-text); }
.s-sub { font-size: 12px; color: var(--color-warm-text-faint); margin-top: 2px; }
.s-stepper { display: flex; align-items: center; gap: 10px; flex: none; }
.step-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background-color: var(--color-bg-surface); border: 1.4px solid var(--color-border-panel);
  color: var(--color-warm-text); font-size: 19px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding-bottom: 2px;
}
.step-btn:active { background-color: var(--color-bg-panel-elevated); }
.step-btn:disabled { opacity: 0.3; cursor: default; }
.s-val { font-size: 14px; font-weight: 700; min-width: 34px; text-align: center; color: var(--color-warm-text); }
.log-action-btn {
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 0 14px; height: 34px;
  border-radius: 8px;
  background-color: var(--color-bg-surface); border: 1.4px solid var(--color-border-panel);
  color: var(--color-warm-text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.log-action-btn:active { background-color: var(--color-bg-panel-elevated); }
.log-action-btn.danger { background-color: rgba(192,57,43,0.18); color: var(--color-danger-text); border-color: var(--color-danger); }

/* .selectable: the opt-in for DIAGNOSTIC text (Casey 2026-08-05: anything he
   might need to copy/paste back into a debugging session: engine notes, probe
   reasons, error details, sync history). Put it on every diagnostic element you
   add. It beats each shell's user-select: none, including Mini's `#app *` (an
   id selector): `:is(#app, body)` carries the id's weight and `body` matches in
   every host, so the rule needs no !important. The `*` half covers descendants,
   which an element-level `none` would otherwise keep. */
:is(#app, body) :is(.selectable, .selectable *) {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
