/* Vidyāsthāna Kośa · Design 1 "Pothī rows" (Kosha UI, owner's choice 2026-11-09), on the corpus Pothī tokens:
   warm paper, maroon and saffron, never black; verses in Sanskrit 2003, other Devanāgarī in Tiro. */
@font-face { font-family: "Sanskrit 2003"; src: url("/fonts/sanskrit2003.woff2") format("woff2"); font-display: swap; }
:root {
	--bg: #f6ecd9; --surface: #fff8ec; --ink: #8a4b12; --heading: #6e1b12; --muted: #8a5a2e; --line: #e0c9a0;
	--accent: #b5470f; --accent-strong: #8f3209; --accent-soft: #f3e2c4; --gold: #b8862b; --verse-ink: #7a1626;
	--warn: #9c3d0a; --warn-soft: #f6d9a8; --zebra: #fbf3e3;
	--cover: #7a1e14; --cover-ink: #f6e7cc; --cover-gold: #d9a441;
	--verse: "Sanskrit 2003", "Tiro Devanagari Sanskrit", serif;
	--deva: "Tiro Devanagari Sanskrit", "Sanskrit 2003", serif;
	--latn: "Source Serif 4", Georgia, serif;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #2a1610; --surface: #351d15; --ink: #f3e3cc; --heading: #f6c48a; --muted: #c9a888; --line: #4d2e22;
		--accent: #f0a05a; --accent-strong: #f6c48a; --accent-soft: #4a2a1b; --gold: #e0b062; --verse-ink: #f4b9a8;
		--warn: #f0a05a; --warn-soft: #4a2a1b; --zebra: #3a2117; --cover: #4a1a12; --cover-ink: #f3e3cc; --cover-gold: #e0b062;
		color-scheme: dark;
	}
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--latn); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; }
.dv { font-family: var(--deva); }
.latn { font-family: var(--latn); color: var(--muted); font-size: 0.85em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.cap { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* header: light leaf with the maroon bead row on top (Design 1) */
header.site { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.site::before { content: ""; display: block; height: 6px; background: var(--cover) radial-gradient(circle, var(--cover-gold) 1.2px, transparent 1.5px) 0 50% / 12px 6px repeat-x; }
header.site .bar { display: flex; align-items: center; gap: 1rem; max-width: 84rem; margin: 0 auto; padding: 0.6rem 16px; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--heading); line-height: 1.15; flex: none; }
.brand .mark { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--accent-soft); border: 2px solid var(--gold); font-family: var(--deva); font-size: 1.2rem; color: var(--verse-ink); }
.brand .names { display: flex; flex-direction: column; }
.brand .t { font-size: 1.3rem; }
.brand .latn { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; gap: 1.1rem; margin-left: auto; }
.nav a { color: var(--heading); text-decoration: none; font-size: 1.05rem; }
.nav a:hover { color: var(--accent); }
.script { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.script button { font: inherit; font-size: 0.8rem; border: 0; background: transparent; color: var(--heading); padding: 0.25rem 0.7rem; cursor: pointer; }
html[data-script="deva"] .script [data-s="deva"], html[data-script="iast"] .script [data-s="iast"] { background: var(--accent); color: var(--surface); }

/* search */
form[role="search"] { position: relative; display: flex; align-items: center; gap: 0.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0.15rem 0.4rem 0.15rem 0.7rem; }
form[role="search"] svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
form[role="search"] input { flex: 1; min-width: 0; font: inherit; border: 0; background: transparent; color: var(--ink); padding: 0.45rem 0.2rem; outline: none; }
form[role="search"] select { font: inherit; font-size: 0.8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--accent-soft); color: var(--heading); padding: 0.2rem 0.3rem; }
form[role="search"]:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.hsearch { flex: 1; max-width: 34rem; margin-left: 1rem; }
.bigsearch.big { max-width: 46rem; margin: 1.6rem auto 0.8rem; border: 2px solid var(--accent); border-radius: 16px; padding: 0.4rem 0.6rem 0.4rem 1rem; box-shadow: 0 8px 28px rgba(122, 30, 20, 0.08); }
.bigsearch.big input { font-size: 1.15rem; }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 0.3rem; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(74, 36, 22, 0.16); z-index: 20; }
.sugg li a { display: flex; gap: 0.6rem; align-items: baseline; padding: 0.35rem 0.6rem; border-radius: 6px; text-decoration: none; color: var(--heading); }
.sugg li a .dv { font-size: 1.1rem; }
.sugg li a[aria-selected="true"], .sugg li a:hover { background: var(--accent-soft); }
.sugg .n { margin-left: auto; font-size: 0.75rem; color: var(--muted); }

