/* Вкладки ТЗ v1: оферта, учасники, пропозиції, аналіз, помічник. Світла тема CRM 4B2B:
   статус це кольоровий чіп, цифри великі, найкраще значення зелене. */

.achip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; border: 1px solid transparent; vertical-align: middle; }
.achip.gray { background: #F3F4F6; color: #374151; border-color: #E5E7EB; }
.achip.green { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.achip.amber { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.achip.red { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.achip.blue { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.achip.violet { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }

.amuted { color: #5F6B7A; font-size: 12.5px; }
.ared { color: #B91C1C; }
.agreen { color: #047857; font-weight: 600; }
.aok { padding: 12px 14px; border-radius: 10px; background: #ECFDF5; color: #047857; font-weight: 600; }

.akpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 4px 0 16px; }
.akpi { color: #111827; background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08); }
.akpi-v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: #111827; line-height: 1.15; word-break: break-word; }
.akpi-l { font-size: 13px; color: #4B5563; margin-top: 4px; }
.akpi-s { font-size: 12px; color: #5F6B7A; margin-top: 2px; }
.akpi.green { box-shadow: inset 3px 0 0 #10B981, 0 1px 3px rgba(16,24,40,.08); }
.akpi.red { box-shadow: inset 3px 0 0 #EF4444, 0 1px 3px rgba(16,24,40,.08); }

.astepper { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.astep { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: #FFFFFF; border: 1px solid #D1D5DB; font-size: 13px; font-weight: 600; color: #374151; }
.astep-n { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #F3F4F6; color: #374151; font-size: 12px; }
.astep.done { border-color: #A7F3D0; background: #ECFDF5; color: #047857; }
.astep.done .astep-n { background: #10B981; color: #FFFFFF; }

.agrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 8px 0; }
.afield { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.afield > span { color: #4B5563; font-weight: 500; }
.asel { padding: 6px 10px; border-radius: 8px; border: 1px solid #D1D5DB; background: #FFFFFF; color: #111827; font-size: 13px; }

.alist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.aline { color: #111827; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #E5E7EB; border-radius: 10px; background: #FFFFFF; flex-wrap: wrap; }
.anum { width: 24px; height: 24px; border-radius: 50%; background: #EEF2FF; color: #4338CA; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none; }
tr.agroup td { background: #F9FAFB; font-weight: 700; color: #111827; }

.atiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.atile { text-align: left; padding: 16px; border-radius: 12px; border: 1px solid #C7D2FE; background: #FFFFFF; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: border-color .15s, box-shadow .15s; font: inherit; color: inherit; }
.atile:hover:not(:disabled) { border-color: #4F46E5; box-shadow: 0 4px 14px rgba(79,70,229,.15); }
.atile:disabled { opacity: .55; cursor: not-allowed; }
.atile-t { font-weight: 700; font-size: 15px; color: #111827; margin-bottom: 6px; }
.atile-s { font-size: 13px; color: #4B5563; }
.atile { display: flex; flex-direction: column; gap: 8px; }
.atile-i { width: 40px; height: 40px; border-radius: 10px; background: #EEF2FF; color: #4F46E5; display: grid; place-items: center; }
.atile-t { margin-bottom: 0; }
.atile-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.atag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #F3F4F6; color: #374151; }
.akpi-go { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.akpi-go:hover, .akpi-go:focus-visible { border-color: #4F46E5; box-shadow: 0 4px 14px rgba(79,70,229,.15); outline: none; }
.ent-link { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: #C7D2FE; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ent-link:hover { color: #4338CA; text-decoration-color: #4338CA; }

.aversions { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; }
.aver { color: #111827; min-width: 190px; border: 1px solid #E5E7EB; border-radius: 12px; padding: 10px 12px; background: #FFFFFF; position: relative; }
.aver.last { border-color: #4F46E5; box-shadow: inset 0 3px 0 #4F46E5; }
.aver-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.aver-v { font-size: 18px; font-weight: 800; color: #111827; }

.atimeline { display: flex; flex-direction: column; gap: 10px; border-left: 2px solid #E5E7EB; padding-left: 14px; }
.atl { position: relative; }
.atl::before { content: ''; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #4F46E5; }
.atl-d { font-size: 12px; color: #5F6B7A; }

.ashort td.alabel { font-weight: 600; color: #111827; min-width: 220px; white-space: normal; }
.ashort td.abest { background: #ECFDF5; color: #047857; font-weight: 700; }
.aclick { cursor: pointer; text-decoration: underline dotted #93A3B8; text-underline-offset: 3px; }
.aclick:hover { background: #EEF2FF; }

.agroup-box { color: #111827; border: 1px solid #E5E7EB; border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: #FFFFFF; }
.agroup-btn { display: flex; gap: 10px; align-items: baseline; background: none; border: none; padding: 0 0 8px; cursor: pointer; font: inherit; color: #111827; font-size: 15px; }
.agroup-btn:hover b { color: #4338CA; }
.abars { display: flex; flex-direction: column; gap: 6px; }
.abar-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) 2fr minmax(160px, auto); gap: 10px; align-items: center; font-size: 13px; }
.abar-n { color: #111827; overflow: hidden; text-overflow: ellipsis; }
.abar-track { background: #F3F4F6; border-radius: 6px; height: 14px; overflow: hidden; }
.abar { height: 100%; background: #93A3B8; border-radius: 6px; }
.abar.best { background: #10B981; }
.abar.neg { background: #EF4444; }
.abar.partial { background: repeating-linear-gradient(45deg, #CBD5E1, #CBD5E1 6px, #E2E8F0 6px, #E2E8F0 12px); }
.abar-v { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-weight: 600; font-variant-numeric: tabular-nums; color: #111827; }

.aheat { margin-top: 14px; }
.aheat-c { background: color-mix(in srgb, #10B981 calc((1 - var(--k)) * 28%), color-mix(in srgb, #EF4444 calc(var(--k) * 28%), #FFFFFF)); }
.aheat-r { font-size: 11px; color: #047857; font-weight: 700; }

.acard-ai, .aconcl { background: #F8FAFF; border: 1px solid #E0E7FF; border-radius: 12px; padding: 12px 16px; margin: 8px 0; color: #111827; }

/* Помічник на кожному кроці (ТЗ 4.7) */
.asst-fab { position: fixed; right: 22px; bottom: 22px; z-index: 70; border: none; border-radius: 99px; background: #4F46E5; color: #FFFFFF; font-weight: 700; padding: 12px 18px; box-shadow: 0 8px 24px rgba(79,70,229,.35); cursor: pointer; font-size: 14px; }
.asst-fab:hover { background: #4338CA; }
.asst-fab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.asst-mic { display: inline-grid; place-items: center; color: #374151; }
/* Плаваюча кнопка помічника не накриває останній блок сторінки */
#app { padding-bottom: 72px; }
.asst { position: fixed; right: 22px; bottom: 80px; z-index: 75; width: min(420px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 16px; box-shadow: 0 20px 50px rgba(16,24,40,.22); display: flex; flex-direction: column; overflow: hidden; color: #111827; }
.asst-h { padding: 12px 14px; border-bottom: 1px solid #E5E7EB; display: flex; align-items: center; gap: 8px; }
.asst-h b { flex: 1; }
.asst-x { background: none; border: none; font-size: 20px; cursor: pointer; color: #4B5563; }
.asst-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #FAFAFA; }
.asst-m { padding: 8px 12px; border-radius: 12px; max-width: 88%; font-size: 13.5px; line-height: 1.45; }
.asst-m.u { align-self: flex-end; background: #4F46E5; color: #FFFFFF; }
.asst-m.a { align-self: flex-start; background: #FFFFFF; border: 1px solid #E5E7EB; }
.asst-f { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #E5E7EB; }
.asst-f textarea { flex: 1; resize: none; height: 42px; border: 1px solid #D1D5DB; border-radius: 10px; padding: 8px 10px; font: inherit; color: #111827; background: #FFFFFF; }
.asst-mic { border: 1px solid #D1D5DB; background: #FFFFFF; border-radius: 10px; width: 42px; cursor: pointer; font-size: 18px; }
.asst-mic.on { background: #FEF2F2; border-color: #EF4444; animation: asstPulse 1.2s infinite; }
.asst-send { border: none; background: #4F46E5; color: #FFFFFF; border-radius: 10px; padding: 0 14px; font-weight: 700; cursor: pointer; }
.asst-q { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; background: #FAFAFA; }
.asst-q button { border: 1px solid #C7D2FE; background: #FFFFFF; color: #4338CA; border-radius: 99px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
@keyframes asstPulse { 50% { box-shadow: 0 0 0 6px rgba(239,68,68,.15); } }
@media (prefers-reduced-motion: reduce) { .asst-mic.on { animation: none; } }

@media (max-width: 640px) {
  .abar-row { grid-template-columns: 1fr; gap: 4px; }
  .akpi-v { font-size: 20px; }
}

.adetails > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adetails > summary::-webkit-details-marker { display: none; }
.adetails > summary::before { content: '▸'; color: #4F46E5; font-weight: 700; }
.adetails[open] > summary::before { content: '▾'; }
.adetails[open] > summary { margin-bottom: 8px; }
.aheat td { color: #111827; }
.aheat td:first-child { min-width: 320px; white-space: normal; }
.aheat-c { font-weight: 600; }
.asel { width: auto !important; min-width: 120px; }
.ashort td, .ashort th { white-space: normal; min-width: 140px; max-width: 260px; }
.ashort td.alabel { min-width: 220px; max-width: 280px; }
.aline input[type=text] { max-width: 300px; flex: 0 1 300px; }
.aline input[type=number] { flex: none; }
.tbl .asel { min-width: 190px; }
.aactions { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.aclamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* UX-аудит 03.10.2026: телефон. KPI парами і компактніше, помічник круглою кнопкою,
   щоб не перекривав дії в картках. */
@media (max-width: 640px) {
  .akpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .akpi { padding: 10px 12px; }
  .akpi-v { font-size: 19px; }
  .akpi-l { font-size: 12px; }
  .asst-fab { right: 14px; bottom: 14px; padding: 0; width: 48px; height: 48px; font-size: 20px; }
  .asst-fab .asst-fab-t { display: none; }
  .aline input[type=text] { max-width: none; flex: 1 1 100%; }
}
/* частка від загальної кількості під числом KPI (воронка учасників) */
.akpi-bar { height: 4px; border-radius: 2px; background: #F3F4F6; margin-top: 8px; overflow: hidden; }
.akpi-bar i { display: block; height: 100%; background: #6366F1; }
.akpi.green .akpi-bar i { background: #10B981; }
.akpi.red .akpi-bar i { background: #EF4444; }
.ashort td.atext { white-space: normal; text-align: left; font-variant-numeric: normal; min-width: 180px; }
.ashort-more { margin-top: 8px; }
.achip.wrap { white-space: normal; line-height: 1.35; padding: 4px 10px; text-align: left; }

/* Перевірка 03.10.2026: рейтинг по розділах, наступний крок, нічия, неповні пропозиції */
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.seg-b { border: 1px solid var(--line-2); background: #FFFFFF; color: var(--text-2); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.seg-b:hover { border-color: var(--accent-border); color: var(--accent-text); }
.seg-b.on { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.seg-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-n { font-size: 11.5px; font-weight: 700; background: rgba(17,24,39,.08); border-radius: 999px; padding: 1px 7px; }
.seg-b.on .seg-n { background: rgba(255,255,255,.22); }
tr.muted-row td { color: var(--muted-2); background: #FCFCFD; }
.note-warn { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 13.5px; }
.next-step { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 12px; padding: 14px 18px; margin-top: 16px; }
.next-step-t { font-weight: 600; color: var(--text); margin-top: 2px; }
.score-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; min-width: 0; }
.score-head label { margin-bottom: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-x { flex: none; border: 1px solid var(--line-2); background: #FFFFFF; color: var(--muted); border-radius: 6px; width: 22px; height: 22px; line-height: 18px; padding: 0; cursor: pointer; font-size: 15px; }
.score-x:hover { color: #B91C1C; border-color: #FCA5A5; }
.score-matrix td, .score-matrix th { white-space: nowrap; }
.score-matrix .score-inp { width: 76px; text-align: center; }
.score-matrix .score-inp.ai-filled { border-color: #A5B4FC; background: #EEF2FF; }
.ai-box { margin-top: 10px; background: #F8FAFF; }
.anooffer { margin-top: 10px; font-size: 13px; }
.anooffer summary { cursor: pointer; }
/* Короткий аналіз: довгі назви учасників переносяться, перша колонка лишається на місці при гортанні */
.tbl.ashort thead th { white-space: normal; vertical-align: bottom; line-height: 1.3; overflow-wrap: anywhere; }
.tbl.ashort td.alabel, .tbl.ashort thead th:first-child { position: sticky; left: 0; z-index: 1; background: #FFFFFF; box-shadow: 1px 0 0 var(--line); }
.tbl.ashort thead th:first-child { background: var(--surface-2); }
.agroup-cells > div { white-space: nowrap; }
/* Смуги розділів однакової геометрії в кожному рядку: назва, смуга, сума з чіпами */
.abar-row { grid-template-columns: minmax(200px, 340px) minmax(120px, 1fr) 340px; }
.abar-v .abar-adj { font-weight: 500; color: var(--muted-2); font-size: 12px; }
@media (max-width: 640px) { .abar-row { grid-template-columns: 1fr; } }
.aclip { display: inline-block; max-width: min(760px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.aaward .aline { padding: 4px 8px; min-height: 0; }
.aaward .aline input { padding: 5px 8px; }
.amore { margin-top: 6px; }
.amore summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
@media (max-width: 640px) {
  .tbl.ashort td.alabel, .tbl.ashort thead th:first-child { min-width: 130px; max-width: 150px; font-size: 12.5px; }
  .ashort td, .ashort th { min-width: 120px; }
}
.note-err { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 13.5px; font-weight: 600; }
.alegend { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 12.5px; color: #475569; }
.alegend-best { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: #ECFDF5; border: 1px solid #A7F3D0; flex: none; }

/* Порівняльна таблиця під висновками (відгук Farmak 15.10.2026): власне вікно прокрутки з
   закріпленою шапкою, блоки учасників розділені лінією, обрана пропозиція зелена */
.acmp-box { margin: 18px 0 6px; }
.acmp-box h3 { display: flex; align-items: center; gap: 6px; }
.acmp-wrap { max-height: 70vh; overflow: auto; margin-top: 8px; }
/* separate: межі клітинок рухаються разом із закріпленими колонками */
table.acmp { min-width: 0; width: max-content; font-size: 13px; border-collapse: separate; border-spacing: 0; }
.acmp th, .acmp td { padding: 7px 10px; white-space: nowrap; }
.acmp thead th { position: sticky; z-index: 2; background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--line); }
.acmp thead tr:first-child th { top: 0; height: 38px; }
.acmp thead tr:nth-child(2) th { top: 38px; }
.acmp th.acmp-part { color: var(--text); font-weight: 700; text-align: left; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.acmp .acmp-pn { margin-right: 6px; }
.acmp .acmp-blk { border-left: 2px solid var(--line-2); }
.acmp td.acmp-name, .acmp th.acmp-name { white-space: normal; min-width: 220px; max-width: 340px; text-align: left; }
.acmp td.acmp-chosen { background: #E3F4E8; color: #047857; font-weight: 700; }
.acmp td.acmp-chosen-sum { color: #047857; font-weight: 700; }
.acmp tr.acmp-sec td { background: var(--surface-3); color: var(--text); font-weight: 700; }
.acmp tfoot th { text-align: left; color: var(--text); font-weight: 600; white-space: normal; min-width: 240px; background: var(--surface-2); border-top: 1px solid var(--line); }
.acmp tfoot td { white-space: normal; min-width: 150px; color: var(--text); background: var(--surface-2); border-top: 1px solid var(--line); vertical-align: top; }
.acmp tfoot tr.acmp-total th, .acmp tfoot tr.acmp-total td { font-weight: 800; background: var(--surface); }
.acmp tbody tr:hover td.acmp-chosen { background: #D1FAE5; }
/* Закріплені колонки позиції (широкий екран): відступи --l0..--l4 ставить кабінет за шириною шапки */
.acmp-s0 { left: var(--l0, 0); } .acmp-s1 { left: var(--l1, 0); } .acmp-s2 { left: var(--l2, 0); }
.acmp-s3 { left: var(--l3, 0); } .acmp-s4 { left: var(--l4, 0); }
.acmp.acmp-sticky .acmp-s { position: sticky; z-index: 1; background: var(--surface); }
.acmp.acmp-sticky thead .acmp-s { z-index: 4; background: var(--surface-2); }
.acmp.acmp-sticky tfoot .acmp-s { background: var(--surface-2); }
.acmp.acmp-sticky tfoot tr.acmp-total .acmp-s { background: var(--surface); }
.acmp.acmp-sticky .acmp-s-last { box-shadow: inset -2px 0 0 var(--line-2); }
.acmp.acmp-sticky tbody tr:hover .acmp-s { background: var(--surface-2); }
.acmp .acmp-sec-n { position: sticky; left: 10px; }
.abar-row.abar-main .abar-n { font-weight: 700; }
.asave-how { margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.asave-how p { margin: 6px 0; }
.asave-formula { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; padding: 8px 12px; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 8px; overflow-x: auto; }
.asave-skip { display: flex; flex-direction: column; gap: 4px; font-size: 13px; max-height: 260px; overflow: auto; }

/* Шаблони листів учасникам (адміністрування): перелік зліва, редактор справа, на телефоні стосом */
.ltpl { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 18px; margin-top: 8px; }
.ltpl-list { display: flex; flex-direction: column; gap: 8px; }
.ltpl-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.ltpl-item:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.ltpl-item.active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.ltpl-ico { color: var(--accent-text); display: inline-flex; grid-row: span 2; }
.ltpl-name { font-weight: 700; overflow-wrap: anywhere; }
.ltpl-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.ltpl-editor { min-width: 0; }
.ltpl-ta { min-height: 300px; font-size: 14px; line-height: 1.5; }
.ltpl-editor .afield { margin-bottom: 14px; }
.ltpl-editor .afield > span { font-weight: 600; color: var(--text); }
.ltpl-vars { margin: 4px 0 10px; }
.tpl-var:disabled { opacity: .55; cursor: default; }
@media (max-width: 760px) {
  .ltpl { grid-template-columns: minmax(0, 1fr); }
  .ltpl-ta { min-height: 260px; }
  .acmp td.acmp-name, .acmp th.acmp-name { min-width: 170px; max-width: 220px; }
}
.tz-missing summary { cursor: pointer; font-weight: 600; }
.tz-missing[open] summary { margin-bottom: 2px; }
/* Перевірка фактів у текстах AI (огляд AI 03.10.2026): червоне немає в даних тендера,
   жовте є в даних, але в іншого учасника; банер з лічильником і переліком доказів */
mark.fc-mark { color: inherit; border-radius: 2px; padding: 0 1px; }
mark.fc-red { background: #FEE2E2; border-bottom: 2px solid #DC2626; }
mark.fc-amber { background: #FEF3C7; border-bottom: 2px dashed #D97706; }
mark.fc-claim { background: #F3F0FF; box-shadow: inset 0 -2px 0 #7C3AED; }
mark.fc-claim mark.fc-claim { background: transparent; box-shadow: none; }
.fc-group-h.violet { color: #6D28D9; }
.adocs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: #4B5563; }
.adocs .chip { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 999px; background: #F3F4F6; color: #374151; text-decoration: none; }
.adocs .chip.warn { background: #FEF3C7; color: #92400E; }
a.docref { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
.fc-wrap { display: flex; flex-direction: column; gap: 8px; }
.fc-banner { border-radius: 10px; padding: 8px 12px; font-size: 13px; border: 1px solid #E5E7EB; background: #F9FAFB; color: #374151; }
.fc-banner.fc-bad { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.fc-banner.fc-warn { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.fc-banner.fc-good { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.fc-banner.fc-compact { padding: 4px 10px; font-size: 12px; }
.fc-banner-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fc-banner-t { font-weight: 600; }
.fc-banner-n { margin-top: 4px; font-size: 12px; }
.fc-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; color: #1F2937; }
.fc-group-h { font-weight: 700; font-size: 12.5px; }
.fc-group-h.red { color: #B91C1C; }
.fc-group-h.amber { color: #B45309; }
.fc-group-h.green { color: #047857; }
.fc-items { margin: 4px 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fc-why { font-size: 12px; color: #6B7280; }
.fc-ev { font-size: 12px; color: #374151; overflow-wrap: anywhere; }
.fc-claims { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; max-height: 50vh; overflow: auto; }
.fc-claim { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid #FECACA; background: #FEF2F2; border-radius: 8px; cursor: pointer; }
.fc-claim input { margin-top: 3px; }
/* Розпізнана пропозиція: значення з цитатою документа, не знайдене, PDF без тексту */
.rec-q { font-size: 12px; color: #6B7280; overflow-wrap: anywhere; }
.rec-ai { font-size: 12px; color: #92400E; }
.rec-terms td, .rec-terms th { vertical-align: top; }
.inp-need { border-color: #F59E0B !important; background: #FFFBEB; }
.chat-msg .md-view { white-space: normal; }
.asst-m .fc-banner { margin-bottom: 6px; }

/* Рядок чіпів замість пояснювального абзацу */
.ctx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 14px; font-size: 13px; }
.role-leg { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; color: #4B5563; }
.tpl-var { cursor: pointer; border: 1px solid transparent; font-family: inherit; }
.tpl-var:hover { border-color: #4F46E5; }
/* Шлях протоколу: чотири кроки зі стрілками */
.pflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 18px; counter-reset: pf; }
.pflow-s { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid #E5E7EB; background: #FFFFFF; font-size: 13px; }
.pflow-s b { font-size: 14px; color: #111827; }
.pflow-s.on { border-color: #4F46E5; box-shadow: 0 4px 14px rgba(79,70,229,.12); }
.pflow-i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #F3F4F6; color: #4B5563; margin-bottom: 4px; }
.pflow-s.on .pflow-i { background: #EEF2FF; color: #4F46E5; }
.pflow-s:not(:last-child)::after { content: ''; position: absolute; right: -9px; top: 50%; width: 8px; height: 8px; border-top: 2px solid #C7D2FE; border-right: 2px solid #C7D2FE; transform: translateY(-50%) rotate(45deg); }
@media (max-width: 640px) {
  .pflow { grid-template-columns: minmax(0, 1fr); }
  .pflow-s:not(:last-child)::after { right: auto; left: 30px; top: auto; bottom: -9px; transform: rotate(135deg); }
}
.empty .empty-ico { display: flex; justify-content: center; margin-bottom: 8px; color: #9CA3AF; }
.atile-on { border-color: #4F46E5; box-shadow: 0 0 0 1px #4F46E5, 0 4px 14px rgba(79,70,229,.15); }
.atile.btn-ai::before { display: none; }
