/* ============================================================
   TOASTS — flash messages and turbo-stream confirmations
   ============================================================ */
@keyframes toast-life {
  0%   { opacity: 0; transform: translateY(8px); }
  8%   { opacity: 1; transform: none; }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-pop);
  color: var(--text-1);
  font-size: var(--fs-13);
  box-shadow: var(--shadow-card);
  animation: toast-life 3.5s ease forwards;
}
.toast i { color: var(--accent-bright); }
.toast--long { animation-duration: 9s; max-width: min(460px, calc(100vw - 32px)); box-sizing: border-box; }
.toast--alert { border-color: var(--danger); }
.toast--alert i { color: var(--danger-bright); }

/* ============================================================
   SETTINGS — the user settings page
   Three shapes cover the whole page: a card, a row (label and hint on the left, one
   control on the right), and three button weights. It used to be 57 inline style
   attributes and a single class. Above the cards sits the hero: who this is.
   ============================================================ */
.set-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 28px 24px 72px;
  box-sizing: border-box;
}
.set-notes { margin-bottom: 28px; }

/* The hero: avatar, name, email and plan. */
.set-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 20px;
  background-color: var(--surface-card);
  background-image: radial-gradient(120% 140% at 0% 0%, rgba(34, 197, 94, 0.07), transparent 60%), var(--sheen);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 var(--inset-light), 0 1px 2px rgba(0, 0, 0, 0.4);
}
.set-hero .soc-avatar { box-shadow: 0 0 0 3px var(--surface-card), 0 0 0 4px var(--border-strong); }
.set-hero .soc-avatar i { font-size: 0.95em; }
.set-hero-body { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.set-hero-name { overflow: hidden; color: var(--text-1); font-size: var(--fs-18); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.set-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: var(--fs-10);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}
.set-pill.is-premium { border-color: rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.1); color: var(--gold-bright); }
.set-pill.is-trial { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-bright); }

.set-card {
  margin-bottom: 16px;
  background-color: var(--surface-card);
  background-image: var(--sheen);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 var(--inset-light), 0 1px 2px rgba(0, 0, 0, 0.4);
}
/* Premium gets a thin gold edge; the danger zone a red one. */
.set-card.is-premium {
  border-color: rgba(251, 191, 36, 0.28);
  background-image: linear-gradient(135deg, rgba(251, 191, 36, 0.06), transparent 55%), var(--sheen);
}
.set-card.is-premium .set-card-head i { color: var(--gold-bright); }
.set-card.is-danger { border-color: var(--danger-line); }
.set-card.is-danger .set-card-head { color: var(--danger-bright); border-bottom-color: var(--danger-soft); }
.set-card.is-danger .set-card-head i { color: var(--danger-bright); }
.set-card.is-danger .set-row { border-top-color: var(--danger-soft); }

.set-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px 10px;
  border-bottom: 1px solid var(--hairline-strong);
  color: var(--text-3);
  font-size: var(--fs-10);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.set-card-head i { width: 14px; color: var(--text-3); font-size: var(--fs-11); text-align: center; }
/* Autosave's word on the Preferences card, at the right of its head. */
.set-card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.set-card-status.is-ok { color: var(--accent-bright); }
.set-card-status.is-error { color: var(--danger-bright); }
.set-card-status i { width: auto; color: inherit; }
.set-card-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--hairline);
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 18px;
  border-top: 1px solid var(--hairline);
}
.set-row:first-of-type { border-top: none; }
.set-row.is-stacked { flex-direction: column; align-items: stretch; gap: 12px; }

.set-label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-name { color: var(--text-1); font-size: var(--fs-13); font-weight: 500; }
.set-hint { color: var(--text-3); font-size: var(--fs-11); line-height: 1.5; text-wrap: pretty; }
.set-hint.is-error { color: var(--danger-bright); }

