.codex-account-panel {
  max-width: 620px;
  background:
    radial-gradient(circle at 90% 8%, rgba(129, 92, 246, .13), transparent 34%),
    radial-gradient(circle at 8% 62%, rgba(38, 193, 174, .12), transparent 34%),
    var(--panel, #f8faff);
}

.codex-account-intro {
  margin: -4px 2px 18px;
  color: var(--muted, #8390a5);
  font-size: 13px;
}

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

.codex-account-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(133, 153, 184, .15);
  border-radius: 22px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 12px 35px rgba(45, 65, 100, .07);
}

.codex-account-card > .codex-account-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  font-weight: 750;
  background: linear-gradient(145deg, #1b5472, #19a99b);
}

.codex-account-card.xuanyu > .codex-account-avatar {
  background: linear-gradient(145deg, #7c3aed, #2d87e7);
}

.codex-account-identity {
  min-width: 0;
}

.codex-account-card strong,
.codex-account-card small {
  display: block;
}

.codex-account-card strong {
  color: var(--ink, #132138);
  font-size: 15px;
}

.codex-account-card small {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted, #8390a5);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-account-card button,
.codex-login-flow button {
  border: 0;
  border-radius: 14px;
  font: 650 12px/1 system-ui, sans-serif;
}

.codex-account-card button {
  min-width: 0;
  min-height: 40px;
  padding: 0 15px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #287ee6);
  box-shadow: 0 7px 20px rgba(96, 71, 225, .25);
  white-space: nowrap;
  writing-mode: horizontal-tb;
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.codex-account-card button:active { transform: scale(.975); }

.codex-account-card button.new-chat {
  color: #176d64;
  background: rgba(42, 190, 167, .12);
  box-shadow: none;
}

.codex-account-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(133, 153, 184, .13);
}

.codex-account-card button.relogin {
  color: #6842bf;
  background: rgba(124, 58, 237, .1);
  box-shadow: none;
}

.codex-account-card button.login {
  color: #fff;
  background: linear-gradient(135deg, #7654ec, #3181ec);
}

@media (max-width: 430px) {
  .codex-account-card { grid-template-columns: 44px minmax(0, 1fr); }
  .codex-account-card > .codex-account-avatar { width: 44px; height: 44px; border-radius: 15px; }
  .codex-account-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .codex-account-actions > :only-child { grid-column: 1 / -1; }
}

.codex-login-flow {
  margin-top: 14px;
  padding: 19px;
  border: 1px solid rgba(129, 92, 246, .2);
  border-radius: 24px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 18px 50px rgba(82, 56, 176, .12);
}

.codex-login-flow[hidden] {
  display: none;
}

.codex-login-flow > strong,
.codex-login-flow > p,
.codex-login-flow > small {
  display: block;
}

.codex-login-kicker {
  color: #7253d8;
  font: 750 9px/1 system-ui, sans-serif;
  letter-spacing: .16em;
}

.codex-login-flow > strong {
  margin-top: 9px;
  color: var(--ink, #132138);
}

.codex-login-flow > p,
.codex-login-flow > small {
  color: var(--muted, #8390a5);
  font: 400 11px/1.6 system-ui, sans-serif;
}

.codex-device-code {
  display: flex;
  width: 100%;
  margin: 15px 0;
  padding: 15px;
  align-items: center;
  justify-content: space-between;
  color: #3d2b79;
  background: rgba(120, 86, 218, .09);
}

.codex-device-code code {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .12em;
}

.codex-device-code small {
  color: #8068c6;
  font-size: 10px;
}

.codex-login-flow > div {
  display: flex;
  gap: 9px;
  margin-bottom: 11px;
}

.codex-login-flow > div button {
  min-height: 42px;
  padding: 0 16px;
  color: #647086;
  background: rgba(117, 132, 158, .1);
}

.codex-login-flow > div .codex-login-primary {
  flex: 1;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #2387e8);
  box-shadow: 0 8px 24px rgba(90, 72, 220, .25);
}

:root[data-theme="dark"] .codex-account-panel {
  --panel: #0d1626;
}

:root[data-theme="dark"] .codex-account-card,
:root[data-theme="dark"] .codex-login-flow {
  background: rgba(20, 31, 50, .82);
}

:root[data-theme="dark"] .codex-account-actions {
  border-top-color: rgba(255, 255, 255, .09);
}

@media (min-width: 520px) {
  .codex-account-card { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .codex-account-actions {
    grid-column: auto;
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .codex-account-panel {
    max-width: 680px;
    padding-top: 20px;
  }

  .codex-account-list {
    grid-template-columns: 1fr 1fr;
  }

  .codex-login-flow {
    margin-top: 10px;
    padding: 14px 17px;
  }
}
