/* First-login appearance chooser. Kept visually neutral so every theme is judged fairly. */
.appearance-onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 22000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.appearance-onboarding-modal .modal-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.28), transparent 38%),
    rgba(9, 15, 22, 0.68);
  backdrop-filter: blur(16px) saturate(0.82);
  -webkit-backdrop-filter: blur(16px) saturate(0.82);
}

.appearance-onboarding-dialog {
  --appearance-ink: #111923;
  --appearance-muted: #5d6a78;
  --appearance-line: rgba(91, 108, 124, 0.24);
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 32px;
  color: var(--appearance-ink);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  background:
    linear-gradient(118deg, rgba(220, 226, 231, 0.98) 0%, rgba(255, 255, 255, 0.99) 18%, rgba(237, 241, 244, 0.99) 38%, rgba(203, 211, 218, 0.97) 51%, rgba(255, 255, 255, 0.99) 72%, rgba(225, 230, 234, 0.98) 100%);
  box-shadow:
    0 38px 90px rgba(5, 10, 16, 0.34),
    0 10px 28px rgba(21, 34, 45, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(81, 99, 115, 0.18);
  animation: appearanceDialogEnter 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.appearance-onboarding-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, 0.72) 36%, transparent 52%);
  opacity: 0.48;
}

.appearance-onboarding-header,
.appearance-choice-grid,
.appearance-onboarding-selection,
.appearance-default-check,
.appearance-onboarding-note,
.appearance-onboarding-actions {
  position: relative;
  z-index: 1;
}

