/* Gabriel vanilla widget — scoped under .gw-root so it can't leak into host page */
.gw-root, .gw-root *, .gw-root *::before, .gw-root *::after {
  box-sizing: border-box;
}
.gw-root {
  --gw-crimson: #8B1818;
  --gw-crimson-dark: #6B1212;
  --gw-crimson-light: #A52020;
  --gw-gold: #C9A227;
  --gw-gold-light: #E8C547;
  --gw-deep: #1A1A2E;
  --gw-white: #FFFFFF;
  --gw-gray-100: #F4F4F5;
  --gw-gray-200: #E4E4E7;
  --gw-gray-400: #71717A;
  --gw-shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --gw-shadow-lg: 0 12px 32px rgba(20,20,40,0.18), 0 4px 12px rgba(20,20,40,0.10);
  --gw-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gw-font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-family: var(--gw-font-body);
  color: var(--gw-deep);
  line-height: 1.5;
}

@keyframes gwFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gwPulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,24,24,0.55), var(--gw-shadow-lg); }
  50% { box-shadow: 0 0 0 14px rgba(139,24,24,0); var(--gw-shadow-lg); }
}
@keyframes gwTypingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }

.gw-launcher {
  position: fixed; left: 20px; bottom: 20px; z-index: 2147483646;
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--gw-crimson), var(--gw-crimson-dark));
  color: white; font-size: 28px; box-shadow: var(--gw-shadow-lg);
  animation: gwPulseGlow 2.6s infinite; font-family: var(--gw-font-display);
  display: flex; align-items: center; justify-content: center;
}
.gw-launcher:hover { transform: scale(1.05); }

.gw-panel {
  position: fixed; left: 16px; bottom: 16px; z-index: 2147483647;
  width: min(400px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 32px));
  background: var(--gw-white); border-radius: 16px;
  box-shadow: var(--gw-shadow-lg); display: flex; flex-direction: column;
  overflow: hidden; animation: gwFadeUp 0.25s ease-out;
  border: 1px solid var(--gw-gray-200);
}

.gw-header {
  background: linear-gradient(135deg, var(--gw-crimson) 0%, var(--gw-crimson-dark) 100%);
  padding: 14px 16px; position: relative; overflow: hidden;
}
.gw-header-cross {
  position: absolute; top: -20px; right: -20px;
  font-size: 80px; opacity: 0.08; color: white; user-select: none; line-height: 1;
}
.gw-header-row { display: flex; align-items: center; gap: 12px; position: relative; }
.gw-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gw-gold), var(--gw-gold-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.3); color: white;
}
.gw-title { flex: 1; min-width: 0; }
.gw-title-name {
  font-family: var(--gw-font-display); font-size: 15px; font-weight: 700;
  color: white; letter-spacing: 0.3px;
}
.gw-title-status { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.gw-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 6px #4ADE80; display: inline-block; }
.gw-status-text { font-size: 11px; color: rgba(255,255,255,0.8); }
.gw-header-actions { display: flex; gap: 4px; position: relative; }

.gw-icon-btn {
  background: rgba(255,255,255,0.12); border: none; color: white; cursor: pointer;
  width: 30px; height: 30px; border-radius: 6px; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.gw-icon-btn:hover { background: rgba(255,255,255,0.22); }
.gw-lang-btn {
  background: rgba(255,255,255,0.12); border: none; color: white; cursor: pointer;
  padding: 0 10px; height: 30px; border-radius: 6px; font-size: 11px; font-weight: 600;
}
.gw-lang-btn:hover { background: rgba(255,255,255,0.22); }
.gw-lang-menu {
  position: absolute; top: 36px; right: 0; background: white; border-radius: 8px;
  box-shadow: var(--gw-shadow-lg); padding: 4px; min-width: 160px;
  border: 1px solid var(--gw-gray-200); z-index: 10;
}
.gw-lang-item {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border: none;
  background: transparent; cursor: pointer; font-size: 13px; border-radius: 4px;
  color: var(--gw-deep);
}
.gw-lang-item:hover { background: var(--gw-gray-100); }
.gw-lang-item.active { background: var(--gw-gray-100); color: var(--gw-crimson); font-weight: 600; }

.gw-body {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px; background: #FAFAF8;
}
.gw-body::-webkit-scrollbar { width: 6px; }
.gw-body::-webkit-scrollbar-thumb { background: var(--gw-gray-200); border-radius: 3px; }

.gw-welcome {
  background: linear-gradient(135deg, var(--gw-crimson), var(--gw-crimson-dark));
  border-radius: 12px; padding: 14px 16px; color: white;
  animation: gwFadeUp 0.3s ease-out;
}
.gw-welcome-row { display: flex; gap: 10px; align-items: flex-start; }
.gw-welcome-icon { font-size: 28px; }
.gw-welcome-title { font-family: var(--gw-font-display); font-size: 15px; margin: 0 0 4px; font-weight: 600; }
.gw-welcome-body { font-size: 12px; opacity: 0.88; line-height: 1.5; margin: 0; }

.gw-onboarding {
  background: white; border-radius: 12px; padding: 14px;
  border: 1px solid var(--gw-gray-200);
}
.gw-onb-title { font-family: var(--gw-font-display); font-size: 14px; font-weight: 600; color: var(--gw-deep); margin: 0 0 4px; }
.gw-onb-sub { font-size: 12px; color: var(--gw-gray-400); margin: 0 0 12px; }
.gw-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gw-quick-btn {
  padding: 9px 10px; font-size: 11.5px; border-radius: 8px;
  background: white; border: 1px solid var(--gw-gray-200); color: var(--gw-deep);
  cursor: pointer; text-align: left; line-height: 1.3; font-family: inherit;
  transition: all 0.15s;
}
.gw-quick-btn:hover { border-color: var(--gw-crimson); color: var(--gw-crimson); }
.gw-onb-actions { display: flex; gap: 8px; margin-top: 10px; }
.gw-onb-prayer, .gw-onb-lead {
  flex: 1; padding: 9px 10px; font-size: 11.5px; border-radius: 8px;
  border: none; cursor: pointer; color: white; font-family: inherit; font-weight: 500;
}
.gw-onb-prayer { background: var(--gw-crimson); }
.gw-onb-lead { background: var(--gw-gold); }

.gw-msg-row { display: flex; animation: gwFadeUp 0.2s ease-out; }
.gw-msg-row.user { justify-content: flex-end; }
.gw-msg-row.assistant { justify-content: flex-start; }
.gw-msg {
  max-width: 85%; padding: 10px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word;
}
.gw-msg.user {
  background: linear-gradient(135deg, var(--gw-crimson), var(--gw-crimson-light));
  color: white; border-bottom-right-radius: 4px;
}
.gw-msg.assistant {
  background: white; color: var(--gw-deep);
  border: 1px solid var(--gw-gray-200); border-bottom-left-radius: 4px;
  box-shadow: var(--gw-shadow-sm);
}

.gw-typing { display: flex; gap: 4px; padding: 6px 10px; }
.gw-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gw-crimson); display: inline-block;
  animation: gwTypingBounce 1s infinite;
}
.gw-typing span:nth-child(2) { animation-delay: 0.15s; }
.gw-typing span:nth-child(3) { animation-delay: 0.3s; }

