/* MSS — design tokens from docs/UI_UX_DESIGN_SYSTEM.md and the MSS Desktop screens */
:root {
  --primary: #2563EB; --primary-hover: #1565C0; --primary-soft: #EFF6FF; --primary-line: #BFDBFE;
  --navy: #0B2545; --saffron: #FF9933;
  --success: #047857; --success-soft: #ECFDF5; --warning: #B45309; --warning-soft: #FFFBEB; --error: #D32F2F; --error-soft: #FEF2F2;
  --bg: #F8FAFC; --surface: #FFFFFF; --text: #0F172A; --text-2: #374151; --muted: #6B7280; --faint: #9CA3AF;
  --line: #E2E8F0; --line-soft: #F1F5F9;
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.05);
  --shadow-lg: 0 16px 40px rgba(15,23,42,.14);
  --ease: cubic-bezier(.2,.7,.2,1);
  --nav-h: 64px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Poppins, Inter, sans-serif;
}
:root[lang="ta"] { --font: "Noto Sans Tamil", Inter, sans-serif; --display: "Noto Sans Tamil", Poppins, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
:root[lang="ta"] body { line-height: 1.7; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.02em; line-height: 1.25; color: var(--text); }
:root[lang="ta"] h1, :root[lang="ta"] h2, :root[lang="ta"] h3, :root[lang="ta"] h4 { letter-spacing: 0; line-height: 1.4; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid rgba(37,99,235,.45); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.page { padding: 28px 0 64px; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.grid-main { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 24px; align-items: start; }
.grid-detail { display: grid; grid-template-columns: 200px minmax(0,1fr) 300px; gap: 24px; align-items: start; }
.grid-side { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.sticky { position: sticky; top: calc(var(--nav-h) + 20px); }

/* ---------- Top nav ---------- */
.topnav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topnav .container { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand b { font: 700 17px/1 var(--display); letter-spacing: -.02em; }
.brand small { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .02em; margin-top: 2px; }
.navlinks { display: flex; gap: 4px; }
.navlinks a { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--text-2); transition: background .15s, color .15s; }
.navlinks a:hover { background: var(--line-soft); color: var(--text); }
.navlinks a.active { background: var(--primary-soft); color: var(--primary); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-search { position: relative; width: 280px; }
.nav-search input { width: 100%; height: 40px; padding: 0 44px 0 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.nav-search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.nav-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.nav-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 11px var(--font); color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.lang button { border: 0; background: none; padding: 7px 11px; font-size: 13px; font-weight: 600; color: var(--muted); min-height: 36px; }
.lang button.on { background: var(--primary); color: #fff; }
.avatar-btn { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.avatar-btn img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #E0F2FE; }
.avatar-btn span { font-size: 13px; font-weight: 600; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: absolute; right: 24px; top: calc(var(--nav-h) - 6px); width: 240px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 8px; animation: fade .15s var(--ease); z-index: 60; }
.menu header { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.menu header b { display: block; font-size: 14px; }
.menu header small { color: var(--muted); font-size: 12.5px; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 8px; background: none; font-size: 14px; font-weight: 500; color: var(--text-2); text-align: left; }
.menu a:hover, .menu button:hover { background: var(--line-soft); color: var(--text); }
.menu .danger { color: var(--error); }

/* Mobile tab bar */
.tabbar { display: none; }

/* ---------- Primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.card-sm { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title h3 { font-size: 18px; font-weight: 600; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.h1 { font-size: clamp(26px, 3.2vw, 40px); font-weight: 700; }
.h2 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-size: 14.5px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: #13335c; color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #DBEAFE; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 15.5px; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text-2); }
.icon-btn:hover { background: var(--bg); }
.icon-btn.on { color: var(--primary); background: var(--primary-soft); border-color: var(--primary-line); }

.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--line-soft); color: var(--text-2); border: 1px solid transparent; white-space: nowrap; }
button.chip { min-height: 34px; }
button.chip:hover { border-color: var(--line); background: #fff; }
.chip.on { background: var(--primary); color: #fff; }
.chip-blue { background: var(--primary-soft); color: #1D4ED8; }
.chip-green { background: var(--success-soft); color: var(--success); }
.chip-amber { background: var(--warning-soft); color: var(--warning); }
.chip-red { background: var(--error-soft); color: var(--error); }
.chip-navy { background: var(--navy); color: #fff; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: .02em; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .select { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #D7DEE7; border-radius: 12px; background: #fff; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.error-text { color: var(--error); font-size: 13px; }
.check { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.check .count { margin-left: auto; font-size: 12px; color: var(--faint); }
.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #CBD5E1; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--primary); }
.toggle input:checked + span::after { transform: translateX(18px); }
.seg { display: inline-flex; padding: 3px; background: var(--line-soft); border-radius: 12px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); min-height: 34px; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.1); }

.progress { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .5s var(--ease); }
.divider { height: 1px; background: var(--line-soft); margin: 4px 0; }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty h3 { font-size: 18px; margin-bottom: 6px; color: var(--text); }
.empty .btn { margin-top: 16px; }

/* ---------- Search bar ---------- */
.searchbar { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.searchbar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.searchbar svg { color: var(--faint); flex-shrink: 0; }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 16px; height: 44px; }
.searchbar .icon-btn { border: 0; }

/* ---------- Scheme card ---------- */
.scheme { position: relative; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 16px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); }
.scheme:hover { border-color: #CBD5E1; box-shadow: var(--shadow); }
.scheme .mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font: 700 15px var(--display); }
.scheme .mark.state { background: #FFF7ED; color: #C2410C; }
.scheme h4 { font-size: 16.5px; font-weight: 600; line-height: 1.35; }
.scheme h4 a { color: var(--text); }
.scheme h4 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.scheme h4 a:hover { color: var(--primary); }
.scheme .meta { font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; }
.scheme .desc { font-size: 14px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scheme .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.scheme .side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; min-width: 96px; }
.scheme .side .icon-btn { position: relative; z-index: 1; }
.match { text-align: right; }
.match b { font: 700 18px var(--display); color: var(--success); }
.match.mid b { color: var(--warning); }
.match.low b { color: var(--faint); }
.match small { display: block; font-size: 11px; color: var(--muted); }
.scheme-compact { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.scheme-compact .desc { -webkit-line-clamp: 3; }
.scheme-compact .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; }
.scheme-compact .foot .chip { display: block; min-width: 0; }

.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.cards-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(28px, 5vw, 64px); color: #fff; background: linear-gradient(160deg, rgba(11,37,69,.9), rgba(37,99,235,.74)), url("assets/login-bg.webp") center/cover; }
.auth-hero .logo { width: 96px; padding: 12px; background: rgba(255,255,255,.94); border-radius: 18px; }
.auth-hero h1 { color: #fff; font-size: clamp(30px, 4vw, 52px); font-weight: 700; line-height: 1.12; max-width: 620px; }
.auth-hero p { color: #DBEAFE; font-size: clamp(15px, 1.4vw, 18px); max-width: 560px; margin-top: 18px; }
.auth-hero .pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.auth-hero .pills span { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.26); }
.auth-hero .foot { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: #BFDBFE; }
.auth-hero .foot img { height: 40px; filter: brightness(0) invert(1); }
.auth-panel { display: grid; place-items: center; padding: clamp(20px, 5vw, 64px); }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 20px; padding: clamp(24px, 4vw, 44px); background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 12px 32px rgba(15,23,42,.06); }
.demo-note { padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: #1E40AF; font-size: 13px; line-height: 1.5; }
.demo-note code { font: 600 13px ui-monospace, Consolas, monospace; background: #fff; padding: 1px 6px; border-radius: 6px; }
.or { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; color: var(--faint); letter-spacing: .06em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pw { position: relative; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px; }

/* ---------- Onboarding ---------- */
.onb { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; background: linear-gradient(180deg, rgba(248,250,252,.85), var(--bg)), url("assets/onboarding-bg.webp") center/cover; }
.onb-card { width: 100%; max-width: 760px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow-lg); }
.steps { display: flex; gap: 6px; margin: 20px 0 28px; }
.steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); transition: background .3s; }
.steps i.on { background: var(--primary); }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.option { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; text-align: left; min-height: 64px; transition: border-color .15s, background .15s; }
.option b { font-size: 14.5px; font-weight: 600; }
.option small { font-size: 12.5px; color: var(--muted); }
.option:hover { border-color: #CBD5E1; }
.option.on { border-color: var(--primary); background: var(--primary-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Home ---------- */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: clamp(24px, 4vw, 44px); color: #fff; background: linear-gradient(120deg, rgba(11,37,69,.96) 0%, rgba(11,37,69,.86) 55%, rgba(37,99,235,.7) 100%), url("assets/home-bg.webp") center/cover; }
.hero h1 { color: #fff; font-size: clamp(26px, 3.4vw, 42px); font-weight: 700; }
.hero .hi { color: #BFDBFE; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.hero .searchbar { margin-top: 22px; max-width: 760px; border: 0; }
.hero .quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero .quick button { border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; min-height: 36px; transition: background .15s; }
.hero .quick button:hover { background: rgba(255,255,255,.2); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.stat b { display: block; font: 700 28px/1.1 var(--display); letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.companion { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: var(--r-lg); color: #fff; background: linear-gradient(160deg, #0B2545, #1E3A8A); overflow: hidden; position: relative; }
.companion img { position: absolute; right: -16px; bottom: -8px; width: 130px; opacity: .95; }
.companion p { color: #CBD5E1; font-size: 14px; max-width: 70%; }
.companion h3 { color: #fff; font-size: 18px; }
.update { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.update:last-child { border-bottom: 0; padding-bottom: 0; }
.update i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex-shrink: 0; }
.update b { display: block; font-size: 14px; font-weight: 600; }
.update p { font-size: 13px; color: var(--muted); }
.list-link { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--text); border-bottom: 1px solid var(--line-soft); }
.list-link:last-child { border-bottom: 0; }
.list-link:hover { color: var(--primary); }
.list-link span { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Search ---------- */
.filters h4 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; font-family: var(--font); }
.filters h4:first-of-type { margin-top: 0; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.active-filters .chip button { border: 0; background: none; padding: 0 0 0 2px; color: inherit; font-size: 14px; line-height: 1; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filter-toggle { display: none; }
.drawer-backdrop { display: none; }
mark { background: #FEF08A; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Discover ---------- */
.cat { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text); text-align: left; transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); }
.cat:hover { border-color: var(--primary-line); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.cat .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--primary-soft); }
.cat b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.cat small { font-size: 12.5px; color: var(--muted); }
.org { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); }
.org:hover { border-color: var(--primary-line); color: var(--text); }
.org b { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.35; }
.org .n { font: 700 13px var(--display); color: var(--primary); background: var(--primary-soft); padding: 4px 9px; border-radius: 8px; }

/* ---------- Detail ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.detail-head { display: grid; grid-template-columns: 64px minmax(0,1fr) auto; gap: 20px; align-items: start; }
.detail-head .emblem { width: 64px; height: 64px; object-fit: contain; }
.detail-head h1 { font-size: clamp(24px, 3vw, 36px); font-weight: 700; }
.detail-head .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.tile { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.tile .eyebrow { font-size: 11px; }
.tile b { display: block; font: 700 22px/1.2 var(--display); margin: 6px 0 2px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.tile small { font-size: 12.5px; color: var(--muted); }
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc a { padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.toc a:hover { background: var(--line-soft); color: var(--text); }
.toc a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.section { scroll-margin-top: calc(var(--nav-h) + 20px); }
.prose p + p { margin-top: 10px; }
.prose { color: var(--text-2); font-size: 15px; }
.checkrow { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; align-items: flex-start; }
.checkrow .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; font-weight: 700; }
.checkrow.ok { background: #F0FDF4; border-color: #BBF7D0; } .checkrow.ok .dot { background: #16A34A; color: #fff; }
.checkrow.no { background: #FEF2F2; border-color: #FECACA; } .checkrow.no .dot { background: var(--error); color: #fff; }
.checkrow.unk { background: var(--bg); } .checkrow.unk .dot { background: #E2E8F0; color: var(--muted); }
.checkrow b { display: block; font-size: 14.5px; font-weight: 600; }
.checkrow small { font-size: 13px; color: var(--muted); }
.docs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.doc { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.doc input { width: 18px; height: 18px; accent-color: var(--success); margin: 2px 0 0; flex-shrink: 0; }
.doc b { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.doc small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.doc.done { background: #F0FDF4; border-color: #BBF7D0; }
.doc.done b { text-decoration: line-through; text-decoration-color: rgba(4,120,87,.4); }
.steps-list { counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.steps-list li { list-style: none; display: grid; grid-template-columns: 30px 1fr; gap: 12px; font-size: 14.5px; color: var(--text-2); }
.steps-list li::before { counter-increment: s; content: counter(s); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font: 700 13px var(--display); }
.steps-list { padding: 0; margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.faq { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.faq + .faq { margin-top: 8px; }
.faq summary { padding: 14px 16px; font-weight: 600; font-size: 14.5px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-size: 18px; color: var(--muted); }
.faq[open] summary::after { content: "–"; }
.faq p { padding: 0 16px 14px; color: var(--text-2); font-size: 14px; }
.ask { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.ask h4 { color: #fff; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.ask h4 img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #fff; }
.ask button { text-align: left; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08); color: #E2E8F0; border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 500; min-height: 40px; }
.ask button:hover { background: rgba(255,255,255,.16); }
.lang-note { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--warning); background: var(--warning-soft); padding: 8px 12px; border-radius: 10px; }

/* ---------- Saarthi ---------- */
.chat { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 24px; height: calc(100vh - var(--nav-h) - 56px); min-height: 520px; }
.chat-side { display: flex; flex-direction: column; gap: 16px; }
.chat-side .persona { text-align: center; padding: 24px; }
.chat-side .persona img { width: 140px; margin: 0 auto 12px; }
.chat-main { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.chat-head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--primary-soft); }
.chat-head .status { font-size: 12px; color: var(--success); display: flex; align-items: center; gap: 6px; }
.chat-head .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22C55E; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; max-width: 86%; animation: fade .25s var(--ease); }
.msg img.av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--primary-soft); }
.bubble { padding: 12px 14px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line-soft); font-size: 14.5px; color: var(--text); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.msg.me { align-self: flex-end; }
.msg.me .bubble { background: var(--primary); color: #fff; border-color: var(--primary); border-bottom-right-radius: 4px; }
.msg.bot .bubble { border-top-left-radius: 4px; }
.mini { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
.mini:hover { border-color: var(--primary-line); color: var(--text); }
.mini b { font-size: 14px; font-weight: 600; line-height: 1.35; }
.mini small { font-size: 12px; color: var(--muted); }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 12px; }
.composer { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line-soft); align-items: center; }
.composer input { flex: 1; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; outline: none; font-size: 15px; background: var(--bg); }
.composer input:focus { border-color: var(--primary); background: #fff; }
.mic { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.mic.live { background: var(--error); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(211,47,47,.45); } 100% { box-shadow: 0 0 0 14px rgba(211,47,47,0); } }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* ---------- Admin ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bar { display: grid; grid-template-columns: 160px 1fr 48px; gap: 12px; align-items: center; font-size: 13.5px; padding: 6px 0; }
.bar .progress { height: 10px; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 100; padding: 12px 18px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); transition: opacity .2s, transform .25s var(--ease); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .nav-search { width: 200px; }
  .grid-main { grid-template-columns: minmax(0,1fr) 300px; }
  .grid-detail { grid-template-columns: minmax(0,1fr) 280px; }
  .grid-detail .toc-wrap { display: none; }
  .cards-4 { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .navlinks, .nav-search { display: none; }
  .grid-main, .grid-side, .grid-detail { grid-template-columns: minmax(0,1fr); }
  .sticky { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cards-3, .cards-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { min-height: auto; }
  .auth-hero .foot { display: none; }
  .toc-wrap { display: none; }
  .detail-head { grid-template-columns: 56px minmax(0,1fr); }
  .detail-head .emblem { width: 56px; height: 56px; }
  .detail-head .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - var(--nav-h) - 72px - 40px); }
  .chat-side { display: none; }
  body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 10px; min-height: 52px; justify-content: center; }
  .tabbar a.active { color: var(--primary); }
  .filters-panel { position: fixed; inset: 0 auto 0 0; width: min(340px, 88vw); z-index: 70; background: #fff; overflow-y: auto; padding: 20px; transform: translateX(-100%); transition: transform .3s var(--ease); border-radius: 0 20px 20px 0; }
  .filters-panel.open { transform: none; box-shadow: var(--shadow-lg); }
  .drawer-backdrop.open { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(15,23,42,.4); animation: fade .2s; }
  .filter-toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .page { padding: 18px 0 40px; }
  .topnav .container { gap: 12px; }
  .brand small, .avatar-btn span { display: none; }
  .avatar-btn { padding: 3px; }
  .card { padding: 18px; border-radius: 16px; }
  .cards-2, .cards-3, .docs, .form-grid { grid-template-columns: minmax(0,1fr); }
  .cards-4 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .cat { padding: 14px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 22px; }
  .scheme { grid-template-columns: minmax(0,1fr); gap: 10px; padding: 16px; }
  .scheme .mark { display: none; }
  .scheme .side { flex-direction: row; align-items: center; min-width: 0; }
  .match { text-align: left; }
  .detail-head { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .detail-head .emblem { width: 48px; height: 48px; }
  .detail-head .actions { justify-content: flex-start; }
  .detail-head .actions .btn-primary { flex: 1 1 100%; }
  .msg { max-width: 94%; }
  .chat { height: calc(100vh - var(--nav-h) - 80px - 24px); }
  .bar { grid-template-columns: 110px 1fr 40px; }
  .companion p { max-width: 62%; }
  .auth-hero { padding: 24px 20px 28px; gap: 20px; }
  .auth-hero .pills { display: none; }
  .auth-hero .logo { width: 64px; padding: 8px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topnav, .tabbar, .actions, .toc-wrap, .ask, #toast, .no-print { display: none !important; }
  body { background: #fff; }
  .grid-main, .grid-side { grid-template-columns: 1fr; }
  .card { break-inside: avoid; }
}

/* Lucide Icons Integration */
.lucide {
  width: 1.25em;
  height: 1.25em;
  stroke-width: 2;
  display: inline-block;
  vertical-align: middle;
}
.ico .lucide {
  width: 24px;
  height: 24px;
}

/* ---------- App Footer ---------- */
.app-footer {
  margin-top: 48px;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.app-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-footer-brand a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-family: var(--display);
  font-size: 14.5px;
}
.app-footer-brand img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.app-footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-footer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12.5px;
  text-decoration: none;
  transition: all .15s ease;
}
.app-footer-pill:hover {
  transform: translateY(-1px);
}
.app-footer-pill.primary {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-line);
}
.app-footer-pill.primary:hover {
  background: #DBEAFE;
}
.app-footer-pill.ghost {
  background: #fff;
  color: var(--text-2);
  border: 1px solid var(--line);
}
.app-footer-pill.ghost:hover {
  background: var(--line-soft);
  color: var(--text);
}
.app-footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s;
}
.app-footer-link:hover {
  color: var(--primary);
}

@media (max-width: 768px) {
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px;
    margin-top: 32px;
    gap: 14px;
  }
}

