/* ================================================================
   Accounts
   The sign-in dialog, the signed-out notice, and the account section
   of the settings panel.
   ================================================================ */

/* ---------- Settings panel ---------- */

.acct-who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}

.acct-status {
  margin: 3px 0 10px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.acct-status:empty { display: none; }

.acct-hint { margin: 0 0 10px; }

.option-button.acct-primary {
  border-color: color-mix(in srgb, var(--text) 32%, transparent);
  font-weight: 600;
}

/* ---------- Signed-out notice above the text ---------- */

.acct-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 34px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  color: var(--muted);
  font: 13px/1.5 var(--ui-font);
}

.acct-notice span { flex: 1 1 260px; }

.acct-notice button {
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--text);
  font: 600 13px/1.2 var(--ui-font);
  cursor: pointer;
}

.acct-notice button + button { color: var(--muted); font-weight: 500; }
.acct-notice button:hover { text-decoration: underline; }

/* ---------- Dialog ---------- */

.acct-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--page-bg) 55%, rgba(0,0,0,.45));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.acct-backdrop.open { display: flex; }

.acct-card {
  position: relative;
  width: min(380px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 26px 24px 22px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--page-bg);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  color: var(--text);
  font-family: var(--ui-font);
}

.acct-card h2 {
  margin: 0 30px 6px 0;
  font: 500 24px/1.2 var(--reader-font);
  letter-spacing: -0.01em;
}

/* When a dialog has no lead sentence, keep the form off the heading. */
.acct-card h2 + form { margin-top: 20px; }

.acct-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.acct-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: 20px/1 var(--ui-font);
  cursor: pointer;
}

.acct-close:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }

.acct-field { display: block; margin-bottom: 12px; }

.acct-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.acct-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: var(--text);
  font: 16px/1.3 var(--ui-font);
  outline: none;
}

.acct-field input:focus { border-color: color-mix(in srgb, var(--ink) 60%, transparent); }

.acct-error {
  min-height: 0;
  margin: 2px 0 10px;
  color: #D14D41;
  font-size: 13px;
  line-height: 1.45;
}

.acct-error:empty { margin: 0; }

.acct-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: 11px;
  background: var(--text);
  color: var(--page-bg);
  font: 600 15px/1 var(--ui-font);
  cursor: pointer;
}

.acct-submit:disabled { opacity: .55; cursor: default; }

.acct-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 14px;
}

.acct-links button {
  min-height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font: 13.5px/1.2 var(--ui-font);
  cursor: pointer;
}

.acct-links button:hover { color: var(--text); text-decoration: underline; }

/* ---------- Busy cover while study moves in or out ---------- */

.acct-busy {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
  color: var(--muted);
  font: 14px/1.4 var(--ui-font);
}

.acct-busy.open { display: flex; }
