:root {
  --rc-blue-900: #0a2540;
  --rc-blue-700: #1e4a85;
  --rc-blue-500: #2e6cc7;
  --rc-blue-300: #7fa3da;
  --rc-blue-100: #e8f0fa;
  --rc-white:    #ffffff;
  --rc-bg:       #f7f9fc;
  --rc-grey-100: #eef1f6;
  --rc-grey-400: #98a2b3;
  --rc-grey-700: #475467;
  --rc-grey-900: #1d2939;
  --rc-warn:     #b54708;
  --rc-warn-bg:  #fff6e8;
  --rc-urgent:   #b42318;
  --rc-urgent-bg:#fef3f2;
  --rc-shadow:   0 14px 40px rgba(10, 37, 64, 0.18);
  --rc-shadow-sm:0 4px 12px rgba(10, 37, 64, 0.10);
  --rc-radius:   16px;
  --rc-font:     "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--rc-font);
  color: var(--rc-grey-900);
  background: var(--rc-bg);
}

.rc-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.rc-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--rc-grey-100) 1px, transparent 1px),
    linear-gradient(90deg, var(--rc-grey-100) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .35;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
}
.rc-bg-glow {
  position: absolute; top: -10%; left: 50%; transform: translateX(-50%);
  width: 80vmin; height: 80vmin;
  background: radial-gradient(circle, rgba(46, 108, 199, 0.25), transparent 60%);
  filter: blur(60px);
}

.rc-topbar { padding: 16px 24px; }
.rc-topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.rc-brand-mark { font-family: var(--rc-font); font-weight: 800; font-size: 1.1rem; color: var(--rc-blue-900); text-decoration: none; }
.rc-topbar-brand { text-decoration: none; }
.rc-topbar-meta { display: flex; align-items: center; gap: 8px; }
.rc-kicker { font-size: .78rem; color: var(--rc-grey-700); letter-spacing: .04em; text-transform: uppercase; }
.rc-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--rc-grey-400); }

.rc-hero { padding: 48px 24px 96px; }
.rc-hero-inner { max-width: 1100px; margin: 0 auto; }
.rc-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.rc-eyebrow-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--rc-blue-100); color: var(--rc-blue-900); border-radius: 999px; font-size: .78rem; font-weight: 500; }
.rc-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rc-blue-500); animation: rc-pulse 1.6s ease-in-out infinite; }
@keyframes rc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.rc-title { font-family: var(--rc-font); font-weight: 800; font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: .98; letter-spacing: -.02em; margin: 0 0 24px; color: var(--rc-blue-900); }
.rc-title-line { display: block; }
.rc-title em { font-style: italic; color: var(--rc-blue-500); }

.rc-lede { font-size: 1.1rem; line-height: 1.55; color: var(--rc-grey-900); max-width: 56ch; margin: 0 0 40px; }
.rc-lede strong { color: var(--rc-blue-700); font-weight: 600; }

.rc-pillars { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.rc-pillar { background: var(--rc-white); border: 1px solid var(--rc-grey-100); border-radius: var(--rc-radius); padding: 20px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--rc-shadow-sm); }
.rc-pillar-num { font-family: var(--rc-font); font-weight: 700; color: var(--rc-blue-500); font-size: 1.2rem; }
.rc-pillar h3 { margin: 0 0 4px; font-size: 1rem; color: var(--rc-blue-900); }
.rc-pillar p { margin: 0; color: var(--rc-grey-700); font-size: .9rem; line-height: 1.45; }

.rc-hint { display: flex; align-items: center; gap: 16px; color: var(--rc-grey-700); font-size: .95rem; }
.rc-hint em { color: var(--rc-blue-700); font-style: normal; font-weight: 500; }

.rc-foot { padding: 24px; border-top: 1px solid var(--rc-grey-100); margin-top: 48px; }
.rc-foot-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--rc-grey-700); }

#rc-widget { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.rc-toggle { width: 56px; height: 56px; border-radius: 50%; background: var(--rc-blue-700); color: var(--rc-white); border: none; cursor: pointer; display: grid; place-items: center; box-shadow: var(--rc-shadow); transition: transform .15s ease; }
.rc-toggle:hover { transform: scale(1.05); }
.rc-attention { animation: rc-attention 1.8s ease-in-out infinite; }
@keyframes rc-attention { 0%, 100% { box-shadow: var(--rc-shadow); } 50% { box-shadow: var(--rc-shadow), 0 0 0 8px rgba(46, 108, 199, 0.25); } }

.rc-panel { position: absolute; bottom: 72px; right: 0; width: min(380px, calc(100vw - 40px)); height: min(560px, calc(100vh - 120px)); background: var(--rc-bg); border: 1px solid var(--rc-grey-100); border-radius: var(--rc-radius); box-shadow: var(--rc-shadow); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; opacity: 0; transform: scale(.96); transition: opacity .18s ease, transform .18s ease; }
.rc-panel.rc-open { opacity: 1; transform: scale(1); }
.rc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--rc-grey-100); background: var(--rc-blue-100); }
.rc-brand { font-family: var(--rc-font); font-weight: 700; color: var(--rc-blue-900); }
.rc-brand-tag { display: block; font-family: var(--rc-font); font-weight: 400; font-size: .7rem; color: var(--rc-grey-700); }
.rc-head-actions { display: flex; gap: 4px; }
.rc-reset, .rc-close { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--rc-blue-900); }
.rc-reset:hover, .rc-close:hover { background: rgba(10, 37, 64, 0.06); }
.rc-close { font-size: 1.2rem; line-height: 1; }

.rc-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(16px + var(--rc-ui-h, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--rc-bg);
  scroll-padding-bottom: var(--rc-ui-h, 0px);
}

