/* Logged-out mode should mirror the main UI with only targeted removals. */

.logged-out-header-logo-wrap {
  display: none;
}

.logged-out-auth-actions {
  display: none;
}

body.logged-out-mode .sidebar {
  display: none !important;
}

body.logged-out-mode .header-right {
  display: flex !important;
  top: 0;
  height: 100%;
  align-items: center;
}

/* Keep header-right anchored to the same visual x-position in home and chat views. */
body.logged-out-mode.chat-view-active .header-right {
  right: var(--spacing);
}

body.logged-out-mode #incognitoBtn {
  display: none !important;
}

body.logged-out-mode .header {
  transform: translateY(-8px) !important;
}

body.logged-out-mode .header-left {
  top: 0;
  height: 100%;
  align-items: center;
  gap: 0.6rem;
}

body.logged-out-mode .logged-out-header-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27.5px;
  height: 27.5px;
  flex: 0 0 auto;
}

body.logged-out-mode .logged-out-header-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.logged-out-mode .logged-out-header-logo:hover {
  transform: scale(1.14);
  filter: brightness(1.3);
}

body.logged-out-mode .header-center,
body.logged-out-mode #titleDropdown,
body.logged-out-mode .title-dropdown {
  display: none !important;
}

body.logged-out-mode #versionDropdown {
  left: calc(24px + 0.6rem);
}

body.logged-out-mode .logged-out-hidden-controls {
  display: none !important;
}

body.logged-out-mode .logged-out-auth-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

body.logged-out-mode .auth-icon-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

body.logged-out-mode .auth-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.logged-out-mode .auth-icon-btn:active {
  transform: translateY(1px);
  background: rgba(255, 255, 255, 0.14);
}

body.logged-out-mode .auth-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.45);
}

body.logged-out-mode .auth-btn {
  min-width: 0;
  height: 35px;
  padding: 0 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1;
  font-weight: 500;
  font-family: var(--font-sans);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    filter 0.15s ease,
    transform 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

body.logged-out-mode .auth-btn.auth-btn-newchat {
  display: none;
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  border: none;
  border-radius: 50%;
  box-shadow: none;
  filter: none;
}

body.logged-out-mode.chat-view-active .auth-btn.auth-btn-newchat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.logged-out-mode .auth-btn.auth-btn-newchat .icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 50%;
  transition:
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

body.logged-out-mode .auth-btn.auth-btn-newchat .icon svg {
  width: 100%;
  height: 100%;
  display: block;
  transition:
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

body.logged-out-mode .auth-btn.auth-btn-newchat:hover {
  background: transparent;
  filter: none;
  transform: none;
}

body.logged-out-mode .auth-btn.auth-btn-newchat:hover .icon {
  transform: scale(1.12) rotate(-6deg);
  filter: brightness(1.25);
}

body.logged-out-mode .auth-btn.auth-btn-newchat:active {
  transform: none;
}

body.logged-out-mode .auth-btn.auth-btn-newchat:active .icon {
  transform: scale(0.92) rotate(0deg);
  filter: brightness(1.06);
}

body.logged-out-mode .auth-btn.auth-btn-newchat:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.4);
}

body.logged-out-mode .auth-btn:hover {
  filter: brightness(1.06);
}

body.logged-out-mode .auth-btn:active {
  transform: translateY(1px);
}

body.logged-out-mode .auth-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.45);
}

body.logged-out-mode .auth-btn-signin {
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.96);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
}

body.logged-out-mode .auth-btn-signin:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.logged-out-mode .auth-btn-signup {
  background: #efefef;
  color: #111;
  border: 1.5px solid #efefef;
}

body.logged-out-mode .auth-btn-signup:hover {
  background: #ffffff;
}

