/* ==========================================================================
   VARIABLES & BASE
   ========================================================================== */
:root {
  --primary: #0F172A;
  --primary-light: #1E293B;
  --accent: #10B981;
  --accent-hover: #059669;
  --accent-light: rgba(16, 185, 129, 0.1);
  --bg-app: #FFFFFF;
  --bg-sidebar: #F8FAFC;
  --bg-input: #F1F5F9;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}
[data-theme="dark"] {
  --primary: #F8FAFC;
  --primary-light: #E2E8F0;
  --accent: #10B981;
  --accent-hover: #059669;
  --accent-light: rgba(16, 185, 129, 0.15);
  --bg-app: #0F172A;
  --bg-sidebar: #1E293B;
  --bg-input: #334155;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border: #334155;
  --danger: #EF4444;
  --danger-light: rgba(239, 68, 68, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  overflow: hidden;
  transition: background-color 0.3s, color 0.3s;
}

body.lang-hi { font-family: 'Noto Serif Devanagari', 'Inter', sans-serif; line-height: 1.8; }
body.lang-te { font-family: 'Noto Serif Telugu', 'Inter', sans-serif; line-height: 1.9; }
body.lang-ta { font-family: 'Noto Serif Tamil', 'Inter', sans-serif; line-height: 1.8; }
body.lang-kn { font-family: 'Noto Serif Kannada', 'Inter', sans-serif; line-height: 1.9; }

/* Accessibility Focus States */
button:focus-visible, a:focus-visible, input:focus-visible, .sidebar-nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   SIDEBAR & NAV
   ========================================================================== */
.sidebar {
  width: 280px; background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; transition: transform 0.3s ease; z-index: 100;
}
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.logo-icon svg { width: 18px; height: 18px; stroke: var(--bg-app); }
.logo-text { font-family: 'Outfit', sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }

.new-chat-btn {
  margin: 0 20px 24px; padding: 12px; border-radius: var(--radius-md); background: var(--bg-app); border: 1px solid var(--border);
  color: var(--text-main); font-family: 'Inter', sans-serif; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: all 0.2s;
}
.new-chat-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.sidebar-scroll-area { flex: 1; overflow-y: auto; padding: 0 12px; }
.sidebar-scroll-area::-webkit-scrollbar { width: 4px; }
.sidebar-scroll-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 0 8px 8px; }
.sidebar-nav-item {
  padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-main); font-size: 13.5px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; gap: 10px; transition: all 0.2s; margin-bottom: 2px;
}
.sidebar-nav-item:hover { background: var(--bg-input); }
.sidebar-nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.chat-list { display: flex; flex-direction: column; }
.chat-item { 
  padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 13.5px; 
  cursor: pointer; display: flex; align-items: center; gap: 10px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item:hover { background: var(--bg-input); color: var(--text-main); }
.chat-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* ==========================================================================
   ACCOUNT AREA (SIDEBAR FOOTER & MENUS)
   ========================================================================== */
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); position: relative; }
.profile-btn { 
  display: flex; align-items: center; justify-content: space-between; padding: 8px; 
  border-radius: var(--radius-md); cursor: pointer; transition: background 0.2s; width: 100%; border: none; background: none; text-align: left;
}
.profile-btn:hover { background: var(--bg-input); }
.profile-btn-content { display: flex; align-items: center; gap: 12px; overflow: hidden; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.profile-name { font-size: 14px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-plan { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-chevron { color: var(--text-muted); flex-shrink: 0; margin-left: 8px; }

.account-menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.2); z-index: 8000; display: none; opacity: 0; transition: opacity 0.2s; }
.account-menu-overlay.active { display: block; opacity: 1; }
.account-menu { 
  position: absolute; bottom: calc(100% + 8px); left: 16px; width: 268px; 
  max-height: min(78vh, 520px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-app); border: 1px solid var(--border); border-radius: var(--radius-md); 
  box-shadow: 0 10px 40px rgba(0,0,0,0.14); padding: 8px 6px; display: none; flex-direction: column; 
  z-index: 8001; animation: fadeIn 0.2s; transform-origin: bottom left;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.account-menu::-webkit-scrollbar { width: 5px; }
.account-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.account-menu.active { display: flex; }
.menu-item { 
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; 
  cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--text-main); 
  transition: 0.15s ease; border: none; background: none; text-align: left; width: 100%; font-family: 'Outfit', 'Inter', sans-serif;
}
.menu-item:hover { background: var(--bg-input); }
.menu-divider { height: 1px; background: var(--border); margin: 6px 0; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-light); }
.sheet-handle { display: none; }

/* ==========================================================================
   MAIN APP & CHAT
   ========================================================================== */
