/* Dual-language heading companions. English headings are never hidden or altered. */
.h-sub{ display:none; margin:.3em 0 .5em; font-weight:600; line-height:1.5; font-style:normal; letter-spacing:0; text-transform:none; color:var(--brass,#9A7633); overflow-wrap:anywhere; }
.h-sub[lang="ta"]{ font-family:"Noto Serif Tamil","Latha","Nirmala UI","Noto Sans Tamil",serif; }
.h-sub[lang="hi"]{ font-family:"Noto Serif Devanagari","Nirmala UI","Mangal","Noto Sans Devanagari",serif; }
html[data-lang="ta"] .h-sub[lang="ta"], html[data-lang="hi"] .h-sub[lang="hi"]{ display:block; }

/* portal page */
section .h-sub{ font-size:clamp(1rem,2.3vw,1.3rem); max-width:44ch; margin-bottom:16px; }
.hero .h-sub{ color:#E3C48A; font-size:clamp(1rem,2.4vw,1.3rem); max-width:50ch; margin-top:0; margin-bottom:14px; }
.close .h-sub{ color:#E3C48A; }
/* A4 page view: size follows the sheet */
.sheet .h-sub{ font-size:clamp(.78rem,2.05cqi,1.12rem); margin:.25em 0 .7em; max-width:36em; }
.sheet.darksheet .h-sub{ color:#E3C48A; }
.sheet .h1 + .h-sub, .sheet .cover-title + .h-sub{ margin-top:.5em; }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) section:not(.hero):not(.close):not(.sheet) .h-sub{ color:#E3C48A; } }

/* Moon stage Tamil companion label (Tamil mode only) */
.tm-label{ display:none; font-family:"Noto Serif Tamil","Latha","Nirmala UI",serif; font-weight:600; font-size:.82em; line-height:1.35; color:var(--brass,#9A7633); margin-top:.15em; }
html[data-lang="ta"] .tm-label{ display:block; }
.moon__n + .tm-label{ font-size:clamp(.6rem,1.2cqi,.76rem); text-align:center; }

/* selector */
.lang-sel{ display:inline-flex; align-items:center; gap:.6em; flex:none; font-size:.78rem; color:var(--dim,#33425C); }
.lang-sel__t{ font:500 .64rem/1 "DM Mono",ui-monospace,monospace; letter-spacing:.1em; text-transform:uppercase; color:var(--faint,#66738C); white-space:nowrap; }
.lang-sel select{ font:600 .8rem Inter,"Segoe UI",system-ui,sans-serif; color:#16234B; padding:.5em 1.9em .5em .9em; border-radius:999px; border:1px solid rgba(22,35,75,.22);
  background:linear-gradient(180deg,rgba(255,255,255,.95),rgba(255,255,255,.7)); box-shadow:inset 0 1px 0 #fff,0 6px 14px -8px rgba(22,35,75,.45); cursor:pointer; }
.lang-sel select:focus-visible{ outline:2px solid #9A7633; outline-offset:2px; }
.lang-sel--nav{ margin-left:auto; position:sticky; right:0; padding-left:18px; background:linear-gradient(90deg,transparent,var(--ivory,#FAF7F0) 28%); }
.lang-sel--nav .lang-sel__t{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; } /* name kept for assistive tech */
.lang-sel--float{ position:fixed; top:12px; right:14px; z-index:40; padding:6px 8px 6px 12px; border-radius:999px; background:rgba(255,253,248,.82); backdrop-filter:blur(12px) saturate(170%); -webkit-backdrop-filter:blur(12px) saturate(170%); box-shadow:0 10px 26px -14px rgba(22,35,75,.6),inset 0 0 0 1px rgba(22,35,75,.12); }
@media (max-width:640px){ .lang-sel__t{ display:none; } .lang-sel--float{ top:8px; right:8px; } }
@media print{ .h-sub, .tm-label, .lang-sel{ display:none !important; } }

/* Proposal page view on narrow screens: let each A4 sheet grow so headings and companions are never clipped */
@media screen and (max-width:900px){
  .doc .sheet{ aspect-ratio:auto; height:auto; min-height:calc((100vw - 32px) * 1.4143); }
  .doc .sheet__inner{ height:auto; min-height:calc((100vw - 32px) * 1.4143); }
}