body.logged-out-mode .logged-out-message-cta {
  width: 100%;
  max-width: 750px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.95rem;
  margin: 0.62rem auto 0.5rem;
  padding: 0.78rem 0.82rem 0.78rem 1rem;
  border-radius: 1.85rem;
  border: none;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.02) 0%,
      rgba(255, 255, 255, 0.01) 100%),
    linear-gradient(90deg,
      rgba(43, 43, 48, 0.92) 0%,
      rgba(39, 39, 43, 0.94) 52%,
      rgba(34, 34, 38, 0.96) 100%);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  pointer-events: none;
  transition:
    opacity 0.24s cubic-bezier(0.2, 0, 0, 1),
    transform 0.26s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.2s ease;
}

body.logged-out-mode .logged-out-message-cta[hidden] {
  display: none !important;
}

body.logged-out-mode .logged-out-message-cta.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

body.logged-out-mode .logged-out-message-cta-text {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.35;
  font-weight: 450;
  letter-spacing: 0.004em;
  color: rgba(255, 255, 255, 0.92);
}

body.logged-out-mode .logged-out-message-cta-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  flex: 0 0 auto;
}

body.logged-out-mode .logged-out-message-cta-btn {
  height: 38px;
  border-radius: 999px;
  border: none;
  padding: 0 1rem;
  font-size: 0.96rem;
  line-height: 1;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

body.logged-out-mode .logged-out-message-cta-btn.login {
  color: rgba(12, 12, 14, 0.96);
  background: rgba(246, 246, 248, 0.96);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

body.logged-out-mode .logged-out-message-cta-btn.signup {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

body.logged-out-mode .logged-out-message-cta-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

body.logged-out-mode .logged-out-message-cta-btn.login:hover {
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

body.logged-out-mode .logged-out-message-cta-btn.signup:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 1);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 8px 20px rgba(0, 0, 0, 0.26);
}

body.logged-out-mode .logged-out-message-cta-btn:active {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.98);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

body.logged-out-mode .logged-out-message-cta-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.46);
}

@media (max-width: 820px) {
  body.logged-out-mode .logged-out-message-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.72rem;
    border-radius: 1.3rem;
    padding: 0.84rem;
  }

  body.logged-out-mode .logged-out-message-cta-text {
    text-align: center;
    font-size: 0.9rem;
  }

  body.logged-out-mode .logged-out-message-cta-actions {
    width: 100%;
    justify-content: center;
  }
}

body.logged-out-auth-modal-open {
  overflow: hidden;
}

body.perf-conservative * {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.perf-conservative .logged-out-auth-modal,
body.perf-interacting .logged-out-auth-modal {
  box-shadow: none !important;
}

body.perf-conservative .logged-out-auth-modal-overlay,
body.perf-interacting .logged-out-auth-modal-overlay {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.perf-conservative .logged-out-auth-provider-btn,
body.perf-conservative .logged-out-auth-input,
body.perf-conservative .logged-out-auth-identifier-btn,
body.perf-conservative .auth-btn,
body.perf-conservative .auth-icon-btn,
body.perf-interacting .logged-out-auth-provider-btn,
body.perf-interacting .logged-out-auth-input,
body.perf-interacting .logged-out-auth-identifier-btn,
body.perf-interacting .auth-btn,
body.perf-interacting .auth-icon-btn {
  filter: none !important;
  box-shadow: none !important;
  transition: none !important;
}

body.perf-conservative .logged-out-auth-modal-close,
body.perf-conservative .logged-out-auth-modal-close:hover,
body.perf-conservative .logged-out-auth-modal-close:active,
body.perf-interacting .logged-out-auth-modal-close,
body.perf-interacting .logged-out-auth-modal-close:hover,
body.perf-interacting .logged-out-auth-modal-close:active {
  transform: none !important;
  transition: none !important;
}

body.perf-conservative .logged-out-auth-provider-btn:hover,
body.perf-conservative .logged-out-auth-provider-btn:active,
body.perf-interacting .logged-out-auth-provider-btn:hover,
body.perf-interacting .logged-out-auth-provider-btn:active {
  transform: none !important;
}

body.perf-conservative .version-container,
body.perf-interacting .version-container,
body.perf-focused .version-container {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  transform: none !important;
  will-change: auto !important;
}

.logged-out-auth-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 4000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.logged-out-auth-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.logged-out-auth-modal {
  width: min(400px, calc(100vw - 24px));
  height: auto;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, rgba(30, 31, 37, 0.98), rgba(24, 25, 31, 0.98));
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.58);
  color: rgba(255, 255, 255, 0.98);
  padding: 38px 26px 24px;
  position: relative;
  opacity: 0;
  transform: translateY(20px) scale(0.965);
  transition:
    opacity 0.24s ease,
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.logged-out-auth-modal-overlay.show .logged-out-auth-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.logged-out-auth-modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.logged-out-auth-modal-close svg {
  width: 19px;
  height: 19px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.logged-out-auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

.logged-out-auth-modal-close:hover svg {
  transform: rotate(90deg);
}

.logged-out-auth-modal-close:active {
  transform: scale(0.95);
}

.logged-out-auth-modal-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.45);
}

