#trade-own-content {
    width: 800px;
    position: absolute;
    top: 25px;
    left: max(50%, 720px);
    transform: translateX(-50%);
    background: #F0EEE9d9;
    border-radius: 10px;
    font-size: 1rem;
    padding: 20px;
    box-sizing: border-box;
    min-height: 650px;
}

.trade-title {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 8px 0;
    margin-bottom: 30px;
}

.trade-own-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    min-height: 350px;
}

/* 카드: 인벤토리 카드(240px) 3개 폭 + 사이 간격(20px x 2) */
.trade-own-card {
    position: relative;
    width: 760px;
    height: 100px;
    background: #E7ECF2;
    border: 1px solid #C7D2DE;
    border-radius: 8px;
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    padding: 8px;
    gap: 0;
}
/* 모습(일반/샤이니/다크)별 카드 배경색 — 살짝만 다르게, 정보 구분용이라
   시선을 크게 끌지 않는 톤으로 정함. form-0(일반)은 기존 배경색 그대로. */
.trade-own-card.form-1 {
    background: #F1EAD0;
    border-color: #E6D8A8;
}
.trade-own-card.form-2 {
    background: #EDE3F5;
    border-color: #CBB8DE;
}

.trade-own-card:hover {
    outline: 2px solid #4444ff;
}


/* 왼쪽: 스프라이트 + 이름 + 레벨 (인벤토리 card-left와 동일) */
.trade-own-card .card-left {
    position: relative;
    flex: 0 0 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 10px;
    gap: 0px;
}
.trade-own-card .status-icon {
    position: absolute;
    top: 4px;
    right: -164px;
    width: 14px;
    height: 14px;
    image-rendering: pixelated;
}
.trade-own-card .sprite {
    width: 60px;
    height: 60px;
    margin-top: 0px;
    image-rendering: pixelated;
}
.trade-own-card .name {
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    margin-top: 0;
}
.trade-own-card .level {
    font-size: 0.8rem;
    color: #000;
}

/* 가운데: 별명 + 기술표 + 교환 등록/취소 버튼 (인벤토리 card-right와 동일 폭) */
.trade-own-card .card-mid {
    flex: 0 0 170px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
    padding: 0;
}
.trade-own-card .nickname-row {
    font-size: 0.7rem;
    font-weight: bold;
    color: #000;
    padding-bottom: 1px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trade-own-card .nickname-row .nickname-value {
    font-weight: normal;
    color: #000;
}
.trade-own-card .move-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(2, auto);
    min-height: 35px;
    gap: 1px 6px;
    width: calc(100% - 5px);
    border-top: 1px solid #C7D2DE;
    border-bottom: 1px solid #C7D2DE;
    padding: 3px 0;
}
.trade-own-card .move-cell {
    font-size: 0.7rem;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}
.trade-own-card .card-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 3px;
}
.trade-own-card .card-action-link {
    position: static;
    width: auto;
    height: auto;
    bottom: auto;
    right: auto;
    display: block;
    flex: 1 1 0;
    text-align: left;
    font-size: 0.7rem;
    color: #4444ff;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: default;
    white-space: nowrap;
    /* 버튼 박스 자체는 배치(균등 분할)만 담당하고 클릭은 받지 않습니다.
       실제 클릭은 안의 .link-text(텍스트 크기만큼)에서만 반응하도록
       분리합니다 — 박스가 넓어도 글자 밖 여백은 클릭되지 않게 하기 위함. */
    pointer-events: none;
}
.trade-own-card .card-action-link .link-text {
    pointer-events: auto;
    cursor: pointer;
}
.trade-own-card .card-action-link .link-text:hover {
    text-decoration: underline;
}
.trade-own-card .card-action-link:nth-child(2) {
    padding-left: 1px;
}
.trade-own-card .action-cancel {
    color: #4444ff;
}

/* 세로 구분선 */
.trade-own-card .card-divider {
    flex: 0 0 1px;
    background: #C7D2DE;
    margin: 4px 4px;
}

/* 오른쪽: 조건 표 영역 */
.trade-own-card .card-conditions {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    padding-left: 8px;
    gap: 6px;
}

