.trade-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.trade-tabs__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted, #9aa3b5);
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.02);
}

.trade-tabs__link.is-active,
.trade-tabs__link:hover {
  color: var(--accent-bright);
  border-color: var(--accent);
  text-decoration: none;
}

.trade-search,
.trade-form,
.trade-inbox,
.trade-thread,
.trade-empty {
  margin-bottom: 1rem;
}

.trade-search__main,
.trade-form__actions,
.trade-toolbar,
.trade-card__actions,
.trade-thread__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

.trade-toolbar {
  justify-content: space-between;
  align-items: center;
  margin: 0.85rem 0;
}

.trade-toolbar p {
  margin: 0;
}

.trade-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.82rem;
}

.trade-field--grow {
  flex: 1 1 16rem;
}

.trade-filters .form-control[hidden] {
  display: none;
}

.trade-filters,
.trade-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.trade-printing-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.trade-printing-fields .form-control {
  width: 100%;
}

.trade-suggest {
  position: relative;
  z-index: 3;
}

.trade-suggest__list {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0.25rem 0 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--panel, #141824);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 24rem;
  overflow: auto;
}

.trade-suggest__list button {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 6px;
  padding: 0.35rem;
  cursor: pointer;
}

.trade-suggest__list button:hover,
.trade-suggest__list button:focus {
  background: var(--accent-soft);
}

.trade-suggest__list img {
  width: 36px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
}

.trade-suggest__list small {
  display: block;
  color: var(--muted, #9aa3b5);
}

.trade-list {
  display: grid;
  gap: 0.75rem;
}

.trade-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 12, 24, 0.45);
}

.trade-card__image {
  width: 96px;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  background: #0b1020;
}

.trade-card__title-row,
.trade-thread__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.trade-card__title {
  margin: 0;
  font-size: 1.05rem;
}

.trade-card__rarity {
  margin: 0.1rem 0 0;
  color: var(--accent-bright);
  font-size: 0.88rem;
}

.trade-card__line,
.trade-card__qty,
.trade-card__who,
.trade-card__notes {
  margin: 0.15rem 0;
}

