.account-panel[hidden] {
  display: none !important;
}

.account-panel {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: start center;
  padding: 72px 16px 24px;
  background: rgba(7, 24, 74, 0.38);
  backdrop-filter: blur(4px);
}

.account-panel-card {
  width: min(440px, 100%);
  max-height: min(82vh, 640px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow-2, 0 18px 40px rgba(15, 23, 42, 0.12));
}

.account-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fbff;
}

.account-panel-head h2 {
  margin: 0;
  font-size: var(--type-title);
  font-weight: 800;
  color: var(--navy);
}

.account-panel-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: var(--type-title);
  line-height: 1;
  cursor: pointer;
}

.account-panel-body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 14px;
}

.account-field {
  display: grid;
  gap: 6px;
}

.account-field > span {
  font-size: var(--type-meta);
  font-weight: 700;
  color: var(--muted);
}

.account-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-size: var(--type-meta);
}

.account-field input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(18, 96, 255, 0.12);
  background: #fff;
}

.account-field input:disabled {
  background: #eef3fb;
  color: var(--muted);
  cursor: not-allowed;
}

.account-section-label {
  margin: 4px 0 0;
  font-size: var(--type-meta);
  font-weight: 800;
  color: var(--navy);
}

.theme-switch-row {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f8fbff;
}

html[data-theme="dark"] .theme-switch-row {
  background: #1a2840;
  border-color: #2a3f5f;
}

.theme-switch-row > span:first-child {
  font-size: var(--type-meta);
  font-weight: 700;
  color: var(--muted);
}

.ui-theme-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.theme-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.theme-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon.is-active {
  color: #f59e0b;
  transform: scale(1.08);
}

html[data-theme="dark"] .theme-icon.moon.is-active {
  color: #93c5fd;
}

.theme-switch-track {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.theme-switch-track input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch-thumb {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}

.theme-switch-thumb::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.theme-switch-track input:checked + .theme-switch-thumb {
  background: #3b82f6;
}

.theme-switch-track input:checked + .theme-switch-thumb::after {
  transform: translateX(24px);
}

.account-panel-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}

.account-btn-primary {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: var(--type-body);
  font-weight: 700;
  cursor: pointer;
}

.account-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.account-btn-ghost {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: var(--type-body);
  font-weight: 700;
  cursor: pointer;
}

html[data-theme="dark"] .account-btn-ghost {
  background: linear-gradient(180deg, rgba(42, 62, 98, 0.95), rgba(22, 36, 60, 0.98));
  border-color: rgba(147, 197, 253, 0.42);
  color: #f0f6ff;
  -webkit-text-fill-color: #f0f6ff;
}

html[data-theme="dark"] .account-btn-ghost:hover {
  color: #fff;
  -webkit-text-fill-color: #fff;
  border-color: rgba(255, 154, 92, 0.65);
}

html[data-theme="dark"] .account-btn-primary {
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.account-status {
  min-height: 20px;
  font-size: var(--type-meta);
  font-weight: 600;
  color: var(--muted);
}

.account-status.is-error {
  color: #ef4444;
}

.account-status.is-success {
  color: #16a34a;
}

.theme-icon.moon svg path {
  fill: currentColor;
  stroke: none;
}
