/* ═══════════ Byten (/trades, byte-toasts, profilknapp) ═══════════ */
.tr-page { max-width: 1140px; margin: 0 auto; padding: 8px 4px 48px; color: #e6edf3; }
.tr-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: radial-gradient(120% 160% at 0% 0%, #2ea04326 0%, transparent 55%), linear-gradient(135deg, #0d1117, #161b22);
  border: 1px solid #30363d; border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; }
.tr-hero-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tr-hero-icon { font-size: 32px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: #2ea04322; border: 1px solid #2ea04366; flex: 0 0 auto; }
.tr-hero h1 { margin: 0; font-family: Oswald, sans-serif; font-size: 26px; letter-spacing: 2px; text-transform: uppercase; color: #56d364; }
.tr-hero-sub { color: #8b949e; font-size: 13px; }
.tr-stats { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tr-stat { background: #0d1117; border: 1px solid #30363d; border-radius: 999px; padding: 6px 12px; font-size: 12px; color: #8b949e; }
.tr-stat b { color: #e6edf3; font-size: 14px; }
.tr-stat.hot { border-color: #d2992280; color: #f2cc60; }

.tr-btn { background: #21262d; border: 1px solid #30363d; color: #e6edf3; border-radius: 10px; padding: 8px 14px; font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; min-height: 38px; }
.tr-btn:hover { border-color: #8b949e; }
.tr-btn:disabled { opacity: .55; cursor: default; }
.tr-btn.primary { background: #238636; border-color: #2ea043; color: #fff; }
.tr-btn.success { background: linear-gradient(135deg, #238636, #2ea043); border-color: #3fb950; color: #fff; }
.tr-btn.danger { color: #ff7b72; border-color: #f8514966; background: transparent; }
.tr-link { background: none; border: 0; color: #58a6ff; cursor: pointer; font-weight: 700; font-size: 13px; }

.tr-flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 700; font-size: 13px; }
.tr-flash.ok { background: #2386361f; border: 1px solid #23863666; color: #3fb950; }
.tr-flash.err { background: #f851491a; border: 1px solid #f8514966; color: #ff7b72; }
.tr-loading { display: grid; place-items: center; padding: 60px 0; }

.tr-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.tr-tabs::-webkit-scrollbar { display: none; }
.tr-tab { flex: 0 0 auto; background: #161b22; border: 1px solid #30363d; color: #8b949e; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.tr-tab.active { background: #2ea04322; border-color: #2ea043; color: #56d364; }
.tr-count { background: #30363d; color: #c9d1d9; border-radius: 999px; font-size: 11px; padding: 0 7px; }
.tr-badge { background: #d29922; color: #1b1300; border-radius: 999px; font-size: 11px; font-weight: 900; padding: 0 7px; }

.tr-empty { text-align: center; color: #8b949e; padding: 40px 10px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.tr-card { background: linear-gradient(135deg, #0d1117, #161b22); border: 1px solid #30363d; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.tr-card.waiting { border-color: #d2992280; box-shadow: inset 3px 0 0 #d29922; }
.tr-card.hl { outline: 2px solid #58a6ff66; }
.tr-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tr-who { display: flex; align-items: center; gap: 10px; color: #e6edf3; text-decoration: none; min-width: 0; }
.tr-who small { display: block; color: #8b949e; font-size: 11px; }
.tr-avatar { width: 42px; height: 42px; border-radius: 50%; background: #21262d; border: 2px solid #30363d; display: grid; place-items: center; font-size: 20px; overflow: hidden; flex: 0 0 auto; }
.tr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tr-avatar.sm { width: 34px; height: 34px; font-size: 16px; }
.tr-pill { border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; border: 1px solid; }
.tr-pill.me { color: #f2cc60; border-color: #d2992280; background: #d2992218; }
.tr-pill.them { color: #8b949e; border-color: #30363d; }
.tr-msg { margin-top: 10px; color: #c9d1d9; font-size: 13px; background: #0d1117; border: 1px solid #21262d; border-radius: 8px; padding: 8px 10px; }
.tr-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin-top: 12px; align-items: stretch; }
.tr-arrow { align-self: center; color: #8b949e; font-size: 20px; }
.tr-side { background: #0d1117; border: 1px solid #21262d; border-radius: 10px; padding: 10px; min-width: 0; }
.tr-side.give { box-shadow: inset 0 2px 0 #f8514966; }
.tr-side.get { box-shadow: inset 0 2px 0 #3fb95066; }
.tr-side-title { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #8b949e; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 6px; }
.tr-ok { color: #3fb950; text-transform: none; letter-spacing: 0; }
.tr-nothing { color: #6e7681; font-size: 13px; font-style: italic; }
.tr-money { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.tr-money small { color: #8b949e; font-weight: 600; font-size: 11px; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-chip { display: inline-flex; align-items: center; gap: 6px; background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 3px 8px 3px 3px; font-size: 12px; font-weight: 700; }
.tr-chip img { width: 24px; height: 24px; object-fit: contain; border-radius: 5px; background: #0d1117; }
.tr-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.tr-meta { color: #6e7681; font-size: 12px; }
.tr-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tr-actions.end { justify-content: flex-end; }

/* rarity */
.r-common { --rc: #8b949e; } .r-uncommon { --rc: #3fb950; } .r-rare { --rc: #58a6ff; } .r-epic { --rc: #bc8cff; } .r-legendary { --rc: #f2cc60; }
.tr-chip { border-color: color-mix(in srgb, var(--rc, #30363d) 50%, #30363d); }

.tr-history { display: flex; flex-direction: column; gap: 6px; }
.tr-hrow { display: grid; grid-template-columns: 110px 140px 1fr 1fr 110px; gap: 10px; align-items: center; background: #0d1117; border: 1px solid #21262d; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.tr-hname { color: #e6edf3; font-weight: 800; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-hsum { color: #c9d1d9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-hsum em { color: #6e7681; font-style: normal; margin-right: 4px; }
.tr-hdate { color: #6e7681; text-align: right; }
.tr-status { border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 800; text-align: center; border: 1px solid #30363d; color: #8b949e; }
.tr-status.s-completed { color: #3fb950; border-color: #2ea04366; background: #2ea0431a; }
.tr-status.s-declined, .tr-status.s-cancelled { color: #ff7b72; border-color: #f8514955; }

.tr-panel { background: linear-gradient(135deg, #0d1117, #161b22); border: 1px solid #30363d; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.tr-panel h2 { margin: 0 0 10px; font-family: Oswald, sans-serif; font-size: 15px; letter-spacing: 1.2px; text-transform: uppercase; color: #c9d1d9; }
.tr-input { width: 100%; background: #0d1117; border: 1px solid #30363d; border-radius: 10px; color: #e6edf3; padding: 10px 12px; font-size: 15px; outline: none; }
.tr-input:focus { border-color: #2ea043; box-shadow: 0 0 0 3px #2ea04333; }
.tr-hint { color: #6e7681; font-size: 12px; margin-top: 6px; }
.tr-partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 10px; }
.tr-partner { display: flex; align-items: center; gap: 10px; background: #0d1117; border: 1px solid #30363d; border-radius: 12px; padding: 10px; color: #e6edf3; cursor: pointer; text-align: left; }
.tr-partner:hover { border-color: #2ea043; }
.tr-partner small { display: block; color: #8b949e; font-size: 11px; }
.tr-edit-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; color: #c9d1d9; flex-wrap: wrap; }
.tr-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tr-eside.give h2 { color: #ffa198; }
.tr-eside.get h2 { color: #7ee787; }
.tr-field { display: block; margin-bottom: 10px; }
.tr-field > span { display: block; font-size: 12px; font-weight: 800; color: #8b949e; margin-bottom: 4px; }
.tr-field small { font-weight: 600; color: #6e7681; }
.tr-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tr-item { position: relative; background: #0d1117; border: 1px solid #30363d; border-radius: 10px; padding: 8px; cursor: pointer; text-align: center; user-select: none; }
.tr-item:hover { border-color: #484f58; }
.tr-item.on { border-color: #2ea043; background: #2ea04314; box-shadow: 0 0 0 1px #2ea043; }
.tr-item-img { height: 52px; display: grid; place-items: center; }
.tr-item-img img { max-width: 100%; max-height: 52px; object-fit: contain; }
.tr-item-name { font-size: 12px; font-weight: 800; margin-top: 4px; line-height: 1.2; color: var(--rc, #e6edf3); overflow-wrap: anywhere; }
.tr-item-meta { display: flex; justify-content: center; gap: 6px; font-size: 11px; color: #8b949e; margin-top: 2px; flex-wrap: wrap; }
.tr-qty { width: 100%; margin-top: 6px; background: #161b22; border: 1px solid #2ea043; border-radius: 6px; color: #e6edf3; padding: 3px 6px; text-align: center; }
.tr-check { position: absolute; top: 4px; right: 6px; color: #3fb950; font-weight: 900; }
.tr-summary .tr-sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tr-sum-grid em { display: block; font-style: normal; color: #8b949e; font-size: 11px; text-transform: uppercase; font-weight: 800; }
.tr-sum-grid b { font-size: 15px; }
.tr-summary .tr-input { margin: 8px 0; }

/* toasts */
.tr-toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 9996; display: flex; flex-direction: column-reverse; gap: 10px; max-width: min(360px, calc(100vw - 40px)); }
.tr-toast { background: linear-gradient(135deg, #0d1117, #161b22); border: 1px solid #2ea043; border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px #000a; color: #e6edf3; }
.tr-toast-title { display: flex; justify-content: space-between; font-weight: 800; color: #56d364; }
.tr-toast-close { background: none; border: 0; color: #8b949e; font-size: 18px; cursor: pointer; }
.tr-toast-msg { font-size: 13px; margin: 4px 0 6px; color: #c9d1d9; }
.tr-toast-link { color: #58a6ff; font-size: 13px; font-weight: 700; text-decoration: none; }

/* profilknapp */
.pf-trade-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; margin-top: 8px; border-radius: 10px;
  background: #2ea04322; border: 1px solid #2ea04380; color: #56d364; font-weight: 800; font-size: 13px; text-decoration: none; }

@media (max-width: 760px) {
  .tr-editor { grid-template-columns: 1fr; }
  .tr-hrow { grid-template-columns: auto 1fr auto; }
  .tr-hrow .tr-hsum { grid-column: 1 / -1; white-space: normal; }
}
@media (max-width: 600px) {
  .tr-page { padding-bottom: 96px; }
  .tr-hero { padding: 14px; }
  .tr-hero h1 { font-size: 21px; }
  .tr-stats { width: 100%; }
  .tr-stats .tr-btn { margin-left: auto; }
  .tr-sides { grid-template-columns: 1fr; }
  .tr-arrow { justify-self: center; transform: rotate(90deg); }
  .tr-card-foot .tr-actions { width: 100%; }
  .tr-card-foot .tr-btn { flex: 1 1 auto; }
  .tr-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tr-toast-stack { right: 12px; left: 12px; bottom: 84px; max-width: none; }
}
