/* ==========================================================================
   Company Insights Ireland – Clean Gov-Style Design System
   Gemini / ChatGPT Style Transition Architecture
   ========================================================================== */

:root {
  --green-900: #064e3b;
  --green-800: #065f46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-300: #6ee7b7;
  --green-100: #d1fae5;
  --green-50: #ecfdf5;

  --amber-600: #d97706;
  --red-600: #dc2626;
  --grey-500: #6b7280;
  --grey-400: #9ca3af;
  --grey-300: #d1d5db;
  --grey-200: #e5e7eb;
  --grey-100: #f3f4f6;
  --grey-50: #f9fafb;

  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --white: #ffffff;
  --border: #e5e7eb;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--grey-50);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', 'Inter', sans-serif;
  line-height: 1.3;
}

a {
  color: var(--green-700);
  text-decoration: underline;
}
a:hover {
  color: var(--green-900);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ---- Navbar ---- */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-icon-wrapper {
  width: 40px;
  height: 40px;
  background: var(--green-50);
  border: 1.5px solid var(--green-100);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-700);
}

.brand-svg {
  width: 22px;
  height: 22px;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-900);
  display: block;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-email {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-text {
  background: none;
  border: none;
  color: var(--green-700);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.btn-text:hover {
  color: var(--green-900);
}

.btn-nav-signin {
  padding: 0.45rem 1.1rem;
  background: var(--green-700);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.btn-nav-signin:hover {
  background: var(--green-800);
}

.btn-signin-short { display: none; }
.btn-signin-full { display: inline; }

.btn-new-chat {
  padding: 0.42rem 0.95rem;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-800);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-new-chat:hover {
  background: var(--green-100);
  color: var(--green-900);
}

/* ---- KPI Bar ---- */
.kpi-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

.kpi-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.kpi {
  text-align: center;
}

.kpi-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.kpi-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
}

.kpi-num.green { color: var(--green-700); }
.kpi-num.amber { color: var(--amber-600); }
.kpi-num.red { color: var(--red-600); }
.kpi-num.grey { color: var(--grey-500); }

.kpi-divider {
  width: 1px;
  height: 32px;
  background: var(--grey-200);
}

/* ---- Portal Hero (Landing Welcome View) ---- */
.portal-hero {
  padding: 2.75rem 0 1.5rem;
  text-align: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.hero-centered {
  max-width: 940px;
  margin: 0 auto;
}

.portal-hero h1 {
  font-size: clamp(1.55rem, 3.2vw, 2.2rem);
  font-weight: 800;
  color: var(--green-900);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-intro {
  font-size: clamp(0.92rem, 1.4vw, 1.05rem);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.hero-details {
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.hero-scope-note {
  font-size: clamp(0.78rem, 1vw, 0.82rem);
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

/* ---- Main Container ---- */
.main-container {
  max-width: 1000px;
  margin: 0 auto;
  flex: 1;
}

/* ---- Landing Search Card ---- */
.landing-search-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 3rem;
  transition: all 0.25s ease;
}

.search-input-group {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.main-search-input {
  flex: 1;
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius);
  outline: none;
  color: var(--text);
  background: var(--grey-50);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.main-search-input:focus {
  border-color: var(--green-600);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.btn-main-send {
  padding: 0.9rem 1.75rem;
  background: var(--green-700);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-main-send:hover {
  background: var(--green-800);
}

/* Suggestion Chips */
/* ---- Suggested Prompts Section ---- */
.suggested-prompts-section {
  margin-top: 1.25rem;
}

.suggested-prompts-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-900);
  margin-bottom: 0.65rem;
  display: block;
}

.prompt-cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.prompt-card {
  background: var(--grey-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.prompt-card:hover {
  border-color: var(--green-500);
  background: var(--green-50);
  box-shadow: var(--shadow-sm);
}

.prompt-card.active-typing-card {
  border-color: var(--green-600);
  background: var(--green-50);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.prompt-full-text {
  font-size: clamp(0.78rem, 1.1vw, 0.86rem);
  color: var(--text-secondary);
  line-height: 1.45;
  font-weight: 500;
}

.card-scope-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--grey-200);
  line-height: 1.5;
}

/* ---- Residual Emulator Banner Hide ---- */
.firebase-emulator-warning {
  display: none !important;
}

/* ==========================================================================
   STATE 2: Active Chat View (Ultra-Smooth Gemini / ChatGPT Style Transition)
   ========================================================================== */

.fade-out-transition {
  opacity: 0 !important;
  transform: translateY(-16px) !important;
  transition: opacity 0.28s ease-out, transform 0.28s ease-out !important;
}

body.mode-chat {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #ffffff;
}

body.mode-chat .navbar {
  display: none !important;
}

body.mode-chat .main-container {
  padding: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.mode-chat .portal-hero,
body.mode-chat .kpi-bar,
body.mode-chat .landing-search-card {
  display: none !important;
}

body.mode-chat .active-chat-view {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
}

body.mode-chat .portal-footer {
  display: none !important;
}

/* Wireframe Top Header Bar */
.active-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.btn-chat-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'Inter', sans-serif;
}

.btn-chat-back:hover {
  background: #f8fafc;
  color: #065f46;
  border-color: #cbd5e1;
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chat-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: monospace;
  font-size: 0.76rem;
  color: #64748b;
}

.chat-status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  display: inline-block;
}

.quota-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

/* Messages Stream */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

/* Floating Bottom Input Bar (Attached to bottom of chat view) */
.chat-input-bar-fixed {
  border-top: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  background: #ffffff;
  z-index: 10;
  flex-shrink: 0;
  display: none;
  position: static;
}

body.mode-chat .chat-input-bar-fixed {
  display: block;
}

.chat-dock-disclaimer {
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 0.45rem;
  line-height: 1.4;
}

/* Welcome Persona Card (From Wireframe) */
.welcome-notification {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: chatPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  margin-bottom: 0.5rem;
}

@keyframes chatPopIn {
  0% { opacity: 0; transform: translateY(10px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.agent-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.persona-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #047857;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.avatar-online-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.welcome-bubble {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px 16px 16px 16px;
  padding: 1rem 1.15rem;
  flex: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.welcome-header-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.persona-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.agent-badge-tag {
  font-family: monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #047857;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.persona-desc {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 8px;
}

.welcome-demo-note {
  font-size: 0.78rem;
  color: #64748b;
  background-color: #ffffff;
  border-left: 3px solid #059669;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  margin-top: 8px;
  line-height: 1.45;
}

/* User & Agent Message Bubbles */
.msg {
  display: flex;
  width: 100%;
}

.msg.agent { align-self: flex-start; }
.msg.user { align-self: flex-end; justify-content: flex-end; }

.msg-bubble {
  padding: 0.95rem 1.25rem;
  border-radius: 16px;
  font-size: 0.93rem;
  line-height: 1.65;
  max-width: 92%;
}

.msg.agent .msg-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  border-radius: 4px 16px 16px 16px;
  width: 100%;
  max-width: 100%;
}

.msg.user .msg-bubble {
  background: #047857;
  color: #ffffff;
  border-radius: 16px 16px 2px 16px;
  font-weight: 500;
  max-width: 80%;
}

/* Suggested Follow-up Chips Container */
.chat-followups-wrap {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e2e8f0;
}

.chat-followups-label {
  font-family: monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.45rem;
}

.chat-followups-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-pill-chip {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.35;
  text-align: left;
  font-family: 'Inter', sans-serif;
}

.chat-pill-chip:hover {
  border-color: #059669;
  color: #047857;
  background: #ecfdf5;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(4, 120, 87, 0.08);
}

.btn-csv-export {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.95rem;
  padding: 0.5rem 1rem;
  background: var(--green-50);
  color: var(--green-800);
  border: 1px solid var(--green-200);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'Inter', sans-serif;
}

.btn-csv-export:hover {
  background: var(--green-100);
  border-color: var(--green-300);
}

/* Agent Verbose Processing Styles */
@keyframes agentSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Real-Time Thinking Progress Bar */
.ci-thinking-container {
  padding: 0.35rem 0;
  width: 100%;
  max-width: 480px;
}

.ci-thinking-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}

.ci-thinking-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(5, 150, 105, 0.2);
  border-top-color: #059669;
  border-radius: 50%;
  animation: agentSpin 0.65s linear infinite;
  flex-shrink: 0;
}

.ci-thinking-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #065f46;
  flex: 1;
}

.ci-thinking-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
}

.ci-thinking-bar-bg {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.ci-thinking-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ci-thinking-step-detail {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

/* Post-Execution Reasoning Pill */
.ci-reasoning-pill {
  margin-bottom: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.82rem;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.ci-reasoning-pill:hover {
  border-color: #cbd5e1;
}

.ci-reasoning-pill summary {
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #334155;
  user-select: none;
  outline: none;
}

.ci-reasoning-icon {
  font-size: 0.95rem;
}

.ci-reasoning-title {
  flex: 1;
}

.ci-reasoning-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: 6px;
}

.ci-reasoning-content {
  padding: 0.6rem 0.85rem 0.75rem;
  border-top: 1px solid #edf2f7;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ci-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
}

.ci-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  margin-top: 6px;
  flex-shrink: 0;
}

.btn-csv-export:hover {
  background: var(--green-100);
  border-color: var(--green-500);
  color: var(--green-900);
}

/* Floating Bottom Input Bar (Attached to active chat container) */

.bottom-input-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.bottom-chat-input {
  flex: 1;
  width: 100%;
  padding: 0.8rem 1.1rem;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius);
  outline: none;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bottom-chat-input:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.btn-bottom-send {
  padding: 0.8rem 1.4rem;
  background: var(--green-700);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-bottom-send:hover {
  background: var(--green-800);
}

.btn-bottom-reset {
  padding: 0.8rem 1.1rem;
  background: #ffffff;
  color: #64748b;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-bottom-reset:hover {
  color: #0f172a;
  border-color: #94a3b8;
  background: #f8fafc;
}

/* ---- Sign-in Prompt Modal ---- */
.signin-prompt {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.25rem;
}

.signin-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--green-700);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem 1.75rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.btn-close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.btn-close-modal:hover {
  color: var(--text);
  background: var(--grey-100);
}

.signin-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green-800);
  background: var(--green-50);
  border: 1px solid var(--green-100);
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.badge-icon-svg {
  width: 14px;
  height: 14px;
  stroke: var(--green-700);
}

.signin-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--green-900);
  margin-bottom: 0.4rem;
}

.signin-header p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.78rem 1rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-google:hover {
  background: var(--grey-50);
  border-color: #9ca3af;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--grey-400);
  font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--grey-200);
}

.form-group-auth {
  text-align: left;
  margin-bottom: 0.85rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--white);
  outline: none;
}

.auth-input:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.consent-checkbox {
  margin-top: 2px;
  accent-color: var(--green-700);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.consent-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  cursor: pointer;
}

.consent-label a {
  color: var(--green-700);
  font-weight: 600;
}

.btn-primary-auth {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--green-700);
  color: var(--white);
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary-auth:hover {
  background: var(--green-800);
}

.trust-guarantees {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--grey-200);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.trust-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.trust-item span {
  color: var(--green-600);
  font-weight: 800;
  margin-right: 0.25rem;
}

.auth-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  text-align: center;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  background: var(--white);
  margin-top: auto;
}

