/* ============================================================
   PolicyChat Consumer Chat — Design System v2
   Inspired by: Stripe (trust), Linear (minimal), Lemonade (friendly),
                Vercel (geometric), Wise/Revolut (financial clarity)
   Typography: Inter (body), JetBrains Mono (data/rates)
   Palette: Slate Blue #2563EB (brand), Coral #FF7056 (CTA/warm accent),
            Teal #0D9488 (success/safe), Neutral slate scale
   AA contrast minimum throughout
   ============================================================ */

/* --- Fonts: self-hosted via /chat/fonts.css (loaded in index.html head).
   The Google Fonts @import was removed 2026-07-15: the CDN 3-hop chain
   (preconnect → fonts.googleapis.com → fonts.gstatic.com) was invisible
   to the preload scanner and added ~300ms on cold loads. Inter 400/500/600
   are now served from /chat/fonts/ with immutable cache headers. --- */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* --- Brand color scale (Slate Blue) --- */
  --color-brand-50:   #EFF6FF;
  --color-brand-100:  #DBEAFE;
  --color-brand-200:  #BFDBFE;
  --color-brand-300:  #93C5FD;
  --color-brand-400:  #60A5FA;
  --color-brand-500:  #3B82F6;
  --color-brand-600:  #2563EB;
  --color-brand-700:  #1D4ED8;
  --color-brand-800:  #1E40AF;
  --color-brand-900:  #1E3A8A;

  /* --- Warm accent (Coral — friendly CTA) --- */
  /* A11y: #FF7056 = 3.2:1 on white (FAILS AA 4.5:1). Darkened to #C44328 (5.3:1) for AA compliance. */
  --color-accent-50:  #FFF5F2;
  --color-accent-100: #FFE8E2;
  --color-accent-200: #FFCDBF;
  --color-accent-300: #FFAB95;
  --color-accent-400: #FF8A6A;
  --color-accent-500: #C44328;
  --color-accent-600: #A83520;
  --color-accent-700: #D43B2B;
  --color-accent-800: #B12B1C;
  --color-accent-900: #8C1E10;

  /* --- Success (Teal) --- */
  --color-success-50:  #F0FDFA;
  --color-success-100: #CCFBF1;
  --color-success-200: #99F6E4;
  --color-success-400: #2DD4BF;
  --color-success-500: #14B8A6;
  --color-success-600: #0D9488;
  --color-success-700: #0F766E;
  --color-success-800: #115E59;

  /* --- Neutral slate scale --- */
  --color-50:   #F8FAFC;
  --color-100:  #F1F5F9;
  --color-200:  #E2E8F0;
  --color-300:  #CBD5E1;
  --color-400:  #94A3B8;
  --color-500:  #64748B;
  --color-600:  #475569;
  --color-700:  #334155;
  --color-800:  #1E293B;
  --color-900:  #0F172A;

  /* --- Empirical design anchors (auto-inserted 2026-05-12) --- */
  /* iter-51: sage. brand primary swap — royal blue → forest green
     to match the Hims-inspired editorial palette. Cascades through
     30+ legacy --pc-blue call sites in one stroke. */
  --color-brand-primary: #1e3a32;   /* forest — was #2563EB royal */
  /* A2: CTA terra — warm earthy accent (paired with forest) */
  --color-cta-primary:   #c97f5f;   /* terra — was #C44328 coral */

  /* --- Semantic aliases (legacy --pc-blue tokens now point at forest) --- */
  --pc-blue:         #1e3a32;       /* forest */
  --pc-blue-dark:    #0f231d;       /* deep forest */
  --pc-blue-light:   #e8e2d6;       /* pc-stone — warm light surface */
  --pc-blue-mid:     #d4cdba;       /* slightly darker stone */
  --pc-green:        var(--color-success-600);
  --pc-green-dark:   var(--color-success-700);
  --pc-green-light:  var(--color-success-50);
  --pc-orange:       var(--color-cta-primary);
  --pc-orange-dark:  var(--color-accent-600);
  --pc-orange-light: var(--color-accent-50);

  /* --- Gray aliases (for backward compatibility) --- */
  --gray-50:   var(--color-50);
  --gray-100:  var(--color-100);
  --gray-200:  var(--color-200);
  --gray-300:  var(--color-300);
  --gray-400:  var(--color-400);
  --gray-500:  var(--color-500);
  --gray-600:  var(--color-600);
  --gray-700:  var(--color-700);
  --gray-800:  var(--color-800);
  --gray-900:  var(--color-900);

  /* --- Surface colors --- */
  --bg-primary:      #FFFFFF;
  --bg-secondary:    var(--color-50);
  --bg-tertiary:     var(--color-100);
  --text-primary:    var(--color-900);
  --text-secondary:  var(--color-600);
  --text-muted:      var(--color-400);
  --border:          var(--color-200);
  --border-focus:    var(--pc-blue);

  /* --- Chat bubbles --- */
  --bubble-user-bg:      var(--pc-blue);
  --bubble-user-text:    #FFFFFF;
  /* iter-68: assist bubble bg matches brand cream so the conversation
     surface sits within the sage palette instead of slate blue/gray. */
  --bubble-assist-bg:    var(--pc-cream, #faf7f2);
  --bubble-assist-text:  var(--pc-ink, #1c2417);

  /* --- Shadows (Stripe-inspired, very subtle) --- */
  --shadow-xs:  0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:  0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:  0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg:  0 10px 30px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.05);
  --shadow-xl:  0 20px 50px rgba(15, 23, 42, 0.14), 0 8px 16px rgba(15, 23, 42, 0.06);

  /* --- Radii --- */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-pill: 9999px;

  /* --- Spacing scale (4px base) --- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;

  /* --- Typography scale --- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;
  --text-3xl:  36px;
  --text-4xl:  48px;
  /* Legacy aliases */
  --font-size-xs:   var(--text-xs);
  --font-size-sm:   var(--text-sm);
  --font-size-base: var(--text-base);
  --font-size-md:   var(--text-md);
  --font-size-lg:   var(--text-lg);
  --font-size-xl:   var(--text-xl);
  --font-size-2xl:  var(--text-2xl);
  --font-size-3xl:  var(--text-3xl);

  /* --- Easing --- */
  --easing-out:        cubic-bezier(0.16, 1, 0.3, 1);
  --easing-in-out:     cubic-bezier(0.4, 0, 0.2, 1);
  --easing-bounce-rare: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Durations --- */
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --duration-slow: 380ms;
  /* Legacy aliases */
  --transition-fast: 150ms var(--easing-out);
  --transition-base: 220ms var(--easing-out);
  --transition-slow: 380ms var(--easing-out);

  /* --- Layout --- */
  --header-height:  56px;
  --sidebar-width:  272px;
  --input-height:   56px;
  --max-chat-width: 680px;
}

/* ============================================================
   DARK MODE TOKENS
   ============================================================ */
[data-theme="dark"] {
  --bg-primary:      #0F172A;
  --bg-secondary:    #1E293B;
  --bg-tertiary:     #293548;
  --text-primary:    #F1F5F9;
  --text-secondary:  #94A3B8;
  --text-muted:      #475569;
  --border:          #293548;
  --bubble-user-bg:     var(--pc-blue);
  --bubble-user-text:   #FFFFFF;
  --bubble-assist-bg:   #1E293B;
  --bubble-assist-text: #F1F5F9;
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.40);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.50), 0 1px 2px rgba(0,0,0,0.40);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.55), 0 2px 4px rgba(0,0,0,0.40);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.60), 0 4px 8px rgba(0,0,0,0.45);
  --shadow-xl:  0 20px 50px rgba(0,0,0,0.65), 0 8px 16px rgba(0,0,0,0.50);
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--pc-blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea {
  font-family: var(--font-sans);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.pc-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* --- Header --- */
.pc-header {
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  /* Subtle bottom fade instead of heavy shadow */
  box-shadow: 0 1px 0 var(--border);
}

.pc-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--pc-blue);
  text-decoration: none;
}

.pc-logo svg {
  flex-shrink: 0;
}

.pc-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--pc-blue);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-logo-icon svg {
  width: 22px;
  height: 22px;
  /* B-HEADER-SAGE-REBRAND 2026-05-18: sage leaf uses cream fill (matches
     favicon + chat avatar) instead of pure white, so the brand palette is
     consistent across the header / chat-bubble avatar / favicon trio. */
  color: var(--pc-cream, #faf7f2);
}

.pc-tagline {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 400;
  display: none;
}

@media (min-width: 640px) {
  .pc-tagline { display: block; }
}

/* iter-68c: hide the inline chat tagline on narrow viewports to stop it
   wrapping under the sage. brand mark in the header. The brand + actions
   layout stays clean on small screens. */
.pc-chat-tagline {
  display: none;
}
@media (min-width: 640px) {
  .pc-chat-tagline { display: inline; }
}

.pc-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* --- Body (chat + sidebar) --- */
.pc-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* --- Chat Column --- */
.pc-chat-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* --- Sidebar --- */
.pc-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: transform var(--transition-base);
}

@media (max-width: 767px) {
  .pc-sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    height: calc(100dvh - var(--header-height));
    z-index: 200;
    transform: translateX(100%);
    box-shadow: var(--shadow-lg);
  }
  .pc-sidebar.open {
    transform: translateX(0);
  }
}

/* ============================================================
   MESSAGE STREAM
   ============================================================ */

.pc-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  .pc-messages {
    padding: var(--space-6) var(--space-8);
  }
}