/* Buttons. Secondary is the default — it was written out seven times before. */
.set-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  flex-shrink: 0;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.set-btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.set-btn.is-primary { border-color: transparent; background: var(--accent); color: #04140a; font-weight: 600; }
.set-btn.is-primary:hover { background: var(--accent-bright); }
.set-btn.is-danger { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger-bright); }
.set-btn.is-danger:hover { border-color: var(--danger); background: rgba(239, 68, 68, 0.18); }
.set-btn.is-danger-solid { border-color: transparent; background: var(--danger); color: #fff; font-weight: 600; }
.set-btn.is-danger-solid:hover { background: var(--danger-bright); }
.set-btn.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-bright); }
span.set-btn.is-on { cursor: default; }
.set-btn[disabled] { cursor: default; opacity: 0.6; }
.set-btn[disabled]:hover { border-color: var(--border); background: var(--surface-2); }
.set-inline-form { display: inline; margin: 0; }

.set-input {
  box-sizing: border-box;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-1);
  font-family: inherit;
  font-size: var(--fs-12);
  transition: border-color var(--dur-fast) ease;
}
.set-input.set-input-short { width: 220px; max-width: 100%; }
.set-input:focus { outline: none; border-color: var(--border-strong); }
.set-input.is-invalid { border-color: var(--danger-line); }
.set-input::placeholder { color: var(--text-3); }
.set-textarea { resize: vertical; line-height: 1.6; }
.set-contact { display: flex; flex-direction: column; gap: 8px; }
.set-contact .set-card-foot { padding: 4px 0 0; border-top: none; }

/* A field with its live check under it (the username). */
.set-field { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.set-field-check { color: var(--text-3); font-size: var(--fs-10); font-variant-numeric: tabular-nums; text-align: right; }
.set-field-check.is-ok { color: var(--accent-bright); }
.set-field-check.is-error { color: var(--danger-bright); }

/* A select drawn to match: its own chevron, an icon at the left, and a dark list. */
.set-select { position: relative; width: 310px; max-width: 100%; }
.set-select select {
  height: 32px;
  padding: 0 30px 0 32px;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-2);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.set-select select:hover { border-color: var(--border-strong); background: var(--surface-3); }
.set-select select:focus-visible { border-color: var(--text-3); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
.set-select option, .set-select optgroup { background: var(--surface-pop); color: var(--text-1); }
.set-select optgroup { color: var(--text-3); font-weight: 600; }
.set-select-icon, .set-select-chevron {
  position: absolute;
  top: 50%;
  color: var(--text-3);
  pointer-events: none;
  transform: translateY(-50%);
}
.set-select-icon { left: 11px; font-size: var(--fs-12); }
.set-select-chevron { right: 11px; font-size: var(--fs-9); transition: color var(--dur-fast) ease; }
.set-select:hover .set-select-chevron, .set-select:focus-within .set-select-chevron { color: var(--text-1); }
.set-select:focus-within .set-select-icon { color: var(--accent-bright); }

/* A text button inside a line of hint text. */
.set-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-bright);
  font: inherit;
  cursor: pointer;
}
.set-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Avatar shuffle, beside the "Avatar" name. */
.set-shuffle { margin-left: 8px; font-size: var(--fs-11); font-weight: 400; }
.set-shuffle i { margin-right: 3px; font-size: 0.9em; }

/* Contact rests as one row (a <summary>) and opens into the form. */
.set-contact-wrap > summary { list-style: none; cursor: pointer; }
.set-contact-wrap > summary::-webkit-details-marker { display: none; }
.set-contact-wrap[open] > summary .set-btn { display: none; }
.set-contact-wrap > div.set-row { border-top: none; padding-top: 0; }

/* The avatar picker: icons tinted with the chosen colour, then the colours. */
.set-avatar-picker { display: flex; flex-direction: column; gap: 12px; }
.set-avatar-picker fieldset { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: none; }
.set-avatar-opt, .set-hue { position: relative; cursor: pointer; }
.set-avatar-opt input, .set-hue input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.set-avatar-opt .soc-avatar {
  width: 34px;
  height: 34px;
  font-size: 14px;
  opacity: 0.55;
  transition: opacity var(--dur-fast) ease, box-shadow var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.set-avatar-opt:hover .soc-avatar { opacity: 0.9; }
.set-avatar-opt input:checked + .soc-avatar { opacity: 1; box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 4px hsl(var(--soc-hue) 70% 60%); }
.set-avatar-opt input:focus-visible + .soc-avatar { box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 4px var(--text-2); }
.set-hue-dot {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: hsl(var(--soc-hue) 45% 38%);
  transition: box-shadow var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.set-hue:hover .set-hue-dot { transform: scale(1.12); }
.set-hue input:checked + .set-hue-dot { box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 4px hsl(var(--soc-hue) 70% 62%); }
.set-hue input:focus-visible + .set-hue-dot { box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 4px var(--text-2); }

/* The trial countdown under the Plan row. */
.set-meter { display: flex; align-items: center; gap: 12px; padding: 0 18px 15px; }
.set-meter-bar {
  flex: 1;
  height: 6px;
  border: none;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  appearance: none;
}
.set-meter-bar::-webkit-progress-bar { border-radius: 999px; background: var(--surface-3); }
.set-meter-bar::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); }
.set-meter-bar::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); }
.set-meter-text { flex-shrink: 0; color: var(--text-3); font-size: var(--fs-11); font-variant-numeric: tabular-nums; }
.set-meter-text strong { color: var(--text-1); font-weight: 600; }

