
:root {
  --primary: #059669; /* Switched to a Kerala Green theme for Malayalam */
  --primary-dark: #047857;
  --primary-light: #D1FAE5; 
  --sugg-active-bg: #D1FAE5;
  --sugg-active-circle: #059669;
  --sugg-inactive-circle: #F3F4F6;
  --sugg-text: #374151;
  --text: #1F2937;
  --text-dark: #111827;
  --text-mid: #6B7280;
  --text-light: #9CA3AF;
  --white: #FFFFFF;
  --soft-white: #F9FAFB;
  --bg: #F3F4F6;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.15), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --container: 1100px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans Malayalam', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.container { width: min(var(--container), calc(100% - 32px)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}
.nav-shell { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #111, #333); color: var(--primary);
  display: grid; place-items: center; font-size: 1.25rem;
}
.brand-text { display: flex; align-items: flex-end; gap: 4px; line-height: 1; }
.brand-text strong { font-size: 1.45rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.brand-text strong span { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text-mid); font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.main-cta {
  min-height: 40px; padding: 0 20px; border: none; border-radius: 999px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 0.9rem;
}

/* Hero & Editor */
.hero { padding: 48px 0 24px; text-align: center; }
.hero-head h1 { margin: 0 auto 16px; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; font-weight: 800; color: var(--text-dark); }
.hero-head .accent { color: var(--primary); }
.hero-head p { max-width: 680px; margin: 0 auto; color: var(--text-mid); font-size: 1.05rem; line-height: 1.6; }
.editor-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 16px; margin-top: 24px; border: 1px solid var(--border); }
.editor-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.lang-switch, .tool-actions { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pill-btn, .action-btn {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--white); color: var(--text-dark); font-size: 0.9rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: all 0.2s;
}
.pill-btn:hover, .action-btn:hover { background: var(--soft-white); }
.pill-btn.active { background: var(--primary-light); border-color: var(--primary-light); color: var(--primary-dark); }
.editor-shell {
  position: relative; background: var(--soft-white); border: 2px solid var(--primary-light);
  border-radius: var(--radius-md); display: flex; flex-direction: column; transition: border-color 0.2s;
}
.editor-shell:focus-within { border-color: #A7F3D0; background: var(--white); }
.textarea-wrapper { flex-grow: 1; position: relative; display: flex; flex-direction: column; }
#home_th_ta_box {
  width: 100%; min-height: 350px; resize: vertical; border: none; outline: none;
  background: transparent; color: var(--text); font-size: 1.15rem; line-height: 1.8; display: block; padding: 20px;
}
#home_th_ta_box::placeholder { color: var(--text-light); }

/* Suggestions */
.suggestion-popup {
  display: none; position: absolute; width: 280px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 99;
  overflow: hidden; top: 0; left: 0;
}
.suggestion-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.suggestion-head strong { font-size: 0.8rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; }
.suggestion-close { background: transparent; border: none; color: var(--text-mid); font-size: 1.4rem; cursor: pointer; padding: 0; }
.suggestions-list { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; padding-bottom: 8px; }
.suggestion-item {
  display: flex; align-items: center; gap: 16px; padding: 12px 16px;
  background: var(--white); border: none; border-bottom: 1px solid transparent; 
  cursor: pointer; text-align: left;
}
.sugg-number { width: 24px; height: 24px; border-radius: 50%; background: var(--sugg-inactive-circle); color: var(--text-light); display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.sugg-text { font-size: 1.15rem; color: var(--sugg-text); font-weight: 500; }
.suggestion-item.active, .suggestion-item:hover { background: var(--sugg-active-bg); }
.suggestion-item.active .sugg-number, .suggestion-item:hover .sugg-number { background: var(--sugg-active-circle); color: #fff; }
.suggestion-item.active .sugg-text, .suggestion-item:hover .sugg-text { color: var(--sugg-active-circle); }
.suggestion-footer { padding: 10px; text-align: center; border-top: 1px solid var(--border); background: var(--white); font-size: 0.8rem; color: var(--text-light); }
.suggestion-footer kbd { background: var(--white); border: 1px solid #D1D5DB; border-radius: 4px; padding: 2px 6px; font-family: inherit; font-weight: 600; color: var(--text-mid); }
#caret-mirror { position: absolute; visibility: hidden; white-space: pre-wrap; word-wrap: break-word; top: 0; left: 0; z-index: -9999; }

/* Bottom bar & Voices */
.editor-bottom { padding: 12px 16px; background: var(--soft-white); display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); flex-wrap: wrap; border-radius: 0 0 12px 12px; gap: 12px; }
.voice-box { display: flex; align-items: center; gap: 12px; background: var(--white); padding: 6px 16px 6px 6px; border-radius: 999px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.voice-main-btn { width: 36px; height: 36px; border: none; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-size: 1.2rem; }
.voice-main-btn.is-live { background: #DCFCE7; color: #16A34A; animation: pulseLive 1.5s infinite; }
@keyframes pulseLive { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.voice-meta { display: flex; flex-direction: column; }
.voice-title { font-size: 0.85rem; font-weight: 700; color: var(--text-dark); }
.voice-status { font-size: 0.75rem; font-weight: 600; color: var(--text-light); }
.voice-status.is-live { color: #16A34A; }
.metrics { display: flex; gap: 8px; }
.metric-chip { padding: 6px 12px; border-radius: 8px; background: var(--white); border: 1px solid var(--border); color: var(--text-mid); font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
#char_count { font-size: 0.85rem; color: var(--text-light); margin-top: 12px; text-align: right; padding-right: 8px; font-weight: 500; }

/* Sections & Footer */
.section-card { background: var(--white); border-radius: var(--radius-lg); padding: 32px; margin-top: 32px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.section-title { text-align: center; margin-bottom: 24px; }
.section-title h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; color: var(--text-dark); margin: 0; }
.section-line { width: 40px; height: 4px; background: var(--primary); border-radius: 999px; margin: 12px auto 0; }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step-card { text-align: center; padding: 20px 16px; border-radius: var(--radius-md); background: var(--soft-white); border: 1px solid var(--border); }
.step-no { width: 28px; height: 28px; margin: 0 auto 12px; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); display: grid; place-items: center; font-size: 0.85rem; font-weight: 800; }
.step-icon { font-size: 1.8rem; color: var(--text-dark); margin-bottom: 8px; }
.step-card h3 { font-size: 1rem; margin: 0 0 6px; }
.step-card p { font-size: 0.85rem; color: var(--text-mid); margin: 0; line-height: 1.5; }
.faq-list { display: grid; gap: 12px; max-width: 800px; margin: 0 auto; }
.faq-list details { background: var(--soft-white); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.faq-list summary { cursor: pointer; font-weight: 700; color: var(--text-dark); list-style: none; display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list p { margin: 12px 0 0; color: var(--text-mid); line-height: 1.7; font-size: 0.95rem; }
.site-footer { margin-top: 48px; background: #111827; color: #fff; padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand .brand-mark { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: none; }
.footer-brand .brand-text strong { color: #fff; }
.footer-brand .brand-text strong span { color: #34D399; }
.footer-box p, .footer-box a { color: #9CA3AF; line-height: 1.6; font-size: 0.9rem; margin: 0 0 16px; }
.footer-box h5 { margin: 0 0 16px; font-size: 1.05rem; color: #fff; font-weight: 700; }
.footer-box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 32px; padding-top: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }

@media (max-width: 900px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .hero { padding: 24px 0 16px; }
  .editor-card { padding: 12px; margin-top: 12px; }
  #home_th_ta_box { min-height: 250px; padding: 16px 16px 120px 16px; }
  .editor-bottom { flex-direction: column; align-items: stretch; }
  .voice-box { margin: 0 auto; }
  .metrics { justify-content: center; }
  .suggestion-popup { left: 50% !important; right: auto !important; transform: translateX(-50%) !important; top: 20px !important; width: 90%; max-width: 320px; }
  .steps-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
