/* Word Forms tables (Grammar Round 1, 24 November 2026).
   One forms table that stays a real grid on every screen: a phone shows one tense at a time with short heads,
   a desktop shows the tenses side by side and the noun table beside its use in the texts.
   Every rule is scoped under #forms, .fm-* or [data-fm-*]; colours come from the sv.css tokens.
   rupa.js sets: fm-off / fm-on (hidden / picked), html[data-fm-roman], body[data-fm-barpad], .fm-two[data-fm-two],
   [data-fm-slide] (the short slide when the tense changes). Layout rules are "screen" only; print has its own block. */

/* ---------- the table: a real grid at every width (undo sv.css's phone cards for [data-fm-table]) ---------- */
:is(#forms,#ru-out) table[data-fm-table]{display:table;table-layout:auto;width:100%;max-width:100%;margin:6px 0 16px;border-collapse:collapse;font-size:17px}
:is(#forms,#ru-out) table[data-fm-table] caption{display:table-caption;width:auto;text-align:left;padding:0 0 6px;font:700 15px/1.5 var(--ui);color:var(--soft)}
:is(#forms,#ru-out) table[data-fm-table] thead{display:table-header-group;position:static;width:auto;height:auto;overflow:visible;clip:auto;clip-path:none}
:is(#forms,#ru-out) table[data-fm-table] tbody{display:table-row-group}
:is(#forms,#ru-out) table[data-fm-table] tr{display:table-row;margin:0;padding:0;border:0;border-radius:0;background:none}
:is(#forms,#ru-out) table[data-fm-table] th,
:is(#forms,#ru-out) table[data-fm-table] td{display:table-cell;width:auto;padding:7px 8px;border:0;border-bottom:1px solid var(--line);vertical-align:top;white-space:normal;overflow-wrap:normal;word-break:normal}
:is(#forms,#ru-out) table[data-fm-table] td::before{content:none;display:none}
:is(#forms,#ru-out) table[data-fm-table] td+td{border-top:0}
:is(#forms,#ru-out) table[data-fm-table] thead th{color:var(--light);border-bottom:2px solid rgba(255,181,71,.35);vertical-align:bottom;font:700 14.5px/1.4 var(--label)}
:is(#forms,#ru-out) table[data-fm-table] tbody th{color:var(--soft);font:600 15px/1.45 var(--ui)}
:is(#forms,#ru-out) table[data-fm-table] th [lang="sa"]{display:inline;font:600 17px/1.6 var(--sa);color:var(--ink)}
:is(#forms,#ru-out) table[data-fm-table] th small{display:block;font:400 14px/1.45 var(--ui);color:var(--soft);opacity:1}
:is(#forms,#ru-out) table[data-fm-table] tbody tr:hover td{background:rgba(255,255,255,.03)}
:is(#forms,#ru-out) .sv-ftable-wrap{max-width:100%;overflow-x:auto;overflow-y:hidden}
:is(#forms,#ru-out) table[data-fm-table] .fm-short{display:none}
:is(#forms,#ru-out) table[data-fm-table] .fm-long{display:inline}

/* forms: side by side in the cell, wrapping only between forms, never inside a word */
:is(#forms,#ru-out) table[data-fm-table] td>a.sv-cellink,
:is(#forms,#ru-out) table[data-fm-table] td>.fm-fs{display:flex;flex-wrap:wrap;align-items:flex-start;gap:2px 14px;min-height:44px;min-width:0;color:inherit;text-decoration:none;border-radius:8px}
:is(#forms,#ru-out) table[data-fm-table] td>a.sv-cellink:hover{text-decoration:none;background:rgba(255,181,71,.08)}
:is(#forms,#ru-out) table[data-fm-table] .sv-form{display:inline-block;margin:0;padding:0 2px;border-radius:6px;text-align:left}
:is(#forms,#ru-out) table[data-fm-table] .fm-f{display:inline-block;white-space:nowrap;cursor:pointer}
:is(#forms,#ru-out) table[data-fm-table] .fm-f .sv-deva,
:is(#forms,#ru-out) table[data-fm-table] td .sv-deva{display:block;font:400 22px/1.55 var(--sa);color:#fff;white-space:nowrap}
:is(#forms,#ru-out) table[data-fm-table] .fm-f .sv-roman,
:is(#forms,#ru-out) table[data-fm-table] td .sv-roman{display:block;margin:0;font:italic 400 15px/1.35 var(--ui);color:var(--soft);opacity:1;white-space:nowrap}
:is(#forms,#ru-out) table[data-fm-table] td.fm-none{color:var(--mute);cursor:help}
:is(#forms,#ru-out) table[data-fm-table] .fm-f.fm-on .sv-deva{color:var(--gold);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:6px}
:is(#forms,#ru-out) table[data-fm-table] a.sv-cellink[aria-expanded="true"],
:is(#forms,#ru-out) table[data-fm-table] .sv-form[aria-expanded="true"]{background:rgba(255,181,71,.16);box-shadow:inset 0 0 0 1px rgba(255,181,71,.55)}
/* Roman under each form: the switch in the bar (rupa.js sets html[data-fm-roman]) */
html[data-fm-roman="0"] :is(#forms,#ru-out) table[data-fm-table] .sv-roman{display:none}

/* row heads that open their meaning */
:is(#forms,#ru-out) table[data-fm-table] th[data-fm-h][data-mean-en]{cursor:pointer}
:is(#forms,#ru-out) table[data-fm-table] th[data-fm-h][aria-expanded="true"]{color:var(--light);background:rgba(255,181,71,.1)}

/* visible keyboard focus on cells, heads, tabs, chips and bar buttons */
:is(#forms,#ru-out) table[data-fm-table] a.sv-cellink:focus-visible,
:is(#forms,#ru-out) table[data-fm-table] .sv-form:focus-visible,
:is(#forms,#ru-out) table[data-fm-table] td[tabindex]:focus-visible,
:is(#forms,#ru-out) table[data-fm-table] th[tabindex]:focus-visible{outline:3px solid var(--light);outline-offset:-3px;border-radius:6px}
[data-fm-tabs] a:focus-visible,[data-fm-tabs] button:focus-visible,[data-fm-genders] button:focus-visible,[data-fm-bar] button:focus-visible,.fm-understood a:focus-visible,.fm-ready a:focus-visible{outline:3px solid var(--light);outline-offset:3px}

/* the meaning bubble */
.fm-bubble{position:absolute;z-index:70;max-width:min(330px,calc(100vw - 16px));padding:10px 14px;border-radius:14px;border:1px solid var(--light);background:var(--panel2);color:var(--ink);
  font:500 16px/1.5 var(--ui);box-shadow:0 18px 40px -16px rgba(0,0,0,.85)}
.fm-bubble[hidden]{display:none}
.fm-bubble b{display:block;font:600 19px/1.6 var(--sa);color:#fff}
.fm-bubble b span{font:600 15px/1.4 var(--ui);color:var(--light);margin-left:6px}
.fm-bubble p{margin:2px 0 0}
.fm-bubble .fm-other{color:var(--soft);font-size:15px}

/* ---------- tense tabs: one row of chips that wraps; never a sideways scroll ---------- */
[data-fm-tabs]{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:10px 0 12px;padding:0;min-width:0}
[data-fm-tabs] a,[data-fm-tabs] button{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:6px 14px;border-radius:999px;border:1px solid rgba(255,181,71,.45);
  background:rgba(255,181,71,.08);color:#ffd9a0;font:600 17px/1.3 var(--ui);text-decoration:none;cursor:pointer;-webkit-appearance:none;appearance:none}
[data-fm-tabs] a [lang="sa"]{font:600 18px/1.4 var(--sa)}
[data-fm-tabs] a:hover,[data-fm-tabs] button:hover{background:rgba(255,181,71,.2);color:#fff}
[data-fm-tabs] a[aria-current]{background:linear-gradient(90deg,var(--light),var(--flame));color:var(--on-light);border-color:transparent}
[data-fm-tabs] a[aria-current] [lang]{color:var(--on-light)}
[data-fm-tabs] .fm-off{display:none}
[data-fm-tabs] [data-fm-all]{border-style:dashed;background:transparent;color:var(--light)}
[data-fm-tabs] [data-fm-all][aria-pressed="true"]{border-style:solid;background:rgba(255,181,71,.16)}
[data-fm-tabs] [data-fm-all][hidden]{display:none}
[data-fm-tabs] .fm-vedic{font:700 12.5px/1.2 var(--label);color:var(--gold);opacity:.95}
[data-fm-tabs] a[aria-current] .fm-vedic{color:var(--on-light)}

/* gender switch */
[data-fm-genders]{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 12px}
[data-fm-genders] button{min-height:44px}
[data-fm-gender].fm-off{display:none}

/* tenses, voices and padas */
#forms [data-fm-tense]{min-width:0;scroll-margin-top:calc(var(--head) + 84px)}
#forms [data-fm-tense]>h3,[data-fm-panels] [data-fm-tense]>h3{margin:6px 0 4px}
[data-fm-panels] .fm-tense.fm-off,[data-fm-panels] .fm-voice.fm-off,[data-fm-panels] .fm-pada.fm-off{display:none}
[data-fm-panels] .fm-voice,[data-fm-panels] .fm-pada{min-width:0}
[data-fm-panels] .fm-pada>h3,[data-fm-panels] .fm-pada>h4{margin:10px 0 2px;font-size:17px;line-height:1.5}
[data-fm-panels] .fm-voice>h4{margin:14px 0 0;color:var(--light);font-size:16px}
[data-fm-panels][hidden]{display:none}
@media (prefers-reduced-motion:no-preference){
  [data-fm-panels] [data-fm-slide="next"]{animation:fm-in-next .22s ease-out both}
  [data-fm-panels] [data-fm-slide="prev"]{animation:fm-in-prev .22s ease-out both}
}
@keyframes fm-in-next{from{opacity:.25;transform:translateX(28px)}to{opacity:1;transform:none}}
@keyframes fm-in-prev{from{opacity:.25;transform:translateX(-28px)}to{opacity:1;transform:none}}

/* the one line under the lookup box, and the ready-table links */
.fm-understood{margin:6px 0 4px;color:var(--soft);font-size:17px}
.fm-understood[hidden]{display:none}
.fm-understood [lang="sa"]{color:#fff;font-weight:600}
.fm-ready{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 14px}
.fm-ready .sv-chip{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}

/* ---------- the action bar ---------- */
[data-fm-bar]{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
[data-fm-bar][hidden]{display:none}
[data-fm-bar] button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:46px;min-width:44px;padding:8px 14px;border-radius:14px;border:1px solid var(--line2);
  background:rgba(255,255,255,.06);color:var(--ink);font:700 15.5px/1.25 var(--label);cursor:pointer;-webkit-appearance:none;appearance:none}
[data-fm-bar] button:hover{border-color:var(--light);color:#fff;background:rgba(255,181,71,.12)}
[data-fm-bar] button[hidden]{display:none}
[data-fm-bar] button[aria-pressed="true"]{background:linear-gradient(90deg,var(--light),var(--flame));color:var(--on-light);border-color:transparent}
[data-fm-bar] button[aria-pressed="true"] [lang]{color:var(--on-light)}
[data-fm-bar] [data-fm-act="copy"]{border-color:rgba(255,181,71,.6);color:var(--gold)}

/* ================= Grammar Round 2 (24 November 2026) ================= */
/* tense tabs step aside while a participle panel shows (rupa.js sets [hidden]) */
[data-fm-tabs][hidden]{display:none}

/* a lit cell (arrived from a tapped word, a typed form or a shared link): outline and weight, not colour alone */
:is(#forms,#ru-out) table[data-fm-table] td.fm-lit{outline:3px solid var(--gold);outline-offset:-3px;background:rgba(255,181,71,.16);border-radius:8px;scroll-margin:calc(var(--head) + 90px) 0 110px}
:is(#forms,#ru-out) table[data-fm-table] td.fm-lit .fm-f.fm-on .sv-deva{font-weight:700;color:#fff;text-decoration:underline;text-decoration-color:var(--gold);text-decoration-thickness:3px;text-underline-offset:6px}
:is(#forms,#ru-out) table[data-fm-table] td.fm-lit:focus-visible,
:is(#forms,#ru-out) table[data-fm-table] td.fm-lit a.sv-cellink:focus-visible{outline:3px solid #fff;outline-offset:-3px}
@media (prefers-reduced-motion:no-preference){
  :is(#forms,#ru-out) table[data-fm-table] td.fm-lit{animation:fm-lit-in .9s ease-out 1 both}
}
@keyframes fm-lit-in{0%{box-shadow:0 0 0 0 rgba(255,181,71,.75)}100%{box-shadow:0 0 0 14px rgba(255,181,71,0)}}
.fm-notmade{margin:4px 0 12px;font-size:17px}

/* found in the texts: a count under each found form, a hollow ring under each form made by the rules only */
.fm-f .fm-n{display:block;margin:0 0 1px;font:700 13px/1.25 var(--ui);font-variant-numeric:tabular-nums;color:var(--gold);letter-spacing:.01em;white-space:nowrap;text-decoration:none}
.fm-f .fm-ring,.fm-legend .fm-ring{display:inline-block;width:10px;height:10px;margin:3px 0 2px;border:1.5px solid var(--soft);border-radius:50%;vertical-align:middle;box-sizing:border-box}
.fm-legend .fm-ring{margin:0 2px 0 0;vertical-align:-1px}
.fm-sr{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
.fm-legend{margin:2px 0 14px;font:500 16px/1.5 var(--ui);color:var(--soft);max-width:75ch}
.fm-legend .sv-hi,.fm-legend .sv-en{overflow-wrap:anywhere}

/* the forms a typed word matches: chips that open the table with the form lit */
.fm-hits{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 12px;min-width:0}
.fm-hits[hidden]{display:none}
.fm-hits .fm-hit{display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:44px;max-width:100%;padding:8px 14px;white-space:normal;overflow-wrap:anywhere;text-align:left;text-decoration:none;
  border:1px solid rgba(255,181,71,.55);background:rgba(255,181,71,.1)}
.fm-hits .fm-hit:hover{background:rgba(255,181,71,.2);text-decoration:none}
.fm-hits .fm-hit-w{color:var(--ink);font:600 17px/1.4 var(--ui)}
.fm-hits .fm-hit-w [lang="sa"]{font:600 19px/1.4 var(--sa);color:#fff}
.fm-hits .fm-hit-go{font:700 14px/1.3 var(--label);color:var(--gold)}
.fm-hits .fm-hit:focus-visible{outline:3px solid var(--light);outline-offset:3px}

/* the details panel: the count with its one use, the steps from root to form, the report link */
#ru-detail .fm-found:empty{display:none}
#ru-detail .fm-found{margin:8px 0 10px}
#ru-detail .fm-found-n{margin:0 0 4px}
#ru-detail .fm-found-n strong{color:var(--gold)}
#ru-detail .fm-found-0{margin:0;color:var(--soft)}
#ru-detail .fm-found-use{margin:6px 0 0;padding:6px 0 6px 14px;border-left:3px solid rgba(255,181,71,.55)}
#ru-detail .fm-found-use p{margin:0 0 4px;overflow-wrap:anywhere}
#ru-detail .fm-found-use .sv-deva{font-size:20px;line-height:1.7;color:#fff}
.fm-der h4{margin:12px 0 6px}
.fm-steps{list-style:none;margin:10px 0 8px;padding:0;counter-reset:none}
.fm-steps .fm-step{display:grid;grid-template-columns:2.2rem minmax(0,1fr);gap:0 10px;padding:10px 0;border-top:1px solid var(--line)}
.fm-steps .fm-step:first-child{border-top:0}
.fm-steps .fm-snum{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:50%;background:rgba(255,181,71,.14);border:1px solid rgba(255,181,71,.5);
  color:var(--gold);font:700 15px/1 var(--ui);font-variant-numeric:tabular-nums}
.fm-steps .fm-sbody{min-width:0}
.fm-steps p{margin:0 0 4px}
.fm-steps .fm-srule{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}
.fm-steps .fm-sutra,.fm-steps .fm-rule{min-height:40px;font:700 15px/1.3 var(--label)}
.fm-steps .fm-sutra [lang="sa"],.fm-steps .fm-rule [lang="sa"]{font:600 17px/1.3 var(--sa)}
.fm-steps a.fm-sutra-open{text-decoration:none;color:var(--gold);border-color:rgba(255,181,71,.6)}
.fm-steps .fm-stext{font:500 18px/1.6 var(--sa);color:var(--ink);overflow-wrap:anywhere;min-width:0}
.fm-steps .fm-stext:empty{display:none}
.fm-steps .fm-sterms{font:400 20px/1.6 var(--sa);color:#fff;overflow-wrap:anywhere}
.fm-steps .fm-chg{font-weight:700;color:var(--gold);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:5px}
.fm-steps .fm-sline{font:500 17px/1.55 var(--ui);color:var(--soft)}
.fm-steps .fm-sline [lang="sa"]{font-family:var(--sa);color:var(--ink)}
.fm-der .fm-result{margin:6px 0 8px;font-size:17px}
.fm-der .fm-result .sv-deva{font-size:22px;color:#fff}
.fm-der .fm-sutra:focus-visible,.fm-der a:focus-visible,#ru-detail .fm-report a:focus-visible,#ru-detail .fm-found a:focus-visible{outline:3px solid var(--light);outline-offset:3px}
#ru-detail .fm-report{margin:10px 0 0;font-size:16px}
#ru-detail .fm-report a{color:var(--soft);text-decoration:underline;text-underline-offset:3px}
#ru-detail .fm-report a:hover{color:var(--gold)}

/* ready participles on the root page (tools.php: section.fm-krt, table.fm-krt-table, not a forms grid) */
#forms .fm-krt{margin:18px 0 6px;padding:14px 0 0;border-top:1px solid var(--line);min-width:0}
#forms .fm-krt>h3{margin:0 0 4px}
#forms .fm-krt table.fm-krt-table{width:100%;max-width:100%;table-layout:auto}
#forms .fm-krt-table th,#forms .fm-krt-table td{white-space:normal;overflow-wrap:anywhere;min-width:0}
#forms .fm-krt-table .fm-f{display:inline-block;vertical-align:top;margin:0 12px 2px 0;white-space:nowrap;cursor:copy;border-radius:6px}
#forms .fm-krt-table .fm-f .sv-deva{display:block;font:400 20px/1.5 var(--sa);color:#fff}
#forms .fm-krt-table .fm-f .sv-roman{display:block;margin:0;font:italic 400 14.5px/1.3 var(--ui);color:var(--soft)}
html[data-fm-roman="0"] #forms .fm-krt-table .sv-roman{display:none}
#forms .fm-krt-table a[data-fm-krt-open]{display:inline-flex;align-items:center;min-height:44px;font-weight:700;color:var(--gold);white-space:nowrap}
#forms .fm-krt [data-fm-form]:focus-visible,#forms .fm-krt-word [data-fm-form]:focus-visible{outline:3px solid var(--light);outline-offset:2px}
@media screen and (max-width:899px){
  /* labelled rows: each participle is a card, its cells flow two to a line and never push the page sideways */
  #forms .fm-krt-table,#forms .fm-krt-table tbody,#forms .fm-krt-table tr{display:block;width:100%}
  #forms .fm-krt-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%)}
  #forms .fm-krt-table tr{display:flex;flex-wrap:wrap;gap:2px 12px;margin:0 0 10px;padding:8px 12px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.04)}
  #forms .fm-krt-table th,#forms .fm-krt-table td{display:block;flex:1 1 8.5rem;width:auto;padding:4px 0;border:0}
  #forms .fm-krt-table tr>:first-child{flex-basis:100%}
  #forms .fm-krt-table td[data-label]::before{content:attr(data-label);display:block;font:700 13px/1.4 var(--ui);color:var(--light);margin-bottom:1px}
  html[data-fm-lang] #forms .fm-krt-table td[data-fm-rl-label]::before{content:attr(data-fm-rl-label)}
  #forms .fm-krt-table tbody tr:hover td{background:none}
}

/* the participle panel the builder makes: stem line, gender switch, the eight-by-three table, the indeclinable word */
#forms [data-fm-panels][data-fm-kind="noun"]>*{min-width:0}
#forms [data-fm-kind="noun"] .fm-krt-stem,#forms [data-fm-kind="noun"]>p{max-width:75ch}
#forms .fm-krt-head h3{margin:10px 0 4px;overflow-wrap:anywhere}
#forms .fm-krt-head h3 small{font-size:15px}
#forms .fm-krt-stem{font-size:17px;overflow-wrap:anywhere}
#forms .fm-krt-stem b[lang="sa"]{font:600 22px/1.5 var(--sa);color:#fff}
#forms [data-fm-kind="noun"] .fm-krt-g{margin:10px 0 2px;font-size:17px;color:var(--light)}
#forms [data-fm-kind="noun"] [data-fm-genders]{margin:8px 0 10px}
#forms [data-fm-kind="noun"] [data-fm-genders] [data-fm-g][aria-pressed="true"]{background:linear-gradient(90deg,var(--light),var(--flame));color:var(--on-light);border-color:transparent}
#forms [data-fm-kind="noun"] [data-fm-genders] [data-fm-g][aria-pressed="true"] [lang]{color:var(--on-light)}
#forms [data-fm-kind="noun"] [data-fm-gender][hidden]{display:none}
#forms .fm-krt-word{display:flex;flex-wrap:wrap;gap:6px 18px;margin:8px 0 12px;min-width:0}
#forms .fm-krt-word .fm-f{display:inline-block;white-space:nowrap;cursor:copy;padding:4px 8px;border-radius:10px;border:1px solid rgba(255,181,71,.4);background:rgba(255,181,71,.08)}
#forms .fm-krt-word .fm-f .sv-deva{display:block;font:400 24px/1.5 var(--sa);color:#fff}
#forms .fm-krt-word .fm-f .sv-roman{display:block;font:italic 400 15px/1.3 var(--ui);color:var(--soft)}
html[data-fm-roman="0"] #forms .fm-krt-word .sv-roman{display:none}

/* the builder's participle choices: chip groups and the two lists of further suffixes */
#fm-layers .fm-lay-krt,#fm-layers [data-fm-group="kr"] .fm-lay-chips{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
#fm-layers .fm-lay-krt .sv-chip,#fm-layers [data-fm-group="kr"] .sv-chip{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left}
#fm-layers .sv-chip[aria-disabled="true"]{opacity:.5;border-style:dashed;cursor:help}
#fm-layers select{display:block;width:100%;max-width:26rem;min-height:46px;margin:6px 0;padding:8px 12px;border-radius:12px;border:1px solid var(--line2);background:var(--panel2);color:var(--ink);
  font:600 16px/1.3 var(--ui);-webkit-appearance:auto;appearance:auto}
#fm-layers select:focus-visible,#fm-layers .sv-chip:focus-visible{outline:3px solid var(--light);outline-offset:2px}
#fm-layers label{display:block;margin:8px 0 0;font:600 15px/1.4 var(--label);color:var(--soft)}

/* ---------- phone and tablet: below 1000 px ---------- */
@media screen and (max-width:999px){
  #forms{padding:14px 10px}
  :is(#forms,#ru-out) table[data-fm-table]{font-size:16px}
  :is(#forms,#ru-out) table[data-fm-table] th,
  :is(#forms,#ru-out) table[data-fm-table] td{padding:4px 4px}
  :is(#forms,#ru-out) table[data-fm-table] thead th{padding-bottom:5px;font-size:14px}
  :is(#forms,#ru-out) table[data-fm-table] tbody th{width:1%;white-space:nowrap;padding-right:6px}
  /* heads show the short label; the full label stays for screen readers */
  :is(#forms,#ru-out) table[data-fm-table] th[data-fm-h]>.fm-short{display:inline;font:600 16px/1.5 var(--sa);color:var(--light)}
  :is(#forms,#ru-out) table[data-fm-table] th[data-fm-h]>:not(.fm-short){position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;
    overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
  :is(#forms,#ru-out) table[data-fm-table] td>a.sv-cellink,
  :is(#forms,#ru-out) table[data-fm-table] td>.fm-fs{gap:0 10px;min-height:44px;align-items:center}
  :is(#forms,#ru-out) table[data-fm-table] .fm-f .sv-deva,
  :is(#forms,#ru-out) table[data-fm-table] td .sv-deva{font-size:20px;line-height:1.5}
  :is(#forms,#ru-out) table[data-fm-table] .fm-f .sv-roman,
  :is(#forms,#ru-out) table[data-fm-table] td .sv-roman{font-size:13.5px;line-height:1.3}
  [data-fm-tabs]{gap:6px}
  [data-fm-tabs] a,[data-fm-tabs] button{padding:6px 12px;font-size:16px}
  /* the bar: fixed at the bottom, clear of the safe area; the page keeps room so it never covers the last line */
  [data-fm-bar]{position:fixed;left:0;right:0;bottom:0;z-index:60;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px;margin:0;
    padding:8px max(10px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));
    background:rgba(14,8,25,.97);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-top:1px solid var(--line2);box-shadow:0 -14px 30px -18px rgba(0,0,0,.9)}
  [data-fm-bar][hidden]{display:none}
  [data-fm-bar] button{min-height:48px;padding:6px 4px;font-size:14.5px;border-radius:12px;min-width:0;overflow-wrap:anywhere;text-align:center}
  [data-fm-bar] [data-fm-slot]{display:contents}
  [data-fm-bar] [data-fm-slot][hidden]{display:none}
  body[data-fm-barpad]{padding-bottom:calc(80px + env(safe-area-inset-bottom,0px))}
}
@media screen and (max-width:359px){
  :is(#forms,#ru-out) table[data-fm-table] .fm-f .sv-deva,
  :is(#forms,#ru-out) table[data-fm-table] td .sv-deva{font-size:20px}
  #forms{padding:12px 8px}
  [data-fm-bar] button{font-size:13.5px}
}

/* ---------- desktop: 1000 px and wider ---------- */
@media screen and (min-width:1000px){
  /* noun table left, its use in the texts right; verbs take the full width for the grid of tenses */
  .fm-two{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:24px;align-items:start}
  .fm-two>.fm-main,.fm-two>.fm-side{min-width:0}
  .fm-two[data-fm-two="verb"]{display:block}
  /* every tense shown, three across at 1440 px; the tabs jump to them. Columns are at least 20.5rem so the longest
     forms (a long root in the conditional) fit without a sideways scroll; narrower windows get two columns. */
  #forms[data-fm="verb"] [data-fm-panels],[data-fm-panels].fm-verbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,20.5rem),1fr));gap:14px 12px;align-items:start}
  #forms[data-fm="verb"] [data-fm-panels][hidden]{display:none}
  #forms[data-fm="verb"] [data-fm-panels]>:not(.fm-tense),[data-fm-panels].fm-verbs>:not(.fm-tense){grid-column:1/-1}
  [data-fm-panels] .fm-tense.fm-off{display:block}
  [data-fm-panels] .fm-tense{padding:2px 0 0;border-top:1px solid var(--line)}
  [data-fm-tabs] .fm-off{display:inline-flex}
  [data-fm-tabs] [data-fm-all]{display:none}
  /* in the narrow tense columns the heads stay short (the bubble gives the full name and meaning) */
  #forms[data-fm="verb"] table[data-fm-table] th[data-fm-h]>.fm-short,
  #ru-out .fm-verbs table[data-fm-table] th[data-fm-h]>.fm-short{display:inline;font:600 16px/1.5 var(--sa);color:var(--light)}
  #forms[data-fm="verb"] table[data-fm-table] th[data-fm-h]>:not(.fm-short),
  #ru-out .fm-verbs table[data-fm-table] th[data-fm-h]>:not(.fm-short){position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;
    overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
  #forms[data-fm="verb"] table[data-fm-table] tbody th,#ru-out .fm-verbs table[data-fm-table] tbody th{width:1%;white-space:nowrap}
  #forms[data-fm="verb"] table[data-fm-table] th,#forms[data-fm="verb"] table[data-fm-table] td,
  #ru-out .fm-verbs table[data-fm-table] th,#ru-out .fm-verbs table[data-fm-table] td{padding:5px 3px}
  #forms[data-fm="verb"] table[data-fm-table] .fm-f .sv-deva,#ru-out .fm-verbs table[data-fm-table] .fm-f .sv-deva{font-size:20px}
  #forms[data-fm="verb"] table[data-fm-table] .fm-f .sv-roman,#ru-out .fm-verbs table[data-fm-table] .fm-f .sv-roman{font-size:14px}
  /* the detail panel under a tense spans the whole row of tenses */
  #forms[data-fm="verb"] [data-fm-panels]>#ru-detail,[data-fm-panels].fm-verbs>#ru-detail{grid-column:1/-1}
  /* the bar: sticky at the top of the forms column, under the site header, on a solid ground */
  [data-fm-bar]{position:sticky;top:calc(var(--head) + 8px);z-index:20;margin:8px 0 12px;padding:8px 10px;border-radius:16px;border:1px solid var(--line2);
    background:var(--panel2);box-shadow:0 14px 30px -20px rgba(0,0,0,.9)}
  [data-fm-bar] [data-fm-slot]{display:contents}
  [data-fm-bar] [data-fm-slot][hidden]{display:none}
}

/* ---------- print: every tense, voice and gender; no controls (works with tools.php PRINT_CSS) ---------- */
@media print{
  [data-fm-bar],[data-fm-tabs],[data-fm-genders],[data-fm-choose],#fm-layers,.fm-layers,.fm-bubble,.fm-understood,.fm-ready{display:none!important}
  #forms .fm-off,#forms [data-fm-gender].fm-off{display:block!important}
  #forms [data-fm-panels]{display:block!important}
  #forms [data-fm-panels][hidden]{display:none!important}
  #forms [data-fm-tense]{animation:none!important;transform:none!important;opacity:1!important}
  #forms table[data-fm-table] .fm-short{display:none!important}
  #forms table[data-fm-table] .fm-long{display:inline!important;position:static!important;width:auto!important;height:auto!important;margin:0!important;overflow:visible!important;clip:auto!important;clip-path:none!important;white-space:normal!important}
  #forms table[data-fm-table] .fm-f{display:inline-block!important;margin-right:8pt!important}
  #forms table[data-fm-table] td>a.sv-cellink{display:inline!important;min-height:0!important}
  body[data-fm-barpad]{padding-bottom:0!important}
  :is(#forms,#ru-out) table[data-fm-table] td .sv-deva,
  :is(#forms,#ru-out) table[data-fm-table] td .sv-roman{color:#000!important}
  /* marks print as text only: the count, and ◦ for a form made by the rules only; no outline or tint */
  .fm-f .fm-n{color:#000!important;font-size:9pt!important}
  .fm-f .fm-ring,.fm-legend .fm-ring{border:0!important;width:auto!important;height:auto!important;margin:0!important}
  .fm-f .fm-ring::before,.fm-legend .fm-ring::before{content:"\25E6";color:#000}
  .fm-legend{color:#000!important}
  :is(#forms,#ru-out) table[data-fm-table] td.fm-lit{outline:0!important;background:none!important;box-shadow:none!important;animation:none!important}
  .fm-hits,.fm-notmade,#ru-detail .fm-report,[data-fm-tabs][hidden]{display:none!important}
  #forms .fm-krt-table .fm-f .sv-deva,#forms .fm-krt-word .fm-f .sv-deva{color:#000!important}
  /* the forms column prints; the side column and the rest of the page do not */
  .sv-page>.fm-two.fm-two:not(#fm-none),.fm-two>.fm-main:not(#fm-none){display:block!important;background:#fff!important}
  .fm-two>.fm-side,.fm-two #sv-uses,.fm-two #ru-attested,.fm-two #sv-more,.fm-two [data-extra-forms],.fm-two .sv-noprint{display:none!important}
}

/* ================= Grammar Round 3 (24 November 2026) ================= */
/* labels in more Indian languages: the switch under the title line (forms-lang.js). Hindi and English stay as they are;
   a chosen language adds span.sv-rl beside them, and these rules show it in their place on screen only. */
.fm-lang{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:4px 0 12px;min-width:0;max-width:100%}
.fm-lang label{display:inline;margin:0;font:600 15px/1.4 var(--label);color:var(--soft)}
.fm-lang select{min-height:44px;min-width:0;max-width:100%;margin:0;padding:6px 12px;border-radius:12px;border:1px solid var(--line2);background:var(--panel2);color:var(--ink);
  font-weight:600;font-size:16px;line-height:1.3;-webkit-appearance:auto;appearance:auto;
  font-family:var(--ui),"Noto Sans Gujarati","Noto Sans Bengali","Noto Sans Tamil","Noto Sans Telugu","Noto Sans Kannada","Noto Sans Malayalam","Noto Sans Oriya","Nirmala UI",sans-serif}
.fm-lang select:hover{border-color:var(--light)}
.fm-lang select:focus-visible{outline:3px solid var(--light);outline-offset:2px}
.fm-lang-note{flex:1 1 15rem;min-width:0;font:500 15px/1.5 var(--ui);color:var(--mute);overflow-wrap:anywhere}
.fm-lang-note[hidden]{display:none}

/* the scripts: only fonts already on the reader's device (no web fonts), with room for their tall vowel signs */
:is(.sv-rl,.fm-lang option)[lang="mr"],html[data-fm-lang="mr"] [data-fm-orig]{font-family:"Noto Sans Devanagari","Nirmala UI","Kohinoor Devanagari","Devanagari Sangam MN",Mangal,sans-serif}
:is(.sv-rl,.fm-lang option)[lang="gu"],html[data-fm-lang="gu"] [data-fm-orig]{font-family:"Noto Sans Gujarati","Nirmala UI","Gujarati Sangam MN","Gujarati MT",Shruti,sans-serif}
:is(.sv-rl,.fm-lang option)[lang="bn"],html[data-fm-lang="bn"] [data-fm-orig]{font-family:"Noto Sans Bengali","Nirmala UI","Kohinoor Bangla","Bangla Sangam MN",Vrinda,sans-serif}
:is(.sv-rl,.fm-lang option)[lang="ta"],html[data-fm-lang="ta"] [data-fm-orig]{font-family:"Noto Sans Tamil","Nirmala UI","Tamil Sangam MN",Latha,sans-serif}
:is(.sv-rl,.fm-lang option)[lang="te"],html[data-fm-lang="te"] [data-fm-orig]{font-family:"Noto Sans Telugu","Nirmala UI","Kohinoor Telugu","Telugu Sangam MN",Gautami,sans-serif}
:is(.sv-rl,.fm-lang option)[lang="kn"],html[data-fm-lang="kn"] [data-fm-orig]{font-family:"Noto Sans Kannada","Nirmala UI","Kannada Sangam MN",Tunga,sans-serif}
:is(.sv-rl,.fm-lang option)[lang="ml"],html[data-fm-lang="ml"] [data-fm-orig]{font-family:"Noto Sans Malayalam","Nirmala UI","Malayalam Sangam MN",Kartika,sans-serif}
:is(.sv-rl,.fm-lang option)[lang="or"],html[data-fm-lang="or"] [data-fm-orig]{font-family:"Noto Sans Oriya","Noto Sans Odia","Nirmala UI","Oriya Sangam MN",Kalinga,sans-serif}

@media screen{
  /* today's English and Hindi step aside only where the language has a word ([data-fm-rl] is set label by label) */
  html[data-fm-lang] .sv-t[data-fm-rl]>.sv-en,
  html[data-fm-lang] .sv-t[data-fm-rl]>.sv-hi,
  html[data-fm-lang] .sv-en[data-fm-rl],
  html[data-fm-lang] th[data-fm-rl]>.sv-en,
  html[data-fm-lang] th[data-fm-rl]>.sv-t,
  html[data-fm-lang] th[data-fm-rl]>.fm-long>.sv-t{display:none!important}
  html[data-fm-lang] .sv-rl{display:inline;line-height:1.6}
  html[data-fm-lang] .sv-rl:is([lang="ta"],[lang="te"],[lang="kn"],[lang="ml"],[lang="or"]){line-height:1.7}
  html[data-fm-lang] .sv-rl:is([lang="ta"],[lang="ml"]){font-size:.95em}
  /* a table head: the word on its own line under the Sanskrit term. Phones and the narrow tense columns keep today's
     short head (the rules above clip every other child of th[data-fm-h]), so the noun table still fits a 390 px screen. */
  html[data-fm-lang] table[data-fm-table] th[data-fm-h]>.fm-rlh{display:block;margin:1px 0 0;font-weight:600;font-size:14.5px;line-height:1.5;color:var(--light);white-space:normal}
  /* the meaning bubble: the case or person and its meaning in the language, under the Sanskrit name */
  html[data-fm-lang] .fm-bubble .fm-rlb{display:block;margin:4px 0 0;font-size:16px;line-height:1.65;color:var(--gold)}
  /* the bar on a phone: longer words wrap inside their button */
  html[data-fm-lang] [data-fm-bar] button .sv-rl{overflow-wrap:anywhere}
}

/* the word-in-front box and its button (builder.js, compound group): one line from 360 px, wrapping below */
.fm-pp{display:flex;flex-wrap:wrap;align-items:stretch;gap:8px;margin:6px 0 4px;min-width:0;max-width:34rem}
.fm-pp>*{min-width:0;max-width:100%}
.fm-pp>:first-child,.fm-pp input,.fm-pp .sv-input{flex:1 1 10rem;width:auto;margin:0}
.fm-pp input,.fm-pp .sv-input{min-height:46px}
.fm-pp button,.fm-pp .sv-btn{flex:0 0 auto;min-height:46px;margin:0;white-space:normal;text-align:center}
.fm-pp input:focus-visible,.fm-pp button:focus-visible{outline:3px solid var(--light);outline-offset:2px}
@media screen and (min-width:360px){
  .fm-pp{flex-wrap:nowrap}
  .fm-pp>:first-child,.fm-pp input,.fm-pp .sv-input{flex-basis:0}
}

/* "Words made from this word" on noun pages (derive-noun.js): the same look as the root page's choices (#fm-layers) */
#fm-derive,.fm-derive{margin:10px 0 12px;min-width:0;max-width:100%}
.fm-derive [hidden]{display:none!important}
.fm-derive details>summary{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;min-height:44px;cursor:pointer;font:700 17px/1.4 var(--ui);color:var(--light);overflow-wrap:anywhere}
.fm-derive details>summary [lang="sa"]{font:600 18px/1.4 var(--sa);color:var(--gold)}
.fm-derive .fm-lay-h{margin:0 0 6px;font:700 16px/1.4 var(--label);color:var(--light)}
.fm-derive .fm-lay-chips,.fm-derive .fm-lay-krt{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
.fm-derive .sv-chip{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left}
.fm-derive .sv-chip[aria-disabled="true"]{opacity:.5;border-style:dashed;cursor:help}
.fm-derive select{display:block;width:100%;max-width:26rem;min-height:46px;margin:6px 0;padding:8px 12px;border-radius:12px;border:1px solid var(--line2);background:var(--panel2);color:var(--ink);
  font:600 16px/1.3 var(--ui);-webkit-appearance:auto;appearance:auto}
.fm-derive label{display:block;margin:8px 0 0;font:600 15px/1.4 var(--label);color:var(--soft)}
.fm-derive select:focus-visible,.fm-derive .sv-chip:focus-visible,.fm-derive summary:focus-visible,.fm-derive button:focus-visible{outline:3px solid var(--light);outline-offset:2px}
@media (prefers-reduced-motion:reduce){
  .fm-lang select,.fm-pp button,.fm-derive .sv-chip{transition:none}
}

/* print: today's labels only (forms-lang.js also takes its additions out before printing); no switch, no builders */
@media print{
  .sv-rl,.fm-lang,#fm-derive,.fm-derive,.fm-pp{display:none!important}
}
