
  .ai-search-bubble {
	border: none;
	border-radius: .5em;
	background-color: #ffffff;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
	margin-top: 1rem;
	margin-bottom:1rem;
	display: flex;
	flex-direction: column;
	max-height: 650px;
	overflow: hidden;
	transition: box-shadow 0.3s ease;
  }

  .ai-search-bubble:hover {
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .ai-search-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding:.5rem 1.5rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	background: linear-gradient(135deg, #0896a3 0%, #0ba8b8 50%, #089fb1 100%);
	position: relative;
	overflow: hidden;
  }

  .ai-search-header::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -10%;
	width: 200px;
	height: 200px;
	background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
	border-radius: 50%;
  }

  .ai-search-header h3 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
	color: white;
	display: flex;
	align-items: center;
	gap: 10px;
	letter-spacing: 0.3px;
	position: relative;
	z-index: 1;
  }

  .ai-search-header img {
	width: 30px;
	height: 30px;
	filter: brightness(0) invert(1);
  }

  .ai-search-close {
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: white;
	cursor: pointer;
	padding: 8px;
	margin: 0;
	font-size: 1.2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	transition: all 0.2s ease;
	width: 36px;
	height: 36px;
	position: relative;
	z-index: 1;
  }

  .ai-search-close:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: scale(1.05);
  }

  .ai-search-close:active {
	transform: scale(0.95);
  }

  .ai-search-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	min-height: 200px;
	max-height: 450px;
	background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
	scrollbar-width: thin;
	scrollbar-color: rgba(8, 150, 163, 0.3) transparent;
  }

  .ai-search-body::-webkit-scrollbar { width: 6px; }
  .ai-search-body::-webkit-scrollbar-track { background: transparent; }
  .ai-search-body::-webkit-scrollbar-thumb { background: rgba(8, 150, 163, 0.3); border-radius: 10px; }
  .ai-search-body::-webkit-scrollbar-thumb:hover { background: rgba(8, 150, 163, 0.5); }

  .ai-search-footer {
	display: flex;
	gap: 10px;
	padding: 16px 20px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	background-color: #ffffff;
	border-radius: 0 0 16px 16px;
  }

  .ai-search-input {
	flex: 1;
	padding: 12px 16px;
	border: 2px solid #e8e8e8;
	border-radius: 12px;
	font-size: 0.95rem;
	font-family: inherit;
	background-color: #fafafa;
	transition: all 0.3s ease;
	line-height: 1.5;
  }

  .ai-search-input:focus {
	outline: none;
	border-color: #0896a3;
	background-color: #ffffff;
	box-shadow: 0 0 0 4px rgba(8, 150, 163, 0.08);
  }

  .ai-search-input::placeholder { color: #999; }

  .ai-search-send-btn {
	padding: 12px 18px;
	background: linear-gradient(135deg, #0896a3 0%, #067f8d 100%);
	color: white;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	font-weight: 600;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	box-shadow: 0 2px 8px rgba(8, 150, 163, 0.3);
  }

  .ai-search-send-btn:hover {
	background: linear-gradient(135deg, #067f8d 0%, #056873 100%);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(8, 150, 163, 0.4);
  }

  .ai-search-send-btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(8, 150, 163, 0.3); }
  .ai-search-send-btn svg { width: 18px; height: 18px; fill: currentColor; }

  .ai-msg-row {
	display: flex;
	margin-bottom: 16px;
	gap: 12px;
	align-items: flex-start;
	animation: messageSlideIn 0.3s ease;
  }

  @keyframes messageSlideIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
  }

  .ai-msg-row.user { justify-content: flex-end; }
  .ai-msg-row.bot { justify-content: flex-start; }

  .ai-bot-avatar-small {
	width: 36px;
	height: 36px;
	min-width: 36px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #0896a3 0%, #089fb1 100%);
	border-radius: 50%;
	padding: 8px;
	box-shadow: 0 2px 8px rgba(8, 150, 163, 0.2);
  }

  .ai-bot-avatar-small img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0) invert(1); }

  .ai-msg-bubble {
	max-width: 75%;
	padding: 12px 16px;
	border-radius: 16px;
	word-wrap: break-word;
	font-size: 0.95rem;
	line-height: 1.6;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	transition: all 0.2s ease;
  }

  .ai-msg-bubble:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
  .ai-msg-row.user .ai-msg-bubble { background: linear-gradient(135deg, #0896a3 0%, #089fb1 100%); color: white; border-radius: 16px 16px 4px 16px; }
  .ai-msg-row.bot .ai-msg-bubble { background-color: #ffffff; color: #333; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 16px 16px 16px 4px; }
  .ai-msg-bubble a { color: #0896a3; text-decoration: none; font-weight: 500; border-bottom: 1px solid rgba(8, 150, 163, 0.3); transition: all 0.2s ease; }
  .ai-msg-bubble a:hover { border-bottom-color: #0896a3; color: #067f8d; }
  .ai-msg-row.user .ai-msg-bubble a { color: #fff; font-weight: 600; border-bottom-color: rgba(255, 255, 255, 0.5); }
  .ai-msg-row.user .ai-msg-bubble a:hover { border-bottom-color: #fff; }

  .ai-loader { display: flex; gap: 5px; padding: 8px; align-items: center; }
  .ai-loader .ai-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #0896a3 0%, #089fb1 100%); animation: bounce 1.4s infinite ease-in-out; box-shadow: 0 2px 4px rgba(8, 150, 163, 0.3); }
  .ai-loader .ai-dot:nth-child(2) { animation-delay: 0.2s; }
  .ai-loader .ai-dot:nth-child(3) { animation-delay: 0.4s; }

  .ai-loader .ai-status-text {
	margin-left: 8px;
	font-size: 0.82rem;
	color: #0896a3;
	font-weight: 500;
	animation: statusFadeIn 0.4s ease;
	white-space: nowrap;
  }

  @keyframes statusFadeIn {
	from { opacity: 0; transform: translateX(-4px); }
	to { opacity: 1; transform: translateX(0); }
  }

  @keyframes bounce {
	0%, 80%, 100% { opacity: 0.4; transform: translateY(0) scale(0.8); }
	40% { opacity: 1; transform: translateY(-10px) scale(1.1); }
  }

  .ai-options-container { display: flex; flex-direction: column; gap: 10px; width: 100%; }

  .ai-option-btn {
	padding: 14px 16px 14px 20px;
	background-color: #f4fbfc;
	border: 1.5px solid rgba(8, 150, 163, 0.28);
	border-radius: 12px;
	cursor: pointer;
	text-align: left;
	font-size: 0.95rem;
	line-height: 1.5;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	color: #1a5c63;
  }

  .ai-option-btn::before { content: ''; position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: linear-gradient(180deg, #0896a3 0%, #089fb1 100%); transform: scaleY(1); transition: width 0.3s ease, opacity 0.3s ease; opacity: 0.55; border-radius: 12px 0 0 12px; }
  .ai-option-btn:hover:not(.selected) { background-color: #e8f7f9; border-color: rgba(8, 150, 163, 0.6); transform: translateX(4px); box-shadow: 0 4px 14px rgba(8, 150, 163, 0.18); }
  .ai-option-btn:hover:not(.selected)::before { width: 5px; opacity: 1; }
  .ai-option-btn.selected { background: linear-gradient(135deg, #0896a3 0%, #089fb1 100%); color: white; border-color: #0896a3; cursor: default; pointer-events: none; font-weight: 500; box-shadow: 0 4px 12px rgba(8, 150, 163, 0.3); }
  .ai-option-btn.selected::before { display: none; }

  .lh-feedback-box { background: white; border: 1px solid var(--lh-border); padding: .5rem 1rem; display: flex; justify-content: space-between; align-items: center; border-radius: .8rem; font-size: .8rem; color: var(--lh-dark); }
  .lh-feedback-btns { justify-content: space-between; align-items: center; display: flex; flex-direction: row; flex-wrap: nowrap; gap: .8rem; margin-left: .8rem; }
  .lh-feedback-btns button { background: none; border: none; cursor: pointer; width: 25px; height: 25px; padding:0; opacity: 0.6; transition: opacity 0.2s, transform 0.2s; }
  .lh-feedback-btns button.lh-feedback-btn-si {background:url(/img/common/ico_si.svg); background-size:contain; background-repeat:no-repeat; margin-bottom: .4rem;}
  .lh-feedback-btns button.lh-feedback-btn-no {background:url(/img/common/ico_no.svg); background-size:contain; background-repeat:no-repeat; margin-top: .4rem;}
  .lh-feedback-btns button:hover { opacity: 1; transform: scale(1.2); }

  .btn-ai-assistant { 
	background-color: #0896a3;
	color: white;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	transition: background-color 0.2s;
	width:100%;
	}
  .btn-ai-assistant:hover { background-color: #067f8d; color: white; text-decoration: none; }
  .btn-ai-assistant i { font-size: 1rem;}
  .btn-ai-assistant img {filter:brightness(0) invert(1);}

  /* Buscador clásico: misma familia cromática que el asistente, pero estilo
	 "outline" (fondo blanco + borde) para distinguirlo a simple vista del
	 botón de IA (relleno). Icono de lupa = búsqueda clásica por palabra clave. */
  #cercadorTramits .btn-classic-search {
	background-color: #ffffff;
	color: #0896a3;
	border: 2px solid #0896a3;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
	width:100%;
  }
  #cercadorTramits .btn-classic-search:hover,
  #cercadorTramits .btn-classic-search:focus {
	background-color: #e8f7f9;
	color: #067f8d;
	border-color: #067f8d;
	text-decoration: none;
  }


  /* Caixa de cerca i botons del cercador amb alçada doblada */
  #cercadorTramits .form-control,
  #cercadorTramits .btn {
	min-height: 75px;
	font-size: 1.2rem;
  }
  #cercadorTramits .btn img { width:30px; height:30px;}
 
}


  @media (max-width: 768px) {
	.ai-search-bubble {
	  position: fixed !important;
	  top: 0 !important;
	  left: 0 !important;
	  right: 0 !important;
	  bottom: 0 !important;
	  margin: 0 !important;
	  border-radius: 0 !important;
	  max-height: none !important;
	  z-index: 9998;
	  width: 100% !important;
	  height: 100% !important;
	}
	.ai-search-header { border-radius: 0 !important; padding: 14px 16px; }
	.ai-search-header h3 { font-size: 0.95rem; }
	.ai-search-body {
	  padding: 16px;
	  max-height: none !important;
	  flex: 1 !important;
	  min-height: 0 !important;
	}
	.ai-search-footer { border-radius: 0 !important; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
	.ai-msg-bubble { max-width: 85%; font-size: 0.9rem; }
	.ai-bot-avatar-small { width: 32px; height: 32px; min-width: 32px; }
  }

  #bitacolaBtn { display: none; width: 32px; height: 32px; background: white; border: none; border-radius: 50%; color: #0896a3; font-size: 1rem; font-weight: 700; font-family: Georgia, serif; font-style: italic; cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .2s, background .2s; position: relative; z-index: 1; }
  #bitacolaBtn:hover { transform: scale(1.1); background: rgba(255,255,255,.9); }

  #bitacolaPopup { display: none; position: fixed; width: 600px; height: 500px; background: #f1faf0; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.22); z-index: 9999; flex-direction: column; font-size: 13px; }
  #bitacolaPopup.visible { display: flex; }
  #bitacolaPopupHeader { background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%); color: white; padding: 9px 14px; border-radius: 12px 12px 0 0; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 12px; letter-spacing: .3px; }
  #bitacolaPopupBody { padding: 14px 16px; overflow-y: auto; max-height: 600px; line-height: 1.65; color: #1b2e1b; scrollbar-width: thin; scrollbar-color: rgba(46,125,50,.35) transparent; }
  #bitacolaPopupBody::-webkit-scrollbar { width: 5px; }
  #bitacolaPopupBody::-webkit-scrollbar-thumb { background: rgba(46,125,50,.35); border-radius: 10px; }

  .bita-item { border-bottom: 1px solid rgba(46,125,50,.15); }
  .bita-item:last-child { border-bottom: none; }
  .bita-tit { width: 100%; background: none; border: none; padding: 9px 4px 9px 0; font-size: 12.5px; font-weight: 600; color: #1b5e20; cursor: pointer; display: flex; justify-content: flex-start; align-items: center; text-align: left; gap: 8px; line-height: 1.4; }
  .bita-tit:hover { color: #2e7d32; }
  .bita-arrow { font-size: 10px; flex-shrink: 0; transition: transform .2s; color: #388e3c; }
  .bita-tit[aria-expanded="true"] .bita-arrow { transform: rotate(180deg); }
  .bita-txt { font-size: 12px; line-height: 1.65; color: #1b2e1b; padding: 0 4px 10px 4px; }
  .bita-txt[hidden] { display: none; }

  .ai-bitacola-wrapper { position: relative; display: flex; align-items: center; gap: 8px;}

  #lh-launcher, #lh-label-external { display: none !important; }