/* ═══ DISPUTES (Ren 2026-11-03, canvas "Dispute to refund flow").
   Markup: dispute.js (form, Dispute opened, deal pop-up block, chat line).
   Colours come from agreements.css (--ag-*), so dark mode follows. ═══ */
.cc-dsp-page { position: fixed; inset: 0; z-index: 10070; background: var(--ag-page, #eef3ef); color: var(--ag-ink, #1a2b20); display: flex; flex-direction: column; font-family: 'Inter', system-ui, sans-serif; animation: ccDspIn .18s ease-out; }
@keyframes ccDspIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.cc-dsp-page svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.cc-dsp-top { height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 0 8px; padding-top: env(safe-area-inset-top); background: var(--ag-card, #fff); border-bottom: 1px solid var(--ag-line, #e3e9e5); }
.cc-dsp-top b { font-size: 17px; font-weight: 800; }
.cc-dsp-ib { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: inherit; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cc-dsp-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; max-width: 560px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.cc-dsp-foot { flex-shrink: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: var(--ag-card, #fff); border-top: 1px solid var(--ag-line, #e3e9e5); }
.cc-dsp-foot.col { grid-template-columns: 1fr; background: transparent; border-top: 0; max-width: 560px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.cc-dsp-send { background: #a65a0a; color: #fff; }
.cc-dsp-send:disabled { opacity: .7; }
.cc-dsp-dark { background: var(--ag-ink, #1a2b20); color: var(--ag-card, #fff); }
.cc-dsp-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; }
.cc-dsp-note svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; margin-top: 1px; }
.cc-dsp-note.orange { background: var(--ag-orange-bg); color: var(--ag-orange-ink); }
.cc-dsp-note.blue { background: var(--ag-blue-bg); color: var(--ag-blue-ink); }
.cc-dsp-field { display: flex; flex-direction: column; gap: 8px; }
.cc-dsp-q { font-size: 14px; font-weight: 700; }
.cc-dsp-q i { font-style: normal; font-weight: 500; color: var(--ag-label); }
.cc-dsp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-dsp-chip { min-height: 42px; padding: 0 14px; border-radius: 21px; border: 1px solid var(--ag-line); background: var(--ag-card); color: var(--ag-ink); font: 600 14px 'Inter', system-ui, sans-serif; cursor: pointer; }
.cc-dsp-chip.on { background: var(--ag-orange-bg); border-color: var(--ag-orange); color: var(--ag-orange-ink); }
.cc-dsp-text { width: 100%; box-sizing: border-box; border: 1px solid #c9d4cc; border-radius: 14px; padding: 12px; font: 400 16px/1.45 'Inter', system-ui, sans-serif; color: var(--ag-ink); background: var(--ag-card); resize: vertical; min-height: 120px; }
.cc-dsp-text:focus { outline: 3px solid rgba(196,106,12,.35); border-color: var(--ag-orange); }
.cc-dsp-count { align-self: flex-end; font-size: 12px; color: var(--ag-label); }
.cc-dsp-seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cc-dsp-seg button { min-height: 44px; border-radius: 12px; border: 1px solid var(--ag-line); background: var(--ag-card); color: var(--ag-ink); font: 600 13px 'Inter', system-ui, sans-serif; cursor: pointer; padding: 0; }
.cc-dsp-seg button.on { background: var(--ag-ink); border-color: var(--ag-ink); color: var(--ag-card); }
.cc-dsp-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.cc-dsp-ph, .cc-dsp-add { width: 76px; height: 76px; border-radius: 14px; position: relative; flex-shrink: 0; }
.cc-dsp-ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }
.cc-dsp-ph button { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 13px; border: 2px solid var(--ag-card); background: var(--ag-ink); color: var(--ag-card); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.cc-dsp-ph button svg { width: 14px; height: 14px; }
.cc-dsp-add { border: 2px dashed #c9d4cc; background: var(--ag-soft); color: var(--ag-label); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cc-dsp-hint { font-size: 12px; line-height: 1.4; color: var(--ag-label); }
.cc-dsp-quote { background: var(--ag-orange-bg); color: var(--ag-orange-ink); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.cc-dsp-lbl { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--ag-label); }
.cc-dsp-quote .cc-dsp-lbl { color: var(--ag-orange-ink); }
/* Dispute opened */
.cc-dsp-center { align-items: stretch; padding-top: 48px; }
.cc-dsp-center > h2 { margin: 0; text-align: center; font-size: 26px; font-weight: 800; }
.cc-dsp-center > p { margin: 0; text-align: center; font-size: 15px; line-height: 1.45; color: var(--ag-muted); }
.cc-dsp-big { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; align-self: center; }
.cc-dsp-big svg { width: 30px; height: 30px; }
.cc-dsp-big.orange { background: var(--ag-orange-bg); color: var(--ag-orange); }
.cc-dsp-card { background: var(--ag-card); border: 1px solid var(--ag-line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.cc-dsp-step { display: flex; gap: 12px; align-items: flex-start; }
.cc-dsp-step b { display: block; font-size: 15px; font-weight: 700; }
.cc-dsp-step small { display: block; font-size: 13px; line-height: 1.4; color: var(--ag-muted); margin-top: 2px; }
.cc-dsp-n { width: 28px; height: 28px; border-radius: 14px; background: var(--ag-soft); color: var(--ag-muted); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.cc-dsp-n.on { background: var(--ag-teal); color: #fff; }
.cc-dsp-n svg { width: 16px; height: 16px; }
/* Inside the deal pop-up */
.cc-dsp-panel { display: flex; flex-direction: column; gap: 10px; }
.cc-dsp-panel svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.cc-dsp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cc-dsp-steps span { display: flex; flex-direction: column; gap: 6px; }
.cc-dsp-steps i { display: block; height: 5px; border-radius: 5px; background: var(--ag-track); }
.cc-dsp-steps em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ag-label); }
.cc-dsp-steps .done i, .cc-dsp-steps .now i { background: #c46a0c; }
.cc-dsp-steps .now em { color: var(--ag-orange-ink); }
.cc-dsp-side { background: var(--ag-card); border: 1px solid var(--ag-line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.cc-dsp-side.empty > span:last-child { font-size: 14px; color: var(--ag-muted); }
.cc-dsp-said { font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ag-text); }
.cc-dsp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-dsp-tags i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ag-orange-ink); background: var(--ag-orange-bg); border-radius: 10px; padding: 3px 10px; }
.cc-dsp-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-dsp-thumb { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; border: 0; padding: 0; cursor: zoom-in; background: var(--ag-soft); }
.cc-dsp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-dsp-result { border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.cc-dsp-result b { font-size: 22px; font-weight: 800; line-height: 1.25; padding-right: 48px; }
.cc-dsp-result small { font-size: 13px; line-height: 1.45; }
.cc-dsp-rt { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.6); }
.cc-dsp-result.purple { background: var(--ag-purple-bg); color: var(--ag-ink); }
.cc-dsp-result.purple .cc-dsp-lbl, .cc-dsp-result.purple .cc-dsp-rt { color: var(--ag-purple); }
.cc-dsp-result.blue { background: var(--ag-blue-bg); color: var(--ag-ink); }
.cc-dsp-result.blue .cc-dsp-lbl, .cc-dsp-result.blue .cc-dsp-rt { color: var(--ag-blue-ink); }
.cc-dsp-result.split { background: var(--ag-card); border: 2px solid var(--ag-purple); color: var(--ag-ink); }
.cc-dsp-result.split .cc-dsp-lbl, .cc-dsp-result.split .cc-dsp-rt { color: var(--ag-purple); }
.cc-dsp-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 4px 0; }
.cc-dsp-bar i { background: #5b3aa8; }
.cc-dsp-bar b { background: #0b7a6c; padding: 0; }
.cc-dsp-rnote { margin-top: 6px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.45; }
body.dark-mode .cc-dsp-rt { background: rgba(0,0,0,.25); }
body.dark-mode .cc-dsp-result.purple .cc-dsp-lbl, body.dark-mode .cc-dsp-result.purple .cc-dsp-rt,
body.dark-mode .cc-dsp-result.split .cc-dsp-lbl, body.dark-mode .cc-dsp-result.split .cc-dsp-rt { color: #c7b3f5; }
/* Chat line */
.chat-system-msg.cc-dsp-chat { text-align: left; line-height: 1.45; cursor: pointer; }
.chat-system-msg.cc-dsp-chat.orange { background: rgba(245,158,11,.10); color: #92400e; }
.chat-system-msg.cc-dsp-chat.blue { background: rgba(31,111,209,.10); color: #174f96; }
body.dark-mode .chat-system-msg.cc-dsp-chat.orange { color: #f3b46b; }
body.dark-mode .chat-system-msg.cc-dsp-chat.blue { color: #8fbaf0; }
.chat-system-msg.cc-dsp-chat svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
/* Chat pinned bar while a deal is under review */
#chatPinnedAgreement.cc-pin-dispute { background: #fdf0e1 !important; }
#chatPinnedAgreement.cc-pin-dispute > span:first-child { color: #c46a0c; }
#chatPinnedAgreement.cc-pin-dispute .cc-pstep.on i { background: #c46a0c; }
body.dark-mode #chatPinnedAgreement.cc-pin-dispute { background: rgba(196,106,12,.2) !important; }
/* Dispute bond line (Ren 2026-11-08) */
.cc-dsp-note[hidden] { display: none; }
.cc-dsp-note.cc-dsp-bond { background: #f1ecfb; color: #4a2f8f; }
