/* =========================================================
   아이템 트레이드
   ========================================================= */
.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.trade-write-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
}

.trade-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.3);
    background: rgba(var(--primary-color-rgb), 0.06);
    font-size: 13px;
    line-height: 1.6;
}

.trade-notice i {
    margin-top: 3px;
    color: var(--primary-color);
}

.trade-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.trade-tab {
    position: relative;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.trade-tab.active {
    color: var(--primary-color);
}

.trade-tab.active::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--primary-color);
}

.trade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.trade-badge[hidden] {
    display: none;
}

[data-trade-panel][hidden] {
    display: none;
}

.trade-panel-desc {
    margin-bottom: 10px;
}

.trade-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.trade-filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.trade-filter-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.trade-filter-search input {
    width: 100%;
    box-sizing: border-box;
    padding-left: 36px;
    min-height: 40px;
}

.trade-done-toggle {
    font-size: 13px;
}

/* 카드 */
.trade-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.trade-empty {
    grid-column: 1 / -1;
    padding: 30px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.trade-empty.is-error {
    color: #dc2626;
}

.trade-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.trade-card:hover,
.trade-card:focus-visible {
    border-color: var(--primary-color);
    outline: none;
}

.trade-card.status-done {
    opacity: 0.6;
}

.trade-card-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.trade-kind {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.trade-kind.kind-have {
    background: rgba(22, 163, 74, 0.14);
    color: #16a34a;
}

.trade-kind.kind-want {
    background: rgba(var(--primary-color-rgb), 0.14);
    color: var(--primary-color);
}

.trade-status {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--border-color);
    color: var(--text-muted);
}

.trade-status.status-reserved {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

.trade-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.trade-card-items,
.trade-detail-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.trade-item-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 3px 8px 3px 3px;
    border-radius: 10px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 13px;
}

.trade-item-chip img {
    border-radius: 7px;
    flex-shrink: 0;
}

.trade-item-chip .nm {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trade-item-chip b {
    color: var(--primary-color);
}

.trade-more {
    align-self: center;
    font-size: 12px;
    color: var(--text-muted);
}

.trade-card-wish {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.trade-card-wish .lbl {
    color: var(--text-muted);
    font-weight: 600;
}

.trade-card-wish .trade-item-chip {
    font-size: 12px;
}

.trade-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 이용 제한 */
.trade-ban {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.06);
    font-size: 13px;
    line-height: 1.6;
}

.trade-ban i {
    color: #dc2626;
}

.trade-ban details {
    margin-top: 8px;
}

.trade-ban textarea {
    width: 100%;
    box-sizing: border-box;
    margin: 8px 0;
    height: auto;
}

/* 모달 */
.trade-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
}

.trade-modal-overlay[hidden] {
    display: none;
}

.trade-modal {
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.trade-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.trade-modal-head h2 {
    margin: 0;
    font-size: 17px;
}

.trade-modal-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.trade-modal-body {
    padding: 16px 18px 20px;
    overflow-y: auto;
}

.trade-detail h3 {
    margin: 16px 0 8px;
    font-size: 14px;
}

.trade-detail-desc {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.7;
}

.trade-detail-items .trade-item-chip {
    font-size: 14px;
}

.trade-openchat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 14px;
    border-radius: 10px;
    background: #fee500;
    color: #191919;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

.trade-detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.trade-detail-actions select {
    width: auto;
    height: 38px;
}

.trade-detail-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.trade-warning {
    margin-top: 8px;
    color: #d97706;
    font-size: 13px;
}

/* 글쓰기 */
.trade-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.trade-kind-pick {
    display: flex;
}

.trade-kind-pick button {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

.trade-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.trade-field small {
    font-weight: 400;
    color: var(--text-muted);
}

.trade-field textarea.form-input {
    height: auto;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
    font-weight: 400;
}

.trade-field .form-input {
    font-weight: 400;
}

.trade-picker {
    position: relative;
}

.trade-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 5;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
}

.trade-suggest[hidden] {
    display: none;
}

.trade-suggest button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.trade-suggest button:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
}

.trade-suggest img {
    border-radius: 6px;
}

.trade-suggest p {
    padding: 10px;
    font-size: 13px;
}

.trade-picked {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.trade-picked-empty {
    font-size: 12px;
    font-weight: 400;
}

.trade-picked-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px 3px 3px;
    border-radius: 10px;
    border: 1px solid var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.06);
    font-size: 13px;
    font-weight: 500;
}

