/* A4 dictionaries — only what the Gita Folio system has no component for (tokens only, no new colours):
   the headword list of a letter (a multi-column word list with 44px targets), the scheme pickers of /dictionary,
   the Dhātupāṭha's paradigms and the inline conjugation tables of /dhatu, and the morphology list of /sanskritdictionary. */

/* Headword list: columns like a printed index; every word is a 44px target */
.hw-head{margin-top:var(--s-6);border-bottom-color:var(--border-strong)}
.hw-head h3{font-size:var(--fs-h4)}
/* Parts of a long letter: the current part (guide words) as the summary of the list of every part; a labelled
   previous / next pager (.pager) under the headwords — each side its own column, baseline-aligned */
.hw-parts{margin-top:var(--s-5)}
.hw-parts .pager{align-items:baseline}
.hw-parts .pager .t[lang=sa]{font:1.125rem/1.6 var(--ff-sanskrit);color:var(--sanskrit)}
.hw-parts .pager a:hover .t{color:var(--accent)}
.hw-all,.paradigms{margin-top:var(--s-2);border-bottom:1px solid var(--border)}
.hw-all>summary,.paradigms>summary{list-style:none;display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--s-2);min-height:var(--tap);padding-block:var(--s-1);font:500 var(--fs-ui-sm)/1.3 var(--ff-ui);color:var(--text-muted);cursor:pointer}
.hw-all>summary::-webkit-details-marker,.paradigms>summary::-webkit-details-marker{display:none}
.hw-all>summary:hover,.paradigms>summary:hover{color:var(--accent)}
.hw-all .chev,.paradigms .chev{width:16px;height:16px;transition:transform var(--t)}
.hw-all[open]>summary .chev,.paradigms[open]>summary .chev{transform:rotate(180deg)}
.entry .paradigms:not([open])>summary .chev{transform:none;color:var(--text-subtle)} /* not turned by the open entry around it */
.entry .paradigms>summary .chev{align-self:center}
.hw-all__now{flex:1 1 auto;min-width:0}
.hw-all__sep{color:var(--text-subtle)}
.hw-all__range{font:1.0625rem/1.5 var(--ff-sanskrit);color:var(--sanskrit)}
.hw-all__more{display:inline-flex;align-items:center;gap:var(--s-2);margin-left:auto;white-space:nowrap}
@media(max-width:29.99rem){.hw-all__more .meta{display:none}}
.hw-list--ranges{columns:12rem;margin-block:var(--s-2) var(--s-4)}
.hw-list--ranges a{font-size:1.0625rem}
.hw-hint{margin-top:var(--s-3)}
.hw-list{columns:9.5rem;column-gap:var(--s-5);margin-top:var(--s-4)}
.hw-list li{break-inside:avoid}
.hw-list a{display:flex;align-items:center;min-height:var(--tap);font:1.25rem/1.5 var(--ff-sanskrit);color:var(--sanskrit);transition:color var(--t)}
.hw-list a:hover{color:var(--accent)}
.hw-list a[aria-current]{color:var(--accent);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.3em}
@media(max-width:29.99rem){.hw-list{columns:2}}
/* Dhātupāṭha roots run in reading order left to right ("→ Reading order."), row by row */
.hw-list--rows{columns:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,9.5rem),1fr));column-gap:var(--s-5)}
@media(max-width:29.99rem){.hw-list--rows{grid-template-columns:1fr 1fr}}