/* Center messages on wide screens */
.pc-messages-inner {
  max-width: var(--max-chat-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* --- Message rows --- */
.pc-message-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: pc-message-in var(--transition-base) ease-out;
}

.pc-message-row--user {
  flex-direction: row-reverse;
}

@keyframes pc-message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Avatar --- */
.pc-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  overflow: hidden;
}

.pc-avatar--assist {
  background: var(--pc-blue-light);
  color: var(--pc-blue);
  position: relative;
}

.pc-avatar--user {
  background: var(--gray-200);
  color: var(--gray-700);
}

/* Subtle pulse when streaming */
.pc-avatar--streaming {
  animation: pc-avatar-pulse 1.6s ease-in-out infinite;
}

@keyframes pc-avatar-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.25); }
  50%       { box-shadow: 0 0 0 6px rgba(0, 102, 204, 0); }
}

/* --- Bubbles --- */
.pc-bubble {
  max-width: min(520px, calc(100vw - 80px));
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  line-height: 1.7;
  position: relative;
  word-break: break-word;
  letter-spacing: -0.01em;
}

.pc-bubble--assist {
  background: var(--bubble-assist-bg);
  color: var(--bubble-assist-text);
  border-bottom-left-radius: var(--radius-xs);
  /* Subtle left-edge accent for assistant messages */
}

.pc-bubble--user {
  background: var(--bubble-user-bg);
  color: var(--bubble-user-text);
  border-bottom-right-radius: var(--radius-xs);
}

/* Typing cursor during streaming */
.pc-bubble--streaming::after {
  content: '▋';
  display: inline-block;
  animation: pc-cursor-blink 0.8s step-end infinite;
  color: var(--pc-blue);
  font-size: 0.9em;
  margin-left: 1px;
}

.pc-bubble--user.pc-bubble--streaming::after {
  color: rgba(255,255,255,0.7);
}

@keyframes pc-cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Markdown-like formatting inside bubbles */
.pc-bubble strong { font-weight: 600; }
.pc-bubble em     { font-style: italic; }
.pc-bubble code   {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(0,0,0,0.07);
  padding: 1px 5px;
  border-radius: 4px;
}
.pc-bubble ul {
  margin-left: var(--space-5);
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* --- Typing indicator (three dots — subtle fade-pulse, not heavy bounce) --- */
.pc-typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: pc-message-in var(--duration-base) var(--easing-out);
}

.pc-typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bubble-assist-bg);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-xs);
}

.pc-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-400);
  animation: pc-dot-fade 1.4s var(--easing-in-out) infinite;
}

.pc-typing-dot:nth-child(1) { animation-delay: 0s; }
.pc-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.pc-typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes pc-dot-fade {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.3; }
  35%            { transform: translateY(-4px); opacity: 0.9; }
}

/* ============================================================
   QUICK REPLY BUTTONS
   ============================================================ */

.pc-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  max-width: var(--max-chat-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--space-4);
  animation: pc-message-in var(--transition-base) ease-out;
}

@media (min-width: 768px) {
  .pc-quick-replies {
    padding: 0 var(--space-8);
    padding-left: calc(var(--space-8) + 36px + var(--space-3)); /* align with bubble */
  }
}

.pc-quick-reply-btn {
  background: var(--bg-primary);
  border: 1.5px solid var(--color-brand-200);
  color: var(--pc-blue);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  transition:
    background var(--duration-fast) var(--easing-out),
    color var(--duration-fast) var(--easing-out),
    border-color var(--duration-fast) var(--easing-out),
    box-shadow var(--duration-fast) var(--easing-out);
  cursor: pointer;
  white-space: nowrap;
  /* Minimum touch target */
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.pc-quick-reply-btn:hover {
  background: var(--color-brand-50);
  border-color: var(--pc-blue);
  color: var(--pc-blue-dark);
  box-shadow: var(--shadow-xs);
}

.pc-quick-reply-btn:active {
  background: var(--color-brand-100);
}

/* Mobile touch targets */
@media (max-width: 640px) {
  .pc-quick-reply-btn {
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
  }
}

/* ============================================================
   iter-41: Lemonade-style horizontal progress stepper at top of chat.
   4 steps: What you need → Your profile → Refining → Your matches.
   States: .pc-step / .pc-step--active / .pc-step--done.
   ============================================================ */

.pc-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 20px 12px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.pc-stepper::-webkit-scrollbar { display: none; }

.pc-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.3s ease;
  flex-shrink: 0;
}

.pc-step-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  flex-shrink: 0;
}

.pc-step-label {
  letter-spacing: 0.01em;
}

