/* Settings page: fills the space under the top bar. A menu of topics on the left, one topic shown
   at a time on the right. layout.js opens and closes it and draws the menu from the sections. */
.settings-page { position: fixed; top: 52px; /* responsive.css keeps this at the top bar's real height */ left: 0; right: 0; bottom: 0; z-index: 1050; overflow-y: auto; background: var(--page); }
.settings-head { display: flex; align-items: center; gap: 14px; max-width: 980px; margin: 0 auto; padding: 20px 20px 12px; }
.settings-head .note { margin-left: auto; }
.settings-head button svg { fill: none; }
.settings-head h2 { font-size: 19px; font-weight: 700; text-transform: none; letter-spacing: -.01em; color: var(--ink); }
.settings-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 20px; align-items: start; max-width: 980px; margin: 0 auto; padding: 0 20px 32px; }
.settings-body { min-width: 0; }
.set-side { position: sticky; top: 12px; min-width: 0; }
.set-custom { margin: 14px 10px 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.set-custom a { display: block; margin-top: 4px; font-weight: 600; color: var(--accent); }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.set-nav h4 { margin: 14px 10px 4px; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.set-nav h4:first-child { margin-top: 4px; }
.set-nav button { width: 100%; height: auto; justify-content: flex-start; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: none; box-shadow: none; text-align: left;
  font: inherit; font-size: 13.5px; font-weight: 550; color: var(--ink-2); cursor: pointer; }
.set-nav button:hover { background: var(--surface-2); color: var(--ink); }
.set-nav button[aria-current=page] { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--ink); font-weight: 650; }
.set-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* one topic at a time: the open section is the page, its heading the page's title */
.paged .set-sec:not(.open) { display: none; }
.paged .set-sec { margin: 0; padding: 20px 22px 24px; }
.paged .set-sec > h3 { font-size: 16px; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0 0 8px; }
.paged .set-sec > h3 .note { font-weight: 400; }
@media (max-width: 760px) {   /* phone: the menu becomes a row of topics to swipe through, above the page */
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0 10px 24px; }
  .set-side { position: static; display: contents; }
  .set-custom { order: 3; margin: 4px 4px 0; }
  .set-nav { flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .set-nav h4, .settings-head .note { display: none; }
  .set-nav button { width: auto; white-space: nowrap; }
  .paged .set-sec { padding: 16px 14px 20px; }
}
/* Settings opens from the account menu (account.js); the old gear button stays in the page only as its switch */
#btnSettings { display: none; }
.set-sec { padding: 16px 18px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  break-inside: avoid; margin: 0 0 14px; }
.set-sec > h3 { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 2px; }
.set-sec > .check { margin-top: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-weight: 550; color: var(--ink-2); font-size: 12.5px; }
.set-sec button.block { margin-top: 14px; }
/* Sections fold (layout.js), in Settings, Block info and Data entry: a list of headings, one open at a time */
.folds .set-sec { margin: 0 0 8px; padding: 0 18px; }
.folds .set-sec > h3 { display: flex; align-items: center; gap: 10px; margin: 0; padding: 15px 0; cursor: pointer;
  font-size: 14px; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--ink); border-radius: var(--radius-sm); }
.folds .set-sec > h3 .note { font-weight: 400; }
.folds .set-sec > h3::after { content: ""; width: 7px; height: 7px; margin: 0 4px 0 auto; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s; }
.folds .set-sec.open > h3::after { transform: rotate(225deg); }
.folds .set-sec > h3:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.folds .set-sec:not(.open) > :not(h3) { display: none !important; }
.folds .set-sec.open { padding-bottom: 18px; }
.terms-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; align-items: center; margin-top: 10px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.terms-grid [hidden] { display: none; }
#termsSave { margin-top: 12px; }
.settings-layout .settings-body { max-width: none; margin: 0; padding: 0; }
/* Your data: what is here, what leaves the app, and deleting it */
.data-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-top: 12px; min-height: 68px; }
.data-stats > div { display: grid; gap: 1px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.data-stats b { font-size: 20px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.data-stats span { font-size: 12px; color: var(--ink-2); }
.data-stats i { font-style: normal; font-size: 11px; color: var(--muted); }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.data-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.data-table th { text-align: left; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 12px 6px 0; }
.data-table td { vertical-align: top; padding: 8px 12px 8px 0; border-top: 1px solid var(--line); }
.data-table td:first-child { color: var(--ink); font-weight: 600; width: 34%; }
.data-table td span { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.data-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.data-danger { margin-top: 26px; padding: 2px 14px 14px; border: 1px solid color-mix(in srgb, var(--critical) 45%, var(--line)); border-radius: 8px; }
.data-danger h4 { color: var(--critical); }
button.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, var(--line)); }
button.danger:hover:not(:disabled) { background: var(--critical); border-color: var(--critical); color: #fff; }
#pData h4 { margin-top: 20px; }
a.btn { text-decoration: none; }
a.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--page); }
a.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.data-choice select { width: auto; }
