/* "Ask Claimrang" chat box (public/js/askWidget.js). One stylesheet for the app and the public website.
   Self-contained: its own colours, so it looks the same wherever it is placed. Midnight by default;
   light when the page says data-theme="light" (the app's light theme). No inline styles anywhere. */

.cq-root {
  --cq-bg: #0b1730;
  --cq-surface: #12213d;
  --cq-surface-2: #182b4b;
  --cq-line: rgba(160, 190, 240, 0.16);
  --cq-line-2: rgba(160, 190, 240, 0.28);
  --cq-text: #eef3fb;
  --cq-text-2: #a9b8d0;
  --cq-text-3: #7d90ad;
  --cq-accent: #5aa8f5;
  --cq-accent-2: #8cc6ff;
  --cq-accent-ink: #9fd0ff;
  --cq-tint: rgba(90, 168, 245, 0.14);
  --cq-on: #04101f;
  --cq-me: linear-gradient(135deg, #6db4f8, #3d8ef0);
  --cq-head: radial-gradient(120% 140% at 0% 0%, #2b5fc0 0%, #17376f 45%, #0c1830 100%);
  --cq-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 40px 90px -24px rgba(0, 8, 30, 0.85), 0 16px 36px -18px rgba(0, 0, 0, 0.7);
  --cq-ring: 0 0 0 3px rgba(90, 168, 245, 0.4);
  --cq-font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--cq-font);
  color: var(--cq-text);
}
:root[data-theme="light"] .cq-root {
  --cq-bg: #f3f6fb;
  --cq-surface: #ffffff;
  --cq-surface-2: #f3f7fd;
  --cq-line: #e1e8f2;
  --cq-line-2: #c8d3e3;
  --cq-text: #0f1a2e;
  --cq-text-2: #50607a;
  --cq-text-3: #7b8ba3;
  --cq-accent: #1f6fe0;
  --cq-accent-2: #3b8cf5;
  --cq-accent-ink: #1552b5;
  --cq-tint: #e6f0fe;
  --cq-on: #ffffff;
  --cq-me: linear-gradient(135deg, #3b8cf5, #1f6fe0);
  --cq-shadow: 0 40px 80px -28px rgba(10, 40, 100, 0.45), 0 12px 28px -14px rgba(20, 22, 43, 0.22);
  --cq-ring: 0 0 0 3px rgba(31, 111, 224, 0.28);
}

.cq-root *, .cq-root *::before, .cq-root *::after { box-sizing: border-box; }
.cq-root button { font-family: inherit; }
.cq-root [hidden] { display: none !important; }
.cq-ic { width: 20px; height: 20px; flex: none; }

/* ---------- the button in the corner ---------- */
.cq-launch {
  position: fixed; right: 22px; bottom: 22px; z-index: 60; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  border: 0; padding: 7px 20px 7px 7px; border-radius: 999px; color: #04101f; font: 650 0.95rem/1 var(--cq-font); letter-spacing: -0.005em;
  background: linear-gradient(180deg, #b7dcff, #5aa8f5);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 18px 40px -14px rgba(64, 140, 245, 0.85), 0 10px 26px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s;
}
.cq-launch:hover { transform: translateY(-2px); }
.cq-launch:focus-visible { outline: none; box-shadow: var(--cq-ring), 0 18px 40px -14px rgba(64, 140, 245, 0.85); }
.cq-launch-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #0c1830; color: #9fd0ff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset; }
.cq-launch-ic .cq-ic { width: 21px; height: 21px; }
.cq-root.is-open .cq-launch { display: none; }

/* ---------- the panel ---------- */
.cq-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 61; width: min(408px, calc(100vw - 24px)); height: min(680px, calc(100vh - 44px)); height: min(680px, calc(100dvh - 44px));
  display: flex; flex-direction: column; overflow: hidden; background: var(--cq-bg); color: var(--cq-text);
  border: 1px solid var(--cq-line-2); border-radius: 22px; box-shadow: var(--cq-shadow);
  animation: cq-in 0.26s cubic-bezier(0.2, 0.9, 0.25, 1);
}
@keyframes cq-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

.cq-head { display: flex; align-items: center; gap: 11px; padding: 14px 12px 14px 14px; background: var(--cq-head); color: #fff; flex: none; }
.cq-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #d6ecff; background: rgba(255, 255, 255, 0.12); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset; }
.cq-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cq-who strong { font: 700 1.02rem/1.2 var(--cq-font); letter-spacing: -0.01em; }
.cq-sub { font-size: 0.76rem; line-height: 1.3; color: rgba(225, 238, 255, 0.78); display: flex; align-items: center; gap: 6px; }
.cq-sub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5fe0a8; box-shadow: 0 0 0 3px rgba(95, 224, 168, 0.2); flex: none; }
.cq-hbtn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; cursor: pointer; color: rgba(235, 244, 255, 0.85); background: transparent; transition: background 0.15s; }
.cq-hbtn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.cq-hbtn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }
.cq-hbtn .cq-ic { width: 19px; height: 19px; }