.trade-picked-item img {
    border-radius: 6px;
}

.trade-picked-item .nm {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trade-picked-item input {
    width: 56px;
    height: 28px;
    padding: 0 6px;
    font-size: 13px;
    text-align: center;
}

.trade-picked-item button {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
}

.trade-form-msg {
    min-height: 1em;
    color: #dc2626;
    font-size: 13px;
}

.trade-submit {
    min-height: 46px;
    font-size: 15px;
}

/* 대화 */
.trade-chat {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    height: min(70vh, 680px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: var(--card-bg);
}

.trade-rooms {
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    background: var(--bg-color);
}

.trade-room {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.trade-room:hover {
    background: rgba(var(--primary-color-rgb), 0.05);
}

.trade-room.active {
    background: rgba(var(--primary-color-rgb), 0.12);
}

.trade-room img {
    border-radius: 8px;
    flex-shrink: 0;
}

.trade-room-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.trade-room-top {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.trade-room-top .t {
    font-size: 11px;
    color: var(--text-muted);
}

.trade-room-item,
.trade-room-last {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trade-room-last {
    color: var(--text-main);
}

.trade-conv {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.trade-conv-empty {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
}

.trade-conv-empty i {
    font-size: 34px;
    opacity: 0.5;
}

.trade-conv-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.trade-conv-back {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
}

.trade-conv-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.trade-conv-title a {
    font-size: 12px;
}

.trade-conv-menu {
    display: flex;
    gap: 4px;
}

.trade-conv-menu .action-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.trade-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trade-msg {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    max-width: 80%;
}

.trade-msg.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.trade-msg .bubble {
    padding: 8px 12px;
    border-radius: 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.trade-msg.mine .bubble {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.trade-msg .at,
.trade-msg .read {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--text-muted);
}

.trade-msg .read {
    color: var(--primary-color);
    font-weight: 700;
}

.trade-msg-system {
    align-self: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-color);
    font-size: 12px;
    color: var(--text-muted);
}

.trade-send {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

.trade-send textarea {
    flex: 1;
    height: auto;
    min-height: 42px;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
}

.trade-send button {
    width: 48px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .trade-chat {
        grid-template-columns: 1fr;
        height: calc(100vh - var(--header-height) - var(--dock-height) - 160px);
        height: calc(100dvh - var(--header-height) - var(--dock-height) - 160px);
        min-height: 420px;
    }

    .trade-conv {
        display: none;
    }

    .trade-conv.is-open {
        display: flex;
    }

    .trade-conv.is-open ~ .trade-rooms,
    .trade-chat:has(.trade-conv.is-open) .trade-rooms {
        display: none;
    }

    .trade-conv-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .trade-list {
        grid-template-columns: 1fr;
    }

    .trade-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .trade-modal {
        max-width: none;
        border-radius: 18px 18px 0 0;
        max-height: 92vh;
        max-height: 92dvh;
    }

    .trade-conv-menu .action-btn span {
        display: none;
    }
}

/* =========================================================
   평판 (교환 완료 수 · 후기)
   ========================================================= */
.rep-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
}

.rep-badge.rep-new {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-muted);
}

.rep-badge.rep-warn {
    background: rgba(217, 119, 6, 0.14);
    color: #d97706;
}

.rep-verified {
    color: #5865f2;
}

.trade-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}

.trade-author {
    font-weight: 600;
    color: var(--text-main);
}

.trade-filter-note {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bg-color);
    font-size: 13px;
}

.trade-author-card {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.trade-author-card:hover {
    border-color: var(--primary-color);
}

.trade-author-name {
    font-weight: 700;
}

.trade-author-more {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.rep-summary {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.3);
    border-radius: 12px;
    background: rgba(var(--primary-color-rgb), 0.05);
    font-size: 14px;
    font-weight: 600;
}

.rep-summary-main i {
    color: var(--primary-color);
}

/* 프로필 */
.rep-profile-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.rep-name {
    font-size: 18px;
}

.rep-verified-tag {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.14);
    color: #5865f2;
    font-size: 12px;
    font-weight: 700;
}

.rep-verified-tag.none {
    background: var(--border-color);
    color: var(--text-muted);
}

.rep-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.rep-stats div {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 10px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.rep-stats b {
    font-size: 16px;
    color: var(--text-main);
}

.rep-stats b.ok {
    color: #16a34a;
}

.rep-stats b.warn {
    color: #d97706;
}

.rep-note {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
    font-size: 13px;
}

[data-theme="dark"] .rep-note {
    color: #fbbf24;
}

.rep-profile h3 {
    margin: 4px 0 8px;
    font-size: 14px;
}

.rep-reviews {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rep-reviews li {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 2px 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-color);
    font-size: 13px;
}

.rep-reviews li i {
    grid-row: span 2;
    margin-top: 2px;
}

.rep-reviews .rv-good i {
    color: #16a34a;
}

.rep-reviews .rv-bad i {
    color: #d97706;
}

.rep-reviews small {
    color: var(--text-muted);
    font-size: 11px;
}

/* 대화: 교환 완료 확인 · 후기 */
.trade-conv-title > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.trade-conv-links {
    font-size: 12px;
    color: var(--text-muted);
}

.trade-conv-links a {
    color: var(--text-muted);
}

.trade-conv-links a:hover {
    color: var(--primary-color);
}

.trade-deal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    font-size: 13px;
}

.trade-deal[hidden] {
    display: none;
}

.trade-deal-text {
    flex: 1;
    min-width: 200px;
    line-height: 1.5;
}

.trade-deal.is-done {
    color: #16a34a;
    font-weight: 600;
}

.trade-deal.is-done .trade-deal-text {
    flex-basis: 100%;
}

.trade-review {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    color: var(--text-main);
    font-weight: 400;
}

.trade-review .form-input {
    flex: 1;
    min-width: 160px;
    height: 36px;
}

.rv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.rv-btn.good.active {
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.rv-btn.bad.active {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

@media (max-width: 600px) {
    .rep-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .rep-summary {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ---------- 영구제·내구도 / 팩 표시 ---------- */
.trade-form-guide {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(var(--primary-color-rgb), 0.08);
    font-size: 13px;
    line-height: 1.6;
}

.trade-form-guide > i {
    color: var(--primary-color);
}

.trade-suggest button .nm {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.trade-term {
    flex-shrink: 0;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.trade-term.permanent {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

.trade-term.durable {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

[data-theme="dark"] .trade-term.permanent {
    color: #34d399;
}

[data-theme="dark"] .trade-term.durable {
    color: #fbbf24;
}

.trade-pack-check {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.trade-pack-check input {
    width: 15px !important;
    height: 15px !important;
    margin: 0;
    padding: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.trade-picked-item.is-pack .trade-pack-check {
    color: var(--primary-color);
}

.trade-pack-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.16);
    color: #7c3aed;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

[data-theme="dark"] .trade-pack-tag {
    color: #c4b5fd;
}

/* 대화 영역: 화면 높이에 맞춰 입력칸이 항상 보이게 */
.trade-chat {
    height: min(calc(100vh - var(--header-height, 64px) - 32px), 720px);
    min-height: 420px;
    scroll-margin-top: calc(var(--header-height, 64px) + 12px);
}

/* 말풍선: 한글 단어 단위 줄바꿈 */
.trade-msg .bubble {
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 태블릿·휴대폰: 하단 메뉴에 입력칸이 가리지 않게 */
@media (max-width: 1024px) {
    .trade-chat {
        height: calc(100dvh - var(--header-height, 56px) - 64px - 24px - env(safe-area-inset-bottom, 0px));
        min-height: 360px;
    }
}

/* ---------- 아이템별 상태 ---------- */
.trade-item-state {
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.trade-item-state.reserved {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.trade-item-state.done {
    background: rgba(127, 127, 127, 0.18);
    color: var(--text-muted);
}

[data-theme="dark"] .trade-item-state.reserved {
    color: #fbbf24;
}

.trade-item-chip.item-done .nm,
.trade-owner-item.item-done .nm {
    text-decoration: line-through;
    opacity: 0.6;
}

.trade-item-chip.item-done img,
.trade-owner-item.item-done img {
    opacity: 0.5;
}

.trade-owner-hint {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.trade-owner-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trade-owner-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.trade-owner-item.item-reserved {
    border-color: rgba(245, 158, 11, 0.5);
}

.trade-owner-item .trade-item-chip {
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0;
}

select.trade-item-status {
    flex-shrink: 0;
    width: auto;
    min-height: 34px;
    padding: 4px 28px 4px 10px;
    font-size: 13px;
}

.trade-status-label {
    font-size: 12px;
    color: var(--text-muted);
    align-self: center;
}