.footer-inner p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner strong {
  color: var(--green-800);
}

.footer-small {
  font-size: 0.75rem;
  color: var(--grey-400);
  margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .portal-hero h1 {
    font-size: 1.65rem;
  }
  .kpi-row {
    gap: 1rem;
  }
  .kpi-divider {
    display: none;
  }
  .search-input-group {
    flex-direction: column;
  }
  .btn-main-send {
    width: 100%;
  }
  .prompt-cards-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .brand-sub {
    display: none !important;
  }
  .brand-name {
    font-size: 0.98rem;
    line-height: 1.15;
  }
  .brand-icon-wrapper {
    width: 32px;
    height: 32px;
  }
  .brand-svg {
    width: 16px;
    height: 16px;
  }
  .user-email {
    display: none !important;
  }
  .active-chat-header {
    padding: 0.5rem 0.75rem;
  }
  .btn-chat-back {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
  }
  .chat-status-text {
    font-size: 0.7rem;
  }
  .quota-pill {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
  }
  .chat-messages {
    padding: 0.75rem 0.75rem 1rem 0.75rem;
    gap: 0.85rem;
  }
  .welcome-notification {
    gap: 8px;
  }
  .persona-logo-icon {
    width: 36px;
    height: 36px;
  }
  .welcome-bubble {
    padding: 0.75rem 0.85rem;
  }
  .persona-name {
    font-size: 0.88rem;
  }
  .persona-desc {
    font-size: 0.82rem;
  }
  .welcome-demo-note {
    font-size: 0.74rem;
  }
  .msg-bubble {
    padding: 0.75rem 0.9rem !important;
    font-size: 0.86rem !important;
    max-width: 95% !important;
  }
  .chat-pill-chip {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
  .chat-input-bar-fixed {
    padding: 0.5rem 0.75rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }
  .bottom-chat-input {
    font-size: 0.84rem;
    padding: 0.65rem 0.85rem;
  }
  .btn-bottom-send {
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
  }
  .btn-bottom-reset {
    padding: 0.65rem 0.8rem;
    font-size: 0.78rem;
  }
}

/* Callout Box */
.callout {
  background: #ecfdf5;
  border-left: 4px solid #059669;
  padding: 0.65rem 0.85rem;
  border-radius: 0 8px 8px 0;
  margin: 0.65rem 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #064e3b;
}

/* Responsive Table Wrapper */
.ci-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.75rem 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Agent Response Tables */
.ci-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.82rem;
  min-width: 280px;
}
.ci-table thead {
  background: linear-gradient(135deg, #064e3b, #047857);
  color: #fff;
}
.ci-table th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ci-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
}
.ci-table tbody tr:hover {
  background: #f0fdf4;
}
.ci-table tbody tr:nth-child(even) {
  background: #f9fafb;
}
.ci-table tbody tr:nth-child(even):hover {
  background: #f0fdf4;
}

/* Truncation Banner */
.truncation-banner {
  margin: 0.75rem 0;
  padding: 0.5rem 1rem;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  color: #92400e;
  font-size: 0.85rem;
}

/* Clickable Table Rows */
.ci-clickable-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
.ci-clickable-row:hover {
  background: #dcfce7 !important;
}

/* Company Profile Modal Overlay */
.ci-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ci-modal-card {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.ci-modal-header {
  background: linear-gradient(135deg, #064e3b, #047857);
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.ci-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.ci-modal-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.82rem;
  color: #a7f3d0;
}

.ci-modal-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.ci-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ci-modal-body {
  padding: 1.5rem;
}

.ci-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ci-modal-field.full-width {
  grid-column: 1 / -1;
}

.ci-modal-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.ci-modal-val {
  font-size: 0.92rem;
  color: #111827;
  font-weight: 500;
  line-height: 1.4;
}

.ci-modal-footer {
  padding: 1rem 1.5rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  text-align: right;
}

.btn-ask-ai {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn-ask-ai:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-1px);
}