/* Entries: Devanagari keeps its face everywhere (gloss, lead lines, senses, sub-entries); lead lines are unnumbered */
.entry__short [lang=sa],.entry__body [lang=sa]{font-family:var(--ff-sanskrit)}
.entry__body [lang=sa]{font-size:1.0625em;line-height:1.7}
.entry .entry__body b.xp{font-weight:600;color:var(--text-muted)}
.entry__line{margin-bottom:var(--s-2)}
.entry__line--etym{font-size:var(--fs-small);color:var(--text-muted)}
.entry__line--sutra [lang=sa]{font-size:1.25rem}
.entry__line--sutra b{font-weight:600}
.entry__line--dhatu-class{display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--s-2);font:400 var(--fs-ui-sm)/1.4 var(--ff-ui);color:var(--text-muted)}
.entry__line--dhatu-class .label{color:var(--text-subtle)}
.anub{margin-left:.08em;font-size:.68em;color:var(--text-muted)}
.anub--pre{margin-left:0;margin-right:.08em}
.entry__line--sutra .anub:not(.anub--pre){margin-right:.12em}
.entry__line--dhatu-class .meta [lang=sa]{font-size:1rem;line-height:1.4}
.entry__notes{margin-top:var(--s-3);display:grid;gap:var(--s-2);font-size:var(--fs-ui-sm);color:var(--text-muted)}
.entry__notes p{font-family:var(--ff-ui);line-height:1.55}
.sub__sense{margin-top:var(--s-1)}
.senses--plain p+p{margin-top:var(--s-2);padding-top:var(--s-2);border-top:1px solid var(--border)}
.subentries{margin-top:var(--s-4)}
.subentries__h{margin-bottom:var(--s-1);color:var(--text-subtle)}
.subentries__list>li{padding-block:var(--s-2);border-top:1px solid var(--border)}
.sub__label{font-weight:600}
.sub__label [lang=sa]{color:var(--sanskrit)}
.senses--sub{margin-top:var(--s-1)}
.senses--sub li::before{font-size:1rem}

/* "In the Gita": verse refs in the UI face with lining figures, the first occurrence quoted in its line */
.occurs__refs{display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--s-1)}
.occurs__refs .vref{display:inline-flex;align-items:center;justify-content:center;min-height:var(--tap);min-width:var(--tap);font:500 var(--fs-ui-sm)/1 var(--ff-ui);font-variant-numeric:lining-nums tabular-nums;color:var(--accent)}
.occurs__sep{color:var(--text-subtle)}
.occurs__quote{margin:var(--s-2) 0 var(--s-3)}
.occurs__quote [lang=sa]{font:1.25rem/1.7 var(--ff-sanskrit)}
.occurs__quote mark{padding-inline:.1em}
.occurs__quote .vref{display:inline-flex;align-items:center;justify-content:center;min-height:var(--tap);min-width:var(--tap);vertical-align:middle;font:500 var(--fs-ui-sm)/1 var(--ff-ui);font-variant-numeric:lining-nums tabular-nums;font-style:normal;white-space:nowrap}
.occurs__forms li{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:var(--s-2);padding-top:var(--s-1)}
.occurs__forms [lang=sa]{font:1.125rem/1.6 var(--ff-sanskrit)}
.occurs__forms .iast{font-style:italic;color:var(--text-muted)}
.occurs__gram{font:400 var(--fs-ui-sm)/1.45 var(--ff-ui);color:var(--text-muted)}
.search-well__hint a{display:inline-flex;align-items:center;min-height:var(--tap)}
.search-well__hint .nowrap{white-space:nowrap}
/* An empty field must not read as filled: no clear button until there is text, and a lighter placeholder */
.search-well .searchbox:has(input:placeholder-shown) [data-clear]{visibility:hidden}
.search-well .searchbox input::placeholder{color:var(--text-subtle);opacity:.55}

/* Landing on results (#results) and the field under the keyboard: a little air above */
#results,#analysis,#browse{scroll-margin-top:var(--s-4)}
.search-well .searchbox{scroll-margin-top:var(--s-3)}
/* While the on-screen keyboard is open the field stays in view above it */
.search-well:has([data-kbd-toggle][aria-pressed=true]) .searchbox{position:sticky;top:0;z-index:var(--z-sticky);background:var(--bg)}
.search-well .kbd{margin-bottom:var(--s-2)}
/* The space bar is a .key (so folio.js binds it) dressed as the secondary button beside it */
.kbd__foot .btn.key{border:1px solid var(--border-strong);font:500 var(--fs-ui)/1.2 var(--ff-ui);color:var(--text);background:transparent}
.kbd__foot .btn.key:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-wash)}
/* Group titles are labels (not headings) styled as the component's titles; the head row holds the phone tabs and the
   close button */
