.history-search {
  display: flex;
  align-items: center;
  background: rgba(25, 27, 35, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  gap: 16px;
}

.history-search input {
  width: 100%;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  outline: none;
  padding: 0;
  border-radius: 0;
}

.history-search input::placeholder {
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin: 16px 0 12px;
  padding: 4px;
  position: relative;
}

.history-tabs .active-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(50% - 4px);
  margin: 4px;
  background: #ffffff;
  border-radius: 6px;
  transition: transform 0.2s ease;
  z-index: 0;
}

.history-tabs.workspace-active .active-indicator {
  transform: translateX(100%);
}

.history-tabs .tab {
  padding: 10px 0;
  background: transparent;
  color: #ffffff;
  letter-spacing: -0.08px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  border: none;
  cursor: pointer;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.history-tabs .tab.active {
  color: #0b0b0b;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  isolation: isolate;
}

.history-list.is-motion-replaying [data-motion-role]:not(.is-visible):not(.is-inview) {
  opacity: 0;
}

.history-group {
  display: flex;
  flex-direction: column;
}

.history-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 0 4px;
  border-bottom: 1px solid #434550;
}

.history-group-text {
  font-size: 12px;
  font-weight: 300;
  line-height: 22px;
  color: #b6b6b6;
}

.history-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.history-menu-anchor {
  position: relative;
  align-self: start;
  z-index: 1;
}

.history-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.workspace-row {
  align-items: flex-start;
  padding: 16px 0;
  gap: 12px;
}

.workspace-row .history-info {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.workspace-logos {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-logo {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.workspace-logo-badge {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
  min-width: 20px;
  max-width: 24px;
}

.workspace-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: #fff;
}

.workspace-meta {
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, 0.45);
}

.workspace-row .dot-menu svg circle {
  fill: #626368;
}

.dot-menu {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.dot-menu svg {
  width: 4px;
  height: 16px;
  fill: #7d808d;
}

.history-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-icon svg {
  width: 24px;
  height: 24px;
}

.history-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: #ffffff;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.star {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 0.16s ease;
}

.star svg {
  width: 24px;
  height: 24px;
  display: block;
  transition: opacity 0.18s ease;
}

.star svg path {
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.star[data-bookmark-state="default"] svg {
  opacity: 0.68;
}

.star[data-bookmark-state="filled"] svg {
  opacity: 1;
}

.star[data-bookmark-state="default"]:hover svg,
.star[data-bookmark-state="default"]:focus-visible svg {
  opacity: 0.84;
}

.star[data-bookmark-state="default"]:active svg,
.star[data-bookmark-state="filled"]:active svg {
  opacity: 1;
}

.star:active {
  transform: scale(0.96);
}

.history-empty {
  padding: 32px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}
.history-menu {
  position: absolute;
  top: 46px;
  left: 0;
  background: linear-gradient(180deg, rgba(37, 40, 52, 0.98), rgba(28, 31, 40, 0.98));
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  min-width: 120px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  animation: menuFade 0.18s ease forwards;
  z-index: 10;
}

.menu-option {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  padding: 6px 16px;
  cursor: pointer;
  text-align: center;
}

.menu-option + .menu-option {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-option:hover {
  opacity: 0.85;
}

@keyframes menuFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding:
    max(16px, env(safe-area-inset-top))
    16px
    calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  transform: translateY(8px) scale(0.98);
}

.history-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.modal-card {
  background: #262832;
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  padding: 24px 24px 16px;
  text-align: center;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.history-modal.open .modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-question {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  outline: none;
}

.modal-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.modal-btn {
  border: none;
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.modal-btn.primary {
  background: #434550;
  color: #ffffff;
}

.modal-btn.danger {
  background: #b23b3b;
  color: #ffffff;
}

.modal-btn.secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
}

.modal-btn:hover:not(:disabled) {
  transform: scale(0.99);
  opacity: 0.95;
}

.modal-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#chat_history .history-row {
  padding: 14px 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#chat_history .history-row.menu-open,
#chat_history .workspace-row.menu-open {
  border-color: rgba(255, 255, 255, 0.12);
  z-index: 8;
}

#chat_history .workspace-row {
  padding: 14px 0;
}

#chat_history .dot-menu {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #7d808d;
  transition: transform 0.15s ease, opacity 0.15s ease,
    background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#chat_history .dot-menu:hover,
#chat_history .history-row.menu-open .dot-menu {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f2f3f8;
}

#chat_history .dot-menu:active {
  transform: scale(0.97);
}

#chat_history .dot-menu svg {
  fill: currentColor;
}

#chat_history .history-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 176px;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(34, 37, 49, 0.995), rgba(24, 26, 35, 0.995));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
  z-index: 28;
}

#chat_history .history-menu.open {
  display: flex;
}

#chat_history .menu-option {
  font-size: 13px;
  font-weight: 500;
  padding: 10px 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

#chat_history .menu-option + .menu-option {
  border-top: none;
}

#chat_history .menu-option:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.05);
}

#chat_history .menu-option:active {
  transform: scale(0.97);
}

#chat_history .menu-option[data-action="delete"] {
  color: #ffd0d0;
}

#chat_history .history-menu-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

#chat_history .history-menu-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

#chat_history .history-menu-label {
  line-height: 1.2;
}

#chat_history .history-modal,
#profile .history-modal {
  background: rgba(7, 9, 14, 0.6);
}

#chat_history .history-modal .modal-card,
#profile .history-modal .modal-card {
  background: linear-gradient(180deg, rgba(30, 34, 44, 0.98), rgba(22, 25, 34, 0.98));
  border-radius: 18px;
  width: 100%;
  max-width: 330px;
  padding: 16px;
  text-align: left;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.045);
  gap: 14px;
  backdrop-filter: blur(12px);
}

#chat_history .history-modal-header,
#profile .history-modal-header,
#profile-transactions .history-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#chat_history .history-modal-heading,
#profile .history-modal-heading,
#profile-transactions .history-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#chat_history .modal-question,
#profile .modal-question,
#profile-transactions .modal-question {
  font-size: 16px;
  line-height: 22px;
}

#chat_history .modal-desc,
#profile .modal-desc,
#profile-transactions .modal-desc {
  margin: 0;
  font-size: 12px;
  line-height: 17px;
  color: rgba(255, 255, 255, 0.58);
}

#chat_history .history-modal-close,
#profile .history-modal-close,
#profile-transactions .history-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

#chat_history .history-modal-close:hover,
#profile .history-modal-close:hover,
#profile-transactions .history-modal-close:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.07);
}

#chat_history .history-modal-close svg,
#profile .history-modal-close svg,
#profile-transactions .history-modal-close svg {
  width: 13px;
  height: 13px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

#chat_history .history-modal-body,
#profile .history-modal-body,
#profile-transactions .history-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#chat_history .history-modal-body--compact,
#profile .history-modal-body--compact,
#profile-transactions .history-modal-body--compact {
  gap: 8px;
}

#chat_history .history-modal-label,
#profile .history-modal-label,
#profile-transactions .history-modal-label {
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, 0.52);
}

#chat_history .history-modal .modal-input,
#profile .history-modal .modal-input,
#profile-transactions .history-modal .modal-input {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 14px;
}

#chat_history .history-modal .modal-input:focus,
#profile .history-modal .modal-input:focus,
#profile-transactions .history-modal .modal-input:focus {
  border-color: rgba(124, 188, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(33, 183, 255, 0.12);
}

#chat_history .history-modal-actions,
#profile .history-modal-actions,
#profile-transactions .history-modal-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
}

#chat_history .history-modal-actions--single .modal-btn,
#profile .history-modal-actions--single .modal-btn,
#profile-transactions .history-modal-actions--single .modal-btn {
  width: 100%;
}

#chat_history .history-modal .modal-btn,
#profile .history-modal .modal-btn,
#profile-transactions .history-modal .modal-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  border-radius: 13px;
  padding: 10px 12px;
  width: 100%;
}

#chat_history .history-modal .modal-btn.primary,
#chat_history .history-modal .modal-btn.danger,
#profile .history-modal .modal-btn.primary,
#profile .history-modal .modal-btn.danger,
#profile-transactions .history-modal .modal-btn.primary,
#profile-transactions .history-modal .modal-btn.danger {
  background: rgba(255, 255, 255, 0.075);
  color: #ffffff;
}

#chat_history .history-modal .modal-btn.secondary,
#profile .history-modal .modal-btn.secondary,
#profile-transactions .history-modal .modal-btn.secondary {
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.85);
}

#profile .history-modal .modal-card,
#profile-transactions .history-modal .modal-card {
  width: min(520px, calc(100vw - 32px));
  max-width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 18px;
  gap: 16px;
  border-radius: 22px;
  overflow: hidden;
}

#chat_history .history-workspace-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#chat_history .history-workspace-option {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease,
    background 0.2s ease, border-color 0.2s ease;
}

#chat_history .history-workspace-option:hover:not(:disabled) {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.06);
}

#chat_history .history-workspace-option:active:not(:disabled) {
  transform: scale(0.97);
}

#chat_history .history-workspace-option.is-current,
#chat_history .history-workspace-option:disabled {
  cursor: default;
  opacity: 0.88;
  border-color: rgba(124, 188, 255, 0.24);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(87, 102, 255, 0.08));
}

#chat_history .history-workspace-option-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#chat_history .history-workspace-option-title {
  font-size: 14px;
  line-height: 19px;
  font-weight: 500;
  color: #fff;
}

#chat_history .history-workspace-option-subtitle {
  font-size: 11px;
  line-height: 15px;
  color: rgba(255, 255, 255, 0.52);
}

#chat_history .history-workspace-option-badge {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  color: #d7ebff;
}

.start-chat-card {
  --app-motion-fixed-transform: translateX(-50%) scale(1);
  position: fixed;
  left: 50%;
  bottom: calc(var(--footer-floating-cta-bottom) + env(safe-area-inset-bottom));
  max-width: 560px;
  width: 94%;
  margin: 0;
  border: 1px solid rgba(12, 15, 24, 0.06);
  border-radius: 14px;
  background: #ffffff;
  color: #0f131b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transform: var(--app-motion-fixed-transform);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
  z-index: 9;
}

.start-chat-card:hover {
  --app-motion-fixed-transform: translateX(-50%) scale(0.99);
  background: #eceff5;
  transform: var(--app-motion-fixed-transform);
  opacity: 0.95;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.start-chat-card:active {
  --app-motion-fixed-transform: translateX(-50%) scale(0.97);
  transform: var(--app-motion-fixed-transform);
  background: #e5e9f1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
}

.start-chat-icon svg {
  width: 24px;
  height: 24px;
  color: currentColor;
}

.start-chat-card:focus-visible {
  outline: none;
  border-color: rgba(130, 194, 255, 0.34);
  box-shadow: 0 0 0 4px rgba(124, 188, 255, 0.14), 0 10px 24px rgba(0, 0, 0, 0.35);
}

.start-chat-text {
  font-size: 16px;
  font-weight: 600;
}

/* Chat page layout */
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 6px;
  background: #11131a;
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0;
}

.chat-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.chat-back svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.chat-title {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
}

#chat .top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

#chat .top-bar .burger {
  grid-column: 3;
  justify-self: end;
}

.chat-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-balance {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
}

.chat-balance-value {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  min-width: max-content;
  text-align: center;
  letter-spacing: 0.02em;
}

.chat-balance-add {
  width: 14px;
  height: 14px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #fff;
  padding: 0;
  min-width: 14px;
  min-height: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, color 0.2s ease;
}

.chat-balance-add:hover {
  transform: scale(0.99);
  opacity: 0.95;
  color: #f5f7ff;
}

.chat-balance-add:active {
  transform: scale(0.97);
}

.chat-balance-add svg {
  width: 12px;
  height: 12px;
  display: block;
}

.chat-hero {
  position: sticky;
  top: 40px;
  overflow: visible;
}

.chat-head-wrap {
  margin: 0 -16px;
  padding: 0 16px 16px;
  position: fixed;
  width: 100vw;
  max-width: 560px;
  z-index: 10;
  top: 0;
  background: rgba(18, 20, 27, calc(0.88 * var(--section-topbar-alpha, 0)));
  border-bottom: 1px solid rgba(255, 255, 255, calc(0.03 * var(--section-topbar-alpha, 0)));
  backdrop-filter: blur(calc(14px * var(--section-topbar-alpha, 0)));
  -webkit-backdrop-filter: blur(calc(14px * var(--section-topbar-alpha, 0)));
  box-shadow: 0 10px 24px rgba(0, 0, 0, calc(0.12 * var(--section-topbar-alpha, 0)));
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, backdrop-filter 0.22s ease;
}

.support-chat-head-wrap {
  padding-bottom: 10px;
}

#support-chat-section .top-bar {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
}

.support-chat-back {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: rgba(245, 246, 251, 0.92);
  background: transparent;
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.support-chat-back:hover,
.support-chat-back:focus-visible {
  background: rgba(255, 255, 255, 0.03);
}

.support-chat-back:active {
  transform: scale(0.96);
  opacity: 0.86;
}

.support-chat-back svg {
  width: 18px;
  height: 18px;
}

.support-chat-title-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.support-chat-subtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  color: rgba(241, 243, 250, 0.56);
}

#chat.settings-open .chat-head-wrap {
  padding-bottom: 0;
}

.chat-hero .chat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.chat-model-name {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.chat-menu {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  gap: 4px;
  cursor: pointer;
}

.chat-menu span {
  display: block;
  width: 16px;
  height: 2px;
  background: #fff;
}

.chat-open-bar {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
  align-items: flex-end;
  width: 100%;
}

.chat-open-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.chat-open-add {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(33, 35, 47, 0.92);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 4px;
}

.chat-open-add svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.chat-open-more {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(33, 35, 47, 0.92);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  cursor: pointer;
  justify-content: flex-start;
  transition: transform 0.15s ease, opacity 0.15s ease,
    background 0.2s ease, border-color 0.2s ease, gap 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-open-more:active {
  transform: scale(0.97);
}

.chat-open-more:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.12);
}

.chat-open-more-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: transform 0.22s ease;
}

.chat-open-bar.stack-open .chat-open-more-icon {
  transform: rotate(180deg);
}

.chat-open-more-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  color: currentColor;
}

.chat-open-toggle-text {
  font-size: 11px;
  color: #d4d6e0;
  white-space: nowrap;
  max-width: 120px;
  transition: opacity 0.25s ease, transform 0.25s ease, max-width 0.25s ease;
}

.chat-open-bar.stack-open .chat-open-toggle-text {
  opacity: 1;
  transform: none;
  max-width: 120px;
}

.chat-open-bar.stack-open .chat-open-more {
  gap: 5px;
}

@media (hover: hover) and (pointer: fine) {
  .chat-open-add:hover,
  .chat-open-more:hover {
    transform: scale(0.99);
    opacity: 0.95;
    background: rgba(43, 46, 58, 0.96);
  }
}

.chat-opened-item {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 42px;
  padding: 6px 9px;
  background: linear-gradient(180deg, rgba(33, 35, 47, 1), rgba(30, 32, 42, 0.985));
  border-radius: 12px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 6px 12px rgba(0, 0, 0, var(--stack-shadow-opacity, 0.08));
  opacity: 0;
  transform: translateY(var(--stack-y, 0px));
  transition: opacity 0.18s ease, transform 0.22s var(--motion-ease-soft),
    box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  overflow: hidden;
  transform-origin: top center;
  isolation: isolate;
}

.chat-opened-item::before {
  content: "";
  position: absolute;
  inset: -12% -6% 46% -6%;
  background: radial-gradient(84% 68% at 50% 6%, rgba(44, 47, 60, 0.16) 0%, rgba(25, 27, 35, 0) 72%);
  opacity: 0.34;
  pointer-events: none;
  z-index: 0;
}

.chat-opened-item > * {
  position: relative;
  z-index: 1;
}

.chat-opened-item.is-active {
  border-color: rgba(124, 92, 255, 0.34);
  background: linear-gradient(180deg, rgba(33, 35, 47, 1), rgba(29, 31, 41, 0.99));
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.08), 0 6px 12px rgba(0, 0, 0, var(--stack-shadow-opacity, 0.08));
}

.chat-opened-item.is-active::before {
  opacity: 0.42;
  background: radial-gradient(86% 70% at 50% 6%, rgba(88, 68, 176, 0.1) 0%, rgba(25, 27, 35, 0) 72%);
}

.chat-opened-item.menu-open:not(.is-active) {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 16px rgba(0, 0, 0, 0.14);
}

.chat-opened-item.is-dragging {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
  cursor: grabbing;
  transition: none;
}

.chat-opened-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(110, 201, 255, 0.5), 0 16px 30px rgba(0, 0, 0, 0.3);
}

