#qw-account {
  --paper: #faf7ee;
  --ink: #293b31;
  --muted: #68756a;
  --line: #dce1d4;
  --gold: #c19b53;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #10271db8;
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", "Leelawadee UI", sans-serif;
  color-scheme: light;
}
#qw-account *, #qw-account *::before, #qw-account *::after { box-sizing: border-box; }
#qw-account[hidden] { display: none !important; }
#qw-account [hidden] { display: none !important; }
#qw-account button { font: inherit; cursor: pointer; color: inherit; }
#qw-account button:disabled { opacity: .5; cursor: default; }
#qw-account button:focus-visible { outline: 2px solid #a77c34; outline-offset: 4px; }
#qw-account .account-panel {
  width: min(100%, 480px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 30px;
  border: 1px solid #eee7d5;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 24px 90px #061a1840;
}
#qw-account .account-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
#qw-account .account-brand { margin: 0 0 5px; color: #8f784e; font-size: 10px; font-weight: 650; letter-spacing: .2em; }
#qw-account h2 { margin: 0; font-size: 24px; font-weight: 650; line-height: 1.3; letter-spacing: -.025em; }
#qw-account .account-close {
  display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: #e9ebdf; color: #66715f;
}
#qw-account .account-close:hover { background: #dfe4d7; }
#qw-account .account-close svg { width: 15px; height: 15px; }
#qw-account .account-character { display: flex; align-items: center; gap: 17px; margin: 28px 0; }
#qw-account .account-portrait {
  width: 74px; height: 74px; flex: 0 0 74px; overflow: hidden;
  border-radius: 50%; border: 1px solid #dedbc8; background: #e7e4d6;
}
#qw-account .account-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
#qw-account .account-character-copy { min-width: 0; }
#qw-account .account-label { margin: 0 0 2px; font-size: 12px; color: var(--muted); }
#qw-account .account-name { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
#qw-account .account-setup-hint { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
#qw-account .account-providers { display: grid; gap: 12px; }
#qw-account .account-provider {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px;
  padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f0f2e9;
}
#qw-account .account-provider-info { min-width: 0; }
#qw-account .account-provider-controls { display: grid; align-content: start; justify-items: end; gap: 10px; padding-top: 4px; }
#qw-account .account-provider-top { display: flex; align-items: center; gap: 11px; }
#qw-account .account-google-mark {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  border-radius: 10px; background: #fff; border: 1px solid #e2e5db;
}
#qw-account .account-google-mark svg { width: 18px; height: 18px; }
#qw-account .account-provider-title { font-size: 14px; font-weight: 600; }
#qw-account .account-connected {
  display: inline-flex; align-items: center; gap: 5px;
  color: #3d6850; background: #e2ebde; border-radius: 20px;
  padding: 3px 8px; font-size: 11px; font-weight: 550; white-space: nowrap;
}
#qw-account .account-connected svg { width: 12px; height: 12px; }
#qw-account .account-email { margin: 13px 0 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; user-select: text; }
#qw-account .account-email-muted { color: var(--muted); font-size: 13px; font-weight: 400; }
#qw-account .account-provider-actions { text-align: right; }
#qw-account .account-note { margin: 18px 0 0; color: var(--muted); font-size: 13px; }
#qw-account .account-note:empty { display: none; }
#qw-account .account-actions { display: grid; gap: 10px; margin-top: 24px; }
#qw-account .account-button {
  width: 100%; padding: 11px 16px; border: 1px solid #cbd3c3; border-radius: 10px;
  background: transparent; font-weight: 550; transition: background .12s;
}
#qw-account .account-button:hover { background: #e9ede1; }
#qw-account .account-primary { background: #c4a15f; color: #28362c; border-color: #ba9656; }
#qw-account .account-primary:hover { background: #d0b071; }
#qw-account .account-danger { background: #9f4f3b; border-color: #9f4f3b; color: #fff8ee; }
#qw-account .account-danger:hover { background: #8e4534; }
#qw-account .account-unlink { border: 0; padding: 0; background: transparent; color: #8c5b4b; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
#qw-account .account-unlink:disabled { text-decoration: none; }
#qw-account .account-recovery-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
#qw-account .account-status { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; color: #86513b; background: #f1e7dc; font-size: 13px; }
#qw-account .account-status[data-tone="working"] { color: var(--muted); background: #edf0e5; }
#qw-account .account-done { margin-top: 12px; }
@media (max-width: 520px) {
  #qw-account { padding: 16px; }
  #qw-account .account-panel { padding: 24px; max-height: calc(100dvh - 32px); border-radius: 20px; }
  #qw-account .account-character { margin: 24px 0; gap: 14px; }
  #qw-account .account-name { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { #qw-account .account-button { transition: none; } }

/* Settings owns the frame and navigation; this region only renders its content. */
#qw-account.account-embedded {
  inset: auto; display: block; padding: 0; background: transparent;
  visibility: hidden; overflow: hidden;
  --ink: #312922; --muted: #806e59; --line: #dfceb5;
}
#qw-account.account-embedded .account-panel {
  position: absolute; left: 0; top: 0; transform-origin: top left;
  max-height: none; padding: 4px 2px 14px; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; overscroll-behavior: contain;
}
#qw-account.account-embedded .account-header,
#qw-account.account-embedded .account-done { display: none; }
#qw-account.account-embedded .account-character { margin: 16px 0 24px; }
#qw-account.account-embedded .account-provider { background: #f0e5d2; }