.appearance-onboarding-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.appearance-onboarding-icon {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 17px;
  background: linear-gradient(145deg, #263341, #0f1720);
  box-shadow: 0 10px 20px rgba(16, 27, 37, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.appearance-onboarding-icon .material-icons-round { font-size: 27px; }

.appearance-onboarding-eyebrow {
  display: block;
  margin: 1px 0 5px;
  color: #536475;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.appearance-onboarding-header h2 {
  margin: 0;
  color: var(--appearance-ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.appearance-onboarding-header p {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--appearance-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.appearance-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.appearance-choice {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr 25px;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 12px;
  overflow: hidden;
  text-align: left;
  color: var(--appearance-ink);
  border: 1px solid rgba(91, 108, 124, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 5px 12px rgba(38, 54, 68, 0.06);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.appearance-choice:hover {
  transform: translateY(-2px);
  border-color: rgba(43, 61, 77, 0.48);
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px rgba(32, 47, 61, 0.13);
}

.appearance-choice:focus-visible {
  outline: 3px solid rgba(37, 122, 224, 0.3);
  outline-offset: 2px;
}

.appearance-choice.active {
  border-color: #26394b;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px #26394b, 0 12px 28px rgba(25, 41, 55, 0.16);
}

.appearance-choice-preview {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(22, 31, 40, 0.12), 0 7px 14px rgba(23, 36, 48, 0.18);
}

.appearance-choice-preview::after {
  content: "";
  position: absolute;
  inset: -25% 35% -25% -10%;
  transform: skewX(-16deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
}

.appearance-choice-preview i {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.25);
}

.appearance-choice-preview-blue { background: radial-gradient(circle at 70% 20%, #9b4dff, #15101d 45%, #030304 80%); }
.appearance-choice-preview-blue i { background: #9b4dff; }
.appearance-choice-preview-green { background: radial-gradient(circle at 70% 20%, #34d399, #0b241a 45%, #020806 80%); }
.appearance-choice-preview-green i { background: #34d399; }
.appearance-choice-preview-gold { background: radial-gradient(circle at 70% 20%, #f5b72f, #291b05 45%, #080601 80%); }
.appearance-choice-preview-gold i { background: #f5b72f; }
.appearance-choice-preview-white { background: linear-gradient(145deg, #e5eaee, #fff 52%, #d9e0e5); }
.appearance-choice-preview-white i { background: #71808f; }
.appearance-choice-preview-metallic-white { background: linear-gradient(118deg, #bbc5cc 0%, #fff 22%, #d6dde2 43%, #fff 62%, #aebac3 82%, #fff); }
.appearance-choice-preview-metallic-white i { background: #40566a; }
.appearance-choice-preview-metallic-pink { background: linear-gradient(118deg, #dbaabd 0%, #fff 22%, #f0cfdd 43%, #fff 62%, #cf87a3 82%, #fff); }
.appearance-choice-preview-metallic-pink i { background: #bd4f7d; }

.appearance-choice-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.appearance-choice-copy strong { color: #121c26; font-size: 0.91rem; line-height: 1.1; }
.appearance-choice-copy small { color: #687684; font-size: 0.71rem; line-height: 1.25; }

.appearance-choice-check {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: transparent;
  border: 1px solid rgba(72, 90, 106, 0.3);
  border-radius: 50%;
  font-size: 15px;
  transition: 180ms ease;
}

.appearance-choice.active .appearance-choice-check {
  color: #fff;
  border-color: #1f3446;
  background: #1f3446;
}

.appearance-official-badge {
  position: absolute;
  top: 7px;
  right: 9px;
  padding: 3px 6px;
  color: #fff;
  border-radius: 999px;
  background: #26394b;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.appearance-choice:has(.appearance-official-badge) .appearance-choice-check { margin-top: 20px; }

.appearance-onboarding-selection {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  color: #445565;
  font-size: 0.8rem;
}

.appearance-onboarding-selection .material-icons-round { font-size: 17px; }
.appearance-onboarding-selection strong { color: #182633; }

.appearance-default-check {
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--appearance-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.appearance-default-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.appearance-default-checkbox {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: transparent;
  border: 1px solid #8896a3;
  border-radius: 8px;
  background: #fff;
  transition: 160ms ease;
}

.appearance-default-checkbox .material-icons-round { font-size: 17px; }

.appearance-default-check input:checked + .appearance-default-checkbox {
  color: #fff;
  border-color: #203445;
  background: #203445;
  box-shadow: 0 6px 14px rgba(32, 52, 69, 0.23);
}

.appearance-default-check input:focus-visible + .appearance-default-checkbox {
  outline: 3px solid rgba(37, 122, 224, 0.3);
  outline-offset: 2px;
}

.appearance-default-copy { display: flex; flex-direction: column; gap: 3px; }
.appearance-default-copy strong { color: #17232e; font-size: 0.9rem; }
.appearance-default-copy small { color: #657382; font-size: 0.73rem; line-height: 1.35; }

.appearance-onboarding-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 2px 0;
  color: #596978;
  font-size: 0.72rem;
  line-height: 1.45;
}

.appearance-onboarding-note .material-icons-round { margin-top: 1px; font-size: 15px; }
.appearance-onboarding-note strong { color: #273746; }

.appearance-onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.appearance-onboarding-official,
.appearance-onboarding-confirm {
  min-height: 46px;
  padding: 0 19px;
  border-radius: 13px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.appearance-onboarding-official {
  color: #2a3b4b;
  border: 1px solid rgba(76, 94, 110, 0.3);
  background: rgba(255, 255, 255, 0.67);
}

.appearance-onboarding-confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  border: 1px solid #101b24;
  background: linear-gradient(145deg, #293a49, #101820);
  box-shadow: 0 10px 24px rgba(20, 33, 44, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.appearance-onboarding-confirm .material-icons-round { font-size: 18px; }
.appearance-onboarding-official:hover,
.appearance-onboarding-confirm:hover { transform: translateY(-1px); }
.appearance-onboarding-confirm:hover { box-shadow: 0 13px 28px rgba(20, 33, 44, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.appearance-onboarding-confirm:disabled,
.appearance-onboarding-official:disabled { cursor: wait; opacity: 0.64; transform: none; }

@keyframes appearanceDialogEnter {
  from { opacity: 0; transform: translateY(18px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .appearance-onboarding-modal { padding: 12px; align-items: end; }
  .appearance-onboarding-dialog {
    width: 100%;
    max-height: calc(100dvh - 18px);
    padding: 22px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 18px 18px;
  }
  .appearance-onboarding-header { gap: 12px; margin-bottom: 18px; }
  .appearance-onboarding-icon { flex-basis: 45px; width: 45px; height: 45px; border-radius: 14px; }
  .appearance-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .appearance-choice { grid-template-columns: 45px 1fr 21px; min-height: 72px; gap: 9px; padding: 9px; border-radius: 15px; }
  .appearance-choice-preview { width: 45px; height: 45px; border-radius: 13px; }
  .appearance-choice-copy strong { font-size: 0.8rem; }
  .appearance-choice-copy small { font-size: 0.63rem; }
  .appearance-choice-check { width: 20px; height: 20px; font-size: 13px; }
  .appearance-onboarding-actions { flex-direction: column-reverse; }
  .appearance-onboarding-official,
  .appearance-onboarding-confirm { width: 100%; }
}

@media (max-width: 430px) {
  .appearance-choice-grid { grid-template-columns: 1fr; }
  .appearance-choice { min-height: 66px; }
  .appearance-onboarding-header p { font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .appearance-onboarding-dialog { animation: none; }
  .appearance-choice,
  .appearance-onboarding-official,
  .appearance-onboarding-confirm { transition: none; }
}