.cq-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--cq-line-2) transparent; }
.cq-view { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cq-thread { flex: 1; min-height: 0; padding: 0; }

/* ---------- home ---------- */
.cq-hero { padding: 4px 4px 2px; }
.cq-hello { margin: 0; font: 720 1.42rem/1.2 var(--cq-font); letter-spacing: -0.02em; }
.cq-lead { margin: 6px 0 0; color: var(--cq-text-2); font-size: 0.93rem; line-height: 1.45; }
.cq-label { margin: 0; padding: 12px 14px 6px; font: 700 0.7rem/1 var(--cq-font); letter-spacing: 0.09em; text-transform: uppercase; color: var(--cq-text-3); }
.cq-label-out { padding: 8px 4px 0; }
.cq-card { background: var(--cq-surface); border: 1px solid var(--cq-line); border-radius: 16px; overflow: hidden; }
.cq-line {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer;
  border: 0; border-top: 1px solid var(--cq-line); background: transparent; color: var(--cq-text); font: 560 0.92rem/1.35 var(--cq-font); padding: 12px 14px;
}
.cq-card > .cq-line:first-child { border-top: 0; }
.cq-line:hover { background: var(--cq-tint); }
.cq-go { width: 16px; height: 16px; color: var(--cq-text-3); transition: transform 0.15s, color 0.15s; }
.cq-line:hover .cq-go, .cq-row:hover .cq-go, .cq-tile:hover .cq-go { color: var(--cq-accent-ink); transform: translateX(2px); }
.cq-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.cq-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; cursor: pointer; color: var(--cq-text);
  background: var(--cq-surface); border: 1px solid var(--cq-line); border-radius: 16px; padding: 13px; transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.cq-tile:hover { border-color: var(--cq-accent); background: var(--cq-surface-2); transform: translateY(-1px); }
.cq-tile-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--cq-accent-ink); background: var(--cq-tint); }
.cq-tile-ic .cq-ic { width: 18px; height: 18px; }
.cq-tile-text { display: flex; flex-direction: column; gap: 3px; }
.cq-tile-text strong { font: 650 0.9rem/1.25 var(--cq-font); }
.cq-tile-text small { font-size: 0.76rem; line-height: 1.35; color: var(--cq-text-2); }
.cq-resume { display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border: 1px dashed var(--cq-line-2); border-radius: 12px; background: transparent; color: var(--cq-accent-ink); font: 620 0.86rem/1 var(--cq-font); padding: 11px; }
.cq-resume:hover { background: var(--cq-tint); }
.cq-topic-head { display: flex; align-items: center; gap: 12px; padding: 2px 2px 4px; }
.cq-topic-head strong { display: block; font: 700 1.08rem/1.25 var(--cq-font); letter-spacing: -0.01em; }
.cq-topic-head small { color: var(--cq-text-2); font-size: 0.82rem; }