.logged-out-auth-modal-title {
  text-align: center;
  margin: 0;
  font-size: clamp(1.85rem, 3.1vw, 2.45rem);
  line-height: 1.14;
  font-weight: 500;
}

.logged-out-auth-modal-desc {
  text-align: center;
  margin: 12px auto 20px;
  max-width: 430px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.94rem, 1.55vw, 1.03rem);
  line-height: 1.42;
}

.logged-out-auth-provider-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: auto;
}

.logged-out-auth-provider-list[hidden],
.logged-out-auth-divider[hidden],
.logged-out-auth-identifier-toggle[hidden],
.logged-out-auth-phone-row[hidden],
.logged-out-auth-password-field[hidden],
.logged-out-auth-input[hidden],
.logged-out-auth-dob-field[hidden],
.logged-out-auth-username-status[hidden],
.logged-out-auth-last-method[hidden],
.logged-out-auth-resend[hidden],
.logged-out-auth-helper[hidden],
.logged-out-auth-link[hidden] {
  display: none !important;
}

.logged-out-auth-provider-btn {
  width: 100%;
  height: 52px;
  border-radius: 26px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 20px;
  font-size: clamp(0.96rem, 1.45vw, 1.02rem);
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.logged-out-auth-provider-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.logged-out-auth-provider-btn:active {
  transform: translateY(0) scale(0.99);
}

.logged-out-auth-provider-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.45);
}

.logged-out-auth-provider-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.logged-out-auth-provider-btn.is-last-method {
  position: relative;
}

.logged-out-auth-provider-btn.is-last-method::before,
.logged-out-auth-provider-btn.is-last-method::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 16px;
  height: calc(100% + 4px);
  border: 1.5px solid rgba(255, 138, 58, 0.95);
  border-top-color: rgba(255, 195, 142, 0.98);
  border-bottom-color: rgba(255, 92, 12, 0.92);
  pointer-events: none;
  transform: translateY(-50%);
  opacity: 0.9;
  /* Fade arc ends so the parentheses taper out at top/bottom. */
  -webkit-mask-image: linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.45) 14%,
      rgba(0, 0, 0, 1) 32%,
      rgba(0, 0, 0, 1) 68%,
      rgba(0, 0, 0, 0.45) 86%,
      rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.45) 14%,
      rgba(0, 0, 0, 1) 32%,
      rgba(0, 0, 0, 1) 68%,
      rgba(0, 0, 0, 0.45) 86%,
      rgba(0, 0, 0, 0) 100%);
  filter: drop-shadow(0 0 2px rgba(255, 130, 46, 0.22));
  transition:
    opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    border-top-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    border-bottom-color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.logged-out-auth-provider-btn.is-last-method::before {
  left: -6px;
  border-right: 0;
  border-radius: 999px 0 0 999px;
}