.chat-opened-main {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.chat-opened-handle {
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  padding: 0;
  color: #7d808d;
  cursor: default;
  flex: 0 0 12px;
  touch-action: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.chat-opened-item.is-draggable .chat-opened-handle {
  cursor: grab;
  opacity: 0.8;
  pointer-events: auto;
}

.chat-opened-item.is-draggable .chat-opened-handle:hover {
  color: #d7d9e2;
}

.chat-opened-item.is-dragging .chat-opened-handle {
  cursor: grabbing;
}

.chat-opened-handle svg {
  width: 10px;
  height: 10px;
  display: block;
}

.chat-opened-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.chat-opened-icon svg {
  width: 20px;
  height: 20px;
}

.chat-opened-title {
  font-size: 13px;
  line-height: 17px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-opened-stack {
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
  width: 100%;
  transition: height 0.28s var(--motion-ease-soft), margin-bottom 0.28s var(--motion-ease-soft);
}

.chat-opened-stack.open {
  pointer-events: auto;
  margin-bottom: 6px;
}


.chat-opened-stack.open .chat-opened-item {
  opacity: 1;
}

.chat-opened-menu-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 0;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: #8f93a3;
  flex: 0 0 auto;
  transition: transform 0.15s ease, opacity 0.15s ease,
    background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.chat-opened-menu-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f2f3f8;
}

.chat-opened-menu-btn:focus-visible {
  outline: none;
  border-color: rgba(110, 201, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(110, 201, 255, 0.18);
}

.chat-opened-menu-btn:active {
  transform: scale(0.97);
}

.chat-opened-menu-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.chat-opened-menu {
  position: absolute;
  background: linear-gradient(180deg, rgba(35, 38, 49, 0.98), rgba(26, 28, 37, 0.98));
  border-radius: 13px;
  padding: 5px;
  flex-direction: column;
  gap: 4px;
  min-width: 148px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  animation: menuFade 0.18s ease forwards;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.chat-opened-menu button {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.chat-opened-menu button:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.05);
}

.chat-opened-menu button:active {
  transform: scale(0.97);
}

.chat-opened-menu button[data-action="delete"] {
  color: #ffd0d0;
}

.chat-opened-menu-icon {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.chat-opened-menu-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.chat-opened-menu-label {
  line-height: 1.2;
}

.chat-opened-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding:
    max(16px, env(safe-area-inset-top))
    16px
    calc(24px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.chat-opened-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.chat-opened-modal .modal-card {
  background: linear-gradient(180deg, rgba(35, 38, 49, 0.98), rgba(26, 28, 37, 0.98));
  border-radius: 18px;
  width: 100%;
  max-width: 332px;
  padding: 16px;
  text-align: left;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(14px);
}

.chat-opened-modal.open .modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-opened-modal .modal-question {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

.chat-opened-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chat-opened-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.chat-opened-modal-desc {
  margin: 0;
  font-size: 12px;
  line-height: 17px;
  color: rgba(255, 255, 255, 0.58);
}

.chat-opened-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.chat-opened-modal-close:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.07);
}

.chat-opened-modal-close svg {
  width: 13px;
  height: 13px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.chat-opened-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-opened-modal-label {
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, 0.52);
}

.chat-opened-modal-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14px;
  line-height: 19px;
  padding: 11px 13px;
  outline: none;
}

.chat-opened-modal-input:focus {
  border-color: rgba(124, 188, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(33, 183, 255, 0.12);
}

.chat-opened-modal-error {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: #ffbaba;
}

.chat-opened-modal-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
}

.chat-opened-modal .modal-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
}

.chat-opened-modal .modal-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  border-radius: 13px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  width: 100%;
}

.chat-opened-modal .modal-btn.danger {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.chat-opened-modal .modal-btn.primary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.chat-opened-modal .modal-btn.secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
}

.chat-opened-modal .modal-btn:hover:not(:disabled) {
  transform: scale(0.99);
  opacity: 0.95;
}

.chat-opened-modal .modal-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.chat-opened-modal .modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-opened-add-modal {
  position: fixed;
  inset: 0;
  display: block;
  padding: 0;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 45;
}

.chat-opened-add-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.chat-opened-add-card {
  width: min(100%, 292px);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: linear-gradient(180deg, rgba(34, 37, 49, 0.88) 0%, rgba(20, 23, 33, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 42px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
  position: absolute;
  text-align: left;
  isolation: isolate;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-opened-add-modal.open .chat-opened-add-card {
  opacity: 1;
  transform: translateY(0);
}

.chat-opened-add-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.15s ease;
}

.chat-opened-add-close svg {
  width: 14px;
  height: 14px;
  stroke: #7d808d;
  stroke-width: 1.5;
  fill: none;
}

.chat-opened-add-title,
.chat-opened-add-subtitle {
  font-size: 14px;
  line-height: 18px;
  color: #ffffff;
  margin: 0;
}

.chat-opened-add-step-viewport {
  position: relative;
  width: 100%;
  min-height: 320px;
}

.chat-opened-add-step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-opened-add-step--history {
  align-items: center;
  text-align: center;
}

.chat-opened-add-step--model {
  align-items: stretch;
  text-align: left;
}

.chat-opened-add-step.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.chat-opened-add-step.is-entering.is-back {
  transform: translateX(-16px);
}

.chat-opened-add-step.is-leaving {
  pointer-events: none;
}

.chat-opened-add-step.is-leaving.is-forward {
  opacity: 0;
  transform: translateX(-16px);
}

.chat-opened-add-step.is-leaving.is-back {
  opacity: 0;
  transform: translateX(16px);
}

.chat-opened-add-step-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
}

.chat-opened-add-step-header .chat-opened-add-title {
  text-align: center;
}

.chat-opened-add-back {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.chat-opened-add-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-opened-add-back:hover {
  transform: translateY(-50%) scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.12);
}

.chat-opened-add-back:active {
  transform: translateY(-50%) scale(0.97);
}

.chat-opened-add-start {
  width: 100%;
  border: none;
  border-radius: 11px;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.15s ease;
}

.chat-opened-add-start-icon svg {
  width: 16px;
  height: 16px;
}

.chat-opened-add-start:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.16);
}

.chat-opened-add-start:active {
  transform: scale(0.97);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}

.chat-opened-add-start-text {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
}

.chat-opened-add-search {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(25, 27, 35, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-opened-add-search-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}

.chat-opened-add-search-icon svg {
  width: 19px;
  height: 19px;
  stroke: #ffffff;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-opened-add-search-input {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #ffffff;
  font-size: 12px;
  line-height: 15px;
  outline: none;
  padding: 0;
}

.chat-opened-add-search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.chat-opened-add-list {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 208px;
  overflow-y: auto;
}

.chat-opened-add-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  color: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
}


.chat-opened-add-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.chat-opened-add-item-title {
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-opened-add-star {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #ffffff;
}

.chat-opened-add-star[data-bookmark-state="default"] svg {
  opacity: 0.68;
}

.chat-opened-add-star[data-bookmark-state="filled"] svg {
  opacity: 1;
}

.chat-opened-add-star svg {
  width: 18px;
  height: 18px;
  display: block;
  transition: opacity 0.18s ease;
}

.chat-opened-add-empty {
  font-size: 12px;
  line-height: 15px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 16px 0;
}

.chat-opened-add-model-groups {
  width: 100%;
  max-height: 252px;
  overflow-y: auto;
  padding: 2px 2px 8px;
  box-sizing: border-box;
}

.chat-opened-add-model-step[data-context="create"] .model-option-status.is-active {
  display: none;
}

.chat-opened-add-error {
  margin: 0;
  min-height: 16px;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: #ffb2b2;
}

.chat-body.settings-open .chat-opened-add-modal:not(.model-modal) {
  display: none;
}

body.is-edge-swiping {
  overflow: hidden;
  overscroll-behavior: none;
}

.page.is-edge-swiping {
  overflow: hidden;
}

.page.is-edge-swiping .section.is-swipe-source,
.page.is-edge-swiping .section.is-swipe-preview {
  display: block;
  position: absolute;
  inset: 0;
  min-height: 100%;
  pointer-events: none;
  will-change: transform, opacity;
  background: var(--app-shell-background);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.page.is-edge-swiping .section.is-swipe-source {
  z-index: 2;
}

.page.is-edge-swiping .section.is-swipe-preview {
  z-index: 1;
  opacity: calc(0.72 + var(--edge-swipe-progress, 0) * 0.28);
}

.page.is-edge-swiping[data-edge-swipe-direction="right"] .section.is-swipe-source {
  transform: translate3d(var(--edge-swipe-source-offset, 0px), 0, 0);
}

.page.is-edge-swiping[data-edge-swipe-direction="left"] .section.is-swipe-source {
  transform: translate3d(var(--edge-swipe-source-offset, 0px), 0, 0);
}

.page.is-edge-swiping[data-edge-swipe-direction="right"] .section.is-swipe-preview {
  transform: translate3d(var(--edge-swipe-preview-offset, 0px), 0, 0);
}

.page.is-edge-swiping[data-edge-swipe-direction="left"] .section.is-swipe-preview {
  transform: translate3d(var(--edge-swipe-preview-offset, 0px), 0, 0);
}

.page.is-edge-swipe-settling .section.is-swipe-source,
.page.is-edge-swipe-settling .section.is-swipe-preview {
  transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1), opacity 180ms ease;
}

.page.page-chat-single-scroll {
  box-sizing: border-box;
  height: 100dvh;
  min-height: 100dvh;
  padding-bottom: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.page.page-chat-single-scroll #chat.section.active,
.page.page-chat-single-scroll #support-chat-section.section.active {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  padding-bottom: 0;
}

.chat-body {
  --chat-composer-input-max-height: clamp(200px, 32svh, 300px);
  --chat-composer-shell-max-height: clamp(244px, 40svh, 360px);
  --chat-composer-live-height: 56px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 110px;
  height: auto;
}

.page.page-chat-single-scroll .chat-body {
  box-sizing: border-box;
  margin-top: 0;
  padding-top: 110px;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.support-chat-body {
  margin-top: 78px;
  gap: 14px;
}

.page.page-chat-single-scroll .support-chat-body {
  padding-top: 78px;
}

.chat-body.hello-active {
  height: 60vh;
}

.chat-body.has-messages {
  height: auto;
}

.page.page-chat-single-scroll .chat-body.hello-active,
.page.page-chat-single-scroll .chat-body.has-messages {
  height: 100%;
  max-height: 100%;
}

.messages-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 8px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.messages-container::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.page.page-chat-single-scroll .messages-container {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  padding-bottom: calc(var(--chat-composer-live-height, 56px) + var(--footer-dock-nav-min-height) + env(safe-area-inset-bottom) + 28px);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.chat-footer-docked .page.page-chat-single-scroll .messages-container {
  padding-bottom: calc(var(--chat-composer-live-height, 56px) + env(safe-area-inset-bottom) + 28px);
}

.messages-container.is-history-revealing {
  overflow-anchor: none;
}

.message {
  max-width: 100%;
  font-size: 14px;
  line-height: 20px;
  color: #fff;
  position: relative;
}

.message-user {
  align-self: flex-end;
  width: fit-content;
  max-width: min(70%, 340px);
}

.message-user-card {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 8px 44px 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(27, 52, 108, 0.46);
  border: 1px solid rgba(143, 177, 255, 0.08);
  border-radius: 14px 14px 7px 14px;
  box-shadow: none;
}

.message-other,
.message-error {
  align-self: flex-start;
  width: min(100%, 560px);
  max-width: calc(100% - 8px);
  background: none;
  border: none;
  padding: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: flex-start;
  gap: 8px;
}

.message-logo {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.message-assistant-card {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 14px;
  box-shadow: none;
}

.message-assistant-card--error {
  background: rgba(104, 40, 48, 0.1);
  border-color: rgba(255, 178, 178, 0.12);
}

.message-logo svg {
  width: 22px;
  height: 22px;
}

.message-content {
  color: #f5f6fb;
  font-size: 14px;
  line-height: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.message-content > * {
  margin-top: 0;
  margin-bottom: 0;
}

.message-user .message-content,
.message-other .message-content,
.message-error .message-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-content p {
  margin: 0;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
}

.message-content h1 {
  font-size: 18px;
}

.message-content h2 {
  font-size: 17px;
}

.message-content h3 {
  font-size: 16px;
}

.message-content h4,
.message-content h5,
.message-content h6 {
  font-size: 15px;
}

.message-content ul,
.message-content ol {
  margin: 0 0 0 18px;
  padding: 0;
  list-style-position: outside;
}

.message-content {
  counter-reset: ol-counter;
}

.message-content ol {
  list-style-type: none;
  counter-reset: none;
}

.message-content ol li {
  counter-increment: ol-counter;
  position: relative;
  padding-left: 24px;
}

.message-content ol li::before {
  content: counter(ol-counter) ".";
  position: absolute;
  left: 0;
}

.message-content li {
  margin: 2px 0;
}

.message-content a {
  color: #7dd3fc;
  text-decoration: underline;
}

.message-content strong {
  font-weight: 600;
}

.message-content em {
  font-style: italic;
}

.message-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
}

.message-content pre {
  margin: 0;
  overflow-x: auto;
}

.message-content blockquote {
  margin: 0;
  padding: 6px 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.016);
  border-radius: 6px;
}

.message-content hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0;
}

.message-content .md-table {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
}

.message-content table {
  width: 100%;
  border-collapse: collapse;
}

.message-content img {
  display: block;
  max-width: 100%;
  height: auto;
}

.message-content th,
.message-content td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 8px;
  font-size: 13px;
  line-height: 18px;
  color: #ffffff;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.message-content th {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.024);
}

.code-block {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px 9px;
  max-width: 100%;
  width: fit-content;
  overflow-x: auto;
}

.message-other .code-block,
.message-error .code-block {
  width: 100%;
  max-width: 100%;
}

.message-user .code-block,
.message-assistant-card .code-block {
  width: 100%;
  max-width: 100%;
}

.code-block code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  display: block;
  white-space: pre;
}

.message-assistant-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 1px;
}

.message-assistant-action {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.028);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(242, 243, 247, 0.58);
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.message-assistant-action.hidden {
  display: none;
  pointer-events: none;
}

.message-assistant-action:active {
  transform: scale(0.97);
}

.message-assistant-action:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.message-assistant-action.is-feedback {
  background: rgba(125, 211, 252, 0.1);
  border-color: rgba(125, 211, 252, 0.12);
  color: #f5f9ff;
}

.message-assistant-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.message-copy {
  position: relative;
}

.message-copy .message-assistant-action-icon {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.message-copy .message-assistant-action-icon--success {
  opacity: 0;
  transform: scale(0.82);
}

.message-copy.is-feedback .message-assistant-action-icon--copy {
  opacity: 0;
  transform: scale(0.82);
}

.message-copy.is-feedback .message-assistant-action-icon--success {
  opacity: 1;
  transform: scale(1);
}

.message-copy .message-assistant-action-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.message-copy .message-assistant-action-icon--success svg {
  width: 13px;
  height: 13px;
}

@media (hover: hover) and (pointer: fine) {
  .message-assistant-action:hover {
    transform: scale(0.99);
    opacity: 0.95;
    background: rgba(255, 255, 255, 0.045);
  }
}

.message-action-label {
  display: none;
}

#chat.image-mode .image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 358px;
}

#chat.image-mode .image-tile {
  border: none;
  background: #262832;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  aspect-ratio: 167 / 200;
}

#chat.image-mode .image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.message-image .message-content {
  width: 100%;
  max-width: 100%;
}

.message-edit {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.025);
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 7px;
  color: rgba(234, 240, 255, 0.5);
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.message-edit:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.05);
}

.message-edit:active {
  transform: scale(0.97);
}

.message-edit svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

.message-edit-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 10, 16, 0.44);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 60;
}

.message-edit-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.message-edit-card {
  width: min(376px, calc(100% - 32px));
  max-height: min(74vh, 460px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(28, 30, 38, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: none;
  overflow: hidden;
  isolation: isolate;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.message-edit-modal.open .message-edit-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.message-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-edit-title {
  margin: 0;
  font-size: 15px;
  line-height: 19px;
  font-weight: 600;
  color: #f5f6fb;
}

.message-edit-close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #7d808d;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.message-edit-close:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.05);
}

.message-edit-close:active {
  transform: scale(0.97);
}

.message-edit-close svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

.message-edit-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
  padding: 2px 2px 0;
}

.message-edit-editor {
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: none;
}

.message-edit-attachments {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  padding: 2px;
}

.message-edit-attachments.has-items {
  display: flex;
}

.message-edit-textarea {
  width: 100%;
  min-height: 96px;
  max-height: 240px;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  resize: none;
  overflow-y: auto;
}

.message-edit-textarea:focus {
  outline: none;
}

.message-edit-textarea::placeholder {
  color: rgba(242, 243, 247, 0.46);
}

.image-preview-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 12, 18, 0.7);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 70;
}

.image-preview-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.image-preview-card {
  position: relative;
  width: min(350px, 100%);
  background: #262832;
  border-radius: 16px;
  padding: 24px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 6px 10px 4px rgba(0, 0, 0, 0.15), 0 2px 3px rgba(0, 0, 0, 0.3);
}

.image-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #7d808d;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.image-preview-main img {
  width: 100%;
  height: 304px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.image-preview-thumbs {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 0 16px;
}

.image-preview-thumbs.is-empty {
  display: none;
}

.image-preview-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  padding: 0;
  cursor: pointer;
  opacity: 0.7;
}

.image-preview-thumb.active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.35);
}

.image-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-preview-actions {
  display: flex;
  gap: 4px;
}

