/* Login, PDF drop zone, samples and the docked assistant. */

/* ---------- login ---------- */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); text-align: center; display: flex; flex-direction: column; gap: 8px; }
.login-logo svg { width: min(340px, 100%); height: auto; margin: 0 auto 10px; }
.login-card h1 { font-size: 22px; }
.login-card .sub { font-size: 14px; }
.login-notice { background: var(--accent-soft); color: var(--accent-deep); padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.login-field { display: grid; gap: 6px; text-align: left; font-size: 13px; font-weight: 650; color: var(--ink2); margin: 16px 0 12px; }
.login-field input {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line2);
  border-radius: 10px; background: var(--surface); color: var(--ink);
}
.wide-btn { width: 100%; }

/* ---------- drop zone + samples ---------- */

.card.drop { padding: 0; overflow: hidden; }
.drop-zone {
  border: 1.5px dashed var(--line2); border-radius: var(--r);
  margin: 12px; padding: 26px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone.hover { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone .sub { max-width: 46ch; }
.drop-zone .btn { margin-top: 10px; }
.pick { cursor: pointer; position: relative; }
.vh {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 0;
}
.samples { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.chip-btn {
  all: unset; cursor: pointer;
  border: 1px solid var(--line2); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 650; color: var(--ink2);
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.chip-btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- chat dock ---------- */

.chat {
  background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 16px 10px; }
.chat-title { font-weight: 750; }
.chat-head .x { font-size: 18px; }

.chat-msgs { flex: 1; overflow-y: auto; padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.chat-empty { display: block; padding: 14px 16px 2px; }
.chat-empty .bubble { max-width: 96%; }
.chat-empty .bubble p + p { margin-top: 7px; }
.chat-empty .chips { padding: 12px 0 0; }

.bubble { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.bubble p { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }

.bubble.typing { display: flex; gap: 5px; padding: 14px 16px; }
.bubble.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: cdots 1.2s infinite; }
.bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cdots { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

.receipts { list-style: none; margin: 9px 0 0; padding: 8px 0 0; display: grid; gap: 4px; font-size: 13px; border-top: 1px solid var(--line); }
.rc { display: flex; gap: 6px; }
.rc.ok { color: var(--ok); font-weight: 650; }
.rc.bad { color: var(--bad); font-weight: 650; }

.chat-err { margin: 0 16px 8px; padding: 10px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); display: grid; gap: 6px; }
.chat-err p { font-size: 13px; }
.chat-err .link { color: var(--bad); justify-self: start; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 16px 10px; }
.chips-row:empty { display: none; }
.chip {
  all: unset; cursor: pointer;
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 999px; padding: 5px 11px;
  font-size: 12px; font-weight: 650;
}
.chip:hover { background: #dbe7fa; }

.chat-form { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; min-width: 0; font: inherit;
  padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px;
  background: var(--surface); color: var(--ink);
}
.chat-form .btn { padding: 9px 14px; }

/* ---------- floating button (chat closed) ---------- */

.chat-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 15;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 12px 18px; font-size: 13.5px; font-weight: 750; cursor: pointer;
  box-shadow: 0 6px 20px rgba(47, 87, 168, 0.4);
}
.chat-fab:hover { background: #3f66b4; }

/* ---------- mobile: bottom sheet ---------- */

@media (max-width: 1099px) {
  .chat {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 14;
    height: min(72vh, 560px);
    border: none; border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(16, 24, 40, 0.18);
    transform: translateY(110%);
    transition: transform 0.25s ease;
  }
  .chat:not(.closed) { transform: none; }
  .chat-head .x { font-size: 20px; }
}

@media (max-width: 720px) {
  .chat-form .btn { min-height: 44px; min-width: 44px; padding: 9px 12px; }
  .chat-form input { font-size: 15px; }
  .chip { min-height: 44px; display: inline-flex; align-items: center; }
  .chip-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .drop-zone .btn { min-height: 44px; }
  .login-logo svg { width: 80%; }
}

@media (prefers-reduced-motion: reduce) {
  .chat { transition: none; }
}