.condition-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.condition-row td {
    font-size: 0.8rem;
    text-align: center;
    padding: 4px 2px;
    vertical-align: middle;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.condition-row td:nth-child(1) { width: 10%;}
.condition-row td:nth-child(2) { width: 20%;}
.condition-row td:nth-child(3) { width: 20%;}
.condition-row td:nth-child(4) { width: 30%;}
.condition-row td:nth-child(5) { width: 15%;}
.condition-row td:nth-child(6) { width: 5%;}

.cond-pick-button {
    position: static;
    width: 90%;
    height: auto;
    padding: 3px 3px;
    font-size: 0.8rem;
    font-family: inherit;
    border: 1px solid #C7D2DE;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    margin: 0 auto;
}
.cond-pick-button:hover {
    background: #DCE4EE;
}

.cond-level {
    display: table-cell;
    gap: 2px;
    align-items: center;
    justify-content: flex-start;
}
.cond-level-value,
.cond-level-op {
    font-size: 0.8rem;
    font-family: inherit;
    border: 1px solid #C7D2DE;
    border-radius: 3px;
    background: #ffffff;
    padding: 2px 3px;
    box-sizing: border-box;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    flex-shrink: 0;
}
.cond-level-value {
    width: 60px;
}
.cond-level-op {
    width: 60px;
}

.form-toggle-group {
    display: flex;
    gap: 3px;
    justify-content: center;
    align-items: center;
}
.form-toggle-btn {
    position: static;
    width: 20px;
    height: 20px;
    padding: 1px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    bottom: auto;
    right: auto;
}
.form-toggle-btn img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}
.form-toggle-btn[aria-pressed="true"] {
    opacity: 1;
    border-color: #4444ff;
    background: #ffffff;
}
.form-toggle-btn:hover {
    opacity: 0.75;
}
.form-toggle-btn[aria-pressed="true"]:hover {
    opacity: 1;
}

.condition-remove-btn {
    position: static;
    width: 18px;
    height: 18px;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1;
    border: none;
    background: none;
    color: #cc3333;
    cursor: pointer;
}
.condition-remove-btn:hover:not(:disabled) {
    color: #a10000;
}
.condition-remove-btn:disabled {
    color: #bbb;
    cursor: default;
}

.add-condition-button {
    position: static;
    width: auto;
    height: auto;
    align-self: center;
    padding: 3px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    border: 1px solid #C7D2DE;
    background: #E7ECF2;
    border-radius: 4px;
    cursor: pointer;
}
.add-condition-button:hover:not(:disabled) {
    background: #DCE4EE;
}
.add-condition-button:disabled {
    color: #aaa;
    cursor: default;
    background: #F0EEE9;
}

/* 확인 팝업 텍스트 보강 (base.css의 .modal-* 재사용, 추가 스타일만) */
.modal-secondary {
    background: #E7ECF2 !important;
    border-color: #C7D2DE !important;
    color: #000 !important;
}
.modal-secondary:hover {
    background: #DCE4EE !important;
}
.modal-actions {
    gap: 10px;
}

