/* ══ Duty Assistant chat — FAB, panel, message bubbles ══ */

#chat-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border-highlight);
  background: linear-gradient(135deg, var(--primary), #2563EB);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
  z-index: 500;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}
#chat-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(59, 130, 246, 0.5); }
#chat-fab:active { transform: translateY(0); }
#chat-fab svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.chat-overlay {
  position: fixed;
  inset: 0;
  background: var(--glass-b-8);
  z-index: 600;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.chat-overlay.open { display: flex; }

.chat-panel {
  width: 100%;
  max-width: 460px;
  margin: 0 auto 0;
  height: min(640px, 92vh);
  display: flex;
  flex-direction: column;
  border-radius: var(--r3) var(--r3) 0 0;
  padding: 16px 16px 12px;
}
@media (min-width: 540px) {
  .chat-overlay { align-items: center; padding: 20px; }
  .chat-panel { border-radius: var(--r3); height: min(640px, 85vh); }
}

.chat-panel .card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chat-panel .card-title::after { content: none; }

.chat-close {
  border: none;
  background: var(--glass-w-05);
  color: var(--ink2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-close:hover { background: var(--glass-w-100); color: var(--ink); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px 8px;
}

.chat-msg { max-width: 88%; font-size: 13px; line-height: 1.55; }
.chat-msg-user { align-self: flex-end; background: var(--primary); color: #fff; padding: 10px 14px; border-radius: var(--r2) var(--r2) 4px var(--r2); }
.chat-msg-bot { align-self: flex-start; }
.chat-msg-bot .chat-bubble { background: var(--glass-w-03); border: 1px solid var(--border); padding: 10px 14px; border-radius: var(--r2) var(--r2) var(--r2) 4px; color: var(--ink2); }
.chat-msg-bot .res { margin-top: 0; }
.chat-msg-bot .hint { margin-top: 10px; margin-bottom: 0; font-size: 11px; }
.chat-msg-bot .chat-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--r2);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
}
.chat-msg-bot .chat-view-tab:hover { background: var(--primary-hover); }

.chat-empty { text-align: center; color: var(--ink3); font-size: 12px; padding: 24px 12px; line-height: 1.6; }

.chat-input-row { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.chat-input-row input {
  flex: 1;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 0 14px;
  font-size: 14px;
  background: var(--glass-b-2);
  color: var(--ink);
  font-family: var(--sans);
  outline: none;
}
.chat-input-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); }
.chat-input-row button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--r2);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-input-row button:hover { background: var(--primary-hover); }
.chat-input-row button svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
