/* Negotiation view */
.view-negotiation { overflow-y: auto; }
.neg-root { padding: 20px 24px 40px; max-width: 1100px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.neg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.neg-head h1 { font-size: 20px; font-weight: 600; }
.neg-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted-fg); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.neg-timeline { list-style: none; display: flex; gap: 0; overflow-x: auto; padding: 4px 2px 10px; position: relative; scrollbar-width: thin; }
.neg-timeline li { flex: 0 0 auto; position: relative; padding-right: 14px; }
.neg-timeline li:not(:last-child)::after { content: ""; position: absolute; top: 22px; right: 0; width: 14px; height: 2px; background: var(--border-strong); }
.neg-round { width: 176px; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card); }
.neg-round:hover { border-color: var(--border-strong); }
.neg-round.on { border-color: var(--primary); background: var(--primary-50); box-shadow: var(--shadow-sm); }
.neg-round-n { font-weight: 600; font-size: 13px; }
.neg-round-meta { font-size: 11px; color: var(--muted-fg); }
.neg-round-bar, .neg-progress { height: 6px; border-radius: 99px; background: var(--muted); overflow: hidden; display: flex; }
.neg-round-bar i { background: var(--ok); }
.neg-round-counts { font-size: 10.5px; color: var(--muted-fg); }
.neg-round-counts b { font-weight: 600; margin-left: 4px; }
.c-open { color: var(--warn); } .c-ok { color: var(--ok); } .c-bad { color: var(--bad); } .c-info { color: var(--info); }

.neg-summary { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.neg-sum-top { display: flex; justify-content: space-between; align-items: center; }
.neg-sum-pct { font-weight: 600; color: var(--primary); }
.neg-progress { height: 10px; }
.neg-progress .p-ok { background: var(--ok); } .neg-progress .p-info { background: var(--info); } .neg-progress .p-bad { background: var(--bad); }
.neg-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.neg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.neg-tab { padding: 8px 14px; border: 0; background: transparent; font-size: 13px; color: var(--muted-fg); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.neg-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.neg-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pill-btn { padding: 3px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); font-size: 12px; text-transform: capitalize; }
.pill-btn.on { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }

.neg-doc { margin-bottom: 18px; }
.neg-doc h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--secondary); padding: 6px 0; flex-wrap: wrap; }
.neg-sec { margin-bottom: 12px; }
.neg-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.neg-sec-n { font-family: var(--font-mono); font-size: 12px; background: var(--muted); padding: 1px 7px; border-radius: 6px; }
.neg-change { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.neg-change.st-accepted { border-left-color: var(--ok); } .neg-change.st-rejected { border-left-color: var(--bad); } .neg-change.st-countered { border-left-color: var(--info); }
.neg-change header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.neg-type { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 1px 8px; border-radius: 6px; background: var(--info-bg); color: var(--info); }
.neg-type.t-insert { background: var(--ok-bg); color: var(--ok); } .neg-type.t-delete { background: var(--bad-bg); color: var(--bad); }
.btn.ok { color: var(--ok); border-color: hsl(142 40% 78%); } .btn.ok:hover { background: var(--ok-bg); }
.neg-applied { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; color: var(--ok); }
.neg-note { margin: 6px 0 0; font-size: 12.5px; }
.neg-diff { margin-top: 8px; padding: 8px 10px; background: var(--bg); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.neg-del { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
.neg-ins { background: var(--ok-bg); color: var(--ok); text-decoration: none; }
.neg-counter { margin-top: 8px; padding: 8px 10px; background: var(--info-bg); border-radius: var(--radius-sm); font-size: 12.5px; overflow-wrap: anywhere; }
.neg-counter-form { margin-top: 10px; } .neg-counter-form textarea, .neg-ledger textarea, .modal textarea { width: 100%; resize: vertical; }
.neg-preview { max-height: 46vh; overflow-y: auto; }

.neg-gauge { padding: 14px 16px; margin-bottom: 12px; }
.neg-gauge-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.neg-bar { height: 14px; border-radius: 99px; background: var(--muted); display: flex; overflow: hidden; }
.neg-bar .gave { background: var(--warn); } .neg-bar .got { background: var(--ok); }
.neg-bar-legend { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; align-items: center; flex-wrap: wrap; }
.neg-bar-legend small { color: var(--muted-fg); margin-left: auto; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; } .dot.gave { background: var(--warn); } .dot.got { background: var(--ok); }
.neg-table-wrap { overflow-x: auto; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.neg-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.neg-table th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-fg); padding: 8px 12px; background: var(--muted); }
.neg-table td { padding: 8px 12px; border-top: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.neg-form { padding: 14px 16px; } .neg-form h3 { font-size: 13px; margin-bottom: 10px; }
.neg-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.neg-cmp-pick { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.neg-cmp-pick select { padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card); }
.neg-cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.neg-cmp-grid .card { padding: 12px 14px; } .neg-cmp-grid h3 { font-size: 13px; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.neg-cmp-grid ul { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }

@media (max-width: 600px) {
  .neg-root { padding: 14px 16px 32px; }
  .neg-round { width: 150px; }
  .neg-change header .spacer { flex-basis: 100%; height: 0; }
  .neg-bar-legend small { margin-left: 0; }
}
.neg-panel { padding: 14px 16px; border-color: var(--primary-100); }
.neg-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .neg-panel-head h3 { font-size: 14px; }
.neg-panel textarea { width: 100%; resize: vertical; }