.main-area { flex: 1; display: flex; flex-direction: column; position: relative; }
.top-header { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--bg-app); }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-main); cursor: pointer; padding: 4px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.action-btn { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-sidebar); color: var(--text-main); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.action-btn:hover { background: var(--bg-input); }
.nalsa-btn { background: var(--danger-light); color: var(--danger); border-color: transparent; }

.chat-container { flex: 1; overflow-y: auto; padding: 40px 24px; scroll-behavior: smooth; display: flex; flex-direction: column; align-items: center; }
.hero-section { max-width: 700px; width: 100%; text-align: center; margin: 4vh auto 0; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.hero-title { font-family: 'Outfit', sans-serif; font-size: 32px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 12px; }
.hero-sub { font-size: 16px; color: var(--text-muted); margin-bottom: 32px; line-height: 1.5; }
.chips-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.chip { padding: 12px 20px; background: var(--bg-sidebar); border: 1px solid var(--border); border-radius: var(--radius-xl); font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text-main); box-shadow: 0 2px 5px rgba(0,0,0,0.02); transition: all 0.2s; white-space: nowrap; }
.chip:hover { border-color: var(--accent); background: var(--accent-light); transform: translateY(-2px); }
.chip.primary { background: var(--primary); color: var(--bg-app); border-color: var(--primary); }
.chip.primary:hover { background: var(--primary-light); color: var(--bg-app); }

.chat-content-wrap { max-width: 800px; width: 100%; display: flex; flex-direction: column; gap: 24px; padding-bottom: 20px; }
.msg-row { display: flex; gap: 16px; align-items: flex-start; animation: fadeIn 0.3s ease; }
.msg-row.user { flex-direction: row-reverse; }
.bubble-avatar { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.user-av { background: var(--border); color: var(--text-main); }
.ai-av { background: var(--accent); color: white; }
.bubble { max-width: 80%; padding: 18px 24px; border-radius: 20px; font-size: 15px; line-height: 1.6; }
.msg-row.ai .bubble { 
  background: var(--bg-sidebar); 
  border: 1px solid var(--border); 
  border-left: 4px solid var(--accent); /* Premium green left border */
  border-top-left-radius: 4px; 
  color: var(--text-main); 
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.015);
}
.msg-row.user .bubble { background: var(--accent); color: white; border-top-right-radius: 4px; box-shadow: 0 4px 14px rgba(16,185,129,0.18); }

.input-section { width: 100%; background: linear-gradient(180deg, transparent, var(--bg-app) 10%); padding: 10px 24px 20px; display: flex; flex-direction: column; align-items: center; }
.trust-strip { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; width: 100%; max-width: 800px; padding: 0 16px;}
.input-wrapper { width: 100%; max-width: 800px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 8px 16px; display: flex; align-items: flex-end; gap: 12px; }
.input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 8px 30px rgba(16,185,129,0.1); }
textarea { flex: 1; border: none; background: transparent; color: var(--text-main); font-family: 'Inter', sans-serif; font-size: 15px; resize: none; min-height: 44px; max-height: 200px; padding: 12px 0; outline: none; }
textarea:focus, textarea:focus-visible { outline: none !important; border: none !important; box-shadow: none !important; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink:0;}
.icon-btn:hover { background: var(--border); color: var(--text-main); }
.send-btn { background: var(--accent); color: white; }
.send-btn:hover { background: var(--accent-hover); color: white; transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }
.disclaimer { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 12px; max-width: 800px; line-height: 1.5; padding: 0 16px;}

/* ==========================================================================
   MODALS (Pricing, Trust, Categories)
   ========================================================================== */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 9999; }