/* ---------- conversation ---------- */
.cq-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: var(--cq-line-2) transparent; }
.cq-turn { display: flex; align-items: flex-end; gap: 8px; animation: cq-pop 0.24s cubic-bezier(0.2, 0.9, 0.25, 1); }
@keyframes cq-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cq-turn-me { justify-content: flex-end; }
.cq-avatar { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--cq-accent-ink); background: var(--cq-tint); margin-bottom: 2px; }
.cq-avatar .cq-ic { width: 14px; height: 14px; }
.cq-msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 0.92rem; line-height: 1.52; overflow-wrap: anywhere; }
.cq-msg p { margin: 0; }
.cq-msg p + p { margin-top: 8px; }
.cq-bot { background: var(--cq-surface); border: 1px solid var(--cq-line); border-bottom-left-radius: 6px; }
.cq-me { background: var(--cq-me); color: #fff; border-bottom-right-radius: 6px; font-weight: 560; }
.cq-title { font: 700 0.95rem/1.3 var(--cq-font); letter-spacing: -0.005em; padding-bottom: 7px; margin-bottom: 8px !important; border-bottom: 1px solid var(--cq-line); }
.cq-title + p { margin-top: 0 !important; }
.cq-rows { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cq-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font: inherit; color: inherit; text-decoration: none; padding: 9px 11px; border-radius: 11px; background: var(--cq-surface-2); border: 1px solid var(--cq-line); }
a.cq-row, button.cq-row { cursor: pointer; }
a.cq-row:hover, button.cq-row:hover { border-color: var(--cq-accent); background: var(--cq-tint); }
.cq-row-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.cq-row-main strong { font-weight: 640; }
.cq-row-main small { color: var(--cq-text-2); font-size: 0.78rem; line-height: 1.35; }
.cq-row-amount { font-weight: 680; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cq-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-weight: 660; color: var(--cq-accent-ink); text-decoration: none; }
.cq-link:hover { text-decoration: underline; }
.cq-link .cq-go { color: currentColor; }
.cq-rate { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--cq-line); font-size: 0.78rem; color: var(--cq-text-3); }
.cq-rate-btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; border: 1px solid var(--cq-line-2); background: transparent; color: var(--cq-text-2); font: 620 0.76rem/1 var(--cq-font); padding: 5px 9px; border-radius: 999px; }
.cq-rate-btn:hover { border-color: var(--cq-accent); color: var(--cq-accent-ink); background: var(--cq-tint); }
.cq-rate-btn .cq-ic { width: 13px; height: 13px; }
.cq-down { transform: rotate(180deg); }
.cq-typing { display: inline-flex; align-items: center; gap: 5px; padding: 14px 15px; }
.cq-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--cq-text-3); animation: cq-dot 1s infinite ease-in-out; }
.cq-typing i:nth-child(2) { animation-delay: 0.15s; }
.cq-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cq-dot { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.cq-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 2px 34px; }
.cq-chip { cursor: pointer; text-align: left; border: 1px solid var(--cq-line-2); background: transparent; color: var(--cq-accent-ink); font: 620 0.82rem/1.25 var(--cq-font); padding: 8px 12px; border-radius: 999px; transition: background 0.15s, border-color 0.15s; }
.cq-chip:hover { background: var(--cq-tint); border-color: var(--cq-accent); }

/* ---------- the text box ---------- */
.cq-foot { flex: none; position: relative; padding: 10px 14px 10px; border-top: 1px solid var(--cq-line); background: var(--cq-bg); }
.cq-form { display: flex; align-items: center; gap: 8px; }
.cq-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 46px; border-radius: 14px; background: var(--cq-surface); border: 1px solid var(--cq-line-2); transition: border-color 0.15s, box-shadow 0.15s; }
.cq-field:focus-within { border-color: var(--cq-accent); box-shadow: var(--cq-ring); }
.cq-field-ic { width: 17px; height: 17px; color: var(--cq-text-3); }
.cq-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--cq-text); font: 500 0.95rem/1.2 var(--cq-font); padding: 0; }
.cq-input::placeholder { color: var(--cq-text-3); }
.cq-send { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border: 0; border-radius: 14px; cursor: pointer; color: var(--cq-on); background: linear-gradient(180deg, var(--cq-accent-2), var(--cq-accent)); box-shadow: 0 8px 18px -8px rgba(64, 140, 245, 0.9); transition: transform 0.15s; }
.cq-send:hover { transform: translateY(-1px); }
.cq-send:focus-visible { outline: none; box-shadow: var(--cq-ring); }
.cq-note { margin: 8px 2px 0; font-size: 0.71rem; line-height: 1.35; color: var(--cq-text-3); text-align: center; }
.cq-picks { position: absolute; left: 14px; right: 14px; bottom: calc(100% - 4px); display: flex; flex-direction: column; overflow: hidden; background: var(--cq-surface); border: 1px solid var(--cq-line-2); border-radius: 14px; box-shadow: 0 -14px 30px -16px rgba(0, 0, 0, 0.55); }
.cq-pick { display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer; border: 0; border-top: 1px solid var(--cq-line); background: transparent; color: var(--cq-text); font: 540 0.88rem/1.3 var(--cq-font); padding: 10px 12px; }
.cq-pick:first-child { border-top: 0; }
.cq-pick:hover, .cq-pick[aria-selected="true"] { background: var(--cq-tint); }
.cq-pick-ic { width: 15px; height: 15px; color: var(--cq-text-3); }

.cq-root button:focus-visible, .cq-root a:focus-visible { outline: none; box-shadow: var(--cq-ring); }

/* ---------- phones: the chat box becomes the whole screen ---------- */
@media (max-width: 560px) {
  .cq-launch { right: 14px; bottom: 14px; padding: 6px; }
  .cq-launch-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cq-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cq-panel, .cq-turn { animation: none; }
  .cq-typing i { animation: none; opacity: 0.7; }
  .cq-launch, .cq-tile, .cq-send, .cq-go { transition: none; }
}
@media print { .cq-root { display: none; } }
