/* ========================================================
   POCKET COPILOT | "Sunburst Daylight" Design System
   Lively, High-Visibility, Zero-Bloat Outdoor Field Aesthetic
   ======================================================== */

:root {
  /* High-Visibility Daylight Palette */
  --bg-sky: #F0F9FF;
  --bg-mesh: radial-gradient(at 0% 0%, rgba(224, 242, 254, 0.9) 0px, transparent 50%),
             radial-gradient(at 100% 0%, rgba(254, 243, 199, 0.75) 0px, transparent 50%),
             radial-gradient(at 50% 100%, rgba(240, 253, 244, 0.85) 0px, transparent 50%),
             #F8FAFC;
  --surface-card: rgba(255, 255, 255, 0.94);
  --surface-glass: rgba(255, 255, 255, 0.85);
  --surface-tinted: #E0F2FE;
  
  /* Vibrant Accents */
  --primary-azure: #0284C7;
  --primary-deep: #0369A1;
  --primary-light: #38BDF8;
  --sun-gold: #F59E0B;
  --sun-amber: #D97706;
  --sun-glow: rgba(245, 158, 11, 0.35);
  --accent-emerald: #10B981;
  --accent-emerald-dark: #059669;
  --accent-rose: #F43F5E;
  --accent-purple: #8B5CF6;
  
  /* Text & Contrast (Engineered for Outdoor Sun Glare) */
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-subtle: #64748B;
  --border-soft: rgba(2, 132, 199, 0.18);
  --border-card: rgba(255, 255, 255, 0.9);
  --border-strong: rgba(2, 132, 199, 0.35);
  --border-gold: rgba(245, 158, 11, 0.4);
  
  /* Shadows with Warm Ambient Glow */
  --shadow-sm: 0 2px 8px rgba(2, 132, 199, 0.08);
  --shadow-md: 0 8px 24px rgba(2, 132, 199, 0.12), 0 2px 6px rgba(245, 158, 11, 0.06);
  --shadow-lg: 0 16px 36px rgba(2, 132, 199, 0.18), 0 4px 14px rgba(245, 158, 11, 0.1);
  --shadow-gold: 0 8px 25px rgba(245, 158, 11, 0.4);
  --shadow-emerald: 0 8px 25px rgba(16, 185, 129, 0.35);
  
  /* Typography & Geometry */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  /* iOS Safe Areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-sky);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ========================================================
   TOP HEADER NAVIGATION
   ======================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1.5px solid var(--border-soft);
  padding: calc(var(--safe-top) + 10px) 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  object-fit: cover;
  border: 1.5px solid #FFF;
}

.brand-title-group h1 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-deep);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.3px;
}

.zero-pii-pill {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFF;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 65vw;
}

.header-actions::-webkit-scrollbar {
  display: none;
}

.header-btn {
  flex-shrink: 0;
  background: #FFF;
  border: 1px solid var(--border-soft);
  color: var(--primary-deep);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.header-btn:active {
  transform: scale(0.95);
  background: var(--surface-tinted);
}

.sync-pill {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
}

/* ========================================================
   LIVELY SCENARIO CHIPS BAR
   ======================================================== */
.chips-scroll-container {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.chips-scroll-container::-webkit-scrollbar {
  display: none;
}

.scenario-chip {
  flex-shrink: 0;
  background: #FFF;
  border: 1.5px solid var(--border-soft);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.scenario-chip:active {
  transform: scale(0.95);
}

.chip-brittle {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
  color: #B45309;
}

.chip-drip {
  border-color: rgba(2, 132, 199, 0.5);
  background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
  color: #0369A1;
}

.chip-ice {
  border-color: rgba(14, 165, 233, 0.5);
  background: linear-gradient(135deg, #F0FDFA, #CCFBF1);
  color: #0F766E;
}

.chip-shingle {
  border-color: rgba(244, 63, 94, 0.5);
  background: linear-gradient(135deg, #FFF1F2, #FFE4E6);
  color: #BE123C;
}

.chip-testsquare {
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, #F5F3FF, #EDE9FE);
  color: #6D28D9;
}

.chip-water {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  color: #047857;
}

/* ========================================================
   MAIN CHAT & WORKSPACE FEED
   ======================================================== */
.chat-container {
  flex: 1;
  padding: 16px 16px 140px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.welcome-hero {
  background: linear-gradient(135deg, #FFFFFF 0%, #F0F9FF 60%, #FEF3C7 100%);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 8px;
}

.welcome-hero h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 6px;
}

.welcome-hero p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.quick-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-pill-box {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 3px;
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-deep);
}

/* Chat Bubbles */
.chat-bubble {
  display: flex;
  gap: 10px;
  width: 100%;
  animation: fadeInBubble 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInBubble {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.user {
  flex-direction: row-reverse;
}

.bubble-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: #FFF;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}

.chat-bubble.user .bubble-avatar {
  background: var(--primary-azure);
  color: #FFF;
  border: none;
}

.bubble-content {
  max-width: 86%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.55;
  box-shadow: var(--shadow-md);
}

.chat-bubble.user .bubble-content {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant .bubble-content {
  background: #FFFFFF;
  color: var(--text-main);
  border: 1.5px solid var(--border-card);
  border-bottom-left-radius: 4px;
  width: 100%;
}

/* Markdown Rendering Inside Assistant Bubbles */
.md-body p { margin-bottom: 10px; }
.md-body p:last-child { margin-bottom: 0; }
.md-h1, .md-h2, .md-h3 {
  font-family: var(--font-heading);
  color: var(--primary-deep);
  margin: 14px 0 6px 0;
}
.md-h2 { font-size: 1.15rem; }
.md-h3 { font-size: 1.02rem; }
.md-bold { font-weight: 700; color: #0F172A; }
.md-ul { margin: 8px 0 10px 18px; }
.md-li { margin-bottom: 4px; }
.md-code {
  font-family: var(--font-mono);
  background: #F1F5F9;
  padding: 2px 5px;
  border-radius: 4px;
  color: #0284C7;
  font-size: 0.85em;
}

.file-note-callout {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-left: 5px solid var(--sun-gold);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 12px 0;
  display: flex;
  gap: 10px;
}

.callout-icon { font-size: 1.2rem; flex-shrink: 0; }
.callout-text { font-size: 0.9rem; color: #78350F; line-height: 1.5; }

/* Response Action Buttons (Lively & Action-Oriented) */
.response-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #F1F5F9;
}

.action-chip-btn {
  background: #FFF;
  border: 1.5px solid var(--border-soft);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.action-chip-btn:active { transform: scale(0.95); }

.action-chip-btn.bridge-scope {
  background: linear-gradient(135deg, #10B981, #059669);
  border-color: #059669;
  color: #FFFFFF;
  box-shadow: var(--shadow-emerald);
}

.action-chip-btn.copy-f9 {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-color: #D97706;
  color: #FFFFFF;
  box-shadow: var(--shadow-gold);
}

.action-chip-btn.email-work {
  background: #F0F9FF;
  border-color: var(--primary-azure);
  color: var(--primary-deep);
}

/* ========================================================
   BOTTOM ACTION DOCK (BIG RECORD BUTTON)
   ======================================================== */
.action-dock-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1.5px solid var(--border-soft);
  padding: 10px 16px calc(var(--safe-bottom) + 8px) 16px;
  box-shadow: 0 -4px 20px rgba(2, 132, 199, 0.08);
}

.dock-content {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dock-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #FFF;
  border: 1.5px solid var(--border-soft);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.dock-icon-btn:active { transform: scale(0.92); }

.input-pill-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.chat-input-field {
  width: 100%;
  background: #F8FAFC;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-full);
  padding: 12px 42px 12px 16px;
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input-field:focus {
  border-color: var(--primary-azure);
  background: #FFF;
}

.send-btn-inside {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-azure);
  color: #FFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Big Glowing Record Button */
.big-record-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border: 2px solid #FFF;
  box-shadow: var(--shadow-gold);
  color: #FFF;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.big-record-btn:active {
  transform: scale(0.9);
}

.big-record-btn.recording {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  animation: pulseRecording 1.2s infinite ease-in-out;
}

@keyframes pulseRecording {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ========================================================
   MODALS & SLIDE-UP SHEETS
   ======================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal-sheet {
  background: #FFFFFF;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 24px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Form Controls inside Modals */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  background: #F8FAFC;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-azure);
  background: #FFF;
}

.btn-solid-primary {
  width: 100%;
  background: linear-gradient(135deg, #0284C7, #0369A1);
  color: #FFF;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
}

.btn-solid-primary:active { transform: scale(0.98); }

/* Task Items */
.task-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F8FAFC;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
}

.task-item-card.completed {
  opacity: 0.55;
  text-decoration: line-through;
}

.task-claim-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(2, 132, 199, 0.12);
  color: var(--primary-deep);
  padding: 2px 6px;
  border-radius: 4px;
}

.task-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

.task-date {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

/* Toast */
.toast-msg {
  position: fixed;
  top: calc(var(--safe-top) + 70px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.92);
  color: #FFF;
  backdrop-filter: blur(10px);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 200;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================================
   DENIAL ASSISTANT & POLICY REVIEW STYLES
   ======================================================== */
.header-btn.email-btn-pill {
  background: rgba(2, 132, 199, 0.1);
  color: #0284C7;
  border-color: rgba(2, 132, 199, 0.35);
  font-weight: 700;
}
.header-btn.email-btn-pill:hover {
  background: rgba(2, 132, 199, 0.2);
}

.header-btn.denial-btn-pill {
  background: rgba(225, 27, 34, 0.08);
  color: #DC2626;
  border-color: rgba(225, 27, 34, 0.3);
  font-weight: 700;
}
.header-btn.denial-btn-pill:hover {
  background: rgba(225, 27, 34, 0.16);
}

.scenario-chip.chip-email {
  background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
  border-color: rgba(2, 132, 199, 0.4);
  color: #0369A1;
}

.scenario-chip.chip-denial {
  background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #B91C1C;
}

.report-preview-banner {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border: 1.5px solid #10B981;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #065F46;
}
.preview-banner-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.denial-jump-anchors {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: #F8FAFC;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.jump-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.jump-chip {
  background: #FFF;
  border: 1px solid var(--border-soft);
  color: var(--primary-deep);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.jump-chip:hover {
  background: #0284C7;
  color: #FFF;
  border-color: #0284C7;
}

.denial-single-report-card {
  background: #FFFFFF;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 480px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-main);
  box-shadow: var(--shadow-md);
}

.denial-section-block {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-soft);
}
.denial-section-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}


.modal-sheet-wide {
  max-width: 680px;
}

.denial-intro-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 16px;
}

.denial-form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.denial-dropzone {
  border: 2px dashed rgba(2, 132, 199, 0.3);
  background: #F0F9FF;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.denial-dropzone:hover, .denial-dropzone.dragover {
  border-color: var(--primary-azure);
  background: #E0F2FE;
}

.dropzone-prompt .dropzone-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 4px;
}

.dropzone-prompt .dropzone-text {
  font-size: 0.9rem;
  color: var(--primary-deep);
}

.dropzone-prompt .dropzone-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.denial-thumbnails-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.denial-thumb-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid var(--border-soft);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}
.denial-thumb-chip .thumb-remove {
  cursor: pointer;
  color: #EF4444;
  font-weight: 800;
  margin-left: 2px;
}

.btn-dictate-inline {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-dictate-inline.recording {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #EF4444;
  animation: pulseMic 1.2s infinite;
}

.denial-textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-generate-denial {
  width: 100%;
  background: linear-gradient(135deg, #DC2626, #991B1B);
  color: #FFFFFF;
  border: none;
  padding: 13px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transition: all 0.2s ease;
  margin-top: 4px;
}
.btn-generate-denial:active {
  transform: scale(0.98);
}
.btn-generate-denial.loading {
  opacity: 0.75;
  pointer-events: none;
}

.denial-results-wrapper {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid var(--border-soft);
}

.denial-result-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.denial-tab-btn {
  background: #F1F5F9;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.denial-tab-btn.active {
  background: var(--primary-deep);
  color: #FFFFFF;
  border-color: var(--primary-deep);
}

.denial-tab-pane {
  display: none;
  background: #F8FAFC;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 14px;
}
.denial-tab-pane.active {
  display: block;
}

.result-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--primary-deep);
}

.copy-small-btn {
  background: #FFF;
  border: 1px solid var(--border-soft);
  color: var(--primary-azure);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.denial-formatted-output {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.denial-results-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* Task Category Filter Chips */
.task-chip-btn {
  background: #F1F5F9;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-chip-btn.active {
  background: var(--primary-deep);
  color: #FFFFFF;
  border-color: var(--primary-deep);
}

/* Claims App Fast Switcher Bar */
.claims-app-switcher-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0F172A;
  padding: 8px 16px;
  overflow-x: auto;
  border-bottom: 1.5px solid #1E293B;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.switcher-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #38BDF8;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.app-switch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: #CBD5E1;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
}

.app-switch-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: #38BDF8;
}

.app-switch-chip.active {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  color: #FFFFFF;
  border-color: #38BDF8;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.status-dot {
  color: #10B981;
  font-size: 0.7rem;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Pending Media & Document Attachments Preview Strip */
.pending-attachments-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px;
  background: rgba(240, 249, 255, 0.95);
  border-top: 1.5px solid rgba(2, 132, 199, 0.2);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ========================================================
   CONTINUOUS MULTI-PHOTO CAMERA VIEWFINDER MODAL
   ======================================================== */
.multi-camera-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 16px) 16px;
  touch-action: none;
}

.multi-camera-header {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #FFF;
  z-index: 10;
}

.multi-camera-header h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cam-badge-count {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.cam-btn-icon {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFF;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.multi-camera-viewfinder-box {
  width: 100%;
  max-width: 500px;
  flex: 1;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.multi-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-grid-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
}

.camera-flash-fx {
  position: absolute;
  inset: 0;
  background: #FFF;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease-out;
}

.camera-flash-fx.flashing {
  opacity: 0.85;
}

/* Snapped Thumbnails Reel inside Camera */
.camera-snapped-tray {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  min-height: 58px;
  scrollbar-width: none;
}

.camera-snapped-tray::-webkit-scrollbar {
  display: none;
}

.snapped-thumb-card {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #F59E0B;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.snapped-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.snapped-thumb-del {
  position: absolute;
  top: 1px;
  right: 1px;
  background: rgba(239, 68, 68, 0.9);
  color: #FFF;
  border: none;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Shutter & Controls Dock */
.multi-camera-controls {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-top: 6px;
}

.camera-shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FBBF24, #D97706);
  border: 4px solid #FFFFFF;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.camera-shutter-btn:active {
  transform: scale(0.92);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
}

.shutter-inner-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #FFF;
  opacity: 0.9;
}

.cam-done-btn {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFF;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.cam-done-btn:active {
  transform: scale(0.95);
}

.cam-gallery-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Auto-Update Banner */
.auto-update-alert-bar {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFFFFF;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

/* History Modal Session Cards & Auto-Recovery */
.history-session-card {
  background: #F8FAFC;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.history-session-card:hover {
  border-color: #9333EA;
  background: #FAF5FF;
}

.history-session-card.active-session {
  border-color: #9333EA;
  background: #FAF5FF;
  box-shadow: 0 0 0 1px #9333EA;
}

.history-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-session-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.history-session-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-session-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.history-session-meta {
  font-size: 0.72rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-session-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-btn-load {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.history-btn-load:hover {
  transform: translateY(-1px);
}

.history-btn-del {
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #EF4444;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 0.72rem;
  cursor: pointer;
}

/* ========================================================
   v4.0 CLEAN LAYOUT: slim header, four main actions, menu
   ======================================================== */
.slim-header { padding-bottom: 8px; }
.slim-header .brand-title-group { display: flex; flex-direction: column; gap: 2px; }
.slim-header .brand-title-group h1 { font-size: 1.1rem; line-height: 1.1; }
.engine-pill {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary-deep);
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-btn {
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-soft);
  background: #FFF;
  color: var(--primary-deep);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.top-btn.clear-btn { background: rgba(245, 158, 11, 0.14); color: #B45309; border-color: rgba(245, 158, 11, 0.5); }

.action-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--border-soft);
}
.action-tile {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: #FFF;
  color: var(--text-main);
  font-family: var(--font-body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  padding: 6px 2px;
}
.action-tile .tile-icon { font-size: 1.35rem; line-height: 1; }
.action-tile .tile-label { font-size: 0.7rem; font-weight: 800; text-align: center; line-height: 1.15; }
.tile-email { background: rgba(2, 132, 199, 0.1); border-color: rgba(2, 132, 199, 0.35); color: #0369A1; }
.tile-notes { background: rgba(16, 185, 129, 0.13); border-color: rgba(16, 185, 129, 0.45); color: #047857; }
.tile-denial { background: rgba(225, 27, 34, 0.08); border-color: rgba(225, 27, 34, 0.3); color: #B91C1C; }
.tile-vault { background: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.35); color: #6D28D9; }

/* Welcome card */
.dictation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.dictation-title { font-weight: 800; font-size: 0.95rem; color: #92400E; }
.dictation-sub { font-size: 0.76rem; color: #B45309; margin-top: 2px; }
.dictation-btn {
  min-height: 44px;
  min-width: 72px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--sun-gold);
  color: #FFF;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: var(--shadow-gold);
  cursor: pointer;
  flex-shrink: 0;
}
.quick-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-subtle); margin: 4px 0 8px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-tile {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 8px 10px;
  background: #FFF;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.engine-row { margin-top: 12px; font-size: 0.78rem; color: var(--text-muted); }
.engine-row strong { color: var(--primary-deep); }

/* Menu sheet */
.menu-section-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-subtle); margin: 14px 0 8px; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #F8FAFC;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.menu-docs-note { margin-top: 16px; font-size: 0.74rem; color: var(--text-subtle); line-height: 1.4; }

/* Answer that is not backed by the loaded documents */
.not-in-docs {
  background: #FEF3C7;
  border: 1.5px solid #F59E0B;
  color: #92400E;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 360px) {
  .action-tile .tile-label { font-size: 0.64rem; }
  .quick-grid, .menu-grid { grid-template-columns: 1fr; }
}

/* v4.0 polish: keep the name on one line on small phones */
.slim-header { padding-left: 12px; padding-right: 12px; gap: 8px; }
.slim-header .brand-wrapper { min-width: 0; gap: 8px; }
.slim-header .brand-icon { width: 34px; height: 34px; flex-shrink: 0; }
.slim-header .brand-title-group h1 { font-size: 1rem; white-space: nowrap; }
.top-btn { padding: 0 11px; }
.top-btn span:last-child { font-size: 0.8rem; }

/* v4.1 denial letter builder */
.letter-entry-btn {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px 14px;
  margin: 0 0 14px;
  background: linear-gradient(135deg, #FEF2F2 0%, #FFFFFF 100%);
  border: 1.5px solid rgba(225, 27, 34, 0.35);
  border-radius: var(--radius-md);
  color: #991B1B;
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
}
.letter-entry-btn small { color: var(--text-muted); font-weight: 600; }
.quick-wide { grid-column: 1 / -1; background: #FEF2F2; border-color: rgba(225, 27, 34, 0.35); color: #991B1B; }
.dl-help { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.dl-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.dl-check input { width: 22px; height: 22px; flex-shrink: 0; }
.dl-status { min-height: 1.2em; margin: 10px 0; font-size: 0.85rem; color: var(--primary-deep); font-weight: 700; }
.dl-label { display: block; margin: 14px 0 6px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-subtle); }
.dl-output { font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.45; white-space: pre-wrap; }
.dl-list { margin: 0 0 12px; padding-left: 18px; font-size: 0.82rem; line-height: 1.5; color: var(--text-main); }
.dl-note { font-size: 0.74rem; color: var(--text-subtle); line-height: 1.4; margin-top: 12px; }

.move-details { margin-top: 10px; background: #F8FAFC; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 8px 12px; }
.move-details summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.move-steps { margin: 4px 0 10px; padding-left: 18px; font-size: 0.8rem; line-height: 1.5; color: var(--text-main); }

/* v4.2 Xactimate code check */
.code-check { margin-top: 8px; padding: 8px 10px; background: #F8FAFC; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); font-size: 0.78rem; line-height: 1.45; }
.code-ok { color: #047857; font-weight: 700; }
.code-warn { color: #92400E; font-weight: 700; margin-top: 4px; }