.overlay.active { display: flex; animation: fadeIn 0.2s; }
.modal { background: var(--bg-app); border-radius: var(--radius-lg); width: 100%; max-width: 500px; padding: 32px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close-top { position: absolute; top: 20px; right: 20px; background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }
.modal h3 { font-family: 'Outfit', sans-serif; font-size: 24px; margin-bottom: 8px; letter-spacing: -0.5px; }
.modal p.sub { color: var(--text-muted); font-size: 14.5px; line-height: 1.5; margin-bottom: 24px; }
.modal-btns { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* Pricing Cards */
.plan-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; transition: all 0.2s; position: relative; }
.plan-card.premium { border-color: var(--accent); background: var(--accent-light); }
.plan-badge { position: absolute; top: -10px; right: 20px; background: var(--accent); color: white; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 12px; text-transform: uppercase; }
.plan-name { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.plan-price { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.plan-features { list-style: none; margin-bottom: 20px; }
.plan-features li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin-bottom: 8px; color: var(--text-main); }
.plan-features svg { flex-shrink: 0; color: var(--accent); }
.btn-upgrade { width: 100%; background: var(--accent); color: white; border: none; padding: 12px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-upgrade:hover { background: var(--accent-hover); }

/* Topics Grid */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.topic-card { border: 1px solid var(--border); padding: 16px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; background: var(--bg-sidebar); color: var(--text-main); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.topic-card:hover { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }

/* ==========================================================================
   UNIVERSAL DOCUMENT BUILDER OVERLAY
   ========================================================================== */
.doc-builder-overlay {
  position: fixed; inset: 0; background: var(--bg-app); z-index: 9000;
  display: none; flex-direction: column; overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.doc-builder-overlay.active { display: flex; }

.doc-header { height: 64px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--bg-app); }
.doc-header-title { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 18px; }
.close-builder-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }

.doc-body { flex: 1; overflow-y: auto; padding: 40px 24px 120px; display: flex; flex-direction: column; align-items: center; }
.doc-content { width: 100%; max-width: 600px; }

/* Stage: Selection */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; width: 100%; max-width: 900px; }
.doc-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; cursor: pointer; transition: all 0.2s; background: var(--bg-sidebar); display: flex; flex-direction: column; justify-content: space-between;}
.doc-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
.doc-card-title { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.doc-card-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; }
.doc-meta { font-size: 12px; font-weight: 600; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center;}
.price-tag { color: var(--accent); font-weight: 700; background: var(--accent-light); padding: 4px 8px; border-radius: 4px; }

/* Stage: Form Wizard */
.step-indicator { font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.step-title { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; margin-bottom: 24px; letter-spacing: -0.5px; }

.form-group { margin-bottom: 24px; animation: fadeIn 0.3s ease; }
.form-label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; color: var(--text-main); }
.form-helper { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-app); color: var(--text-main); font-family: 'Inter', sans-serif; font-size: 15px; transition: all 0.2s;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.form-textarea { resize: vertical; min-height: 100px; }

.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-label { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; cursor: pointer; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-app); transition: all 0.2s; }
.radio-label:hover { border-color: var(--accent); }
.radio-label input:checked + span { color: var(--accent); font-weight: 600; }
.radio-label:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }

.error-text { color: var(--danger); font-size: 12px; font-weight: 500; margin-top: 6px; display: none; }
.form-group.has-error .form-input, .form-group.has-error .form-textarea { border-color: var(--danger); }
.form-group.has-error .error-text { display: block; }

/* Stage: Review */
.review-section { margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.review-header { background: var(--bg-sidebar); padding: 12px 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.review-edit-btn { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; }
.review-row { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.review-row:last-child { border-bottom: none; }
.review-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.review-value { font-size: 14.5px; color: var(--text-main); word-break: break-word; }

.price-warning-box { background: var(--bg-sidebar); border: 1px solid var(--border); padding: 16px; border-radius: var(--radius-md); margin-bottom: 24px; display: flex; align-items: center; gap: 12px;}

/* Stage: Preview */
.preview-container { background: white; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.05); padding: 40px; border-radius: 8px; color: black; font-family: 'Times New Roman', Times, serif; font-size: 16px; line-height: 1.6; max-width: 800px; margin: 0 auto; }
.next-steps-card { background: var(--accent-light); border: 1px solid var(--accent); border-radius: var(--radius-md); padding: 20px; margin-top: 24px; max-width: 800px; margin: 24px auto 0; }
.next-steps-title { font-weight: 700; color: var(--accent-hover); margin-bottom: 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }

/* Sticky Bottom Action Bar */
.doc-footer { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-app); border-top: 1px solid var(--border); padding: 16px 24px; display: flex; justify-content: center; z-index: 20; }
.doc-footer-inner { width: 100%; max-width: 600px; display: flex; justify-content: space-between; align-items: center; }
.btn-primary { background: var(--accent); color: white; border: none; padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text-main); border: 1px solid var(--border); padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: var(--bg-input); }
.btn-text { background: none; border: none; color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; padding: 8px; }
.btn-text:hover { color: var(--danger); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--primary); color: var(--bg-app); padding: 12px 24px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: transform 0.3s; z-index: 10000; }
.toast.show { transform: translateX(-50%) translateY(0); }


.announcement-banner {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.14) 0%, rgba(59, 130, 246, 0.10) 100%);
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
  padding: 8px 44px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  position: relative;
  min-height: 42px;
  line-height: 1.4;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease;
}
.announcement-banner:hover {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.20) 0%, rgba(59, 130, 246, 0.15) 100%);
}
.announcement-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 90%;
  text-align: center;
  word-break: break-word;
}
.announcement-text {
  display: inline;
  white-space: normal;
}
.announcement-icon {
  font-size: 16px;
  flex-shrink: 0;
  animation: wiggle 2s infinite ease-in-out;
}
.announcement-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 3px 12px;
  background: #10b981 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}
