/* Konverzace s agenty — první verze (funkční session). Designová session ji smí volně přestylovat. */
.chat-page { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px; height: calc(100dvh - var(--top-h, 64px) - 48px); min-height: 480px; }
.chat-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 14px; }
.chat-side > .btn { align-self: stretch; justify-content: center; }
.chat-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; margin: 0 -6px; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); color: var(--fg-2); min-height: 44px; }
.chat-item:hover { background: var(--surface-3); color: var(--fg-1); }
.chat-item.on { background: var(--primary-tint); color: var(--fg-1); }
.chat-item > div { min-width: 0; flex: 1; }
.chat-item b { display: block; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item span { display: block; font-size: var(--fs-xs); color: var(--fg-4); }
.chat-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex: none; box-shadow: 0 0 10px var(--primary); }

.chat-main { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.chat-pick { display: flex; align-items: center; gap: 10px; margin: 0; }
.chat-pick select { min-width: 220px; }
.chat-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.chat-empty { margin: auto; max-width: 460px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chat-empty h2 { font-size: var(--fs-h3); margin: 10px 0 0; }
.chat-hint { text-align: center; }

.msg { display: flex; gap: 10px; max-width: min(760px, 100%); }
.msg time { display: block; font-size: var(--fs-xs); color: var(--fg-5, var(--fg-4)); margin-top: 4px; }
.msg .bubble { padding: 10px 14px; border-radius: var(--radius-lg); line-height: 1.55; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; flex-direction: column; align-items: flex-end; }
.msg.me .bubble { background: var(--primary-tint); border: 1px solid var(--primary-border); color: var(--fg-1); border-bottom-right-radius: 6px; }
.msg.agent .body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.msg.agent .bubble { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg.agent .bubble > :first-child { margin-top: 0; }
.msg.agent .bubble > :last-child { margin-bottom: 0; }
.msg.thinking .bubble { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-3); align-self: flex-start; }
.msg.office { align-self: center; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--fg-3); padding: 6px 14px; border-radius: var(--radius-full); border: 1px dashed var(--border-strong); max-width: 100%; }
.msg.office .ico { width: 16px; height: 16px; color: var(--ok-fg, var(--primary)); flex: none; }

.steps { font-size: var(--fs-sm); color: var(--fg-3); }
.steps summary { cursor: pointer; min-height: 28px; display: inline-flex; align-items: center; }
.steps ul { margin: 4px 0 0; padding-left: 18px; }
.steps li { margin: 2px 0; }

.proposal { border: 1px solid var(--primary-border); background: color-mix(in srgb, var(--primary) 7%, transparent); border-radius: var(--radius-lg); padding: 12px 14px; }
.proposal.st-zamitnuto, .proposal.st-provedeno { border-color: var(--border); background: var(--surface-1); }
.proposal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proposal-head .ico { width: 18px; height: 18px; color: var(--primary); }
.proposal p { margin: 8px 0; }
.proposal ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.proposal .err { color: var(--danger-fg); }
.proposal-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.proposal-act .prop-note { flex: 1 1 200px; min-width: 0; }

.chat-compose { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-compose textarea { min-height: 52px; max-height: 40vh; resize: vertical; }
.chat-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.chat-actions > span { margin-right: auto; }

.duties { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.duties .tag { margin-left: 6px; }

.cmd .cmd-task { align-self: center; min-height: 40px; border-radius: 999px; white-space: nowrap; }

@media (max-width: 760px) {
  .chat-page { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .chat-side { max-height: 210px; }
  .chat-main { height: calc(100dvh - var(--top-h, 64px) - 60px); min-height: 420px; }
  .chat-actions > span { display: none; }
  .chat-pick { flex-wrap: wrap; }
  .chat-pick select { min-width: 0; width: 100%; }
  .cmd .cmd-task { display: none; }
}
