.account-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(14px);
}

.account-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--studio-border, var(--line));
  border-radius: 18px;
  color: var(--studio-text, var(--ink));
  background: var(--studio-surface-raised, var(--soft-surface-strong));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

.account-dialog header,
.account-dialog-body {
  padding: 22px;
}

.account-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--studio-border, var(--line));
}

.account-dialog h2,
.account-dialog h3,
.account-dialog p {
  margin-top: 0;
}

.account-dialog h2 {
  margin-bottom: 4px;
  font-size: 1.35rem;
}

.account-dialog .account-muted,
.account-dialog small {
  color: var(--studio-muted, var(--muted));
}

.account-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--studio-border, var(--line));
  border-radius: 50%;
  color: inherit;
  background: var(--studio-surface-soft, var(--soft-surface));
}

.account-forms,
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-card {
  padding: 18px;
  border: 1px solid var(--studio-border, var(--line));
  border-radius: 14px;
  background: var(--studio-surface-soft, var(--soft-surface));
}

.account-form {
  display: grid;
  gap: 12px;
}

.account-form label {
  display: grid;
  gap: 6px;
  color: var(--studio-muted, var(--muted));
  font-size: 0.86rem;
}

.account-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--studio-border, var(--line));
  border-radius: 10px;
  color: var(--studio-text, var(--ink));
  background: var(--studio-surface-raised, var(--soft-surface-strong));
}

.account-form .account-consent {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}

.account-consent input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.account-dialog a {
  color: var(--studio-accent, var(--blue));
}

.account-error,
.account-success,
.account-notice {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 10px;
}

.account-error {
  border: 1px solid rgba(215, 75, 85, 0.42);
  color: #ff9aa2;
  background: rgba(215, 75, 85, 0.12);
}

.account-success {
  border: 1px solid rgba(35, 174, 124, 0.35);
  color: #74d7ad;
  background: rgba(35, 174, 124, 0.12);
}

.account-notice {
  border: 1px solid var(--studio-border, var(--line));
  color: var(--studio-muted, var(--muted));
  background: var(--studio-surface, var(--soft-surface));
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.account-summary div {
  padding: 10px;
  border-radius: 10px;
  background: var(--studio-surface-raised, var(--soft-surface-strong));
}

.account-summary strong,
.account-summary span {
  display: block;
}

.account-entitlement-table {
  display: grid;
  gap: 0;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--studio-border, var(--line));
  border-radius: 12px;
}

.account-entitlement-table > div {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1.2fr;
}

.account-entitlement-table > div + div {
  border-top: 1px solid var(--studio-border, var(--line));
}

.account-entitlement-table span,
.account-entitlement-table strong {
  padding: 10px;
  font-size: .82rem;
}

.account-entitlement-table span + span,
.account-entitlement-table strong + strong {
  border-left: 1px solid var(--studio-border, var(--line));
}

.account-summary span {
  margin-top: 4px;
  color: var(--studio-muted, var(--muted));
  font-size: 0.78rem;
}

@media (max-width: 700px) {
  .account-overlay { padding: 10px; }
  .account-dialog { max-height: calc(100vh - 20px); }
  .account-forms,
  .account-grid { grid-template-columns: 1fr; }
  .account-summary { grid-template-columns: 1fr; }
  .account-entitlement-table { overflow-x: auto; }
  .account-entitlement-table > div { min-width: 620px; }
}

.platform-error-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1400;
  width: min(380px, calc(100vw - 36px));
  padding: 13px 15px;
  border: 1px solid rgba(215, 75, 85, 0.42);
  border-radius: 12px;
  color: #fff;
  background: rgba(88, 22, 31, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.platform-image-fallback {
  display: inline-grid;
  min-width: 72px;
  min-height: 48px;
  place-items: center;
  padding: 8px;
  border: 1px dashed var(--studio-border, currentColor);
  border-radius: 10px;
  color: var(--studio-muted, #8a91a3);
  font-size: 12px;
  text-align: center;
}