.logged-out-auth-provider-btn.is-last-method::after {
  right: -6px;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.logged-out-auth-provider-btn.is-last-method:hover::before,
.logged-out-auth-provider-btn.is-last-method:hover::after,
.logged-out-auth-provider-btn.is-last-method:focus-visible::before,
.logged-out-auth-provider-btn.is-last-method:focus-visible::after {
  border-color: rgba(255, 154, 78, 0.98);
  border-top-color: rgba(255, 214, 168, 1);
  border-bottom-color: rgba(255, 110, 28, 0.96);
  opacity: 1;
  transform: translateY(-50%) scale(1.03);
  filter: drop-shadow(0 0 5px rgba(255, 132, 44, 0.42));
}

.provider-icon {
  width: 20px;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
}

.provider-google {
  width: 18px;
  min-width: 18px;
  height: 18px;
  font-size: 0;
}

.provider-google svg {
  width: 100%;
  height: 100%;
  display: block;
}

.provider-ms {
  width: 18px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.provider-ms svg {
  width: 100%;
  height: 100%;
  display: block;
}

.provider-discord {
  width: 20px;
  min-width: 20px;
  height: 20px;
}

.provider-discord svg {
  width: 100%;
  height: 100%;
  display: block;
}

.logged-out-auth-divider {
  margin: 1em 0 1em;
  display: flex;
  align-items: center;
}

.logged-out-auth-divider>span:not(.label) {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.logged-out-auth-divider .label {
  flex: 0 0 auto;
  min-width: 40px;
  height: auto;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  color: rgba(255, 255, 255, 0.58);
  font-size: clamp(0.78rem, 1.05vw, 0.88rem);
  letter-spacing: 0.02em;
}

.logged-out-auth-field-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logged-out-auth-identifier-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
}

.logged-out-auth-identifier-btn {
  flex: 1;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.logged-out-auth-identifier-btn:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.94);
}

.logged-out-auth-identifier-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.38);
}

.logged-out-auth-identifier-btn.is-active {
  color: rgba(255, 255, 255, 0.96);
  border-color: rgba(120, 180, 255, 0.42);
  background: rgba(95, 140, 235, 0.18);
}

.logged-out-auth-identifier-btn.is-last-method {
  position: relative;
}

.logged-out-auth-identifier-btn.is-last-method::before,
.logged-out-auth-identifier-btn.is-last-method::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 10px;
  height: calc(100% + 3px);
  border: 1.5px solid rgba(255, 138, 58, 0.95);
  border-top-color: rgba(255, 195, 142, 0.98);
  border-bottom-color: rgba(255, 92, 12, 0.92);
  pointer-events: none;
  transform: translateY(-50%);
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.45) 14%,
      rgba(0, 0, 0, 1) 32%,
      rgba(0, 0, 0, 1) 68%,
      rgba(0, 0, 0, 0.45) 86%,
      rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.45) 14%,
      rgba(0, 0, 0, 1) 32%,
      rgba(0, 0, 0, 1) 68%,
      rgba(0, 0, 0, 0.45) 86%,
      rgba(0, 0, 0, 0) 100%);
  filter: drop-shadow(0 0 2px rgba(255, 130, 46, 0.2));
  transition:
    opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    border-top-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    border-bottom-color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.logged-out-auth-identifier-btn.is-last-method::before {
  left: -4px;
  border-right: 0;
  border-radius: 999px 0 0 999px;
}

.logged-out-auth-identifier-btn.is-last-method::after {
  right: -4px;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.logged-out-auth-identifier-btn.is-last-method:hover::before,
.logged-out-auth-identifier-btn.is-last-method:hover::after,
.logged-out-auth-identifier-btn.is-last-method:focus-visible::before,
.logged-out-auth-identifier-btn.is-last-method:focus-visible::after,
.logged-out-auth-identifier-btn.is-last-method.is-active::before,
.logged-out-auth-identifier-btn.is-last-method.is-active::after {
  border-color: rgba(255, 154, 78, 0.98);
  border-top-color: rgba(255, 214, 168, 1);
  border-bottom-color: rgba(255, 110, 28, 0.96);
  opacity: 1;
  transform: translateY(-50%) scale(1.03);
  filter: drop-shadow(0 0 4px rgba(255, 132, 44, 0.38));
}

.logged-out-auth-identifier-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.logged-out-auth-dob-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logged-out-auth-dob-label {
  margin: 0 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.79rem;
  letter-spacing: 0.01em;
}

.logged-out-auth-dob-row {
  display: grid;
  grid-template-columns: 1.2fr 0.75fr 0.9fr;
  gap: 8px;
}

.logged-out-auth-phone-row {
  display: grid;
  grid-template-columns: 0.34fr 1fr;
  gap: 8px;
}

.logged-out-auth-phone-country {
  text-align: center;
  letter-spacing: 0.01em;
}

.logged-out-auth-phone-number {
  min-width: 0;
}

.logged-out-auth-dob-input {
  min-width: 0;
}

.logged-out-auth-month-picker {
  position: relative;
}

.logged-out-auth-month-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding-right: 16px;
}