.gw-sentiment {
  background: #FEF3C7; border: 1px solid #F59E0B;
  border-radius: 10px; padding: 12px;
}
.gw-sentiment-title { font-size: 13px; font-weight: 600; color: #92400E; margin: 0 0 4px; }
.gw-sentiment-body { font-size: 12px; color: #78350F; margin: 0 0 8px; }
.gw-sentiment-actions { display: flex; gap: 6px; }
.gw-sentiment-cta {
  background: var(--gw-crimson); color: white; border: none;
  padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.gw-sentiment-dismiss {
  background: transparent; color: #78350F;
  border: 1px solid #D97706; padding: 6px 12px;
  border-radius: 6px; font-size: 12px; cursor: pointer;
}

.gw-input-wrap {
  padding: 10px 12px; border-top: 1px solid var(--gw-gray-200); background: white;
}
.gw-input-row {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--gw-gray-100); border-radius: 20px; padding: 6px 8px 6px 14px;
}
.gw-input {
  flex: 1; background: transparent; border: none; outline: none; resize: none;
  font-family: var(--gw-font-body); font-size: 14px; color: var(--gw-deep);
  line-height: 1.5; max-height: 120px; padding: 6px 0;
}
.gw-voice-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--gw-gray-200); color: var(--gw-deep); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.gw-voice-btn.active { background: var(--gw-crimson); color: white; }
.gw-send-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--gw-crimson), var(--gw-crimson-light));
  color: white; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.gw-send-btn:disabled { background: var(--gw-gray-200); cursor: not-allowed; }
.gw-footer { font-size: 10px; color: var(--gw-gray-400); text-align: center; margin: 6px 0 0; }

/* Forms (prayer / lead) */
.gw-form { flex: 1; overflow-y: auto; padding: 16px; background: #FAFAF8; }
.gw-form-back {
  background: transparent; border: none; color: var(--gw-crimson); cursor: pointer;
  font-size: 12px; padding: 0; margin-bottom: 8px; font-family: inherit;
}
.gw-form-title { font-family: var(--gw-font-display); font-size: 18px; color: var(--gw-deep); margin: 0 0 4px; font-weight: 600; }
.gw-form-intro { font-size: 12.5px; color: var(--gw-gray-400); margin: 0 0 14px; }
.gw-field { margin-bottom: 10px; }
.gw-label { display: block; font-size: 11px; font-weight: 600; color: var(--gw-gray-400); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.gw-input-field, .gw-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--gw-gray-200);
  border-radius: 8px; font-size: 13.5px; background: white; color: var(--gw-deep);
  font-family: inherit; outline: none;
}
.gw-input-field:focus, .gw-textarea:focus { border-color: var(--gw-crimson); }
.gw-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.gw-checkbox-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.gw-checkbox-row input { accent-color: var(--gw-crimson); }
.gw-checkbox-row label { font-size: 12.5px; color: var(--gw-deep); }
.gw-submit-btn {
  width: 100%; padding: 11px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--gw-crimson), var(--gw-crimson-light));
  color: white; cursor: pointer; font-size: 14px; font-weight: 600; font-family: inherit;
  margin-top: 8px;
}
.gw-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.gw-success {
  background: #D1FAE5; border: 1px solid #10B981; color: #065F46;
  padding: 12px; border-radius: 8px; font-size: 13px; margin-top: 12px;
}
.gw-error {
  background: #FEE2E2; border: 1px solid #EF4444; color: #991B1B;
  padding: 10px; border-radius: 8px; font-size: 12.5px; margin-top: 10px;
}