.announcement-cta:hover {
  background: #059669 !important;
  transform: scale(1.04);
}
.announcement-close-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
}
.announcement-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-10deg); }
  30% { transform: rotate(10deg); }
  45% { transform: rotate(-4deg); }
  60% { transform: rotate(4deg); }
}

.maintenance-schedule-banner {
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #f59e0b;
  text-align: center;
  z-index: 10;
}
.maintenance-schedule-icon {
  font-size: 15px;
}

/* Active Maintenance Mode fullscreen blur overlay */
.maintenance-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 24px;
}
.maintenance-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.maintenance-card .maintenance-icon {
  font-size: 48px;
  margin-bottom: 24px;
  animation: rotateGear 4s infinite linear;
  display: inline-block;
}
@keyframes rotateGear {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.maintenance-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 16px;
}
.maintenance-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 24px;
}
.maintenance-card .maintenance-note {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  /* 1. Body & Viewport dynamic heights */
  body {
    height: 100dvh !important;
  }
  
  /* Keyboard and Safe Area padding for iOS devices */
  @supports (-webkit-touch-callout: none) {
    .input-section {
      padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    }
  }
  
  /* 2. Sidebar overrides & overlay */
  .sidebar { 
    position: fixed; 
    transform: translateX(-100%); 
    height: 100dvh !important; 
    z-index: 100;
    transition: transform 0.3s ease-in-out;
  }
  .sidebar.open { 
    transform: translateX(0); 
  }
  .sidebar.open ~ .sidebar-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  /* 3. Button sizes and touch targets */
  button, 
  a.btn, 
  .btn,
  .action-btn, 
  .new-chat-btn, 
  .btn-upgrade, 
  .state-option-btn,
  .view-tab,
  .chip {
    min-height: 48px !important;
    font-size: 15px !important;
  }
  .icon-btn {
    min-width: 48px !important;
    min-height: 48px !important;
  }
  
  /* 4. Text legibility & wrapping */
  body, p, span, li, button, input, textarea, select, td, th {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
  h1, h2, h3, h4, h5, h6, .doc-header-title, .doc-card-title, .modal h3 {
    font-size: 18px !important;
  }
  .disclaimer, .compliance-footer, .consent-checkbox-label {
    font-size: 13px !important;
  }
  
  /* 5. Pricing Modal */
  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 !important;
  }
  .pricing-grid .plan-card {
    width: 100% !important;
    margin-bottom: 8px !important;
    padding: 18px 16px !important;
  }
  .pricing-grid .btn-upgrade {
    width: 100% !important;
    min-height: 44px !important;
  }
  #pricingModal .modal {
    max-height: 90vh !important;
    padding: 16px !important;
    overflow-y: auto !important;
  }
  
  /* 6. Document Builder */
  .doc-content { 
    padding: 0 16px !important; 
  }
  .preview-container { 
    padding: 16px !important; 
    overflow-x: auto !important;
    font-size: 14px !important;
    max-width: 100% !important;
  }
  .doc-footer {
    padding: 12px 16px !important;
  }
  .doc-footer-inner {
    gap: 12px !important;
  }
  .doc-footer-inner button {
    flex: 1 !important;
    min-height: 48px !important;
    font-size: 15px !important;
  }

  .mobile-menu-btn { display: block; }
  .hero-title { font-size: 26px !important; }
  .input-section { padding: 8px 12px 12px !important; }
  
  /* Mobile Bottom Sheet for Account Menu */
  .account-menu { 
    position: fixed; bottom: 0; left: 0; width: 100%; 
    max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain;
    border-radius: 20px 20px 0 0; padding: 12px 14px calc(24px + env(safe-area-inset-bottom)); 
    animation: slideUp 0.3s; border-bottom: none; 
    scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  }
  .sheet-handle { display: block; width: 36px; height: 4px; background: var(--border); border-radius: 4px; margin: 0 auto 12px; }
  .menu-item { min-height: 40px; font-size: 13.5px; padding: 8px 10px; }

  #currentStateLabel,
  #nalsaLabel {
    display: none !important;
  }
  .header-actions {
    gap: 6px !important;
  }
  .action-btn {
    padding: 8px 8px !important;
  }
  .suggestion-fab {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }
}

/* ==========================================================================
   STATS SECTION (Live Counters)
   ========================================================================== */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 48px;
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}