/* The preference switches. */
.set-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; cursor: pointer; }
.set-switch input { position: absolute; width: 0; height: 0; opacity: 0; }
.set-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background-color: var(--surface-3);
  transition: background-color var(--dur-base) ease;
}
.set-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--dur-base) ease;
}
.set-switch input:checked + .set-switch-track { background-color: var(--accent); }
.set-switch input:checked + .set-switch-track::after { transform: translateX(18px); }
.set-switch input:focus-visible + .set-switch-track { box-shadow: 0 0 0 2px var(--text-2); }

/* The native file control is the one piece of browser chrome that cannot be themed, so
   it is hidden behind a label that reports the chosen file itself. */
.set-restore { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.set-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: var(--fs-12);
  cursor: pointer;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.set-file:hover { color: var(--text-1); border-color: var(--text-3); }
.set-file i { color: var(--text-3); font-size: var(--fs-11); }
.set-file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.set-file:focus-within { border-color: var(--text-2); color: var(--text-1); }

.set-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
}
.set-modal[hidden] { display: none; }
.set-modal-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 26px 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-pop);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.set-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border: 1px solid var(--danger-line);
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger-bright);
  font-size: 22px;
}
.set-modal-title { margin: 0 0 10px; color: var(--danger-bright); font-size: var(--fs-16); font-weight: 700; }
.set-modal-body {
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: var(--fs-13);
  line-height: 1.65;
  text-wrap: pretty;
}
.set-modal-body strong { color: var(--text-1); }
.set-modal-actions { display: flex; justify-content: center; gap: 10px; }

@media (max-width: 640px) {
  .set-page { padding: 18px 12px 56px; }
  .set-hero { flex-wrap: wrap; padding: 16px; }
  .set-row { flex-direction: column; align-items: stretch; gap: 10px; }
  /* A switch stays beside its label, as settings screens do; only wide controls drop below. */
  .set-row.is-switch { flex-direction: row; align-items: center; gap: 16px; }
  .set-btn { align-self: flex-start; }
  .set-field { align-items: stretch; }
  .set-field-check { text-align: left; }
  .set-select { width: 100%; }
}

/* ---- Settings: the hero inside Profile; short buttons beside their label on a phone ---- */
.set-card .set-hero {
  margin: 0; border: none; border-radius: 0; box-shadow: none;
  padding: 16px 18px; border-bottom: 1px solid var(--hairline);
}
.set-hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.set-hero > .set-pill { align-self: flex-start; }
.set-avatar-row:has(.set-avatar-picker[hidden]) { display: none; }
.set-avatar-row { border-top: none; padding-top: 4px; }
#username-save[hidden] { display: none; }
/* Recent notifications, folded at the foot of the Notifications card. */
.set-past-notes { border-top: 1px solid var(--hairline); }
.set-past-summary { list-style: none; cursor: pointer; border-top: none; }
.set-past-summary::-webkit-details-marker { display: none; }
.set-past-notes[open] .set-past-chevron { transform: rotate(180deg); }
.set-past-notes .soc-notes { padding: 0 10px 10px; }
/* Restore, beside the backup: red, but quiet until it's needed. */
.set-restore-row .set-btn.is-danger { margin-left: auto; }
.set-btn .fa-check { font-size: 0.85em; }
@media (max-width: 640px) {
  /* A short button stays beside its label, as a switch does; only rows with a field
     (username, time zone, home town) or a stacked control drop below. */
  .set-row:not(.is-stacked):not(:has(.set-field)) { flex-direction: row; align-items: center; gap: 14px; }
  .set-row:not(.is-stacked):not(:has(.set-field)) .set-btn { align-self: center; flex-shrink: 0; white-space: nowrap; }
  .set-card .set-hero { flex-wrap: nowrap; align-items: flex-start; }
}
.set-hero-actions .set-shuffle { white-space: nowrap; }

