/* ==========================================================================
   Accounts, security and PWA (Phase 12): Profile's deeper screens, the
   sign-in extras, the privacy notice, the install and update offers and the
   offline strip. Design tokens only (docs/DESIGN.md § 2).
   ========================================================================== */

/* A button marked hidden stays hidden (.btn sets its own display). */
.btn[hidden], .chip[hidden] { display: none; }

/* ---------- avatars ---------------------------------------------------------- */

.avatar-link { display: block; border-radius: 22px; flex: 0 0 auto; }
.avatar-link:active { transform: scale(.96); }
.avatar-lg.has-photo, .avatar-xl.has-photo { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar-lg img, .avatar-xl img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-xl {
  width: 96px; height: 96px; flex: 0 0 96px; border-radius: 30px;
  display: grid; place-items: center; font-size: 34px; font-weight: 900; letter-spacing: -.02em;
  color: var(--brand-ink); background: var(--brand-soft);
}
.photo-card { display: flex; align-items: center; gap: 16px; }
@media (max-width: 359px) {
  .photo-card { align-items: flex-start; gap: 12px; }
  .avatar-xl { width: 72px; height: 72px; flex-basis: 72px; border-radius: 24px; font-size: 26px; }
}

/* ---------- rows ----------------------------------------------------------------- */

.row-ico {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink);
}
.row-ico .ico { width: 20px; height: 20px; }
.flat-group { box-shadow: none; border: 1px solid var(--line); }
.list-row .m { overflow-wrap: anywhere; }

/* Weekday picks: Monday to Thursday, then Friday to Sunday, every one wide
   and tall enough to hit (seven in a row would be under 44 px on a phone). */
.day-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.day-picks .chip { padding: 0; justify-content: center; min-width: 0; }

.danger-ink { color: var(--danger); }

/* ---------- passkeys and two-step ------------------------------------------------- */

.pk-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.pk-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 6px 6px 12px; background: var(--surface); }
.pk-row + .pk-row { border-top: 1px solid var(--line-2); }
.pk-row .t { display: block; font-weight: 800; }
.pk-row .m { display: block; font-size: var(--fs-cap); font-weight: 650; color: var(--muted); }
.pk-empty { padding: 4px 2px; font-weight: 750; }
.tf-status { display: flex; align-items: center; gap: 10px; }

.code-in { text-align: center; font-size: 26px !important; font-weight: 850; letter-spacing: .3em; }
.secret-key {
  padding: 14px 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink);
  font-size: 17px; font-weight: 800; letter-spacing: .06em; text-align: center; word-spacing: .3em;
  overflow-wrap: anywhere; user-select: all; -webkit-user-select: all;
}
.codes-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; padding: 0;
  list-style: none; counter-reset: code;
}
.codes-grid li {
  padding: 10px 4px; border-radius: var(--r-sm); background: var(--surface-2); text-align: center;
  font-size: 14px; font-weight: 800; color: var(--ink); white-space: nowrap;
  user-select: all; -webkit-user-select: all;
}
/* Nineteen characters a code: one column where two would not fit them. */
@media (max-width: 400px) { .codes-grid { grid-template-columns: 1fr; gap: 6px; } .codes-grid li { padding: 8px 4px; font-size: 15px; letter-spacing: .03em; } }

/* ---------- install --------------------------------------------------------------- */

.install-card { display: flex; gap: 14px; align-items: flex-start; background: var(--brand-soft); box-shadow: none; }
.install-card h3 { font-size: var(--fs-body); font-weight: 850; color: var(--brand-ink); }
.install-card .cap { color: var(--ink-2); }
.install-actions { margin-top: 10px; gap: 8px; }
.install-actions .btn { white-space: nowrap; }
.install-icon {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface); color: var(--brand);
}
.install-steps { display: grid; gap: 12px; margin: 4px 0 16px; padding: 0; list-style: none; }
.install-steps li { display: flex; align-items: flex-start; gap: 12px; font-size: var(--fs-sm); font-weight: 650; color: var(--ink-2); line-height: 1.45; }
.install-steps .n {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); font-size: 14px; font-weight: 850;
}
.kbd {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin: 0 2px; vertical-align: middle;
  border-radius: 8px; background: var(--surface-2); color: var(--brand); border: 1px solid var(--line);
}

/* ---------- the notice strip (offline, not backed up, update ready) --------------- */

.app-notice {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: calc(var(--safe-t) + 6px) var(--pad) 6px;
  font-size: var(--fs-cap); font-weight: 750; line-height: 1.3;
  background: var(--surface-2); color: var(--ink-2); border-bottom: 1px solid var(--line);
}
#maint-banner ~ .app-notice { padding-top: 6px; }
.app-notice > * { max-width: 560px; }
.app-notice .ico { flex: 0 0 auto; }
.app-notice.offline { background: var(--surface-2); color: var(--ink-2); }
.app-notice.error { background: var(--warn-soft); color: var(--pr-ink); }
.app-notice.update { background: var(--brand-soft); color: var(--brand-ink); }
.app-notice .btn.sm { min-height: 44px; flex: 0 0 auto; }
body.has-notice .app { padding-top: 8px; }

/* ---------- sign-in extras ---------------------------------------------------------- */

.login-foot { margin-top: -8px; }
.link-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
  padding: 0 12px; border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 750; color: var(--brand);
}
.link-btn:active { background: var(--brand-soft); }

/* ---------- the privacy notice ------------------------------------------------------ */

.prose { display: grid; gap: 10px; }
.prose h2 { font-size: var(--fs-h3); }
.prose h3 { font-size: var(--fs-body); font-weight: 850; margin-top: 8px; }
.prose p, .prose li { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); line-height: 1.5; }
.prose ul { display: grid; gap: 6px; padding-left: 20px; list-style: disc; }
.prose li::marker { color: var(--faint); }
.prose b { color: var(--ink); }
