/* ---------- Vidya: AI counsellor widget ---------- */
.svc-chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 120;
  display: inline-flex; align-items: center; gap: 12px; padding: 8px 20px 8px 8px; min-height: 60px;
  border: 0; border-radius: 999px; background: var(--forest); color: var(--on-dark);
  box-shadow: 0 20px 40px -16px rgba(10, 43, 32, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  font-weight: 600; font-size: 0.92rem; transition: transform .45s var(--ease), opacity .3s;
}
.svc-chat-launcher:hover { transform: translateY(-3px); }
.svc-chat-launcher .orb { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #d6b57a, #a87c3f 60%, #7d5a2a); position: relative; }
.svc-chat-launcher .orb::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(201, 164, 103, 0.6); animation: pulse 2.8s var(--ease) infinite; }
.svc-chat-launcher .orb svg { width: 22px; height: 22px; color: var(--forest-3); }
.svc-chat-launcher small { display: block; font-weight: 400; font-size: 0.72rem; color: var(--on-dark-muted); }
.menu-open .svc-chat-launcher, .chat-open .svc-chat-launcher { opacity: 0; pointer-events: none; transform: scale(.9); }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@media (max-width: 520px) { .svc-chat-launcher .txt { display: none; } .svc-chat-launcher { padding: 8px; } }

.svc-chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 130;
  width: min(420px, calc(100vw - 24px)); height: min(680px, calc(100vh - 40px)); height: min(680px, calc(100dvh - 40px));
  display: flex; flex-direction: column; background: var(--paper); color: var(--ink);
  border-radius: 22px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 50px 100px -30px rgba(10, 43, 32, 0.55);
  transform-origin: bottom right; transform: translateY(16px) scale(.96); opacity: 0; visibility: hidden;
  transition: transform .5s var(--ease), opacity .35s var(--ease), visibility .5s;
}
.chat-open .svc-chat { transform: none; opacity: 1; visibility: visible; }
@media (max-width: 520px) {
  .svc-chat { right: 0; bottom: 0; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
}

.svc-chat header { background: var(--forest); color: var(--on-dark); padding: 18px 18px 18px 20px; display: flex; align-items: center; gap: 14px; position: relative; }
.svc-chat header .avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; background: radial-gradient(circle at 30% 30%, #d6b57a, #a87c3f 60%, #7d5a2a); display: grid; place-items: center; font-family: var(--serif); color: var(--forest-3); font-size: 1.2rem; }
.svc-chat header .t { flex: 1; min-width: 0; }
.svc-chat header strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.2rem; letter-spacing: -0.01em; }
.svc-chat header span { font-size: 0.78rem; color: var(--on-dark-muted); display: inline-flex; align-items: center; gap: 6px; }
.svc-chat header span i { width: 7px; height: 7px; border-radius: 50%; background: #52c48f; }
.svc-chat header button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-dark); background: transparent; color: var(--on-dark); display: grid; place-items: center; flex: none; }
.svc-chat header button:hover { background: rgba(241, 236, 224, 0.1); }
.svc-chat header button svg { width: 16px; height: 16px; }

.svc-chat .log { flex: 1; overflow-y: auto; padding: 22px 18px 8px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; overscroll-behavior: contain; }
.msg { max-width: 88%; font-size: 0.95rem; line-height: 1.55; animation: rise .4s var(--ease) both; }
.msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; padding: 13px 16px; }
.msg.user { align-self: flex-end; background: var(--forest); color: var(--on-dark); border-radius: 18px 4px 18px 18px; padding: 11px 16px; white-space: pre-wrap; word-break: break-word; }
.msg.bot p { margin: 0 0 .6em; } .msg.bot p:last-child { margin: 0; }
.msg.bot ul, .msg.bot ol { margin: .3em 0 .7em; padding-left: 1.2em; }
.msg.bot li { margin-bottom: .25em; }
.msg.bot a { color: var(--forest-2); border-bottom: 1px solid var(--brass); }
.msg.bot strong { font-weight: 600; }
.msg.bot h4 { font-family: var(--sans); font-size: .95rem; font-weight: 600; margin: .6em 0 .3em; letter-spacing: 0; }
.msg.err { border-color: rgba(163, 58, 43, .3); }
.msg .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.msg .actions a { font-size: .82rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink); }
.msg .actions a:hover { background: var(--forest); color: var(--on-dark); border-color: var(--forest); }
.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.svc-chat .suggest { display: flex; gap: 8px; padding: 6px 18px 12px; overflow-x: auto; scrollbar-width: none; }
.svc-chat .suggest::-webkit-scrollbar { display: none; }
.svc-chat .suggest button { flex: none; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font-size: .84rem; color: var(--ink-2); transition: all .25s; }
.svc-chat .suggest button:hover { border-color: var(--forest); color: var(--forest); }

.svc-chat form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 10px; border-top: 1px solid var(--line); background: var(--card); }
.svc-chat textarea { flex: 1; resize: none; border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; height: 46px; min-height: 46px; max-height: 140px; overflow-y: auto; font: inherit; font-size: .95rem; background: var(--paper); color: var(--ink); line-height: 1.4; }
.svc-chat textarea:focus { outline: none; border-color: var(--forest); }
.svc-chat form button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--forest); color: var(--on-dark); display: grid; place-items: center; flex: none; transition: background .25s, opacity .25s; }
.svc-chat form button:disabled { opacity: .45; cursor: not-allowed; }
.svc-chat form button svg { width: 18px; height: 18px; }
.svc-chat .fine { font-size: .7rem; color: var(--muted); text-align: center; padding: 0 16px 10px; background: var(--card); }
.svc-chat .fine a { border-bottom: 1px solid var(--line-strong); }

.msg .follow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.msg .follow button { font-size: .8rem; padding: 6px 11px; border-radius: 999px; border: 1px dashed var(--line-strong); background: transparent; color: var(--forest-2); text-align: left; }
.msg .follow button:hover { border-style: solid; border-color: var(--forest); background: var(--paper); }