/* ---- Settings polish ---- */
/* A built-in habit already in the day: a quiet state, not a button. */
.set-state { display: inline-flex; flex-shrink: 0; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-12); white-space: nowrap; }
.set-state i { color: #4ade80; font-size: var(--fs-11); }
/* View profile beside Change avatar and Shuffle. */
.set-view-profile { font-size: var(--fs-11); font-weight: 400; white-space: nowrap; text-decoration: none; }
.set-view-profile i { margin-right: 3px; font-size: 0.9em; }
/* Restore before a file is picked: grey, not an armed red button. */
.set-btn.is-danger[disabled], .set-btn.is-danger[disabled]:hover { border-color: var(--border); background: var(--surface-2); color: var(--text-3); opacity: 1; }
@media (max-width: 640px) {
  .set-hero-actions { flex-wrap: wrap; row-gap: 6px; }
  /* Temperature: its select under the label, as the other phone rows have it. */
  #weather .weather-unit-select { flex: 1 1 100%; max-width: none; }
  #weather .set-row:has(.weather-unit-select) { flex-wrap: wrap; row-gap: 8px; }
}

/* Email & password (devise/registrations/edit): Settings' cards, a back arrow by the title. */
.set-page .ledger-head-left .show-back { margin-right: 4px; }
.set-account-form .set-row.is-stacked .set-input { width: 100%; max-width: 420px; }
.set-account-actions { justify-content: flex-end; gap: 8px; }
.set-form-error { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--danger-line); border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger-bright); font-size: var(--fs-13); }
/* Email & password: an eye inside each password field, and the note for an account made with Google. */
.set-password { position: relative; width: 100%; max-width: 420px; }
.set-account-form .set-password .set-input { max-width: none; padding-right: 40px; }
.set-reveal { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 30px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--text-3); font-size: 13px; cursor: pointer; }
.set-reveal:hover { color: var(--text-1); background: var(--surface-3); }
.set-reveal .when-shown, .set-reveal[aria-pressed="true"] .when-hidden { display: none; }
.set-reveal[aria-pressed="true"] .when-shown { display: inline-block; }
.set-card-head label { cursor: default; }
.set-google-note { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 0; color: var(--text-3); font-size: var(--fs-12); line-height: 1.5; }
.set-google-note i { font-size: 11px; }
.set-link-btn { padding: 0; border: 0; background: none; color: var(--text-1); font: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); cursor: pointer; }
.set-link-btn:hover { text-decoration-color: currentColor; }
/* Premium already, not paying: the plans are a preview for later. */
.prem-plans.is-quiet { opacity: 0.55; }
.prem-plans.is-quiet .prem-plan.is-featured { border-color: var(--border-panel); }

/* ---- Settings polish ---- */
/* A hidden button stays hidden: .set-btn's display outranked [hidden], so Install showed
   beside "Install from your browser's menu" and did nothing. */
