.account-drawer, .account-drawer[open] {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(820px, calc(100vw - 48px));
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid #d9e4da;
  border-radius: 20px 0 0 20px;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  box-shadow: -12px 0 48px #183a2621;
  transition: transform .26s ease, opacity .26s ease, display .26s allow-discrete, overlay .26s allow-discrete;
}
.account-drawer { transform: translateX(100%); opacity: 0; }
.account-drawer[open] { display: flex; flex-direction: column; transform: translateX(0); opacity: 1; }
.account-drawer::backdrop {
  background: #183a2600;
  backdrop-filter: blur(2px);
  transition: background .26s ease, display .26s allow-discrete, overlay .26s allow-discrete;
}
.account-drawer[open]::backdrop { background: #183a263d; }
@starting-style {
  .account-drawer[open] { transform: translateX(100%); opacity: 0; }
  .account-drawer[open]::backdrop { background: #183a2600; }
}
body:has(.account-drawer[open]) { overflow: hidden; }
.account-drawer .workspace-dialog-head { padding: 26px 28px 22px; background: #fff; }
.account-drawer .workspace-dialog-head strong { font-size: 24px; }
.account-drawer .drawer-close { display: grid; place-items: center; width: 34px; height: 34px; margin-top: 2px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #f7f9f5; color: var(--ink-soft); }
.account-drawer .drawer-close:hover { color: var(--forest); background: var(--sage-50); }
.drawer-close svg { width: 16px; height: 16px; }
.account-drawer .credit-scroll-area { padding: 24px 28px; }
.credit-dialog .credit-overview section { padding: 18px; }
.credit-dialog .credit-task-row { gap: 12px; }
.profile-drawer, .profile-drawer[open] { width: min(460px, calc(100vw - 24px)); }
.profile-scroll-area { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px; }
.profile-identity { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; padding: 22px 20px; border: 1px solid #deeadf; border-radius: 14px; background: linear-gradient(115deg, #edf5ed, #f9fbf7); }
.profile-avatar { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--studio-gradient); box-shadow: 0 3px 12px #23584218; font-size: 22px; font-weight: 600; }
.profile-identity > div { min-width: 0; }
.profile-identity strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.profile-identity small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.profile-section-heading { margin: 0 0 18px; font-size: 14px; }
.profile-nickname { display: block; }
.profile-field-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: 12px; color: var(--ink-soft); }
.profile-field-label small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.profile-field-label .is-invalid { color: var(--danger); }
.profile-nickname input { width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: #fff; font-size: 14px; }
.profile-nickname input:disabled { background: #f7f9f5; }
.profile-field-hint { margin: 8px 0 26px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.profile-facts { margin: 0; }
.profile-facts > div { padding: 17px 0; border-top: 1px solid var(--line); }
.profile-facts dt { color: var(--muted); font-size: 12px; }
.profile-facts dd { margin: 7px 0 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.profile-footer { flex: none; padding: 16px 28px max(24px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: #fff; }
.profile-footer .primary-button { width: 100%; }
.profile-message { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.profile-message:empty { display: none; }
.profile-message[data-kind="error"] { color: var(--danger); }
.profile-message[data-kind="success"] { color: var(--sage-700); }
#retryProfileButton { margin: 0 0 12px; }
.user-session .profile-entry { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; border-radius: 9px; color: var(--ink-soft); }
.user-session .profile-entry svg { width: 17px; height: 17px; flex: none; }
.user-session .profile-entry:hover { color: var(--sage-700); background: #e6eee3; }
.user-session .profile-entry:hover span { color: inherit; }
@media (max-width: 700px) {
  .account-drawer, .account-drawer[open] { width: 100vw; border-radius: 0; border-left: 0; }
  .account-drawer .workspace-dialog-head { padding: 22px 20px 18px; }
  .account-drawer .credit-scroll-area, .profile-scroll-area { padding: 20px; }
  .profile-footer { padding: 16px 20px max(20px, env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 560px) {
  .app-shell .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .app-shell .brand-lockup { grid-column: 1 / -1; grid-row: 1; }
  .app-shell .topbar-navigation { grid-column: 1; grid-row: 2; gap: 6px; }
  .app-shell .topbar-actions { grid-column: 2; grid-row: 2; gap: 3px; }
  .app-shell .topbar-tool { padding: 7px 8px; font-size: 11px; }
  .app-shell .credits-entry { padding: 7px; font-size: 11px; }
  .app-shell .credits-entry b { display: none; }
  .app-shell .user-session { gap: 0; padding-left: 0; }
  .app-shell .user-session button { padding: 7px 6px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .account-drawer, .account-drawer[open], .account-drawer::backdrop { transition: none; }
}