.image-preview-action {
  flex: 1;
  height: 49px;
  background: #434550;
  border-radius: 12px;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.image-preview-action:hover:not(:disabled) {
  transform: scale(0.99);
  opacity: 0.95;
}

.image-preview-action:active:not(:disabled) {
  transform: scale(0.97);
}

.image-preview-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-preview-action-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.image-preview-action-label {
  max-width: 98px;
  font-size: 12px;
  line-height: 140%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-preview-copy {
  width: 100%;
  height: 49px;
  background: #434550;
  border-radius: 12px;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.image-preview-copy:hover {
  transform: scale(0.99);
  opacity: 0.95;
}

.image-preview-copy:active {
  transform: scale(0.97);
}

.image-preview-dismiss {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}

.message-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 0;
}

.message-edit-attach {
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #f5f6fb;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.message-edit-attach:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.message-edit-attach:active {
  transform: scale(0.97);
}

.message-edit-attach-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(245, 246, 251, 0.88);
}

.message-edit-attach-icon svg {
  width: 16px;
  height: 16px;
}

.message-edit-attach-label {
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  color: inherit;
}

.message-edit-file-input {
  display: none;
}

.message-edit-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.message-edit-cancel,
.message-edit-save {
  min-width: 104px;
  height: 34px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.message-edit-cancel {
  background: rgba(255, 255, 255, 0.025);
  color: #ffffff;
}

.message-edit-save {
  background: #ffffff;
  color: #0b0b0b;
  border-color: transparent;
}

.message-edit-cancel:hover,
.message-edit-save:hover {
  transform: scale(0.99);
  opacity: 0.95;
}

.message-edit-cancel:active,
.message-edit-save:active {
  transform: scale(0.97);
}

.message-edit-modal .attachment-card {
  flex: 1 1 176px;
  max-width: 100%;
  min-width: 0;
  padding: 7px 9px;
  gap: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.message-edit-modal .attachment-thumb {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.message-edit-modal .attachment-doc-icon {
  width: 32px;
  height: 32px;
}

.message-edit-modal .attachment-body {
  max-width: none;
  gap: 3px;
}

.message-edit-modal .attachment-title {
  font-size: 12px;
  line-height: 16px;
}

.message-edit-modal .attachment-subtitle {
  font-size: 11px;
  line-height: 14px;
}

.message-edit-modal .attachment-remove {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.message-edit-modal .attachment-remove svg {
  width: 8px;
  height: 8px;
  stroke: rgba(245, 246, 251, 0.82);
}

.message-edit-input {
  width: 100%;
  min-height: 90px;
  max-height: 240px;
  height: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  resize: none;
  overflow-y: auto;
}

.message-user.message-editing {
  width: 90%;
}

.edit-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-actions .send-message {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.edit-actions .edit-save {
  background: #ffffff;
  color: #434550;
}

@media (max-width: 420px) {
  .message {
    font-size: 13px;
    line-height: 19px;
  }

  .message-user {
    max-width: min(72%, calc(100% - 44px));
  }

  .message-user-card {
    padding: 8px 40px 8px 10px;
    border-radius: 13px 13px 7px 13px;
  }

  .message-other,
  .message-error {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px;
  }

  .message-logo {
    width: 20px;
    height: 20px;
  }

  .message-logo svg {
    width: 20px;
    height: 20px;
  }

  .message-assistant-card {
    padding: 8px 10px 7px;
    border-radius: 13px;
  }

  .message-edit-card {
    width: min(100%, calc(100% - 24px));
    padding: 13px;
    border-radius: 16px;
  }

  .chat-scroll-bottom {
    bottom: calc(var(--footer-toolbar-bottom) + env(safe-area-inset-bottom) + 54px);
    width: 32px;
    height: 32px;
  }

  .message-edit-footer {
    flex-wrap: wrap;
  }

  .message-edit-attach {
    width: 100%;
    justify-content: center;
  }

  .message-edit-actions {
    width: 100%;
    margin-left: 0;
  }

  .message-edit-cancel,
  .message-edit-save {
    flex: 1 1 0;
    min-width: 0;
  }
}

.edit-actions .edit-cancel {
  background: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
  color: #fff;
}

.edit-actions .edit-save,
.edit-actions .edit-cancel {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.edit-actions .edit-save:hover,
.edit-actions .edit-cancel:hover {
  transform: scale(0.99);
  opacity: 0.95;
}

.edit-actions .edit-save:active,
.edit-actions .edit-cancel:active {
  transform: scale(0.97);
}

.typing-indicator {
  position: relative;
  overflow: hidden;
}

.message-history-reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  will-change: opacity, transform;
}

.message-history-reveal.is-history-visible {
  opacity: 1;
  transform: translateY(0);
}

.typing-indicator .message-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.typing-label {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.15));
  -webkit-background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: shimmer 1.8s linear infinite;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: blink 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.hello-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: clamp(220px, 34vh, 320px);
  padding: 40px 16px;
  color: #fff;
  margin: auto;
}

.hello-icon {
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.hello-icon svg {
  width: 32px;
  height: 32px;
}

.chat-scroll-bottom {
  position: fixed;
  bottom: calc(var(--footer-toolbar-bottom) + env(safe-area-inset-bottom) + 58px);
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(33, 35, 45, 0.96);
  color: rgba(245, 246, 251, 0.92);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.2s ease, border-color 0.2s ease;
  z-index: 13;
}

.chat-scroll-bottom.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-scroll-bottom:hover {
  transform: scale(0.99);
  background: rgba(39, 41, 52, 0.98);
}

.chat-scroll-bottom:active {
  transform: scale(0.97);
}

.chat-scroll-bottom svg {
  width: 20px;
  height: 20px;
  display: block;
  transform: none;
}

.chat-scroll-bottom path {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-toolbar {
  --app-motion-fixed-transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  position: fixed;
  left: 50%;
  transform: var(--app-motion-fixed-transform);
  width: calc(100% - 32px);
  max-width: 560px;
  bottom: calc(var(--footer-toolbar-bottom) + env(safe-area-inset-bottom));
  z-index: 9;
  background: transparent;
  transition: transform 0.2s ease;
}

.input-toolbar::before {
  content: "";
  width: 100vw;
  height: var(--footer-toolbar-backdrop-height);
  position: absolute;
  background: #191b23;
  z-index: -1;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.input-toolbar.menu-open {
  --app-motion-fixed-transform: translate(-50%, 80px);
  transform: var(--app-motion-fixed-transform);
  pointer-events: none;
}

.chat-opened-limit {
  position: fixed;
  left: 50%;
  bottom: calc(var(--footer-limit-bottom) + env(safe-area-inset-bottom));
  width: 95vw;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #262832;
  border-radius: 12px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-opened-limit.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.chat-opened-limit.menu-open {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 140%);
}

.chat-opened-limit__content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.chat-opened-limit__icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.chat-opened-limit__text {
  font-size: 12px;
  line-height: 15px;
  color: #ffffff;
}

.chat-opened-limit__close {
  width: 24px;
  height: 24px;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  cursor: pointer;
}

.chat-opened-limit__close svg {
  width: 14px;
  height: 14px;
  stroke: #7d808d;
  stroke-width: 1.5;
  fill: none;
}

.chat-settings {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  place-self: self-end;
  margin-bottom: 12px;
}

.chat-body.settings-open {
  height: auto;
  margin-top: 60px;
  min-height: calc(100vh - 160px);
  align-items: center;
  justify-content: center;
}

.chat-body.settings-open .messages-container,
.chat-body.settings-open .hello-message,
.chat-body.settings-open .input-toolbar {
  display: none !important;
}

.chat-body.settings-open .chat-opened-limit {
  display: none !important;
}

.page.page-chat-single-scroll .chat-body.settings-open {
  margin-top: 0;
  padding-top: 60px;
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

#chat.settings-open .chat-hero {
  display: none;
}

.chat-settings-screen {
  position: relative;
  display: none;
  min-height: 100%;
  width: 100%;
  overflow: visible;
  color: #ffffff;
}

.page.page-chat-single-scroll .chat-settings-screen {
  min-height: 0;
}

.chat-body.settings-open .chat-settings-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}



.chat-settings-card {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 358px;
  height: auto;
  background: rgba(25, 27, 35, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: visible;
}

.chat-settings-card--tall {
  height: auto;
}

.chat-settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-self: stretch;
}

.chat-settings-field--compact {
  flex: 0 0 151px;
  max-width: 151px;
  height: 50px;
}

.chat-settings-field--slider {
  gap: 11px;
  min-height: 34px;
  width: 326px;
}

.chat-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 17px;
}

.chat-settings-label {
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  color: #ffffff;
}

.chat-settings-value {
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  color: #ffffff;
  min-width: 48px;
  text-align: right;
}

.chat-settings-slider {
  position: relative;
  height: 8px;
  display: flex;
  align-items: center;
}

.chat-settings-range {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  padding: 0;
  transform: translateY(-50%);
  background: rgba(120, 120, 128, 0.16);
  border-radius: 8px;
  overflow: visible;
  pointer-events: none;
}

.chat-settings-range-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: var(--fill-percent, 0%);
  background: #ffffff;
  border-radius: 100px;
}

.chat-settings-range-thumb {
  position: absolute;
  top: 50%;
  left: var(--fill-percent, 0%);
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #262832;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  box-shadow: none;
}

.chat-settings-range-input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.chat-settings-range-input:focus {
  outline: none;
}

.chat-settings-slider:focus-within .chat-settings-range-thumb {
  box-shadow: none;
}

.chat-settings-field--textarea {
  gap: 10px;
  width: 326px;
}

.chat-settings-textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  resize: none;
}

.chat-settings-textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat-settings-textarea--flat {
  border-radius: 0;
}

.chat-settings-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 16px;
  column-gap: 24px;
  width: 326px;
  margin: 0 auto;
}

.chat-model-toggle {
  background: none;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.chat-title-chevron {
  display: inline-flex;
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.chat-title-chevron svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.chat-model-toggle.is-open .chat-title-chevron {
  transform: rotate(180deg);
}

.chat-settings-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 103px;
  height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
}

.chat-settings-stepper-btn {
  width: 24px;
  height: 22px;
  border-radius: 0;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 22px;
  font-weight: 400;
  color: #ffffff;
}

.chat-settings-stepper-value {
  min-width: 7px;
  padding: 0;
  text-align: center;
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  color: #ffffff;
}

.chat-settings-preset {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-settings-control {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  height: 50px;
}

.chat-settings-control--input {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  height: 48px;
}

.chat-settings-control .chat-settings-stepper {
  margin-left: auto;
}

.chat-settings-control-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #ffffff;
  flex-shrink: 0;
}

.chat-settings-control-icon svg {
  width: 24px;
  height: 24px;
}

.chat-settings-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  padding: 0;
}

.chat-settings-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.chat-settings-dropdown {
  position: relative;
  width: 100%;
}

.chat-settings-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: none;
}

.chat-settings-dropdown.is-open .chat-settings-dropdown-trigger {
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
}

.chat-settings-control-text {
  flex: 1;
  text-align: left;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #ffffff;
}

.chat-settings-control-chevron {
  width: 6px;
  height: 12px;
  display: grid;
  place-items: center;
  color: #ffffff;
  transition: none;
}

.chat-settings-control-chevron svg {
  width: 6px;
  height: 12px;
}

.chat-settings-dropdown.is-open .chat-settings-control-chevron {
  transform: rotate(180deg);
}

.chat-settings-dropdown-menu {
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  background: #2b2d35;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  width: 325px;
  height: auto;
  max-height: 130px;
  box-shadow: none;
  overflow-y: auto;
  display: none;
  z-index: 12;
}

.chat-settings-dropdown.is-open .chat-settings-dropdown-menu {
  display: flex;
  flex-direction: column;
}

.chat-settings-dropdown-search {
  width: 100%;
  height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 12px;
  line-height: 20px;
  font-weight: 400;
}

.chat-settings-dropdown-search::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.chat-settings-dropdown-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.chat-settings-dropdown-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  min-height: 20px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}

.chat-settings-option-hash {
  width: 18px;
  text-align: center;
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
}

.chat-settings-option-label {
  font-size: 14px;
  line-height: 20px;
}

.chat-settings-dropdown--compact {
  width: 103px;
  margin-left: auto;
}

.chat-settings-dropdown--compact .chat-settings-dropdown-trigger {
  height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  gap: 8px;
}

.chat-settings-dropdown--compact .chat-settings-control-text {
  font-size: 14px;
  line-height: 17px;
  text-align: center;
}

.chat-settings-dropdown--compact .chat-settings-control-chevron {
  width: 4px;
  height: 8px;
}

.chat-settings-dropdown--compact .chat-settings-control-chevron svg {
  width: 4px;
  height: 8px;
}

.chat-settings-dropdown--ratio .chat-settings-dropdown-menu {
  width: 235px;
  height: auto;
  max-height: 130px;
  padding: 8px;
  left: auto;
  right: 0;
}

.chat-settings-dropdown--ratio.is-open .chat-settings-dropdown-menu {
  display: flex;
}

.chat-settings-dropdown--ratio .chat-settings-dropdown-options {
  display: grid;
  grid-template-columns: 100px 111px;
  grid-auto-rows: 24px;
  column-gap: 8px;
  row-gap: 0;
  align-content: start;
}

.chat-settings-dropdown--ratio .chat-settings-dropdown-option {
  height: 24px;
  padding: 2px;
  gap: 8px;
  font-size: 10px;
  line-height: 12px;
}

.chat-settings-dropdown--ratio .chat-settings-option-label {
  font-size: 10px;
  line-height: 12px;
  text-align: center;
}

.chat-settings-ratio-icon {
  position: relative;
  width: 20px;
  height: 20px;
}

.chat-settings-ratio-icon::before {
  content: '';
  position: absolute;
  border: 0.5px solid #ffffff;
  border-radius: 2px;
  width: 10px;
  height: 10px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.chat-settings-ratio-icon--portrait::before {
  width: 10px;
  height: 14px;
}

.chat-settings-ratio-icon--landscape::before {
  width: 14px;
  height: 10px;
}

.chat-settings-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.chat-settings-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  height: 32px;
  border-radius: 6px;
  background: #2b2d35;
  color: #ffffff;
  font-size: 12px;
  line-height: 20px;
  font-weight: 400;
  min-width: 75px;
}

.chat-settings-chip button {
  border: none;
  background: transparent;
  color: #7d808d;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}

.chat-settings-chip button::before,
.chat-settings-chip button::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 1px;
  background: #7d808d;
}

.chat-settings-chip button::before {
  transform: rotate(45deg);
}

.chat-settings-chip button::after {
  transform: rotate(-45deg);
}

.model-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  background: rgba(8, 10, 16, 0.74);
  backdrop-filter: blur(8px);
  z-index: 65;
}

.model-modal .model-modal-card {
  width: min(100%, 392px);
  max-height: min(76vh, 560px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, rgba(34, 37, 49, 0.88) 0%, rgba(20, 23, 33, 0.94) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 22px 54px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  position: relative;
  text-align: left;
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.model-modal.open .model-modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.model-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.model-modal-header .model-modal-close {
  position: relative;
  top: auto;
  right: auto;
  flex-shrink: 0;
}

.model-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 2px 8px;
  box-sizing: border-box;
}

.model-modal-title {
  margin: 0;
  font-size: 17px;
  line-height: 21px;
  font-weight: 700;
  color: #f5f6fb;
}

.model-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.model-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-group-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(242, 243, 247, 0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 4px;
}

.model-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px 4px;
  background: none;
}

.model-option {
  --model-accent-start: rgba(70, 84, 126, 0.58);
  border: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(34, 37, 49, 0.31) 0%, rgba(20, 23, 33, 0.39) 100%);
  border-radius: 18px;
  padding: 12px 14px;
  color: #ffffff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 18px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.model-option[data-accent='teal'] {
  --model-accent-start: rgba(29, 85, 78, 0.55);
}

.model-option[data-accent='violet'] {
  --model-accent-start: rgba(52, 49, 110, 0.55);
}

.model-option[data-accent='blue'] {
  --model-accent-start: rgba(15, 59, 142, 0.55);
}

.model-option[data-accent='amber'] {
  --model-accent-start: rgba(90, 64, 18, 0.55);
}

.model-option[data-accent='indigo'] {
  --model-accent-start: rgba(33, 52, 104, 0.58);
}

.model-option[data-accent='slate'] {
  --model-accent-start: rgba(70, 84, 126, 0.58);
}

.model-option:hover:not(:disabled) {
  transform: scale(0.995);
  opacity: 0.97;
  background: linear-gradient(180deg, rgba(40, 44, 58, 0.38) 0%, rgba(24, 28, 40, 0.48) 100%);
  border-color: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 24px rgba(0, 0, 0, 0.26);
}

.model-option:active:not(:disabled) {
  transform: scale(0.985);
}

.model-option-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.model-option-icon-tile {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(to bottom, var(--model-accent-start) -20%, rgba(25, 27, 35, 0.72) 44%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.model-option-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.model-option-icon svg {
  width: 20px;
  height: 20px;
}

.model-option-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.model-option-label {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  color: #f5f6fb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-option-subtitle {
  font-size: 12px;
  line-height: 1.28;
  color: rgba(242, 243, 247, 0.46);
}

.model-option-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 40px;
  align-self: center;
}

.model-option-meta:empty {
  display: none;
}

.model-option-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.model-option-status.is-active {
  background: rgba(141, 177, 255, 0.12);
  border-color: rgba(141, 177, 255, 0.18);
  color: rgba(223, 232, 255, 0.92);
}

.model-option-status.is-unavailable {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(242, 243, 247, 0.44);
}

.model-option:last-child {
  margin-bottom: 0;
}

.model-option.active {
  background: linear-gradient(180deg, rgba(42, 46, 62, 0.42) 0%, rgba(28, 32, 44, 0.54) 100%);
  border-color: rgba(141, 177, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 26px rgba(0, 0, 0, 0.28);
}

.model-option.disabled {
  cursor: not-allowed;
}

.model-option.disabled .model-option-main,
.model-option.disabled .model-option-icon-tile {
  opacity: 0.72;
}

.model-modal[data-context="create"] .model-option-status.is-active {
  display: none;
}

.model-empty {
  font-size: 13px;
  color: rgba(242, 243, 247, 0.46);
  padding: 8px 0 4px;
  text-align: center;
}

.chat-settings-actions {
  display: flex;
  gap: 16px;
  margin-top: 0;
  width: 326px;
  margin-left: auto;
  margin-right: auto;
}

.chat-settings-btn {
  flex: 1;
  min-width: 155px;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  height: 43px;
  font-size: 16px;
  line-height: 19px;
  font-weight: 600;
  cursor: pointer;
  transition: none;
}

.chat-settings-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-settings-save {
  background: #ffffff;
  color: #0b0b0b;
}

.input-container {
  flex: 1;
  display: block;
  background: #262832;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  position: relative;
}

.attachments {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  max-height: 160px;
  overflow-y: auto;
}

.attachments.has-items {
  display: flex;
}

.attachment-card {
  display: flex;
  align-items: center;
  padding: 4px;
  gap: 8px;
  background: rgba(52, 49, 110, 0.5);
  border-radius: 8px;
  max-width: 218px;
  width: fit-content;
}

.attachment-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-doc-icon {
  width: 32px;
  height: 32px;
}

.attachment-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 144px;
}

.attachment-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-subtitle {
  font-size: 12px;
  font-weight: 300;
  line-height: 18px;
  color: #b6b6b6;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-remove {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  align-self: flex-start;
}

.attachment-remove svg {
  width: 8px;
  height: 8px;
  stroke: #b6b6b6;
  stroke-width: 1.5;
}

.input-inner {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  gap: 8px;
}

.chat-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-role-pill {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.chat-role-pill.is-visible {
  display: inline-flex;
}

.chat-role-pill-remove {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #7d808d;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.chat-role-pill-remove svg {
  width: 10px;
  height: 10px;
}

.chat-role-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 100%;
  max-width: 260px;
  padding: 8px;
  border-radius: 8px;
  background: #2b2d35;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: none;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 12;
}

.chat-role-menu.is-open {
  display: flex;
}

.chat-role-option {
  border: none;
  background: transparent;
  color: #ffffff;
  text-align: left;
  font-size: 12px;
  line-height: 18px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.chat-role-option:hover,
.chat-role-option.is-active {
  background: rgba(255, 255, 255, 0.08);
}

.chat-role-empty {
  font-size: 12px;
  line-height: 18px;
  color: rgba(255, 255, 255, 0.6);
  padding: 6px 8px;
}

.input-container .clip {
  width: 24px;
  height: 24px;
  stroke: #7d808d;
}

.clip-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #7d808d;
}

.clip-menu {
  position: absolute;
  left: 6px;
  bottom: 55px;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px;
  gap: 8px;
  background: #434550;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  animation: menuFade 0.18s ease forwards;
  z-index: 25;
}

.clip-menu.open {
  display: flex;
}

.clip-menu button {
  border: none;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.clip-menu svg {
  width: 28px;
  height: 28px;
}

.chat-input {
  background: transparent;
  border: none;
  resize: none;
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  padding: 0;
  border-radius: 0;
  height: 23px;
  flex: 1;
  min-width: 0;
}

.chat-input:focus {
  outline: none;
}

.send-message {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: #434550;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 5px;
}

/* Home screen */
#welcome {
  position: relative;
}

#welcome .top-bar {
  gap: 8px;
}

.home-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
}

.home-screen > * {
  position: relative;
  z-index: 1;
}

.home-search {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 4px 8px;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-right: 16px;
  background: rgba(25, 27, 35, 0.3);
  background-blend-mode: soft-light;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  flex: 1 1 auto;
  align-self: stretch;
}

.home-search-icon {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 10px;
  width: 40px;
  height: 40px;
  flex: none;
}

.home-search-icon svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-search-input {
  width: 145px;
  height: 17px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #dadada;
  font-size: 14px;
  line-height: 17px;
  letter-spacing: 0.25px;
  text-align: justify;
  padding: 0;
  flex: none;
}

