.trading-hero {
  min-height: 330px;
}

.trading-page {
  padding-top: 0;
}

.trading-gate,
.trading-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

.trading-gate {
  display: grid;
  gap: 12px;
  max-width: 720px;
  padding: 24px;
}

.trading-gate h2,
.trading-gate p {
  margin: 0;
}

.trading-gate p {
  color: var(--muted);
  line-height: 1.55;
}

.trading-app {
  display: grid;
  gap: 18px;
}

.trading-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.trading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.trading-panel {
  padding: 18px;
}

.panel-title {
  margin-bottom: 16px;
}

.panel-title h2 {
  margin: 0;
}

.post-form,
.dm-form {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.post-form input,
.post-form textarea,
.dm-form input,
.dm-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.post-form textarea,
.dm-form textarea {
  resize: vertical;
  min-height: 108px;
  line-height: 1.45;
}

.dm-form input {
  min-height: 42px;
}

.post-list,
.message-list {
  display: grid;
  gap: 12px;
  max-height: 590px;
  overflow-y: auto;
  padding-right: 4px;
}

.message-list {
  max-height: 460px;
}

.selected-users,
.user-results,
.conversation-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.conversation-box {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.conversation-list {
  max-height: 190px;
  overflow-y: auto;
}

.user-result,
.selected-user,
.conversation-item,
.username-button,
.delete-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.user-result,
.selected-user {
  min-height: 34px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 13px;
  font-weight: 800;
}

.selected-user {
  border-color: rgba(98, 226, 155, 0.48);
  background: rgba(98, 226, 155, 0.13);
}

.empty-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.conversation-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
}

.conversation-item span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.username-button {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-weight: 900;
}

.delete-button {
  justify-self: start;
  min-height: 32px;
  padding: 0 10px;
  background: rgba(255, 107, 154, 0.14);
  color: #ffdbe7;
  font-size: 12px;
  font-weight: 900;
}

.trade-post,
.direct-message {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.trade-post header,
.direct-message header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.trade-post strong,
.direct-message strong {
  font-size: 16px;
}

.trade-post time,
.direct-message time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.trade-post p,
.direct-message p {
  margin: 0;
  color: #d4deef;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.direct-message.is-mine {
  border-color: rgba(98, 226, 155, 0.55);
  background: rgba(20, 45, 38, 0.72);
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 34px;
}

.admin-footer details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.admin-footer summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
}

.admin-form,
.admin-moderation {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.admin-form input,
.admin-moderation input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  outline: none;
}

@media (max-width: 900px) {
  .trading-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .trading-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .trading-panel,
  .trading-gate {
    padding: 14px;
  }

  .trade-post header,
  .direct-message header {
    align-items: flex-start;
    flex-direction: column;
  }
}
