/* Import fonts — support Indian scripts */
@import url('https://fonts.googleapis.com/css2?family=Mukta:wght@400;500;700&family=Noto+Sans:wght@400;500;700&family=Noto+Sans+Tamil:wght@400;500;700&family=Noto+Sans+Devanagari:wght@400;500;700&family=Noto+Sans+Telugu:wght@400;500;700&family=Noto+Sans+Kannada:wght@400;500;700&family=Noto+Sans+Malayalam:wght@400;500;700&family=Noto+Sans+Bengali:wght@400;500;700&family=Noto+Sans+Gujarati:wght@400;500;700&family=Noto+Sans+Oriya:wght@400;500;700&family=Noto+Sans+Gurmukhi:wght@400;500;700&display=swap');

:root {
  --primary: #1B4332;
  /* deep forest green — trust */
  --primary-mid: #40916C;
  /* medium green */
  --primary-lt: #D8F3DC;
  /* light green tint */
  --accent: #F97316;
  /* warm orange — action */
  --accent-lt: #FFF3E0;
  /* light orange tint */
  --danger: #DC2626;
  /* urgent red */
  --danger-lt: #FEE2E2;
  --warning: #D97706;
  /* medium amber */
  --warning-lt: #FEF3C7;
  --success: #059669;
  /* confirmed green */
  --success-lt: #D1FAE5;
  --bg: #F0F7F4;
  /* soft near-white green tint */
  --card: #FFFFFF;
  --text: #1A2E22;
  /* dark green-gray for better readability */
  --text-muted: #4B5A50;
  --border: #D2DFD6;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 4px rgba(27, 67, 50, 0.06);
  --shadow-md: 0 6px 20px rgba(27, 67, 50, 0.08);
  --shadow-lg: 0 12px 30px rgba(27, 67, 50, 0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans', 'Mukta', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(27, 67, 50, 0.05);
  background-attachment: fixed;
  position: relative;
}

/* Script Overrides for Regional Languages */
[lang="ta"] {
  font-family: 'Noto Sans Tamil', sans-serif;
}

[lang="hi"],
[lang="mr"] {
  font-family: 'Noto Sans Devanagari', sans-serif;
}

[lang="te"] {
  font-family: 'Noto Sans Telugu', sans-serif;
}

[lang="kn"] {
  font-family: 'Noto Sans Kannada', sans-serif;
}

[lang="ml"] {
  font-family: 'Noto Sans Malayalam', sans-serif;
}

[lang="bn"],
[lang="as"] {
  font-family: 'Noto Sans Bengali', sans-serif;
}

[lang="gu"] {
  font-family: 'Noto Sans Gujarati', sans-serif;
}

[lang="or"] {
  font-family: 'Noto Sans Oriya', sans-serif;
}

[lang="pa"] {
  font-family: 'Noto Sans Gurmukhi', sans-serif;
}

[lang="ur"] {
  font-family: 'Noto Sans', sans-serif;
}

/* RTL support for Urdu */
body[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

main {
  flex: 1;
  padding: 20px 16px 20px 16px;
  /* Space for sticky chat at bottom is toggled dynamically */
}

/* Accessibility skip-to-content */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.2s;
  text-decoration: none;
  font-weight: bold;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  top: 0;
}

/* Offline banner */
.offline-banner {
  background: var(--warning-lt);
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--warning);
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.offline-banner.visible {
  display: flex;
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--card);
  border-bottom: 1.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

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

.logo-container svg {
  width: 36px;
  height: 36px;
  fill: var(--primary);
}

.app-title {
  font-family: 'Mukta', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.lang-selector-btn {
  background: var(--primary-lt);
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.lang-selector-btn:hover {
  background: var(--primary-mid);
  color: white;
}

/* Progress bar */
.progress-bar-container {
  margin-bottom: 24px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Screens Wrapper */
.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SCREEN 0: Language Selection */
.screen-lang {
  text-align: center;
  padding: 40px 10px;
}

.hero-logo {
  margin-bottom: 24px;
}

.hero-logo svg {
  width: 80px;
  height: 80px;
  fill: var(--primary);
  filter: drop-shadow(0 4px 10px rgba(27, 67, 50, 0.15));
}

.hero-title {
  font-family: 'Mukta', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.hero-tagline {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.lang-btn {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  min-height: 85px;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  border-color: var(--primary);
  background: var(--primary-lt);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.lang-btn .flag {
  font-size: 24px;
}

.lang-btn .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.lang-btn .native-name {
  font-size: 11px;
  color: var(--text-muted);
}

/* SCREEN 1: Profile Form */
.form-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

.form-section {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.form-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-mid);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.input-with-mic {
  display: flex;
  gap: 8px;
  align-items: center;
}

input[type="text"],
input[type="number"],
select {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  transition: var(--transition);
  height: 48px;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--primary-mid);
  outline: none;
  background: var(--card);
}

/* Voice input mic button */
.mic-btn {
  background: var(--primary-lt);
  border: 1.5px solid var(--primary-mid);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--primary);
}

.mic-btn:hover {
  background: var(--primary-mid);
}

.mic-btn:hover svg {
  fill: white;
}

.mic-btn.listening {
  background: var(--danger-lt);
  border-color: var(--danger);
  animation: pulse 1.2s infinite;
}

.mic-btn.listening svg {
  fill: var(--danger);
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 10px 4px rgba(220, 38, 38, 0.2);
  }
}

.voice-status {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
  display: none;
}

/* Gender toggle buttons */
.gender-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gender-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gender-btn:hover {
  border-color: var(--primary-mid);
}

.gender-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Slider and live values */
.slider-container {
  display: flex;
  flex-direction: column;
}

.slider-value-display {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.slider-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Mukta', sans-serif;
}

.income-category {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.income-category.bpl {
  background: var(--danger-lt);
  color: var(--danger);
}

.income-category.lower {
  background: var(--warning-lt);
  color: var(--warning);
}

.income-category.middle {
  background: var(--success-lt);
  color: var(--success);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--primary-mid);
}

/* Stepper Buttons for Family Size */
.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stepper-btn {
  background: var(--primary-lt);
  color: var(--primary);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.stepper-btn:hover {
  background: var(--primary-mid);
  color: white;
}

.stepper-value {
  font-size: 20px;
  font-weight: 700;
  width: 30px;
  text-align: center;
}

/* Multi-select chips for Health Needs */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip:hover {
  border-color: var(--primary-mid);
  background: var(--primary-lt);
}

.chip.active {
  background: var(--primary-mid);
  color: white;
  border-color: var(--primary-mid);
}

/* Checkboxes for Documents */
.checkbox-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  font-size: 14px;
}

.checkbox-item:hover {
  border-color: var(--primary-mid);
  background: var(--primary-lt);
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Submit CTA Container */
.cta-container {
  margin-top: 24px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(27, 67, 50, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover {
  box-shadow: 0 6px 15px rgba(27, 67, 50, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* SCREEN 2: Loading screen */
.screen-loading {
  text-align: center;
  padding: 80px 10px;
}

.loading-logo-pulse {
  margin-bottom: 30px;
  animation: logoPulse 1.5s infinite ease-in-out;
}

.loading-logo-pulse svg {
  width: 90px;
  height: 90px;
  fill: var(--primary-mid);
}

@keyframes logoPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
    filter: drop-shadow(0 0 15px rgba(64, 145, 108, 0.4));
  }
}

.loading-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  min-height: 28px;
}

.loading-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 40px;
}

/* SCREEN 3: Results */
.results-header {
  margin-bottom: 24px;
}

.results-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  font-family: 'Mukta', sans-serif;
}

.results-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.view-toggle {
  display: flex;
  background: var(--border);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.view-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}

.view-btn.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Scheme cards list */
.schemes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scheme-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.scheme-card.high-urgency {
  border-left: 5px solid var(--danger);
}

.scheme-card.medium-urgency {
  border-left: 5px solid var(--warning);
}

.scheme-card.low-urgency {
  border-left: 5px solid var(--success);
}

.scheme-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-mid);
}

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

.urgency-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.urgency-badge.badge-high {
  background: var(--danger-lt);
  color: var(--danger);
}

.urgency-badge.badge-medium {
  background: var(--warning-lt);
  color: var(--warning);
}

.urgency-badge.badge-low {
  background: var(--success-lt);
  color: var(--success);
}

.scheme-name-container {
  display: flex;
  flex-direction: column;
}

.scheme-name-en {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.scheme-name-local {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Mukta', sans-serif;
  margin-top: 2px;
}

.benefit-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.benefit-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.benefit-amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Mukta', sans-serif;
}

.benefit-desc {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.ai-reasoning {
  font-size: 14px;
  background: var(--accent-lt);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-style: italic;
}

.collapsible-trigger {
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  padding: 12px 0 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.collapsible-trigger svg {
  width: 16px;
  height: 16px;
  fill: var(--primary-mid);
  transition: transform 0.3s;
}

.collapsible-trigger.active svg {
  transform: rotate(180deg);
}

.collapsible-content {
  display: none;
  padding-top: 12px;
  flex-direction: column;
  gap: 12px;
}

.collapsible-content.visible {
  display: flex;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.info-doc-list {
  list-style: none;
}

.info-doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.info-doc-item input {
  accent-color: var(--success);
}

.info-step-list {
  padding-left: 20px;
  font-size: 13px;
}

.info-step-item {
  margin-bottom: 4px;
}

.scheme-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-secondary {
  flex: 1;
  background: var(--card);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: var(--primary-lt);
}

.btn-whatsapp {
  flex: 1;
  background: #25D366;
  color: white;
  border: none;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-whatsapp:hover {
  background: #20BA56;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.25);
}

/* Compare View: Side-by-side horizontal scroll */
.compare-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 16px 4px;
  scroll-snap-type: x mandatory;
}

.compare-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* Follow-up Chat Floating Window */
.chat-container {
  position: fixed;
  bottom: 90px; /* Sits above the FAB */
  right: calc(50% - 220px);
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 400px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
}

@media (max-width: 500px) {
  .chat-container {
    right: 16px;
    width: calc(100vw - 32px);
  }
}

.chat-header {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10B981;
}

.chat-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 0 4px;
  line-height: 1;
}

.chat-close-btn:hover {
  opacity: 1;
}

.chat-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: calc(50% - 220px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  transition: var(--transition);
}

.chat-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(27, 67, 50, 0.25);
}

.chat-toggle-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

@media (max-width: 500px) {
  .chat-toggle-btn {
    right: 16px;
  }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  margin-bottom: 0;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  max-width: 85%;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-bubble.user {
  background: var(--success-lt);
  color: #064E3B;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-bubble.bot {
  background: var(--bg);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  height: 40px;
  background: var(--bg);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary-mid);
  background: var(--card);
}

.chat-send-btn {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.chat-send-btn:hover {
  background: var(--primary-mid);
}

/* Results footer */
.results-footer {
  text-align: center;
  padding: 30px 10px;
  margin-top: 20px;
  border-top: 1px dashed var(--border);
}

.counter-box {
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-mid);
}

.counter-num {
  font-size: 24px;
  color: var(--primary);
  font-family: 'Mukta', sans-serif;
}

.attribution {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--primary-mid);
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* API Settings Modal Trigger */
.settings-trigger {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  display: none;
  /* Controlled dynamically */
}

.settings-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 400px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.settings-modal.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(27, 67, 50, 0.5);
  backdrop-filter: blur(4px);
  z-index: 199;
}

.modal-overlay.active {
  display: block;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

/* Accessibility */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}