/* chips */
.chip { display: inline-flex; align-items: baseline; gap: 0.3rem; padding: 0.2rem 0.6rem; margin: 0 0.35rem 0.4rem 0; border-radius: 7px; background: var(--accent-soft); color: var(--heading); text-decoration: none; font-size: 1.02rem; border: 1px solid transparent; }
.chip:hover { border-color: var(--gold); color: var(--heading); }
.chip.on { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.chip.doubt { border: 1px dashed var(--warn); background: transparent; }
.chip .g { font-size: 0.7rem; color: var(--muted); font-family: var(--deva); }
.nana { display: inline-flex; flex-wrap: wrap; align-items: baseline; padding: 0.15rem 0.3rem 0 0.3rem; margin: 0 0.4rem 0.4rem 0; border-left: 2px solid var(--gold); }
.nana .eq { margin: 0 0.4rem 0 0; color: var(--muted); }

/* verses */
.lines { color: var(--verse-ink); font-family: var(--verse); font-size: 1.18rem; line-height: 1.75; }
.lines .line { display: block; overflow-wrap: anywhere; }
.lines u { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.vl-grid { display: grid; grid-template-columns: max-content max-content max-content; column-gap: 2.2em; justify-content: start; }
.vl-grid .line { display: contents; }
.vl-grid .end { color: var(--muted); }
.vl-vrtta .line.even { padding-left: 2em; }

/* home */
main { max-width: 84rem; margin: 0 auto; padding: 1rem 16px 4rem; }
main.narrow { max-width: 50rem; }
.hero { text-align: center; padding: 3.5rem 0 1rem; }
.kicker { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--accent); margin: 0; }
.hero h1 { font-family: var(--deva); font-weight: 400; font-size: clamp(2.2rem, 6vw, 4rem); color: var(--verse-ink); margin: 0.6rem 0 0.4rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46rem; margin: 0 auto; }
.tries { color: var(--muted); }
.tries .chip { margin: 0 0.2rem 0.4rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 2.5rem 0; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.3rem; }
.stats b { display: block; font-size: 2rem; color: var(--accent); }
.stats span { color: var(--muted); }
.kinds h2 { font-size: 1.5rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.3rem; }
a.card { display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; color: var(--ink); }
a.card:hover { border-color: var(--gold); }
a.card .sa { font-size: 1.6rem; color: var(--accent); }
a.card b { color: var(--heading); font-size: 1.1rem; }
a.card .more { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-top: auto; }

/* kośa table */
.kinds h3, main.wide h3 { margin-top: 2rem; }
.tablewrap { overflow-x: auto; }
.ktable { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ktable th { text-align: left; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
.ktable td { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.ktable tr:nth-child(even) td { background: var(--zebra); }
.ktable td a { font-size: 1.1rem; text-decoration: none; margin-right: 0.5rem; }
.ktable .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kdot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-right: 0.5rem; vertical-align: 0.1em; }

/* reader */
main.reader { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 2rem; }
.toc details { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 0.9rem; }
.toc summary { cursor: pointer; color: var(--heading); font-size: 1.05rem; }
.toc ol { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.toc li { padding: 0.15rem 0; font-size: 0.95rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.toc li a { text-decoration: none; }
.toc li[aria-current] a { color: var(--heading); font-weight: 600; }
.crumbs { margin: 0; font-size: 0.85rem; color: var(--muted); }
.reader h1 { font-weight: 400; margin: 0.2rem 0; }
.reader h1 .dv { font-size: 2rem; }
.byline, .kstats { margin: 0.2rem 0; color: var(--muted); }
h2.sec { font-weight: 400; font-size: 1.4rem; border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; margin-top: 1.6rem; }
.verse { position: relative; padding: 0.9rem 0 0.7rem; border-bottom: 1px dashed var(--line); scroll-margin-top: 6rem; }
.verse:target { background: var(--accent-soft); }
.verse .vref { position: absolute; right: 0; top: 0.9rem; font-size: 0.8rem; color: var(--muted); text-decoration: none; }
.verse .chips { margin-top: 0.4rem; }
p.head { color: var(--heading); margin: 1rem 0 0.2rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 2rem 0; }

/* word page */
.kbody { min-width: 0; }
main.word { display: grid; grid-template-columns: 13rem minmax(0, 1fr) 20rem; gap: 1.6rem; align-items: start; }
.filter { position: sticky; top: 5.5rem; font-size: 0.95rem; }
.filter h4 { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0.6rem 0 0.4rem; }
.filter ul { list-style: none; margin: 0; padding: 0; }
.filter li { padding: 0.15rem 0; }
.filter li a { display: flex; gap: 0.45rem; align-items: baseline; }
.filter li .kdot { flex: none; }
.filter a { color: var(--heading); text-decoration: none; }
.card.main { padding: 0; overflow: hidden; }
.whead { padding: 1.3rem 1.6rem 1rem; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; }
.whead h1 { font-size: 3.2rem; font-weight: 400; margin: 0; color: var(--verse-ink); }
.whead .latn.big { font-size: 1.4rem; font-style: italic; }
.gpill { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0.15rem 0.7rem; font-weight: 600; font-size: 0.9rem; }
.whead p { flex-basis: 100%; margin: 0.2rem 0 0; }
.krow { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 5rem; gap: 1.2rem; padding: 1.1rem 1.6rem; border-bottom: 1px solid var(--line); scroll-margin-top: 6rem; }
.krow:target { background: var(--zebra); }
.kmeta { display: flex; flex-direction: column; gap: 0.1rem; }
.kmeta .kn { font-size: 1.15rem; color: var(--heading); text-decoration: none; font-weight: 600; }
.kmeta .ref { font-size: 0.85rem; font-weight: 600; text-decoration: none; margin-top: 0.3rem; }
.kbody .lines { margin-bottom: 0.5rem; }
.kg { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.kg b { font-size: 1.6rem; color: var(--accent); font-weight: 400; line-height: 1.2; }
.flag { margin-top: 0.4rem; font-size: 0.7rem; border: 1px dashed var(--warn); color: var(--warn); border-radius: 6px; padding: 0 0.4rem; }
.asmeaning { padding: 1.1rem 1.6rem; }
.asmeaning h3 { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.asmeaning ul { list-style: none; margin: 0; padding: 0; }
.asmeaning li { display: grid; grid-template-columns: 1rem 9rem 7rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: baseline; padding: 0.4rem 0; border-bottom: 1px dashed var(--line); }
.asmeaning .headw { font-size: 1.3rem; text-decoration: none; }
.asmeaning .vtext { color: var(--verse-ink); }
.asmeaning .ref { font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
.rail { display: grid; gap: 1rem; position: sticky; top: 5.5rem; }
.rail h4 { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 6.5rem 1fr 2.4rem; gap: 0.5rem; align-items: center; padding: 0.12rem 0; }
.bars a { text-decoration: none; color: var(--heading); font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bar { height: 6px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.bars li:first-child .bar i { background: var(--accent); }
.bars .n { font-size: 0.75rem; color: var(--muted); text-align: right; }
.card.warn { background: var(--warn-soft); border-color: var(--warn); }
.card.warn ul { margin: 0; padding-left: 1.1rem; }
.dicts ul { list-style: none; margin: 0; padding: 0; }
.dicts li { display: grid; grid-template-columns: 1fr auto; padding: 0.3rem 0; }
.dicts li span { grid-column: 1; font-size: 0.8rem; color: var(--muted); }
.dicts li em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: 0.7rem; background: var(--accent-soft); border-radius: 999px; padding: 0.1rem 0.5rem; color: var(--muted); }

/* results */
.results { list-style: none; padding: 0; }
.results li { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.results li a { font-size: 1.3rem; text-decoration: none; }
.results li .muted { margin-left: auto; font-size: 0.85rem; }
.prose p, .prose li { max-width: 42rem; }

/* footer: the back cover */
footer.site { background: var(--cover); color: var(--cover-ink); margin-top: 3rem; }
footer.site .bar { max-width: 84rem; margin: 0 auto; padding: 2rem 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
footer.site p { margin: 0.3rem 0; }
footer.site .big { font-size: 1.6rem; }
footer.site a { color: var(--cover-ink); }
footer.site .src, footer.site .src a { color: var(--cover-gold); font-size: 0.85rem; }
footer.site .cols { display: flex; gap: 3rem; }
footer.site .cols div { display: flex; flex-direction: column; gap: 0.3rem; }
footer.site h4 { color: var(--cover-gold); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 0.3rem; }

/* tablets and phones */
@media (max-width: 1100px) {
	main.word { grid-template-columns: minmax(0, 1fr) 18rem; }
	.filter { display: none; }
}
@media (max-width: 860px) {
	header.site .bar { flex-wrap: wrap; gap: 0.5rem 0.8rem; }
	.hsearch { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
	.nav { gap: 0.8rem; }
	.nav a { font-size: 0.95rem; }
	main.reader, main.word { grid-template-columns: minmax(0, 1fr); }
	.toc details { position: static; max-height: none; }
	.toc details:not([open]) ol { display: none; }
	.rail { position: static; }
	.krow { grid-template-columns: minmax(0, 1fr) auto; padding: 1rem; }
	.krow .kbody { grid-column: 1 / -1; grid-row: 2; }
	.whead { padding: 1rem; }
	.asmeaning li { grid-template-columns: 1rem auto 1fr; }
	.asmeaning .vtext { grid-column: 1 / -1; }
	.verse .vref { position: static; display: block; text-align: right; }
}
@media (max-width: 560px) {
	body { font-size: 16px; }
	.brand .latn { display: none; }
	.nav { order: 4; margin-left: 0; flex-basis: 100%; justify-content: space-between; }
	.script { margin-left: auto; }
	.lines { font-size: 1.08rem; }
	.vl-grid { column-gap: 1em; }
	.ktable th:nth-child(2), .ktable td:nth-child(2) { display: none; }
	form[role="search"] select { display: none; }
	.hero { padding-top: 2rem; }
	footer.site .cols { gap: 1.5rem; }
}

/* metre and typo checks under a verse */
.checks { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; margin: 0.15rem 0 0.35rem; font-size: 0.78rem; }
.checks .metre { color: var(--muted); font-size: 0.85rem; }
.checks .mflag, .checks .tflag { border: 1px dashed var(--warn); color: var(--warn); border-radius: 6px; padding: 0 0.45rem; }
.checks .tflag .dv { font-size: 0.95rem; }

/* home shelves */
.shelf { margin: 2.4rem 0 0; }
.shead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.shead h2 { margin: 0 0 0.4rem; font-size: 1.5rem; color: var(--heading); font-weight: 400; }
.shead h2 .en { font-size: 1rem; color: var(--muted); margin-left: 0.4rem; }
.shead a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.8rem; }
.tile { min-width: 0; overflow-wrap: anywhere; }
.tile { position: relative; display: flex; flex-direction: column; gap: 0.1rem; padding: 0.9rem 1rem 0.8rem 1.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--gold); box-shadow: 0 6px 18px rgba(74, 36, 22, 0.08); }
.tile .kdot { position: absolute; left: 0.75rem; top: 1.25rem; }
.tile b { font-size: 1.2rem; color: var(--verse-ink); font-weight: 400; }
.tile .latn { font-size: 0.9rem; color: var(--muted); }
.tile .au { font-size: 0.9rem; color: var(--muted); }
.tile .nums { font-size: 0.8rem; color: var(--accent); margin-top: 0.35rem; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 0.72rem; padding: 0 0.45rem; border-radius: 999px; background: var(--accent-soft); color: var(--muted); white-space: nowrap; }
/* kośa list filter */
.kfilter { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: center; margin: 1.2rem 0 0.4rem; }
.kfilter input[type="search"] { flex: 1 1 18rem; max-width: 28rem; padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.kfilter label { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 560px) {
	.tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; }
	.stats { grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 1.6rem 0; }
	.stats div { padding: 0.8rem 0.9rem; }
	.stats b { font-size: 1.5rem; }
	.hero { padding-bottom: 0; }
	.tile { padding: 0.7rem 0.7rem 0.6rem 1.3rem; }
	.tile .kdot { left: 0.55rem; top: 1.1rem; }
	.tile b { font-size: 1.05rem; }
	.tile .au { display: none; }
	.brand .mark { width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
	.brand .t { font-size: 1.15rem; }
	.nav { overflow-x: auto; justify-content: flex-start; gap: 1.1rem; }
	.krow .kg { flex-direction: row; gap: 0.4rem; align-items: baseline; }
	.krow .kg b { font-size: 1.2rem; }
}

/* verse ends inside a unit that holds several verses */
.vl-grid .vgap { grid-column: 1 / -1; height: 0.55em; }
.lines .line.vend { margin-bottom: 0.55em; }
.vl-grid .line.vend { margin-bottom: 0; }
