/* The Settings page, in the mock-up's design. Colours only from tokens.css; full outlines, small radii, no gradients. */
.set { max-width: 860px; padding: 22px 24px 28px; display: grid; gap: 16px; align-content: start; }
.set-head h1 { font-size: var(--fs-title); font-weight: 700; line-height: 1.15; color: var(--text); }
.set-head p { color: var(--mute); font-size: var(--fs-body); margin-top: 4px; }
.set-card { display: grid; gap: 0; min-width: 0; }
.set-h { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: .09em; color: var(--dim); font-weight: 600; }
.set-where { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: var(--fs-caption); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 1px 7px; color: var(--mute); white-space: nowrap; }

/* The wide header row already says Settings; the page's own heading is for narrow and docked windows. */
@media (min-width: 641px) { .app:not([data-mode="docked"]) .set-head { display: none; } }

/* rows: label and help on the left, the control on the right */
.set-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-card .set-row:first-of-type { border-top: 0; padding-top: 6px; }
.set-row-wide { flex-wrap: wrap; }
.set-row-wide .set-control { flex-basis: 100%; }
.set-lb { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.set-lb b, .set-lb label { font-weight: 600; font-size: var(--fs-body); color: var(--text); }
.set-lb span { font-size: var(--fs-caption); color: var(--mute); }
.set-control { flex: none; display: grid; gap: 6px; justify-items: end; min-width: 0; }
.set-row-wide .set-control { justify-items: start; }
.set-control select, .set-input { height: 34px; padding: 0 10px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel); color: var(--text); font: inherit; font-size: var(--fs-body); }
.set-control select { min-width: 200px; }
.set-control select:disabled { color: var(--dim); }
.set-input { width: 240px; }
.set-input::placeholder { color: var(--dim); }
.set-control select:focus-visible, .set-input:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; border-color: var(--acc); }
.set-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.set-hint { color: var(--mute); font-size: var(--fs-caption); margin: 0; }
.set .form-error { color: var(--bad); font-size: var(--fs-caption); margin: 0; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 4px; }
.set-foot { padding: 0 2px; }

/* segmented choice */
.seg-set { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 2px; }
.seg-set button { background: none; border: 0; border-radius: var(--r-sm); padding: 5px 14px; color: var(--mute); font: inherit; font-size: var(--fs-body); font-weight: 550; cursor: pointer; }
.seg-set button:hover { color: var(--text); }
.seg-set button.is-on { background: var(--panel3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.seg-set button:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }

/* accent swatches */
.sw-grid { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; outline: 2px solid transparent; outline-offset: 2px; }
.sw.is-on { outline-color: var(--text); }
.sw:focus-visible { outline-color: var(--acc); }
.sw-logo { width: auto; height: 32px; border-radius: var(--r); padding: 0 10px 0 6px; display: inline-flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line2); color: var(--text); font: inherit; font-size: var(--fs-caption); }
.sw-logo img { width: 18px; height: 18px; display: block; }
.sw-pick { position: relative; display: grid; place-items: center; border: 1px dashed var(--line2); background: none; color: var(--mute); overflow: hidden; }
.sw-pick.is-on { background: var(--c); border-style: solid; }
.sw-pick.is-on .sw-plus { visibility: hidden; }
.sw-plus { font-size: var(--fs-lead); line-height: 1; }
.sw-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.sw-hex { margin-left: 6px; font-family: var(--mono); font-size: var(--fs-caption); color: var(--mute); }

/* the accent in use, so a choice can be judged at once */
.set-preview { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 2px 0 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.pv-ring { width: 48px; height: 48px; border-radius: 50%; border: 5px solid var(--track); border-top-color: var(--acc); border-right-color: var(--acc); transform: rotate(45deg); }
.pv-ring i { display: none; }
.set .btn-primary, .pv-btn { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.pv-btn { pointer-events: none; }
.pv-sel { font-size: var(--fs-caption); padding: 3px 9px; border: 1px solid var(--acc); border-radius: var(--r-sm); color: var(--text); }
.pv-bar { display: block; width: 160px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.pv-bar::before { content: ""; display: block; width: 64%; height: 100%; background: var(--acc); }
.pv-date { color: var(--acc); font-weight: 600; font-size: var(--fs-body); }

/* switch */
.switch { position: relative; flex: none; width: 42px; height: 24px; padding: 0; border: 0; border-radius: 12px; background: var(--line2); cursor: pointer; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--on-fill); transition: transform .15s; }
.switch.is-on { background: var(--acc); }
.switch.is-on i { background: var(--on-acc); transform: translateX(18px); }
.switch:disabled { opacity: .55; cursor: default; }
.switch:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.set .btn { height: 34px; padding: 0 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line2); color: var(--text); font-size: var(--fs-body); }
.set .btn:hover { border-color: var(--mute); }
.set .btn-primary { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.set .btn-link { border-color: transparent; background: none; color: var(--acc); }
.btn-danger-outline { color: var(--bad); }
.set .btn-danger-outline { border-color: var(--bad); color: var(--bad); }

/* About: the facts shell/about.js writes into #about-body */
.about { display: grid; gap: 10px; color: var(--text); padding-top: 6px; }
.about-app { font-size: var(--fs-body); font-weight: 700; margin: 0; }
.about-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; font-size: var(--fs-body); }
.about-facts dt { color: var(--mute); }
.about-facts dd { margin: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: var(--fs-caption); }
.about-copy { justify-self: start; height: 32px; padding: 0 12px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel); color: var(--text); font: inherit; font-size: var(--fs-body); font-weight: 600; cursor: pointer; }

/* narrow window and phone width: controls go under their labels */
@media (max-width: 640px) {
  .set { padding: 16px 12px 24px; }
  .set-row { flex-wrap: wrap; gap: 8px; }
  .set-control { flex-basis: 100%; justify-items: start; }
  .set-input, .set-control select { width: 100%; min-width: 0; }
}
.app[data-mode="docked"] .set { padding: 14px 12px 20px; }
.app[data-mode="docked"] .set-row { flex-wrap: wrap; gap: 8px; }
.app[data-mode="docked"] .set-control { flex-basis: 100%; justify-items: start; }
