/* SDME portal: native-app style UI. One phone-width shell on every screen size. */
:root {
  --forest: #12392F; --forest-2: #1B4F40; --saffron: #E9A23B; --maroon: #7B2432;
  --ink: #15201B; --muted: #5A6A62; --surface: #F1F5F1; --card: #FFFFFF; --line: #E0E7DF;
  --outer: #D5DFD8; --open: #17794F; --closed: #8A5A1F; --c: var(--forest);
  --app-w: 480px; --bar-h: 58px; --tab-h: 68px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --font-body: "Mukta", "Noto Sans Kannada", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Newsreader", "Noto Serif Kannada", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root { --surface: #0D1713; --card: #15231C; --ink: #E7EEE9; --muted: #9DB0A5; --line: #25362D; --outer: #040807; --open: #4CC38A; --closed: #E0B36A; }
}
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + var(--safe-t) + 70px); background: var(--outer); }
body { margin: 0; background: var(--outer); color: var(--ink); font: 400 1.0625rem/1.5 var(--font-body); overscroll-behavior-y: none; touch-action: manipulation; }
html[lang="kn"] body { line-height: 1.65; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0; }
p { margin: 0; } ul { margin: 0; padding: 0; list-style: none; } a { color: inherit; }
svg { max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--saffron); color: #1b1b1b; padding: 10px 14px; border-radius: 12px; z-index: 100; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 8px; }