.input-toolbar.chat-composer {
  --chat-composer-progress: 0;
  --chat-composer-shell-feedback: rgba(124, 92, 255, 0.12);
  width: calc(100% - 24px);
  max-width: 560px;
  padding: 0;
  gap: 0;
  justify-content: center;
  background: transparent;
  transition: transform 0.24s ease;
}

.input-toolbar.chat-composer::before {
  display: none;
}

.chat-composer-container {
  position: relative;
  flex: 0 0 auto;
  max-width: 100%;
  max-height: var(--chat-composer-shell-max-height);
  width: min(100%, 560px);
  margin: 0 auto;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(33, 35, 47, 0.97);
  backdrop-filter: blur(14px) saturate(108%);
  -webkit-backdrop-filter: blur(14px) saturate(108%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
  overflow: visible;
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease;
  will-change: auto;
  transform-origin: center bottom;
}

.chat-composer-container::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.048) 0%, rgba(124, 92, 255, 0.012) 36%, rgba(124, 92, 255, 0) 74%);
  opacity: 0.42;
  pointer-events: none;
  transition: opacity 0.24s ease, background 0.24s ease;
}

.chat-composer[data-composer-state="recording"] .chat-composer-container {
  border-color: rgba(124, 92, 255, 0.16);
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.16);
}

.chat-composer[data-composer-state="synthesizing"] .chat-composer-container {
  position: relative;
  border-color: rgba(124, 92, 255, 0.16);
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.16);
}

.chat-composer[data-composer-state="recording"] .chat-composer-container::before {
  opacity: 0.6;
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.07) 0%, rgba(124, 92, 255, 0.018) 36%, rgba(124, 92, 255, 0) 82%);
}

.chat-composer[data-composer-state="recording"] .chat-composer-container::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(62% 140% at 0% 50%, rgba(124, 92, 255, calc(var(--chat-composer-wave-strength, 0.08) * 0.2)) 0%, rgba(124, 92, 255, calc(var(--chat-composer-wave-strength, 0.08) * 0.12)) 22%, rgba(124, 92, 255, 0) 66%),
    radial-gradient(62% 140% at 100% 50%, rgba(124, 92, 255, calc(var(--chat-composer-wave-strength, 0.08) * 0.2)) 0%, rgba(124, 92, 255, calc(var(--chat-composer-wave-strength, 0.08) * 0.12)) 22%, rgba(124, 92, 255, 0) 66%),
    linear-gradient(90deg, rgba(124, 92, 255, 0) 0%, rgba(124, 92, 255, calc(var(--chat-composer-wave-strength, 0.08) * 0.04)) 18%, rgba(124, 92, 255, calc(var(--chat-composer-wave-strength, 0.08) * 0.12)) 50%, rgba(124, 92, 255, calc(var(--chat-composer-wave-strength, 0.08) * 0.04)) 82%, rgba(124, 92, 255, 0) 100%);
  opacity: calc(0.18 + var(--chat-composer-wave-strength, 0.08) * 0.58);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: chatComposerWaveGlow 1.9s ease-in-out infinite;
}

.chat-composer[data-composer-state="synthesizing"] .chat-composer-container::before,
.chat-composer[data-composer-state="default"] .chat-composer-container::before {
  opacity: 0.64;
}

.chat-composer[data-composer-state="synthesizing"] .chat-composer-container::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    115deg,
    rgba(124, 92, 255, 0.05) 0%,
    rgba(124, 92, 255, 0.2) 24%,
    rgba(124, 92, 255, 0.06) 48%,
    rgba(124, 92, 255, 0.18) 72%,
    rgba(124, 92, 255, 0.05) 100%
  );
  background-size: 180% 100%;
  animation: chatComposerBorderRun 2.4s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.chat-composer-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.chat-composer.is-multiline .chat-composer-inner {
  align-items: stretch;
}

.chat-composer-plus {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(242, 244, 250, 0.82);
  position: relative;
  flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.16s ease, color 0.2s ease, background-color 0.18s ease;
}

.chat-composer-plus:active,
.chat-composer-voice-btn:active,
.chat-composer .send-message:active {
  transform: scale(0.96);
  opacity: 0.88;
}

.chat-composer-plus:active {
  background: rgba(41, 43, 56, 0.94);
}

.chat-composer-plus-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-composer-plus-icon--close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.72);
}

.chat-composer[data-composer-state="recording"] .chat-composer-plus {
  color: rgba(168, 146, 255, 0.98);
}

.chat-composer-plus.is-menu-open {
  background: rgba(41, 43, 56, 0.94);
  color: rgba(242, 244, 250, 0.9);
}

.chat-composer-plus.is-menu-open .chat-composer-plus-icon--plus {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

.chat-composer-plus.is-menu-open .chat-composer-plus-icon--close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.chat-composer[data-composer-state="recording"] .chat-composer-plus-icon--plus {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

.chat-composer[data-composer-state="recording"] .chat-composer-plus-icon--close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.chat-composer-plus-menu {
  left: 0;
  bottom: calc(100% + 9px);
  min-width: 180px;
  padding: 8px;
  gap: 4px;
  border-radius: 16px;
  background: rgba(24, 26, 34, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.32);
}

.chat-composer-plus-menu .clip-option {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(243, 245, 250, 0.92);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  font-size: 13px;
  line-height: 1.2;
  transition: background 0.18s ease, color 0.18s ease;
}

.chat-composer-plus-menu .clip-option:hover {
  background: rgba(124, 92, 255, 0.08);
}

.chat-composer-plus-menu-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.chat-composer-plus-menu-icon svg {
  width: 20px;
  height: 20px;
}

.chat-composer-main {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 24px;
  max-height: var(--chat-composer-shell-max-height);
  display: grid;
  align-items: start;
}

.chat-composer-recording-shell,
.chat-composer-synth-shell,
.chat-composer .chat-input-wrapper {
  grid-area: 1 / 1;
  width: 100%;
  min-height: 32px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.24s ease, visibility 0s linear 0.16s;
}

.chat-composer-recording-shell,
.chat-composer-synth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: visible;
}

.chat-composer[data-composer-state="recording"] .chat-composer-recording-shell {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.chat-composer-waveform {
  width: min(100%, 420px);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-inline: 12px;
  position: relative;
}

.chat-composer-waveform-bar {
  --wave-level: 0.08;
  --wave-width: 0.18;
  --wave-opacity: 0.3;
  width: calc(3px + var(--wave-width) * 6px);
  min-height: 4px;
  height: calc(4px + var(--wave-level) * 88px);
  border-radius: 999px;
  background: rgba(232, 235, 246, 0.94);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.12);
  transition: height 0.08s linear, width 0.08s linear, opacity 0.08s linear;
  opacity: var(--wave-opacity);
}

.chat-composer[data-composer-state="synthesizing"] .chat-composer-synth-shell {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
  justify-content: space-between;
  gap: 14px;
  padding: 0 4px 0 8px;
}

.chat-composer-status {
  color: #f5f6fb;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
}

.chat-composer-progress {
  color: rgba(245, 246, 251, 0.76);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  min-width: 44px;
  text-align: right;
}

.chat-composer .chat-input-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 24px;
}

.chat-composer.is-multiline .chat-input-wrapper {
  align-items: flex-start;
}

.chat-composer[data-composer-state="default"] .chat-input-wrapper {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.chat-composer .chat-input {
  min-height: 22px;
  max-height: var(--chat-composer-input-max-height);
  height: 22px;
  padding: 0;
  font-size: 15px;
  line-height: 20px;
  color: #f5f6fb;
  align-self: flex-start;
}

.chat-composer.is-multiline .chat-input {
  align-self: flex-start;
}

.chat-composer .chat-input::placeholder {
  color: rgba(243, 245, 250, 0.44);
}

.chat-composer .chat-role-pill {
  margin-bottom: 6px;
}

.chat-composer-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
}

.chat-composer-rail-start {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.chat-composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: stretch;
  min-width: 0;
  justify-content: flex-end;
  transition: gap 0.2s ease, transform 0.2s ease;
}

.chat-composer.is-multiline .chat-composer-actions {
  align-self: stretch;
  padding-bottom: 0;
}

.chat-composer-action-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex: 0 0 38px;
  min-inline-size: 38px;
  inline-size: 38px;
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
  transition:
    inline-size 0.18s ease,
    opacity 0.16s ease,
    transform 0.2s ease,
    min-inline-size 0.18s ease;
}

.chat-composer-voice-slot,
.chat-composer-send-slot {
  inline-size: 38px;
  min-inline-size: 38px;
}

.chat-composer-voice-btn,
.chat-composer .send-message {
  width: 38px;
  height: 38px;
  min-width: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  padding: 0;
  border: none;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  transition: opacity 0.18s ease, transform 0.2s ease, color 0.2s ease;
  position: relative;
}

.chat-composer-plus svg {
  width: 18px;
  height: 18px;
}

.chat-composer-voice-btn svg {
  width: 22px;
  height: 22px;
}

.chat-composer .send-message svg {
  width: 22px;
  height: 22px;
}

.chat-composer-voice-btn {
  color: rgba(168, 146, 255, 0.96);
}

.chat-composer .send-message {
  color: rgba(168, 146, 255, 1);
}

.chat-composer .send-message:disabled {
  opacity: 0.34;
  pointer-events: none;
}

.chat-composer[data-composer-state="recording"] .chat-composer-voice-slot,
.chat-composer[data-composer-state="synthesizing"] .chat-composer-voice-slot,
.chat-composer[data-composer-state="synthesizing"] .chat-composer-send-slot {
  inline-size: 0;
  min-inline-size: 0;
  opacity: 0;
  transform: translateX(6px) scale(0.86);
  pointer-events: none;
}

.chat-composer-synth-tapzone {
  display: none;
}

.chat-composer[data-composer-state="synthesizing"] .chat-composer-synth-tapzone {
  position: absolute;
  inset: 0;
  display: block;
  border: none;
  background: transparent;
  pointer-events: none;
}

.chat-composer .attachments {
  margin-bottom: 10px;
}

body.chat-footer-docked .input-toolbar.chat-composer {
  bottom: calc(12px + env(safe-area-inset-bottom));
}

body.chat-footer-prehidden .footer.tap-bar.bottom-bar,
body.chat-footer-docked .footer.tap-bar.bottom-bar {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

body.chat-footer-docked .chat-scroll-bottom {
  bottom: calc(var(--chat-composer-live-height, 56px) + env(safe-area-inset-bottom) + 18px);
}

body.chat-footer-docked .chat-opened-limit {
  bottom: calc(var(--chat-composer-live-height, 56px) + env(safe-area-inset-bottom) + 26px);
}

@keyframes chatComposerBorderRun {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 200% 50%;
  }
}

@keyframes chatComposerWaveGlow {
  0%,
  100% {
    background-position: -8% 50%, 108% 50%, 50% 50%;
    transform: scaleX(0.985);
  }

  50% {
    background-position: 8% 50%, 92% 50%, 50% 50%;
    transform: scaleX(1.015);
  }
}

@media (max-width: 720px) {
  .input-toolbar.chat-composer {
    max-width: calc(100vw - 24px);
  }

  .chat-composer-container {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-composer[data-composer-state="synthesizing"] .chat-composer-container::after,
  .chat-composer[data-composer-state="recording"] .chat-composer-container::after {
    animation: none;
  }
}

.home-search-input::placeholder {
  color: #dadada;
}

.home-search-input:focus {
  outline: none;
}

.home-ai-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-ai-strip::-webkit-scrollbar {
  display: none;
}

.home-ai-card {
  --home-ai-tint: rgba(52, 49, 110, 0.26);
  --home-ai-shimmer: rgba(121, 106, 224, 0.22);
  --home-ai-shimmer-duration: 13.4s;
  --home-ai-shimmer-delay: -2s;
  position: relative;
  flex: 0 0 150px;
  min-height: 180px;
  padding: 16px;
  border-radius: 16px;
  background:
    radial-gradient(118% 86% at 50% -4%, var(--home-ai-tint) 0%, rgba(25, 27, 35, 0) 58%),
    linear-gradient(180deg, rgba(27, 29, 38, 0.98) 0%, rgba(25, 27, 35, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-clip: padding-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 19px;
  overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
}

.home-ai-card::before {
  content: "";
  position: absolute;
  inset: -14% -10% 42% -10%;
  background:
    radial-gradient(96% 92% at 50% 12%, var(--home-ai-shimmer) 0%, rgba(25, 27, 35, 0) 70%),
    radial-gradient(72% 72% at 18% 8%, rgba(255, 255, 255, 0) 0%, rgba(25, 27, 35, 0) 100%);
  opacity: 0.74;
  transform: translate3d(-4%, -8%, 0);
  animation: home-ai-card-top-glow var(--home-ai-shimmer-duration) ease-in-out infinite;
  animation-delay: var(--home-ai-shimmer-delay);
  pointer-events: none;
  z-index: 0;
}

.home-ai-card--mid {
  --home-ai-tint: rgba(15, 59, 142, 0.24);
  --home-ai-shimmer: rgba(84, 136, 228, 0.2);
  --home-ai-shimmer-duration: 14.6s;
  --home-ai-shimmer-delay: -5s;
}

.home-ai-card--voice {
  --home-ai-tint: rgba(29, 85, 78, 0.24);
  --home-ai-shimmer: rgba(79, 170, 151, 0.19);
  --home-ai-shimmer-duration: 12.7s;
  --home-ai-shimmer-delay: -7s;
}

.home-ai-card--bytedance {
  --home-ai-tint: rgba(90, 64, 18, 0.24);
  --home-ai-shimmer: rgba(170, 128, 66, 0.18);
  --home-ai-shimmer-duration: 13.2s;
  --home-ai-shimmer-delay: -3.5s;
}
.home-ai-card > * {
  position: relative;
  z-index: 1;
}

@keyframes home-ai-card-top-glow {
  0% {
    transform: translate3d(-4%, -8%, 0);
    opacity: 0.7;
  }
  50% {
    transform: translate3d(4%, -1%, 0);
    opacity: 0.84;
  }
  100% {
    transform: translate3d(-4%, -8%, 0);
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-ai-card::before {
    animation: none;
    transform: none;
    opacity: 0.72;
  }
}

.home-ai-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-ai-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-ai-icon svg {
  width: 24px;
  height: 24px;
}

.home-ai-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 19px;
  color: #ffffff;
}

.home-ai-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  line-height: 22px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  align-self: flex-start;
  cursor: pointer;
}

.home-start-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #ffffff;
  color: #000000;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.home-start-chat svg {
  width: 20px;
  height: 20px;
}

.home-start-chat:hover {
  background: #f2f2f2;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
  transform: scale(0.99);
  opacity: 0.95;
}

.home-start-chat:active {
  background: #e9e9e9;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.28);
  transform: scale(0.97);
}

.home-favorites {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #24262e;
  border-radius: 12px;
}

.home-favorites-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: #fefefe;
}

.home-favorites-link {
  background: none;
  border: none;
  color: #58cde7;
  font-size: 12px;
  line-height: 22px;
  cursor: pointer;
  padding: 0;
}

.home-favorites-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 351px;
  overflow-y: auto;
  padding: 0;
}

.home-favorite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(28, 31, 40, 0.98), rgba(22, 25, 33, 0.98));
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.035);
  overflow: hidden;
  flex-shrink: 0;
}

.home-favorite-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding-bottom: 1px;
  border-radius: 12px;
  background: linear-gradient(-84deg, rgba(77, 50, 156, 0.42) 0%, rgba(40, 127, 117, 0.3) 41%, rgba(42, 100, 126, 0.28) 73%, rgba(25, 72, 117, 0.34) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.home-favorite-card > * {
  position: relative;
  z-index: 1;
}

.home-favorite-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-favorite-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.home-favorite-icon img {
  width: 16px;
  height: 16px;
}

.home-favorite-icon svg {
  display: block;
}

.home-favorite-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-favorite-star {
  width: 24px;
  height: 24px;
  border: none;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: transform 0.16s ease;
}

.home-favorite-star svg {
  width: 24px;
  height: 24px;
  display: block;
  transition: opacity 0.18s ease;
}

.home-favorite-star[data-bookmark-state="default"] svg {
  opacity: 0.68;
}

.home-favorite-star[data-bookmark-state="filled"] svg {
  opacity: 1;
}

.home-favorite-star[data-bookmark-state="default"]:hover svg,
.home-favorite-star[data-bookmark-state="default"]:focus-visible svg {
  opacity: 0.84;
}

.home-favorite-star[data-bookmark-state="default"]:active svg,
.home-favorite-star[data-bookmark-state="filled"]:active svg {
  opacity: 1;
}

.home-favorite-star:active {
  transform: scale(0.96);
}

.home-favorite-empty {
  font-size: 13px;
  color: #a8b2d1;
  padding: 10px 4px;
  text-align: center;
}

.home-ai-link:focus-visible,
.home-start-chat:focus-visible,
.home-favorite-card:focus-visible,
.home-favorites-link:focus-visible {
  outline: 2px solid rgba(88, 205, 231, 0.6);
  outline-offset: 2px;
}

/* Profile */
#profile,
#profile-transactions {
  position: relative;
}

#welcome .top-bar,
#shop .top-bar,
#chat_history .top-bar,
#profile .top-bar,
#profile-transactions .top-bar,
#notification-section .top-bar,
#guide-section .top-bar,
#help-section .top-bar,
#chat .top-bar {
  padding: 8px 16px;
  margin: 0 -16px;
  background: rgba(18, 20, 27, calc(0.9 * var(--section-topbar-alpha, 0)));
  border-bottom: 1px solid rgba(255, 255, 255, calc(0.035 * var(--section-topbar-alpha, 0)));
  backdrop-filter: blur(calc(14px * var(--section-topbar-alpha, 0)));
  -webkit-backdrop-filter: blur(calc(14px * var(--section-topbar-alpha, 0)));
  box-shadow: 0 10px 24px rgba(0, 0, 0, calc(0.14 * var(--section-topbar-alpha, 0)));
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, backdrop-filter 0.22s ease;
}

#help-section {
  position: relative;
}

.help-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  min-width: 0;
}

.help-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-search {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(25, 27, 35, 0.3);
  background-blend-mode: soft-light;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
}

.help-search:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(25, 27, 35, 0.34);
}

.help-search:focus-within {
  border-color: rgba(124, 92, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.14);
  background: rgba(26, 28, 37, 0.92);
}

.help-search-icon {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 10px;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  color: rgba(245, 247, 255, 0.92);
}

.help-search-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.help-search-input {
  width: 100%;
  height: 17px;
  min-width: 0;
  flex: 1 1 auto;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #dadada;
  font-size: 14px;
  line-height: 17px;
  letter-spacing: 0.25px;
  text-align: left;
  padding: 0;
}

