/* Settings sheet on the web (10/13, operator: "It's so wide"). Scoped to .settings-sheet
   (views/settings.js adds it), so no shared sheet, card, button or segment rule changes.
   Phones: one stacked column, as before. 600px of sheet and up: words left, control right.
   768px windows and up: a centered panel capped at a 680px reading column (main's width). */

.settings-sheet { container-type: inline-size; }
.settings-sheet > h2 { font-size: 1.35rem; margin: 2px 0 2px; }

/* Section headings: small caps line, same look as .section-title elsewhere. */
.settings-sheet .set-h {
  margin: 26px 0 0; padding-bottom: 2px; font-size: .78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-soft);
}

/* Cards: flat list rows with a divider between rows of one group, none after the last. */
.settings-sheet .set-card { padding: 14px 0; }
.settings-sheet .set-group > .set-card:last-child,
.settings-sheet .set-h + .set-card { border-bottom: 0; }
.settings-sheet .set-group > .set-card:last-child { padding-bottom: 6px; }
/* 11/05 (operator: "the distance under the headings is a little too much"): the first card under a heading starts
   --head-gap under the heading's words (it was 16px, and 26 to 52px beside a wide row's centered control). The 2px is the
   heading's own padding-bottom; the title's -10px lift (below) cancels the rest of its 44px row. */
.settings-sheet .set-h + .set-card, .settings-sheet .set-h + .set-group > .set-card:first-child { padding-top: calc(var(--head-gap) - 2px); }
.settings-sheet .set-h-wrap + .set-danger { margin-top: var(--head-gap); }
.settings-sheet .set-desc { margin: 2px 0 10px; }
.settings-sheet .set-after { margin: 10px 0 0; }
.settings-sheet .set-chips { margin-top: 8px; flex-wrap: wrap; overflow: visible; }
.settings-sheet .set-backup { margin: 6px 0 0; color: var(--danger); }

/* Row with a control: stacked on phones (control full width under the words). */
.settings-sheet .set-row .set-text { min-width: 0; }
.settings-sheet .set-row .set-desc { margin-bottom: 0; }
.settings-sheet .set-ctl { display: flex; width: 100%; margin-top: 12px; }
.settings-sheet .set-ctl-stack { flex-direction: column; gap: 8px; }
.settings-sheet .set-send { width: 100%; }
.settings-sheet .set-email { display: block; font-weight: 600; overflow-wrap: anywhere; }
.settings-sheet .tag-input { min-width: 200px; } /* wraps under the chips instead of clipping its placeholder */
/* Explanations fold under each card's (i) (10/22, js/about.js); the title row is the card's first line. */
.settings-sheet .set-card > .about-head:first-child { margin-top: -10px; }
.settings-sheet .set-row .about-head { margin-top: -10px; }
.settings-sheet .set-row .about-text { margin-bottom: 0; }
.settings-sheet .set-card .about-sw { margin: -10px 0; }
.settings-sheet .set-card .about-sw + .about-text { margin: 12px 0 0; }
/* 10/25 (operator: "the nice toggles from the Gather toggle"): pick-one rows and on/off switches are the Gather balloon
   (js/balloon.js radio mode + balloonSwitch). A two-word label ("Outer Darkness", "Match device") wraps onto two lines
   in a narrow slot instead of an ellipsis; balloon.js sizes the balloon to the wrapped words. */
.settings-sheet .set-balloon { margin-bottom: 0; }
.settings-sheet .set-balloon .bt-t { white-space: normal; line-height: 1.1; text-align: center; }
.settings-sheet .set-card .about-sw:has(.bt-switch) { margin: -4px 0; }
.settings-sheet .set-sw-title { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-align: left; }
.settings-sheet .set-h-wrap { margin-top: 26px; min-height: 0; }
.settings-sheet .set-h-wrap > .set-h { margin: 0; }
.settings-sheet .set-danger > .about-text { margin: 0 0 12px; }
/* Contact and appeals: the two Email buttons, natural width, one under the other (same as the phone). */
.settings-sheet .set-mails { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 4px; }
.settings-sheet .set-mail { display: inline-flex; max-width: 100%; overflow-wrap: anywhere; }

