/* Chat workspace: readable conversations and a clear completion queue. */
#chatModal .mainInformation h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
#negativeFlags, #quickNegativeFlags { grid-template-columns: minmax(0,1fr); }
.negativeReason { min-width: 0; padding: 12px; border: 1px solid #eadce7; border-radius: 14px; background: #fff; }
.reasonExplanation { display: grid; gap: 8px; margin-top: 12px; }
.reasonExplanation > span { font-size: 12px; color: #765267; }
.reasonExplanation textarea { width: 100%; resize: vertical; border-radius: 12px; }
#chatsView > .completionPanel { margin: 0 0 24px; }
.chatListFrame .chatListRow { border: 1px solid #c6cee5; background: #fff; box-shadow: 0 3px 10px #35417a0d; }
.searchOptions { padding: 6px; border-color: #cdc9f3; border-radius: 16px; box-shadow: 0 12px 32px #35316b26; }
.searchOptions button { border: 0; border-radius: 10px; margin: 2px 0; }
.searchOptions button:hover, .searchOptions .keyboardActive { background: #eeebff; color: #5147bb; }
#chatModal input[type="checkbox"] { accent-color: #645bff; }
.dateRangePicker.singleDatePicker { position: fixed; z-index: 130; margin: 0; }
.singleDateButton { width: 100%; text-align: left; }
.withSidebar { display: grid; grid-template-columns: 210px minmax(0, 1fr); column-gap: 24px; align-items: start; }
.withSidebar .topbar { grid-column: 1 / -1; }
.withSidebar .mainNav { position: sticky; top: 20px; display: flex; flex-direction: column; align-items: stretch; width: 100%; margin-top: 24px; padding: 12px; background: #ffffffa8; border: 1px solid #dcdff0; border-radius: 22px; }
.withSidebar .navTab { width: 100%; min-height: 46px; text-align: left; padding: 12px 16px; font-size: 14px; }
.navPlanned { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 12px 16px; border: 0; border-radius: 13px; background: transparent; color: #758097; font: inherit; font-size: 14px; text-align: left; cursor: default; }
.navPlanned small { font-size: 12px; color: #6c7590; background: #eceefa; padding: 2px 6px; border-radius: 6px; }
.withSidebar .content { min-width: 0; padding-top: 24px; }
.withSidebar .filtersBar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.withSidebar .chatListRow { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.2fr) 120px 170px; gap: 12px; }
.iconLink svg { display: block; flex-shrink: 0; }
.filtersDisclosure { margin: 0 0 16px; }
.filtersDisclosure > summary { display: flex; align-items: center; gap: 10px; width: fit-content; padding: 11px 16px; border: 1px solid #d9dcef; border-radius: 14px; background: #ffffffdb; color: #454583; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.filtersDisclosure > summary::-webkit-details-marker { display: none; }
.filterChevron { width: 7px; height: 7px; margin: -3px 2px 0 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.filtersDisclosure[open] .filterChevron { transform: rotate(225deg); margin-top: 3px; }
.filtersDisclosure > .filtersBar { margin-top: 12px; }
.filtersDisclosure > summary:focus-visible { outline: 3px solid #9b99ff; outline-offset: 3px; }
.chatListRow { position: relative; }
.chatListRow::before { content: ''; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 4px; border-radius: 6px; }
.chatListRow.rowComplete::before { background: #20aa62; }
.chatListRow.rowIncomplete::before { background: #f16a38; }
@media (max-width: 1150px) { .withSidebar { grid-template-columns: 175px minmax(0,1fr); gap: 16px; } .withSidebar .chatListRow { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } .withSidebar .filtersBar { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 750px) { .withSidebar { display: block; } .withSidebar .mainNav { position: static; flex-direction: row; flex-wrap: wrap; } .withSidebar .navTab { width: auto; } }
@media (max-width: 540px) { .withSidebar .filtersBar, .withSidebar .chatListRow { grid-template-columns: minmax(0,1fr); } }
.filtersBar { grid-template-columns: minmax(230px, 1.4fr) minmax(100px, .7fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(150px, 1fr) auto 36px; }
.filtersBar > * { min-width: 0; }
.dateRangeControl { position: relative; min-width: 0; display: grid; gap: 7px; }
.dateRangeControl > button { white-space: normal; overflow-wrap: anywhere; }
.quickBranchStep { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e1e6ef; }
.quickBranchStep > strong { display: block; font-size: 12px; margin-bottom: 8px; }
@media (max-width: 1300px) { .filtersBar { grid-template-columns: repeat(3, minmax(230px, 1fr)); } }
@media (max-width: 850px) { .filtersBar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .filtersBar { grid-template-columns: minmax(0, 1fr); } }
.dateRangeControl>span { font-size: 12px; font-weight: 650; }
.dateRangeControl>button { min-height: 42px; width: 100%; font-size: 12px; }
.dateRangePicker { position: absolute; z-index: 20; top: 100%; left: 0; margin-top: 8px; width: 310px; max-width: calc(100vw - 48px); padding: 16px; border: 1px solid #d5deeb; border-radius: 18px; background: white; box-shadow: 0 14px 40px #24354d30; }
.dateRangePicker header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dateRangePicker header button { border: 0; background: #edf2f7; border-radius: 9px; padding: 6px 12px; cursor: pointer; }
.calendarWeek,.calendarDays { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; margin-top: 12px; text-align: center; }
.calendarWeek { font-size: 11px; color: #75839a; }
.calendarDays button { border: 0; background: #f5f7fa; padding: 8px 0; border-radius: 8px; cursor: pointer; }
.calendarDays button:hover { background: #dce7f4; }
.calendarDays button.selected { background: #645bff; color: white; }
.dateRangePicker p { font-size: 11px; line-height: 1.5; color: #62758f; }
.branchChips { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 12px 0; max-height: 230px; overflow: auto; }
.branchChip { padding: 10px; border: 1px solid #dce4ed; border-radius: 12px; background: #f4f7fb; color: #34485f; font-size: 11px; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.branchChip:hover { border-color: #a5a1ef; background: #f0eeff; }
.branchChip b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 550; }
.branchChip small { display: block; margin-top: 5px; color: #738198; font-size: 10px; }
.frequentBranches { margin-bottom: 16px; }
.frequentBranches summary { font-size: 12px; }
#quickTopicChips { max-height: 180px; overflow: auto; }
#quickNegativeFieldset .flagsGrid { grid-template-columns: 1fr; }
#quickNegativeFieldset p,#negativeFieldset p { font-size: 12px; color: #ac394c; }
.chatListFrame { padding: 14px; border: 1px solid #e1e5ed; border-radius: 28px; background: #ffffffd9; box-shadow: 0 12px 36px #23304b08; }
.chatList { display: grid; gap: 18px; }
.chatListRow { display: grid; grid-template-columns: minmax(220px,1fr) minmax(240px,1.25fr) 150px 200px; align-items: center; gap: 18px; padding: 17px 20px; border: 1px solid #e5e8ee; border-radius: 20px; background: #ffffffbd; transition: border-color .15s, background .15s; }
.chatListRow:hover { border-color: #bdc8d7; background: #fff; }
.chatRowIdentity { display: grid; gap: 5px; min-width: 0; }
.chatRowIdentity .chatNumberBtn { justify-self: start; padding: 0; font-size: 19px; font-weight: 700; color: #202d44; }
.chatRowIdentity small,.chatRowOperator { font-size: 12px; color: #69778d; overflow-wrap: anywhere; }
.chatRowClassification { min-width: 0; }
.chatRowClassification .classificationBlock { width: 100%; padding: 8px 12px; border-radius: 12px; }
.chatRowClassification .subCell { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rowRating { font-size: 13px; text-align: center; border-radius: 10px; }
.completionBadge { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 14px; border: 1px solid transparent; border-radius: 24px; font-size: 14px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.completionBadge>span:first-child { width: 21px; height: 21px; border-radius: 50%; display: inline-grid; place-items: center; color: white; }
.completionBadge.isComplete { background: #e4f5eb; color: #187340; }
.isComplete>span:first-child { background: #229650; }
.completionBadge.isIncomplete { background: #fff0f0; color: #b83040; }
.isIncomplete>span:first-child { background: #d84a5c; }
.completionBadge:hover { border-color: currentColor; }
.rowArrow { opacity: .6; }
.completionPanel { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 20px; margin-top: 18px; border: 1px solid #e1e5ed; border-radius: 26px; background: #ffffffd9; }
.completionPanel>div { border: 1px solid #e5e8ee; border-radius: 18px; padding: 18px 20px; }
.progressHeading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 17px; }
.progressHeading strong { color: #18804d; }
.completionPanel progress { appearance: none; display: block; width: 100%; height: 12px; border: 0; border-radius: 20px; overflow: hidden; background: #e6e9ef; }
.completionPanel progress::-webkit-progress-bar { background: #e6e9ef; }
.completionPanel progress::-webkit-progress-value { background: #20a366; border-radius: 20px; }
.completionPanel progress::-moz-progress-bar { background: #20a366; }
.completionPanel small { display: block; margin-top: 9px; color: #6a7689; font-size: 12px; }
.plannedProgress { color: #728094; }
.plannedProgress strong { color: inherit; }
.plannedTrack { height: 12px; border-radius: 20px; background: repeating-linear-gradient(135deg,#e9edf2,#e9edf2 6px,#f2f4f7 6px,#f2f4f7 12px); }

#chatModal { padding: 18px; background: #15243970; backdrop-filter: blur(8px); }
#chatModal .modalPanel { width: min(1580px,100%); height: calc(100dvh - 36px); max-height: none; display: flex; flex-direction: column; overflow: hidden; border-radius: 26px; background: #f7f9fc; }
#chatModal .modalHeader { flex: none; background: #ffffffeb; padding: 18px 26px; border-bottom: 1px solid #e2e7ee; }
#chatModal .modalHeader h2 { font-size: 24px; font-weight: 700; }
#chatModal .chatWorkspace { grid-template-columns: minmax(0,1fr) minmax(0,1fr); flex: 1; min-height: 0; overflow: hidden; }
#chatModal .dialoguePane { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 24px; background: #ffffff80; border-right: 1px solid #e2e7ee; }
#chatModal .dialoguePane h2 { flex: none; font-size: 15px; letter-spacing: .01em; margin: 0; }
#chatModal .dialogueContent { position: static; flex: 1; min-height: 0; max-height: none; overflow: auto; padding: 0 8px 12px 0; }
.dialogueContent h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; text-align: center; color: #8390a2; margin: 22px 0 18px; }
.dialogueContent .mutedText { font-size: 12px; line-height: 1.6; padding: 12px 14px; background: #f0f3f8; border-radius: 12px; }
.messageRow { display: flex; margin: 0 0 14px; }
.messageRow.operator { justify-content: flex-end; }
.messageBubble { max-width: 88%; min-width: 130px; border-radius: 6px 18px 18px 18px; background: #edf0f6; padding: 13px 16px; }
.operator .messageBubble { background: #eeebff; border-radius: 18px 6px 18px 18px; }
.unknown .messageBubble { width: 100%; max-width: 100%; background: #f5f5f5; }
.messageMeta { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 18px; margin-bottom: 8px; font-size: 11px; }
.messageMeta strong { font-weight: 650; color: #61728c; }
.messageMeta .speaker-operator { color: #5147bb; }
.messageMeta time { color: #758397; font-size: 10px; }
.messageText { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 14px; color: #1e2c40; }
#chatModal #chatForm { overflow: auto; padding: 20px; scroll-padding: 20px; }
.editorCard,#chatModal .chatRatingField { display: block; min-width: 0; margin: 0 0 14px; border: 1px solid #e0e5ed; border-radius: 18px; padding: 20px; background: #fff; }
.editorCard h3 { margin: 0 0 20px; font-size: 15px; }
.editorCard summary { cursor: pointer; font-size: 14px; font-weight: 650; color: #25354d; }
.editorCard[open]>summary { margin-bottom: 20px; }
.editorCard .formGrid { margin-top: 16px; }
.editorCard .textGrid { margin-top: 16px; }
.editorCard .directDescriptionField { margin: 0; padding: 0; background: transparent; border: none; }
.quickCategories { margin: 16px 0; }
.quickCategories summary { font-size: 12px; color: #576f8e; }
.quickCategories small { display: block; margin-top: 8px; color: #788496; }
.categoryChips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.categoryChip { border: 1px solid #dce3eb; background: #f3f6fa; border-radius: 20px; padding: 7px 13px; cursor: pointer; color: #354e6a; font-size: 12px; }
.categoryChip:hover,.categoryChip:focus-visible { background: #eeebff; border-color: #a5a1ef; }
#chatModal .chatRatingField { padding-top: 12px; background: #fff; border: 1px solid #c9d3e3; }
#chatModal .chatRatingField legend { padding: 0 6px; font-size: 15px; font-weight: 700; }
#chatModal .chatRatingField[data-rating="pending"] { border: 2px solid #a8bce2; }
#chatModal .mainInformation { border: 2px solid #a8bce2; border-radius: 18px; }
#chatStatus[hidden] { display: none; }
.ratingOptions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 8px 0 12px; }
.ratingOption { position: relative; cursor: pointer; min-width: 0; }
.ratingOption input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ratingOption>span { min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 5px; border: 1px solid transparent; border-radius: 12px; font-size: 12px; font-weight: 550; }
.ratingOption i { font-style: normal; font-size: 24px; line-height: 1; }
.ratingOption.positive>span { background: #edf6ef; color: #267244; }
.ratingOption.neutral>span { background: #f0f2f7; color: #4b5d76; }
.ratingOption.negative>span { background: #fff0f0; color: #b53647; }
.ratingOption input:checked+span { border-color: currentColor; box-shadow: 0 0 0 2px #334d6620; font-weight: 750; }
.ratingOption input:focus-visible+span { outline: 3px solid #6996d6; outline-offset: 3px; }
.chatRatingField small { font-size: 11px; color: #65758b; line-height: 1.5; }
.sectionCount { font-weight: 400; font-size: 11px; padding: 4px 8px; border-radius: 20px; background: #edf1f6; margin-left: 8px; color: #687b94; }
#chatModal .chatIdentitySummary { font-size: 12px; background: transparent; border: 0; padding: 0 2px 12px; margin: 0; line-height: 1.6; }
#chatModal .modalFooter { position: sticky; bottom: -20px; z-index: 3; flex-wrap: wrap; gap: 8px; margin: 0 -20px -20px; padding: 15px 20px; background: #f7f9fcf5; border-top: 1px solid #e1e6ee; backdrop-filter: blur(12px); }
#chatModal .modalFooter button { padding: 10px 13px; font-size: 12px; border-radius: 11px; }
#chatModal .modalFooter .primaryBtn { background: linear-gradient(135deg,#645bff,#008fe8); box-shadow: none; }
#negativeFieldset { border-color: #efd2d6; background: #fff8f8; border-radius: 18px; }
#dialoguePreview .messageBubble { max-width: 92%; }
#dialoguePreview .messageText { font-size: 12px; }
@media(max-width:1100px) {
  .chatListRow { grid-template-columns: minmax(170px,1fr) minmax(160px,1fr) 175px; gap: 12px; }
  .chatListRow .rowRating { grid-column: 2; grid-row: 2; text-align: left; }
  .completionBadge { grid-column: 3; grid-row: 1 / span 2; font-size: 12px; }
  #chatModal .dialoguePane { padding: 16px; }
  #chatModal #chatForm { padding: 14px; }
  .editorCard,#chatModal .chatRatingField { padding: 14px; }
  .ratingOptions { gap: 5px; }
  .ratingOption>span { font-size: 10px; gap: 4px; }
  .ratingOption i { font-size: 19px; }
  #chatModal .modalFooter { margin: 0 -14px -14px; bottom: -14px; padding: 12px 14px; }
}
@media(max-width:760px) {
  .chatListFrame { padding: 8px; border-radius: 20px; }
  .chatListRow { grid-template-columns: minmax(0,1fr) auto; padding: 14px; gap: 10px; }
  .chatRowClassification { grid-column: 1 / -1; grid-row: 2; }
  .chatListRow .rowRating { grid-column: 1; grid-row: 3; }
  .completionBadge { grid-column: 2; grid-row: 1; padding: 9px; }
  .rowArrow { display: none; }
  .completionPanel { grid-template-columns: 1fr; padding: 12px; gap: 10px; }
  #chatModal { padding: 0; }
  #chatModal .modalPanel { height: 100dvh; min-height: 0; border-radius: 0; overflow: auto; display: block; }
  #chatModal .modalHeader { position: sticky; top: 0; z-index: 4; padding: 14px 18px; }
  #chatModal .chatWorkspace { display: block; overflow: visible; }
  #chatModal .dialoguePane { border-right: 0; border-bottom: 1px solid #e2e7ee; }
  #chatModal .dialogueContent { max-height: 38dvh; flex: none; }
  #chatModal #chatForm { overflow: visible; }
  .ratingOption>span { font-size: 11px; }
  #chatModal .modalFooter { position: static; }
}