.help-search-input::placeholder {
  color: #dadada;
}

.help-search-input:focus {
  outline: none;
}

.help-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.help-contact-card {
  position: relative;
  min-height: 132px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  text-decoration: none;
  color: #f4f6ff;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.help-contact-card:hover,
.help-feedback-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.038);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.help-contact-card:focus-visible,
.help-feedback-card:focus-visible {
  outline: none;
  border-color: rgba(124, 92, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.14), 0 12px 24px rgba(0, 0, 0, 0.15);
}

.help-contact-card:active,
.help-feedback-card:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.045);
}

.help-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.075);
  color: #f6f7fb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.help-card-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.help-card-title {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  font-size: 15px;
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.help-feedback-card {
  width: 100%;
  min-height: 78px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: #f4f6ff;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.help-feedback-copy {
  font-size: 15px;
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.help-faq-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-faq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.help-faq-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f7f8fc;
}

.help-view-all {
  border: none;
  background: transparent;
  color: rgba(194, 180, 255, 0.92);
  font-size: 13px;
  line-height: 1.1;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.16s ease, transform 0.16s ease, color 0.16s ease;
}

.help-view-all:hover,
.help-view-all:focus-visible {
  color: rgba(232, 225, 255, 0.98);
  opacity: 1;
}

.help-view-all:focus-visible {
  outline: none;
}

.help-view-all:active {
  transform: scale(0.98);
  opacity: 0.82;
}

.help-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-faq-item {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease;
}

.help-faq-item.is-open {
  background: linear-gradient(180deg, rgba(34, 28, 54, 0.98), rgba(26, 23, 42, 0.98));
  border-color: rgba(124, 92, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(174, 157, 255, 0.06), 0 12px 26px rgba(0, 0, 0, 0.18);
}

.help-faq-trigger {
  width: 100%;
  border: none;
  background: transparent;
  color: #f4f6fb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.help-faq-trigger:hover {
  background: rgba(255, 255, 255, 0.018);
}

.help-faq-trigger:focus-visible {
  outline: none;
  background: rgba(124, 92, 255, 0.08);
}

.help-faq-question {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.help-faq-trigger-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(245, 247, 255, 0.9);
}

.help-faq-trigger-line {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.help-faq-trigger-line--horizontal {
  width: 12px;
  height: 2px;
}

.help-faq-trigger-line--vertical {
  width: 2px;
  height: 12px;
}

.help-faq-item.is-open .help-faq-trigger-line--vertical {
  opacity: 0;
  transform: translate(-50%, -50%) scaleY(0);
}

.help-faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.24s ease, opacity 0.2s ease;
}

.help-faq-item.is-open .help-faq-answer {
  grid-template-rows: 1fr;
  opacity: 1;
}

.help-faq-answer-inner {
  overflow: hidden;
}

.help-faq-answer p {
  margin: 0;
  padding: 0 18px 18px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(232, 235, 246, 0.86);
}

.help-faq-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(232, 235, 246, 0.62);
  text-align: center;
  padding: 20px;
}

.help-faq-empty p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

@media (hover: hover) and (pointer: fine) {
  .help-contact-card:hover,
  .help-feedback-card:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .help-view-all:hover {
    opacity: 0.86;
  }
}

@media (max-width: 640px) {
  .help-contact-grid {
    gap: 12px;
  }

  .help-contact-card {
    min-height: 136px;
    padding: 14px;
  }

  .help-feedback-card,
  .help-search {
    border-radius: 12px;
  }
}

.support-chat-messages {
  padding-top: 6px;
}

.support-chat-empty-state {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 26px 0 10px;
  text-align: center;
}

.support-chat-empty-state[hidden] {
  display: none;
}

.support-chat-empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: rgba(210, 198, 255, 0.96);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.support-chat-empty-icon svg {
  width: 32px;
  height: 32px;
}

.support-chat-empty-title {
  margin: 0;
  max-width: 320px;
  font-size: 18px;
  line-height: 1.24;
  letter-spacing: -0.03em;
  color: #f4f6fb;
}

.support-chat-chip-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.support-chat-chip {
  width: min(100%, 380px);
  min-height: 54px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(124, 92, 255, 0.22);
  background: rgba(35, 37, 48, 0.94);
  color: rgba(245, 246, 251, 0.94);
  font-size: 15px;
  line-height: 1.28;
  font-weight: 500;
  text-align: center;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.support-chat-chip:hover,
.support-chat-chip:focus-visible {
  background: rgba(40, 42, 55, 0.98);
  border-color: rgba(124, 92, 255, 0.3);
}

.support-chat-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.16);
}

.support-chat-chip:active {
  transform: scale(0.985);
  opacity: 0.88;
}

.support-chat-message-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.support-chat-message-attachment {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.support-chat-message-attachment-name {
  font-size: 12px;
  line-height: 1.2;
  color: #f5f6fb;
}

.support-chat-message-attachment-size {
  font-size: 11px;
  line-height: 1.2;
  color: rgba(232, 235, 246, 0.58);
}

.profile-shell,
.profile-transactions-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  min-width: 0;
}

.profile-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.profile-info-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.profile-settings-trigger,
.profile-transactions-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.038);
  color: #f5f7ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.profile-settings-trigger svg,
.profile-transactions-back svg {
  width: 20px;
  height: 20px;
  display: block;
}

.profile-settings-trigger:active,
.profile-transactions-back:active {
  transform: scale(0.97);
}

.profile-settings-trigger:focus-visible,
.profile-transactions-back:focus-visible {
  outline: none;
  border-color: rgba(132, 199, 255, 0.34);
  background: rgba(255, 255, 255, 0.06);
}

.profile-avatar,
.profile-settings-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #d9d9d9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.profile-avatar.has-image,
.profile-settings-avatar.has-image {
  background: transparent;
}

.profile-avatar-img,
.profile-settings-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-avatar.has-image .profile-avatar-img,
.profile-settings-avatar.has-image .profile-settings-avatar-img {
  display: block;
}

.profile-avatar-initials,
.profile-settings-avatar-initials {
  font-size: 18px;
  font-weight: 600;
  color: #111111;
}

.profile-name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: #ffffff;
}

.profile-handle {
  font-size: 12px;
  line-height: 16px;
  color: #7d808d;
}

.profile-balance-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 92% 6%, rgba(64, 104, 224, 0.13) 0%, rgba(64, 104, 224, 0) 44%),
    linear-gradient(180deg, rgba(39, 42, 54, 0.96), rgba(28, 31, 40, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.profile-balance-header,
.profile-balance-row,
.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-balance-row {
  flex-wrap: nowrap;
}

.profile-balance-label,
.profile-section-title,
.profile-section-label {
  font-size: 12px;
  font-weight: 300;
  line-height: 22px;
  color: #b6b6b6;
}

.profile-balance-mark,
.profile-section-label {
  display: inline-flex;
  align-items: center;
}

.profile-balance-mark svg {
  width: 10px;
  height: 15px;
}

.profile-balance-value {
  font-size: 24px;
  line-height: 29px;
  color: #ffffff;
  letter-spacing: 0.5px;
  flex: 1 1 auto;
  min-width: 0;
}

.profile-topup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(21, 44, 88, 0.94) 0%, rgba(47, 101, 205, 0.9) 100%);
  border: 1px solid rgba(113, 173, 255, 0.3);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.14s ease, background 0.14s ease;
  flex: 0 0 auto;
}

.profile-topup-icon svg {
  width: 15px;
  height: 15px;
}

.profile-topup:active {
  transform: scale(0.97);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.profile-topup:focus-visible {
  outline: none;
  border-color: rgba(118, 185, 255, 0.48);
  background: linear-gradient(90deg, rgba(24, 51, 102, 0.96) 0%, rgba(59, 113, 219, 0.92) 100%);
}

.profile-transactions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-section-header {
  padding-bottom: 6px;
  border-bottom: 1px solid #434550;
}

.profile-section-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.profile-filter-toggle {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b6b6b6;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.profile-filter-toggle svg {
  width: 18px;
  height: 18px;
}

.profile-filter-toggle svg path {
  fill: currentColor;
}

.profile-filter-toggle:active {
  transform: scale(0.97);
}

.profile-filter-toggle:focus-visible {
  outline: none;
  border-color: rgba(20, 223, 122, 0.38);
}

.profile-filter-toggle.active {
  color: #14df7a;
  border-color: rgba(20, 223, 122, 0.35);
  background: rgba(20, 223, 122, 0.08);
}

.profile-transactions-list,
.profile-transactions-detail,
.profile-transaction-group__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.profile-transaction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-transaction--detail {
  padding: 14px 0;
}

.profile-transaction-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.profile-transaction-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(38, 40, 50, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.profile-transaction-badge svg {
  width: auto;
  height: 16px;
  display: block;
}

.profile-transaction-badge[data-badge='visa'] svg {
  width: 34px;
  height: 34px;
}

.profile-transaction-badge[data-badge='visa'] {
  background: transparent;
  border: none;
  box-shadow: none;
}

.profile-transaction-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-transaction-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: #ffffff;
}

.profile-transaction-time {
  font-size: 12px;
  font-weight: 300;
  line-height: 18px;
  color: #b6b6b6;
}

.profile-transaction-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  flex-shrink: 0;
}

.profile-transaction-credits,
.profile-transaction-amount {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #b6b6b6;
}

.profile-transaction-amount:empty {
  display: none;
}

.profile-transaction-credits {
  color: #14df7a;
  white-space: nowrap;
}

.profile-transaction--negative .profile-transaction-credits {
  color: #f66164;
}

.profile-view-all {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #f5f7ff;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.profile-view-all:active {
  transform: scale(0.98);
}

.profile-view-all:focus-visible {
  outline: none;
  border-color: rgba(130, 194, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.profile-empty {
  color: #a8b2d1;
  font-size: 13px;
  text-align: center;
  padding: 16px 0;
}

.profile-transactions-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-transactions-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-transaction-filters {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 5px;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(44, 48, 62, 0.94), rgba(33, 37, 48, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: fit-content;
  isolation: isolate;
  overflow: hidden;
}

.profile-transaction-ranges {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 5px;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(43, 47, 60, 0.92), rgba(31, 35, 45, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.045);
  overflow: hidden;
  isolation: isolate;
}

.profile-segmented-pill {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--segmented-pill-w, 0px);
  height: var(--segmented-pill-h, 0px);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(26, 101, 71, 0.95), rgba(16, 78, 54, 0.98));
  border: 1px solid rgba(71, 216, 140, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translate3d(var(--segmented-pill-x, 0px), var(--segmented-pill-y, 0px), 0);
  transform-origin: center;
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    width 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    height 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.2s ease;
  z-index: 0;
  pointer-events: none;
  will-change: transform, width, height, opacity;
}

.profile-transaction-filters.is-pill-ready .profile-segmented-pill,
.profile-transaction-ranges.is-pill-ready .profile-segmented-pill {
  opacity: 1;
}

.profile-transaction-filters.is-pill-static .profile-segmented-pill,
.profile-transaction-ranges.is-pill-static .profile-segmented-pill {
  transition: none;
}

.profile-transaction-ranges.is-custom-mode .profile-segmented-pill {
  opacity: 0;
}

.profile-transaction-filter,
.profile-transaction-range {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  min-height: 42px;
  border-radius: 13px;
  background: transparent;
  color: #a8b0c7;
  font-size: 13px;
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.profile-transaction-filter {
  padding: 0 18px;
}

.profile-transaction-range {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 8px;
}

.profile-transaction-filter.is-active,
.profile-transaction-range.is-active {
  color: #14df7a;
}

.profile-transaction-overview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-transaction-overview,
.profile-transactions-detail {
  will-change: height;
}

.profile-analytics-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: 22px;
  background:
    radial-gradient(140% 180% at 100% 0%, rgba(77, 110, 228, 0.08) 0%, rgba(77, 110, 228, 0) 42%),
    radial-gradient(120% 140% at 0% 100%, rgba(27, 122, 81, 0.07) 0%, rgba(27, 122, 81, 0) 48%),
    linear-gradient(180deg, rgba(39, 43, 55, 0.96), rgba(25, 29, 38, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 0;
  overflow: visible;
}

.profile-analytics-card.is-loading {
  min-height: 354px;
  background: linear-gradient(90deg, rgba(38, 40, 50, 0.92), rgba(55, 58, 72, 0.65), rgba(38, 40, 50, 0.92));
  background-size: 180% 100%;
  animation: profile-card-shimmer 1.2s linear infinite;
}

@keyframes profile-card-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

.profile-analytics-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.profile-analytics-summary__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 220px;
}

.profile-analytics-summary__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.profile-analytics-summary__eyebrow {
  font-size: 11px;
  line-height: 15px;
  letter-spacing: 0.03em;
  color: #9ca4ba;
}

.profile-analytics-summary__value {
  font-size: clamp(30px, 6vw, 42px);
  line-height: 0.96;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.profile-analytics-summary__meta {
  font-size: 12px;
  line-height: 17px;
  color: #9da6bf;
}

.profile-analytics-summary__meta .profile-value-animate,
.profile-analytics-legend-item__meta .profile-value-animate {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.profile-analytics-summary--positive .profile-analytics-summary__value {
  color: #14df7a;
}

.profile-analytics-summary--negative .profile-analytics-summary__value {
  color: #f66164;
}

.profile-analytics-range-shell {
  position: relative;
  flex-shrink: 0;
  min-width: 0;
}

.profile-analytics-range-clear {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #c6cede;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, color 0.18s ease;
}

.profile-analytics-range-clear svg {
  width: 16px;
  height: 16px;
  display: block;
}

.profile-analytics-range-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e5e9f4;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, color 0.18s ease;
}

.profile-analytics-range-chip svg {
  width: 16px;
  height: 16px;
  display: block;
  color: #aeb6c9;
  transition: transform 0.2s ease;
}

.profile-analytics-range-shell.is-open .profile-analytics-range-chip svg {
  transform: rotate(180deg);
}

.profile-analytics-range-chip:active,
.profile-analytics-range-clear:active,
.profile-range-dropdown__action:active {
  transform: scale(0.98);
}

.profile-analytics-range-chip:focus-visible,
.profile-analytics-range-clear:focus-visible,
.profile-range-dropdown__action:focus-visible {
  outline: none;
  border-color: rgba(124, 188, 255, 0.3);
  background: rgba(255, 255, 255, 0.065);
}

.profile-range-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 12;
  width: min(344px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 14px;
  border-radius: 20px;
  background:
    radial-gradient(140% 180% at 100% 0%, rgba(77, 110, 228, 0.08) 0%, rgba(77, 110, 228, 0) 42%),
    radial-gradient(120% 140% at 0% 100%, rgba(27, 122, 81, 0.07) 0%, rgba(27, 122, 81, 0) 48%),
    linear-gradient(180deg, rgba(39, 43, 55, 0.985), rgba(24, 28, 37, 0.995));
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow: 0 24px 48px rgba(2, 6, 15, 0.34);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.profile-range-dropdown[data-range-months="2"] {
  width: min(540px, calc(100vw - 32px));
}

.profile-analytics-range-shell.is-open .profile-range-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-range-dropdown__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.profile-range-dropdown__title {
  font-size: 14px;
  line-height: 19px;
  font-weight: 600;
  color: #f6f8ff;
}

.profile-range-dropdown__subtitle {
  font-size: 11px;
  line-height: 15px;
  color: #9ea8c2;
}

.profile-range-dropdown__calendar {
  position: relative;
}

.profile-range-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-range-dropdown__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.profile-range-dropdown__actions-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-range-dropdown__action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f5f7ff;
  font-size: 12px;
  line-height: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, color 0.18s ease;
}

.profile-range-dropdown__action--primary {
  background: linear-gradient(180deg, rgba(60, 66, 84, 0.98), rgba(73, 79, 96, 0.98));
  border-color: rgba(255, 255, 255, 0.1);
}

.profile-range-dropdown__action--ghost {
  background: rgba(255, 255, 255, 0.03);
}

.profile-range-dropdown__action[disabled] {
  opacity: 0.45;
  cursor: default;
}

.profile-flatpickr.flatpickr-calendar {
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #eef2ff;
  font-family: inherit;
}

.profile-range-dropdown[data-range-months="1"] .profile-flatpickr .flatpickr-rContainer,
.profile-range-dropdown[data-range-months="1"] .profile-flatpickr .flatpickr-days,
.profile-range-dropdown[data-range-months="1"] .profile-flatpickr .dayContainer {
  min-width: 100% !important;
  width: 100% !important;
}

.profile-flatpickr .flatpickr-months {
  margin-bottom: 8px;
}

.profile-flatpickr .flatpickr-month {
  color: #f5f7ff;
}

.profile-flatpickr .flatpickr-current-month {
  padding-top: 2px;
  font-size: 14px;
}

.profile-flatpickr .flatpickr-current-month .flatpickr-monthDropdown-months,
.profile-flatpickr .flatpickr-current-month input.cur-year {
  color: #f5f7ff;
  font-size: 14px;
  font-weight: 600;
}

.profile-flatpickr .flatpickr-prev-month,
.profile-flatpickr .flatpickr-next-month {
  top: 4px;
  color: #aeb7cb;
  fill: currentColor;
}

.profile-flatpickr .flatpickr-prev-month:hover,
.profile-flatpickr .flatpickr-next-month:hover {
  color: #ffffff;
}

.profile-flatpickr .flatpickr-weekdays {
  background: transparent;
}

.profile-flatpickr span.flatpickr-weekday {
  color: #7f89a3;
  font-size: 11px;
  font-weight: 600;
}

.profile-flatpickr .dayContainer {
  gap: 2px 0;
}

.profile-flatpickr .flatpickr-day {
  color: #dce2f0;
  border-radius: 12px;
  border: 1px solid transparent;
  max-width: none;
}

.profile-flatpickr .flatpickr-day.flatpickr-disabled,
.profile-flatpickr .flatpickr-day.flatpickr-disabled:hover,
.profile-flatpickr .flatpickr-day.prevMonthDay,
.profile-flatpickr .flatpickr-day.nextMonthDay {
  color: rgba(128, 137, 160, 0.38);
}

.profile-flatpickr .flatpickr-day:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.profile-flatpickr .flatpickr-day.today {
  border-color: rgba(78, 164, 255, 0.28);
}

.profile-flatpickr .flatpickr-day.inRange,
.profile-flatpickr .flatpickr-day.prevMonthDay.inRange,
.profile-flatpickr .flatpickr-day.nextMonthDay.inRange {
  background: rgba(24, 220, 123, 0.12);
  border-color: transparent;
  box-shadow: none;
}

.profile-flatpickr .flatpickr-day.selected,
.profile-flatpickr .flatpickr-day.startRange,
.profile-flatpickr .flatpickr-day.endRange,
.profile-flatpickr .flatpickr-day.selected:hover,
.profile-flatpickr .flatpickr-day.startRange:hover,
.profile-flatpickr .flatpickr-day.endRange:hover {
  background: linear-gradient(180deg, rgba(24, 220, 123, 0.9), rgba(18, 173, 96, 0.92));
  border-color: rgba(24, 220, 123, 0.25);
  color: #07160f;
}

.profile-analytics-chart {
  display: grid;
  grid-template-columns: repeat(var(--chart-columns, 1), minmax(0, 1fr));
  align-items: end;
  gap: var(--chart-gap, 10px);
  min-height: 210px;
  min-width: 0;
  overflow: hidden;
}

.profile-chart-column {
  display: grid;
  grid-template-rows: 12px minmax(144px, 1fr) 16px;
  gap: 8px;
  min-width: 0;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1) var(--chart-enter-delay, 0ms),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1) var(--chart-enter-delay, 0ms);
}

.profile-chart-value {
  font-size: 9px;
  line-height: 11px;
  color: #8892ad;
  text-align: center;
  white-space: nowrap;
}

.profile-chart-rail {
  position: relative;
  height: 160px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.profile-chart-stack {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  height: calc((100% - 10px) * var(--bar-height, 0) / 100);
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  transform-origin: bottom center;
  transform: scaleY(0.001);
  opacity: 0.55;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1) var(--chart-enter-delay, 0ms),
    opacity 0.24s ease var(--chart-enter-delay, 0ms),
    height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-chart-segment {
  border: none;
  padding: 0;
  width: 100%;
  height: calc(var(--segment-height, 0) * 1%);
  min-height: 7px;
  border-radius: 10px;
  background: var(--segment-color, #14df7a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.profile-chart-label {
  font-size: 11px;
  line-height: 15px;
  color: #a6aec3;
  text-align: center;
  min-width: 0;
}

.profile-analytics-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-analytics-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 176px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: #a8b2d1;
  font-size: 14px;
  text-align: center;
  padding: 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.profile-transaction-overview.is-animating .profile-chart-column,
.profile-transaction-overview.is-animating .profile-analytics-empty {
  opacity: 1;
  transform: translateY(0);
}

.profile-transaction-overview.is-animating .profile-chart-stack {
  transform: scaleY(1);
  opacity: 1;
}

.profile-analytics-chart--compact .profile-chart-value,
.profile-analytics-chart--dense .profile-chart-value {
  font-size: 8px;
  line-height: 10px;
}

.profile-analytics-chart--compact .profile-chart-label {
  font-size: 10px;
  line-height: 14px;
}

.profile-analytics-chart--dense .profile-chart-label {
  font-size: 9px;
  line-height: 13px;
}

.profile-analytics-chart--dense .profile-chart-column {
  gap: 8px;
}

.profile-range-error {
  font-size: 12px;
  line-height: 16px;
  color: #f47b81;
  margin-top: 8px;
}

.profile-analytics-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.03);
  color: #f5f7ff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.profile-analytics-legend-item__swatch {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--legend-color, #14df7a);
}

.profile-analytics-legend-item__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.profile-analytics-legend-item__label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: #ffffff;
}

.profile-analytics-legend-item__meta {
  font-size: 11px;
  line-height: 15px;
  color: #a5aec3;
}

.profile-chart-segment.is-selected,
.profile-analytics-legend-item.is-selected {
  opacity: 1;
}

.profile-chart-segment.is-selected {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 16px rgba(0, 0, 0, 0.18);
}

.profile-analytics-legend-item.is-selected {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.09);
}

.profile-chart-segment.is-dimmed,
.profile-analytics-legend-item.is-dimmed {
  opacity: 0.28;
  filter: saturate(0.72);
}

.profile-value-animate {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transform-origin: center center;
  will-change: filter, transform, opacity;
  transition:
    filter 116ms var(--motion-ease-soft),
    transform 116ms var(--motion-ease-soft),
    opacity 116ms var(--motion-ease-soft);
}

.profile-value-animate.is-updating {
  filter: blur(2.8px);
  transform: scale(0.95);
  opacity: 0.8;
}

.profile-value-animate.is-overshooting {
  filter: blur(1.1px);
  transform: scale(1.045);
  opacity: 0.94;
}

.profile-transaction-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-transaction-group__header {
  padding-top: 6px;
}

.profile-transaction-group__label {
  font-size: 13px;
  line-height: 18px;
  color: #9ba2b7;
  letter-spacing: 0.01em;
}

.profile-settings-modal {
  z-index: 60;
}

.profile-settings-card {
  max-width: none;
  width: min(448px, calc(100vw - 14px));
  background:
    linear-gradient(180deg, rgba(31, 34, 44, 0.985), rgba(21, 24, 33, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
  border-radius: 24px;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.profile-settings-card .history-modal-header {
  padding: 13px 13px 10px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  background: transparent;
}

.profile-settings-card .history-modal-heading {
  gap: 8px;
}

.profile-settings-card .modal-question {
  font-size: 17px;
  line-height: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-settings-card .modal-desc {
  max-width: 320px;
  font-size: 12px;
  line-height: 17px;
  color: #9ba3b8;
}

.profile-settings-card .history-modal-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.profile-settings-card .history-modal-close svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.7;
}

.profile-settings-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 13px 8px;
}

.profile-settings-avatar-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.042);
  background:
    linear-gradient(135deg, rgba(91, 114, 255, 0.07), rgba(255, 255, 255, 0.016) 55%, rgba(116, 228, 196, 0.04));
}

.profile-settings-avatar-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.profile-settings-avatar-title,
.profile-settings-linkage-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.profile-settings-avatar-desc {
  font-size: 12px;
  line-height: 16px;
  color: #9ba2b7;
}

.profile-settings-card .history-modal-label {
  font-size: 11px;
  line-height: 15px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8d95aa;
}

.profile-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-settings-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.profile-settings-card .modal-input {
  min-height: 46px;
  padding: 0 13px;
  border-radius: 15px;
  border-color: rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.022);
}