.logged-out-auth-month-trigger-label {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logged-out-auth-month-trigger svg {
  width: 12px;
  height: 8px;
  margin-left: 10px;
  stroke: rgba(255, 255, 255, 0.78);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.logged-out-auth-month-picker.open .logged-out-auth-month-trigger svg {
  transform: rotate(180deg);
}

.logged-out-auth-month-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 55;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 22, 30, 0.97);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  padding: 6px;
  max-height: 236px;
  overflow-y: auto;
  backdrop-filter: blur(12px);
}

.logged-out-auth-month-option {
  width: 100%;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.logged-out-auth-month-option:hover {
  background: rgba(120, 180, 255, 0.16);
}

.logged-out-auth-month-option.is-active {
  background: rgba(120, 180, 255, 0.3);
  color: rgba(255, 255, 255, 1);
}

.logged-out-auth-month-option:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(120, 180, 255, 0.44);
}

.logged-out-auth-month-trigger:disabled,
.logged-out-auth-month-option:disabled {
  cursor: not-allowed;
}

.logged-out-auth-dob-row input.logged-out-auth-dob-input {
  text-align: center;
}

.logged-out-auth-password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.logged-out-auth-input {
  width: 100%;
  height: 52px;
  border-radius: 26px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(0.96rem, 1.45vw, 1.02rem);
  padding: 0 20px;
  font-family: var(--font-sans);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.logged-out-auth-input-with-toggle {
  padding-right: 52px;
}

.logged-out-auth-input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.logged-out-auth-input[type="date"] {
  color-scheme: dark;
}

.logged-out-auth-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.82);
  cursor: pointer;
}

.logged-out-auth-input:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.11);
}

.logged-out-auth-input:focus,
.logged-out-auth-input:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(120, 180, 255, 0.56);
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.28);
  transform: translateY(-2px);
}

.logged-out-auth-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.logged-out-auth-input.is-checking {
  border-color: rgba(120, 180, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.12);
}

.logged-out-auth-input.is-valid {
  border-color: rgba(101, 233, 153, 0.88);
  box-shadow: 0 0 0 2px rgba(101, 233, 153, 0.14);
}

.logged-out-auth-input.is-invalid {
  border-color: rgba(255, 118, 118, 0.88);
  box-shadow: 0 0 0 2px rgba(255, 118, 118, 0.12);
}

.logged-out-auth-username-status {
  min-height: 1rem;
  margin: -2px 4px 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.8rem;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.16s ease, transform 0.16s ease, color 0.16s ease;
}

.logged-out-auth-username-status.show {
  opacity: 1;
  transform: translateY(0);
}

.logged-out-auth-username-status.available {
  color: #9dffc0;
}

.logged-out-auth-username-status.taken,
.logged-out-auth-username-status.invalid {
  color: #ffb5b5;
}

.logged-out-auth-username-status.checking {
  color: #b9d8ff;
}

.logged-out-auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 0;
  bottom: 0;
  margin: auto 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.logged-out-auth-password-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logged-out-auth-password-toggle .icon-eye-closed {
  display: none;
}

.logged-out-auth-password-toggle.is-visible .icon-eye-open {
  display: none;
}

.logged-out-auth-password-toggle.is-visible .icon-eye-closed {
  display: block;
}

.logged-out-auth-password-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
}

.logged-out-auth-password-toggle:active {
  background: rgba(255, 255, 255, 0.16);
}

