.account-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 24px 68px;
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}

.account-kicker {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 12px;
  padding: 7px 11px;
  text-transform: uppercase;
}

.account-hero h1 {
  color: #f8fafc;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  margin: 0 0 12px;
}

.account-hero p,
.account-panel p {
  color: var(--text-secondary);
  line-height: 1.65;
}

.account-hero p {
  max-width: 660px;
  font-size: 16px;
  margin: 0;
}

.account-hero-card {
  min-width: 190px;
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(59, 130, 246, 0.08)),
    rgba(10, 16, 30, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  padding: 18px;
}

.account-hero-card span {
  display: block;
  color: #86efac;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.account-hero-card strong {
  color: #ffffff;
  font-size: 20px;
}

.account-grid,
.member-layout {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.account-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.member-layout {
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
}

.member-layout .danger-panel {
  grid-column: 1 / -1;
}

.member-layout[hidden],
.cloud-panel[hidden],
.migration-panel[hidden],
.account-grid[hidden] {
  display: none !important;
}

body.account-loading #guestPanel,
body.account-authenticated #guestPanel {
  display: none !important;
}

.account-panel,
.account-status {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 13, 24, 0.92)),
    rgba(10, 16, 30, 0.9);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.18);
}

.account-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
}

.account-status {
  min-height: 0;
  margin-bottom: 18px;
  color: #cbd5e1;
  padding: 14px 16px;
}

.account-status:empty {
  display: none;
}

.account-status.success {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.1);
  color: #bbf7d0;
}

.account-status.error {
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
}

.account-status.info {
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(96, 165, 250, 0.1);
  color: #bfdbfe;
}

.panel-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 4px;
}

.panel-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  font-weight: 950;
}

.danger-icon {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.account-panel h2 {
  color: #f8fafc;
  font-size: 21px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.account-panel p {
  margin: 0;
}

.account-panel label {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
}

.account-panel input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font: inherit;
  outline: none;
  padding: 12px 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.account-panel input::placeholder {
  color: #64748b;
}

.account-panel input:focus {
  border-color: rgba(34, 197, 94, 0.58);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
  background: rgba(15, 23, 42, 0.96);
}

.account-panel button {
  min-height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 11px 14px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.account-panel button:hover {
  transform: translateY(-1px);
}

.primary-action {
  border: 1px solid rgba(34, 197, 94, 0.44);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(20, 184, 166, 0.9));
  color: #03130a;
}

.secondary-action {
  border: 1px solid rgba(96, 165, 250, 0.32) !important;
  background: rgba(96, 165, 250, 0.1) !important;
  color: #bfdbfe !important;
}

.text-action {
  width: fit-content;
  min-height: 34px !important;
  border: 0 !important;
  background: transparent !important;
  color: #93c5fd !important;
  padding: 4px 0 !important;
}

.profile-email,
.verification-state {
  border-radius: 12px;
  font-weight: 900;
  padding: 11px 13px;
}

.profile-email {
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(96, 165, 250, 0.1);
  color: #bfdbfe !important;
  word-break: break-word;
}

.verification-state.is-ok {
  border: 1px solid rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
  color: #bbf7d0;
}

.verification-state.is-warning {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
}

.danger-panel {
  border-color: rgba(239, 68, 68, 0.24);
  background:
    linear-gradient(180deg, rgba(30, 15, 18, 0.9), rgba(12, 10, 14, 0.92)),
    rgba(10, 16, 30, 0.9);
}

.danger-panel h2 {
  color: #fecaca;
}

.danger-action {
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  background: rgba(239, 68, 68, 0.14) !important;
  color: #fecaca !important;
}

.captcha-slot {
  margin: 2px 0 4px;
  min-height: 0;
}

.captcha-slot.is-enabled {
  min-height: 65px;
}

.cloud-panel {
  margin-top: 4px;
}

.migration-panel {
  border-color: rgba(34, 197, 94, 0.34);
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(59, 130, 246, 0.08)),
    rgba(10, 16, 30, 0.9);
  margin-bottom: 18px;
}

.panel-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

#remote-output {
  min-height: 82px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.52);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.55;
  margin: 4px 0 0;
  padding: 14px;
  white-space: pre-wrap;
}

.sync-diagnostics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.sync-diagnostics div {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.34);
  padding: 11px 12px;
}

.sync-diagnostics span,
.sync-diagnostics strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-diagnostics span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sync-diagnostics strong {
  color: #f8fafc;
  font-size: 13px;
  margin-top: 5px;
}

.sync-history {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.sync-history[hidden] {
  display: none;
}

.sync-history-empty,
.sync-history-item {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.34);
  margin: 0;
  padding: 12px;
}

.sync-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sync-history-item strong {
  display: block;
  color: #f8fafc;
  font-size: 14px;
}

.sync-history-item span {
  color: #94a3b8;
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

body.light-mode .account-hero h1,
body.light-mode .account-panel h2 {
  color: #0f172a;
}

body.light-mode .account-hero-card,
body.light-mode .account-panel,
body.light-mode .account-status {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

body.light-mode .account-hero-card strong,
body.light-mode .account-panel label {
  color: #0f172a;
}

body.light-mode .account-panel input,
body.light-mode #remote-output,
body.light-mode .sync-diagnostics div,
body.light-mode .sync-history-empty,
body.light-mode .sync-history-item {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
}

body.light-mode .profile-email {
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.08);
}

body.light-mode .danger-panel {
  background: rgba(255, 255, 255, 0.92);
}

@media (max-width: 900px) {
  .account-hero,
  .account-grid,
  .member-layout {
    grid-template-columns: 1fr;
  }

  .account-hero-card {
    display: none;
  }

  .panel-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sync-diagnostics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .account-shell {
    padding: 24px 14px 54px;
  }

  .account-panel {
    border-radius: 14px;
    padding: 18px;
  }

  .panel-head {
    grid-template-columns: 1fr;
  }

  .panel-icon {
    width: 38px;
    height: 38px;
  }

  .panel-actions {
    grid-template-columns: 1fr;
  }

  .sync-diagnostics {
    grid-template-columns: 1fr;
  }
}