.pagination {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.pagination button {
    position: static;
    min-width: 32px;
    width: auto;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #C7D2DE;
    background: #F0EEE9;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}
.pagination button:hover {
    background: #E7ECF2;
}
.pagination button.active {
    background: #4444ff;
    border-color: #4444ff;
    color: #fff;
    font-weight: bold;
    cursor: default;
}
.pagination button:disabled {
    color: #aaa;
    cursor: default;
    background: #F0EEE9;
}

.pokemon-toolbar {
    position: absolute;
    top: 60px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.sort-buttons {
    display: flex;
    gap: 12px;
}
.sort-button {
    position: static;
    width: auto;
    height: auto;
    padding: 4px 2px;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-family: inherit;
    color: #000;
    cursor: pointer;
}
.sort-button:hover {
    text-decoration: underline;
}
.sort-button.active {
    font-weight: bold;
    color: #000;
}
.filter-wrap {
    position: relative;
}
.filter-button {
    position: static;
    width: auto;
    height: auto;
    padding: 6px 14px 4px;
    border: 1px solid #C7D2DE;
    background: #E7ECF2;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}
.filter-button:hover {
    background: #DCE4EE;
}
.filter-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: #ffffff;
    border: 1px solid #C7D2DE;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 20px;
    display: grid;
    grid-template-columns: 110px 110px;
    gap: 8px 0px;
    z-index: 10;
    box-sizing: border-box
}
.filter-panel label {
    display: flex;
    width: 100%;
    margin-bottom: 0;
    align-items: center;
    gap: 2px;
    font-size: 1rem;
    white-space: nowrap;
    cursor: pointer;
}
.filter-panel label span {
    display: inline-block;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    min-width: 0;
}
.filter-panel label input {
    flex: 0 0 auto;
    height: 14px;
}
.filter-panel label.filter-all {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 110px 110px;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid #C7D2DE;
    align-items: center;
    width: calc(100% - 45px);
}
.filter-panel label.filter-all span {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 2px;
}
.filter-panel label.filter-all input {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    margin-left: auto;
    transform: translateX(2px);
}

/* ══════════════════════════════════════════════
   포켓몬 선택 모달
   ══════════════════════════════════════════════ */
.pick-modal {
    width: 800px;
    height: 700px;
    background: #F0EEE9;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.pick-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-right: 6px;
}
.pick-modal-title {
    font-size: 1.3rem;
    font-weight: bold;
}
.pick-modal-close {
    position: static;
    width: 28px;
    height: 28px;
    border: 1px solid #C7D2DE;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}
.pick-modal-close:hover {
    background: #DCE4EE;
}

.pick-modal-search-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    position: relative;
    padding-right: 6px;
}
.pick-modal-search {
    flex: 0 0 250px;
    padding: 8px 12px;
    border: 1px solid #C7D2DE;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}
.pick-modal-filter-btn {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 14px;
    border: 1px solid #C7D2DE;
    background: #E7ECF2;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.pick-modal-filter-btn:hover {
    background: #DCE4EE;
}
.pick-modal-confirm-btn {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 18px;
    margin-left: auto;
    border: 1px solid #4444ff;
    background: #4444ff;
    color: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}
.pick-modal-confirm-btn:hover:not(:disabled) {
    background: #3333dd;
}
.pick-modal-confirm-btn:disabled {
    background: #C7D2DE;
    border-color: #C7D2DE;
    color: #888;
    cursor: default;
}

/* pick 모달 안의 필터 패널은 검색행 기준 상대위치이므로 위치만 재정의 */
.pick-modal-search-row .filter-wrap {
    position: relative;
}
.pick-modal-search-row .filter-panel {
    top: calc(100% + 10px);
    left: 0;
    right: auto;
}

.pick-grid {
    display: grid;
    grid-template-columns: repeat(8, 80px);
    align-content: start;
    gap: 16px;
    justify-content: start;
    overflow-y: auto;
    padding: 4px 2px;
    flex: 1;
    min-height: 0;
}

.pick-card {
    width: 80px;
    height: 80px;
    background: #E7ECF2;
    border: 1px solid #C7D2DE;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-sizing: border-box;
    gap: 2px;
}
.pick-card:hover {
    background: #DCE4EE;
    border-color: #9fb0c7;
}
.pick-card.selected {
    background: #DCE4EE;
    border: 2px solid #4444ff;
}
.pick-card:focus-visible {
    outline: 2px solid #4444ff;
    outline-offset: 2px;
}
/* 선택된 카드는 이미 파란 테두리(.selected)로 표시되므로, 포커스 아웃라인까지
   겹치면 두 겹으로 보입니다. 선택된 카드에서는 포커스 아웃라인을 끕니다. */
.pick-card.selected:focus-visible {
    outline: none;
}
.pick-card .pick-sprite {
    width: 56px;
    height: 56px;
    image-rendering: pixelated;
}
.pick-card .pick-name {
    font-size: 0.68rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 74px;
}

.pick-modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}
.pick-modal-footer button {
    position: static;
    min-width: 32px;
    width: auto;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #C7D2DE;
    background: #F0EEE9;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}
.pick-modal-footer button:hover {
    background: #E7ECF2;
}
.pick-modal-footer button.active {
    background: #4444ff;
    border-color: #4444ff;
    color: #fff;
    font-weight: bold;
    cursor: default;
}

.register-confirm-card {
    width: 400px;
    max-width: 400px;
}
.register-confirm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    table-layout: fixed;
}
.register-confirm-table td {
    font-size: 0.8rem;
    text-align: center;
    padding: 6px 4px;
    border-bottom: 1px solid #C7D2DE;
    white-space: nowrap;
}
.register-confirm-table td:nth-child(1) { width: 15%;}
.register-confirm-table td:nth-child(2) { width: 20%;}
.register-confirm-table td:nth-child(3) { width: 25%;}
.register-confirm-table td:nth-child(4) { width: 25%;}
.register-confirm-table td:nth-child(5) { width: 15%;}

#cancel-confirm-yes,
#cancel-confirm-no {
    white-space: nowrap;
    width: 75px;
}
.pick-sort-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 10px;
}
.pick-sort-buttons .sort-button {
    position: static;
    width: auto;
    height: auto;
    padding: 4px 2px;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-family: inherit;
    color: #000;
    cursor: pointer;
    white-space: nowrap;
}
.pick-sort-buttons .sort-button:hover {
    text-decoration: underline;
}
.pick-sort-buttons .sort-button.active {
    font-weight: bold;
    color: #000;
}