/* IFNR Saathi shared interface layer (v1, October 2026). Pairs with saathi-ux.js. */
:root{--sx-accent:#117460;--sx-accent-ink:#ffffff;--sx-surface:#ffffff;--sx-ink:#16262c;--sx-soft:#4a5d63;--sx-line:#d8e2df;--sx-mark:#fde7a6;--sx-focus:#e0a72e;--sx-chip:#f3f7f5}
html[data-sx-family="stroke"]{--sx-accent:#33598C}
html[data-sx-family="epilepsy"]{--sx-accent:#5B3F8C}
html[data-theme="dark"]{--sx-surface:#18242a;--sx-ink:#e6eeeb;--sx-soft:#b3c3bf;--sx-line:#33464b;--sx-mark:#7a5a00;--sx-accent:#237a64;--sx-chip:#1d2b2f}
html[data-theme="dark"][data-sx-family="stroke"]{--sx-accent:#3a6aa0}
html[data-theme="dark"][data-sx-family="epilepsy"]{--sx-accent:#7b5ea7}

/* ---------- visually hidden text ---------- */
.sx-vh{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---------- hover and keyboard focus for every button and link ---------- */
:where(button,.btn,[role="button"],input[type="button"],input[type="submit"],summary,.navbtn,.icon-btn){cursor:pointer;transition:filter .15s ease,background-color .15s ease,box-shadow .15s ease,color .15s ease}
:where(button,.btn,[role="button"],input[type="button"],input[type="submit"],.navbtn,.icon-btn):not(:disabled):hover{filter:brightness(.94)}
html[data-theme="dark"] :where(button,.btn,[role="button"],input[type="button"],input[type="submit"],.navbtn,.icon-btn):not(:disabled):hover{filter:brightness(1.18)}
:where(summary):hover{filter:brightness(.97)}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--sx-focus);outline-offset:2px}

/* ---------- loading animation: content fades in on load and on every page change ---------- */
@keyframes sx-fade{from{opacity:0}to{opacity:1}}
/* the condition sites already fade each page in; the home and Launch events pages get the same */
@media (prefers-reduced-motion:no-preference){
  html[data-sx-family="home"] body.sx-ready main,html[data-sx-family="events"] body.sx-ready main{animation:sx-fade .35s ease-out both}
}
html.reduce-motion main,body.reduce-motion main{animation:none!important}

/* ---------- header tools (search + dark mode) ---------- */
.sx-tools{display:flex;align-items:center;gap:6px;flex:none}
.sx-tools.sx-push{margin-left:auto}
.sx-tools.sx-inline{margin-right:2px}
.sx-hbtn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;min-width:44px;padding:8px 12px;border-radius:999px;
  border:1px solid var(--sx-line);background:var(--sx-chip);color:var(--sx-ink);font:600 .92rem/1 var(--body,var(--font-body,system-ui,sans-serif))}
.sx-hbtn svg{flex:none}
@media (max-width:720px){.sx-hide-sm{display:none}.sx-hbtn{padding:8px 10px}}
.sx-floating-tools{position:fixed;top:10px;right:10px;z-index:1200}

/* ---------- scroll progress ---------- */
.sx-progress{position:fixed;left:0;top:0;right:0;height:3px;z-index:2000;pointer-events:none;background:transparent}
.sx-progress span{display:block;height:100%;background:var(--sx-accent);transform-origin:0 50%;transform:scaleX(0);transition:transform .08s linear}

/* ---------- floating buttons ---------- */
.sx-fab{position:fixed;z-index:900;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:48px;height:48px;padding:0 14px;border-radius:999px;
  border:0;background:var(--sx-accent);color:var(--sx-accent-ink);font:600 .95rem/1 var(--body,var(--font-body,system-ui,sans-serif));box-shadow:0 6px 18px rgba(0,0,0,.18)}
.sx-fab:hover{filter:brightness(1.1)}
.sx-top{right:18px;bottom:18px;width:48px;padding:0;opacity:0;visibility:hidden;transform:translateY(8px);transition:opacity .2s,transform .2s,visibility .2s}
.sx-top.sx-show{opacity:1;visibility:visible;transform:none}
.sx-contact{right:18px;bottom:18px}
.sx-fab.sx-hidden,.sx-top.sx-show.sx-hidden{opacity:0;visibility:hidden;pointer-events:none}
.sx-contact{transition:opacity .2s,visibility .2s}
@media (max-width:600px){.sx-contact{width:48px;padding:0}.sx-contact .sx-fab-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}
@media (prefers-reduced-motion:reduce){.sx-top{transition:none}.sx-progress span{transition:none}}

/* ---------- Sawaal-Jawaab Saathi (guided FAQ assistant) ---------- */
.sx-qa-fab{right:18px;bottom:18px;transition:opacity .2s,visibility .2s}
/* phones: fewer, smaller floating buttons so they cover as little text as possible; Contact stays in each site's menu and footer */
@media (max-width:600px){.sx-contact{display:none!important}.sx-qa-fab{width:48px;padding:0}.sx-qa-fab .sx-fab-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}
.sx-endspace{height:0}
@media (max-width:720px){.sx-endspace{height:140px}}
.sx-qa-fab.sx-qa-compact{width:48px;padding:0}.sx-qa-fab.sx-qa-compact .sx-fab-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
@media (max-width:359px){.sx-qa-fab{width:48px;padding:0}.sx-qa-fab .sx-fab-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}
.sx-qa{position:fixed;inset:0;z-index:3000;background:rgba(8,20,22,.35);display:flex;align-items:flex-end;justify-content:flex-end;padding:16px}
.sx-qa[hidden]{display:none}
body.sx-qa-open{overflow:hidden}
.sx-qa-box{width:min(420px,100%);height:min(680px,calc(100vh - 32px));height:min(680px,calc(100dvh - 32px));max-height:100%;display:flex;flex-direction:column;background:var(--sx-surface);color:var(--sx-ink);
  border-radius:18px;box-shadow:0 24px 60px rgba(0,0,0,.3);overflow:hidden;font:400 .95rem/1.55 var(--body,var(--font-body,system-ui,sans-serif))}
.sx-qa-top{display:flex;align-items:center;gap:10px;padding:10px 8px 10px 14px;background:var(--sx-accent);color:var(--sx-accent-ink)}
.sx-qa-logo{display:flex;width:38px;height:38px;flex:none;align-items:center;justify-content:center;border-radius:50%;background:rgba(255,255,255,.18)}
.sx-qa-title{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.sx-qa-title strong{font-size:1.02rem}
.sx-qa-title span{font-size:.78rem;opacity:.92}
.sx-qa-restart{flex:none;min-height:36px;padding:0 10px;border-radius:999px;border:1px solid rgba(255,255,255,.5);background:transparent;color:inherit;font:600 .78rem/1.1 inherit;max-width:9em}
.sx-qa .sx-qa-x{color:inherit}
.sx-qa-emerg{margin:0;padding:8px 14px;background:#fdecea;color:#8a1c12;font-size:.84rem;font-weight:600;border-bottom:1px solid #f3c7c0}
.sx-qa-emerg a,.sx-qa-alert a{color:inherit;font-weight:800;text-decoration:underline}
html[data-theme="dark"] .sx-qa-emerg{background:#3a1d1a;color:#ffc9c0;border-color:#5a2b26}
.sx-qa-log{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:14px 12px 6px;display:flex;flex-direction:column;gap:10px}
.sx-qa-msg{max-width:92%;padding:10px 13px;border-radius:16px;word-wrap:break-word;overflow-wrap:anywhere}
.sx-qa-msg p{margin:0 0 .5em}.sx-qa-msg p:last-child{margin-bottom:0}
.sx-qa-msg ul,.sx-qa-msg ol{margin:.3em 0 .5em;padding-left:1.25em}
.sx-qa-msg a{color:var(--sx-accent);font-weight:600}
html[data-theme="dark"] .sx-qa-msg a{color:#9fd6c6}
html[data-theme="dark"][data-sx-family="stroke"] .sx-qa-msg a{color:#a9c6ec}
html[data-theme="dark"][data-sx-family="epilepsy"] .sx-qa-msg a{color:#c9b6ea}
.sx-qa-bot{align-self:flex-start;background:var(--sx-chip);border:1px solid var(--sx-line);border-bottom-left-radius:6px}
.sx-qa-me{align-self:flex-end;background:var(--sx-accent);color:var(--sx-accent-ink);border-bottom-right-radius:6px}
.sx-qa-alert{background:#fdecea;color:#8a1c12;border-color:#f3c7c0;font-weight:600}
html[data-theme="dark"] .sx-qa-alert{background:#3a1d1a;color:#ffc9c0;border-color:#5a2b26}
.sx-qa-choices{background:transparent;border:0;padding:0;max-width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.sx-qa-h{margin:2px 2px 2px;font-size:.78rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--sx-soft)}
.sx-qa-chip{display:block;text-align:left;min-height:44px;padding:9px 13px;border-radius:14px;border:1.5px solid var(--sx-accent);background:var(--sx-surface);color:var(--sx-ink);font:500 .92rem/1.4 inherit;cursor:pointer}
.sx-qa-chip:hover{background:rgba(127,160,150,.14)}
.sx-qa-site{display:block;font-size:.72rem;font-weight:700;color:var(--sx-accent);margin-bottom:1px}
html[data-theme="dark"] .sx-qa-site{color:#8fd3bf}
.sx-qa-search{margin-top:8px;border-style:dashed}
.sx-qa-mail{display:inline-flex;align-items:center;gap:8px;margin-top:8px;background:var(--sx-accent);color:var(--sx-accent-ink)!important;border-color:var(--sx-accent);font-weight:700;text-decoration:none}
.sx-qa-mail:hover{background:var(--sx-accent);filter:brightness(1.12)}
.sx-qa-mail svg{width:18px;height:18px;flex:none}
.sx-qa-none{margin:2px 2px 0;padding:6px 2px;min-height:36px;border:0;background:none;color:var(--sx-accent);font:600 .86rem/1.3 inherit;text-decoration:underline;cursor:pointer}
html[data-theme="dark"] .sx-qa-none{color:#9fd6c6}
.sx-qa-ans{max-width:100%}
.sx-qa-note{font-size:.8rem;color:var(--sx-soft);font-style:italic}
.sx-qa-more{display:inline-block;margin-top:8px;font-size:.88rem}
.sx-qa-form{display:flex;gap:8px;padding:10px;border-top:1px solid var(--sx-line)}
.sx-qa-in{flex:1;min-width:0;min-height:46px;padding:0 14px;border-radius:999px;border:1.5px solid var(--sx-line);background:var(--sx-surface);color:var(--sx-ink);font:500 1rem/1.3 inherit}
.sx-qa-in:focus{border-color:var(--sx-accent);outline:none;box-shadow:0 0 0 3px rgba(224,167,46,.35)}
.sx-qa-send{flex:none;min-height:46px;padding:0 18px;border-radius:999px;border:0;background:var(--sx-accent);color:var(--sx-accent-ink);font:700 .95rem/1 inherit}
@media (max-width:600px){
  .sx-qa{padding:0;background:var(--sx-surface)}
  .sx-qa-box{width:100%;height:100%;border-radius:0}
}

/* ---------- cookie notice ---------- */
.sx-cookie{position:fixed;z-index:1100;left:50%;bottom:16px;transform:translateX(-50%);width:min(560px,calc(100% - 24px));display:flex;gap:14px;align-items:center;
  padding:14px 16px;border-radius:16px;background:var(--sx-surface);color:var(--sx-ink);border:1px solid var(--sx-line);box-shadow:0 12px 34px rgba(0,0,0,.18);font:400 .9rem/1.5 var(--body,var(--font-body,system-ui,sans-serif))}
.sx-cookie p{margin:0;flex:1}
.sx-btn{flex:none;min-height:44px;padding:0 20px;border-radius:999px;border:0;background:var(--sx-accent);color:var(--sx-accent-ink);font:700 .95rem/1 inherit}
@media (max-width:520px){.sx-cookie{flex-direction:column;align-items:stretch;gap:10px;bottom:10px;padding:12px 14px;font-size:.84rem;line-height:1.45}.sx-cookie .sx-btn{width:100%;min-height:44px}}
html[data-sx-family="home"] .sx-cookie{bottom:calc(16px + var(--sx-bnav,0px))}

/* ---------- search ---------- */
.sx-modal{position:fixed;inset:0;z-index:3000;background:rgba(8,20,22,.55);display:flex;align-items:flex-start;justify-content:center;padding:6vh 12px 12px}
.sx-modal[hidden]{display:none}
body.sx-modal-open{overflow:hidden}
.sx-modal-box{width:min(720px,100%);max-height:84vh;display:flex;flex-direction:column;background:var(--sx-surface);color:var(--sx-ink);border-radius:18px;box-shadow:0 24px 60px rgba(0,0,0,.3);overflow:hidden}
.sx-modal-top{display:flex;align-items:center;gap:10px;padding:10px 10px 10px 16px;border-bottom:1px solid var(--sx-line)}
.sx-modal-icon{color:var(--sx-soft);display:flex}
.sx-input{flex:1;min-width:0;min-height:46px;border:0;background:transparent;color:var(--sx-ink);font:500 1.08rem/1.3 var(--body,var(--font-body,system-ui,sans-serif))}
.sx-input:focus{outline:none}
.sx-input::-webkit-search-cancel-button{display:none}
.sx-close{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;border:0;background:transparent;color:var(--sx-soft)}
.sx-results{overflow:auto;padding:6px 10px 14px}
.sx-res-h{margin:14px 8px 6px;font:700 .78rem/1.2 var(--body,var(--font-body,system-ui,sans-serif));letter-spacing:.06em;text-transform:uppercase;color:var(--sx-soft)}
.sx-hint{margin:12px 8px;color:var(--sx-soft);font-size:.92rem;display:flex;align-items:center;gap:10px}
.sx-hit{display:block;width:100%;text-align:left;padding:10px 12px;margin:2px 0;border-radius:12px;border:1px solid transparent;background:transparent;color:inherit;text-decoration:none;font:inherit}
.sx-hit:hover,.sx-hit:focus-visible{background:rgba(127,160,150,.14);border-color:var(--sx-line)}
.sx-hit-site{display:block;font-size:.76rem;font-weight:700;color:var(--sx-accent);margin-bottom:2px}
html[data-theme="dark"] .sx-hit-site{color:#8fd3bf}
html[data-theme="dark"][data-sx-family="stroke"] .sx-hit-site{color:#9fc0ea}
html[data-theme="dark"][data-sx-family="epilepsy"] .sx-hit-site{color:#c3b0e6}
.sx-hit-t{display:block;font-weight:700;font-size:1rem;line-height:1.35}
.sx-hit-x{display:block;color:var(--sx-soft);font-size:.88rem;line-height:1.45;margin-top:3px}
.sx-modal mark{background:var(--sx-mark);color:inherit;border-radius:3px;padding:0 1px}
.sx-spin{width:16px;height:16px;border-radius:50%;border:2.5px solid var(--sx-line);border-top-color:var(--sx-accent);animation:sx-rot .8s linear infinite;flex:none}
@keyframes sx-rot{to{transform:rotate(360deg)}}
.sx-flash{animation:sx-flash 2.2s ease-out}
@keyframes sx-flash{0%,40%{background:var(--sx-mark)}100%{background:transparent}}

/* ---------- last updated ---------- */
.sx-updated{margin:28px 0 6px;padding-top:12px;border-top:1px solid var(--sx-line);color:var(--sx-soft);font-size:.85rem}
.sx-updated-foot{border-top-color:rgba(255,255,255,.18);color:inherit;opacity:.85;margin-top:18px}

/* ---------- Launch events page: sticky header ---------- */
html[data-sx-family="events"] .site-header{position:sticky;top:0;z-index:100}

/* ---------- print ---------- */
@media print{
  .sx-ui:not(.sx-updated),.sx-tools,.sx-progress,.sx-fab,.sx-cookie,.sx-modal,.sx-qa{display:none!important}
  html[data-theme="dark"]{color-scheme:light}
  main a[data-sx-href]:not([data-sx-noprint])::after{content:" (" attr(data-sx-href) ")";font-size:.85em;word-break:break-all}
  html[data-sx-family="home"] .site-header,html[data-sx-family="events"] .site-header{position:static!important;box-shadow:none!important}
  html[data-sx-family="home"] .header-actions,html[data-sx-family="home"] .main-nav,html[data-sx-family="home"] .bnav,html[data-sx-family="home"] .a11y-fab,
  html[data-sx-family="home"] .a11y-panel,html[data-sx-family="home"] .modal-backdrop,html[data-sx-family="home"] .toast,html[data-sx-family="home"] .skip-link,
  html[data-sx-family="events"] .back-link,html[data-sx-family="events"] .skip-link{display:none!important}
  html[data-sx-family="home"] body,html[data-sx-family="events"] body{background:#fff!important;color:#000!important}
  html[data-sx-family="home"] section,html[data-sx-family="events"] article{break-inside:avoid-page}
  html[data-sx-family="home"] *,html[data-sx-family="events"] *{box-shadow:none!important;animation:none!important}
}

/* ---------- avoid a flash of light content while dark mode is being prepared ---------- */
html[data-theme="dark"]:not(.sx-dark-ready) body{opacity:0}
html.sx-dark-ready body{transition:opacity .15s ease-out}

/* ---------- home page header: keep menu words whole; switch to the menu button before the links run out of room ---------- */
html[data-sx-family="home"] .main-nav li,html[data-sx-family="home"] .main-nav .nav-link{white-space:nowrap;overflow-wrap:normal}
html[data-sx-family="home"] .main-nav .nav-link{padding:.5rem .62rem}
@media (max-width:1240px){html[data-sx-family="home"] .main-nav{display:none}html[data-sx-family="home"] .menu-btn{display:inline-flex}}

/* ---------- contrast fixes (WCAG AA, 4.5:1 for normal text) in light and dark mode ---------- */
html[data-sx-family="green"]{--coral:#b04a42}
html[data-sx-family="stroke"],html[data-sx-family="epilepsy"]{--coral:#ad4f33;--coral-d:#8f3f27}
html[data-sx-family="home"] .path-note strong,html[data-sx-family="home"] .disc-detail .ask{color:#f5cf6e}
html[data-sx-family="home"],html[data-sx-family="events"]{--ink-faint:#56696f}

/* ---------- home page header on phones: make room for the dark mode button without covering the name ---------- */
@media (max-width:640px){
  html[data-sx-family="home"] .header-actions .search-label{display:none}
  html[data-sx-family="home"] .header-actions{gap:4px;flex:none}
  html[data-sx-family="home"] .header-actions .icon-btn{padding-left:9px;padding-right:9px}
  html[data-sx-family="home"] .sx-tools.sx-inline{margin-right:0}
  html[data-sx-family="home"] .header-inner{gap:.6rem}
  html[data-sx-family="home"] .brand,html[data-sx-family="home"] .brand-text{min-width:0}
  html[data-sx-family="home"] .brand-name{white-space:nowrap}
}
@media (max-width:480px){
  /* the bottom bar already has a Search button on phones, so the header keeps only dark mode, language and menu */
  html[data-sx-family="home"] .header-actions > .icon-btn[data-open-search]{display:none}
}
@media (max-width:420px){
  html[data-sx-family="home"] .brand{gap:.45rem}
  html[data-sx-family="home"] .brand-mark{height:34px}
  html[data-sx-family="home"] .brand-sub{font-size:.56rem;letter-spacing:.08em}
}
/* phones: the two-column list of rehabilitation services ran off the screen in Malayalam and at 320px */
html[data-sx-family="home"] .disc-card{min-width:0}
html[data-sx-family="home"] .disc-card span{min-width:0;overflow-wrap:anywhere}
@media (max-width:640px){html[data-sx-family="home"] .disc-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:350px){html[data-sx-family="home"] .disc-grid{grid-template-columns:minmax(0,1fr)}}
/* the IFNR Saathi logo has dark lines; in dark mode it sits on a small light tile so it stays visible */
html[data-theme="dark"] img[data-sx-logo="tile"]{background:#f6f1e6;border-radius:10px;padding:3px 4px}
@media (max-width:350px){
  html[data-sx-family="home"] #langBtn svg{display:none}
  html[data-sx-family="home"] .brand-mark{height:28px}
  html[data-sx-family="home"] .brand-sub{font-size:.5rem;letter-spacing:.04em}
  html[data-sx-family="home"] .header-inner{gap:.4rem}
}
/* long Malayalam words in the About section pushed the page sideways on 320px phones */
html[data-sx-family="home"] .about-grid > *{min-width:0}
@media (max-width:360px){html[data-sx-family="home"] .about-grid :is(h2,p,li){overflow-wrap:anywhere}}
/* timeline steps slide in from the right; stop that slide from making the page scroll sideways on narrow phones */
html[data-sx-family="home"] .timeline{overflow-x:clip}
/* phone numbers, web and email addresses that are now tappable */
a.sx-autolink{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;overflow-wrap:anywhere}
a.sx-al-tel{white-space:nowrap;font-weight:600}

/* Link back to the IFNR Saathi home page (sites without their own strip) */
.sx-umbrella{display:flex;align-items:center;gap:.5rem;padding:.45rem 1rem;background:#006360;color:#eaf3f1;text-decoration:none;font-size:.85rem;line-height:1.35;position:relative;z-index:999}
.sx-umbrella:hover{background:#033c3a;color:#fff}
.sx-umbrella:focus-visible{outline:3px solid #ecc24a;outline-offset:-3px}
/* Existing strips: let the text wrap on phones instead of being cut off */
@media (max-width:600px){.umbrella-strip span{white-space:normal!important;overflow:visible!important}}
@media print{.sx-umbrella{display:none!important}}
.alert[id],[id].card{scroll-margin-top:96px}

/* Big emergency call buttons (first aid and BE FAST pages) */
.sx-callrow{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0 4px}
.sx-call{display:inline-flex;align-items:center;justify-content:center;min-height:48px;min-width:120px;padding:10px 18px;border-radius:12px;background:#b3261e;color:#fff!important;font-weight:700;font-size:1.15rem;text-decoration:none!important}
.sx-call:hover,.sx-call:focus-visible{background:#8c1d18}
/* Larger tap area for inline phone links, without moving the text */
a[href^="tel:"]:not(.sx-call):not(.btn){padding:.4em .25em;margin:-.4em -.25em}
/* Long words (for example Malayalam headings) wrap instead of pushing the page sideways */
h1,h2,h3,.alert h3{overflow-wrap:anywhere}
/* Programmatic focus on headings after a page change should not show a box */
[tabindex="-1"]:focus:not(:focus-visible){outline:none}
@media (max-width:520px){
  .a11y-bar span.lbl{display:none}
  .a11y-bar .wrap{padding:4px 12px;gap:6px}
}
h1:focus:not(:focus-visible),h2:focus:not(:focus-visible){outline:none}
/* Phone-only shortcut to seizure first aid at the top of the Epilepsy home page */
.sx-quick-fa{display:none}
@media (max-width:640px){
  .sx-quick-fa{display:block;width:100%;margin:0 0 14px;padding:12px 14px;border:0;border-radius:12px;background:#b3261e;color:#fff;font:inherit;font-weight:700;text-align:left;cursor:pointer}
  .sx-quick-fa u{text-underline-offset:3px}
}