.stat-card {
  flex: 1;
  min-width: 220px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.1), 0 4px 6px -2px rgba(16, 185, 129, 0.05);
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.stat-count-wrap {
  display: flex;
  align-items: baseline;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-plus {
  color: var(--accent);
  margin-left: 2px;
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   WHATSAPP SHARE BUTTON
   ========================================================================== */
.btn-whatsapp {
  background-color: #25D366;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
  font-family: 'Inter', sans-serif;
}

.btn-whatsapp:hover {
  background-color: #128C7E;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ==========================================================================
   LANGUAGE DROPDOWN & MENU
   ========================================================================== */
.lang-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 9000;
  width: 200px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  animation: fadeIn 0.15s ease;
}
.lang-dropdown.active {
  display: flex;
  flex-direction: column;
}
.lang-dropdown::-webkit-scrollbar { width: 4px; }
.lang-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.lang-option {
  padding: 10px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  display: block;
}
.lang-option:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* ==========================================================================
   FILE PREVIEW & INPUT PROCESSING
   ========================================================================== */
.file-preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  width: 100%;
  max-width: 800px;
  animation: fadeIn 0.2s ease;
}
.file-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-preview-remove {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.file-preview-remove:hover {
  color: var(--danger);
}

.input-wrapper.processing {
  opacity: 0.6;
  pointer-events: none;
  background: var(--border);
}

.empty-chats-state {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 16px 8px;
  text-align: center;
  font-style: italic;
  line-height: 1.4;
}

/* Hide chat-content-wrap when empty */
.chat-content-wrap:empty {
  display: none;
}

/* ==========================================================================
   SUGGESTION BOX (Floating Button + Modal)
   ========================================================================== */
.suggestion-fab {
  position: fixed;
  bottom: 28px;
  left: 308px;
  right: auto;
  height: 48px;
  padding: 0 20px 0 16px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35), 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 7000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.suggestion-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.45), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.suggestion-fab:active {
  transform: translateY(-1px);
}

.suggestion-counter {
  display: flex;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.suggestion-counter span {
  font-weight: 700;
  color: var(--accent);
}

.suggestion-counter.near-limit span {
  color: #F59E0B;
}

.suggestion-counter.at-limit span {
  color: var(--danger);
}

.suggestion-submit-btn {
  transition: all 0.2s;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.suggestion-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.suggestion-fab-label {
  display: inline;
}

@media (max-width: 768px) {
  .suggestion-fab {
    bottom: 20px;
    left: 16px;
    right: auto;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
  }
  .suggestion-fab svg {
    width: 20px;
    height: 20px;
  }
  .suggestion-fab-label {
    display: none;
  }
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  margin-top: 10px;
}
.btn-google:hover {
  background: var(--bg-sidebar);
  border-color: var(--text-muted);
}
.btn-google svg {
  flex-shrink: 0;
}

/* Voice Input Styles */
.mic-btn.listening {
  background: var(--danger) !important;
  color: white !important;
  border-color: var(--danger) !important;
  animation: pulse-red 1.5s infinite;
  transform: scale(1.05);
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* ==========================================================================
   MY DOCUMENTS & DRAFTS ARCHIVE
   ========================================================================== */
.archive-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 8px;
}

.archive-tab-btn {
  padding: 10px 16px;
  font-weight: 500;
  font-size: 14.5px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.archive-tab-btn:hover {
  color: var(--text-main);
  border-bottom-color: var(--border);
}

.archive-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px;
}

.archive-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.archive-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--accent);
}

.archive-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.archive-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.archive-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.archive-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.archive-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  gap: 12px;
}

.archive-empty-icon {
  font-size: 36px;
}

.document-view-paper {
  background: #FFFFFF !important;
  color: #1A1A1A !important;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.05);
  border: 1px solid #D1D5DB !important;
}

[data-theme="dark"] .document-view-paper {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   PRODUCTION READY LAYOUT: TABS, DASHBOARD, GUIDED INTAKE, COMPLIANCE
   ========================================================================== */

/* 1. View Toggle Bar (Top Navigation inside main-area) */
.view-toggle-bar {
  display: flex;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  gap: 16px;
  height: 52px;
  align-items: stretch;
}
.view-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.view-tab:hover {
  color: var(--text-main);
}
.view-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 2. Dashboard View & Panels */
.dashboard-view {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  width: 100%;
  display: none;
  flex-direction: column;
  gap: 32px;
  animation: fadeIn 0.3s ease;
}
.dashboard-view.active {
  display: flex;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.dashboard-title {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.dashboard-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
}
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* 3. Dashboard Card Components */
.dash-card {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01);
}
.dash-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

/* 4. Active Drafts Table list */
.drafts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.drafts-table th {
  padding: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.drafts-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.drafts-table tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-badge.drafting {
  background: rgba(245, 158, 11, 0.1);
  color: #D97706;
}
.status-badge.review {
  background: rgba(59, 130, 246, 0.1);
  color: #2563EB;
}
.status-badge.completed {
  background: var(--accent-light);
  color: var(--accent-hover);
}

.table-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}
.table-btn:hover {
  background: var(--bg-sidebar);
  border-color: var(--accent);
  color: var(--accent);
}
.table-btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.table-btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

/* 5. Next Legal Actions & Escalation Banners */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.action-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-sidebar);
  border-left: 4px solid var(--accent);
}
.action-item.warning {
  border-left-color: #F59E0B;
}
.action-item-title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.action-item-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.advocate-banner {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
}
.advocate-banner-text {
  flex: 1;
  min-width: 280px;
}
.advocate-banner-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--accent);
}
.advocate-banner-desc {
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.5;
}