.trade-card__who {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.trade-card__notes {
  color: var(--muted, #9aa3b5);
  font-size: 0.88rem;
}

.trade-chip,
.trade-badge {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--border);
  color: var(--text, #e8edf7);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.trade-chip--offer {
  color: var(--accent-bright);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.trade-chip--wanted {
  color: #d5def2;
  border-color: rgba(140, 168, 214, 0.7);
  background: rgba(36, 58, 96, 0.55);
}

.trade-chip.is-muted,
.trade-badge--muted {
  color: var(--muted, #9aa3b5);
}

.trade-badge--muted {
  border-color: var(--border);
  color: var(--muted, #9aa3b5);
}

.trade-card__actions {
  align-items: center;
  margin-top: 0.45rem;
}

.trade-card__actions form,
.trade-thread__tools form {
  margin: 0;
}

.trade-card__actions .btn i {
  margin-right: 0.35rem;
}

.trade-section {
  margin-top: 1.25rem;
}

.trade-section h2,
.trade-inbox h2,
.trade-thread h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.05rem;
}

.trade-empty {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.trade-empty p {
  flex: 1 1 100%;
  margin: 0;
}

.trade-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1rem 0;
}

.trade-pager a {
  min-width: 2rem;
  text-align: center;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
}

.trade-pager a.is-active {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.trade-type {
  border: 0;
  padding: 0;
  margin: 0 0 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.trade-type legend {
  width: 100%;
  margin-bottom: 0.35rem;
}

.trade-thread__log {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 28rem;
  overflow: auto;
  margin: 0.8rem 0;
  padding-right: 0.2rem;
}

.trade-bubble {
  max-width: min(36rem, 100%);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.trade-bubble.is-mine {
  align-self: flex-end;
  border-color: rgba(184, 145, 76, 0.45);
  background: var(--accent-soft);
}

.trade-bubble p {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.trade-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: end;
}

.trade-report {
  font-size: 0.85rem;
}

[data-offer-terms][hidden],
[data-sale-fields][hidden],
[data-trade-fields][hidden] {
  display: none !important;
}

.trade-note {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin: -0.2rem 0 0.9rem;
  color: var(--muted, #9aa3b5);
  font-size: 0.82rem;
  line-height: 1.4;
}

.trade-note i {
  margin-top: 0.15rem;
  color: var(--accent);
}

.trade-mode {
  border: 0;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.trade-mode legend {
  width: 100%;
  margin-bottom: 0.35rem;
}

.trade-mode label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.trade-mode label:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.trade-money {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trade-money > span {
  color: var(--accent-bright);
  font-size: 0.85rem;
}

.trade-money .form-control {
  flex: 1;
}

.trade-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0.5rem;
}

.trade-terms {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.12rem 0.65rem;
  margin: 0.35rem 0;
}

.trade-terms dt {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent-bright);
}

.trade-terms dd {
  margin: 0;
}

.trade-card__fine {
  margin: 0.15rem 0 0.35rem;
  color: var(--muted, #9aa3b5);
  font-size: 0.75rem;
}

.trade-interest {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.trade-report form {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
  min-width: min(18rem, 100%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  .trade-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .trade-card__image {
    width: 72px;
    height: 105px;
  }

  .trade-interest,
  .trade-money {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .trade-filters-toggle {
    display: inline-flex;
  }

  .trade-filters {
    display: none;
  }

  .trade-filters.is-open {
    display: grid;
  }

  .trade-send span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .trade-desk {
    display: block;
    height: auto;
    min-height: 0;
  }

  .trade-desk--thread .trade-desk__list,
  .trade-desk--inbox .trade-desk__pane {
    display: none;
  }

  .trade-back {
    display: inline-flex;
  }

  .trade-thread__log {
    min-height: 16rem;
    max-height: 58vh;
  }

  .trade-mode label {
    flex: 1 1 100%;
  }
}

.page-header__title {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 1.45rem;
}

.trade-tabs__link {
  padding: 0.38rem 0.7rem;
  font-size: 0.92rem;
}

.trade-tabs__link:focus-visible,
.trade-menu summary:focus-visible,
.trade-clear:focus-visible,
.trade-inbox__item:focus-visible,
.trade-send:focus-visible,
.trade-jump:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.trade-tab-badge {
  min-width: 1.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1408;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.trade-filters-toggle,
.trade-back {
  display: none;
}

.trade-filters-toggle,
.trade-clear,
.trade-back {
  align-items: center;
  gap: 0.35rem;
  color: var(--muted, #9aa3b5);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.trade-clear {
  display: inline-flex;
  margin-left: auto;
}

.trade-avatar {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: #182033;
  color: var(--accent-bright);
  font-size: 0.78rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.trade-avatar__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trade-card__who {
  align-items: center;
}

.trade-card__notes {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trade-menu {
  position: relative;
  margin-left: auto;
}

.trade-menu summary {
  list-style: none;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted, #9aa3b5);
  cursor: pointer;
}

.trade-menu summary::-webkit-details-marker {
  display: none;
}

.trade-menu__panel {
  position: absolute;
  right: 0;
  z-index: 4;
  width: min(18rem, 70vw);
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12182a;
}

.trade-menu__label,
.trade-menu__link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.45rem;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.trade-desk {
  display: grid;
  grid-template-columns: minmax(16rem, 30%) minmax(0, 1fr);
  gap: 0.75rem;
  height: calc(100dvh - 13.5rem);
  min-height: 28rem;
}

.trade-desk__list,
.trade-desk__pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 12, 24, 0.45);
  overflow: hidden;
}

.trade-desk__list {
  padding: 0.75rem 0.85rem 0.4rem;
}

.trade-desk__list h2,
.trade-desk__empty p {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}

.trade-desk__empty {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  color: var(--muted, #9aa3b5);
}

.trade-desk__empty i,
.trade-empty--inbox i {
  font-size: 1.4rem;
  color: var(--accent);
}

.trade-empty--inbox {
  display: grid;
  justify-items: start;
  gap: 0.35rem;
  padding: 0.4rem 0 0.8rem;
}

.trade-inbox__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}

.trade-inbox__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "avatar name time"
    "avatar preview badge";
  gap: 0.1rem 0.55rem;
  align-items: center;
  padding: 0.65rem 0.35rem;
  border-top: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.trade-inbox__item .trade-avatar {
  grid-area: avatar;
  flex-shrink: 0;
}

.trade-inbox__name {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trade-inbox__item time { grid-area: time; justify-self: end; color: var(--muted, #9aa3b5); font-size: 0.75rem; }
.trade-inbox__preview { grid-area: preview; color: var(--muted, #9aa3b5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-inbox__item .trade-tab-badge { grid-area: badge; justify-self: end; }

.trade-inbox__item.is-unread .trade-inbox__name,
.trade-inbox__item.is-unread .trade-inbox__preview {
  color: var(--text, #e8edf7);
  font-weight: 700;
}

.trade-inbox__item.is-selected {
  background: rgba(198, 161, 91, 0.08);
  border-radius: 8px;
}

.trade-desk__pane .trade-thread {
  border: 0;
  background: transparent;
  margin: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.trade-back {
  margin: 0.65rem 0.85rem 0;
}

.trade-thread__head {
  align-items: center;
  padding: 0.75rem 0.85rem 0.35rem;
}

.trade-person {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-width: 0;
}

.trade-person h2 {
  margin: 0;
  font-size: 1rem;
}

.trade-person p,
.trade-context p {
  margin: 0.1rem 0 0;
  color: var(--muted, #9aa3b5);
  font-size: 0.82rem;
}

.trade-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  margin: 0 0.85rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trade-context img {
  width: 42px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.trade-context__kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.trade-context__side {
  display: grid;
  justify-items: end;
  gap: 0.3rem;
  font-size: 0.82rem;
}

.trade-thread__log {
  position: relative;
  flex: 1;
  min-height: 22rem;
  max-height: none;
  margin: 0;
  padding: 0.85rem;
}

.trade-day {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.35rem 0 0.15rem;
  color: var(--muted, #9aa3b5);
  font-size: 0.75rem;
}

.trade-day::before,
.trade-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.trade-system,
.trade-thread__invite {
  margin: 0.2rem auto 0.45rem;
  max-width: 34rem;
  text-align: center;
  color: var(--muted, #9aa3b5);
  font-size: 0.8rem;
}

.trade-bubble {
  display: grid;
  gap: 0.2rem;
  background: #182033;
  border-color: #2a3348;
}

.trade-bubble.is-mine {
  background: rgba(198, 161, 91, 0.08);
  border-color: rgba(198, 161, 91, 0.35);
}

.trade-bubble time {
  justify-self: end;
  color: var(--muted, #9aa3b5);
  font-size: 0.7rem;
}

.trade-read {
  letter-spacing: -0.08em;
  color: var(--accent-bright);
}

.trade-jump {
  align-self: center;
  margin: 0.35rem 0;
  border: 1px solid var(--border);
  background: #182033;
  color: inherit;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.trade-blocked,
.trade-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.45rem 0.85rem 0;
}

.trade-blocked p,
.trade-suggestions button {
  margin: 0;
}

.trade-suggestions button {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
}

.trade-composer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 0.65rem 0.85rem 0.85rem;
  background: #101624;
}

.trade-composer textarea {
  min-height: 2.6rem;
  max-height: 8rem;
  resize: none;
  overflow: auto;
}

.trade-send {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 900px) {
  .trade-desk {
    grid-template-columns: minmax(13rem, 34%) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .trade-tabs__link {
    padding: 0.32rem 0.5rem;
    font-size: 0.8rem;
  }

  .trade-tabs__link i {
    display: none;
  }

  .trade-desk {
    display: block;
    height: auto;
    min-height: 0;
  }

  .trade-desk--thread .trade-desk__list,
  .trade-desk--inbox .trade-desk__pane {
    display: none;
  }

  .trade-back,
  .trade-filters-toggle {
    display: inline-flex;
  }

  .trade-filters:not(.is-open) {
    display: none;
  }

  .trade-send span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}

.trade-home-cta,
.trade-home-search,
.trade-home-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
}

.trade-home-cta {
  margin: 0 0 0.9rem;
}

.trade-home-cta p,
.trade-home-stats {
  margin: 0;
}

.trade-home-cta p {
  flex: 1 1 12rem;
}

.trade-home-search {
  position: relative;
  align-items: stretch;
  margin-bottom: 1rem;
}

.trade-home-search .trade-suggest {
  position: absolute;
  left: 0;
  right: 7rem;
  top: 100%;
}

.trade-home-stats {
  margin-bottom: 0.35rem;
  color: var(--muted, #9aa3b5);
  font-size: 0.92rem;
}

.trade-home-stats strong {
  color: var(--text, #e8edf7);
  font-weight: 650;
}

.trade-home-summary {
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 12, 24, 0.45);
}

.trade-home-summary h2 {
  margin: 0;
  flex: 1 1 14rem;
  font-size: 1.15rem;
}

.trade-home-summary__counts {
  display: flex;
  gap: 1.1rem;
}

.trade-home-summary__counts p {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--muted, #9aa3b5);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.trade-home-summary__counts strong {
  color: var(--accent-bright);
  font-size: 1.35rem;
  line-height: 1.2;
}

.trade-home-section {
  margin: 1.15rem 0 1.5rem;
}

.trade-home-section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.trade-home-section__head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.trade-home-section__head p {
  margin: 0.2rem 0 0;
  color: var(--muted, #9aa3b5);
  font-size: 0.88rem;
}

.trade-home-section__all {
  color: var(--accent-bright);
  white-space: nowrap;
  text-decoration: none;
}

.trade-home-section__all:hover {
  text-decoration: underline;
}

.trade-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.trade-home-grid .trade-card {
  height: 100%;
}

@media (max-width: 1100px) {
  .trade-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .trade-home-cta {
    align-items: stretch;
  }

  .trade-home-cta .btn,
  .trade-home-search .btn {
    justify-content: center;
  }

  .trade-home-search {
    flex-direction: column;
  }

  .trade-home-search .trade-field--grow {
    flex: 1 1 auto;
  }

  .trade-home-search .trade-suggest {
    right: 0;
  }

  .trade-home-summary {
    align-items: stretch;
  }

  .trade-home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