.set-btn[hidden] { display: none; }
/* Premium in gold, as everywhere it's offered. */
.set-btn.is-gold { gap: 6px; border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.12); color: var(--gold-bright); font-weight: 600; }
.set-btn.is-gold:hover { border-color: rgba(251, 191, 36, 0.8); background: rgba(251, 191, 36, 0.2); }
.set-btn.is-gold i { font-size: 0.9em; }
.set-card.is-premium .set-card-head { color: var(--gold-bright); }
/* Built-in habits: each with its icon. */
.set-habit-row { justify-content: flex-start; gap: 14px; }
.set-habit-row > .set-label { flex: 1; }
.set-habit-icon { display: inline-grid; flex-shrink: 0; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--accent-bright); font-size: var(--fs-12); }
/* Card titles: a step up in size and contrast, so a card reads as a section. */
.set-card-head { color: var(--text-2); font-size: var(--fs-11); letter-spacing: 0.08em; }
.set-card-head i { color: var(--text-2); }
/* The danger zone quieter at rest: its Delete only reddens on hover. */
.set-card.is-danger { border-color: rgba(239, 68, 68, 0.22); }
.set-card.is-danger .set-card-head { color: rgba(248, 113, 113, 0.85); }
#delete-account-btn.set-btn.is-danger { border-color: var(--border); background: transparent; color: var(--danger-bright); }
#delete-account-btn.set-btn.is-danger:hover { border-color: var(--danger); background: rgba(239, 68, 68, 0.12); }
/* No keyboard on a touch screen, so no shortcuts row. */
@media (hover: none) and (pointer: coarse) { .set-shortcuts-row { display: none; } }
@media (max-width: 640px) {
  /* Shuffle and View profile as icons beside Change avatar, on one line. */
  .set-hero-actions { flex-wrap: nowrap; gap: 6px; }
  .set-hero-actions .set-link > span { display: none; }
  .set-hero-actions .set-link { display: inline-grid; place-items: center; width: 30px; height: 30px; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; }
  .set-hero-actions .set-link i { margin: 0; }
}
/* The plan's name in Premium's gold, not the brand's blue. */
.set-card.is-premium .set-name .brand-em { color: var(--gold-bright); }

/* ============================================================
   GUIDE (guide/show) — the settings page's card and row, with an entry's body in full
   rather than as a one-line hint, and a row of section links above.
   ============================================================ */
.guide-lead { margin: -4px 0 14px; color: var(--text-3); font-size: var(--fs-13); }
.guide-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.guide-nav-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-2); font-size: var(--fs-12); text-decoration: none;
}
.guide-nav-link i { color: var(--text-3); font-size: var(--fs-11); }
.guide-nav-link:hover { border-color: var(--border-strong); color: var(--text-1); }
.guide-card { scroll-margin-top: 16px; }
.guide-entry { align-items: flex-start; scroll-margin-top: 16px; }
.guide-entry:target { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.guide-entry-title { margin: 0; }
.guide-entry-body { margin: 0; color: var(--text-2); font-size: var(--fs-12); line-height: 1.55; text-wrap: pretty; }
.guide-entry-body code {
  padding: 1px 5px; border-radius: 4px; background: var(--surface-3);
  color: var(--text-1); font-family: inherit; font-size: 0.95em; white-space: nowrap;
}
.guide-entry .set-btn { margin-top: 2px; text-decoration: none; }
@media (max-width: 640px) {
  .guide-entry { flex-direction: column; gap: 10px; }
  /* Clear of the phone's fixed top bar when a link lands on an entry. */
  .guide-card, .guide-entry { scroll-margin-top: 68px; }
}

/* Settings' sections to jump to (users/edit): a row of links across the top, and on a
   screen wide enough, a column to the right of the cards that stays in view and lights
   the section being read. */
.set-page { position: relative; }
.set-toc { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 18px; font-size: var(--fs-13); }
.set-toc-link { color: var(--text-3); text-decoration: none; transition: color var(--dur-fast); }
.set-toc-link:hover { color: var(--text-1); text-decoration: none; }
.set-toc-link.is-current { color: var(--text-1); }
.set-toc-link.is-danger:hover { color: var(--danger-bright); }
.set-card[id] { scroll-margin-top: 20px; }
@media (min-width: 1560px) {
  .set-toc-rail { position: absolute; top: 28px; bottom: 72px; left: 100%; width: 170px; }
  .set-toc {
    position: sticky; top: 28px; flex-direction: column; flex-wrap: nowrap; gap: 8px;
    margin: 0; padding-left: 14px; border-left: 1px solid var(--border);
  }
  .set-toc::before { content: "On this page"; color: var(--text-3); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
  .set-toc-link { position: relative; }
  .set-toc-link.is-current::before { content: ""; position: absolute; top: 2px; bottom: 2px; left: -15px; width: 2px; border-radius: 2px; background: var(--accent); }
}
@media (max-width: 819px) {
  .set-toc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .set-toc::-webkit-scrollbar { display: none; }
  .set-toc-link { flex: 0 0 auto; }
}

/* A disabled button reads as one: dimmer and grey, not a full-strength button at 60%. */
.set-btn[disabled], .set-btn[disabled]:hover { opacity: 0.4; color: var(--text-3); border-color: var(--border); background: transparent; }