/* 6. Guided Intake Modal Wizard */
.intake-modal-body {
  padding: 4px 0;
}
.intake-step {
  display: none;
  animation: fadeIn 0.2s ease;
}
.intake-step.active {
  display: block;
}
.intake-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}
.intake-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* 7. Upload Privacy & Compliance Checkboxes */
.consent-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 800px;
  padding: 0 16px;
}
.consent-checkbox-wrap input {
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--accent);
}
.consent-checkbox-label {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  cursor: pointer;
}

/* 8. Production Footer Disclaimer Banner */
.compliance-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: auto;
}
.compliance-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}
.compliance-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}
.compliance-link:hover {
  color: var(--accent);
}
.emergency-warning {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  max-width: 800px;
  margin: 12px auto 0;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
@media (max-width: 600px) {
  .emergency-warning {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}
.cookie-consent-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  max-width: 380px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUpCookie 0.3s ease-out;
}
@keyframes slideUpCookie {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.cookie-consent-text {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}
.cookie-consent-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* Geolocation Selector Styles */
.state-option-btn {
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg-sidebar);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.state-option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.state-option-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 600;
}
.state-grid-container::-webkit-scrollbar {
  width: 6px;
}
.state-grid-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.location-btn svg {
  color: var(--accent);
}

/* Indian Language Premium Typography Overrides */
body.lang-hi, 
body.lang-hi input, 
body.lang-hi textarea, 
body.lang-hi select, 
body.lang-hi button, 
body.lang-hi .preview-container,
body.lang-hi .form-input,
body.lang-hi .form-textarea,
body.lang-hi .form-select,
body.lang-hi .doc-header-title,
body.lang-hi .doc-card-title,
body.lang-hi .step-title,
body.lang-hi .review-value {
  font-family: 'Noto Serif Devanagari', 'Inter', sans-serif !important;
  line-height: 1.85 !important;
}

body.lang-te, 
body.lang-te input, 
body.lang-te textarea, 
body.lang-te select, 
body.lang-te button, 
body.lang-te .preview-container,
body.lang-te .form-input,
body.lang-te .form-textarea,
body.lang-te .form-select,
body.lang-te .doc-header-title,
body.lang-te .doc-card-title,
body.lang-te .step-title,
body.lang-te .review-value {
  font-family: 'Noto Serif Telugu', 'Inter', sans-serif !important;
  line-height: 1.95 !important;
}

body.lang-ta, 
body.lang-ta input, 
body.lang-ta textarea, 
body.lang-ta select, 
body.lang-ta button, 
body.lang-ta .preview-container,
body.lang-ta .form-input,
body.lang-ta .form-textarea,
body.lang-ta .form-select,
body.lang-ta .doc-header-title,
body.lang-ta .doc-card-title,
body.lang-ta .step-title,
body.lang-ta .review-value {
  font-family: 'Noto Serif Tamil', 'Inter', sans-serif !important;
  line-height: 1.85 !important;
}

body.lang-kn, 
body.lang-kn input, 
body.lang-kn textarea, 
body.lang-kn select, 
body.lang-kn button, 
body.lang-kn .preview-container,
body.lang-kn .form-input,
body.lang-kn .form-textarea,
body.lang-kn .form-select,
body.lang-kn .doc-header-title,
body.lang-kn .doc-card-title,
body.lang-kn .step-title,
body.lang-kn .review-value {
  font-family: 'Noto Serif Kannada', 'Inter', sans-serif !important;
  line-height: 1.95 !important;
}

/* Onboarding welcome modal cards */
.onboarding-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  text-align: left;
}
.onboarding-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-sidebar);
}
.onboarding-card:hover {
  border-color: var(--accent) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
@media (max-width: 580px) {
  .onboarding-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Suggestion Chips Above Input */
.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-sidebar);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.suggestion-chip:hover {
  border-color: var(--accent) !important;
  background: var(--accent-light) !important;
  color: var(--accent) !important;
  transform: translateY(-1px);
}

/* Premium Button Hover & Lifts */
button, .btn, .icon-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
button:hover:not(:disabled), .btn:hover:not(:disabled), .icon-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

/* Phase 2 trust, safety, and accessibility primitives */
:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 3px;
}

