/* Account security follows the existing workbench palette and controls. */
.mfa-open-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; min-height: 40px; padding: 8px; border: 0; border-radius: 6px;
  color: var(--muted, #66716b); background: transparent; font: inherit; cursor: pointer;
  white-space: nowrap;
}
.mfa-open-button svg { width: 17px; height: 17px; flex: none; }
.mfa-open-button:hover { color: var(--accent, #167653); background: #edf6f0; }
.mfa-open-button:focus-visible, .mfa-login summary:focus-visible,
.account-mfa :is(button, summary, input):focus-visible {
  outline: 2px solid var(--focus, #248d68); outline-offset: 3px;
}
.mfa-login { margin: -2px 0 14px; color: var(--muted, #66716b); font-size: 12px; }
.mfa-login summary { width: fit-content; padding: 8px 0; cursor: pointer; }
.mfa-login[open] summary { margin-bottom: 8px; }
.mfa-login .field, .login-panel .mfa-login label { margin-bottom: 8px; }
.mfa-login small { display: block; margin: 6px 0 0; font-size: 12px; color: var(--muted, #66716b); }
.account-mfa {
  box-sizing: border-box; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; border: 0; border-radius: 12px;
  background: var(--surface, #fff); color: var(--ink, #242b28);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  box-shadow: var(--shadow-popover, 0 14px 48px rgb(24 39 31 / 14%));
}
.account-mfa *, .account-mfa *::before, .account-mfa *::after { box-sizing: border-box; }
.account-mfa::backdrop { background: rgb(24 39 31 / 38%); }
.account-mfa > header {
  position: static; display: flex; justify-content: space-between; align-items: center;
  min-height: 64px; padding: 12px 16px 12px 24px; border-bottom: 1px solid var(--border, #e4e8e5);
}
.account-mfa h2 { margin: 0; font-size: 17px; font-weight: 600; }
.account-mfa button {
  display: inline-flex; justify-content: center; align-items: center; gap: 6px;
  min-height: 42px; margin: 0; padding: 10px 14px;
  border: 1px solid transparent; border-radius: 6px; background: var(--accent, #167653);
  color: #fff; font: inherit; font-size: 13px; font-weight: 500; line-height: 1.5; cursor: pointer;
}
.account-mfa button:hover { background: var(--accent-hover, #105f42); }
.account-mfa button:disabled { opacity: .55; cursor: default; }
.account-mfa > header button { width: 40px; height: 40px; padding: 8px; color: var(--muted, #66716b); background: transparent; }
.account-mfa > header button:hover { background: #f0f3f1; }
.account-mfa > header svg { width: 18px; height: 18px; }
.account-mfa .mfa-body { padding: 24px; }
.account-mfa p { margin: 0; }
.account-mfa .mfa-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-weight: 600; }
.account-mfa .mfa-badge { font-size: 12px; font-weight: 400; padding: 2px 8px; border-radius: 4px; color: #59665e; background: #f0f3f1; }
.account-mfa .mfa-badge.enabled { color: #146c4c; background: #edf6f0; }
.account-mfa .mfa-description { color: var(--muted, #66716b); font-size: 13px; line-height: 1.8; }
.account-mfa form { margin: 22px 0 0; padding: 0; }
.account-mfa label { display: block; margin: 0 0 18px; color: #4c5b51; font-size: 13px; font-weight: 500; }
.account-mfa input:not([type=checkbox]) {
  display: block; width: 100%; height: 44px; margin-top: 7px; padding: 10px 12px;
  border: 1px solid #cbd5ce; border-radius: 6px; background: #fff; color: var(--ink, #242b28);
  font: inherit; font-size: 16px; caret-color: var(--accent, #167653);
}
.account-mfa input::placeholder { color: #6b776f; font-size: 13px; }
.account-mfa .mfa-primary { width: 100%; }
.account-mfa .mfa-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.account-mfa .mfa-secondary { color: #424e46; background: #fff; border-color: #dce2dd; }
.account-mfa .mfa-secondary:hover { background: #f5f7f5; border-color: #bdc8c0; }
.account-mfa .mfa-danger { color: var(--danger, #aa4242); background: transparent; }
.account-mfa .mfa-danger:hover { background: #fcf1f1; }
.account-mfa .mfa-note { margin-top: 16px; font-size: 12px; color: var(--muted, #66716b); }
.account-mfa .mfa-error { margin-top: 16px; padding: 10px 12px; border-radius: 6px; color: #a43f3f; background: #fff1f1; font-size: 13px; white-space: pre-wrap; }
.account-mfa .mfa-error:empty { display: none; }
.account-mfa .mfa-qr { width: 220px; padding: 12px; margin: 18px auto; background: #fff; }
.account-mfa .mfa-qr :is(img, canvas) { max-width: 100%; }
.account-mfa details { font-size: 12px; color: var(--muted, #66716b); }
.account-mfa summary { padding: 6px 0; cursor: pointer; }
.account-mfa .mfa-secret { display: block; overflow-wrap: anywhere; margin-top: 8px; user-select: all; }
.account-mfa .mfa-codes { margin: 18px 0; padding: 14px 16px; overflow-x: auto; background: #f7f8fa; border-radius: 6px; line-height: 1.85; user-select: all; font-size: 13px; font-variant-numeric: tabular-nums; }
.account-mfa .mfa-saved { display: flex; gap: 8px; align-items: center; min-height: 44px; margin: 14px 0; font-size: 13px; font-weight: 400; }
.account-mfa input[type=checkbox] { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent, #167653); }
@media (max-width: 600px) {
  .mfa-open-button { min-width: 44px; min-height: 44px; }
  .mfa-open-button span { display: none; }
  .account-mfa .mfa-body { padding: 20px; }
  .account-mfa > header { padding-left: 20px; }
  .account-mfa button { min-height: 44px; }
  .mfa-login summary { min-height: 44px; display: list-item; padding-top: 12px; }
}
