
/* Shared navigation */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 12px 0 18px;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid var(--border, #384257);
  border-radius: 16px;
  background: var(--panel, #202634);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 100px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted, #667085);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.site-nav a:hover {
  color: var(--text, #111a32);
  background: var(--card, #f5f6fa);
  transform: translateY(-1px);
}

.site-nav a.active {
  color: #fff;
  background: #5865f2;
  border-color: #5865f2;
  box-shadow: 0 3px 10px rgba(88, 101, 242, 0.18);
}

.site-nav a:focus-visible {
  outline: 2px solid #8d7cff;
  outline-offset: 3px;
}

/* Mobile navigation */
@media (max-width: 620px) {
  .site-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    padding: 5px;
    margin: 8px 0 16px;
    border-radius: 12px;
  }

  .site-nav a {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 1px;
    gap: 0;
    font-size: 11px;
    line-height: 1.2;
    border-radius: 9px;
    text-align: center;
  }

  .site-nav a:hover {
    transform: none;
  }
}

/* Extra-small phones */
@media (max-width: 360px) {
  .site-nav {
    gap: 2px;
    padding: 4px;
  }

  .site-nav a {
    padding: 10px 0;
    font-size: 10px;
    letter-spacing: -0.2px;
  }
}

/* Compact mobile topbar */
@media (max-width: 620px) {
  .topbar {
    gap: 8px;
  }

  .topbar .brand {
    font-size: 19px;
    white-space: nowrap;
  }

  .topbar .subtitle {
    font-size: 11px;
  }

  .topbar .top-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  /* Keep the theme toggle, hide secondary information */
.topbar .top-actions .updated,
.topbar .top-actions .rank {
  display: none;
}

  .topbar .theme-toggle {
    flex-shrink: 0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .site-nav a {
    transition: none;
  }
}


/* =========================================================
   ACCOUNT UI
========================================================= */

.account-area {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #5865f2;
  border-radius: 11px;
  background: #5865f2;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.account-button:hover {
  background: #4754df;
  transform: translateY(-1px);
}

.account-avatar {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border, #384257);
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}

.account-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 10px);
  right: 0;
  width: 205px;
  padding: 7px;
  border: 1px solid var(--border, #384257);
  border-radius: 13px;
  background: var(--panel, #202634);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.account-menu[hidden] {
  display: none;
}

.account-menu a,
.account-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #fff);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu a:hover,
.account-menu button:hover {
  background: var(--card, #30394b);
}

.account-menu .account-divider {
  height: 1px;
  margin: 5px 3px;
  background: var(--border, #384257);
}

@media (max-width: 620px) {
  .account-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .account-avatar {
    width: 32px;
    height: 32px;
  }

  .account-menu {
    width: 190px;
  }
}


/* =========================================================
   ACCOUNT MODAL
========================================================= */

body.account-modal-open {
  overflow: hidden;
}

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}

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

.account-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.account-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 20, .62);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.account-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  max-height: min(720px, calc(100vh - 40px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border, #384257);
  border-radius: 22px;
  background: var(--panel, #202634);
  color: var(--text, #fff);
  box-shadow: 0 25px 80px rgba(0, 0, 0, .35);
  transform: translateY(18px) scale(.97);
  transition: transform .22s ease;
}

.account-modal.is-open .account-modal-dialog {
  transform: translateY(0) scale(1);
}

.account-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px 23px;
  border-bottom: 1px solid var(--border, #384257);
  background: var(--panel, #202634);
}

.account-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-modal-eyebrow {
  color: #8d7cff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.8px;
}

.account-modal-heading h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 850;
}

.account-modal-close {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--border, #384257);
  border-radius: 10px;
  background: var(--card, #30394b);
  color: var(--text, #fff);
  font-size: 23px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.account-modal-close:hover {
  background: #5865f2;
  color: white;
  transform: rotate(90deg);
}

.account-modal-content {
  padding: 22px;
}

.account-modal-description {
  margin: 0 0 20px;
  color: var(--muted, #98a2b3);
  font-size: 13px;
  line-height: 1.7;
}

.account-profile-section {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px;
  border: 1px solid var(--border, #384257);
  border-radius: 15px;
  background: var(--card, #30394b);
}

.account-profile-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 2px solid #8d7cff;
  border-radius: 50%;
background: transparent;
color: #a99aff;
  font-size: 22px;
  font-weight: 900;
}

.account-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 5px;
}

.account-profile-name {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
}

.account-profile-email {
  overflow-wrap: anywhere;
  color: var(--muted, #98a2b3);
  font-size: 12px;
}

.account-modal-section {
  margin-top: 23px;
}

.account-modal-section-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 850;
}

.account-field-label {
  display: block;
  margin: 12px 0 8px;
  color: var(--muted, #98a2b3);
  font-size: 12px;
  font-weight: 750;
}

.account-field-input {
  width: 100%;
  min-height: 43px;
  padding: 0 13px;
  box-sizing: border-box;
  border: 1px solid var(--border, #384257);
  border-radius: 10px;
  outline: none;
  background: var(--card, #30394b);
  color: var(--text, #fff);
  font: inherit;
  font-size: 13px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.account-field-input:focus {
  border-color: #8d7cff;
  box-shadow: 0 0 0 3px rgba(141, 124, 255, .13);
}

.account-avatar-options {
  display: flex;
  gap: 8px;
}

.account-avatar-choice {
  padding: 8px 15px;
  border: 1px solid var(--border, #384257);
  border-radius: 9px;
  background: var(--card, #30394b);
  color: var(--text, #fff);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.account-avatar-choice:hover,
.account-avatar-choice.selected {
  border-color: #8d7cff;
  background: rgba(141, 124, 255, .13);
}

.account-avatar-choice:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.account-save-button {
  width: 100%;
  min-height: 42px;
  margin-top: 16px;
  border: 0;
  border-radius: 10px;
  background: #5865f2;
  color: white;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.account-save-button:hover {
  background: #4754df;
  transform: translateY(-1px);
}

.account-save-button:disabled {
  opacity: .6;
  cursor: wait;
}

.account-save-message {
  display: block;
  min-height: 17px;
  margin-top: 8px;
  font-size: 12px;
}

.account-save-message.success {
  color: #35c98b;
}

.account-save-message.error {
  color: #ff668c;
}

.account-modal-divider {
  height: 1px;
  margin: 21px 0;
  background: var(--border, #384257);
}

.account-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #384257);
}

.account-provider-row:last-child {
  border-bottom: 0;
}

.account-provider-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.account-provider-name {
  font-size: 13px;
}

.account-provider-connected,
.account-provider-disconnected {
  overflow-wrap: anywhere;
  color: var(--muted, #98a2b3);
  font-size: 11px;
}

.account-provider-check {
  flex-shrink: 0;
  color: #35c98b;
  font-size: 11px;
  font-weight: 800;
}

.account-connect-button {
  padding: 8px 13px;
  border: 1px solid #5865f2;
  border-radius: 9px;
  background: #5865f2;
  color: white;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.account-connect-button:hover {
  background: #4754df;
}

.account-modal-footer {
  margin-top: 20px;
}

.account-logout-button {
  width: 100%;
  min-height: 41px;
  border: 1px solid rgba(255, 102, 140, .35);
  border-radius: 10px;
  background: rgba(255, 102, 140, .08);
  color: #ff668c;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.account-logout-button:hover {
  background: rgba(255, 102, 140, .16);
}

.account-login-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-action-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border, #384257);
  border-radius: 10px;
  background: var(--card, #30394b);
  color: var(--text, #fff);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.account-action-button:hover {
  border-color: #8d7cff;
  background: rgba(141, 124, 255, .12);
}

@media (max-width: 520px) {
  .account-modal {
    padding: 12px;
  }

  .account-modal-dialog {
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .account-modal-header {
    padding: 17px;
  }

  .account-modal-content {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-modal,
  .account-modal-dialog,
  .account-modal-close {
    transition: none;
  }
}


/* =========================================================
   ACCOUNT FAVORITES & SUGGESTIONS
========================================================= */

.account-activity-section {
  margin-top: 4px;
}

.account-activity-navigation {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.account-activity-link {
  flex: 1;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border, #384257);
  border-radius: 10px;
  background: var(--card, #30394b);
  color: var(--text, #fff);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: .2s ease;
}

.account-activity-link:hover {
  border-color: #8d7cff;
  background: rgba(141, 124, 255, .12);
  color: #a99aff;
}

.account-favorites-list,
.account-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-empty-message {
  margin: 0;
  padding: 17px 13px;
  border: 1px dashed var(--border, #384257);
  border-radius: 11px;
  color: var(--muted, #98a2b3);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* Favorite cards */

.account-favorite-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  padding-right: 45px;
  border: 1px solid var(--border, #384257);
  border-radius: 13px;
  background: var(--card, #30394b);
}

.account-favorite-image {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 55px;
  height: 55px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(141, 124, 255, .1);
}

.account-favorite-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.account-favorite-placeholder {
  color: #a99aff;
  font-size: 20px;
  font-weight: 900;
}

.account-favorite-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.account-favorite-name {
  overflow-wrap: anywhere;
  color: var(--text, #fff);
  font-size: 13px;
  font-weight: 850;
}

.account-favorite-category {
  color: var(--muted, #98a2b3);
  font-size: 10px;
}

.account-favorite-values {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 3px;
}

.account-favorite-value,
.account-favorite-token-value {
  color: var(--muted, #98a2b3);
  font-size: 10px;
  font-weight: 750;
}

.account-favorite-remove {
  position: absolute;
  top: 50%;
  right: 11px;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 1px solid rgba(255, 102, 140, .25);
  border-radius: 9px;
  background: rgba(255, 102, 140, .08);
  color: #ff668c;
  font-size: 15px;
  cursor: pointer;
  transform: translateY(-50%);
  transition: .2s ease;
}

.account-favorite-remove:hover {
  background: rgba(255, 102, 140, .18);
  transform: translateY(-50%) scale(1.08);
}

.account-favorite-remove:disabled {
  opacity: .5;
  cursor: wait;
}

/* Suggestion cards */

.account-suggestion-card {
  padding: 14px;
  border: 1px solid var(--border, #384257);
  border-radius: 13px;
  background: var(--card, #30394b);
}

.account-suggestion-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.account-suggestion-title-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 5px;
}

.account-suggestion-item-name {
  overflow-wrap: anywhere;
  color: var(--text, #fff);
  font-size: 13px;
  font-weight: 850;
}

.account-suggestion-mode {
  color: #a99aff;
  font-size: 10px;
  font-weight: 800;
}

.account-suggestion-status {
  flex-shrink: 0;
  padding: 5px 9px;
  border: 1px solid rgba(255, 190, 90, .25);
  border-radius: 8px;
  background: rgba(255, 190, 90, .1);
  color: #eab85e;
  font-size: 10px;
  font-weight: 850;
}

.account-suggestion-status.status-approved,
.account-suggestion-status.status-completed {
  border-color: rgba(53, 201, 139, .25);
  background: rgba(53, 201, 139, .1);
  color: #35c98b;
}

.account-suggestion-status.status-rejected,
.account-suggestion-status.status-declined {
  border-color: rgba(255, 102, 140, .25);
  background: rgba(255, 102, 140, .1);
  color: #ff668c;
}

.account-suggestion-date {
  display: block;
  margin-top: 9px;
  color: var(--muted, #98a2b3);
  font-size: 10px;
}

.account-suggestion-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #384257);
}

.account-suggestion-detail {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-suggestion-detail-label {
  flex-shrink: 0;
  color: var(--muted, #98a2b3);
  font-size: 11px;
}

.account-suggestion-detail-value {
  overflow-wrap: anywhere;
  color: var(--text, #fff);
  font-size: 11px;
  text-align: right;
}

.account-suggestion-reason {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 3px;
}

.account-suggestion-reason-text {
  margin: 0;
  padding: 10px;
  border-radius: 9px;
  background: rgba(141, 124, 255, .07);
  color: var(--text, #fff);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.account-suggestion-evidence {
  align-self: flex-start;
  color: #8d7cff;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.account-suggestion-evidence:hover {
  text-decoration: underline;
}

/* Mobile */

@media (max-width: 520px) {
  .account-favorite-card {
    gap: 9px;
    padding: 10px;
    padding-right: 42px;
  }

  .account-favorite-image {
    width: 47px;
    height: 47px;
  }

  .account-favorite-name {
    font-size: 12px;
  }

  .account-favorite-values {
    gap: 4px 8px;
  }

  .account-suggestion-card {
    padding: 12px;
  }

  .account-suggestion-header {
    gap: 7px;
  }

  .account-suggestion-status {
    padding: 4px 7px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-activity-link,
  .account-favorite-remove {
    transition: none;
  }
}


/* Account activity tabs */

.account-activity-link.active {
  border-color: #8d7cff;
  background: rgba(141, 124, 255, .16);
  color: #a99aff;
  box-shadow: 0 0 0 1px rgba(141, 124, 255, .12);
}

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

/* =========================================================
   SUGGESTION FILTERS & PAGINATION
========================================================= */

.account-suggestion-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}

.account-suggestion-filter {
  flex: 1 1 auto;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid var(--border, #384257);
  border-radius: 9px;
  background: var(--card, #30394b);
  color: var(--muted, #98a2b3);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease;
}

.account-suggestion-filter:hover {
  border-color: #8d7cff;
  color: #a99aff;
}

.account-suggestion-filter.active {
  border-color: #8d7cff;
  background: rgba(141, 124, 255, .16);
  color: #a99aff;
  box-shadow: 0 0 0 1px rgba(141, 124, 255, .12);
}

.account-suggestion-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
}

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

.account-suggestion-page-info {
  color: var(--muted, #98a2b3);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.account-suggestion-page-button {
  min-height: 33px;
  padding: 7px 12px;
  border: 1px solid var(--border, #384257);
  border-radius: 9px;
  background: var(--card, #30394b);
  color: var(--text, #fff);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background .2s ease,
    border-color .2s ease,
    opacity .2s ease;
}

.account-suggestion-page-button:hover:not(:disabled) {
  border-color: #8d7cff;
  background: rgba(141, 124, 255, .12);
  color: #a99aff;
}

.account-suggestion-page-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .account-suggestion-filters {
    gap: 5px;
  }

  .account-suggestion-filter {
    padding: 7px 8px;
    font-size: 10px;
  }

  .account-suggestion-pagination {
    gap: 7px;
  }

  .account-suggestion-page-button {
    padding: 7px 10px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-suggestion-filter,
  .account-suggestion-page-button {
    transition: none;
  }
}

/* Account modal scrollbar */

.account-modal-dialog {
  scrollbar-width: thin;
  scrollbar-color: var(--border, #384257) var(--panel, #202634);
}

.account-modal-dialog::-webkit-scrollbar {
  width: 8px;
}

.account-modal-dialog::-webkit-scrollbar-track {
  background: var(--panel, #202634);
  border-radius: 8px;
}

.account-modal-dialog::-webkit-scrollbar-thumb {
  background: var(--border, #384257);
  border-radius: 8px;
}

.account-modal-dialog::-webkit-scrollbar-thumb:hover {
  background: var(--muted, #98a2b3);
}

.account-favorite-image {
  position: relative;
  overflow: visible;
}

.account-favorite-image .set-image-stack {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  overflow: visible;
}

.account-favorite-image .set-image-stack .stack-img {
  position: absolute;
  display: block;
  object-fit: contain;
  max-width: none;
  max-height: none;
}

.account-favorite-image .set-image-stack .card-layer {
  top: 5%;
  left: 5%;
  width: 65%;
  height: 65%;
  z-index: 1;
}

.account-favorite-image .set-image-stack .frame-layer {
  bottom: 5%;
  right: 5%;
  width: 65%;
  height: 65%;
  z-index: 2;
}

.account-suggestion-review-reason {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, rgba(120, 120, 150, 0.16));
  border-radius: 12px;
  background: var(--surface, rgba(130, 130, 160, 0.045));
}

.account-suggestion-review-reason-text {
  margin: 6px 0 0;
  color: var(--text, #252536);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.account-action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border, #384257);
  border-radius: 10px;
  background: var(--card, #30394b);
  color: var(--text, #fff);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.account-action-button:hover {
  border-color: #8d7cff;
  background: rgba(141, 124, 255, .12);
}

.account-login-provider-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
}