.chip-urgent {
  border-color: rgba(220, 38, 38, 0.45) !important;
  color: #b91c1c !important;
  background: rgba(254, 242, 242, 0.94) !important;
}

.urgent-help-card {
  border: 1px solid rgba(220, 38, 38, 0.38);
  border-left: 4px solid #dc2626;
  background: #fffafa;
  border-radius: 12px;
  padding: 16px;
  color: #27272a;
}
.urgent-help-eyebrow { color: #b91c1c; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.urgent-help-card h3 { margin: 5px 0 7px; font-size: 17px; }
.urgent-help-card p { margin: 0; line-height: 1.55; font-size: 14px; }
.urgent-help-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.urgent-help-actions .table-btn { text-decoration: none; min-height: 42px; display: inline-flex; align-items: center; }
.urgent-help-note { color: #52525b; font-size: 12px !important; margin-top: 12px !important; }

.answer-trust-card {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 10px;
  color: var(--text-muted);
}
.answer-trust-card summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text-main); }
.answer-trust-card summary span { color: var(--text-muted); font-weight: 500; }
.answer-trust-content { display: grid; gap: 10px; padding: 12px 0 2px; font-size: 12.5px; line-height: 1.5; }
.answer-trust-content p { margin: 3px 0 0; }
.fact-correction-btn { justify-self: start; border: 1px solid var(--border); background: var(--bg-sidebar); color: var(--text-main); border-radius: 7px; padding: 8px 10px; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; }
.review-intro { max-width: 680px; color: var(--text-muted); line-height: 1.55; margin: 0 auto 18px; text-align: center; }
.review-confirmation { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 4px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-sidebar); line-height: 1.45; font-size: 13px; cursor: pointer; }
.review-confirmation input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 600px) {
  .suggestion-chips-container { overflow-x: auto; flex-wrap: nowrap !important; padding-bottom: 4px !important; }
  .suggestion-chip { flex: 0 0 auto; min-height: 42px; }
  .input-trust-signals { justify-content: flex-start !important; gap: 8px !important; font-size: 11px !important; }
  .urgent-help-actions .table-btn { width: 100%; justify-content: center; }
  .compliance-footer { padding: 18px 14px; }
}

