body #modal-root .modal.chat-review-modal{width:min(480px,100%);max-width:480px}
.chat-review-modal .modal-head{padding:22px 24px}
.chat-review-modal .modal-content{padding:22px 24px}
.chat-review-context{margin-bottom:22px;overflow-wrap:anywhere}
.chat-review-context strong{font-size:14px}
.chat-review-context p{margin:8px 0 0;font-size:13px;line-height:1.65;color:var(--muted)}
.chat-review-modal .review-form{display:grid;gap:12px}
.chat-review-modal .review-stars{gap:6px;min-width:0}
.chat-review-modal .review-stars legend{font-size:14px;margin-bottom:10px}
.chat-review-modal .review-stars label{position:relative;display:grid;place-items:center;width:44px;height:44px;box-sizing:border-box;padding:5px;border:0;border-radius:10px;background:transparent;color:var(--ink)}
body #modal-root .chat-review-modal .review-stars label:has(input:checked){background:transparent;color:var(--ink)}
.chat-review-modal .review-stars label:hover{background:var(--surface2)}
.chat-review-modal .review-stars input{position:absolute;width:1px;height:1px;opacity:0}
.chat-review-modal .review-stars label:has(input:focus-visible){outline:2px solid var(--primary);outline-offset:2px}
.chat-review-modal .review-stars .chat-review-star{display:grid;place-items:center;filter:grayscale(1);opacity:.4;transition:opacity .15s,filter .15s}
.chat-review-modal .review-stars .is-filled .chat-review-star{filter:none;opacity:1}
.chat-review-modal .chat-review-star .dh-custom-icon{width:32px;height:32px;margin:0}
.chat-review-rating,.chat-review-counter,.chat-review-note{font-size:12px;line-height:1.6;color:var(--muted)}
.chat-review-modal .field{margin-top:8px;gap:8px;min-width:0}
.chat-review-modal textarea{box-sizing:border-box;width:100%;min-height:86px;max-height:160px;resize:vertical}
.chat-review-counter{text-align:right}
.chat-review-counter.chat-error{color:var(--primary);font-weight:600}
.chat-review-footer{display:flex;justify-content:flex-end;gap:10px;padding-top:8px}
body #modal-root .chat-review-footer>.btn{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:10px;border-radius:12px}
.chat-review-footer .dh-custom-icon{width:24px;height:24px;margin:0}
@media(max-width:400px){.chat-review-modal .modal-head,.chat-review-modal .modal-content{padding:18px}}
body .content:has(.chat-workspace){max-width:none;margin:0;padding:26px clamp(18px,2vw,32px);}
body .content .chat-workspace{max-width:none;margin:0;}
.chat-workspace{width:100%;max-width:1320px;margin:0 auto;display:grid;grid-template-columns:310px minmax(0,1fr);height:calc(100dvh - 128px);min-height:520px;border:1px solid var(--line);border-radius:20px;background:var(--surface);overflow:hidden;box-shadow:0 8px 32px #36212c04}
.chat-inbox{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--line)}.chat-inbox-heading{padding:26px 24px 16px}.chat-inbox-heading h1{margin:8px 0 0;font-size:30px}.chat-search{padding:0 18px 18px}.chat-search input{width:100%;border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--surface2);color:var(--ink);font:13px var(--font-body)}
.chat-threads{overflow:auto;scrollbar-width:thin;padding:0 8px 12px}.chat-thread{display:flex;gap:12px;align-items:center;padding:16px 12px;border-radius:12px;position:relative;border-bottom:1px solid var(--line)}.chat-thread.selected{background:var(--surface2);border-bottom-color:transparent}.chat-thread-face{padding:4px;flex:none}.chat-initials{width:34px;height:34px;background:var(--surface2);color:var(--primary);border-radius:50%;display:grid;place-items:center;font-size:12px}.chat-thread-open{display:grid;gap:5px;min-width:0;flex:1;background:none;border:0;text-align:left;padding:0;color:var(--ink);font:13px var(--font-body);cursor:pointer}.chat-thread-top{display:flex;justify-content:space-between;gap:8px;align-items:center}.chat-thread-top strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-thread-top time{font-size:12px;color:var(--muted);flex:none}.chat-thread-topic,.chat-thread-last{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}.chat-thread-topic{color:var(--primary)}.chat-unread{background:var(--primary);color:var(--surface);font-size:12px;min-width:18px;border-radius:10px;padding:3px}.chat-inbox-empty{padding:20px;color:var(--muted);font-size:13px}
.chat-room{display:flex;flex-direction:column;min-height:0;min-width:0}.chat-room-header{display:flex;align-items:center;gap:18px;padding:20px 28px;border-bottom:1px solid var(--line);min-height:85px}.chat-person{display:grid;gap:5px;min-width:0}.chat-person strong{font-size:14px}.chat-person span{font-size:12px;color:var(--muted)}.chat-options{margin-left:auto;position:relative}.chat-options summary{list-style:none;cursor:pointer;width:36px;height:36px;display:grid;place-items:center;font-size:25px}.chat-options summary::-webkit-details-marker{display:none}.chat-options-menu{position:absolute;right:0;top:42px;width:210px;padding:8px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 35px #24131e20;z-index:5}body .chat-options-menu .btn{display:block;width:100%;text-align:left;border:0;background:none;font-size:12px}
.chat-item{margin:16px 24px 0;padding:10px 12px;display:flex;align-items:center;gap:12px;text-align:left;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);cursor:pointer;flex:none}.chat-item img{height:44px;width:44px;object-fit:cover;border-radius:8px}.chat-item>span:not(.chat-item-arrow){display:grid;gap:5px;min-width:0}.chat-item small{font:500 12px var(--font-body);letter-spacing:.1em;color:var(--muted)}.chat-item strong{font:500 12px var(--font-body)}.chat-item-arrow{margin-left:auto;color:var(--muted)}
.chat-messages{flex:1;min-height:0;overflow:auto;padding:24px 30px;display:flex;flex-direction:column;gap:10px;scrollbar-width:thin;background:var(--surface)}.chat-date{align-self:center;color:var(--muted);font-size:12px;margin:6px 0 14px}.chat-bubble{align-self:flex-start;max-width:78%;background:var(--surface2);border:1px solid var(--line);padding:12px 16px;border-radius:16px 16px 16px 4px}.chat-bubble.own{align-self:flex-end;background:#f6e6ed;border-color:transparent;border-radius:16px 16px 4px 16px}.chat-bubble p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.65}.chat-bubble time{display:block;text-align:right;font-size:12px;color:var(--muted);margin-top:5px}body[data-theme=dark] .chat-bubble.own{background:#49303d}
.chat-start,.chat-welcome{margin:auto;text-align:center;max-width:360px;padding:24px}.chat-start h2,.chat-welcome h2{font-size:27px;margin:12px 0}.chat-start p,.chat-welcome p{font-size:13px;line-height:1.8;color:var(--muted)}.chat-welcome-icon{font:36px var(--font-display);color:var(--primary)}
.chat-compose{margin:0 24px;display:flex;gap:12px;align-items:flex-end;padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.chat-compose textarea{flex:1;min-width:0;resize:none;border:0;background:transparent;color:var(--ink);font:14px/1.6 var(--font-body);padding:9px;max-height:100px;min-height:42px}.chat-compose textarea:focus{outline:none}.chat-compose:focus-within{border-color:var(--primary)}body .chat-send{width:40px;height:40px;min-height:40px;padding:0;border-radius:11px;font-size:22px}.chat-local-note{padding:10px 24px 16px;font-size:12px;color:var(--muted)}.chat-error{color:var(--primary)}.chat-closed{padding:20px;text-align:center;font-size:13px;color:var(--muted);border-top:1px solid var(--line)}body .chat-back{display:none}
@media(max-width:850px){.chat-workspace{grid-template-columns:260px minmax(0,1fr)}.chat-room-header{padding:18px}.chat-messages{padding:20px}.chat-item{margin:12px 14px 0}.chat-compose{margin:0 14px}}
@media(max-width:650px){body .content:has(.chat-workspace){padding:12px}.chat-workspace{height:calc(100dvh - 94px);min-height:420px;grid-template-columns:minmax(0,1fr);border-radius:14px}.chat-inbox{border:0}.chat-workspace:not(.has-conversation) .chat-room{display:none}.chat-workspace.has-conversation .chat-inbox{display:none}body .chat-back{display:inline-flex;border:0;padding:0;width:28px;min-height:32px}.chat-room-header{gap:14px;padding:14px;min-height:76px}.chat-bubble{max-width:88%}.chat-local-note{padding:8px 16px 12px}}
/* The listing remains a clear, actionable reference throughout the conversation. */
body .chat-workspace .chat-item{padding:16px;gap:16px;border-color:color-mix(in srgb,var(--primary) 32%,var(--line));border-left:4px solid var(--primary);background:linear-gradient(115deg,var(--surface2),var(--surface));box-shadow:0 4px 16px color-mix(in srgb,var(--primary) 7%,transparent)}
body .chat-workspace .chat-item:hover{border-color:var(--primary)}
body .chat-workspace .chat-item:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
body .chat-workspace .chat-item>.chat-context-image{width:80px;height:80px;border-radius:12px;flex:none;object-fit:contain;background:var(--surface)}
body .chat-workspace .chat-item>.chat-context-copy{flex:1;gap:7px;min-width:0}
body .chat-workspace .chat-context-copy>small{font-size:11px;font-weight:650;color:var(--primary);letter-spacing:.06em;line-height:1.5}
body .chat-workspace .chat-context-copy>strong{font-size:15px;font-weight:650;line-height:1.5;overflow-wrap:anywhere}
body .chat-workspace .chat-context-copy>span{font-size:14px;font-weight:600;line-height:1.5}
body .chat-workspace .chat-item>.chat-context-action{display:flex;align-items:center;gap:8px;flex:none;max-width:30%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--primary);font-size:12px;font-weight:650;line-height:1.5;letter-spacing:normal;overflow-wrap:anywhere}
body .chat-context-action .chat-item-arrow{color:inherit;margin:0}
@media(max-width:760px){body .chat-workspace .chat-item{gap:12px;flex-wrap:wrap;padding:12px}body .chat-workspace .chat-item>.chat-context-image{width:64px;height:64px}body .chat-workspace .chat-item>.chat-context-copy{flex-basis:calc(100% - 80px)}body .chat-workspace .chat-item>.chat-context-action{max-width:100%;margin-left:auto}}
/* Keep the controls at their natural height; only the conversation list scrolls. */
body .chat-inbox{min-width:0;overflow:hidden}
body .chat-inbox-heading,body .chat-filters{flex:none}
body .chat-filters{display:grid;gap:14px;min-width:0;padding:0 18px 18px;border-bottom:1px solid var(--line)}
body .chat-filters .chat-search,body .chat-filters .chat-service-filter{margin:0;padding:0;min-width:0}
body .chat-filters .chat-search input,body .chat-filters .chat-service-filter select{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font:13px/1.4 var(--font-body)}
body .chat-filters .chat-search input:focus-visible,body .chat-filters .chat-service-filter select:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
body .chat-inbox .chat-filters .chat-status-tabs{width:100%;max-width:100%;min-height:54px;margin:0;overflow:visible;box-sizing:border-box}
body .chat-room>[data-loading-state=panel]{flex:1 1 auto;min-height:0;justify-content:center;align-items:center}
body .chat-inbox-compact .chat-inbox-heading{padding:18px 18px 14px}
body .chat-inbox-compact .chat-inbox-heading>p{display:none}
body .chat-inbox-compact .chat-filters{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:0 14px 14px;z-index:6}
body .chat-filter-toggle{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:9px 10px;white-space:nowrap;font-size:12px;background:var(--surface);border:1px solid var(--line);border-radius:12px}
body .chat-filter-toggle.has-active-filters{border-color:var(--primary);color:var(--primary);background:var(--surface2)}
.chat-filter-count{display:grid;place-items:center;min-width:18px;height:18px;border-radius:50%;background:var(--primary);color:#fff;font-size:11px}
body .chat-inbox .chat-filter-panel{position:absolute;top:calc(100% - 7px);inset-inline:10px;display:grid;gap:14px;padding:16px;max-height:min(360px,55dvh);overflow:auto;box-sizing:border-box;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 8px 28px #36212c26}
body .chat-filter-panel[hidden],body .chat-filter-count[hidden]{display:none!important}
.chat-filter-panel>h2{margin:0;font:500 15px var(--font-body)}
body .chat-filter-panel>.chat-filter-done{justify-self:end;min-height:44px}
body .chat-filter-toggle:focus-visible,body .chat-filter-done:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
body .chat-inbox .chat-status-tabs>button{flex:1 1 0;min-width:0;padding:9px 4px!important;font-size:13px!important}
body .chat-inbox .chat-threads{flex:1;min-height:0;overscroll-behavior:contain;scrollbar-gutter:stable;padding-top:8px}
body .chat-room-header>.member-avatar{flex:none;width:42px;height:42px;margin:4px}
body .chat-thread-face>.member-avatar{width:36px;height:36px;flex:none;margin:4px}
body .chat-item:has(.chat-context-image){justify-content:flex-start;min-height:86px}
body .chat-item>.chat-context-image{width:64px;height:64px;flex:none;object-fit:contain;background:var(--surface2);border-radius:8px}
body .chat-item>span:not(.chat-item-arrow){text-align:left;overflow-wrap:anywhere}
body .chat-inbox .chat-status-tabs{display:flex;gap:4px}
.chat-attachment-thumb{position:relative;display:grid;place-items:center;width:84px;min-height:84px;margin:8px 0;flex:none;background:var(--surface2);border-radius:10px;overflow:hidden}
body .chat-attachment-thumb>img{display:block;width:84px;height:84px;object-fit:contain}
body .chat-attachment-thumb>.chat-attachment-remove{position:absolute;top:2px;right:2px;z-index:1;display:grid;place-items:center;width:32px;height:32px;min-width:32px;min-height:32px;padding:5px;border:1px solid var(--line);border-radius:50%;background:var(--surface);box-shadow:0 2px 6px #00000015}
.chat-attachment-remove .dh-custom-icon{width:20px;height:20px;margin:0}
body .chat-attachment-remove .dh-custom-icon img{width:20px;height:20px;max-width:20px;max-height:20px}
.chat-attachment-thumb>small{padding:32px 6px 8px;text-align:center}
@media(pointer:coarse){body .chat-attachment-thumb>.chat-attachment-remove{width:44px;height:44px;min-width:44px;min-height:44px;padding:10px}}
body .chat-thread>.chat-thread-open{display:grid;grid-template-columns:minmax(0,1fr);justify-items:start;gap:5px;width:100%;min-width:0;padding:0;border:0;background:transparent;text-align:left}
body .chat-thread>.chat-thread-open>strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .chat-inbox .chat-thread-open{font-weight:400}
body .chat-inbox .chat-thread-top{width:100%;min-width:0}
body .chat-inbox .chat-thread-top strong,body .chat-inbox .chat-thread-open>strong{font-size:13px;font-weight:500}
body .chat-inbox .chat-thread-topic,body .chat-inbox .chat-thread-last{font-weight:400;max-width:100%}
body .chat-inbox .chat-thread.is-unread{background:color-mix(in srgb,var(--primary) 5%,var(--surface));box-shadow:inset 3px 0 var(--primary)}
body .chat-inbox .chat-thread.is-unread .chat-thread-top strong{font-weight:600}
.chat-unread-dot{display:inline-block;flex:0 0 9px;width:9px;height:9px;border-radius:50%;background:var(--primary)}
body .chat-inbox-summary{display:flex;flex-wrap:wrap;align-items:center;gap:5px 10px;margin:8px 0 0;font-size:11px;font-weight:400;line-height:1.5}
body .chat-inbox-compact .chat-inbox-heading>.chat-inbox-summary{display:flex}
.chat-inbox-pending{color:var(--primary)}
body .chat-workspace{height:calc(100dvh - 200px)}
@media(max-width:650px){body .chat-workspace{height:calc(100dvh - 164px)}}
body .chat-room-header>.chat-negotiation-header{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin:0 0 0 auto;padding:0;border:0;background:none;max-width:45%;font-size:12px}
.chat-negotiation-header>small{max-width:240px;color:var(--muted);line-height:1.5}
.chat-system-message{align-self:center;width:fit-content;max-width:min(100%,560px);box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:3px 7px;margin:4px 0;padding:8px 12px;text-align:center;background:#f0edf8;border:1px solid #ddd5ed;border-radius:10px;color:#5b4c73;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.chat-system-message .chat-system-label{flex-basis:100%;font-size:10px;letter-spacing:.025em;color:inherit}
.chat-system-message .chat-system-author,.chat-system-message time{font-size:11px;color:inherit}
.chat-system-message p{margin:0}
body .chat-workspace .chat-bubble{background:#edf3f7;border-color:#d5e1e9;color:#293c4a}
body .chat-workspace .chat-bubble.own{background:#f7dfe9;border-color:#eac3d3;color:#4d2538}
body .chat-workspace .chat-bubble time{color:inherit;opacity:.75}
body[data-theme=dark] .chat-workspace .chat-bubble{background:#293b47;border-color:#405867;color:#e2eef5}
body[data-theme=dark] .chat-workspace .chat-bubble.own{background:#542e43;border-color:#75435e;color:#ffe5f0}
body[data-theme=dark] .chat-system-message{background:#343145;border-color:#5b5275;color:#e1d9f3}
body .chat-compose>.chat-emoji-toolbar{position:relative;inset:auto;flex:none;z-index:4;align-self:flex-end}
body .chat-emoji-toolbar>.emoji-picker-trigger{width:40px;height:42px;min-height:42px;padding:9px}
.chat-emoji-toolbar .emoji-picker-panel{left:-40px;right:auto;max-width:calc(100vw - 64px)}
@media(max-width:650px){body .chat-compose{gap:6px}body .chat-compose textarea{padding-inline:6px}.chat-emoji-toolbar .emoji-picker-grid{grid-template-columns:repeat(6,minmax(0,1fr))}body .chat-emoji-toolbar .emoji-picker-grid>.emoji-choice{height:36px;min-height:36px}}
body #modal-root .modal.chat-resolution-modal{width:min(540px,100%);max-width:540px}
.chat-resolution-intro{margin:0 0 20px;font-size:14px;line-height:1.7;color:var(--muted)}
body .chat-resolution-form{gap:18px}
.chat-resolution-choices{display:grid;gap:10px;margin:0;padding:0;border:0;min-width:0}
.chat-resolution-choices legend{font-size:14px;font-weight:600;margin-bottom:12px}
.chat-resolution-choice{display:flex;align-items:flex-start;gap:12px;padding:16px;border:1px solid var(--line);border-radius:12px;cursor:pointer;background:var(--surface)}
.chat-resolution-choice:has(input:checked){border-color:var(--primary);background:var(--surface2)}
.chat-resolution-choice input[type=radio]{flex:none;width:18px;height:18px;margin:2px 0;accent-color:var(--primary)}
.chat-resolution-choice>span{display:grid;gap:6px;min-width:0}
.chat-resolution-choice strong{font-size:14px}
.chat-resolution-choice small{font-size:12px;line-height:1.6;color:var(--muted)}
.chat-resolution-explanation{margin:0;padding:12px 14px;background:var(--surface2);border-radius:10px;font-size:12px;line-height:1.7}
.chat-resolution-form .field[hidden],.chat-resolution-explanation[hidden]{display:none!important}
.chat-resolution-footer{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;padding-top:6px}
.chat-resolution-footer>.btn{min-height:44px}
.chat-resolution-form>.chat-error:empty{display:none}
@media(max-width:650px){body .chat-room-header{flex-wrap:wrap}body .chat-room-header>.chat-negotiation-header{flex-basis:100%;max-width:none;justify-content:flex-end;padding-top:8px}.chat-negotiation-header>small{margin-right:auto}.chat-resolution-footer{display:grid}.chat-resolution-choice{padding:14px}}
@media(max-width:650px){body #modal-root .chat-resolution-footer{display:grid;grid-template-columns:minmax(0,1fr)}body #modal-root .chat-resolution-footer>.btn{width:100%;justify-self:stretch}}
