/* Accounts + sync: shell entry, Settings cards, first-sign-in dialog. Dark only (design/THEME.md). */

/* Shell entry: bottom of the sidebar on desktop, right of the top bar on phones. */
.account-entry {
  margin-top: auto;
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--control-h); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--muted); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-semi);
  position: relative; min-width: 0;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.account-entry[hidden] { display: none; }
.account-entry svg { width: 22px; height: 22px; flex: none; }
.account-entry:hover { color: var(--text); background: var(--surface-2); }
.account-entry:focus-visible { outline: none; box-shadow: var(--focus-ring); color: var(--text); }
.account-entry-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.account-entry[data-state="on"], .account-entry[data-state="warn"] { color: var(--text); }
.account-entry-dot {
  width: 8px; height: 8px; border-radius: var(--radius-circle); flex: none;
  background: var(--muted);
}
.account-entry[data-state="warn"] .account-entry-dot { background: var(--warn); }
.account-entry-dot[hidden] { display: none; }

@media (max-width: 699px) {
  .account-entry { margin-top: 0; margin-left: auto; padding: 0; width: var(--control-h); justify-content: center; border-radius: var(--radius-circle); }
  .account-entry-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .account-entry-dot { position: absolute; top: 9px; right: 9px; box-shadow: 0 0 0 2px var(--bg); }
}

/* Settings cards */
.acct-card .row, .acct-privacy .row { gap: var(--space-3); }
.acct-sync-line { color: var(--muted); }
.acct-check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--muted); min-height: var(--control-h); cursor: pointer; }
.acct-check input { width: 18px; height: 18px; accent-color: var(--text); }
.acct-signout { gap: var(--space-2); }
.acct-danger { padding-top: var(--space-4); border-top: 1px solid var(--line); }
.acct-privacy-list { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); color: var(--muted); line-height: var(--lh); }
.acct-privacy-list strong { color: var(--text); }

/* Sign-in buttons (Google, Facebook, Microsoft, passkey). Each provider's own colours and wording
   (their branding rules), sentence case, not the app's uppercase button style. */
.acct-providers { display: flex; flex-direction: column; gap: var(--space-3); max-width: 360px; margin-bottom: var(--space-4); }
.acct-providers[hidden] { display: none; }
.acct-brand-form { margin: 0; display: contents; }
.brand-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: var(--control-h); padding: 0 16px;
  border-radius: var(--radius-pill); border: 1px solid transparent; cursor: pointer;
  font-family: Roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-size: 14px; font-weight: 500;
  letter-spacing: .25px; text-transform: none; line-height: 20px;
}
.brand-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.brand-btn:disabled { opacity: .6; cursor: default; }
.brand-logo { display: inline-flex; flex: none; width: 20px; height: 20px; }
.brand-logo svg { width: 20px; height: 20px; }
.brand-google { background: #131314; border-color: #8E918F; color: #E3E3E3; }
.brand-google:hover { background: #1f1f20; }
.brand-facebook { background: #1877F2; border-color: #1877F2; color: #FFFFFF; font-weight: 600; }
.brand-facebook:hover { background: #166FE5; }
.brand-microsoft { background: #2F2F2F; border-color: #2F2F2F; color: #FFFFFF; font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; font-weight: 600; }
.brand-microsoft:hover { background: #3a3a3a; }
.brand-passkey { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
.brand-passkey:hover { background: var(--surface-hover); }
.acct-or { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Settings: connected sign-in methods */
.acct-methods { padding-top: var(--space-4); border-top: 1px solid var(--line); gap: var(--space-2); }
.acct-sub { font-size: var(--fs-md); font-weight: var(--fw-bold); margin: 0; }
.acct-method-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.acct-method { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-h); }
.acct-method-icon { display: inline-flex; width: 20px; height: 20px; flex: none; color: var(--muted); }
.acct-method-icon svg { width: 20px; height: 20px; }
.acct-method-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.acct-method-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-method .acct-brand-form, .acct-method > .btn { margin-left: auto; flex: none; }
.acct-method .acct-brand-form { display: block; }

/* First sign-in: which data to keep */
.acct-dialog {
  max-width: min(440px, calc(100vw - 2 * var(--space-4)));
  border: 0; border-radius: var(--radius); padding: var(--space-6);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.acct-dialog::backdrop { background: var(--overlay); }
.acct-dialog h2 { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin: 0 0 var(--space-2); }
.acct-choice-list { margin: var(--space-4) 0; display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); font-size: var(--fs-sm); }
.acct-choice-list dt { font-weight: var(--fw-bold); }
.acct-choice-list dd { margin: 0; color: var(--muted); }
.acct-choice-actions { justify-content: flex-end; }

/* Shared household lists (household.js). Dark only; green stays for primary CTAs. */
.hh-card .row { gap: var(--space-3); }
.hh-sub { font-size: var(--fs-md); font-weight: var(--fw-bold); margin: 0 0 var(--space-2); }
.hh-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.hh-member { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-h); }
.hh-member .btn { margin-left: auto; }
.hh-member-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-avatar {
  width: 32px; height: 32px; flex: none; border-radius: var(--radius-circle);
  display: grid; place-items: center; background: var(--surface-3); color: var(--text);
  font-weight: var(--fw-bold); font-size: var(--fs-sm);
}
.hh-role { font-size: var(--fs-xs); }
.hh-invite { gap: var(--space-2); }
.hh-link-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.hh-link-row .input { flex: 1 1 220px; min-width: 0; font-family: var(--font-mono); font-size: var(--fs-xs); }
.hh-invites { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.hh-invites li { display: flex; align-items: center; gap: var(--space-3); justify-content: space-between; }
.hh-rename { align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; }
.hh-rename .field { flex: 1 1 200px; margin: 0; }

/* Grocery / shop pages: "Shared with …" line and who added / checked each item. */
.hh-banner {
  display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--muted); font-size: var(--fs-sm); width: fit-content; max-width: 100%;
}
.hh-banner svg { flex: none; color: var(--text); }
.hh-banner [data-role=text] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-banner-link { color: var(--text); font-weight: var(--fw-semi); margin-left: var(--space-2); white-space: nowrap; }
.hh-banner-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
.hh-by { display: block; font-size: var(--fs-xs); color: var(--muted-2); margin-top: 2px; }

/* Settings: Email alerts card (app/notify) */
.notify-toggles { gap: var(--space-1); }
.notify-card[hidden] { display: none; }
