/* The assistant: one launcher docked in the left column, one panel.
 *
 * It sits in the sidebar rather than floating over the page because it is part
 * of the navigation — another way to reach the same things the links above it
 * reach — not a widget bolted on top.
 */

.asst-launcher {
  position: fixed;
  left: 12px;
  bottom: 16px;
  width: 176px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #2d6a2d;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d3324, #2d6a2d);
  color: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  z-index: 900;
  transition: transform .12s ease, box-shadow .12s ease;
}
.asst-launcher:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.24); }
.asst-launcher.on { background: #14211a; }
.asst-launcher .asst-ic { font-size: 20px; flex: 0 0 auto; }
.asst-launch-text { display: block; line-height: 1.3; min-width: 0; }
.asst-launch-text b { display: block; font-size: 13px; }
.asst-launch-text small { font-size: 10.5px; color: rgba(255, 255, 255, .72); }

/* The panel. Fixed, so it survives page navigation visually — the assistant
   often opens another page, and a panel that vanished mid-sentence would be
   worse than one that reappears. */
.asst-box {
  position: fixed;
  left: 12px;
  bottom: 16px;
  width: min(390px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line, #e4ece4);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .22);
  z-index: 950;
  overflow: hidden;
  font-family: "DM Sans", system-ui, sans-serif;
}

.asst-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  background: linear-gradient(135deg, #1d3324, #2d6a2d);
  color: #fff;
}
.asst-head b { display: block; font-size: 14px; }
.asst-head small { font-size: 11px; color: rgba(255, 255, 255, .74); }
.asst-head-right { display: flex; align-items: center; gap: 7px; }
.asst-head select {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .24);
  color: #fff;
  border-radius: 7px;
  padding: 5px 7px;
  font: 600 12px "DM Sans", system-ui, sans-serif;
  max-width: 116px;
}
.asst-head select option { color: #1d2a1d; }
.asst-head button {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 6px;
}
.asst-head button:hover { background: rgba(255, 255, 255, .16); }

.asst-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  background: #fbfdfb;
}
.asst-msg { max-width: 88%; font-size: 13.5px; line-height: 1.55; }
.asst-msg > div:first-child {
  padding: 9px 12px;
  border-radius: 12px;
}
.asst-msg.bot { align-self: flex-start; }
.asst-msg.bot > div:first-child {
  background: #fff;
  border: 1px solid var(--line, #e4ece4);
  border-bottom-left-radius: 4px;
  color: #1d2a1d;
}
.asst-msg.me { align-self: flex-end; }
.asst-msg.me > div:first-child {
  background: #2d6a2d;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.asst-meta {
  font-size: 11px;
  color: #7d8a7e;
  margin-top: 3px;
  padding-left: 4px;
  font-style: italic;
}

.asst-suggest {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
  overflow-x: auto;
  background: #fbfdfb;
}
.asst-suggest button {
  flex: 0 0 auto;
  border: 1px solid var(--line, #e4ece4);
  background: #fff;
  border-radius: 20px;
  padding: 6px 11px;
  font: 500 11.5px "DM Sans", system-ui, sans-serif;
  color: #24402a;
  cursor: pointer;
  white-space: nowrap;
}
.asst-suggest button:hover { border-color: #2d6a2d; background: #f2f8f2; }

.asst-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line, #e4ece4);
  background: #fff;
}
.asst-input input {
  flex: 1;
  border: 1px solid var(--line, #e4ece4);
  border-radius: 22px;
  padding: 9px 14px;
  font: 13.5px "DM Sans", system-ui, sans-serif;
  min-width: 0;
}
.asst-input input:focus { outline: none; border-color: #2d6a2d; }
.asst-input button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line, #e4ece4);
  background: #fff;
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.asst-input button:hover:not(:disabled) { border-color: #2d6a2d; background: #f2f8f2; }
.asst-input button:disabled { opacity: .45; cursor: not-allowed; }
#asstSend { background: #2d6a2d; border-color: #2d6a2d; color: #fff; }
#asstSend:hover { background: #245724; }

/* Listening: a ring that pulses, so it is obvious the microphone is live. */
#asstMic.live {
  background: #ffe9e6;
  border-color: #c0392b;
  animation: asst-pulse 1.15s ease-in-out infinite;
}
@keyframes asst-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .45); }
  50%      { box-shadow: 0 0 0 7px rgba(192, 57, 43, 0); }
}

.asst-foot {
  margin: 0;
  padding: 0 14px 12px;
  font-size: 10.5px;
  line-height: 1.45;
  color: #8a958b;
  background: #fff;
}

@media (max-width: 900px) {
  .asst-launcher { width: auto; }
  .asst-launch-text { display: none; }
  .asst-box { left: 8px; right: 8px; width: auto; }
}

/* Two pickers where there was one, plus the speaker switch. The arrow says
   which way round they are: what you say in, then what comes back. */
.asst-head-right { display: flex; align-items: center; gap: .3rem; }
.asst-head-right select { max-width: 96px; font-size: .82rem; }
.asst-arrow { opacity: .55; font-size: .8rem; }
#asstSpeak { background: none; border: 1px solid rgba(255,255,255,.28);
             border-radius: 6px; cursor: pointer; font-size: .95rem;
             padding: .12rem .34rem; line-height: 1.2; color: inherit; }
#asstSpeak.on { background: rgba(255,255,255,.18); border-color: transparent; }

/* Icons are inline SVG drawn in the current text colour. */
.asst-launcher .asst-ic { width: 24px; height: 24px; display: grid; place-items: center; }
.asst-launcher .asst-ic svg { width: 22px; height: 22px; display: block; }
.asst-head button svg, .asst-arrow svg { width: 16px; height: 16px; display: block; }
.asst-head button { display: grid; place-items: center; }
.asst-arrow { display: grid; place-items: center; }
.asst-input button svg { width: 18px; height: 18px; display: block; }
#asstMic { color: #1d2a1d; }
#asstMic.live { color: #c0392b; }

/* The microphone picker: a setting, so it sits in its own bar under the
   header rather than as chips in the conversation. Hidden unless there is
   more than one input to choose between. */
.asst-micbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: #f4f8f4;
  border-bottom: 1px solid var(--line, #e4ece4);
}
.asst-micbar[hidden] { display: none; }
.asst-micbar-ic { display: grid; place-items: center; color: #2d6a2d; }
.asst-micbar-ic svg { width: 14px; height: 14px; display: block; }
.asst-micbar label {
  font: 600 11.5px "DM Sans", system-ui, sans-serif;
  color: #24402a;
}
.asst-micbar select {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line, #d7e3d7);
  border-radius: 7px;
  background: #fff;
  padding: 5px 7px;
  font: 500 11.5px "DM Sans", system-ui, sans-serif;
  color: #24402a;
}