.pc-step-connector {
  flex: 1 1 24px;
  height: 2px;
  background: linear-gradient(90deg, #cbd5e1 0%, #cbd5e1 100%);
  min-width: 18px;
  max-width: 60px;
  border-radius: 1px;
  transition: background 0.35s ease;
}

/* Active step — highlighted, slight scale, pulse */
.pc-step--active {
  color: var(--pc-blue, #0ea5e9);
}
.pc-step--active .pc-step-circle {
  background: var(--pc-blue, #0ea5e9);
  border-color: var(--pc-blue, #0ea5e9);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
  animation: pc-step-pulse 1.8s ease-in-out infinite;
}
@keyframes pc-step-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.08); }
}

/* Done step — solid green with check */
.pc-step--done {
  color: #16a34a;
}
.pc-step--done .pc-step-circle {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.pc-step--done .pc-step-circle svg {
  display: none;
}
.pc-step--done .pc-step-circle::after {
  content: '✓';
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

/* Connector gets the green/blue fill when the prior step is done */
.pc-step--done + .pc-step-connector {
  background: linear-gradient(90deg, #16a34a 0%, var(--pc-blue, #0ea5e9) 100%);
}
.pc-step--done + .pc-step-connector + .pc-step--active ~ .pc-step-connector,
.pc-step--done + .pc-step-connector + .pc-step--done + .pc-step-connector {
  background: linear-gradient(90deg, #16a34a 0%, #16a34a 100%);
}

/* Mobile: shrink labels to icons-only under 600px */
@media (max-width: 600px) {
  .pc-step-label {
    display: none;
  }
  .pc-stepper {
    padding: 10px 14px 8px;
  }
  .pc-step-connector {
    max-width: 40px;
  }
}

/* ============================================================
   iter-35: Lemonade-style icon-card quick replies
   When quick_replies contain {label, icon} objects, the container
   gets .pc-quick-reply-grid and each chip uses .pc-quick-reply-card
   for a tap-friendly icon-on-top tile.
   ============================================================ */

.pc-quick-reply-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  max-width: 560px;
}

.pc-quick-reply-card {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-primary);
  border: 1.5px solid var(--color-brand-200, #e5e7eb);
  border-radius: 12px;
  padding: 14px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.18s ease-out;
  min-height: 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.pc-quick-reply-card:hover {
  border-color: var(--pc-blue);
  background: var(--color-brand-50, #f0f9ff);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px -2px rgba(14, 165, 233, 0.18);
}

.pc-quick-reply-card:active {
  transform: translateY(0);
}

.pc-qr-icon {
  font-size: 26px;
  line-height: 1;
  display: block;
}

.pc-qr-label {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary, #1f2937);
}

@media (max-width: 640px) {
  .pc-quick-reply-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  .pc-quick-reply-card {
    min-height: 72px;
    padding: 10px 6px;
  }
  .pc-qr-icon { font-size: 22px; }
  .pc-qr-label { font-size: 11.5px; }
}

/* Subtle entrance animation for chip grids */
.pc-quick-reply-grid .pc-quick-reply-card {
  opacity: 0;
  transform: translateY(4px);
  animation: pc-chip-enter 0.3s ease-out forwards;
}
.pc-quick-reply-grid .pc-quick-reply-card:nth-child(1) { animation-delay: 0.04s; }
.pc-quick-reply-grid .pc-quick-reply-card:nth-child(2) { animation-delay: 0.08s; }
.pc-quick-reply-grid .pc-quick-reply-card:nth-child(3) { animation-delay: 0.12s; }
.pc-quick-reply-grid .pc-quick-reply-card:nth-child(4) { animation-delay: 0.16s; }
.pc-quick-reply-grid .pc-quick-reply-card:nth-child(5) { animation-delay: 0.20s; }
.pc-quick-reply-grid .pc-quick-reply-card:nth-child(n+6) { animation-delay: 0.24s; }

@keyframes pc-chip-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   INPUT AREA
   ============================================================ */

.pc-input-area {
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-primary);
  flex-shrink: 0;
}

.pc-input-inner {
  max-width: var(--max-chat-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pc-input-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  background: var(--bg-primary);
  border: 1.5px solid var(--color-200);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  transition:
    border-color var(--duration-fast) var(--easing-out),
    box-shadow var(--duration-fast) var(--easing-out);
  box-shadow: var(--shadow-xs);
}

.pc-input-row:focus-within {
  border-color: var(--pc-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.pc-input-textarea {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  resize: none;
  min-height: 36px;
  max-height: 120px;
  line-height: 1.5;
  outline: none;
  padding: var(--space-1) 0;
}

.pc-input-textarea::placeholder {
  color: var(--text-muted);
}

.pc-input-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.pc-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.pc-icon-btn:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.pc-send-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--pc-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--duration-fast) var(--easing-out),
    box-shadow var(--duration-fast) var(--easing-out),
    opacity var(--duration-fast) var(--easing-out);
  flex-shrink: 0;
  /* Touch target */
  min-width: 44px;
  min-height: 44px;
}

.pc-send-btn:hover:not(:disabled) {
  background: var(--pc-blue-dark);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.pc-send-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.pc-send-btn:disabled {
  background: var(--color-300);
  opacity: 0.6;
  cursor: not-allowed;
}

/* Progress + privacy row */
.pc-input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.pc-progress-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.pc-progress-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

.pc-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--gray-200);
  border-radius: var(--radius-pill);
  overflow: hidden;
  max-width: 140px;
}

.pc-progress-fill {
  height: 100%;
  background: var(--pc-green);
  border-radius: var(--radius-pill);
  transition: width var(--transition-slow) ease-out;
  width: 0%;
}

.pc-privacy-badge {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

.pc-privacy-badge svg {
  color: var(--pc-green);
  flex-shrink: 0;
}

/* ============================================================
   SIDEBAR — STATUS PANEL
   ============================================================ */

.pc-sidebar-header {
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pc-sidebar-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.pc-sidebar-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.pc-sidebar-close:hover { background: var(--gray-200); }

.pc-sidebar-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  flex: 1;
}

/* Status list */
.pc-status-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pc-status-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  opacity: 0.4;
  transition: opacity var(--transition-base);
}

.pc-status-item.active  { opacity: 1; color: var(--text-primary); }
.pc-status-item.done    { opacity: 0.7; color: var(--pc-green-dark); }

.pc-status-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-status-icon--pending {
  border: 2px solid var(--gray-300);
  background: transparent;
}

.pc-status-icon--active {
  border: 2px solid var(--pc-blue);
  background: transparent;
  position: relative;
}

.pc-status-icon--active::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pc-blue);
  animation: pc-status-pulse 1.4s ease-in-out infinite;
}

@keyframes pc-status-pulse {
  0%, 100% { transform: scale(0.6); opacity: 0.6; }
  50%       { transform: scale(1); opacity: 1; }
}

.pc-status-icon--done {
  background: var(--pc-green);
  border: 2px solid var(--pc-green);
  color: white;
}

/* Carrier check item */
.pc-sidebar-carriers {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.pc-sidebar-carriers-title {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  margin-bottom: var(--space-2);
}

.pc-carrier-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin: 2px;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.pc-carrier-pill.found {
  border-color: var(--pc-green);
  color: var(--pc-green-dark);
}

/* Profile capture snippet */
.pc-profile-snippet {
  background: var(--pc-blue-light);
  border: 1px solid var(--pc-blue-mid);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.pc-profile-snippet-title {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--pc-blue-dark);
  letter-spacing: 0.01em;
  margin-bottom: var(--space-2);
}

.pc-profile-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--pc-blue-dark);
  padding: 3px 0;
}

.pc-profile-item svg {
  color: var(--pc-green);
  flex-shrink: 0;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.pc-toast-container {
  position: fixed;
  /* Bottom-right corner — unobtrusive */
  bottom: var(--space-6);
  right: var(--space-5);
  left: auto;
  transform: none;
  z-index: 500;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: var(--space-2);
  pointer-events: none;
}

@media (max-width: 480px) {
  .pc-toast-container {
    bottom: var(--space-4);
    right: var(--space-3);
  }
}

.pc-toast {
  /* Subtle brand-tinted background — calm, not alarming */
  background: var(--color-brand-700);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-md);
  animation: pc-toast-in var(--duration-base) var(--easing-out), pc-toast-out 0.25s var(--easing-in-out) 2.75s forwards;
  white-space: nowrap;
  max-width: 280px;
}

.pc-toast-icon {
  font-size: 16px;
}

@keyframes pc-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pc-toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* ============================================================
   CARRIER COMPARISON CARDS (inline)
   ============================================================ */

/* B-RESULTS-WIDEN 2026-05-17: Break the 680px prose cap for the
   results stage. Prose stays narrow elsewhere (readability), but the
   carrier-comparison grid needs room — was rendering each card at
   ~140px wide on desktop, wrapping text to 1-2 words per line.
   `:has()` widens the parent only when results are present. */
.pc-messages-inner:has(.pc-carrier-cards-wrap) {
  max-width: min(1360px, 100%);
}

.pc-carrier-cards-wrap {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-4);
  animation: pc-message-in var(--transition-base) ease-out;
}

@media (min-width: 768px) {
  .pc-carrier-cards-wrap {
    padding: 0 var(--space-6);
  }
}

.pc-carrier-cards-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 720px) {
  .pc-carrier-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

/* B-RESULTS-WIDEN 2026-05-17: 3-up threshold lowered from 960→1080px since
   the wrap now extends to 1240px on desktop. Each card lands at ~340px
   wide instead of ~140px — text reads in 4-6 word lines, not 1-2. */
@media (min-width: 1080px) {
  .pc-carrier-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Expander row + bundle CTA + what-if panel span all columns of the grid */
.pc-carrier-cards-grid > .pc-carrier-expander,
.pc-carrier-cards-grid > .pc-bundle-cta-row {
  grid-column: 1 / -1;
}

.pc-carrier-card {
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  position: relative;
  overflow: hidden;
  /* iter-33: entrance animation — cards slide-fade in cascade */
  opacity: 0;
  transform: translateY(8px);
  animation: pc-card-enter 0.4s ease-out forwards;
}
.pc-carrier-card:nth-child(1) { animation-delay: 0.05s; }
.pc-carrier-card:nth-child(2) { animation-delay: 0.15s; }
.pc-carrier-card:nth-child(3) { animation-delay: 0.25s; }
.pc-carrier-card:nth-child(4) { animation-delay: 0.35s; }
.pc-carrier-card:nth-child(5) { animation-delay: 0.45s; }

@keyframes pc-card-enter {
  to { opacity: 1; transform: translateY(0); }
}

.pc-carrier-card:hover {
  border-color: var(--pc-forest, #1e3a32);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* B-PALETTE-FIX 2026-05-17: top-card accents were saturated kelly green
   (#16a34a/#22c55e) — clashed with the forest brand (#1e3a32) and the
   warm cream/stone surfaces. Switched to forest with a subtle terra
   highlight for the badge. */
.pc-carrier-card--top {
  border-color: var(--pc-forest, #1e3a32);
  border-width: 2px;
  box-shadow: 0 0 0 1px rgba(30, 58, 50, 0.12), 0 6px 20px -4px rgba(30, 58, 50, 0.22);
}

.pc-carrier-card--top::before {
  content: '✓ Best Match';
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(90deg, var(--pc-forest, #1e3a32), #2a5145);
  color: var(--pc-cream, #faf7f2);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-align: center;
  padding: 5px;
  letter-spacing: 0.06em;
}

/* Subtle pulse on the top card to draw the eye */
.pc-carrier-card--top {
  animation: pc-card-enter 0.4s ease-out forwards, pc-top-pulse 2.4s ease-in-out 0.5s 2;
}
@keyframes pc-top-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(30, 58, 50, 0.12), 0 6px 20px -4px rgba(30, 58, 50, 0.22); }
  50%      { box-shadow: 0 0 0 1px rgba(30, 58, 50, 0.25), 0 8px 26px -4px rgba(30, 58, 50, 0.35); }
}

.pc-carrier-card--top .pc-carrier-card-logo {
  margin-top: var(--space-5);
}

.pc-carrier-logo-area {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pc-carrier-logo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--gray-600);
  flex-shrink: 0;
}

.pc-carrier-name {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
}

.pc-carrier-rate {
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--text-primary);
}

.pc-carrier-rate-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 1px;
}

.pc-carrier-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pc-carrier-feature {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.pc-carrier-feature svg {
  color: var(--pc-green);
  flex-shrink: 0;
}

.pc-carrier-cta {
  /* iter-68: brand forest default; inline styles in buildCardEl provide
     the primary (forest filled) vs secondary (white-with-forest-text) skins
     and override this fallback when present. */
  background: var(--pc-forest, #1e3a32);
  color: var(--pc-cream, #faf7f2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-align: center;
  transition: background var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: auto;
  text-decoration: none;
}

.pc-carrier-cta:hover {
  background: #15302a;
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--pc-cream, #faf7f2);
}

/* ============================================================
   FOOTER TRUST BAR
   ============================================================ */

.pc-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  flex-shrink: 0;
}

.pc-trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.pc-trust-item svg {
  flex-shrink: 0;
}

/* ============================================================
   MODALS
   ============================================================ */

.pc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding: 0 8px;
  animation: pc-overlay-in var(--transition-base) ease-out;
}

@media (min-width: 640px) {
  .pc-modal-overlay {
    align-items: center;
  }
}

@keyframes pc-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pc-modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  /* Constrain strictly to viewport — prevent horizontal overflow on any device */
  /* A11y: min(95vw, 480px) ensures modals never overflow on small screens */
  width: min(95vw, 480px);
  max-width: min(95vw, 480px);
  min-width: 0;
  box-sizing: border-box;
  margin: auto;
  max-height: 90dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-6) var(--space-5);
  animation: pc-modal-in var(--transition-base) ease-out;
}

@media (min-width: 640px) {
  .pc-modal {
    border-radius: var(--radius-xl);
  }
}

@keyframes pc-modal-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pc-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.pc-modal-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.pc-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.pc-modal-body p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

.pc-modal-consent-box {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.7;
  max-height: 140px;
  overflow-y: auto;
}

.pc-modal-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.pc-modal-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--pc-blue);
  cursor: pointer;
}

.pc-modal-checkbox-label {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.5;
}

.pc-modal-footer {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  border: none;
}

.pc-btn--primary {
  background: var(--pc-blue);
  color: white;
}

.pc-btn--primary:hover {
  background: var(--pc-blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.pc-btn--orange {
  background: var(--pc-orange);
  color: white;
}

.pc-btn--orange:hover {
  background: var(--pc-orange-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.pc-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.pc-btn--ghost:hover {
  background: var(--bg-secondary);
  border-color: var(--gray-400);
}

.pc-btn--full {
  width: 100%;
}

.pc-btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
}

.pc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   TOOLTIP
   ============================================================ */

.pc-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.pc-tooltip-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  line-height: 1.5;
  width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  text-align: center;
  font-weight: 400;
}

.pc-tooltip-trigger:hover .pc-tooltip-popup,
.pc-tooltip-trigger:focus .pc-tooltip-popup {
  opacity: 1;
}

/* iter-68k per-card bundle preview. Two-line layout: line 1 = label,
   line 2 = dollar value (bold, larger, forest). On narrow 3-up cards
   this is much more readable than wrap-anywhere flow. */
.pc-carrier-bundle-preview {
  display: block;
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(46,77,63,0.06);
  border: 1px solid rgba(46,77,63,0.18);
  border-radius: 8px;
  font-size: 11px;
  color: #5a6657;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  box-sizing: border-box;
}
.pc-carrier-bundle-preview__line1 {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--pc-clay, #8b7e6d);
  font-weight: 600;
}
.pc-carrier-bundle-preview__line2 {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--pc-forest, #1e3a32);
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -0.01em;
  margin-top: 1px;
}
.pc-carrier-bundle-preview__icon {
  font-weight: 700;
  color: var(--pc-forest, #1e3a32);
}
.pc-carrier-bundle-preview strong {
  color: var(--pc-forest, #1e3a32);
  font-weight: 700;
}

/* ============================================================
   iter-68 BUNDLE CTA (Option B for promise-gap)
   Single high-contrast row between the carrier grid and the what-if
   panel. Vertical-aware: HOME → bundle auto, AUTO + homeowner → bundle
   home, etc. Tap sends the user message that starts the cross-vertical
   collection.
   ============================================================ */
/* B-BUNDLE-CTA-PROMOTE 2026-05-17: promoted from tip card to hero CTA.
   User feedback: "still no cross sell from home to auto" — the row was
   wired up but visually subordinate, reading as an info tip rather than
   a primary next action. Reframed as a hero banner with forest
   background, white text, and a high-contrast cream button. */
.pc-bundle-cta-row {
  margin: 20px 0 4px 0;
  border-radius: 16px;
  border: 1px solid var(--pc-forest, #1e3a32);
  background: linear-gradient(135deg, var(--pc-forest, #1e3a32) 0%, #15302a 100%);
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 24px -10px rgba(30, 58, 50, 0.4);
}
.pc-bundle-cta-row::before {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 220px; height: 100%;
  background: radial-gradient(circle at 80% 50%, rgba(250, 247, 242, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.pc-bundle-cta-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  position: relative;
  z-index: 1;
}
.pc-bundle-cta-icon {
  flex: 0 0 44px;
  height: 44px;
  width: 44px;
  border-radius: 50%;
  background: var(--pc-cream, #faf7f2);
  color: var(--pc-forest, #1e3a32);
  font-weight: 800;
  font-size: 26px;
  line-height: 44px;
  text-align: center;
}
.pc-bundle-cta-body {
  flex: 1;
  min-width: 0;
}
.pc-bundle-cta-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--pc-cream, #faf7f2);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  line-height: 1.3;
}
.pc-bundle-cta-sub {
  font-size: 13px;
  color: rgba(250, 247, 242, 0.78);
  line-height: 1.45;
}
.pc-bundle-cta-btn {
  flex: 0 0 auto;
  padding: 13px 22px;
  border-radius: 12px;
  border: none;
  background: var(--pc-cream, #faf7f2);
  color: var(--pc-forest, #1e3a32);
  font-family: inherit;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  letter-spacing: -0.005em;
  box-shadow: 0 4px 12px -3px rgba(0, 0, 0, 0.18);
}
.pc-bundle-cta-btn:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -3px rgba(0, 0, 0, 0.25);
}
.pc-bundle-cta-btn:disabled {
  background: var(--pc-stone, #e8e2d6);
  color: var(--pc-clay, #8b7e6d);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
@media (max-width: 560px) {
  .pc-bundle-cta-inner {
    flex-wrap: wrap;
    padding: 16px 18px;
    gap: 12px;
  }
  .pc-bundle-cta-icon {
    flex: 0 0 36px;
    height: 36px;
    width: 36px;
    font-size: 22px;
    line-height: 36px;
  }
  .pc-bundle-cta-title {
    font-size: 15px;
  }
  .pc-bundle-cta-btn {
    flex: 1 1 100%;
    margin-top: 4px;
    padding: 12px 18px;
  }
}

/* ============================================================
   iter-67 MARKET-INTEL HEADS-UP (real-time intel #6)
   Surfaces curated carrier-availability constraints (e.g. State
   Farm paused in CA home) so users understand why a major brand
   they'd expect isn't in their matches.
   ============================================================ */
.pc-headsup {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(201, 127, 95, 0.10), rgba(201, 127, 95, 0.04));
  border: 1px solid rgba(201, 127, 95, 0.30);
  border-left: 3px solid var(--pc-terra, #c97f5f);
  border-radius: 10px;
  margin: 0 0 14px 0;
}
.pc-headsup__icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pc-terra, #c97f5f);
  color: var(--pc-cream, #faf7f2);
  font-weight: 800;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  margin-top: 1px;
}
.pc-headsup__body {
  flex: 1;
  min-width: 0;
}
.pc-headsup__title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--pc-ink, #1c2417);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.pc-headsup__text {
  font-size: 12.5px;
  color: #5a6657;
  line-height: 1.45;
}
.pc-headsup__text strong {
  color: var(--pc-ink, #1c2417);
  font-weight: 600;
}

/* ============================================================
   iter-66c WHAT-IF SIMULATOR (decision-support #5)
   Quick-scenario chips below the carrier grid; tap to compound
   industry-multiplier deltas and recompute rate ranges live.
   ============================================================ */
.pc-whatif {
  margin-top: 18px;
  padding: 16px;
  background: var(--pc-cream, #faf7f2);
  border: 1px solid var(--pc-stone, #e8e2d6);
  border-radius: 12px;
}
.pc-whatif__head {
  margin-bottom: 12px;
}
.pc-whatif__title {
  font-weight: 600;
  font-size: 15px;
  color: var(--pc-ink, #1c2417);
  letter-spacing: -0.005em;
}
.pc-whatif__sub {
  font-size: 12px;
  color: #6b7563;
  line-height: 1.4;
  margin-top: 3px;
}
.pc-whatif__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.pc-whatif__chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--pc-stone, #e8e2d6);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--pc-ink, #1c2417);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  font-family: inherit;
}
.pc-whatif__chip:hover {
  border-color: var(--pc-forest, #2e4d3f);
}
.pc-whatif__chip-plus {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--pc-forest, #2e4d3f);
}
.pc-whatif__chip--active {
  background: var(--pc-forest, #2e4d3f);
  border-color: var(--pc-forest, #2e4d3f);
  color: var(--pc-cream, #faf7f2);
}
.pc-whatif__chip--active .pc-whatif__chip-plus {
  color: var(--pc-cream, #faf7f2);
  transform: rotate(45deg);
  transform-origin: 50% 50%;
}
.pc-whatif__result {
  margin-top: 12px;
}
.pc-whatif__result:empty {
  margin-top: 0;
}
.pc-whatif__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--pc-stone, #e8e2d6);
  border-radius: 10px;
  margin-bottom: 8px;
}
.pc-whatif__summary-arrow {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.pc-whatif__summary-pct {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -0.01em;
}
.pc-whatif__summary-label {
  font-size: 12px;
  color: #5a6657;
  margin-top: 2px;
}
.pc-whatif__rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pc-whatif__row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #f0ebe1;
  border-radius: 8px;
  font-size: 12.5px;
}
.pc-whatif__row-name {
  font-weight: 600;
  color: var(--pc-ink, #1c2417);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-whatif__row-before {
  color: #8b8675;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  font-variant-numeric: tabular-nums;
}
.pc-whatif__row-arrow {
  color: var(--pc-clay, #8b7e6d);
  font-size: 13px;
}
.pc-whatif__row-after {
  font-weight: 700;
  color: var(--pc-forest, #2e4d3f);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) {
  .pc-whatif__row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px 10px;
  }
  .pc-whatif__row-before { text-decoration: none; opacity: 0.7; font-size: 11.5px; }
  .pc-whatif__row-arrow { display: none; }
}

/* ============================================================
   iter-66 SIDE-BY-SIDE COMPARE (decision-support #5)
   Pill toggle above carrier grid; comparison table view as
   alternative to stacked cards. Matches sage palette.
   ============================================================ */
.pc-view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--pc-cream, #faf7f2);
  border: 1px solid var(--pc-stone, #e8e2d6);
  margin: 0 0 14px 0;
  align-self: flex-start;
}
.pc-view-toggle__btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--pc-ink, #1c2417);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.pc-view-toggle__btn:hover {
  background: rgba(46, 77, 63, 0.06);
}
.pc-view-toggle__btn--active {
  background: var(--pc-forest, #2e4d3f);
  color: var(--pc-cream, #faf7f2);
  font-weight: 600;
}
.pc-view-toggle__btn--active:hover {
  background: var(--pc-forest, #2e4d3f);
}

.pc-compare-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--pc-stone, #e8e2d6);
  background: #fff;
  /* B-COMPARE-SCROLL-AFFORDANCE 2026-05-18: when the table is wider than
     the container (narrow viewports under ~1100px), users were only seeing
     column 1 + half of column 2 — no visual cue that 2 more carriers
     exist to the right. Right-edge gradient signals "more →" until the
     user scrolls, then disappears. */
  background-image:
    linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), #fff 70%),
    linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0)),
    linear-gradient(to left,  rgba(0,0,0,0.06), rgba(0,0,0,0));
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-repeat: no-repeat;
  background-color: #fff;
  background-size: 32px 100%, 32px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}
.pc-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.4;
  /* B-COMPARE-TABLE-FIT-2 2026-05-18 (iter-79): iter-77's min-width:440px
     was insufficient — at narrow mainCol (~600px when the right STATUS
     sidebar is wide), the auto-sized columns still rendered ~150px each
     for "State Farm" + logo + "TOP MATCH" badge. 4 × 150 + 96 corner =
     696px = wider than container. Result: only 1.5 columns visible.
     Fix: table-layout:fixed so column widths are constrained, not
     content-driven. Min-width set so 4 carrier cols × 88px + 80px corner
     = 432px fits at narrow mainCol. */
  min-width: 432px;
  table-layout: fixed;
}
.pc-compare-corner {
  background: var(--pc-cream, #faf7f2);
  border-bottom: 1px solid var(--pc-stone, #e8e2d6);
  border-right: 1px solid var(--pc-stone, #e8e2d6);
  /* B-COMPARE-CORNER-FIT-2 2026-05-18 (iter-79): row labels (J.D. Power
     claims / App rating) still need ~76-80px to read clean. 80px corner +
     4 × 88px columns = 432px total — fits 432px min-width container. */
  width: 80px;
  font-size: 11px;
  white-space: normal;
}
.pc-compare-table .pc-compare-colhead {
  /* iter-79: each carrier column gets equal share of remaining width
     (table - corner). At min-width 432px: (432-80)/4 = 88px per col.
     The colhead's flex inner-layout (logo above name above badge) makes
     this work even when the carrier name needs to wrap. */
  width: 88px;
}
.pc-compare-colhead {
  background: var(--pc-cream, #faf7f2);
  padding: 12px 10px;
  border-bottom: 1px solid var(--pc-stone, #e8e2d6);
  border-right: 1px solid var(--pc-stone, #e8e2d6);
  text-align: center;
  vertical-align: bottom;
  font-weight: 600;
}
.pc-compare-colhead:last-child {
  border-right: none;
}
.pc-compare-colhead--top {
  background: linear-gradient(180deg, rgba(46,77,63,0.08), var(--pc-cream, #faf7f2));
}
.pc-compare-colhead__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pc-compare-colhead__inner img {
  height: 28px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
}
.pc-compare-colhead__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--pc-ink, #1c2417);
}
.pc-compare-colhead__badge {
  display: inline-block;
  margin-top: 2px;
  background: var(--pc-forest, #2e4d3f);
  color: var(--pc-cream, #faf7f2);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pc-compare-rowlabel {
  background: var(--pc-cream, #faf7f2);
  padding: 9px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: #5a6657;
  border-bottom: 1px solid #f0ebe1;
  border-right: 1px solid var(--pc-stone, #e8e2d6);
  white-space: nowrap;
}
.pc-compare-cell {
  padding: 9px 10px;
  text-align: center;
  border-bottom: 1px solid #f0ebe1;
  border-right: 1px solid #f0ebe1;
  color: var(--pc-ink, #1c2417);
  vertical-align: middle;
}
.pc-compare-cell:last-child {
  border-right: none;
}
.pc-compare-cell--top {
  background: rgba(46, 77, 63, 0.03);
}
.pc-compare-cta-row .pc-compare-rowlabel,
.pc-compare-cta-row .pc-compare-cell {
  border-bottom: none;
}
.pc-compare-cta-cell {
  padding: 12px 10px 14px;
}
.pc-compare-cta {
  display: inline-block;
  padding: 8px 14px;
  background: var(--pc-forest, #2e4d3f);
  color: var(--pc-cream, #faf7f2);
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.18s ease;
  white-space: nowrap;
}
.pc-compare-cta:hover {
  background: #233d31;
}
.pc-compare-note {
  padding: 10px 12px;
  font-size: 12px;
  color: #6b7563;
  border-top: 1px solid var(--pc-stone, #e8e2d6);
  background: var(--pc-cream, #faf7f2);
  text-align: center;
}

/* ============================================================
   iter-66 INLINE TERM EXPLAINER (decision-support #5)
   Insurance jargon wrapped post-render with a forest-tinted
   dotted underline + hover/tap popover in cream-on-forest palette.
   ============================================================ */
.pc-glossary-term {
  position: relative;
  cursor: help;
  border-bottom: 1px dashed var(--pc-forest, #2e4d3f);
  color: inherit;
  outline: none;
}
.pc-glossary-term:hover,
.pc-glossary-term:focus {
  color: var(--pc-forest, #2e4d3f);
}
.pc-glossary-term__popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--pc-forest, #2e4d3f);
  color: var(--pc-cream, #faf7f2);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  width: 240px;
  max-width: 80vw;
  box-shadow: 0 6px 16px rgba(46, 77, 63, 0.22);
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  text-align: left;
  white-space: normal;
}
.pc-glossary-term__popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--pc-forest, #2e4d3f);
}
.pc-glossary-term:hover .pc-glossary-term__popup,
.pc-glossary-term:focus .pc-glossary-term__popup,
.pc-glossary-term:focus-within .pc-glossary-term__popup {
  opacity: 1;
}
@media (max-width: 480px) {
  .pc-glossary-term__popup {
    left: 0;
    transform: none;
    width: min(240px, 80vw);
  }
  .pc-glossary-term__popup::after {
    left: 20px;
    transform: none;
  }
}

/* ============================================================
   ONBOARDING PAGE
   ============================================================ */

.pc-onboard {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.pc-onboard-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-5);
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.pc-onboard-badge {
  background: var(--pc-blue-light);
  color: var(--pc-blue);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.pc-onboard-headline {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

@media (max-width: 480px) {
  .pc-onboard-headline { font-size: var(--font-size-2xl); }
}

.pc-onboard-sub {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-8);
}

.pc-onboard-props {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  margin-bottom: var(--space-8);
  text-align: left;
}

.pc-onboard-prop {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

.pc-onboard-prop-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--pc-blue-light);
  color: var(--pc-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pc-onboard-cta-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
}

.pc-onboard-cta {
  width: 100%;
  max-width: 320px;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-md);
  font-weight: 600;
  /* #C44328 = 5.3:1 on white — WCAG AA compliant (was #FF7056 @ 2.73:1) */
  background: #C44328;
  color: #FFFFFF;
  text-align: center;
  border: none;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--easing-out),
    box-shadow var(--duration-fast) var(--easing-out);
  box-shadow: 0 3px 12px rgba(196, 67, 40, 0.30);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  letter-spacing: -0.01em;
  /* Touch target */
  min-height: 52px;
}

.pc-onboard-cta:hover {
  background: #A83520;
  box-shadow: 0 5px 18px rgba(196, 67, 40, 0.38);
  text-decoration: none;
  color: #FFFFFF;
}

.pc-onboard-cta:active {
  transform: scale(0.99);
  box-shadow: 0 2px 8px rgba(255, 112, 86, 0.25);
}

.pc-onboard-no-commit {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Trust badges row */
.pc-onboard-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.pc-onboard-trust-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

/* ============================================================
   TY PAGE
   ============================================================ */

.pc-ty {
  min-height: 100dvh;
  background: var(--bg-secondary);
  font-family: var(--font-sans);
}

.pc-ty-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  text-align: center;
}

.pc-ty-hero {
  /* Subtle slate gradient — financial/trustworthy not garish */
  background: linear-gradient(160deg, var(--color-brand-700) 0%, var(--color-brand-900) 100%);
  color: white;
  padding: var(--space-12) var(--space-5) var(--space-10);
  text-align: center;
}

.pc-ty-hero h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.pc-ty-hero p {
  font-size: var(--font-size-md);
  opacity: 0.85;
}

.pc-ty-body {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5);
}

.pc-ty-carriers {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .pc-ty-carriers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .pc-ty-carriers {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pc-ty-card {
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.pc-ty-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--pc-blue);
}

.pc-ty-card--featured::before {
  content: '#1 Match for your profile';
  position: absolute;
  top: 0; left: 0; right: 0;
  /* Subtle accent — informative, not garish */
  background: var(--color-brand-600);
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 5px;
  letter-spacing: 0.03em;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.pc-ty-card--featured {
  border-color: var(--color-brand-300);
  box-shadow: var(--shadow-md);
}

.pc-ty-human-handoff {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  margin-top: var(--space-6);
}

.pc-ty-disclosure {
  margin-top: var(--space-5);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

/* ============================================================
   GLOSSARY PAGE
   ============================================================ */

.pc-glossary {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5);
  font-family: var(--font-sans);
}

.pc-glossary h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.pc-glossary-subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.pc-glossary-search {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  background: var(--bg-primary);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  outline: none;
  transition: border-color var(--transition-fast);
}

.pc-glossary-search:focus {
  border-color: var(--pc-blue);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}

.pc-glossary-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pc-glossary-term {
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) 0;
}

.pc-glossary-term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: var(--space-3);
}

.pc-glossary-term-word {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--pc-blue);
}

.pc-glossary-term-def {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: var(--space-2);
  display: none;
}

.pc-glossary-term.open .pc-glossary-term-def {
  display: block;
}

/* ============================================================
   TEST FLOW PAGE
   ============================================================ */

.pc-test-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.pc-test-panel h3 {
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.pc-test-log {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--gray-900);
  color: #A8FF78;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.pc-test-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.pc-test-status--pass { background: var(--pc-green-light); color: var(--pc-green-dark); }
.pc-test-status--fail { background: #FEE2E2; color: #B91C1C; }
.pc-test-status--run  { background: var(--pc-blue-light); color: var(--pc-blue-dark); }
.pc-test-status--wait { background: var(--gray-100); color: var(--gray-500); }

/* ============================================================
   DARK MODE TOGGLE
   ============================================================ */

.pc-theme-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.pc-theme-toggle:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

/* ============================================================
   SAVING INDICATOR
   ============================================================ */

.pc-saving-indicator {
  position: fixed;
  top: var(--space-3);
  right: var(--space-4);
  background: var(--gray-800);
  color: white;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  z-index: 600;
}

.pc-saving-indicator.visible {
  opacity: 1;
}

.pc-saving-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pc-green);
  animation: pc-saving-pulse 1.2s ease-in-out infinite;
}

@keyframes pc-saving-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ============================================================
   UTILITIES
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }

/* Focus visible — accessible but not intrusive */
:focus-visible {
  outline: 2px solid var(--pc-blue);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Ensure buttons never suppress focus-visible (fixes P1 missing focus indicators) */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--pc-blue);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Buttons that explicitly remove outlines must restore focus-visible */
button {
  /* Only remove generic outline — :focus-visible still fires */
  outline: none;
}
button:focus-visible {
  outline: 2px solid var(--pc-blue) !important;
  outline-offset: 2px !important;
}

/* Consistent icon-button touch targets (44px WCAG AA — reinforced) */
.pc-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

/* Logo link — minimum touch-target wrapper (WCAG 2.5.5) */
.pc-logo {
  min-height: 44px;
  padding: var(--space-1) var(--space-2);
  margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-2));
}

/* Footer anchor links — prevent sub-44px tap targets */
.pc-footer a,
.pc-trust-item a,
.pc-onboard-trust a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-1) var(--space-2);
}

/* Sidebar footer help link */
.pc-sidebar-body a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-1) var(--space-2);
}

/* ============================================================
   AUTO-SAVE TOAST REFINEMENT
   ============================================================ */
.pc-saving-indicator {
  background: var(--color-brand-50);
  color: var(--color-brand-700);
  border: 1px solid var(--color-brand-200);
}

.pc-saving-dot {
  background: var(--pc-blue);
}

/* ============================================================
   ERROR STATE — warm, not alarming
   ============================================================ */
.pc-bubble--error {
  border: 1.5px solid var(--color-200);
  background: var(--color-50);
}

/* ============================================================
   STATUS EVENTS — fade in/out
   ============================================================ */
.pc-status-item {
  transition:
    opacity var(--duration-base) var(--easing-out),
    color var(--duration-base) var(--easing-out);
}

/* ============================================================
   CARRIER CARD REFINEMENTS
   ============================================================ */
.pc-carrier-cta {
  transition:
    background var(--duration-fast) var(--easing-out),
    box-shadow var(--duration-fast) var(--easing-out);
}

.pc-carrier-cta:hover {
  box-shadow: 0 3px 10px rgba(255, 107, 53, 0.28);
}

/* ============================================================
   ONBOARDING PROP ICON — softer
   ============================================================ */
.pc-onboard-prop-icon {
  background: var(--color-brand-50);
  color: var(--color-brand-600);
  border-radius: var(--radius-md);
  /* Slight upgrade from pure square */
}

/* ============================================================
   PROFILE SNIPPET — softer brand palette
   ============================================================ */
.pc-profile-snippet {
  background: var(--color-brand-50);
  border: 1px solid var(--color-brand-100);
}

.pc-profile-snippet-title {
  color: var(--color-brand-700);
}

.pc-profile-item {
  color: var(--color-brand-800);
}

/* ============================================================
   GLOSSARY SEARCH FOCUS
   ============================================================ */
.pc-glossary-search:focus {
  border-color: var(--pc-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

/* ============================================================
   MODAL REFINEMENT — backdrop softer
   ============================================================ */
.pc-modal-overlay {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ============================================================
   VOICE HANDOFF — inline card style (not modal)
   ============================================================ */
.pc-voice-handoff-card {
  background: var(--bg-primary);
  border: 1.5px solid var(--color-200);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  margin: var(--space-4) 0;
}

.pc-voice-handoff-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-brand-50);
  color: var(--pc-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pc-voice-handoff-card-body {
  flex: 1;
}

.pc-voice-handoff-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.pc-voice-handoff-card-sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

@media (max-width: 480px) {
  .pc-voice-handoff-card {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================================
   SKIP-TO-CONTENT LINK (keyboard / screen-reader navigation)
   ============================================================ */
.pc-skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  background: var(--pc-blue);
  color: #FFFFFF;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.1s;
  white-space: nowrap;
}
.pc-skip-link:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* ============================================================
   SAFARI iOS SAFE-AREA SUPPORT
   Addresses 100vh / fixed-positioning quirks on iOS Safari
   ============================================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pc-app {
    /* Dynamic viewport height — avoids iOS bottom bar overlap */
    height: 100dvh;
    padding-bottom: 0;
  }
  .pc-input-area {
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  }
  .pc-footer {
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  }
  .pc-sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* Modals — avoid home-indicator overlap */
  .pc-modal-overlay {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================================================
   HIGH CONTRAST MODE (Windows Forced Colors / iOS Increase Contrast)
   ============================================================ */
@media (forced-colors: active) {
  .pc-bubble--user {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
  .pc-btn--primary,
  .pc-carrier-cta,
  .pc-onboard-cta,
  .pc-send-btn {
    forced-color-adjust: none;
    background: ButtonText;
    color: ButtonFace;
    border: 2px solid ButtonText;
  }
  .pc-icon-btn {
    forced-color-adjust: none;
    border: 1px solid ButtonText;
  }
  :focus-visible {
    outline: 2px solid Highlight !important;
  }
  .pc-progress-fill {
    forced-color-adjust: none;
    background: Highlight;
  }
}

/* ============================================================
   TEXT SCALING — 200% browser zoom safety
   ============================================================ */
@media (min-resolution: 1dppx) {
  .pc-bubble {
    /* Ensure text wraps at all zoom levels */
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
  .pc-input-textarea {
    /* Prevent horizontal scroll at 200% zoom */
    max-width: 100%;
  }
  .pc-quick-replies {
    /* Wrap at 200% zoom without overflow */
    overflow-x: hidden;
  }
}

/* Minimum readable size at 200% zoom */
@media (min-width: 1px) {
  .pc-toast {
    max-width: min(280px, 90vw);
  }
}

/* ============================================================
   PRINT STYLESHEET — TY page + chat clean print
   ============================================================ */
@media print {
  /* Hide UI chrome */
  .pc-header,
  .pc-footer,
  .pc-input-area,
  .pc-sidebar,
  .pc-toast-container,
  .pc-saving-indicator,
  .pc-quick-replies,
  .pc-theme-toggle,
  #pc-sidebar-toggle,
  .ty-page-header,
  .ty-human-handoff,
  #voice-handoff-modal {
    display: none !important;
  }

  /* Ensure content is visible */
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .pc-bubble,
  .pc-ty-card,
  .ty-disclosure {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .pc-carrier-cta,
  .pc-btn {
    background: #333 !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }

  /* Page breaks */
  .pc-ty-card {
    break-inside: avoid;
  }
}

/* ============================================================
   FIREFOX-SPECIFIC FIXES
   ============================================================ */
@-moz-document url-prefix() {
  /* Firefox line-height compensation */
  .pc-bubble {
    line-height: 1.65;
  }

  /* Firefox sticky positioning */
  .pc-header {
    position: sticky;
    top: 0;
  }

  /* Firefox smooth scroll */
  .pc-messages {
    scroll-behavior: smooth;
  }
}

/* ============================================================
   MOMENTUM SCROLL — iOS Safari (-webkit-overflow-scrolling: touch)
   ============================================================ */
.pc-messages,
.pc-sidebar,
.pc-modal,
.pc-modal-consent-box {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ============================================================
   AUTOFILL STYLING — Chrome/Android normalization
   ============================================================ */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-primary) inset;
  -webkit-text-fill-color: var(--text-primary);
  transition: background-color 5000s ease-in-out 0s;
}

/* ============================================================
   FONT LOADING — font-display: swap fallback
   (Google Fonts CDN handles this via display=swap param, but
    if self-hosting, ensure these fallbacks are loaded)
   ============================================================ */
@font-face {
  font-family: 'Inter-fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Helvetica');
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
  size-adjust: 107%;
}

/* ============================================================
   LONG CONTENT SAFETY — 200+ word responses
   ============================================================ */
.pc-bubble p + p {
  margin-top: var(--space-3);
}
.pc-bubble ol {
  margin-left: var(--space-5);
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.pc-bubble blockquote {
  border-left: 3px solid var(--color-brand-200);
  padding-left: var(--space-3);
  color: var(--text-secondary);
  margin: var(--space-2) 0;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.pc-messages-inner:empty::before {
  content: '';
  display: none;
}

/* ============================================================
   LOADING STATES — ensure every async state has indicator
   ============================================================ */
.pc-send-btn[data-loading="true"] {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}
.pc-send-btn[data-loading="true"]::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: pc-spin 0.7s linear infinite;
}
@keyframes pc-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   ERROR STATES
   ============================================================ */
.pc-error-banner {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================================
   EDGE INPUT SAFETY — emoji, RTL, long strings
   ============================================================ */
.pc-input-textarea {
  unicode-bidi: plaintext;
  overflow-wrap: break-word;
}
.pc-bubble {
  unicode-bidi: plaintext;
}

/* ============================================================
   ADDITIONAL TOUCH TARGETS — inline links and headers
   ============================================================ */

/* Glossary term headers — full 44px tap zone */
.pc-glossary-term-header {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Onboarding "already started" link */
.onboard-already a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-1);
}

/* Disclosure / footer inline links — hit area expansion */
.ty-disclosure a,
.pc-onboard-trust a,
.pc-footer a,
.pc-trust-item a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-1);
}

/* Lang toggle */
#pc-lang-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-2);
}

/* TCPA modal link inside consent box */
.pc-modal-consent-box a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-1);
}

/* TCPA checkbox — expand label tap area */
.pc-modal-checkbox-row {
  min-height: 44px;
  align-items: center;
}

/* ============================================================
   TAP-ZONE SPACING — min 8px between adjacent interactive elements
   ============================================================ */
.pc-input-actions {
  gap: var(--space-2); /* 8px min between mic + send */
}
.pc-header-actions {
  gap: var(--space-2); /* 8px min between theme toggle + sidebar toggle */
}
.pc-modal-footer {
  gap: var(--space-3); /* 12px between modal CTA buttons */
}

/* ============================================================
   AGENT D EDITS START
   S2 — Confetti burst on TY page
   S4 — Sidebar step circle + animated transitions
   E1 — Profile artifact card (TY page)
   F6 — Mic listening state
   ============================================================ */

/* --- S4: Status step circles with smooth fade + check animation --- */
.pc-status-item {
  transition: opacity var(--duration-base) var(--easing-out),
              color var(--duration-base) var(--easing-out);
}

@keyframes pc-step-check-in {
  from { transform: scale(0.5) rotate(-45deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);     opacity: 1; }
}

.pc-status-icon--done svg {
  animation: pc-step-check-in var(--duration-base) var(--easing-bounce-rare) forwards;
}

@keyframes pc-step-spin {
  to { transform: rotate(360deg); }
}

.pc-status-icon--active::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--pc-blue);
  animation: pc-step-spin 0.9s linear infinite;
}

/* --- S2: Confetti burst (CSS-only, no JS lib) --- */
@keyframes pc-confetti-up {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translate(var(--tx, 20px), var(--ty, -120px)) rotate(var(--tr, 360deg)) scale(0.3); opacity: 0; }
}

.pc-confetti-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: pc-confetti-up 1.2s var(--easing-out) forwards;
  will-change: transform, opacity;
}

/* --- E1: Insurance Profile Card (TY page) --- */
.pc-profile-card {
  background: linear-gradient(135deg, var(--color-brand-800) 0%, var(--color-brand-900) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  max-width: 580px;
  margin: var(--space-6) auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.pc-profile-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.pc-profile-card-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-2);
}

.pc-profile-card-headline {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  line-height: 1.25;
}

.pc-profile-card-line {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.80);
  margin-bottom: var(--space-1);
}

.pc-profile-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.pc-profile-card-tag {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.pc-profile-card-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

.pc-profile-card-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.30);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast);
  min-height: 44px;
  white-space: nowrap;
}

.pc-profile-card-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* --- F6: Mic active visual --- */
#pc-mic-btn[data-listening="true"] {
  color: var(--pc-orange);
  animation: pc-avatar-pulse 1.0s ease-in-out infinite;
}

/* AGENT D EDITS END */

/* ============================================================
   AGENT P EDITS START — FOUNDATIONAL POLISH PASS 2026-05-12
   Levers P1–P9, P11 applied here.
   DO NOT OVERLAP with AGENT D EDITS above.
   ============================================================ */

/* ============================================================
   P1 — TYPOGRAPHY SCALE
   Inter Display for headers; locked 6-step REM scale; JetBrains Mono for $$$
   ============================================================ */
:root {
  /* Locked 6-step size scale (REM on 16px root) */
  --pc-text-xs:   0.75rem;   /* 12px */
  --pc-text-sm:   0.875rem;  /* 14px */
  --pc-text-base: 1rem;      /* 16px */
  --pc-text-md:   1.25rem;   /* 20px */
  --pc-text-lg:   1.75rem;   /* 28px */
  --pc-text-xl:   2.5rem;    /* 40px */

  /* Weight scale */
  --pc-weight-body:     400;
  --pc-weight-ui:       500;
  --pc-weight-emphasis: 600;
  --pc-weight-heading:  700;

  /* Tracking */
  --pc-tracking-tight:  -0.02em;
  --pc-tracking-snug:   -0.01em;
  --pc-tracking-normal:  0em;
  --pc-tracking-caps:    0.04em;

  /* Line-height */
  --pc-leading-body:     1.5;
  --pc-leading-heading:  1.3;
  --pc-leading-number:   1.0;

  /* Inter Display = Inter optical size variant (opsz 32) */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Apply display font + tracking to h1–h3 and key headline classes */
h1, h2, h3,
.pc-modal-title,
.pc-onboard-headline,
.pc-ty-hero h1,
.pc-glossary h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  letter-spacing: var(--pc-tracking-tight);
  line-height: var(--pc-leading-heading);
  font-weight: var(--pc-weight-heading);
}

/* JetBrains Mono for all money/rate values */
.pc-carrier-rate,
.cr-price-headline,
[class*="-price"],
[class*="-rate"] {
  font-family: var(--font-mono);
  line-height: var(--pc-leading-number);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   P2 — COLOR DISCIPLINE
   Slate token aliases + semantic tokens
   ============================================================ */
:root {
  /* Slate 8-step scale */
  --slate-50:  var(--color-50);
  --slate-100: var(--color-100);
  --slate-200: var(--color-200);
  --slate-300: var(--color-300);
  --slate-400: var(--color-400);
  --slate-500: var(--color-500);
  --slate-600: var(--color-600);
  --slate-700: var(--color-700);
  --slate-800: var(--color-800);
  --slate-900: var(--color-900);

  /* Brand blue */
  --color-blue-500: #2563EB;
  --color-blue-700: #1D4ED8;

  /* Coral accent — AA compliant: 5.3:1 on white */
  --color-coral-500: #C44328;
  --color-coral-600: #A83520;

  /* Semantic */
  --color-semantic-success: #0F766E;  /* teal-700 — 4.56:1 on white — AA */
  --color-semantic-warning: #D97706;  /* amber-600 — 4.5:1 on white */
  --color-semantic-danger:  #DC2626;  /* red-600 */
}

/* iter-68: removed the legacy !important coral override. Inline styles on
   each CTA now drive the color, allowing the primary (forest filled) vs
   secondary (white-with-forest-text) visual hierarchy from chat.js to render
   as designed. Only the onboarding/cr-* CTAs keep an enforced forest default
   for pages that lack inline styling. */
.pc-onboard-cta,
.cr-cta-btn,
.cr-top-pick-badge {
  background: var(--pc-forest, #1e3a32);
  color: var(--pc-cream, #faf7f2);
}
.pc-onboard-cta:hover,
.cr-cta-btn:hover {
  background: #15302a;
}

/* ============================================================
   P3 — SPACING RHYTHM
   --pc-space-* at 4/8/12/16/24/32/48/64
   ============================================================ */
:root {
  --pc-space-1:   4px;
  --pc-space-2:   8px;
  --pc-space-3:  12px;
  --pc-space-4:  16px;
  --pc-space-6:  24px;
  --pc-space-8:  32px;
  --pc-space-12: 48px;
  --pc-space-16: 64px;
}

/* Snap onboarding badge padding */
.pc-onboard-badge {
  padding: var(--pc-space-2) var(--pc-space-3);
}

/* ============================================================
   P4 — ANIMATION CURVES
   Snap + smooth + duration tokens
   ============================================================ */
:root {
  --pc-curve-snap:   cubic-bezier(0.32, 0.72, 0, 1);
  --pc-curve-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --pc-duration-fast:  150ms;
  --pc-duration-base:  250ms;
  --pc-duration-slow:  400ms;
}

/* Snap curve for hover-lift/button-press/chip-selection */
.pc-quick-reply-btn,
.pc-send-btn,
.pc-entry-chip {
  transition:
    background   var(--pc-duration-fast) var(--pc-curve-snap),
    color        var(--pc-duration-fast) var(--pc-curve-snap),
    border-color var(--pc-duration-fast) var(--pc-curve-snap),
    box-shadow   var(--pc-duration-fast) var(--pc-curve-snap),
    transform    var(--pc-duration-fast) var(--pc-curve-snap);
}

/* Smooth curve for panel slides */
.pc-sidebar {
  transition: transform var(--pc-duration-slow) var(--pc-curve-smooth);
}

/* Progress fill smooth */
.pc-progress-fill {
  transition: width var(--pc-duration-slow) var(--pc-curve-smooth);
}

/* ============================================================
   P5 — FOCUS RINGS
   iter-68c: switched from legacy coral to brand forest. Coral reads as
   an error indicator on a text input; forest keeps a11y contrast while
   matching the sage palette.
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--pc-forest, #1e3a32) !important;
  outline-offset: 2px;
  border-radius: var(--radius-xs);
  box-shadow: 0 0 0 4px rgba(30, 58, 50, 0.18) !important;
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.pc-quick-reply-btn:focus-visible,
.pc-entry-chip:focus-visible {
  outline: 2px solid var(--pc-forest, #1e3a32) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(30, 58, 50, 0.18) !important;
}

/* ============================================================
   P6 — SKELETON LOADING
   Shimmer class + component-level applications
   ============================================================ */
.pc-skeleton {
  background: linear-gradient(
    90deg,
    var(--slate-100) 0%,
    var(--slate-200) 40%,
    var(--slate-100) 80%
  );
  background-size: 200% 100%;
  animation: pc-shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}

@keyframes pc-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton carrier card */
.pc-carrier-card.pc-skeleton-card .pc-carrier-logo-placeholder,
.pc-carrier-card.pc-skeleton-card .pc-carrier-name,
.pc-carrier-card.pc-skeleton-card .pc-carrier-rate {
  background: linear-gradient(90deg, var(--slate-100) 0%, var(--slate-200) 40%, var(--slate-100) 80%);
  background-size: 200% 100%;
  animation: pc-shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
  color: transparent;
}

/* Profile sidebar empty state */
#pc-profile-list:empty::after {
  content: '';
  display: block;
  height: 14px;
  width: 80%;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--slate-100) 0%, var(--slate-200) 40%, var(--slate-100) 80%);
  background-size: 200% 100%;
  animation: pc-shimmer 1.4s infinite linear;
  margin-bottom: 8px;
}

/* ============================================================
   P7 — ICONOGRAPHY LOCK
   1.75px stroke, rounded caps, consistent viewBox
   ============================================================ */
.pc-icon-btn svg,
.pc-avatar svg,
.pc-status-icon svg,
.pc-quick-reply-btn svg,
.pc-trust-item svg,
.pc-privacy-badge svg,
.pc-onboard-prop-icon svg,
.pc-profile-item svg,
.pc-carrier-feature svg,
.pc-voice-handoff-card-icon svg,
.pc-logo-icon svg,
.pc-theme-toggle svg,
.pc-send-btn svg,
.pc-mic-btn svg {
  stroke-width: 1.75px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Size discipline */
.pc-trust-item svg,
.pc-privacy-badge svg,
.pc-carrier-feature svg {
  width: 16px;
  height: 16px;
}
.pc-avatar svg,
.pc-icon-btn svg {
  width: 18px;
  height: 18px;
}
.pc-onboard-prop-icon svg {
  width: 24px;
  height: 24px;
}

/* ============================================================
   P8 — MOBILE BOTTOM SHEET
   iOS-style 3-position drawer at <768px
   ============================================================ */
@media (max-width: 767px) {
  .pc-sidebar {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto;
    max-height: 85dvh;
    border-left: none !important;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    /* Default = peek: only show 52px pull handle area */
    transform: translateY(calc(100% - 52px));
    transition: transform var(--pc-duration-slow) var(--pc-curve-snap);
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    will-change: transform;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
  }

  .pc-sidebar.sheet-half {
    transform: translateY(40%);
  }

  .pc-sidebar.sheet-full,
  .pc-sidebar.open {
    transform: translateY(0);
  }
}

/* Pull handle bar */
.pc-sheet-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  cursor: grab;
  flex-shrink: 0;
}
.pc-sheet-handle::after {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--slate-300);
  border-radius: var(--radius-pill);
}

@media (min-width: 768px) {
  .pc-sheet-handle { display: none; }
}

/* Backdrop */
.pc-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--pc-duration-slow) var(--pc-curve-smooth);
}
.pc-sheet-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

@media (min-width: 768px) {
  .pc-sheet-backdrop { display: none !important; }
}

/* ============================================================
   P9 — DARK MODE PARITY
   ============================================================ */
[data-theme="dark"] .pc-bubble--assist {
  background: var(--slate-800) !important;
  color: var(--slate-100) !important;
}

[data-theme="dark"] .pc-quick-reply-btn {
  background: var(--slate-800);
  border-color: var(--color-brand-700);
  color: var(--slate-200);
}
[data-theme="dark"] .pc-quick-reply-btn:hover {
  background: var(--slate-700);
  border-color: var(--color-brand-400);
  color: var(--slate-100);
}

[data-theme="dark"] .pc-carrier-card,
[data-theme="dark"] .cr-card,
[data-theme="dark"] .pc-ty-card {
  background: var(--slate-800);
  border-color: var(--slate-700);
}
[data-theme="dark"] .pc-carrier-card:hover,
[data-theme="dark"] .cr-card:hover,
[data-theme="dark"] .pc-ty-card:hover {
  border-color: var(--color-brand-500);
}

[data-theme="dark"] .pc-carrier-logo-placeholder,
[data-theme="dark"] .cr-logo-mark {
  background: var(--slate-700);
  color: var(--slate-300);
}

[data-theme="dark"] .pc-profile-snippet {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .pc-skeleton {
  background: linear-gradient(90deg, var(--slate-700) 0%, var(--slate-600) 40%, var(--slate-700) 80%);
  background-size: 200% 100%;
}

[data-theme="dark"] .ty-hero {
  background: linear-gradient(160deg, var(--color-brand-700) 0%, #0F172A 100%);
}

[data-theme="dark"] .pc-input-row {
  background: var(--slate-800);
  border-color: var(--slate-600);
}

/* ============================================================
   P10 — SEND BUTTON SATISFACTION
   Hover scale, active press, CSS-side tweaks (JS handles whoosh)
   ============================================================ */
.pc-send-btn:hover:not(:disabled) {
  transform: scale(1.04);
  filter: brightness(1.05);
}
.pc-send-btn:active:not(:disabled) {
  transform: scale(0.96);
  transition-duration: 80ms;
}

/* Paper airplane whoosh keyframe */
@keyframes pc-send-whoosh {
  0%   { transform: translateX(0) scale(1); opacity: 1; }
  60%  { transform: translateX(24px) scale(0.8); opacity: 0.6; }
  100% { transform: translateX(48px) scale(0.5); opacity: 0; }
}

.pc-send-btn.sending svg {
  animation: pc-send-whoosh 250ms var(--pc-curve-snap) forwards;
}

/* ============================================================
   P11 — PROGRESS BAR POLISH
   Gradient fill, milestone ticks, inner shadow
   ============================================================ */
.pc-progress-bar {
  position: relative;
  height: 6px;
  background: var(--slate-200);
  overflow: visible;
}

[data-theme="dark"] .pc-progress-bar {
  background: var(--slate-700);
}

.pc-progress-fill {
  background: linear-gradient(90deg, var(--color-blue-500) 0%, var(--color-blue-700) 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.20), 0 1px 3px rgba(37, 99, 235, 0.30);
  transition: width var(--pc-duration-slow) var(--pc-curve-snap);
  height: 100%;
  border-radius: var(--radius-pill);
}

/* Milestone tick marks */
.pc-progress-tick {
  position: absolute;
  top: -2px;
  width: 2px;
  height: calc(100% + 4px);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 1px;
  z-index: 2;
  pointer-events: none;
}
.pc-progress-tick--25 { left: 25%; }
.pc-progress-tick--50 { left: 50%; }
.pc-progress-tick--75 { left: 75%; }

/* ============================================================
   AGENT P EDITS END
   ============================================================ */

/* ============================================================
   AGENT GEO EDITS START
   Feature 2: Places autocomplete dropdown
   Feature 3: Detect-my-location button
   ============================================================ */

/* Autocomplete dropdown */
#pc-places-dropdown {
  position: absolute;
  z-index: 9000;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  display: none;
  max-height: 240px;
  overflow-y: auto;
}

[data-theme="dark"] #pc-places-dropdown {
  background: var(--slate-800, #1e293b);
  border-color: var(--slate-600, #475569);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.40);
}

.pc-places-item {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  line-height: 1.4;
  transition: background 80ms;
}

.pc-places-item:hover,
.pc-places-item:focus {
  background: var(--slate-100, #f1f5f9);
  outline: none;
}

[data-theme="dark"] .pc-places-item:hover,
[data-theme="dark"] .pc-places-item:focus {
  background: var(--slate-700, #334155);
}

.pc-places-attr {
  padding: 5px 14px;
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  border-top: 1px solid var(--slate-100, #f1f5f9);
  list-style: none;
}

/* Detect-my-location button */
.pc-detect-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--color-blue-600, #2563eb);
  background: transparent;
  border: 1px solid var(--color-blue-200, #bfdbfe);
  border-radius: var(--radius-pill, 9999px);
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
  white-space: nowrap;
}

.pc-detect-btn:hover:not(:disabled) {
  background: var(--color-blue-50, #eff6ff);
  border-color: var(--color-blue-400, #60a5fa);
}

.pc-detect-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

[data-theme="dark"] .pc-detect-btn {
  color: var(--color-blue-300, #93c5fd);
  border-color: var(--slate-600, #475569);
}

[data-theme="dark"] .pc-detect-btn:hover:not(:disabled) {
  background: var(--slate-700, #334155);
}

/* Mobile: slightly larger tap target */
@media (max-width: 480px) {
  .pc-detect-btn {
    padding: 7px 14px;
    font-size: 13px;
  }
}

/* ============================================================
   AGENT GEO EDITS END
   ============================================================ */

