/* Settings (settings.js, setnav.js, setrow.js, setyou.js): drawn like a phone's own settings. Who this is at the top,
   then titled groups of rows on white cards, each row an icon on an ice tile, a title, one short line and a chevron,
   with hairlines between rows that start where the words do. On a phone the list and each page are separate screens;
   from 1200px the list stays at the left and the page opens beside it. Colors come only from brand.css. */

.set-frame { display: grid; gap: 20px; }
@media (max-width: 1199.98px) {
  .set-frame.at-home > .set-page, .set-frame:not(.at-home) > .set-title, .set-frame:not(.at-home) > .set-nav { display: none; }
}
.set-nav { display: grid; gap: 22px; align-content: start; min-width: 0; }

/* Who this is: a round tile with their initials, name, role and company. */
.set-me {
  display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 14px 16px;
  border-radius: var(--round); background: var(--white); box-shadow: var(--shadow); color: var(--navy); text-decoration: none;
}
.set-avatar {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--ice); color: var(--navy); font-size: 19px; font-weight: 900; letter-spacing: .02em;
}
.set-me .set-words b { font-size: 20px; }

/* A group: its small label, then its card of rows. */
.set-group { display: grid; gap: 8px; min-width: 0; }
.set-label {
  padding: 0 16px; color: var(--slate); font-size: 13px; font-weight: 900; line-height: 1.35;
  letter-spacing: .1em; text-transform: uppercase;
}
.set-card { display: grid; padding: 6px; border-radius: var(--round); background: var(--white); box-shadow: var(--shadow); min-width: 0; }
.set-card .why { padding: 0 12px 10px 66px; }

.set-row {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 10px 12px;
  border: 0; border-radius: 12px; background: none; color: var(--navy); font: inherit; text-align: left; text-decoration: none;
}
a.set-row, button.set-row { cursor: pointer; }
/* The hairline between two rows, from where the words start; gone beside a lit row. */
.set-row + .set-row::before {
  content: ""; position: absolute; top: 0; left: 66px; right: 12px; border-top: 1px solid var(--hair);
}
.set-row.pick + .set-row.pick::before { left: 16px; }
.set-row[aria-current="page"]::before, .set-row[aria-current="page"] + .set-row::before { border-top-color: transparent; }
@media (hover: hover) {
  a.set-row:hover, button.set-row:not(:disabled):hover, .set-me:hover { background: var(--off); }
  a.set-row:hover::before, a.set-row:hover + .set-row::before,
  button.set-row:not(:disabled):hover::before, button.set-row:not(:disabled):hover + .set-row::before { border-top-color: transparent; }
}
.set-row[aria-current="page"], .set-me[aria-current="page"] { background: var(--ice); }
.set-tile {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--ice); color: var(--deep);
}
.set-tile .ic { width: 22px; height: 22px; }
.set-row[aria-current="page"] .set-tile, .set-me[aria-current="page"] .set-avatar { background: var(--white); }
.set-words { flex: 1; min-width: 0; display: grid; gap: 1px; }
.set-words b { font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.set-words small { color: var(--slate); font-size: 17px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.set-go { flex: none; width: 20px; height: 20px; color: var(--slate); }
.set-row .btn, .set-row .switch { flex: none; }

/* Pick one (language, the look): the picked row has a check at the end. */
.set-row.pick { padding-left: 16px; min-height: 64px; }
.set-row.pick:disabled { cursor: default; }
.set-check { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: var(--blue); }
.set-check .ic { width: 24px; height: 24px; stroke-width: 2.6; }

/* Pages under Settings. */
.set-fix { margin-top: 16px; }
.devices .saved { margin-top: 8px; }
.device-list { list-style: none; margin: 0; padding: 0; }
.device-buttons, .device-ask { margin-top: 12px; }
.device-ask { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--hair); }
.device-list + .device-ask { border-top: 0; padding-top: 4px; }
.device-buttons .btn, .device-ask .btn { flex: 1 1 auto; }
.pin-change { display: grid; gap: 14px; }
.pin-change .input { max-width: 280px; }

@media (min-width: 900px) {
  .device-buttons .btn, .device-ask .btn { flex: 0 0 auto; }
}

/* A laptop: the list at the left, the open page beside it. A page that opens a panel of its own (a kind, a person, a
   template) takes the whole width while it's open, with its way back. */
@media (min-width: 1200px) {
  .main:has(.set-frame) { max-width: 1400px; }
  .set-frame { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); column-gap: 28px; row-gap: 12px; align-items: start; }
  .set-title { grid-column: 1 / -1; }
  .set-page { min-width: 0; }
  .set-frame.at-home .set-me { background: var(--ice); }
  .set-frame.at-home .set-avatar { background: var(--white); }
  .set-frame:not(:has(.split.has-open)) .set-page > .stack > .back { display: none; }
  .set-frame:has(.split.has-open) { grid-template-columns: minmax(0, 1fr); }
  .set-frame:has(.split.has-open) > .set-nav, .set-frame:has(.split.has-open) > .set-title { display: none; }
  /* Pages whose cards sit two across on a laptop stack them in the narrower pane. */
  .set-page .num-grid, .set-page .alerts-grid { grid-template-columns: minmax(0, 1fr); }
}
