/* ===== Intent Chat Modal ===== */
.intent-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: oklch(0% 0 0 / 0.35);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .25s var(--ease-out);
}
.intent-overlay.open { display: flex; }

.intent-modal {
  width: 100%; max-width: 520px;
  height: min(620px, 85vh);
  background: var(--panel-bg);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 60px oklch(0% 0 0 / 0.12);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: slideUp .3s var(--ease-out);
}

/* Header */
.intent-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.intent-hdr-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; flex-shrink: 0;
}
.intent-hdr-title {
  font-family: var(--font-serif);
  font-size: .92rem; font-weight: 600; color: var(--text-primary);
  flex: 1;
}
.intent-hdr-sub {
  font-size: .68rem; color: var(--text-muted);
}
.intent-hdr-close {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: var(--accent-subtle);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; transition: all .15s;
  flex-shrink: 0;
}
.intent-hdr-close:hover {
  background: var(--accent-glow); color: var(--accent);
}
.intent-hdr-skip {
  font-size: .72rem; color: var(--accent);
  background: none; border: none; cursor: pointer;
  padding: 4px 10px; border-radius: 6px;
  font-family: inherit;
  transition: background .15s; white-space: nowrap;
}
.intent-hdr-skip:hover { background: var(--accent-subtle); }

/* Messages area */
.intent-body {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}
.intent-body::-webkit-scrollbar { width: 3px; }
.intent-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Individual messages */
.intent-msg {
  display: flex; gap: 10px; align-items: flex-start;
  animation: msgIn .25s var(--ease-out);
}
.intent-msg-bot .intent-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-subtle); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; flex-shrink: 0;
}
.intent-msg-user {
  flex-direction: row-reverse;
}
.intent-msg-user .intent-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: oklch(92% 0.01 250); color: oklch(45% 0.08 250);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; flex-shrink: 0;
}
.intent-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .8rem; line-height: 1.55;
  word-break: break-word;
}
.intent-msg-bot .intent-msg-bubble {
  background: oklch(97% 0.005 60);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.intent-msg-user .intent-msg-bubble {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}

/* Option buttons area */
.intent-options {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px 0 0 38px;
  animation: msgIn .3s var(--ease-out);
}
.intent-opt {
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--text-secondary);
  font-family: var(--font-sans); font-size: .75rem;
  cursor: pointer; transition: all .15s var(--ease-out);
  white-space: nowrap;
}
.intent-opt:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-subtle);
  transform: translateY(-1px);
}
.intent-opt.selected {
  border-color: var(--accent); background: var(--accent);
  color: #fff;
}
.intent-opt.skip {
  border-color: transparent; color: var(--text-muted);
  font-size: .7rem;
}
.intent-opt.skip:hover {
  color: var(--text-secondary); background: var(--accent-subtle);
  border-color: var(--border);
}

/* Input area */
.intent-input-row {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.intent-input {
  flex: 1; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  font-family: var(--font-sans); font-size: .8rem;
  color: var(--text-primary);
  background: oklch(99% 0.005 60);
  outline: none; transition: border-color .2s;
}
.intent-input:focus { border-color: var(--accent); }
.intent-input::placeholder { color: var(--text-muted); }
.intent-send {
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: var(--accent); color: #fff;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: .85rem;
  transition: all .15s var(--ease-out);
  flex-shrink: 0;
}
.intent-send:hover { background: var(--accent-hover); }
.intent-send:disabled { opacity: .4; cursor: not-allowed; }

/* Photo upload area */
.intent-upload-area {
  padding: 4px 0 0 38px;
  display: flex; gap: 8px; flex-wrap: wrap;
  animation: msgIn .3s var(--ease-out);
}
.intent-upload-btn {
  padding: 8px 14px; border-radius: 10px;
  border: 1px dashed var(--border);
  background: transparent; cursor: pointer;
  font-size: .75rem; color: var(--text-muted);
  font-family: inherit;
  transition: all .15s;
}
.intent-upload-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-subtle);
}
.intent-upload-thumb {
  width: 60px; height: 60px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--border);
  position: relative;
}
.intent-upload-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.intent-upload-thumb .del {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--error); color: #fff; border: none;
  font-size: .45rem; cursor: pointer;
  display: none;
}
.intent-upload-thumb:hover .del { display: flex; align-items: center; justify-content: center; }

/* Summary card */
.intent-summary {
  margin: 4px 0 0 38px;
  padding: 14px 16px;
  background: var(--accent-subtle);
  border-radius: 12px;
  border: 1px solid oklch(85% 0.03 35 / 0.4);
  animation: msgIn .35s var(--ease-out);
}
.intent-summary-title {
  font-size: .78rem; font-weight: 600; color: var(--accent);
  margin-bottom: 8px;
}
.intent-summary-row {
  display: flex; gap: 6px; align-items: baseline;
  font-size: .75rem; color: var(--text-secondary);
  padding: 3px 0;
}
.intent-summary-row .label {
  color: var(--text-muted); min-width: 52px;
}
.intent-summary-actions {
  display: flex; gap: 8px; margin-top: 10px;
}
.intent-summary-confirm {
  padding: 8px 20px; border-radius: 8px;
  border: none; background: var(--accent); color: #fff;
  font-family: inherit; font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.intent-summary-confirm:hover { background: var(--accent-hover); }
.intent-summary-edit {
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-family: inherit; font-size: .78rem;
  cursor: pointer; transition: all .15s;
}
.intent-summary-edit:hover { border-color: var(--accent); color: var(--accent); }

/* Typing indicator */
.intent-typing {
  display: flex; gap: 4px; align-items: center;
  padding: 14px 14px 14px 48px;
}
.intent-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); opacity: .4;
  animation: typingDot 1.2s ease-in-out infinite;
}
.intent-typing span:nth-child(2) { animation-delay: .2s; }
.intent-typing span:nth-child(3) { animation-delay: .4s; }

/* File input (hidden) */
.intent-file-input { display: none; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes typingDot {
  0%, 100% { opacity: .4; transform: translateY(0); }
  50% { opacity: .8; transform: translateY(-3px); }
}

/* Responsive */
@media (max-width: 640px) {
  .intent-modal { height: 90vh; border-radius: 16px; }
  .intent-body { padding: 12px 14px; }
  .intent-msg-bubble { max-width: 88%; font-size: .78rem; }
  .intent-input-row { padding: 10px 14px 14px; }
}