.profile-settings-avatar-btn {
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #f5f7ff;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.profile-settings-avatar-btn:active,
.profile-session-action:active {
  transform: scale(0.98);
}

.profile-settings-avatar-btn:focus-visible,
.profile-session-action:focus-visible {
  outline: none;
  border-color: rgba(132, 199, 255, 0.28);
}

.profile-session-action--danger:focus-visible {
  border-color: rgba(244, 123, 129, 0.28);
}

.profile-settings-linkage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.022), rgba(97, 165, 255, 0.038) 100%);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.profile-settings-linkage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #aeb3c4;
}

.profile-settings-linkage-row strong {
  color: #ffffff;
  font-weight: 500;
  text-align: right;
}

.profile-settings-session-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 0;
}

.profile-session-action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.024);
  color: #f5f7ff;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, color 0.18s ease;
  flex: 1 1 calc(50% - 5px);
  min-width: 0;
}

.profile-session-action__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.92);
}

.profile-session-action__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.profile-session-action--danger {
  color: #f47b81;
  border-color: rgba(244, 123, 129, 0.12);
  background: rgba(244, 123, 129, 0.04);
}

.profile-settings-card .history-modal-actions {
  padding: 10px 13px 13px;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  background: transparent;
}

.profile-settings-card .modal-btn {
  min-height: 44px;
  border-radius: 15px;
}

.profile-settings-card .modal-btn.secondary {
  background: rgba(255, 255, 255, 0.025);
}

@media (max-width: 940px) {
  .profile-analytics-summary {
    flex-wrap: wrap;
  }

  .profile-analytics-summary__copy {
    flex-basis: 100%;
  }

  .profile-analytics-summary__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 540px) {
  .profile-balance-row {
    flex-direction: row;
    align-items: center;
  }

  .profile-topup {
    width: auto;
  }

  .profile-analytics-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-range-dropdown {
    width: min(344px, calc(100vw - 32px));
  }

  .profile-analytics-summary__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .profile-analytics-chart {
    gap: var(--chart-gap, 6px);
    min-height: 188px;
  }

  .profile-chart-column {
    grid-template-rows: 10px minmax(132px, 1fr) 15px;
    gap: 7px;
  }

  .profile-chart-rail {
    height: 142px;
    border-radius: 16px;
  }

  .profile-analytics-legend {
    grid-template-columns: 1fr;
  }

  .profile-settings-avatar-row {
    align-items: flex-start;
  }

  .profile-settings-card .history-modal-header,
  .profile-settings-body,
  .profile-settings-card .history-modal-actions {
    padding-left: 13px;
    padding-right: 13px;
  }
}

@media (max-width: 420px) {
  .profile-settings-fields {
    grid-template-columns: 1fr;
  }

  .profile-session-action {
    flex-basis: 100%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .profile-settings-trigger:hover,
  .profile-transactions-back:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
  }

  .profile-topup:hover {
    transform: scale(0.99);
    opacity: 0.96;
    background: linear-gradient(90deg, rgba(23, 48, 97, 0.96) 0%, rgba(58, 112, 219, 0.92) 100%);
    border-color: rgba(124, 190, 255, 0.38);
  }

  .profile-filter-toggle:hover {
    opacity: 0.92;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
  }

  .profile-view-all:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.13);
  }

  .profile-transaction-filter:hover,
  .profile-transaction-range:hover {
    color: #d8def0;
  }

  .profile-analytics-range-chip:hover,
  .profile-analytics-range-clear:hover,
  .profile-range-dropdown__action:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .profile-range-dropdown__action--primary:hover {
    background: linear-gradient(180deg, rgba(74, 80, 99, 0.98), rgba(86, 93, 112, 0.98));
  }

  .profile-settings-avatar-btn:hover,
  .profile-session-action:hover {
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.13);
  }

  .profile-session-action--danger:hover {
    background: rgba(244, 123, 129, 0.11);
    border-color: rgba(244, 123, 129, 0.28);
  }

  .profile-chart-segment:hover,
  .profile-analytics-legend-item:hover {
    opacity: 0.92;
  }

  .profile-analytics-legend-item:hover {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.042);
  }
}

/* Shop page */
#shop {
  position: relative;
  overflow: visible;
}

#shop .top-bar {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: 56px;
}

#shop .shop-test-mode-banner {
  width: 100%;
  padding: 8px 12px;
  margin: 0 0 8px 0;
  font-size: 12px;
  line-height: 1.4;
  color: #1a1a1a;
  background: #fef3c7;
  border-radius: 8px;
  text-align: center;
  box-sizing: border-box;
}

#shop .shop-test-mode-banner a {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
}

#shop .shop-test-mode-banner a:hover {
  color: #92400e;
}

#shop .shop-top-balance {
  position: absolute;
  left: 50%;
  display: inline-flex;
  align-items: baseline;
  gap: 0.24ch;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
}

#shop .shop-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 16px 0 calc(120px + env(safe-area-inset-bottom));
}

#shop .shop-credits-heading {
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
  color: #ffffff;
  margin-top: 6px;
}

#shop .shop-token-card {
  position: relative;
  width: 100%;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

#shop .shop-token-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  pointer-events: none;
  color: #ffffff;
  font-size: 56px;
  font-weight: 600;
  line-height: 0.88;
  z-index: 1;
  transition: opacity 140ms var(--motion-ease-soft), transform 140ms var(--motion-ease-soft);
}

#shop .shop-token-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  padding: 0 18px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 56px;
  font-weight: 600;
  line-height: 0.88;
  text-align: center;
  outline: none;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  transition: color 120ms var(--motion-ease-soft), opacity 120ms var(--motion-ease-soft);
}

#shop .shop-token-input::-webkit-scrollbar {
  display: none;
}

#shop .shop-token-card.is-editing .shop-token-display {
  opacity: 0;
  transform: translateY(-4px);
}

#shop .shop-token-card.is-editing .shop-token-input {
  color: #ffffff;
  caret-color: #ffffff;
  opacity: 1;
  pointer-events: auto;
}

#shop .shop-token-card:not(.is-editing) .shop-token-input {
  color: transparent;
  caret-color: transparent;
  opacity: 0;
  pointer-events: none;
}

#shop .shop-value-animate {
  display: inline-flex;
  font-variant-numeric: tabular-nums;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  will-change: transform, opacity;
}

#shop .shop-value-animate.is-refreshing {
  animation: shopValueRefresh 180ms cubic-bezier(0.22, 0.78, 0.18, 1);
}

#shop .shop-value-inline {
  white-space: nowrap;
}

#shop .shop-token-display.shop-value-animate,
#shop .shop-token-display .shop-value-animate {
  align-items: center;
  line-height: inherit;
}

@keyframes shopValueRefresh {
  0% {
    opacity: 0.48;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

#shop .shop-slider {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  --shop-slider-fill: 23%;
  overflow: visible;
}

#shop .shop-slider-track {
  position: relative;
  height: 6px;
  background: rgba(120, 120, 128, 0.16);
  border-radius: 999px;
  overflow: visible;
}

#shop .shop-slider-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  width: var(--shop-slider-fill);
  background: #ffffff;
  border-radius: 100px;
}

#shop .shop-slider-thumb {
  position: absolute;
  top: 50%;
  left: var(--shop-slider-fill);
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #262832;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

#shop .shop-slider-input {
  position: absolute;
  left: 0;
  top: -8px;
  width: 100%;
  height: 28px;
  opacity: 0;
  cursor: pointer;
}

#shop .shop-slider-labels {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#shop .shop-slider-endpoint {
  min-width: 0;
  width: 100%;
  font-size: 13px;
  line-height: 22px;
  color: #b6b6b6;
}

#shop .shop-slider-endpoint:last-child {
  text-align: right;
}

#shop .shop-credit-selection {
  width: 100%;
  display: flex;
  justify-content: center;
}

#shop .shop-credit-options {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

#shop .shop-credit-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  min-width: 60px;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: none;
  color: #ffffff;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.12s ease;
}

#shop .shop-credit-option:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.99);
  opacity: 0.95;
}

#shop .shop-credit-option:active {
  transform: scale(0.97);
}

#shop .shop-credit-option.active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

#shop .shop-context-hint {
  width: 100%;
  min-height: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.24ch;
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  color: #ffffff;
}

#shop .shop-glass-panel {
  width: 100%;
  background: rgba(97, 94, 94, 0.1);
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

#shop .shop-glass-title {
  font-size: 13px;
  font-weight: 400;
  line-height: 22px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
}

#shop .shop-glass-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

#shop .shop-glass-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 22px;
  color: #ffffff;
}

#shop .shop-glass-value {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.16ch;
  font-size: 13px;
  font-weight: 400;
  line-height: 22px;
  color: #ffffff;
}

#shop .shop-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: transparent;
  cursor: default;
}

#shop .shop-tooltip-trigger svg {
  width: 16px;
  height: 16px;
  display: block;
}

#shop .shop-disclaimer {
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  line-height: 20px;
  color: #ffffff;
  opacity: 0.8;
}

#shop .shop-purchase-btn {
  position: fixed;
  left: 50%;
  bottom: calc(var(--footer-floating-cta-bottom) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: 94%;
  max-width: 560px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #ffffff;
  color: #191b23;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.12s ease, background 0.12s ease;
  z-index: 9;
}

#shop .shop-purchase-btn:hover:not(:disabled) {
  background: #f2f2f2;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%) scale(0.99);
  opacity: 0.95;
}

#shop .shop-purchase-btn:active:not(:disabled) {
  background: #e9e9e9;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%) scale(0.97);
}

#shop .shop-purchase-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

#shop .shop-purchase-label,
#shop .shop-purchase-price {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: #191b23;
}

#shop .shop-purchase-price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

#shop .shop-purchase-currency {
  display: inline-block;
}

#shop .shop-purchase-divider {
  width: 1px;
  height: 22px;
  background: #b6b6b6;
}

#shop .shop-tooltip {
  position: fixed;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#shop .shop-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

#shop .shop-tooltip-content {
  background: #1f2129;
  color: #f2f3f7;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 18px;
  border: none;
  width: fit-content;
  max-width: min(90vw, 380px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

#shop .shop-tooltip-line + .shop-tooltip-line {
  margin-top: 4px;
}

#shop .shop-tooltip-example {
  color: rgba(242, 243, 247, 0.8);
}

body.shop-payment-modal-open .footer.tap-bar.bottom-bar {
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
}

#shop .shop-payment-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(5, 6, 10, 0);
  transition: opacity var(--motion-fast) var(--motion-ease-enter),
    background var(--motion-fast) var(--motion-ease-enter),
    visibility 0s linear var(--motion-fast);
}

#shop .shop-payment-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(5, 6, 10, 0.68);
  transition-delay: 0s;
}

#shop .shop-payment-sheet {
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100vw;
  max-width: 560px;
  min-height: 409px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 24px;
  padding: 32px 16px calc(96px + env(safe-area-inset-bottom));
  background:
    radial-gradient(96% 112% at 50% -8%, rgba(84, 96, 223, 0.12) 0%, rgba(84, 96, 223, 0) 50%),
    #191b23;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 16px 16px 0 0;
  isolation: isolate;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-50%) translateY(28px);
  transition: opacity var(--motion-fast) var(--motion-ease-enter),
    transform var(--motion-fast) var(--motion-ease-enter);
  will-change: transform, opacity;
}

#shop .shop-payment-modal.open .shop-payment-sheet {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#shop .shop-payment-sheet::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -418px;
  width: 420px;
  height: 420px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(52, 49, 110, 0.24) 0%, rgba(52, 49, 110, 0) 72%);
  z-index: 0;
  pointer-events: none;
}

#shop .shop-payment-animate {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(14px) scale(0.992);
  transition: opacity var(--motion-fast) var(--motion-ease-soft),
    transform var(--motion-fast) var(--motion-ease-soft);
}

#shop .shop-payment-modal.is-ready .shop-payment-animate {
  opacity: 1;
  transform: none;
}

#shop .shop-payment-modal.is-ready .shop-payment-header {
  transition-delay: 18ms;
}

#shop .shop-payment-modal.is-ready .shop-payment-option-reveal:nth-of-type(1) {
  transition-delay: 36ms;
}

#shop .shop-payment-modal.is-ready .shop-payment-option-reveal:nth-of-type(2) {
  transition-delay: 54ms;
}

#shop .shop-payment-modal.is-ready .shop-payment-option-reveal:nth-of-type(3) {
  transition-delay: 72ms;
}

#shop .shop-payment-modal.is-ready .shop-payment-pay-reveal {
  transition-delay: 90ms;
}

#shop .shop-payment-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

#shop .shop-payment-sparkle {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

#shop .shop-payment-sparkle svg {
  width: 24px;
  height: 24px;
  display: block;
}

#shop .shop-payment-title {
  margin: 0;
  color: #ffffff;
  font-size: 24px;
  font-weight: 400;
  line-height: 29px;
  letter-spacing: -0.02em;
}