/* Slide-In Offset for Chat Messages */
.msg-row {
  animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bouncing Dots Keyframes */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* ===========================================================================
   MOBILE UX SPRINT — resilient small-screen layout (320px through tablets)
   =========================================================================== */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  body { min-height: 100dvh; height: 100dvh !important; }
  .main-area { min-width: 0; min-height: 100dvh; height: 100dvh; overflow: hidden; }
  
  /* Sleek Minimalist Top Header (Claude / ChatGPT style) */
  .top-header { height: 50px; padding: 0 14px; flex: 0 0 auto; border-bottom: 1px solid var(--border); background: var(--bg-app); }
  .top-header > div:nth-child(2) { font-size: 16px !important; font-weight: 700 !important; font-family: 'Outfit', sans-serif; letter-spacing: -0.2px; }
  .header-actions { gap: 6px !important; }
  .header-actions .action-btn { padding: 6px 10px; font-size: 12px; border-radius: 20px; }
  .desktop-header-only { display: none !important; }
  .mobile-header-newchat { display: flex !important; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50% !important; padding: 0 !important; background: var(--bg-card) !important; border: 1px solid var(--border) !important; color: var(--text-main) !important; }
  
  /* Hide intrusive view-toggle-bar on mobile (saves 45px prime vertical space) */
  .view-toggle-bar { display: none !important; }

  /* Clean Scrollable Chat Area */
  .chat-container { min-height: 0; padding: 12px 14px 8px; align-items: stretch; }
  .hero-section { margin-top: 2vh; }
  .hero-title { font-size: 21px !important; line-height: 1.3 !important; font-weight: 800 !important; }
  .hero-sub { font-size: 13px !important; line-height: 1.45 !important; margin-bottom: 16px !important; }
  .scales-illustration { margin-bottom: 8px !important; }
  .scales-illustration svg { width: 44px; height: 44px; }
  .chips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .chip { min-width: 0; min-height: 42px !important; padding: 8px 10px; font-size: 12px; white-space: normal; }
  .chat-content-wrap { gap: 14px; padding-bottom: 12px; }
  .msg-row { gap: 8px; }
  .bubble-avatar { width: 28px; height: 28px; font-size: 13px; }
  
  /* Claude / ChatGPT Message Bubble Styling */
  .bubble {
    font-size: 14.5px !important;
    line-height: 1.55 !important;
    padding: 12px 15px !important;
    border-radius: 16px !important;
  }
  .bubble.assistant {
    max-width: 100% !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  }
  .bubble.user {
    max-width: 88% !important;
    background: var(--accent) !important;
    color: #ffffff !important;
  }

  /* Sleek ChatGPT-style Floating Input Composer */
  .input-section {
    flex: 0 0 auto;
    max-height: 46dvh;
    overflow-y: auto;
    padding: 6px 12px calc(12px + env(safe-area-inset-bottom)) !important;
    background: linear-gradient(180deg, transparent 0%, var(--bg-app) 22%) !important;
    border-top: none !important;
    box-shadow: none !important;
  }
  .trust-strip { padding: 0 4px; line-height: 1.35; font-size: 10px !important; }
  .suggestion-chips-container {
    margin-bottom: 6px !important;
    padding: 2px 0 !important;
    gap: 6px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .suggestion-chips-container::-webkit-scrollbar { display: none !important; }
  .suggestion-chip {
    flex: 0 0 auto !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    border-radius: 9999px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03) !important;
    white-space: nowrap !important;
  }
  .input-wrapper {
    gap: 6px;
    padding: 6px 10px;
    border-radius: 26px !important;
    background: var(--bg-card) !important;
    border: 1.5px solid var(--border) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07) !important;
  }
  textarea { min-height: 40px; padding: 9px 4px; font-size: 14.5px !important; }
  .input-trust-signals { display: none !important; }
  .compliance-footer { display: none; }
  .overlay { 
    align-items: stretch !important; 
    justify-content: stretch !important; 
    padding: 0 !important; 
    backdrop-filter: blur(8px);
  }
  .modal { 
    width: 100% !important; 
    max-width: 100% !important; 
    height: 100dvh !important; 
    max-height: 100dvh !important; 
    border-radius: 0 !important; 
    padding: 24px 16px calc(28px + env(safe-area-inset-bottom)) !important; 
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border: none !important;
    box-sizing: border-box !important;
  }
  .modal-close-top { 
    width: 36px !important; 
    height: 36px !important; 
    top: 14px !important; 
    right: 14px !important; 
    font-size: 22px !important;
    background: var(--bg-sidebar-active, rgba(0,0,0,0.05)) !important;
    border: 1px solid var(--border) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 20;
    cursor: pointer;
  }
  .modal-btns { flex-direction: column-reverse; }
  .modal-btns button { width: 100%; }

  .doc-header { height: 56px; padding: 0 16px; }
  .doc-body { padding: 24px 16px 150px; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-card { min-height: 132px; }
  .step-title { font-size: 24px !important; margin-bottom: 16px; }
  .form-group { margin-bottom: 18px; }
  .form-input, .form-textarea, .form-select { min-height: 48px; padding: 12px; }
  .radio-group { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .radio-label { min-height: 48px; padding: 10px 12px; }
  .doc-footer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .doc-footer-inner { gap: 8px; }
  .doc-footer-inner button { min-width: 0; padding: 12px 10px; }
}

@media (max-width: 359px) {
  .header-actions .location-btn { display: none; }
  .chips-grid { grid-template-columns: 1fr; }
  .mobile-nav-item { font-size: 9px; }
  .mobile-nav-item > span:first-child { font-size: 18px; }
}

/* ==========================================================================
   FAST LEGAL PROCESS & ACTION HUB CARD
   ========================================================================== */
.fast-action-hub {
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, rgba(59, 130, 246, 0.04) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 14px;
  padding: 16px;
  font-family: 'Outfit', 'Inter', sans-serif;
  color: var(--text-main);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.fast-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}

.fast-action-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.fast-action-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.fast-action-phases {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fast-phase-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fast-phase-card.phase-1 { border-left: 4px solid #10b981; }
.fast-phase-card.phase-2 { border-left: 4px solid #3b82f6; }
.fast-phase-card.phase-3 { border-left: 4px solid #8b5cf6; }

.fast-phase-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fast-phase-label {
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fast-phase-time {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--bg-input);
  color: var(--text-muted);
  border-radius: 6px;
}

.fast-phase-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.fast-checklist-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.fast-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.fast-check-item input[type="checkbox"] {
  accent-color: var(--accent);
  margin-top: 2px;
  cursor: pointer;
}

.fast-action-btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.btn-auto-draft {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  border: none;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn-auto-draft:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.btn-portal-link {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  color: var(--text-main) !important;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-portal-link:hover {
  background: var(--bg-input);
  border-color: var(--accent);
}

.btn-helpline-link {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e !important;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
[data-theme="dark"] .btn-helpline-link {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24 !important;
}

.fast-fee-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
