html.account-page,
body.account-page {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body.account-page .app-wrapper {
  height: 100vh;
  overflow: hidden;
}

body.account-page .main-container {
  height: 100%;
  min-height: 0;
}

body.account-page header {
  flex-shrink: 0;
}

body.account-page .account-switcher {
  display: inline-flex;
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 40px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.account-page header.visible .account-switcher.is-ready {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.switcher-glider {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.account-switcher span {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #777;
  cursor: pointer;
  padding: 7px 18px;
  border-radius: 30px;
  transition: color 0.35s ease;
  user-select: none;
}

.account-switcher span:hover { color: #ccc; }
.account-switcher span.active { color: #eee; }

.account-main {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 8px 28px 22px;
}

.account-panel {
  position: absolute;
  inset: 8px 28px 22px;
  opacity: 0;
  transform: translateX(28px) scale(0.985);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0.55s;
}

.account-panel.is-active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.account-panel.is-leave {
  opacity: 0;
  transform: translateX(-24px) scale(0.985);
  pointer-events: none;
  visibility: hidden;
}

.acc-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  backdrop-filter: var(--blur-heavy);
  -webkit-backdrop-filter: var(--blur-heavy);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.acc-card-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.profile-grid,
.plan-grid {
  height: 100%;
  display: grid;
  gap: 16px;
  min-height: 0;
}

.profile-grid {
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
}

.plan-grid {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.identity-card,
.current-plan-card,
.profile-editor,
.plans-board {
  min-height: 0;
  height: 100%;
}

.identity-card,
.current-plan-card {
  display: flex;
  flex-direction: column;
  padding: 22px 20px 18px;
  animation: accRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.profile-editor {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 12px;
}

.plan-grid .plans-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.avatar-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 18px;
}

.avatar-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin-bottom: 14px;
}

.avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06) center/cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
}

.avatar:hover {
  transform: scale(1.04);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.avatar-edit {
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, background 0.25s ease;
}

.avatar-edit:hover {
  transform: scale(1.08);
  background: #fff;
}

.avatar-edit svg {
  width: 14px;
  height: 14px;
  stroke: #111;
}

.identity-card h1 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.identity-card .hero-email {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
}

.plan-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.usage-list {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.usage-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.25s ease, transform 0.25s ease;
}

.usage-item:hover {
  background: rgba(255, 255, 255, 0.055);
  transform: translateX(2px);
}

.usage-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
}

.usage-icon svg {
  width: 14px;
  height: 14px;
}

.usage-item span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.usage-item b {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.editor-card,
.social-card,
.password-card {
  padding: 16px 18px 14px;
  animation: accRise 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.editor-card { animation-delay: 0.06s; }
.social-card { animation-delay: 0.12s; }
.password-card { animation-delay: 0.18s; }

.usage-board {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 16px;
  animation: accRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.usage-board-head {
  margin-bottom: 14px;
}

.usage-board-head .acc-card-title {
  margin-bottom: 6px;
}

.usage-board-head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.ai-usage-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}

.ai-usage-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 4px 4px;
}

.ai-usage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-usage-row:hover {
  background: rgba(255, 255, 255, 0.055);
}

.ai-usage-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-usage-model {
  font-size: 13px;
  font-weight: 650;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-usage-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.ai-usage-credits {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.span-2 { grid-column: 1 / -1; }

.acc-field label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 6px;
  font-weight: 700;
}

.acc-field input,
.acc-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.acc-field textarea {
  min-height: 64px;
  max-height: 88px;
  resize: none;
}

.acc-field input:focus,
.acc-field textarea:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.footer-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social .mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.social .mark svg {
  width: 14px;
  height: 14px;
}

.social .acc-field {
  flex: 1;
  min-width: 0;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.password-card .hint {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 8px;
}

.acc-btn {
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 650;
  border-radius: 999px;
  white-space: nowrap;
}

a.acc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

.acc-btn-primary {
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  border: none;
}

.acc-btn-primary:hover {
  background: #fff;
  transform: scale(1.03);
}

.acc-btn-primary:disabled {
  opacity: 0.55;
  transform: none;
  cursor: wait;
}

.acc-btn-ghost {
  width: 100%;
  height: 42px;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  border: none;
  font-weight: 700;
}

a.acc-btn-ghost:hover {
  background: #fff;
  color: #111;
}

.ring-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 8px auto 16px;
}

.ring-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 9;
}

.ring-fill {
  fill: none;
  stroke: #fff;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1),
              stroke 0.4s ease;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ring-center b {
  font-size: 28px;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.ring-center span {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.current-plan-card .plan-kicker {
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.current-plan-card h2 {
  font-size: 32px;
  letter-spacing: -0.04em;
  margin: 4px 0 2px;
}

.current-plan-card .plan-price {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.credit-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

.credits-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.credits-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: inherit;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.plan-pay-hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 10px;
}

.plans-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 0 4px;
}

.plans-head h3 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.plans-head p {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
  height: 100%;
}

.plan-offer {
  position: relative;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  cursor: default;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease,
              background 0.35s ease;
  animation: accRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.plan-offer:nth-child(1) { animation-delay: 0.05s; }
.plan-offer:nth-child(2) { animation-delay: 0.1s; }
.plan-offer:nth-child(3) { animation-delay: 0.15s; }
.plan-offer:nth-child(4) { animation-delay: 0.2s; }

.plan-offer:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(40, 40, 40, 0.55);
}

.plan-offer.is-current {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 12px 32px rgba(255, 255, 255, 0.08);
}

.plan-offer.is-popular::after {
  content: attr(data-badge);
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sale-ribbon {
  position: absolute;
  top: 16px;
  right: -34px;
  width: 132px;
  padding: 5px 0;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transform: rotate(32deg);
  background: var(--sale, #ff4d6d);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  z-index: 2;
  pointer-events: none;
}

.plan-offer .offer-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
}

.plan-offer .offer-price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 6px 0 2px;
}

.plan-offer .offer-price s {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: line-through;
  letter-spacing: 0;
}

.sale-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--sale, #ff4d6d) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--sale, #ff4d6d) 38%, transparent);
  color: var(--sale, #ff4d6d);
}

.sale-banner strong {
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.sale-banner span,
.sale-banner em {
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
}

.unlimited-banner {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(134, 239, 172, 0.1);
  border: 1px solid rgba(134, 239, 172, 0.28);
  color: #86efac;
}

.unlimited-banner strong {
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.unlimited-banner span {
  font-size: 11px;
  color: #d8f5e3;
}

.plan-offer .offer-credits {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 10px;
}

.plan-offer ul {
  list-style: none;
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  flex: 1;
  min-height: 0;
}

.plan-offer li {
  font-size: 12px;
  color: #c8c8cc;
  padding-left: 14px;
  position: relative;
  line-height: 1.35;
}

.plan-offer li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.plan-offer li.feature-unlimited {
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(134, 239, 172, 0.1);
  border: 1px solid rgba(134, 239, 172, 0.28);
  color: #86efac;
  font-weight: 650;
}

.plan-offer li.feature-unlimited::before {
  display: none;
  content: none;
}

.plan-offer .offer-cta {
  height: 34px;
  font-size: 12px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.plan-offer.is-current .offer-cta {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  pointer-events: none;
}

.acc-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 20, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.acc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.acc-toast.ok { color: #34c759; }
.acc-toast.err { color: #ff5e5e; }

@keyframes accRise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .account-main,
  .account-panel { padding-left: 16px; padding-right: 16px; }
  .account-panel { inset: 8px 16px 16px; }
  .profile-grid,
  .plan-grid { grid-template-columns: 1fr 1.4fr; }
}

@media (max-width: 980px), (max-height: 740px) {
  html.account-page,
  body.account-page {
    overflow-y: auto;
    height: auto;
  }
  body.account-page .app-wrapper,
  body.account-page .main-container {
    height: auto;
    min-height: 100vh;
  }
  .account-main {
    height: auto;
    min-height: calc(100vh - 78px);
  }
  .account-panel {
    position: relative;
    inset: auto;
    display: none;
    min-height: 640px;
  }
  .account-panel.is-active { display: block; }
  .profile-grid,
  .plan-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .identity-card,
  .current-plan-card,
  .profile-editor,
  .usage-board {
    height: auto;
  }
  .usage-board .ai-usage-list {
    min-height: 360px;
    max-height: none;
  }
  .plans-grid { height: auto; }
  .password-row { grid-template-columns: 1fr 1fr; }
  .password-row .acc-btn { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .form-grid,
  .social-grid,
  .plans-grid { grid-template-columns: 1fr; }
  .account-switcher span { padding: 7px 14px; font-size: 12px; }
}