#shop .shop-payment-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#shop .shop-payment-option-reveal,
#shop .shop-payment-pay-reveal {
  width: 100%;
}

#shop .shop-payment-option {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease,
    background 0.15s ease, border-color 0.15s ease, box-shadow 0.12s ease;
}

#shop .shop-payment-option:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.08);
}

#shop .shop-payment-option:active {
  transform: scale(0.97);
}

#shop .shop-payment-option.is-selected {
  border-color: rgba(124, 188, 255, 0.34);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(87, 102, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(33, 183, 255, 0.06);
}

#shop .shop-payment-option:focus-visible,
#shop .shop-payment-pay-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(110, 201, 255, 0.6);
}

#shop .shop-payment-option-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  line-height: 19px;
}

#shop .shop-payment-card-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

#shop .shop-payment-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}

#shop .shop-payment-card-icon--visa {
  width: 54px;
  height: 24px;
}

#shop .shop-payment-card-icon--mastercard {
  width: 38px;
  height: 24px;
}

#shop .shop-payment-card-icon svg {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
}

#shop .shop-payment-card-icon--visa svg {
  width: 130px;
  height: 96px;
  left: -38px;
  top: -16px;
}

#shop .shop-payment-card-icon--mastercard svg {
  width: 107px;
  height: 99px;
  left: -37px;
  top: -18px;
}

#shop .shop-payment-option-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

#shop .shop-payment-option-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

#shop .shop-payment-pay-btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  background: #ffffff;
  color: #191b23;
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease,
    box-shadow 0.12s ease, background 0.12s ease;
}

#shop .shop-payment-pay-label,
#shop .shop-payment-pay-price {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: #191b23;
}

#shop .shop-payment-pay-divider {
  width: 1px;
  height: 22px;
  background: #b6b6b6;
  flex: 0 0 auto;
}

#shop .shop-payment-pay-price {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 52px;
}

#shop .shop-payment-pay-currency:empty {
  display: none;
}

#shop .shop-payment-pay-btn:hover:not(:disabled) {
  background: #f2f2f2;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
  transform: scale(0.99);
  opacity: 0.95;
}

#shop .shop-payment-pay-btn:active:not(:disabled) {
  background: #e9e9e9;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  transform: scale(0.97);
}

#shop .shop-payment-pay-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

#shop .shop-payment-pay-btn[data-state="loading"]:disabled {
  cursor: wait;
}

@media (prefers-reduced-motion: reduce) {
  #shop .shop-payment-modal,
  #shop .shop-payment-sheet,
  #shop .shop-payment-animate {
    transition-duration: 1ms !important;
  }

  #shop .shop-payment-animate {
    opacity: 1;
    transform: none;
  }
}

/* Login UI: isolate login-only fullscreen rules from authenticated screens. */
body.login-only {
  overflow: hidden;
}

.login-only .page.login-page {
  /* Floor + measured strategy to prevent dock clipping on early/unstable layout passes. */
  --login-dock-base: 190px;
  --login-dock-measured: 0px;
  --login-dock-space: calc(max(var(--login-dock-base), var(--login-dock-measured)) + env(safe-area-inset-bottom));
  --login-icon-surface: rgba(25, 27, 35, 0.7);
  --login-scroll-progress: 0;
  position: relative;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 0;
  padding-bottom: 0;
}

/* Login glow layers: keep ambient effects behind content without adding scroll. */
.login-only .page.login-page::before,
.login-only .page.login-page::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.login-only .page.login-page::before {
  inset: -20% -16% auto;
  height: 62%;
  background:
    radial-gradient(62% 68% at 50% 12%, rgba(84, 64, 236, 0.82) 0%, rgba(84, 64, 236, 0.22) 46%, rgba(84, 64, 236, 0) 75%),
    radial-gradient(44% 48% at 86% 18%, rgba(40, 104, 216, 0.42) 0%, rgba(40, 104, 216, 0) 72%);
}

.login-only .page.login-page::after {
  inset: 46% -12% -10% -12%;
  background:
    radial-gradient(50% 40% at 20% 34%, rgba(67, 188, 179, 0.16) 0%, rgba(67, 188, 179, 0) 72%),
    linear-gradient(180deg, rgba(12, 14, 22, 0) 0%, rgba(12, 14, 22, 0.7) 44%, #0b0d14 100%);
}

/* Login no-scroll: hard-lock login section to viewport height. */
.login-only .section.active#login {
  position: relative;
  height: 100%;
  overflow: hidden;
  padding-bottom: 0;
}

.login-only #login .login-shell {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(22px + var(--tg-top-inset, 0px)) 0 var(--login-dock-space);
}

.login-only #login .login-center {
  min-height: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(8px, 1.8vh, 18px) clamp(8px, 2vw, 16px) 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  gap: clamp(12px, 2vh, 22px);
}

/* Shared app motion: login-style staged entry for authenticated sections. */
html.app-motion-js body:not(.login-only) .app-motion-section.motion-enabled.active:not(.is-ready) [data-motion-role='text'] {
  opacity: 0;
  transform: translateY(12px) scale(0.985);
}

html.app-motion-js body:not(.login-only) .app-motion-section.motion-enabled.active:not(.is-ready) [data-motion-role='panel'] {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(10px);
}

html.app-motion-js body:not(.login-only) .app-motion-section.motion-enabled.active:not(.is-ready) [data-motion-role='row'] {
  opacity: 0;
  transform: translateY(13px);
}

html.app-motion-js body:not(.login-only) .app-motion-section.motion-enabled.active:not(.is-ready) [data-motion-role='message'] {
  opacity: 0;
  transform: translateY(10px);
}

html.app-motion-js body:not(.login-only) .app-motion-section.motion-enabled.active:not(.is-ready) [data-motion-role='control'] {
  opacity: 0;
  transform: translateY(9px) scale(0.988);
}

html.app-motion-js body:not(.login-only) .app-motion-section.motion-enabled.active:not(.is-ready) [data-motion-fixed='true'] {
  opacity: 0;
  transform: var(--app-motion-fixed-transform, translateX(-50%));
  filter: none;
}

.app-motion-section.motion-enabled .app-motion-item {
  --app-motion-y: 12px;
  --app-motion-scale: 1;
  --app-motion-blur: 0px;
  --app-motion-duration: var(--motion-base);
  --app-motion-easing: var(--motion-ease-soft);
  opacity: 0;
  transform: translateY(var(--app-motion-y)) scale(var(--app-motion-scale));
  filter: blur(var(--app-motion-blur));
  transition:
    opacity var(--app-motion-duration) var(--app-motion-easing),
    transform var(--app-motion-duration) var(--app-motion-easing),
    filter var(--app-motion-duration) var(--app-motion-easing);
  transition-delay: var(--motion-item-delay, 0ms);
  pointer-events: none;
  will-change: transform, opacity, filter;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}

.app-motion-section.motion-enabled .app-motion-item[data-motion-fixed='true'] {
  transform: var(--app-motion-fixed-transform, translateX(-50%));
  filter: none;
  transition:
    opacity var(--app-motion-duration) var(--app-motion-easing),
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  will-change: opacity, transform;
}

.app-motion-section.motion-enabled .app-motion-item.is-visible,
.app-motion-section.motion-enabled .app-motion-item.is-inview {
  opacity: 1;
  transform: none;
  filter: none;
  pointer-events: auto;
}

.app-motion-section.motion-enabled .app-motion-item[data-motion-fixed='true'].is-visible,
.app-motion-section.motion-enabled .app-motion-item[data-motion-fixed='true'].is-inview {
  opacity: 1;
  transform: var(--app-motion-fixed-transform, translateX(-50%));
  filter: none;
  pointer-events: auto;
}

.app-motion-section.motion-enabled[data-motion-variant='full'] [data-motion-role='text'] {
  --app-motion-y: 12px;
  --app-motion-scale: 0.985;
  --app-motion-duration: var(--motion-base);
  --app-motion-easing: var(--motion-ease-enter);
}

.app-motion-section.motion-enabled[data-motion-variant='full'] [data-motion-role='panel'] {
  --app-motion-y: 18px;
  --app-motion-blur: 10px;
  --app-motion-duration: var(--motion-base);
}

.app-motion-section.motion-enabled[data-motion-variant='full'] [data-motion-role='row'] {
  --app-motion-y: 13px;
  --app-motion-duration: var(--motion-base);
}

.app-motion-section.motion-enabled[data-motion-variant='full'] [data-motion-role='message'] {
  --app-motion-y: 10px;
  --app-motion-duration: var(--motion-base);
}

.app-motion-section.motion-enabled[data-motion-variant='full'] [data-motion-role='control'] {
  --app-motion-y: 9px;
  --app-motion-scale: 0.988;
  --app-motion-duration: var(--motion-base);
  --app-motion-easing: var(--motion-ease-enter);
}

.app-motion-section.motion-enabled[data-motion-variant='fast'] [data-motion-role='text'] {
  --app-motion-y: 8px;
  --app-motion-scale: 0.996;
  --app-motion-duration: var(--motion-fast);
  --app-motion-easing: var(--motion-ease-enter);
}

.app-motion-section.motion-enabled[data-motion-variant='fast'] [data-motion-role='panel'] {
  --app-motion-y: 12px;
  --app-motion-duration: var(--motion-fast);
}

.app-motion-section.motion-enabled[data-motion-variant='fast'] [data-motion-role='row'] {
  --app-motion-y: 10px;
  --app-motion-duration: var(--motion-fast);
}

.app-motion-section.motion-enabled[data-motion-variant='fast'] [data-motion-role='message'] {
  --app-motion-y: 8px;
  --app-motion-duration: var(--motion-fast);
}

.app-motion-section.motion-enabled[data-motion-variant='fast'] [data-motion-role='control'] {
  --app-motion-y: 8px;
  --app-motion-duration: var(--motion-fast);
  --app-motion-easing: var(--motion-ease-enter);
}

@media (prefers-reduced-motion: reduce) {
  html.app-motion-js body:not(.login-only) .app-motion-section.motion-enabled.active:not(.is-ready) [data-motion-role] {
    opacity: 1;
    transform: none;
    filter: none;
  }

  html.app-motion-js body:not(.login-only) .app-motion-section.motion-enabled.active:not(.is-ready) [data-motion-fixed='true'] {
    transform: var(--app-motion-fixed-transform, translateX(-50%));
  }

  .app-motion-section.motion-enabled .app-motion-item {
    opacity: 1;
    transform: none;
    filter: none;
    transition: opacity var(--motion-fast) linear !important;
    transition-delay: 0ms !important;
    pointer-events: auto;
  }

  .app-motion-section.motion-enabled .app-motion-item[data-motion-fixed='true'] {
    transform: var(--app-motion-fixed-transform, translateX(-50%));
  }
}

/* Login motion: staged entry is opt-in through JS class toggles. */
.login-only #login.motion-enabled .login-badge,
.login-only #login.motion-enabled .login-title,
.login-only #login.motion-enabled .login-subtitle,
.login-only #login.motion-enabled .login-icon-tile,
.login-only #login.motion-enabled .login-icon-label,
.login-only #login.motion-enabled .login-value-card,
.login-only #login.motion-enabled .login-fixed-actions {
  opacity: 0;
}

.login-only #login.motion-enabled .login-badge,
.login-only #login.motion-enabled .login-title,
.login-only #login.motion-enabled .login-subtitle {
  transform: translateY(12px) scale(0.985);
  transition: opacity var(--motion-base) var(--motion-ease-enter), transform var(--motion-base) var(--motion-ease-enter);
}

.login-only #login.motion-enabled .login-icon-tile {
  transform: translateY(10px) scale(0.92);
  transition: opacity var(--motion-base) var(--motion-ease-enter), transform var(--motion-base) var(--motion-ease-enter);
}

.login-only #login.motion-enabled .login-icon-label {
  transform: translateY(7px);
  transition: opacity var(--motion-fast) var(--motion-ease-soft), transform var(--motion-fast) var(--motion-ease-soft);
}

.login-only #login.motion-enabled .login-value-card {
  transform: translateY(20px);
  filter: blur(10px);
  transition:
    opacity var(--motion-base) var(--motion-ease-soft),
    transform var(--motion-base) var(--motion-ease-soft),
    filter var(--motion-base) var(--motion-ease-soft);
  will-change: transform, opacity;
}

.login-only #login.motion-enabled .login-fixed-actions {
  transform: translateY(20px);
  transition: opacity var(--motion-base) var(--motion-ease-enter), transform var(--motion-base) var(--motion-ease-enter);
}

.login-only #login.is-ready .login-badge,
.login-only #login.is-ready .login-title,
.login-only #login.is-ready .login-subtitle,
.login-only #login.is-ready .login-icon-tile,
.login-only #login.is-ready .login-icon-label,
.login-only #login.is-ready .login-fixed-actions {
  opacity: 1;
  transform: none;
}

.login-only #login.is-ready .login-badge {
  transition-delay: 30ms;
}

.login-only #login.is-ready .login-title {
  transition-delay: 90ms;
}

.login-only #login.is-ready .login-subtitle {
  transition-delay: 130ms;
}

.login-only #login.is-ready .login-fixed-actions {
  transition-delay: 520ms;
}

.login-only #login .login-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(242, 243, 247, 0.76);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.login-only #login .login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.login-only #login .login-title {
  margin: 0;
  max-width: 660px;
  font-size: clamp(42px, 11vw, 92px);
  line-height: 0.95;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.045em;
  text-shadow: 0 10px 26px rgba(83, 74, 232, 0.34);
}

.login-only #login .login-subtitle {
  margin: 0;
  max-width: 460px;
  color: rgba(242, 243, 247, 0.64);
  font-size: clamp(14px, 2.2vw, 17px);
  line-height: 1.45;
}

.login-only #login .login-icon-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.login-only #login .login-icon-item {
  --icon-delay: 0ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.login-only #login .login-icon-item:nth-child(1) {
  --icon-delay: 170ms;
}

.login-only #login .login-icon-item:nth-child(2) {
  --icon-delay: 220ms;
}

.login-only #login .login-icon-item:nth-child(3) {
  --icon-delay: 270ms;
}

.login-only #login .login-icon-item:nth-child(4) {
  --icon-delay: 320ms;
}

.login-only #login.is-ready .login-icon-item .login-icon-tile {
  transition-delay: var(--icon-delay);
}

.login-only #login.is-ready .login-icon-item .login-icon-label {
  transition-delay: calc(var(--icon-delay) + 80ms);
}

.login-only #login .login-icon-tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 84px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-only #login .login-model-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-only #login .login-model-icon svg {
  width: 30px;
  height: 30px;
}

.login-only #login .login-model-icon--flux svg {
  width: 30px;
  height: 20px;
}

.login-only #login .login-model-icon--seedream svg {
  width: 26px;
  height: 26px;
}

.login-only #login .login-model-icon path {
  fill: currentColor !important;
}

.login-only #login .login-model-icon {
  color: #ffffff;
}

.login-only #login .login-icon-label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(245, 246, 251, 0.94);
}

.login-only #login .login-value-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-only #login .login-value-list .login-value-card {
  --card-delay: 0ms;
}

.login-only #login .login-value-list .login-value-card:nth-child(1) {
  --card-delay: 230ms;
}

.login-only #login .login-value-list .login-value-card:nth-child(2) {
  --card-delay: 280ms;
}

.login-only #login .login-value-list .login-value-card:nth-child(3) {
  --card-delay: 330ms;
}

.login-only #login .login-value-list .login-value-card:nth-child(4) {
  --card-delay: 380ms;
}

.login-only #login .login-value-list .login-value-card:nth-child(5) {
  --card-delay: 430ms;
}

.login-only #login.is-ready .login-value-card.is-inview {
  opacity: 1;
  transform: none;
  filter: none;
  transition-delay: var(--card-delay);
}

.login-only #login .login-value-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 22px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(34, 37, 49, 0.31) 0%, rgba(20, 23, 33, 0.39) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 28px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
  text-align: left;
}

.login-only #login .login-value-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(to bottom, rgba(52, 49, 110, 0.55) -20%, var(--login-icon-surface) 44%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: rgba(234, 240, 255, 0.92);
}

.login-only #login .login-value-icon--sync {
  background: linear-gradient(to bottom, rgba(29, 85, 78, 0.55) -20%, var(--login-icon-surface) 44%);
  color: #82e6d8;
}

.login-only #login .login-value-icon--credits {
  background: linear-gradient(to bottom, rgba(52, 49, 110, 0.55) -20%, var(--login-icon-surface) 44%);
  color: #c4b0ff;
}

.login-only #login .login-value-icon--models {
  background: linear-gradient(to bottom, rgba(15, 59, 142, 0.55) -20%, var(--login-icon-surface) 44%);
  color: #90c2ff;
}

.login-only #login .login-value-icon--saved {
  background: linear-gradient(to bottom, rgba(90, 64, 18, 0.55) -20%, var(--login-icon-surface) 44%);
  color: #e9c88f;
}

.login-only #login .login-value-icon--secure {
  background: linear-gradient(to bottom, rgba(70, 84, 126, 0.58) -20%, var(--login-icon-surface) 44%);
  color: #b7c8ff;
}

.login-only #login .login-value-icon svg {
  width: 24px;
  height: 24px;
}

.login-only #login .login-value-copy h3 {
  margin: 0;
  color: #f5f6fb;
  font-size: clamp(18px, 2.8vw, 22px);
  line-height: 1.2;
  font-weight: 700;
}

.login-only #login .login-value-copy p {
  margin: 4px 0 0;
  color: rgba(242, 243, 247, 0.46);
  font-size: clamp(13px, 2.1vw, 17px);
  line-height: 1.3;
}

/* Login toast: transient status messages (errors/progress) that auto-hide. */
.login-only #login .login-toast {
  position: fixed;
  left: 50%;
  top: calc(14px + var(--tg-top-inset, 0px));
  width: auto;
  max-width: calc(100vw - 24px);
  transform: translateX(-50%) translateY(-10px);
  opacity: 0;
  transition: opacity 160ms ease, transform 200ms ease;
  pointer-events: none;
  z-index: 40;
  text-align: center;
}

.login-only #login .login-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.login-only #login .login-toast-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: min(92vw, 520px);
  background: rgba(247, 249, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  padding: 12px 16px;
  text-align: center;
  color: rgba(18, 19, 26, 0.95);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

/* Fixed login dock: keep actions always visible at viewport bottom. */
.login-fixed-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  padding: 0;
  z-index: 24;
  pointer-events: none;
}

.login-dock-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--login-dock-space) + 72px);
  background: linear-gradient(
    180deg,
    rgba(11, 13, 20, calc(0.02 + var(--login-scroll-progress) * 0.08)) 0%,
    rgba(11, 13, 20, calc(0.72 + var(--login-scroll-progress) * 0.16)) 46%,
    rgba(11, 13, 20, calc(0.9 + var(--login-scroll-progress) * 0.08)) 100%
  );
  transition: background var(--motion-base) var(--motion-ease-soft);
  pointer-events: none;
  z-index: 1;
}