/* The app shell: a single phone-width column, centred on large screens */
.app { width: 100%; max-width: var(--app-w); min-height: 100dvh; margin-inline: auto; background: var(--surface); padding-bottom: calc(var(--tab-h) + var(--safe-b) + 26px); position: relative; }
@media (min-width: 520px) { .app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0,0,0,.22); } }
main { animation: enter .22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wrap { padding-inline: 16px; }

/* Press feedback on everything tappable */
.btn, .pill, .quick__item, .card, .lang a, .util, .bottomnav a, .more { transition: transform .12s ease, background-color .12s; }
.btn:active, .pill:active, .quick__item:active, .card:active, .util:active, .bottomnav a:active { transform: scale(.96); }

/* App bar */
.appbar { position: sticky; top: 0; z-index: 50; background: var(--forest); color: #fff; padding-top: var(--safe-t); transition: box-shadow .2s; }
.appbar.is-scrolled { box-shadow: 0 4px 16px rgba(0,0,0,.28); }
.appbar__row { height: var(--bar-h); padding-inline: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand__mark { display: grid; flex: none; }
.brand__mark svg { width: 36px; height: 36px; }
.brand__text { display: grid; line-height: 1.12; min-width: 0; }
.brand__text strong { font: 600 1.02rem var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__text small { font-size: .74rem; opacity: .78; }
.appbar__tools { display: flex; align-items: center; gap: 8px; }
.lang { display: inline-flex; background: rgba(255,255,255,.14); border-radius: 999px; padding: 3px; }
.lang a { text-decoration: none; font-size: .84rem; font-weight: 600; padding: 0 11px; border-radius: 999px; min-height: 32px; display: grid; place-items: center; }
.lang a[aria-current="true"] { background: var(--saffron); color: #1b1b1b; }
.util { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.14); text-decoration: none; }

/* Home hero */
.hero { position: relative; background: var(--forest); color: #fff; overflow: hidden; padding: 6px 0 92px; border-radius: 0 0 32px 32px; }
.hero__ridge { position: absolute; inset: auto 0 0 0; width: 100%; height: 92px; }
.hero__body { position: relative; }
.hero h1 { font-size: clamp(1.7rem, 7.4vw, 2.2rem); max-width: 16ch; }
.hero p { margin-top: 8px; opacity: .9; font-size: .98rem; max-width: 38ch; }
.hero__search { margin-top: 16px; display: flex; align-items: center; gap: 10px; background: #fff; color: #1b1b1b; border-radius: 16px; padding: 0 16px; min-height: 52px; box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.hero__search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit; min-height: 48px; outline: none; }
.hero__search:focus-within { outline: 3px solid var(--saffron); outline-offset: 2px; }

/* Icon grid, like an app launcher */
.quick { margin: -66px 16px 0; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 18px 8px 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 4px; box-shadow: 0 10px 28px rgba(18,57,47,.16); }
.quick__item { display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; text-align: center; font-size: .78rem; font-weight: 600; line-height: 1.2; padding: 2px; }
.quick__ic { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, var(--card)); color: var(--c); }
@media (prefers-color-scheme: dark) { .quick__ic { color: color-mix(in srgb, var(--c) 55%, #fff); } }

/* Sections */
.block { padding: 22px 16px 0; }
.block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block__head h2 { font-size: 1.3rem; }
.more { display: inline-flex; align-items: center; gap: 4px; color: var(--forest); font-weight: 600; text-decoration: none; font-size: .92rem; min-height: 36px; }
@media (prefers-color-scheme: dark) { .more { color: var(--saffron); } }
.pagehead { background: var(--forest); color: #fff; padding: 6px 16px 24px; border-radius: 0 0 28px 28px; }
.pagehead h1 { font-size: 1.75rem; }
.pagehead p { margin-top: 6px; opacity: .88; font-size: .96rem; }
.mission { margin: 26px 16px 0; background: var(--maroon); color: #fff; padding: 24px 20px; border-radius: 26px; }
.mission__text { font: 500 1.3rem/1.35 var(--font-head); }
.mission__src { margin-top: 10px; font-size: .85rem; opacity: .8; }

/* Filter bar: pinned under the app bar like a native segmented header */
.filterbar { padding: 14px 16px 10px; display: grid; gap: 10px; position: sticky; top: calc(var(--bar-h) + var(--safe-t)); z-index: 40; background: var(--surface); }
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0 14px; min-height: 48px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); min-height: 44px; outline: none; }
.search:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(233,162,59,.55); }
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-snap-type: x proximity; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; scroll-snap-align: start; font: 500 .94rem var(--font-body); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; min-height: 42px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.pill__n { font-size: .78rem; color: var(--muted); }
.pill[aria-pressed="true"] { background: var(--forest); color: #fff; border-color: var(--forest); }
.pill[aria-pressed="true"] .pill__n { color: #fff; opacity: .8; }
.list { padding: 0 16px; }
.results { color: var(--muted); font-size: .88rem; margin: 4px 2px 10px; }
.group { margin-bottom: 20px; }
.group__title { font-size: 1.2rem; margin: 8px 2px 12px; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 22px; }

/* Cards */
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 2px 16px 12px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail .card { scroll-snap-align: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 10px rgba(18,57,47,.06); }
.card__top { display: flex; gap: 12px; align-items: center; }
.tile { flex: none; width: 52px; height: 52px; border-radius: 17px; background: color-mix(in srgb, var(--c) 15%, var(--card)); color: var(--c); display: grid; place-items: center; }
@media (prefers-color-scheme: dark) { .tile { color: color-mix(in srgb, var(--c) 55%, #fff); } }
.card__head { min-width: 0; }
.card__cat { font-size: .8rem; color: var(--muted); }
.card__title { font-size: 1.1rem; margin-top: 1px; }
.card__desc { opacity: .86; font-size: .98rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, var(--card)); }
.badge--open { background: color-mix(in srgb, var(--open) 16%, var(--card)); color: var(--open); }
.badge--open::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--open); margin-right: 6px; vertical-align: 1px; }
.badge--closed { background: color-mix(in srgb, var(--closed) 16%, var(--card)); color: var(--closed); }
.badge--accent { background: var(--saffron); color: #231a05; }
.meta { display: grid; gap: 4px; color: var(--muted); font-size: .9rem; }
.meta li { display: flex; gap: 8px; align-items: flex-start; }
.meta .ic { flex: none; margin-top: 4px; }
.card__actions { display: flex; gap: 8px; padding-top: 2px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px; background: var(--forest); color: #fff; text-decoration: none; font-weight: 600; font-size: .94rem; flex: 1 1 auto; }
.btn--ghost { background: transparent; color: var(--forest); border: 1.5px solid var(--forest); }
@media (prefers-color-scheme: dark) { .btn { background: var(--saffron); color: #1b1b1b; } .btn--ghost { background: transparent; color: var(--saffron); border-color: var(--saffron); } }
.tips { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--saffron); border-radius: 22px; padding: 18px; }
.tips h2 { font-size: 1.15rem; margin-bottom: 6px; }
.tips li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .98rem; }
.tips li:last-child { border: 0; }
.tips__note { margin-top: 8px; color: var(--muted); font-size: .88rem; }

/* Footer, kept short for an app feel */
.footer { margin: 28px 16px 0; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; font-size: .92rem; }
.footer__grid { display: grid; gap: 14px; }
.footer__name { font: 600 1.02rem var(--font-head); }
.footer__muted { color: var(--muted); margin-top: 4px; }
.footer__links { display: grid; gap: 0; }
.footer__links a { display: inline-block; padding: 7px 0; text-decoration: none; color: var(--forest); font-weight: 600; }
@media (prefers-color-scheme: dark) { .footer__links a { color: var(--saffron); } }
.footer__copy { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

/* Floating bottom tab bar, aligned to the app column */
.bottomnav { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); width: min(calc(100% - 20px), calc(var(--app-w) - 20px)); height: var(--tab-h); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; background: color-mix(in srgb, var(--card) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 500; min-width: 0; border-radius: 22px; }
.bottomnav a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottomnav a[aria-current="page"] { background: var(--forest); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .bottomnav a[aria-current="page"] { background: var(--saffron); color: #1b1b1b; } }

@media (prefers-reduced-motion: reduce) { *, main { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .appbar, .bottomnav, .filterbar { display: none; } .app { box-shadow: none; padding: 0; } }
