/* Settings. Only DESIGN.md's tokens, as defined in tach.css. */

/* A side list of sections beside the section that is open. */
.settings-shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: var(--s4); align-items: start; margin-top: var(--s4); }
.settings-shell > main:only-child { grid-column: 1 / -1; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.settings-nav a { height: 34px; padding: 0 12px; display: flex; align-items: center; border: 1px solid transparent; border-radius: var(--r-ctrl); color: var(--text-muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.settings-nav a:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.settings-nav a[aria-current] { color: var(--text); font-weight: 600; background: var(--bg-elevated); border-color: var(--border-strong); }
@media (max-width: 860px) {
  .settings-shell { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
}

main.settings { min-width: 0; }
main.settings > p { max-width: 44rem; margin: 0 0 var(--s3); color: var(--text-muted); }
main.settings > section:first-child, main.settings > p:first-child + section { margin-top: 0; }
main.settings .notice { margin: 0 0 var(--s4); }

.quiet { color: var(--text-dim); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li + li { margin-top: var(--s1); }
main.settings ul:not(.plain) { margin: 0 0 var(--s4); padding-left: var(--s6); max-width: 40rem; }

/* Tables of People, Grants, keys and the audit record. */
.ledger td { padding-right: var(--s3); }
.ledger.directory td, .ledger.keys td, .ledger.audit td, .ledger.review td, .ledger.access td { font-size: 0.8125rem; line-height: 1.45; }
.ledger.directory td.desc:first-child, .ledger.access td.desc, .ledger.grants td.desc { font-size: 0.9375rem; }
.ledger td.act { text-align: right; white-space: nowrap; width: 1%; padding-right: 0; padding-left: var(--s4); }
.ledger td.when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger tr.cont td { border-top: 0; padding-top: 0; }
@media (max-width: 40rem) {
  .ledger.directory th:nth-child(4), .ledger.directory td:nth-child(4),
  .ledger.keys th:nth-child(3), .ledger.keys td:nth-child(3), .ledger.keys th:nth-child(4), .ledger.keys td:nth-child(4) { display: none; }
}

/* Forms: a label over each input, one column. */
form.fields { max-width: 32rem; }
.field { display: flex; flex-direction: column; gap: var(--s1); margin: 0 0 var(--s4); padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend, .field-label { color: var(--text-muted); font-size: 0.8125rem; line-height: 1.45; padding: 0; }
.field > input, .field > select { width: 100%; }
.field.pair { flex-direction: row; flex-wrap: wrap; gap: var(--s2); }
.field.pair > legend { width: 100%; margin-bottom: var(--s1); }
.field.pair > input { flex: 1 1 12rem; }
label.choice { display: flex; gap: var(--s2); align-items: baseline; color: var(--text); font-size: 0.9375rem; }
input[type=file] {
  padding: 5px 8px; background: var(--bg-canvas); color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--r-ctrl); font: inherit; font-size: 0.8125rem;
}
input[type=file]::file-selector-button {
  margin-right: var(--s2); padding: 3px 10px; background: var(--bg-surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-ctrl); font: 600 0.75rem var(--font-sans); cursor: pointer;
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: var(--s4) 0 0; }
form.inline { display: inline; margin: 0; }

/* Something shown only once: a link or a key, ready to select and copy. */
input.once {
  display: block; width: 100%; margin-top: var(--s1); padding: 8px 10px;
  background: var(--bg-surface); color: var(--text); border: 1px solid var(--text); border-radius: var(--r-ctrl);
  font: 400 0.9375rem/1.5 var(--font-mono);
}

@media print {
  .settings-nav, form.fields, form.inline, .actions { display: none; }
}