.logged-out-auth-password-toggle:focus-visible {
  outline: none;
  border-color: rgba(120, 180, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.25);
}

.logged-out-auth-password-toggle.is-visible {
  color: rgba(139, 195, 255, 0.95);
  border-color: rgba(139, 195, 255, 0.28);
  background: rgba(105, 165, 255, 0.08);
}

.logged-out-auth-password-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.logged-out-auth-feedback {
  min-height: 1.1rem;
  margin: 10px 2px 2px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.86rem;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.logged-out-auth-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.logged-out-auth-feedback.error {
  color: #ffc0c0;
}

.logged-out-auth-feedback.success {
  color: #c9f7d8;
}

.logged-out-auth-feedback.info {
  color: rgba(255, 255, 255, 0.75);
}

.logged-out-auth-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.logged-out-auth-link {
  border: none;
  background: transparent;
  color: rgba(183, 215, 255, 0.9);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.logged-out-auth-link:hover {
  color: rgba(220, 236, 255, 1);
  background: rgba(115, 168, 255, 0.12);
}

.logged-out-auth-link:active {
  transform: scale(0.97);
}

.logged-out-auth-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.35);
}

.logged-out-auth-link:disabled {
  color: rgba(255, 255, 255, 0.45);
  cursor: not-allowed;
  background: transparent;
  transform: none;
}

.logged-out-auth-resend {
  align-self: center;
  margin-top: -2px;
  border: none;
  background: transparent;
  color: rgba(183, 215, 255, 0.93);
  font-size: 0.84rem;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.logged-out-auth-resend:hover {
  color: rgba(220, 236, 255, 1);
  background: rgba(115, 168, 255, 0.12);
}

.logged-out-auth-resend:active {
  transform: scale(0.97);
}

.logged-out-auth-resend:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.35);
}

.logged-out-auth-resend:disabled {
  color: rgba(255, 255, 255, 0.45);
  cursor: not-allowed;
  background: transparent;
  transform: none;
}

.logged-out-auth-last-method {
  margin: 2px 2px 14px;
  min-height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.86rem;
  line-height: 1.25;
}

.logged-out-auth-last-method-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff6a00;
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.2);
}

.logged-out-auth-continue {
  margin-top: 12px;
  width: 100%;
  height: 54px;
  border-radius: 27px;
  border: none;
  background: #e8e8ea;
  color: #161616;
  font-size: clamp(1rem, 1.6vw, 1.06rem);
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.logged-out-auth-continue:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.logged-out-auth-continue:active {
  transform: translateY(0) scale(0.99);
}

.logged-out-auth-continue:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.45);
}

.logged-out-auth-continue:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

@media (max-width: 760px) {
  .logged-out-auth-modal {
    width: min(460px, calc(100vw - 16px));
    height: auto;
    padding: 32px 14px 18px;
    border-radius: 18px;
  }

  .logged-out-auth-modal-title {
    font-size: clamp(1.62rem, 6.2vw, 2rem);
  }

  .logged-out-auth-modal-desc {
    margin: 10px auto 16px;
    font-size: 0.9rem;
  }

  .logged-out-auth-provider-btn {
    height: 48px;
    padding: 0 14px;
    gap: 8px;
    font-size: 1rem;
  }

  .provider-icon {
    width: 16px;
    min-width: 16px;
    font-size: 1.1rem;
  }

  .provider-google {
    width: 16px;
    min-width: 16px;
    height: 16px;
  }

  .provider-ms {
    width: 16px;
    min-width: 16px;
    height: 16px;
  }

  .logged-out-auth-input {
    height: 48px;
    padding: 0 14px;
    font-size: 0.96rem;
  }

  .logged-out-auth-dob-row {
    grid-template-columns: 1.18fr 0.78fr 0.92fr;
    gap: 6px;
  }

  .logged-out-auth-input-with-toggle {
    padding-right: 44px;
  }

  .logged-out-auth-password-toggle {
    width: 32px;
    height: 32px;
    right: 8px;
  }

  .logged-out-auth-continue {
    height: 50px;
    font-size: 1rem;
  }

  .logged-out-auth-divider {
    margin: 14px 0 10px;
  }
}