/* Leaving: Sign out, Delete account, Erase, set apart at the bottom in the danger color. */
.settings-sheet .set-danger {
  margin-top: 8px; padding: 14px 16px 16px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line));
}
.settings-sheet .set-danger > .set-desc { margin: 0 0 12px; }
.settings-sheet .set-danger-btns { display: flex; flex-direction: column; gap: 8px; }
.settings-sheet .set-danger-btn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.settings-sheet .set-danger-btn.danger { color: #fff; border-color: var(--danger-fill); } /* Erase, armed */
.settings-sheet .set-del { margin-top: 14px; }
.settings-sheet .set-del .row { flex-wrap: wrap; }
.settings-sheet .set-del .row .btn { flex: 1 1 200px; } /* stacks on phones instead of a 3-line pill */

.settings-sheet .set-foot { margin-top: 22px; text-align: center; }
/* 11/05 padding pass. "Suggested:" sat 12px above its chip's words: one line, centered. */
.settings-sheet .ban-suggest { align-items: center; }
/* Invite a friend (invite.js compact row) is a plain .card inside Settings: same edges and rhythm as the set-cards. */
.settings-sheet .invite-card { margin-top: 0; padding: 14px 0; }
/* Google's fixed-width button among the full-width ones: centered under its words like their labels, not pinned left. */
.settings-sheet .sso-row .sso-google { justify-content: center; }
.settings-sheet .set-foot p { margin: 6px 0 0; }

@container (min-width: 600px) {
  .settings-sheet .set-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; column-gap: 28px; align-items: center; }
  .settings-sheet .set-ctl { margin-top: 0; }
  /* Words left, control right, centered on each other: the stacked layout's -10px lift (title hugging the card top)
     put every title 5px above its button's middle here. */
  .settings-sheet .set-row .about-head { margin-top: 0; }
  /* Sign-in methods: Google draws its own button at a fixed width (js/sso.js, 320px when the slot can't be measured),
     wider than the 220px column, so it ran past the panel's right edge. These rows size the control to it. */
  .settings-sheet .set-row.sso-row { grid-template-columns: minmax(0, 1fr) auto; }
  .settings-sheet .sso-row .sso-google { justify-content: flex-end; }
  .settings-sheet .set-danger-btns { flex-direction: row; }
  .settings-sheet .set-danger-btns .btn { flex: 1 1 auto; white-space: nowrap; }
  .settings-sheet .set-send { display: flex; width: 220px; margin-left: auto; }
}

/* Wide windows: a centered panel instead of a full-width bottom sheet. */
@media (min-width: 768px) and (min-height: 560px) {
  .scrim:has(> .settings-sheet) { align-items: center; justify-content: center; padding: 24px; }
  .sheet.settings-sheet {
    width: min(760px, 100%); max-height: calc(100dvh - 48px); border-radius: 22px;
    padding: 8px 40px 32px; box-shadow: var(--shadow); border: 1px solid var(--line);
  }
}

/* Groups you lead (11/18, settings.js groupsYouLead): one row per group, words left and Manage right, a hairline between. */
.settings-sheet .set-lead-intro { margin: 0 0 4px; }
.settings-sheet .set-lead-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.settings-sheet .set-lead-intro + .set-lead-row { border-top: 0; }
.settings-sheet .set-lead-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.settings-sheet .set-lead-row .set-lead-btn { flex: none; width: auto; margin: 0; }
.settings-sheet .set-lead-push { margin: 4px 0 0; }

/* 11/23 Ward Bulletin sections (bulletinSections in views/settings.js): one Off | On per section, its line under it. */
.settings-sheet .set-bsec-intro { margin: 0 0 8px; }
.settings-sheet .set-bsec-sub { margin: 0 0 10px; }
