/* ==========================================================
   Agrotsombela — Design System do Assistente Virtual IA
   ========================================================== */

/* Botão Flutuante (Floating Launcher) */
.chat-launcher {
  position: fixed;
  z-index: 85;
  right: 28px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  border: 1px solid rgba(201, 217, 106, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(18, 69, 43, 0.96), rgba(29, 96, 61, 0.92));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease, opacity 0.25s ease;
  user-select: none;
}

.chat-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: none;
  border-color: var(--lime);
}

.chat-launcher:active {
  transform: translateY(0) scale(0.98);
}

.chat-launcher-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #c9d96a, #8ba834);
  color: #123821;
  box-shadow: none;
}

.chat-launcher-avatar .line-icon {
  width: 22px;
  height: 22px;
}

.chat-launcher-status {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #34d399;
  border: 2px solid #144e30;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-dot 2.5s infinite;
}

.chat-launcher-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.chat-launcher-text strong {
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 750;
  color: #fff;
  letter-spacing: 0.01em;
}

.chat-launcher-text small {
  font-size: 11px;
  color: var(--lime);
  font-weight: 500;
}

/* Quando o drawer estiver aberto, o launcher recolhe suavemente */
body.chat-open .chat-launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
}

/* Overlay com desfoque de fundo */
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(4, 16, 9, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.chat-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Gaveta do Assistente (Drawer) */
.chat-drawer {
  position: fixed;
  z-index: 96;
  inset: 0 0 0 auto;
  width: min(440px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  box-shadow: -18px 0 70px rgba(5, 20, 11, 0.38);
  transform: translateX(105%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
  visibility: hidden;
  border-left: 1px solid var(--line);
}

.chat-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

/* Cabeçalho do Chat */
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(135deg, #103c24 0%, #1a5635 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 84px;
}

.chat-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.chat-brand-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(201, 217, 106, 0.4);
  color: var(--lime);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.chat-brand-avatar .line-icon {
  width: 22px;
  height: 22px;
}

.chat-status-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34d399;
  border: 2.5px solid #103c24;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-dot 2.5s infinite;
}

.chat-brand-info {
  display: flex;
  flex-direction: column;
}

.chat-brand-info strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  color: #fff;
}

.chat-brand-info small {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #c4d9bc;
  margin-top: 3px;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-btn-action {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.chat-btn-action:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.chat-btn-action:active {
  transform: scale(0.95);
}

.chat-btn-action .line-icon {
  width: 17px;
  height: 17px;
}

/* Área de Mensagens */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

/* Balão de Mensagem */
.chat-message-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 92%;
  animation: message-slide-up 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-message-row.user-row {
  align-self: flex-end;
  justify-content: flex-end;
  max-width: 86%;
}

.chat-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-message-row.assistant-row .chat-msg-avatar {
  background: var(--green);
  color: var(--lime);
  box-shadow: 0 2px 8px rgba(29, 96, 61, 0.2);
}

.chat-msg-avatar .line-icon {
  width: 16px;
  height: 16px;
}

.chat-bubble {
  padding: 11px 15px;
  border-radius: 18px;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  word-break: break-word;
  white-space: normal;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-message-row.assistant-row .chat-bubble {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
}

.chat-message-row.user-row .chat-bubble {
  background: linear-gradient(135deg, var(--green) 0%, #154c2f 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(20, 68, 43, 0.22);
}

.chat-bubble p {
  margin: 0 0 8px;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble ul, .chat-bubble ol {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.chat-bubble li {
  margin: 4px 0;
}

.chat-time {
  display: block;
  font-size: 10.5px;
  margin-top: 5px;
  opacity: 0.68;
}

.chat-message-row.user-row .chat-time {
  text-align: right;
  color: #e5f0e1;
}

.chat-message-row.assistant-row .chat-time {
  color: var(--muted);
}

/* Balão de Erro */
.chat-message-row.error-row .chat-bubble {
  background: #fdf2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

body.dark .chat-message-row.error-row .chat-bubble {
  background: #2a1215;
  color: #fca5a5;
  border-color: #7f1d1d;
}

/* Indicador de Digitação (Typing Dots) */
.chat-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 13px 18px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 18px;
  border-top-left-radius: 4px;
}

.chat-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.4;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.chat-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-6px);
    opacity: 1;
    background: var(--lime);
  }
}

/* Sugestões Rápidas (Quick Prompts) */
.chat-suggestions-wrap {
  padding: 8px 16px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.chat-suggestions-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}

.chat-suggestions-title .line-icon {
  width: 14px;
  height: 14px;
  color: var(--green);
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chat-suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 999px;
  color: var(--text);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.chat-suggestion-chip:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(29, 96, 61, 0.18);
}

.chat-suggestion-chip .line-icon {
  width: 14px;
  height: 14px;
  color: var(--green);
  transition: color 0.2s ease;
}

.chat-suggestion-chip:hover .line-icon {
  color: var(--lime);
}

/* Formulário de Envio */
.chat-form-container {
  padding: 10px 16px 14px;
  background: var(--panel);
}

.chat-form {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: var(--bg);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-form:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 96, 61, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.chat-form textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  min-height: 38px;
  height: 38px;
  margin: 0;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  box-sizing: border-box;
}

.chat-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green) 0%, #134d2f 100%);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(29, 96, 61, 0.28);
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.06);
  background: linear-gradient(135deg, #24754a 0%, #195b38 100%);
}

.chat-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chat-send-btn .line-icon {
  width: 17px;
  height: 17px;
}

.chat-note {
  margin: 6px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.chat-note .line-icon {
  width: 13px;
  height: 13px;
  color: var(--green);
}

/* Animações */
@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes message-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsividade */
@media (max-width: 600px) {
  .chat-launcher {
    right: 18px;
    bottom: 18px;
    padding: 5px;
  }
  .chat-launcher-text {
    display: none;
  }
  .chat-drawer {
    width: 100vw;
    border-left: 0;
  }
  .chat-head {
    padding: 14px 16px;
    min-height: 70px;
  }
  .chat-brand-avatar {
    width: 38px;
    height: 38px;
  }
  .chat-messages {
    padding: 16px 14px;
    gap: 13px;
  }
  .chat-form-container {
    padding: 8px 12px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-drawer,
  .chat-overlay,
  .chat-launcher,
  .chat-message-row,
  .chat-typing-dot {
    transition: none !important;
    animation: none !important;
  }
}

/* AgrOne — posicionamento e acabamento da interface. */
.chat-launcher{left:28px;right:auto;padding:7px 18px 7px 7px;background:linear-gradient(135deg,#0e3420,#1d603d);border-color:rgba(201,217,106,.58);box-shadow:none}.chat-launcher-avatar{width:46px;height:46px;background:var(--lime);color:#12452b}.chat-launcher-text strong{font-size:14px;letter-spacing:.02em}.chat-launcher-text small{color:#e0ebac}.chat-drawer{inset:0 auto 0 0;transform:translateX(-105%);border-left:0;border-right:1px solid var(--line);box-shadow:18px 0 70px rgba(5,20,11,.38)}.chat-drawer.open{transform:translateX(0)}.chat-drawer .chat-head{position:relative;top:auto;right:auto;bottom:auto;left:auto;z-index:1;min-height:98px;padding:21px 22px;background:radial-gradient(circle at 8% 0,rgba(201,217,106,.2),transparent 38%),linear-gradient(135deg,#0b2c1a,#195737)}.chat-brand-avatar{width:48px;height:48px;border-radius:16px;background:var(--lime);color:#12452b}.chat-brand-info strong{font-size:18px;letter-spacing:.01em}.chat-head,.chat-suggestions-wrap,.chat-form-container{flex:none}.chat-messages{min-height:0;background:linear-gradient(180deg,var(--panel),var(--bg));padding:25px 20px}.chat-suggestions-wrap{padding:12px 16px 14px;background:var(--panel);border-top:1px solid var(--line)}.chat-suggestion-chip{padding:8px 13px}.chat-form-container{padding:12px 16px 16px;background:var(--panel)}.chat-form{border-radius:20px;background:var(--bg)}.chat-form .sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.chat-typing-bubble{gap:8px}.chat-typing-copy{margin-left:4px;color:var(--muted);font-size:12px;font-weight:700}.chat-typing-scan{display:inline-flex;align-items:center;gap:5px}.chat-typing-scan i{width:6px;height:6px;border-radius:50%;background:var(--lime);animation:agrone-scan 1.1s infinite ease-in-out}.chat-typing-scan i:nth-child(2){animation-delay:.15s}.chat-typing-scan i:nth-child(3){animation-delay:.3s}@keyframes agrone-scan{0%,100%{transform:scale(.55);opacity:.35}50%{transform:scale(1);opacity:1}}body.dark .chat-messages{background:linear-gradient(180deg,#102b1b,#0b2115)}body.dark .chat-form{background:#0a2114}body.dark .chat-suggestion-chip{background:#163824;border-color:rgba(220,237,217,.15)}@media(max-width:600px){.chat-launcher{left:18px;right:auto}.chat-drawer{inset:0;width:100vw;border-right:0}.chat-drawer .chat-head{min-height:82px;padding:16px}.chat-messages{padding:18px 14px}.chat-bubble{font-size:14px;line-height:1.55}.chat-suggestions-wrap{padding:12px 14px}.chat-form-container{padding:10px 12px 13px}}
.chat-suggestions-wrap{display:none}.chat-form{display:grid;grid-template-columns:34px minmax(0,1fr) 50px;grid-template-rows:auto minmax(42px,1fr) auto;gap:5px 8px;min-height:98px;align-items:center;padding:11px 13px;border:2px solid var(--green);border-radius:20px;box-shadow:0 6px 18px rgba(20,83,51,.12)}.chat-form:focus-within{border-color:#23784d;box-shadow:0 0 0 3px rgba(29,96,61,.14)}.chat-form textarea{grid-column:1/3;grid-row:2;align-self:stretch;min-width:0;min-height:44px;height:44px;padding:7px 4px;font-size:14px}.chat-attachment{grid-column:1;grid-row:3;width:28px;height:32px;display:grid;place-items:center;padding:0;border:0;background:transparent;color:var(--green);cursor:pointer}.chat-attachment .line-icon{width:18px;height:18px}.chat-skill-control{grid-column:2;grid-row:3;position:relative;justify-self:start}.chat-skill-trigger{display:inline-flex;align-items:center;gap:6px;min-height:33px;padding:7px 10px;border:0;border-radius:999px;background:var(--panel2);color:var(--text);font:700 12px var(--sans);cursor:pointer}.chat-skill-trigger .line-icon{width:14px;height:14px;color:var(--green)}.chat-skill-trigger b{display:none;color:var(--green);font:800 10px var(--sans)}.chat-skill-active{grid-column:1/3;grid-row:1;display:inline-flex;align-items:center;justify-self:start;gap:5px;min-height:28px;padding:5px 8px;border:1px solid rgba(29,96,61,.28);border-radius:999px;background:var(--panel2);color:var(--green);font:800 11px var(--sans)}.chat-skill-active[hidden]{display:none!important}.chat-skill-active .line-icon{width:13px;height:13px}.chat-skill-active button{width:19px;height:19px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--green);font:700 16px/1 var(--sans);cursor:pointer}.chat-skill-active button:hover{background:var(--green);color:var(--lime)}.chat-skill-menu{position:absolute;z-index:4;bottom:calc(100% + 9px);left:0;width:232px;max-height:360px;overflow:auto;padding:8px;border:1px solid var(--line);border-radius:14px;background:var(--panel);box-shadow:0 18px 38px rgba(7,29,17,.2)}.chat-skill-menu[hidden]{display:none}.chat-skill-menu p{margin:7px 9px 5px;color:var(--muted);font:800 10px var(--display);letter-spacing:.07em;text-transform:uppercase}.chat-skill-menu .chat-skill-prompts-title{margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}.chat-skill-menu button{display:block;width:100%;padding:9px 10px;border:0;border-radius:9px;background:transparent;color:var(--text);font:700 12px var(--sans);text-align:left;cursor:pointer}.chat-skill-menu button:hover{background:var(--panel2);color:var(--green)}.chat-send-btn{grid-column:3;grid-row:1/4;width:48px;height:48px;background:linear-gradient(135deg,#24744a,#145333);box-shadow:0 6px 15px rgba(20,83,51,.3)}.chat-send-btn:hover:not(:disabled){background:linear-gradient(135deg,#c9d96a,#a9c54c);color:#12452b;transform:scale(1.07)}body.dark .chat-form{border-color:#78af79;background:#12251a}body.dark .chat-skill-trigger,body.dark .chat-skill-active{background:#203727;color:var(--lime)}body.dark .chat-skill-menu{background:#143120;border-color:rgba(220,237,217,.18)}@media(max-width:600px){.chat-form{min-height:88px;padding:10px;grid-template-columns:28px minmax(0,1fr) 46px}.chat-form textarea{min-height:39px;height:39px}.chat-skill-trigger{padding:7px 9px}.chat-skill-trigger span{display:none}.chat-skill-trigger b{display:inline}.chat-send-btn{width:44px;height:44px}}
.chat-brand-link{color:var(--green);font-weight:800;text-decoration:none}.assistant-row .chat-brand-link:hover{color:#2e8052}.assistant-row .chat-brand-link:focus-visible{outline:2px solid var(--lime);outline-offset:2px;border-radius:3px}body.dark .assistant-row .chat-brand-link{color:var(--lime)}.user-row .chat-brand-link{color:#fff}.chat-inline-link{color:var(--green);font-weight:700;text-decoration:underline;text-underline-offset:3px;transition:color .2s ease}.chat-inline-link:hover{color:#145333}body.dark .chat-inline-link{color:var(--lime)}.chat-bubble ul{margin:8px 0 8px 18px;padding:0;display:flex;flex-direction:column;gap:5px}.chat-bubble li{line-height:1.55}.chat-message-context{display:inline-flex;align-items:center;gap:5px;margin-bottom:8px;color:var(--green);font:800 10px/1 var(--display);letter-spacing:.07em;text-transform:uppercase}.chat-message-context .line-icon{width:14px;height:14px}body.dark .chat-message-context{color:var(--lime)}.chat-typing-row .chat-typing-bubble{min-height:46px;padding:12px 16px;background:var(--panel2)}.chat-typing-scan i{width:8px;height:8px;box-shadow:0 0 10px rgba(201,217,106,.45)}

/* Em telemóveis o lançador apresenta apenas o ícone, em formato circular. */
@media(max-width:600px){.chat-launcher{left:18px;right:auto;width:58px;height:58px;padding:5px;border-radius:50%;justify-content:center}.chat-launcher-avatar{width:46px;height:46px}}

/* ==========================================================================
   MENSAGEM FIXA DE BOAS-VINDAS (AGRONE) — DESIGN SYSTEM DE ALTO NÍVEL
   Paddings top e bottom calibrados, insígnia refinada e contraste impecável
   ========================================================================== */
.chat-welcome-row {
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 2px;
}

.chat-welcome-row .chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1c5e3a 0%, #113b23 100%);
  color: var(--lime, #c9d96a);
  border: 1px solid rgba(201, 217, 106, 0.38);
  box-shadow: 0 3px 10px rgba(18, 55, 34, 0.22);
  margin-top: 2px;
}

.chat-welcome-row .chat-msg-avatar .line-icon {
  width: 18px;
  height: 18px;
}

.chat-welcome-row .chat-bubble {
  padding: 12px 16px 11px;
  border-radius: 20px;
  border-top-left-radius: 5px;
  background: var(--panel2, #edf1e7);
  border: 1px solid var(--line, rgba(24, 51, 38, 0.12));
  box-shadow: 0 3px 12px rgba(18, 55, 34, 0.05);
}

body.light .chat-welcome-row .chat-bubble {
  background: #f4f8f0;
  border-color: rgba(29, 96, 61, 0.16);
  box-shadow: 0 3px 12px rgba(18, 55, 34, 0.05);
}

body.dark .chat-welcome-row .chat-bubble {
  background: #132d1e;
  border-color: rgba(201, 217, 106, 0.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.26);
}

.chat-welcome-row .chat-message-context {
  display: inline-flex;
  align-items: center;
  gap: 5.5px;
  margin: 0 0 8px;
  padding: 3.5px 9px 3.5px 7px;
  border-radius: 9999px;
  font: 800 10.5px/1.2 var(--display, Georgia, serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(29, 96, 61, 0.09);
  border: 1px solid rgba(29, 96, 61, 0.18);
  color: var(--green, #1d603d);
}

.chat-welcome-row .chat-message-context .line-icon {
  width: 13px;
  height: 13px;
  color: var(--green, #1d603d);
}

body.dark .chat-welcome-row .chat-message-context {
  background: rgba(201, 217, 106, 0.14);
  border-color: rgba(201, 217, 106, 0.28);
  color: var(--lime, #c9d96a);
}

body.dark .chat-welcome-row .chat-message-context .line-icon {
  color: var(--lime, #c9d96a);
}

.chat-welcome-row .chat-bubble p {
  margin: 0 0 6px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}

.chat-welcome-row .chat-bubble p strong,
.chat-welcome-row .chat-bubble p .chat-brand-name {
  color: var(--green, #1d603d);
  font-weight: 750;
}

body.dark .chat-welcome-row .chat-bubble p strong,
body.dark .chat-welcome-row .chat-bubble p .chat-brand-name {
  color: var(--lime, #c9d96a);
}

.chat-welcome-row .chat-time {
  display: block;
  font-size: 11px;
  line-height: 1;
  margin: 4px 0 0;
  color: var(--muted);
  opacity: 0.75;
  font-weight: 500;
}

/* ==========================================================================
   SELETOR DE MENSAGENS RÁPIDAS (SOB A MENSAGEM DE ABERTURA DO AGRONE)
   Bordas a 100% (cápsula / full-pill), padding refinado e feedback suave
   ========================================================================== */
.chat-quick-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 8px 0 16px 45px;
  animation: message-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8.5px;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: 9999px !important; /* 100% pill shape solicitado pelo utilizador */
  border: 1.5px solid rgba(201, 217, 106, 0.35);
  background: rgba(18, 55, 34, 0.72);
  color: #eaf3e5;
  font-family: var(--sans, inherit);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease,
              color 0.2s ease;
  user-select: none;
}

.chat-quick-btn .line-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--lime, #c9d96a);
  transition: transform 0.2s ease;
}

.chat-quick-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-quick-btn:hover {
  transform: translateY(-2px);
  background: rgba(201, 217, 106, 0.22);
  border-color: var(--lime, #c9d96a);
  color: var(--lime, #c9d96a);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.chat-quick-btn:hover .line-icon {
  transform: scale(1.14);
}

.chat-quick-btn:active {
  transform: translateY(0);
}

/* Modo Claro: Alto contraste, fundo níveo e bordas 100% arredondadas */
body.light .chat-quick-btn {
  background: #ffffff;
  border-color: rgba(29, 96, 61, 0.24);
  color: #173e29;
  box-shadow: 0 2px 8px rgba(18, 55, 34, 0.05);
}

body.light .chat-quick-btn .line-icon {
  color: var(--green, #1d603d);
}

body.light .chat-quick-btn:hover {
  background: #edf5ea;
  border-color: var(--green, #1d603d);
  color: var(--green, #1d603d);
  box-shadow: 0 4px 14px rgba(29, 96, 61, 0.14);
}

@media (max-width: 480px) {
  .chat-quick-selector {
    grid-template-columns: 1fr 1fr;
    margin-left: 0;
    gap: 6px;
  }
  .chat-quick-btn {
    padding: 8px 12px;
    font-size: 11.5px;
    min-height: 36px;
    border-radius: 9999px !important;
  }
}

/* Respostas do AgrOne: hierarquia, listas e links de acção. */
.assistant-row .chat-bubble p { margin: 0 0 11px; line-height: 1.65; }
.assistant-row .chat-bubble p:last-child { margin-bottom: 0; }
.assistant-row .chat-bubble h4 {
  margin: 14px 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--green);
  color: var(--text);
  font: 800 14px/1.4 var(--display, inherit);
}
.assistant-row .chat-bubble h4:first-child { margin-top: 0; }
.assistant-row .chat-bubble strong { color: var(--green); font-weight: 800; }
body.dark .assistant-row .chat-bubble strong { color: var(--lime); }
.chat-message-source {
  margin-left: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #d8e5d6;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: none;
}
body.light .chat-message-source { border-color: rgba(29, 96, 61, 0.16); background: #edf4e8; color: #42604c; }
.assistant-row .chat-bubble code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.06);
  font: 0.92em/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.assistant-row .chat-bubble .chat-response-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 13px;
  padding: 0;
  list-style: none;
}
.assistant-row .chat-bubble .chat-response-list li {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 9px 11px 9px 31px;
  border: 1px solid rgba(29, 96, 61, 0.1);
  border-left: 3px solid rgba(29, 96, 61, 0.5);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.52);
  line-height: 1.5;
}
.assistant-row .chat-bubble ul.chat-response-list li::before {
  content: "›";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--green);
  font-size: 20px;
  font-weight: 800;
}
.assistant-row .chat-bubble ol.chat-response-list { counter-reset: agrone-step; }
.assistant-row .chat-bubble ol.chat-response-list li { counter-increment: agrone-step; padding-left: 39px; }
.assistant-row .chat-bubble ol.chat-response-list li::before {
  content: counter(agrone-step, decimal-leading-zero);
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green);
  font: 800 10px/1 var(--display, inherit);
}
body.dark .assistant-row .chat-bubble .chat-response-list li {
  border-color: rgba(201, 217, 106, 0.14);
  border-left-color: rgba(201, 217, 106, 0.65);
  background: rgba(255, 255, 255, 0.035);
}
body.dark .assistant-row .chat-bubble ul.chat-response-list li::before,
body.dark .assistant-row .chat-bubble ol.chat-response-list li::before { color: var(--lime); }

.assistant-row .chat-bubble a.chat-action-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  margin: 2px 3px 2px 0;
  padding: 4px 10px;
  border: 1px solid rgba(29, 96, 61, 0.2);
  border-radius: 999px;
  background: rgba(29, 96, 61, 0.08);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  vertical-align: middle;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.assistant-row .chat-bubble a.chat-action-link span { color: var(--gold); transition: transform .18s ease; }
.assistant-row .chat-bubble a.chat-action-link:hover {
  transform: translateY(-1px);
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 5px 13px rgba(20, 83, 51, .18);
}
.assistant-row .chat-bubble a.chat-action-link:hover span { color: var(--lime); transform: translateX(2px); }
.assistant-row .chat-bubble a.chat-action-link:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
body.dark .assistant-row .chat-bubble a.chat-action-link { border-color: rgba(201, 217, 106, .24); background: rgba(201, 217, 106, .1); color: var(--lime); }
body.dark .assistant-row .chat-bubble a.chat-action-link:hover { background: var(--lime); color: #123821; }
body.dark .assistant-row .chat-bubble a.chat-action-link:hover span { color: #123821; }

@media(max-width:600px) {
  .assistant-row .chat-bubble .chat-response-list li { padding-top: 8px; padding-bottom: 8px; }
  .assistant-row .chat-bubble a.chat-action-link { white-space: normal; }
}