/* Message rows */
.rc-msg { display: flex; max-width: 100%; }
.rc-msg.rc-bot {
  justify-content: flex-start;
  align-items: flex-end;
  gap: 8px;
}
.rc-msg.rc-user { justify-content: flex-end; }

/* Avatar circle to the left of each new bot turn */
.rc-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(10, 37, 64, 0.12);
}
.rc-msg-avatar-spacer {
  width: 32px;
  flex-shrink: 0;
}

/* Bubbles */
.rc-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: .92rem;
  word-wrap: break-word;
  white-space: pre-wrap;
  max-width: 78%;
}
.rc-msg.rc-bot .rc-msg-bubble {
  background: var(--rc-white);
  border: 1px solid var(--rc-grey-100);
  color: var(--rc-grey-900);
  border-bottom-left-radius: 4px;
}
.rc-msg.rc-user .rc-msg-bubble {
  background: var(--rc-blue-700);
  color: var(--rc-white);
  border-bottom-right-radius: 4px;
}

/* Tighten spacing between consecutive bot turns */
.rc-msg.rc-bot + .rc-msg.rc-bot { margin-top: -2px; }

/* Markdown inside bubbles */
.rc-msg-md { white-space: normal; }
.rc-msg-md p { margin: 0 0 8px; }
.rc-msg-md p:last-child { margin-bottom: 0; }
.rc-msg-md ul { margin: 4px 0 8px; padding-left: 20px; }
.rc-msg-md ul:last-child { margin-bottom: 0; }
.rc-msg-md li { margin: 2px 0; }
.rc-msg-md li::marker { color: var(--rc-blue-500); }
.rc-msg-md strong { color: var(--rc-blue-900); font-weight: 600; }
.rc-msg-md em { font-style: italic; }
.rc-msg-md code { font-family: ui-monospace, SFMono-Regular, monospace; font-size: .85em; padding: 1px 5px; background: var(--rc-blue-100); border-radius: 4px; }

/* Typing indicator */
.rc-typing-bubble {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  align-items: center;
}
.rc-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--rc-grey-400);
  border-radius: 50%;
  animation: rc-typing 1.2s ease-in-out infinite;
}
.rc-typing-dot:nth-child(2) { animation-delay: .15s; }
.rc-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes rc-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .3; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

.rc-ui { position: absolute; left: 0; right: 0; bottom: var(--rc-input-h, 60px); padding: 0;  margin: 0 16px 5px; pointer-events: none; }
.rc-ui:empty { display: none; }
.rc-ui > * { pointer-events: auto; box-shadow: 0 4px 16px rgba(10, 37, 64, 0.10); }
.rc-input {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 5px 5px 5px 16px;
  margin: 0 12px 12px;
  background: var(--rc-white);
  border: 1px solid var(--rc-grey-100);
  border-radius: 999px;
  box-shadow: var(--rc-shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rc-input:focus-within {
  border-color: var(--rc-blue-500);
}
.rc-input textarea {
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-family: inherit;
  font-size: .92rem;
  line-height: 1.4;
  color: var(--rc-grey-900);
  outline: none;
  max-height: 120px;
}
.rc-input textarea::placeholder { color: var(--rc-grey-400); opacity: .9; }
.rc-send {
  background: var(--rc-blue-700);
  color: var(--rc-white);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .15s ease, transform .1s ease;
}
.rc-send:hover { background: var(--rc-blue-900); }
.rc-send:active { transform: scale(.94); }
.rc-send svg { transform: translateX(1px); }

/* Generic card styles for AE + professional contact cards */
.rc-card {
  background: var(--rc-white);
  border: 1px solid var(--rc-grey-100);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--rc-shadow-sm);
}
.rc-card-title { margin: 0; font-size: .92rem; font-weight: 600; color: var(--rc-blue-900); }
.rc-card-desc { margin: 0; font-size: .85rem; color: var(--rc-grey-700); line-height: 1.4; }
.rc-card-cta {
  align-self: flex-start;
  background: var(--rc-blue-700);
  color: var(--rc-white);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  transition: background .15s ease, transform .1s ease;
}
.rc-card-cta:hover { background: var(--rc-blue-900); }
.rc-card-cta:active { transform: scale(.97); }

/* Adverse-event card — use warn palette */
.rc-ae-card { border-color: var(--rc-warn-bg); background: var(--rc-warn-bg); }
.rc-ae-card .rc-card-title { color: var(--rc-warn); }
.rc-ae-card .rc-card-cta { background: var(--rc-warn); }
.rc-ae-card .rc-card-cta:hover { background: #8a3505; }

/* Professional contact card */
.rc-pro-card { }
.rc-pro-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rc-pro-item { font-size: .88rem; color: var(--rc-grey-900); line-height: 1.4; }
.rc-pro-link { color: var(--rc-blue-700); text-decoration: none; font-weight: 500; }
a.rc-pro-link:hover { text-decoration: underline; }
.rc-pro-hint { color: var(--rc-grey-700); font-size: .82rem; }

/* --- Header avatar (small circle next to Sofia's name) --- */
.rc-head-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  box-shadow: 0 1px 4px rgba(10, 37, 64, 0.15);
}

/* --- Mode toggle (Próstata / Saúde geral) --- */
.rc-mode-toggle {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  background: var(--rc-blue-100);
  border-bottom: 1px solid var(--rc-grey-100);
}
.rc-mode-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--rc-grey-700);
  font-family: var(--rc-font);
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.rc-mode-btn:hover {
  background: rgba(255, 255, 255, 0.6);
}
.rc-mode-btn.rc-mode-active {
  background: var(--rc-white);
  color: var(--rc-blue-900);
  border-color: var(--rc-grey-100);
  box-shadow: 0 1px 3px rgba(10, 37, 64, 0.10);
  font-weight: 600;
}