.login-dock {
  pointer-events: auto;
  position: relative;
  z-index: 2;
  background: rgba(12, 14, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-radius: 32px 32px 0 0;
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(14px);
}

.login-telegram-btn {
  width: 100%;
  min-height: 64px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #12131a;
  border: 1px solid rgba(18, 19, 26, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  font-size: 17px;
  font-weight: 700;
}

.login-telegram-icon {
  width: 22px;
  height: 22px;
  color: #12131a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-dev-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(242, 243, 247, 0.45);
  box-shadow: none;
  font-family: "Roboto Slab", serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.login-dev-btn.hidden {
  display: none;
}

.login-telegram-btn:hover:not(:disabled) {
  background: #f6f7fb;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.login-telegram-btn:active:not(:disabled) {
  background: #eceff5;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

/* Primary CTA rhythm: align the main action buttons to the softer History interaction profile
   without changing generic btn-primary / btn-ghost behavior project-wide. */
#shop .shop-purchase-btn,
#shop .shop-payment-pay-btn,
.home-start-chat,
.profile-topup,
.login-telegram-btn {
  --primary-cta-rest-transform: scale(1);
  --primary-cta-hover-transform: scale(0.99);
  --primary-cta-active-transform: scale(0.97);
  transform: var(--primary-cta-rest-transform);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#shop .shop-purchase-btn {
  --primary-cta-rest-transform: translateX(-50%);
  --primary-cta-hover-transform: translateX(-50%) scale(0.99);
  --primary-cta-active-transform: translateX(-50%) scale(0.97);
}

#shop .shop-purchase-btn:hover:not(:disabled),
#shop .shop-payment-pay-btn:hover:not(:disabled),
.home-start-chat:hover,
.profile-topup:hover,
.login-telegram-btn:hover:not(:disabled) {
  transform: var(--primary-cta-hover-transform);
  opacity: 0.95;
}

#shop .shop-purchase-btn:active:not(:disabled),
#shop .shop-payment-pay-btn:active:not(:disabled),
.home-start-chat:active,
.profile-topup:active,
.login-telegram-btn:active:not(:disabled) {
  transform: var(--primary-cta-active-transform);
}

@media (prefers-reduced-motion: reduce) {
  /* Reduce-motion fallback: disable staged transforms while keeping content fully visible. */
  .login-only #login.motion-enabled .login-badge,
  .login-only #login.motion-enabled .login-title,
  .login-only #login.motion-enabled .login-subtitle,
  .login-only #login.motion-enabled .login-icon-tile,
  .login-only #login.motion-enabled .login-icon-label,
  .login-only #login.motion-enabled .login-value-card,
  .login-only #login.motion-enabled .login-fixed-actions {
    opacity: 1;
    transform: none;
    filter: none;
    transition: opacity var(--motion-fast) linear !important;
  }
}

@media (max-width: 680px) {
  .login-only #login .login-center {
    padding-inline: 12px;
  }
}

@media (max-width: 420px) {
  .login-only .page.login-page {
    --login-dock-base: 170px;
  }

  .login-only #login .login-title {
    font-size: clamp(38px, 12.5vw, 56px);
  }

  .login-only #login .login-icon-row {
    gap: 8px;
  }

  .login-only #login .login-icon-tile {
    border-radius: 20px;
  }

  .login-only #login .login-value-card {
    padding: 12px;
    border-radius: 20px;
  }

  .login-only #login .login-value-icon {
    width: 44px;
    height: 44px;
  }

  .login-only #login .login-value-copy h3 {
    font-size: 17px;
  }

  .login-only #login .login-value-copy p {
    font-size: 13px;
  }

  .login-telegram-btn {
    min-height: 60px;
    font-size: 16px;
  }
}

@media (max-height: 780px) {
  .login-only .page.login-page {
    --login-dock-base: 170px;
  }

  .login-only #login .login-center {
    gap: 12px;
  }

  .login-only #login .login-title {
    font-size: clamp(36px, 9vw, 62px);
  }

  .login-only #login .login-icon-tile {
    min-height: 72px;
    border-radius: 18px;
  }

  .login-only #login .login-value-card {
    padding: 10px 12px;
  }

  .login-only #login .login-value-icon {
    width: 44px;
    height: 44px;
  }

  .login-only #login .login-value-copy h3 {
    font-size: 16px;
  }

  .login-only #login .login-value-copy p {
    font-size: 12px;
  }

  .login-telegram-btn {
    min-height: 56px;
  }
}

.profile-auth-actions {
  display: flex;
  gap: 12px;
  margin: 16px 0 8px;
}

/* Mini App UX: session ending controls are only relevant for browser sessions. */
body.tg-webapp .profile-auth-actions {
  display: none;
}

.profile-auth-btn {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f5f7ff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
}

.profile-auth-btn--danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

/* Admin dashboard (server + JS-rendered) */
.admin-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-metrics.admin-metrics--kpi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

@media (min-width: 480px) {
  .admin-metrics.admin-metrics--kpi {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.admin-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.35;
}

.admin-metric-label {
  color: rgba(182, 182, 182, 0.95);
  font-size: 13px;
  font-weight: 400;
}

.admin-metric-value {
  color: #f5f5f5;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.admin-subsection {
  margin-top: 14px;
}

.admin-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: #e4e4e7;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.admin-table {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.admin-table-head,
.admin-table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px 12px;
  padding: 8px 0;
  align-items: start;
}

.admin-table-head {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(182, 182, 182, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.admin-table-row {
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table-row:last-child {
  border-bottom: none;
}

.admin-table--events .admin-table-head,
.admin-table--events .admin-table-row {
  grid-template-columns: minmax(130px, 1.1fr) minmax(90px, 1fr) 52px minmax(140px, 2fr);
}

/* Admin — product analytics readable layout */
.admin-analytics-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-refresh-btn {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 10px;
}

.admin-analytics-lead {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.85;
}

.admin-analytics-mount .admin-subsection {
  margin-top: 16px;
}

.admin-analytics-mount .admin-subsection:first-child {
  margin-top: 0;
}

.admin-analytics-muted {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.72;
}

.admin-analytics-generated {
  margin: 16px 0 8px;
  font-size: 11px;
  opacity: 0.55;
}

.admin-analytics-error {
  color: #f87171;
  margin: 0;
}

.admin-table--scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table--scroll .admin-table-head,
.admin-table--scroll .admin-table-row {
  min-width: max-content;
}

.admin-table--scroll .admin-table-head span,
.admin-table--scroll .admin-table-row span {
  white-space: nowrap;
}

.admin-analytics-raw {
  margin-top: 12px;
  font-size: 12px;
}

.admin-analytics-raw summary {
  cursor: pointer;
  opacity: 0.75;
  padding: 6px 0;
}

.admin-analytics-pre {
  white-space: pre-wrap;
  max-height: 16rem;
  overflow: auto;
  font-size: 11px;
  line-height: 1.35;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-events-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-events-input {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  font-size: 13px;
}

.admin-events-input--narrow {
  flex: 0 0 100px;
  min-width: 80px;
}

.admin-events-count {
  font-size: 12px;
  opacity: 0.7;
  margin: 0 0 8px;
}

.admin-table-row--events {
  align-items: flex-start;
}

.admin-ev-time {
  font-size: 11px;
  opacity: 0.75;
}

.admin-ev-name {
  font-weight: 600;
}

.admin-ev-user {
  font-size: 12px;
  opacity: 0.85;
}

.admin-event-props {
  font-size: 11px;
  line-height: 1.4;
}

.admin-event-prop {
  margin: 2px 0;
}

.admin-event-prop-k {
  opacity: 0.65;
}

/* Admin analytics — toolbar, range, sortable headers */
.admin-analytics-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-analytics-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}

.admin-analytics-toolbar-row--secondary {
  align-items: center;
}

.admin-analytics-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.admin-analytics-field-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(182, 182, 182, 0.85);
}

.admin-analytics-input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 17, 22, 0.85);
  color: #f4f4f5;
  font-size: 13px;
  font-family: inherit;
}

.admin-analytics-input--grow {
  flex: 1;
  min-width: 200px;
}

.admin-analytics-input--date {
  min-width: 148px;
}

.admin-analytics-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-preset-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.admin-preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-refresh-btn--primary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(37, 99, 235, 0.25));
  border-color: rgba(96, 165, 250, 0.45);
  font-weight: 600;
}

.admin-meta-pill {
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: rgba(228, 231, 236, 0.95);
}

.admin-meta-pill strong {
  font-weight: 600;
  color: #fff;
}

.admin-table-head--sortable {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(90px, 1fr) 52px minmax(140px, 2fr);
  gap: 8px 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(182, 182, 182, 0.85);
}

.admin-th--sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-start;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 4px 0;
  color: inherit;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-th--sort:hover {
  color: #fff;
}

.admin-sort-ind {
  font-size: 9px;
  opacity: 0.9;
  min-width: 1em;
}

.admin-table-head--kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.admin-analytics-events-hint {
  margin: 0 0 10px;
}

/* App-wide flatter visual refresh */
/* App-wide flatter visual refresh */

.home-search,
.home-favorites,
.home-favorite-card,
.profile-balance-card,
.profile-analytics-card,
.profile-transaction,
.profile-transaction-overview,
.profile-transactions-detail,
#shop .shop-token-card,
#shop .shop-glass-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.home-ai-card {
  background:
    radial-gradient(118% 86% at 50% -4%, var(--home-ai-tint) 0%, rgba(25, 27, 35, 0) 58%),
    linear-gradient(180deg, rgba(27, 29, 38, 0.98) 0%, rgba(25, 27, 35, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.home-ai-card--mid {
  --home-ai-tint: rgba(15, 59, 142, 0.24);
}

.home-ai-card--voice {
  --home-ai-tint: rgba(29, 85, 78, 0.24);
}

.home-ai-card--bytedance {
  --home-ai-tint: rgba(90, 64, 18, 0.24);
}

.home-favorites {
  gap: 10px;
}

.home-favorites-header {
  background: transparent;
}

.home-favorites-list,
.history-list,
#chat_history .history-workspace-list,
.messages-container,
#shop .shop-token-input,
.model-modal-body,
.history-modal-body,
.profile-settings-body,
.chat-opened-modal-body,
.chat-opened-add-card,
.chat-opened-replace-card,
.chat-opened-add-list,
.chat-opened-replace-list,
.chat-opened-modal,
.chat-opened-modal .modal-card,
#chat_history .history-modal,
#chat_history .history-modal .modal-card,
#profile .history-modal,
#profile .history-modal .modal-card,
#profile-transactions .history-modal,
#profile-transactions .history-modal .modal-card,
.message-edit-card,
.image-preview-card {
  scrollbar-width: none !important;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.home-favorites-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar,
#chat_history .history-workspace-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar,
#shop .shop-token-input::-webkit-scrollbar,
.model-modal-body::-webkit-scrollbar,
.history-modal-body::-webkit-scrollbar,
.profile-settings-body::-webkit-scrollbar,
.chat-opened-modal-body::-webkit-scrollbar,
.chat-opened-add-card::-webkit-scrollbar,
.chat-opened-replace-card::-webkit-scrollbar,
.chat-opened-add-list::-webkit-scrollbar,
.chat-opened-replace-list::-webkit-scrollbar,
.chat-opened-modal::-webkit-scrollbar,
.chat-opened-modal .modal-card::-webkit-scrollbar,
#chat_history .history-modal::-webkit-scrollbar,
#chat_history .history-modal .modal-card::-webkit-scrollbar,
#profile .history-modal::-webkit-scrollbar,
#profile .history-modal .modal-card::-webkit-scrollbar,
#profile-transactions .history-modal::-webkit-scrollbar,
#profile-transactions .history-modal .modal-card::-webkit-scrollbar,
.message-edit-card::-webkit-scrollbar,
.image-preview-card::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  background: transparent;
}

#chat .top-bar {
  min-height: 52px;
}

.chat-open-add,
.chat-open-more {
  background: rgba(33, 35, 47, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.chat-open-add,
.chat-open-more {
  border-radius: 8px;
}

.chat-opened-limit {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.message-assistant-card {
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.message-assistant-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 6px;
}

.message-assistant-action {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.message-user-card {
  box-shadow: none;
}

.message-edit,
.image-preview-copy {
  background: rgba(255, 255, 255, 0.028);
  border-color: rgba(255, 255, 255, 0.05);
}

.message-edit-modal,
.image-preview-modal,
.chat-opened-modal,
#chat_history .history-modal,
#profile .history-modal,
#profile-transactions .history-modal,
#shop .shop-payment-modal,
.model-modal {
  background: rgba(7, 9, 14, 0.52);
  backdrop-filter: blur(4px);
}

.message-edit-card,
.image-preview-card,
.chat-opened-modal .modal-card,
#chat_history .history-modal .modal-card,
#profile .history-modal .modal-card,
#profile-transactions .history-modal .modal-card,
.profile-settings-card,
#shop .shop-payment-sheet,
.model-modal .model-modal-card,
.chat-opened-add-card {
  background: rgba(24, 27, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.chat-opened-modal .modal-card,
#chat_history .history-modal .modal-card,
#profile .history-modal .modal-card,
#profile-transactions .history-modal .modal-card,
.profile-settings-card,
.message-edit-card,
.image-preview-card {
  border-radius: 16px;
}

.chat-opened-modal-close,
#chat_history .history-modal-close,
#profile .history-modal-close,
#profile-transactions .history-modal-close,
.profile-settings-card .history-modal-close,
.message-edit-close,
.image-preview-close,
.chat-opened-add-close,
.model-modal-header .model-modal-close {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.chat-opened-modal-input,
.profile-settings-card .modal-input,
#chat_history .history-modal .modal-input,
#profile-transactions .history-modal .modal-input,
.message-edit-textarea {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.chat-opened-modal-input:focus,
.profile-settings-card .modal-input:focus,
#chat_history .history-modal .modal-input:focus,
#profile-transactions .history-modal .modal-input:focus,
.message-edit-textarea:focus {
  border-color: rgba(124, 92, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.14);
}

.chat-opened-modal .modal-btn.primary,
.chat-opened-modal .modal-btn.danger,
#chat_history .history-modal .modal-btn.primary,
#chat_history .history-modal .modal-btn.danger,
#profile .history-modal .modal-btn.primary,
#profile-transactions .history-modal .modal-btn.primary,
#profile-transactions .history-modal .modal-btn.danger,
.profile-settings-card .modal-btn.primary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.07);
}

.chat-opened-modal .modal-btn.secondary,
#chat_history .history-modal .modal-btn.secondary,
#profile .history-modal .modal-btn.secondary,
#profile-transactions .history-modal .modal-btn.secondary,
.profile-settings-card .modal-btn.secondary {
  background: rgba(255, 255, 255, 0.025);
}

.model-modal {
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
}

.model-modal .model-modal-card {
  width: min(100%, 372px);
  max-height: min(72vh, 520px);
  padding: 14px;
  gap: 10px;
}

.model-modal-title {
  font-size: 16px;
  line-height: 20px;
}

.model-groups {
  gap: 10px;
}

.model-group-title {
  color: rgba(242, 243, 247, 0.38);
}

.model-options {
  gap: 7px;
}

.model-option {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.026);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.model-option:hover:not(:disabled) {
  transform: scale(0.995);
  opacity: 0.98;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.model-option-main {
  gap: 10px;
}

.model-option-icon-tile {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.12);
  box-shadow: none;
}

.model-option[data-accent='teal'] .model-option-icon-tile {
  background: rgba(67, 188, 179, 0.12);
  border-color: rgba(67, 188, 179, 0.12);
}

.model-option[data-accent='blue'] .model-option-icon-tile,
.model-option[data-accent='indigo'] .model-option-icon-tile,
.model-option[data-accent='slate'] .model-option-icon-tile {
  background: rgba(95, 135, 255, 0.12);
  border-color: rgba(95, 135, 255, 0.12);
}

.model-option-icon,
.model-option-icon svg {
  width: 18px;
  height: 18px;
}

.model-option-label {
  font-size: 14px;
  font-weight: 600;
}

.model-option-subtitle {
  font-size: 11px;
  color: rgba(242, 243, 247, 0.46);
}

.model-option-status {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
}

.model-option-status.is-active {
  background: rgba(124, 92, 255, 0.14);
  border-color: rgba(124, 92, 255, 0.22);
  color: rgba(240, 236, 255, 0.96);
}

.model-option.active {
  border-color: rgba(124, 92, 255, 0.34);
  background: rgba(124, 92, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.08);
}

#shop .shop-token-card {
  border-radius: 16px;
}

#shop .shop-credit-option {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

#shop .shop-credit-option.active {
  background: rgba(124, 92, 255, 0.12);
  color: #f5f7ff;
  box-shadow: none;
  border-color: rgba(124, 92, 255, 0.22);
}

#shop .shop-slider-thumb {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
}

#shop .shop-payment-modal.open {
  background: rgba(7, 9, 14, 0.52);
}

#shop .shop-payment-sheet {
  min-height: 392px;
  gap: 20px;
  padding: 28px 16px calc(92px + env(safe-area-inset-bottom));
  background: rgba(24, 27, 36, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px 18px 0 0;
}

#shop .shop-payment-sheet::before {
  display: none;
}

#shop .shop-payment-option {
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

#shop .shop-payment-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

#shop .shop-payment-option.is-selected {
  border-color: rgba(124, 92, 255, 0.3);
  background: rgba(124, 92, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.08);
}

#shop .shop-payment-option:focus-visible,
#shop .shop-payment-pay-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.26);
}

#shop .shop-payment-pay-btn {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.14);
}

.profile-settings-card,
.profile-analytics-card,
.profile-balance-card,
.profile-transaction,
.profile-transaction-overview,
.profile-transactions-detail,
.profile-range-dropdown,
.profile-analytics-legend-item {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.profile-settings-card,
.profile-range-dropdown,
.profile-analytics-card,
.profile-balance-card,
.profile-transaction,
.profile-transaction-overview,
.profile-transactions-detail,
.profile-analytics-legend-item {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.profile-topup,
.profile-filter-toggle,
.profile-settings-trigger,
.profile-transactions-back,
.profile-session-action,
.profile-settings-avatar-btn,
.profile-range-dropdown__action,
.profile-analytics-range-chip,
.profile-analytics-range-clear {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.profile-transaction-filter.is-active,
.profile-transaction-range.is-active,
.profile-analytics-legend-item.is-selected,
.profile-filter-toggle.active {
  border-color: rgba(124, 92, 255, 0.22);
  background: rgba(124, 92, 255, 0.1);
  box-shadow: none;
}