/* Logged-out appearance + responsive compatibility overrides */
body.logged-out-mode {
  color-scheme: dark;
}

body.logged-out-mode .logged-out-auth-modal {
  max-height: calc(var(--app-viewport-height, 100vh) - 24px);
}

body.logged-out-mode.app-appearance-light {
  color-scheme: light;
}

body.logged-out-mode.app-appearance-light .logged-out-auth-modal {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(239, 244, 251, 0.96));
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 26px 54px rgba(15, 23, 42, 0.18);
}

body.logged-out-mode.app-appearance-light .logged-out-auth-modal-title,
body.logged-out-mode.app-appearance-light .logged-out-auth-modal-desc,
body.logged-out-mode.app-appearance-light .logged-out-auth-feedback,
body.logged-out-mode.app-appearance-light .logged-out-auth-label,
body.logged-out-mode.app-appearance-light .logged-out-auth-username-status,
body.logged-out-mode.app-appearance-light .logged-out-auth-last-method {
  color: rgba(15, 23, 42, 0.88);
}

body.logged-out-mode.app-appearance-light .logged-out-auth-provider-btn,
body.logged-out-mode.app-appearance-light .logged-out-auth-input,
body.logged-out-mode.app-appearance-light .logged-out-auth-month-trigger,
body.logged-out-mode.app-appearance-light .logged-out-auth-month-option {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.16);
  color: rgba(15, 23, 42, 0.92);
}

body.logged-out-mode.app-appearance-light .logged-out-auth-input::placeholder {
  color: rgba(15, 23, 42, 0.46);
}

body.logged-out-mode.app-appearance-light .logged-out-auth-input[type="date"] {
  color-scheme: light;
}

body.logged-out-mode.app-appearance-light .logged-out-auth-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.8;
}

body.logged-out-mode.app-appearance-light .auth-icon-btn,
body.logged-out-mode.app-appearance-light .auth-btn.auth-btn-newchat {
  color: rgba(15, 23, 42, 0.88);
}

body.logged-out-mode.app-appearance-light .version-container {
  padding: 0.52rem 0.78rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(91, 103, 128, 0.12);
  box-shadow: 0 10px 24px rgba(76, 90, 116, 0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.logged-out-mode.app-appearance-light .version-container:hover {
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 28px rgba(76, 90, 116, 0.1);
}

body.logged-out-mode.app-appearance-light .auth-btn {
  box-shadow: 0 10px 22px rgba(76, 90, 116, 0.08);
}

body.logged-out-mode.app-appearance-light .auth-btn-signin {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(91, 103, 128, 0.14);
  color: rgba(23, 32, 51, 0.92);
  box-shadow:
    0 10px 22px rgba(76, 90, 116, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

body.logged-out-mode.app-appearance-light .auth-btn-signup {
  background: linear-gradient(135deg, rgba(28, 40, 63, 0.96), rgba(45, 58, 85, 0.96));
  border-color: rgba(28, 40, 63, 0.72);
  color: #fff;
  box-shadow: 0 12px 24px rgba(36, 50, 77, 0.22);
}

body.logged-out-mode.app-appearance-light .auth-btn-signin:hover {
  background: rgba(255, 255, 255, 0.86);
}

body.logged-out-mode.app-appearance-light .auth-btn-signup:hover {
  background: linear-gradient(135deg, rgba(22, 33, 54, 0.98), rgba(40, 52, 77, 0.98));
}

body.logged-out-mode.app-appearance-light .logged-out-message-cta {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 244, 251, 0.96));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

body.logged-out-mode.app-appearance-light .logged-out-message-cta-text {
  color: rgba(15, 23, 42, 0.88);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  body.logged-out-mode .logged-out-auth-modal {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(20, 24, 32, 0.97);
  }

  body.logged-out-mode.app-appearance-light .logged-out-auth-modal {
    background: rgba(255, 255, 255, 0.98);
  }
}