.account-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 3px 4px 3px 3px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
}
.account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
}
.account-avatar--initial {
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-2, var(--accent)));
}
.account-email {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}
.quota-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.quota-chip.is-full {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}
@media (max-width: 1180px) {
  .account-email {
    display: none;
  }
}
@media (max-width: 720px) {
  .account-signout span,
  .account-signin span {
    display: none;
  }
}
body.auth-open {
  overflow: hidden;
}
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.auth-modal.is-open {
  opacity: 1;
}
.auth-modal[hidden] {
  display: none;
}
.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.auth-modal__sheet {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 28px 28px 22px;
  border-radius: var(--radius-lg, 18px);
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--border-strong, var(--border));
  box-shadow:
    var(--shadow-lift),
    0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent),
    0 30px 80px -20px var(--accent-glow, rgba(99,102,241,.35));
  transform: translateY(10px) scale(0.985);
  transition: transform 0.25s var(--ease, ease);
}
.auth-modal.is-open .auth-modal__sheet {
  transform: none;
}
.auth-modal__sheet::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(
      90deg,
      var(--accent),
      var(--accent-2, var(--accent)));
}
.auth-modal__x {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
}
.auth-head {
  text-align: center;
  margin-bottom: 18px;
}
.auth-badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 10px;
  color: #fff;
  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-2, var(--accent)));
  box-shadow: 0 10px 26px var(--accent-glow, rgba(99,102,241,.35));
}
.auth-badge svg {
  width: 22px;
  height: 22px;
}
.auth-head h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.32rem;
  letter-spacing: -0.01em;
}
.auth-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.auth-form {
  display: grid;
  gap: 12px;
}
.auth-field {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.auth-input-wrap {
  position: relative;
  display: block;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border-strong, var(--border));
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input[type=password],
.auth-input-wrap input[data-shown] {
  padding-inline-end: 42px;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.auth-eye {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}
.auth-eye:hover {
  color: var(--accent);
}
.auth-eye svg {
  width: 17px;
  height: 17px;
}
.auth-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}
.auth-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--accent);
  cursor: pointer;
}
.auth-link:hover {
  text-decoration: underline;
}
.auth-primary {
  width: 100%;
  padding: 11px 16px;
  font-size: 0.92rem;
  margin-top: 4px;
}
.auth-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.auth-actions .btn {
  flex: 1;
}
.auth-hint {
  margin: -2px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}
.auth-error {
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}
.auth-error[hidden] {
  display: none;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--muted-2, var(--muted));
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-google {
  display: flex;
  justify-content: center;
  min-height: 44px;
}
.auth-foot {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.auth-label {
  margin: 6px 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.auth-tpl-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.auth-tpl-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  background: var(--chip-bg);
  border: 1px solid var(--border);
}
.auth-tpl-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.auth-tpl-link svg {
  width: 16px;
  height: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .auth-modal,
  .auth-modal__sheet {
    transition: none;
  }
}
.account-profile {
  flex: 0 0 auto;
}
body[data-page=profile] .account-profile {
  display: none;
}
.profile-intro {
  border: 1px solid var(--accent, #6366f1);
  border-color: color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
  background: color-mix(in srgb, var(--accent, #6366f1) 8%, transparent);
}
.profile-intro p {
  margin: 6px 0 0;
}
.profile-status {
  font-size: 12.5px;
  opacity: .8;
  font-weight: 600;
}
.profile-bar__hint {
  font-size: 12.5px;
  opacity: .75;
  margin-left: 6px;
}
.export-bar .btn[disabled] {
  opacity: .6;
  cursor: progress;
}
@media (max-width: 760px) {
  .profile-bar__hint {
    display: none;
  }
}
