:root {
  --ig-navy: #000033;
  --ig-blue: #0065b1;
  --ig-cyan: #0891b2;
  --ig-ink: #0f172a;
  --ig-muted: #475569;
  --ig-line: #d9e6f5;
  --ig-card: #ffffff;
  --ig-soft: #eef6ff;
}

.ig-guide-home {
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(2, 8, 23, .22);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.ig-guide-panel,
.ig-guide-drawer {
  background: var(--ig-card);
  color: var(--ig-ink);
  display: flex;
  flex-direction: column;
}

.ig-guide-header {
  background: linear-gradient(135deg, var(--ig-navy), #0b2f68 62%, var(--ig-blue));
  color: #fff;
  padding: 16px 18px;
}

.ig-guide-header h3,
.ig-guide-header h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.ig-guide-header p {
  margin: 0;
  color: #dbeafe;
  line-height: 1.5;
  font-size: .95rem;
}

.ig-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ig-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ig-header-btn {
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 999px;
  padding: 8px 10px;
  font: 700 12px Inter, Arial, sans-serif;
  cursor: pointer;
}

.ig-guide-body {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  max-height: 720px;
}

.ig-guide-home .ig-guide-body {
  min-height: 400px;
}

.ig-guide-messages {
  padding: 12px 16px 4px;
  overflow: auto;
  flex: 1;
  background: linear-gradient(180deg, #f7fbff 0, #ffffff 100%);
}

.ig-msg {
  margin-bottom: 10px;
  display: flex;
}

.ig-msg.assistant { justify-content: flex-start; }
.ig-msg.user { justify-content: flex-end; }

.ig-bubble {
  max-width: min(92%, 760px);
  padding: 10px 12px;
  border-radius: 15px;
  line-height: 1.45;
  font-size: 13.5px;
  box-shadow: 0 8px 20px rgba(2, 8, 23, .06);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ig-guide-home .ig-bubble {
  max-width: 100%;
}

.ig-msg.assistant .ig-bubble {
  background: #fff;
  border: 1px solid var(--ig-line);
}

.ig-msg.user .ig-bubble {
  background: linear-gradient(135deg, var(--ig-blue), #0b5fa5);
  color: #fff;
}

.ig-message-meta {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.ig-message-meta:empty {
  display: none;
  margin-top: 0;
}

.ig-citations,
.ig-followups,
.ig-actions,
.ig-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ig-chip,
.ig-followup,
.ig-starter,
.ig-action-btn,
.ig-status-btn {
  border: 1px solid #cfe0f5;
  background: #f8fbff;
  color: #0b1e52;
  padding: 7px 10px;
  border-radius: 999px;
  font: 700 11.5px/1.15 Inter, Arial, sans-serif;
  cursor: pointer;
  text-decoration: none;
}

.ig-followup:hover,
.ig-starter:hover,
.ig-action-btn:hover,
.ig-status-btn:hover,
.ig-chip:hover {
  background: #eef6ff;
}

.ig-chip small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-weight: 600;
}

.ig-input-area {
  border-top: 1px solid var(--ig-line);
  padding: 14px;
  background: #fff;
}

.ig-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.ig-compose textarea {
  width: 100%;
  min-height: 54px;
  max-height: 140px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  padding: 12px 14px;
  font: 14px/1.5 Inter, Arial, sans-serif;
  color: var(--ig-ink);
}

.ig-send {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ig-blue), #0b5fa5);
  color: #fff;
  padding: 0 16px;
  font: 800 13px Inter, Arial, sans-serif;
  cursor: pointer;
  min-width: 92px;
}

.ig-send[disabled] {
  opacity: .7;
  cursor: wait;
}

.ig-subtle {
  margin-top: 10px;
  color: var(--ig-muted);
  font-size: 12px;
  line-height: 1.45;
}

.ig-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ig-navy), #0b2f68 60%, var(--ig-blue));
  color: #fff;
  padding: 14px 18px;
  box-shadow: 0 18px 44px rgba(2, 8, 23, .28);
  cursor: pointer;
  font: 800 14px Inter, Arial, sans-serif;
}

.ig-launcher small {
  display: block;
  margin-top: 3px;
  color: #dbeafe;
  font-weight: 600;
}

.ig-drawer-shell {
  position: fixed;
  inset: auto 18px 88px auto;
  width: min(420px, calc(100vw - 20px));
  height: min(72vh, 760px);
  z-index: 9998;
  display: none;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 56px rgba(2, 8, 23, .28);
  border: 1px solid #cfe0f5;
}

.ig-drawer-shell.open { display: block; }

.ig-close {
  float: right;
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
}

.ig-status-card,
.ig-calendly-card {
  margin-top: 8px;
  border: 1px solid var(--ig-line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px 11px;
}

.ig-status-card h4,
.ig-calendly-card h4 {
  margin: 0 0 4px;
  color: #0b1e52;
  font-size: 13px;
  line-height: 1.35;
}

.ig-status-card p,
.ig-calendly-card p {
  margin: 0 0 8px;
  color: #334155;
  font-size: 12.5px;
  line-height: 1.4;
}

.ig-status-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ig-calendly-frame {
  width: 100%;
  height: 540px;
  border: 0;
  border-radius: 12px;
  background: #fff;
}

.ig-banner {
  margin: 10px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  padding: 7px 10px;
  border-radius: 999px;
  font: 700 12px Inter, Arial, sans-serif;
}

.ig-history-list {
  display: grid;
  gap: 10px;
  padding: 8px 16px 16px;
}

.ig-history-item {
  text-align: left;
  border: 1px solid var(--ig-line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(2, 8, 23, .04);
}

.ig-history-item strong {
  display: block;
  color: #0b1e52;
  margin-bottom: 4px;
}

.ig-history-item small {
  color: #64748b;
}

.ig-typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.ig-typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
  animation: ig-bounce 1.2s infinite ease-in-out;
}

.ig-typing span:nth-child(2) { animation-delay: .15s; }
.ig-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes ig-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 960px) {
  .ig-guide-home .ig-guide-body { min-height: 520px; }
  .ig-drawer-shell {
    inset: auto 10px 82px 10px;
    width: auto;
    height: min(78vh, 760px);
  }
  .ig-launcher {
    right: 10px;
    left: 10px;
    bottom: 10px;
    padding: 12px 14px;
  }
  .ig-calendly-frame { display: none; }
}