.kbd__label{display:flex;justify-content:space-between;gap:var(--s-2);margin-bottom:var(--s-2);font:500 var(--fs-ui-sm)/1.3 var(--ff-ui);color:var(--text-subtle)}
.kbd__label [lang=sa]{font-size:1rem;color:var(--text-subtle)}
.kbd__head{display:flex;align-items:center;justify-content:flex-end;gap:var(--s-2);margin-bottom:var(--s-3)}
.kbd__head .kbd__tabs{flex:1;min-width:0;margin-bottom:0;grid-auto-columns:minmax(max-content,1fr)}
.kbd__head .kbd__tabs>button{min-width:0;padding-inline:.625rem;white-space:nowrap} /* room for the close button at 320 */
.kbd__close{margin:0}
@media(min-width:48rem){.kbd__head{margin-block:calc(-1 * var(--s-2)) var(--s-1)}}

/* Tool template with the main column first in the DOM (tab order: the tool, then the sidebar) */
@media(min-width:64rem){.tool-layout--main-first>.tool-main{grid-column:2;grid-row:1}.tool-layout--main-first>.tool-nav{grid-column:1;grid-row:1}}
.entry__meta .more{min-height:var(--tap)}
.entry .tr small{white-space:nowrap}

/* /dictionary: From / To scheme pickers and the converted form */
.scheme-pick{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,9.5rem),1fr));gap:var(--s-3) var(--s-4);margin-bottom:var(--s-5)}
.search-well .search-well__top .field__label{margin:0}
.converted{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--s-2);min-height:2.6rem;margin-top:var(--s-3)}
.converted output{font:1.375rem/1.6 var(--ff-sanskrit);color:var(--sanskrit);overflow-wrap:anywhere}
.converted output[lang=sa-Latn]{font:italic 1.25rem/1.5 var(--ff-text);color:var(--text-muted)}
.closest{justify-content:center;margin-top:calc(-1 * var(--s-5))}
.result-group .entry .hw{font-size:1.5rem}

/* /dhatu: present-class codes and their inline conjugation tables */
.conj{font:600 var(--fs-ui)/1 var(--ff-ui);color:var(--accent);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.25em;display:inline-flex;align-items:center;justify-content:center;min-height:var(--tap);min-width:var(--tap);padding-inline:var(--s-1)}
.conj:hover{color:var(--accent-strong)}
/* minmax(0,1fr): a wide table must scroll inside its .table-wrap, not widen the grid track (and the page) */
.conj-tables{margin:var(--s-3) 0 var(--s-4);display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s-4)}
.conj-tables>section{min-width:0}
.conj-tables h3{font:var(--fw-medium) var(--fs-h4)/1.25 var(--ff-display)}
.conj-tables .forms{display:flex;flex-wrap:wrap;gap:var(--s-1) var(--s-3)}
.conj-tables .forms [lang=sa]{font:1.125rem/1.7 var(--ff-sanskrit)}
.dhatu-legend{margin-top:var(--s-3)}

/* The Dhātupāṭha's own paradigms (collapsed): one person × number table per lakāra, captioned, the source as meta */
.paradigms{margin-top:var(--s-3)}
.subentries__list>li>.paradigms:last-child{border-bottom:0} /* the next gaṇa's rule follows */
.paradigms>summary .meta{margin-left:auto}
.paradigms__body{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s-3);padding-block:var(--s-2) var(--s-4)}
.paradigm{margin:0;min-width:0}
.paradigm figcaption{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;column-gap:var(--s-3);margin-bottom:var(--s-1)}
.paradigm__cap{font:500 var(--fs-ui-sm)/1.4 var(--ff-ui);color:var(--text)}
.paradigm .table th,.paradigm .table td{padding:.45rem var(--s-3)}
.paradigm .table td [lang=sa]{font-size:1.125rem;white-space:nowrap}
.paradigms__section{margin-top:var(--s-2);color:var(--text-subtle)}
.paradigms__note{font:400 var(--fs-ui-sm)/1.55 var(--ff-ui);color:var(--text-muted)}

/* /sanskritdictionary: morphology (lexical splits and their analyses) */
.morph{margin-top:var(--s-4);display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s-4)}
.morph__parts{font:1.5rem/1.7 var(--ff-sanskrit);color:var(--sanskrit)}
.morph__list{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s-2);margin-top:var(--s-2);padding-left:var(--s-4);border-left:1px solid var(--accent)}
.morph__list [lang=sa]{font:1.125rem/1.6 var(--ff-sanskrit)}
