/* 계약 협상 테이블 (js/negotiate2.js) — FM 방식: 조건표 + 에이전트 대화 */
.nx-back { position: fixed; inset: 0 0 var(--footer-h, 34px) 0; z-index: 900; background: rgba(4, 7, 14, .82); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; opacity: 0; transition: opacity .18s; }
.nx-back.on { opacity: 1; }
.nx { width: min(1380px, 100%); height: min(860px, 100%); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border: 1px solid #22304e; border-radius: 14px; overflow: hidden; background: radial-gradient(ellipse at 20% 0%, #15213b, #0b111f 65%); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }

/* 머리: 선수 · 협상 · 에이전트 */
.nx-hd { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid #1d2a46; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 28%, #0e1526), #0e1526 55%); }
.nx-pl { display: flex; align-items: center; gap: 12px; }
.nx-pl .nx-ph { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; font-size: 20px; }
.nx-pl > div { display: flex; flex-direction: column; gap: 3px; } .nx-pl b { font-size: 19px; display: flex; align-items: center; gap: 6px; } .nx-pl span { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.nx-title { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid #263452; padding-left: 18px; min-width: 0; }
.nx-title small { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; } .nx-title b { font-size: 17px; color: var(--gold-2); } .nx-title span { font-size: 12.5px; color: #b4bfd4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-ag { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #263452; border-radius: 10px; background: rgba(10, 15, 28, .55); }
.nx-ag > div:not(.nx-pat) { display: flex; flex-direction: column; } .nx-ag b { font-size: 14px; } .nx-ag span { font-size: 11.5px; color: var(--muted); }
.nx-kind { font-style: normal; font-weight: 700; } .nx-kind.tough { color: #ff9a9e; } .nx-kind.normal { color: #c9d3e6; } .nx-kind.kind { color: #7ee0ad; }
.nx-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; color: #fff; background: linear-gradient(135deg, #3b4d75, #26324f); box-shadow: 0 0 0 2px #0c1222, 0 0 0 3px #2c3a5c; flex: none; }
.nx-av.sm { width: 28px; height: 28px; font-size: 12px; }
.nx-pat { display: flex; flex-direction: column; gap: 4px; margin-left: 6px; padding-left: 12px; border-left: 1px solid #263452; } .nx-pat small { font-size: 11px; color: var(--muted); }
.nx-pips { display: flex; gap: 3px; } .nx-pips i { width: 14px; height: 6px; border-radius: 3px; background: #26324f; } .nx-pips i.on { background: var(--gold); }
.nx-x { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #2a3758; background: #131c32; font-size: 20px; line-height: 1; }
.nx-x:hover { border-color: var(--gold); }

/* 몸: 조건표 | 대화 */
.nx-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); min-height: 0; }
.nx-terms { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; border-right: 1px solid #1a2540; }
.nx-th { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; } .nx-th h3 { margin: 0; font-size: 15px; }
.nx-stance { font-style: normal; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: #1c2742; color: var(--muted); cursor: help; }
.nx-stance.good { background: rgba(63, 191, 127, .15); color: #7ee0ad; } .nx-stance.warn { background: rgba(230, 180, 80, .14); color: #f0c76a; } .nx-stance.bad { background: rgba(226, 87, 92, .16); color: #ff9a9e; }
.nx-mood { margin-left: auto; display: flex; align-items: center; gap: 8px; } .nx-mood small { font-size: 11.5px; color: var(--muted); } .nx-mood b { font-size: 12.5px; min-width: 84px; }
.nx-meter { width: 120px; height: 7px; border-radius: 4px; background: #1c2742; overflow: hidden; } .nx-meter i { display: block; height: 100%; border-radius: 4px; transition: width .25s; }
.nx-meter.good i { background: #3fbf7f; } .nx-meter.warn i { background: #e6b450; } .nx-meter.bad i { background: #e2575c; }
.nx-mood b.good { color: #7ee0ad; } .nx-mood b.warn { color: #f0c76a; } .nx-mood b.bad { color: #ff9a9e; }
.nx-head, .nx-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(170px, .62fr); gap: 14px; align-items: center; padding: 0 18px; }
.nx-head { font-size: 11px; color: var(--muted); letter-spacing: .05em; padding-bottom: 6px; border-bottom: 1px solid #1a2540; }
.nx-rows { overflow-y: auto; }
.nx-row { padding-top: 11px; padding-bottom: 11px; border-bottom: 1px solid #141d33; border-left: 3px solid transparent; }
.nx-row.ok { border-left-color: #2f8f62; } .nx-row.no { border-left-color: #b88a30; background: rgba(230, 180, 80, .035); }
.nx-k { font-size: 13.5px; font-weight: 600; display: flex; flex-direction: column; gap: 2px; } .nx-k small { font-size: 11px; color: var(--muted); font-weight: 400; }
.nx-imp { font-style: normal; font-size: 11px; color: var(--gold); letter-spacing: 1px; }
.nx-ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nx-req { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: #c9d3e6; } .nx-req span { display: flex; flex-direction: column; gap: 2px; } .nx-req small { color: var(--muted); font-size: 11px; } .nx-req b.must { color: #f0c76a; }
.nx-chk { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; background: rgba(63, 191, 127, .18); color: #7ee0ad; }
.nx-chk.x { background: rgba(230, 180, 80, .18); color: #f0c76a; } .nx-chk.q { background: #1c2742; color: var(--muted); }
.nx-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.nx-seg button, .nx-chips button, .nx-quick button { padding: 6px 12px; border-radius: 7px; border: 1px solid #2a3758; background: #121a2e; color: #b9c4d9; font-size: 12.5px; transition: border-color .12s, background .12s; }
.nx-seg button:hover:not(:disabled), .nx-chips button:hover:not(:disabled), .nx-quick button:hover:not(:disabled) { border-color: #4a5d88; color: var(--text); }
.nx-seg button.on, .nx-chips button.on { border-color: var(--gold); background: rgba(200, 162, 74, .14); color: var(--gold-2); }
.nx-seg button:disabled, .nx-chips button:disabled, .nx-quick button:disabled, .nx-num button:disabled { opacity: .4; cursor: default; }
.nx-num { display: inline-flex; align-items: stretch; border: 1px solid #2a3758; border-radius: 8px; overflow: hidden; background: #0d1426; width: fit-content; }
.nx-num button { width: 30px; border: 0; background: #151e33; color: #b9c4d9; font-size: 14px; } .nx-num button:hover:not(:disabled) { background: #1d2944; color: var(--text); }
.nx-num input { width: 78px; border: 0; background: transparent; text-align: center; font-size: 15px; font-weight: 700; color: var(--gold-2); padding: 6px 0; -moz-appearance: textfield; }
.nx-num input::-webkit-outer-spin-button, .nx-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nx-quick { display: flex; gap: 4px; } .nx-quick button { padding: 3px 9px; font-size: 11.5px; }
.nx-kind-note { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .nx-kind-note .nx-num input { width: 60px; font-size: 13px; }
.nx-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.nx-fin { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 12px 18px; border-top: 1px solid #1a2540; background: rgba(8, 12, 22, .45); }
.nx-fin > div { display: flex; flex-direction: column; gap: 2px; } .nx-fin small { font-size: 11px; color: var(--muted); } .nx-fin b { font-size: 16px; } .nx-fin b.neg { color: #ff9a9e; } .nx-fin em { font-style: normal; font-size: 11.5px; color: var(--muted); } .nx-fin em.neg { color: #ff9a9e; }

.nx-talk { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; background: rgba(6, 10, 19, .35); }
.nx-log { overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.nx-say { display: flex; align-items: flex-start; gap: 8px; } .nx-say.m { justify-content: flex-end; }
.nx-say p { margin: 0; max-width: 86%; padding: 10px 14px; border-radius: 13px; font-size: 13.5px; line-height: 1.6; }
.nx-say.a p { background: #18233d; border: 1px solid #23304f; border-top-left-radius: 4px; }
.nx-say.m p { background: rgba(200, 162, 74, .12); border: 1px solid rgba(200, 162, 74, .32); color: #f2e2b8; border-top-right-radius: 4px; font-size: 12.5px; }
.nx-qs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px 14px; border-top: 1px solid #1a2540; }
.nx-qs:empty { display: none; }
.nx-qs button { padding: 7px 12px; border-radius: 99px; border: 1px solid #2a3758; background: #111a2e; color: #c9d3e6; font-size: 12.5px; } .nx-qs button:hover { border-color: var(--gold); color: var(--gold-2); }

/* 아래 */
.nx-ft { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid #1d2a46; background: #0c1222; }
.nx-note { flex: 1; font-size: 12.5px; color: var(--muted); } .nx-note b { color: var(--gold-2); }
.nx-ft .btn-primary { min-width: 140px; }

@media (max-width: 1000px) {
  .nx-back { padding: 0; } .nx { height: 100%; border-radius: 0; }
  .nx-hd { grid-template-columns: minmax(0, 1fr) auto; } .nx-title { grid-column: 1 / -1; grid-row: 2; border-left: 0; padding-left: 0; } .nx-ag { grid-column: 1 / -1; grid-row: 3; } .nx-x { grid-row: 1; grid-column: 2; }
  .nx-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; display: block; }
  .nx-terms { display: block; border-right: 0; } .nx-talk { display: block; } .nx-log { max-height: 46vh; }
  .nx-head { display: none; } .nx-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .nx-th { flex-wrap: wrap; } .nx-mood { margin-left: 0; width: 100%; }
}

/* 에이전트 역제안 · 비전 제시 (js/negotiate3.js) */
.nx-ctr:empty, .nx-pitch:empty { display: none; }
.nx-cc { margin: 0 18px 10px; padding: 10px 12px; border: 1px solid rgba(200, 162, 74, .35); border-radius: 10px; background: rgba(200, 162, 74, .06); display: flex; flex-direction: column; gap: 6px; }
.nx-cc > small { font-size: 11px; color: var(--gold-2); letter-spacing: .04em; }
.nx-cc-r { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .nx-cc-r span { flex: 1; min-width: 180px; font-size: 12.5px; color: #d6deee; } .nx-cc-r em { font-style: normal; font-weight: 700; color: var(--gold); margin-right: 6px; } .nx-cc-r span b { color: var(--gold-2); }
.nx-cc-r .btn-sm { padding: 5px 10px; font-size: 12px; }
.nx-pt { margin: 0 18px 12px; border: 1px solid #263452; border-radius: 10px; background: #0f172b; }
.nx-pt summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 600; color: #c9d3e6; list-style: none; } .nx-pt summary::-webkit-details-marker { display: none; }
.nx-pt summary::before { content: '✦ '; color: var(--gold); } .nx-pt summary small { font-weight: 400; color: var(--muted); font-size: 11px; margin-left: 6px; }
.nx-pt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; padding: 0 10px 10px; max-height: 260px; overflow-y: auto; }
.nx-pt-list button { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 9px; border: 1px solid #2a3758; background: #131c32; color: var(--text); }
.nx-pt-list button:hover:not(:disabled) { border-color: var(--gold); }
.nx-pt-list button b { font-size: 12.5px; } .nx-pt-list button small { font-size: 11px; color: var(--muted); } .nx-pt-list button i { font-style: normal; font-size: 10.5px; color: var(--gold); }
.nx-pt-list button:disabled { opacity: .55; cursor: default; } .nx-pt-list button.ok { border-color: #2f8f62; opacity: 1; } .nx-pt-list button.no { border-color: #7a3a3d; }
.nx-talk { grid-template-rows: minmax(0, 1fr) auto auto auto; }
/* 받은 제안 (FA · 사전 계약) */
.nx-offers:empty { display: none; }
.nx-of { margin: 0 18px 10px; padding: 9px 12px; border: 1px solid #2a3758; border-radius: 10px; background: #0f172b; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12.5px; }
.nx-of small { width: 100%; font-size: 11px; color: var(--muted); } .nx-of span { display: inline-flex; align-items: center; gap: 5px; color: #c9d3e6; } .nx-of b { color: var(--gold-2); }
.nx-of span.me { color: #7ee0ad; } .nx-of span.me b { color: #7ee0ad; }
.nx-talk { grid-template-rows: minmax(0, 1fr) auto auto auto auto; }

/* 계약 현황 (js/contracts-ui.js) */
.cv { display: flex; flex-direction: column; gap: 14px; }
.cv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 16px 20px; }
.cv-title { flex: 1 1 320px; } .cv-title h2 { margin: 0 0 4px; font-size: 20px; } .cv-title h2 small { color: var(--muted); font-size: 13px; font-weight: 400; } .cv-title > span { font-size: 12.5px; color: var(--muted); }
.cv-kpi { display: grid; grid-template-columns: repeat(5, minmax(110px, auto)); gap: 10px; }
.cv-kpi > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border: 1px solid #1f2b47; border-radius: 10px; background: #0f172b; min-width: 0; }
.cv-kpi small { font-size: 11px; color: var(--muted); } .cv-kpi b { font-size: 19px; } .cv-kpi b.warn, .cv-kpi .warn { color: #f0c76a; } .cv-kpi em { font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.cv-kpi i { display: block; height: 4px; border-radius: 2px; background: #1c2742; overflow: hidden; } .cv-kpi i b { display: block; height: 100%; background: var(--gold); }
.cv-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 14px; }
.cv-todo { padding-bottom: 8px; } .cv-none { padding: 6px 16px 12px; }
.cv-td { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid #172036; border-left: 3px solid transparent; }
.cv-td.bad { border-left-color: #e2575c; } .cv-td.warn { border-left-color: #e6b450; } .cv-td.good { border-left-color: #3fbf7f; }
.cv-td > div { flex: 1; display: flex; flex-direction: column; min-width: 0; } .cv-td b { font-size: 13.5px; } .cv-td span { font-size: 12px; color: #b4bfd4; }
.cv-td .pl-ph, .cv-pr .pl-ph, .cv-p .pl-ph { width: 30px; height: 30px; border-radius: 7px; flex: none; font-size: 11px; }
.cv-bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 6px 16px 14px; }
.cv-bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.cv-bars i { width: 70%; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--gold), #8a6b25); min-height: 4px; } .cv-bars b { font-size: 12px; } .cv-bars small { font-size: 10.5px; color: var(--muted); }
.cv-table .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cv-f { display: inline-flex; gap: 4px; } .cv-f button { padding: 4px 11px; border-radius: 7px; border: 1px solid #2a3758; background: #121a2e; color: #b9c4d9; font-size: 12px; } .cv-f button.on { border-color: var(--gold); color: var(--gold-2); background: rgba(200, 162, 74, .12); }
.cv-table th[data-sort] { cursor: pointer; } .cv-table th.on { color: var(--gold-2); }
.cv-table tr[data-id] { cursor: pointer; } .cv-table tr.r4 td:first-child, .cv-table tr.r3 td:first-child { box-shadow: inset 3px 0 0 #e2575c; } .cv-table tr.r2 td:first-child { box-shadow: inset 3px 0 0 #e6b450; }
.cv-p { display: flex; align-items: center; gap: 7px; } .cv-p b { font-size: 13px; }
.cv-k { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #1c2742; color: #b9c4d9; white-space: nowrap; } .cv-k.core { background: rgba(200, 162, 74, .14); color: var(--gold-2); } .cv-k.prot { background: rgba(120, 160, 255, .15); color: #a9c3ff; }
.cv-end { display: flex; flex-direction: column; gap: 3px; min-width: 110px; } .cv-end span { font-size: 12.5px; } .cv-end small { color: var(--muted); }
.cv-end i { display: block; height: 4px; border-radius: 2px; background: #1c2742; overflow: hidden; } .cv-end i b { display: block; height: 100%; background: #4a6fae; } .cv-end i b.warn { background: #e6b450; }
.cv-st { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #1c2742; color: var(--muted); white-space: nowrap; margin-right: 5px; }
.cv-st.g { background: rgba(63, 191, 127, .15); color: #7ee0ad; } .cv-st.n { background: #1c2742; color: #c9d3e6; } .cv-st.w { background: rgba(230, 180, 80, .14); color: #f0c76a; } .cv-st.b { background: rgba(226, 87, 92, .16); color: #ff9a9e; }
.cv-table td small { font-size: 11px; color: var(--muted); }
.cv-pr { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid #172036; } .cv-pr b { font-size: 13px; min-width: 90px; } .cv-pr span { flex: 1; font-size: 12.5px; color: #c9d3e6; } .cv-pr small { font-size: 11.5px; color: var(--muted); } .cv-pr.warn small { color: #f0c76a; }
.nx-coach { height: min(560px, 100%); }
@media (max-width: 1000px) { .cv-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cv-top { grid-template-columns: minmax(0, 1fr); } .cv-table td:nth-child(2), .cv-table th:nth-child(2), .cv-table td:nth-child(6), .cv-table th:nth-child(6) { display: none; } }
.st-table tr.st-grp td { background: #121a2e; color: var(--gold-2); font-size: 12px; font-weight: 700; letter-spacing: .03em; padding: 6px 12px; }
