[data-modal-page] [hidden] { display: none !important; }
/* 거래 상세의 여섯 단계 요약은 탭 위에서 동일한 순서로 표시한다. */
.trx-progress { margin: 0; background: linear-gradient(135deg, #fafaf9, #f5f5f4); }
.trx-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.trx-progress-eyebrow { margin: 0 0 5px; color: #78716c; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.trx-progress-heading h3 { margin: 0; color: #292524; font-size: 17px; font-weight: 700; }
.trx-progress-caption { color: #78716c; font-size: 12px; }
.trx-progress-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.trx-progress-card { min-width: 0; padding: 16px; border: 1px solid #e7e5e4; border-radius: 10px; background: #fff; box-shadow: 0 2px 5px #29252405; }
.trx-progress-card-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.trx-progress-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: #f5f5f4; color: #57534e; font-size: 19px; }
.trx-progress-card-heading h4 { margin: 0; color: #44403c; font-size: 13px; font-weight: 700; }
.trx-progress-number { margin-left: auto; color: #a8a29e; font-size: 12px; font-weight: 600; }
.trx-progress-statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.trx-progress-status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.trx-progress-status-row .trx-progress-statuses { flex: 1; }
.trx-progress-value { display: inline-flex; align-items: baseline; gap: 3px; margin-left: auto; color: #44403c; white-space: nowrap; font-size: 11px; }
.trx-progress-value strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trx-progress-statuses .tx-badge { gap: 5px; width: auto; }
.trx-progress-note { margin: 10px 0 0; color: #57534e; font-size: 12px; overflow-wrap: anywhere; }
.trx-progress-dates { margin: 12px 0 0; }
.trx-progress-dates > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-top: 5px; font-size: 11px; }
.trx-progress-dates dt { color: #78716c; }
.trx-progress-dates dd { margin: 0; color: #44403c; font-variant-numeric: tabular-nums; }
.trx-progress-more { margin: 8px 0 0; color: #78716c; font-size: 11px; }
.trx-progress-amount { display: flex; align-items: baseline; gap: 4px; margin: 12px 0 0; color: #b91c1c; font-size: 11px; }
.trx-progress-amount strong { margin-left: auto; font-size: 16px; }
@media (max-width: 799px) { .trx-progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .trx-progress-caption { display: none; } }
@media (max-width: 479px) { .trx-progress-grid { grid-template-columns: minmax(0, 1fr); } }
[data-modal-page] button:disabled { cursor: not-allowed; opacity: .45; }
[data-modal-page] input[type="checkbox"] { accent-color: var(--primary); }
[data-modal-page] .tx-table-select-cell + .tx-table-sticky-left { left: 40px; }

.modal-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px 20px;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.modal-detail-grid.mcht-basic-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.modal-detail-grid > div {
    display: grid;
    grid-template-columns: minmax(120px, 40%) minmax(0, 1fr);
    align-items: stretch;
    min-width: 0;
    min-height: 36px;
    column-gap: 8px;
}

/* 배경 없이 하단 구분선으로 상세 항목을 구분한다. */
.modal-detail-grid dt,
.modal-detail-grid dd {
    border-bottom: 1px solid #d6d3d1;
 font-weight: 500; }

.modal-detail-grid dt {
    font-size: 13px;
    margin: 0;
    padding: 6px 12px;
    background: transparent;
    color: #000;
    font-weight: 400;
    text-align: left;
    overflow-wrap: anywhere;
}

.modal-detail-grid dd {
    font-size: 12px;
    min-width: 0;
    margin: 0;
    padding: 6px 12px;
    color: #24314e;
    font-weight: 400;
    text-align: right;
    overflow-wrap: anywhere;
}

/* 메시지 열은 셀 너비 안에서 일반 텍스트와 배지 내용을 줄바꿈한다. */
.tx-table td.modal-message {
    width: 280px;
    max-width: 280px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.tx-table td.modal-message span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.modal-tabs { min-width: 0; background: #fafaf9; }
.modal-tab-list {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    border-bottom: 1px solid #e7e5e4;
    margin: 0;
    padding: 16px 16px 0;
    background: #fafaf9;
    scrollbar-width: thin;
}
.modal-tab-list button {
    box-sizing: border-box;
    flex: 0 0 auto;
    padding: 12px 8px;
    border-bottom: 2px solid transparent;
    border-radius: 6px 6px 0 0;
    color: #292524;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}
.modal-tab-list button:hover { background: #f5f5f4; color: #44403c; }
.modal-tab-list button[aria-selected="true"] {
    border-bottom-color: #57534e;
    background: #f5f5f4;
    color: #292524;
    font-weight: 700;
}
.modal-tab-list button:focus-visible { outline: 2px solid #78716c; outline-offset: -3px; }
.modal-tab-panel { padding: 16px; }
.modal-tab-panel.hidden { display: none; }
.modal-section + .modal-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e7e5e4;
}
.modal-tab-panel > .modal-section {
    padding: 16px;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(36, 49, 78, .02);
}
.modal-tab-panel > .modal-section + .modal-section { margin-top: 12px; }
.modal-section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.modal-section-heading { flex: 1; min-width: 0; }
.modal-section-title { margin: 0 0 16px; font-size: 14px; font-weight: 700; color: #172543; }
.modal-section-heading .modal-section-title { margin: 0; font-size: 14px; line-height: 1.4; }
.modal-section-status { flex-shrink: 0; gap: 2px; }
.modal-section-status .material-symbols-outlined { font-size: 12px; }
.modal-empty { margin: 0; padding: 24px 0; color: #77849c; text-align: center; }
.modal-detail-grid + .modal-detail-grid { margin-top: 24px; padding-top: 20px; border-top: 1px solid #e5eaf3; }
.modal-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-table-text { min-width: 160px; max-width: 420px; white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-memo-form { display: grid; gap: 12px; margin-bottom: 24px; }
.modal-memo-form label { display: block; margin-bottom: 6px; color: #44403c; font-weight: 500; }
.modal-memo-form input:not([type="hidden"]), .modal-memo-form textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #d6d3d1;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    font: inherit;
}
.modal-memo-form textarea { resize: vertical; }
.modal-memo-form .business-dialog-footer { margin: 0; padding: 0; border: 0; }

@media (width < 1280px) {
    .modal-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .modal-detail-grid.mcht-basic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (width < 600px) {
    .modal-detail-grid { grid-template-columns: minmax(0, 1fr); }
    .modal-detail-grid.mcht-basic-grid { grid-template-columns: minmax(0, 1fr); }
    .modal-tab-list { padding: 12px 12px 0; }
    .modal-tab-panel { padding: 12px; }
    .modal-tab-panel > .modal-section { padding: 12px; }
    .modal-section-header { flex-wrap: wrap; gap: 10px; }
    .modal-section-heading .modal-section-title { font-size: 14px; }
}
