/* Learning-page refinements: comfortable text, compact dialogs and safe artwork. */
.subject-tabs .glossary-subject-tab { grid-column:auto; }
.subject-tabs .resources-subject-tab { grid-column:1; }
.subject-tabs .contact-subject-tab { grid-column:auto; }
.glossary-hero { position:relative; isolation:isolate; overflow:hidden; background:var(--cream); }
.glossary-hero::before,.glossary-hero::after { display:none; }
.glossary-hero-art { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-1; }
.glossary-book-text { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; fill:#a37c43; opacity:.34; font:20px var(--sanskrit-serif); }
.glossary-book-text path { fill:none; stroke:#a37c43; stroke-width:.7; opacity:.5; }
.glossary-hero>div { max-width:65%; }
.glossary-hero h1 { margin:8px 0; font:600 clamp(60px,8vw,115px)/1 var(--serif); }
.glossary-controls { display:grid; grid-template-columns:auto minmax(120px,1fr) auto minmax(120px,.5fr) auto; gap:12px; align-items:center; padding:22px; border:1px solid var(--line); border-left:5px solid var(--gold); border-radius:14px; background:var(--wash); }
.glossary-controls input,.glossary-controls select,.glossary-controls button { min-width:0; min-height:48px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; color:var(--ink); background:var(--surface-raised); font-size:16px; }
.glossary-controls button { color:var(--orange-dark); cursor:pointer; }
.glossary-controls>p { grid-column:1/-1; margin:0; color:var(--soft); }
.glossary-browser { display:grid; grid-template-columns:64px minmax(0,1fr); align-items:start; gap:20px; margin-top:24px; }
.glossary-alphabet { position:sticky; top:var(--glossary-rail-top,90px); display:grid; gap:8px; padding:8px 4px; border:1px solid var(--line); border-radius:14px; background:var(--surface-raised); text-align:center; }
.glossary-alphabet>span { font-size:12px; font-weight:800; color:var(--soft); }
#glossary-alphabet-letters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(13,clamp(18px,calc((100dvh - var(--glossary-rail-top,90px) - 120px)/13),28px)); grid-auto-flow:column; gap:2px; }
.glossary-alphabet button { min-width:0; padding:0; border:1px solid transparent; border-radius:6px; background:transparent; color:var(--ink); font-size:14px; font-weight:700; cursor:pointer; }
.glossary-alphabet button:hover:not(:disabled),.glossary-alphabet button:focus-visible { border-color:var(--gold); color:var(--orange-dark); background:var(--wash); }
.glossary-alphabet button:disabled { color:var(--soft); opacity:.45; cursor:default; }
#glossary-top { min-height:36px; border-color:var(--line); color:var(--orange-dark); font-size:28px; line-height:1; }
.glossary-results { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
.glossary-entry { min-width:0; border:1px solid var(--line); border-left:4px solid var(--gold); border-radius:14px; background:var(--surface-raised); scroll-margin-top:calc(var(--glossary-rail-top,90px) + 8px); }
.glossary-entry>summary { display:grid; grid-template-columns:minmax(220px,.7fr) minmax(0,1.4fr) 28px; gap:24px; align-items:center; padding:22px 24px; cursor:pointer; list-style:none; }
.glossary-entry>summary::-webkit-details-marker { display:none; }
.glossary-term { display:flex; flex-wrap:wrap; gap:4px 12px; align-items:baseline; min-width:0; }
.glossary-term>strong { font:600 28px/1.25 var(--serif); overflow-wrap:anywhere; }
.glossary-term>[lang] { font:600 26px/1.5 var(--sanskrit-serif); }
.glossary-term>small { flex-basis:100%; color:var(--orange-dark); font-size:13px; }
.glossary-definition { font-size:18px; line-height:1.6; }
.glossary-arrow { color:var(--orange-dark); font-size:28px; text-align:center; transition:transform .15s; }
.glossary-entry[open] .glossary-arrow { transform:rotate(180deg); }
.glossary-entry[open]>summary { border-bottom:1px solid var(--line); background:var(--wash); border-radius:10px 10px 0 0; }
.glossary-entry-body { padding:10px 24px 24px; }
.glossary-entry .glossary-aliases { color:var(--soft); font-size:14px; }
.glossary-example { padding:14px 16px; border-left:4px solid var(--gold); border-radius:0 10px 10px 0; background:var(--wash); }
.glossary-example>strong { color:var(--orange-dark); font-size:13px; }
.glossary-example p { margin:6px 0 0; font:500 20px/1.6 var(--serif); }
.glossary-entry nav { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.glossary-entry nav a { padding:7px 12px; border:1px solid var(--gold); border-radius:999px; color:var(--orange-dark); font-size:14px; font-weight:700; text-decoration:none; }
.pronunciation-browser .phoneme-grid button { min-height:104px; padding:14px 12px; align-content:center; gap:8px; }
.pronunciation-browser .phoneme-grid button>b { font:600 34px/1.35 var(--sanskrit-serif); }
.pronunciation-browser .phoneme-grid button>span { align-self:center; font:700 24px/1.25 var(--serif); }
.pronunciation-browser .phoneme-grid button>small { margin:0; font-size:15px; }
.phoneme-layout>div>h4:first-child { margin:0 0 12px; line-height:16px; }
.phoneme-layout>.phoneme-detail { margin-top:28px; }
@media(max-width:980px) { .phoneme-layout>.phoneme-detail { margin-top:0; } }
.consonant-phoneme-grid { grid-template-columns:repeat(7,minmax(70px,1fr)); }
.dictionary-reader-layout:has(>.dictionary-result-list:empty) { grid-template-columns:minmax(0,1fr); grid-template-areas:"entry"; max-width:1140px; }
.dictionary-result-list:empty { display:none; }
.dictionary-entry-view { min-width:0; }
.nominal-module-tabs.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.compound-mode-tabs { margin:0; padding:14px 22px; border-bottom:1px solid var(--line); background:var(--wash); }
.compound-mode-tabs[hidden] { display:none; }
.compound-mode-tabs button { min-width:190px; }
.compound-sentence-set dt { font-size:15px; line-height:1.4; }
.compound-sentence-set dd { font-size:18px; line-height:1.55; }
.compound-sentence-set>article>p em { font-size:16px; }
.compound-sentence-set>h4 { font-size:14px; }
.compound-example-grid p,.bahuvrihi-agreement-workup li { font-size:16px; }
.compound-example-grid small { font-size:14px; }
.compound-subcategories { margin-top:28px; }
.compound-subcategories h3 { font:600 32px/1.2 var(--serif); }
.compound-subcategories td { font-size:16px; line-height:1.55; }
.generator-recognition-note { margin:14px 0 0; color:var(--soft); font-size:15px; line-height:1.6; }
select:disabled { opacity:1; color:var(--ink); background:var(--wash); cursor:default; }
.participle-workup-dialog { position:fixed; width:min(1220px,96vw); max-width:96vw; max-height:94dvh; margin:auto; padding:28px; border:1px solid var(--gold); border-radius:22px; color:var(--ink); background:var(--surface-raised); overflow:auto; }
.participle-workup-dialog::backdrop { background:color-mix(in srgb,var(--ink) 55%,transparent); backdrop-filter:blur(3px); }
.participle-workup-dialog .dialog-close { position:absolute; right:14px; top:12px; z-index:2; display:grid; place-items:center; width:42px; height:42px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--surface); color:var(--orange-dark); font-size:28px; cursor:pointer; }
.participle-workup-dialog .participle-workup-heading { padding-right:35px; }
.participle-workup-dialog .participle-workup-heading h2 { margin:5px 0; }
.participle-workup-dialog .participle-workup-heading h2 span { font-size:42px; }
.participle-workup-dialog .participle-workup-heading h2 b { font-size:32px; }
.participle-workup-dialog .reference-card { margin:15px 0 0; padding:16px; }
.participle-workup-dialog .participle-derivation-card { grid-template-columns:160px minmax(0,1fr); gap:16px; }
.participle-workup-dialog .participle-root-summary { position:static; min-height:160px; padding:12px; }
.participle-workup-dialog .participle-derivation-steps li { padding:9px 12px; grid-template-columns:30px minmax(0,1fr); }
.participle-workup-dialog .participle-derivation-steps li div { grid-template-columns:minmax(100px,.8fr) minmax(130px,1.2fr) minmax(130px,1fr); gap:12px; }
.participle-workup-dialog .participle-derivation-steps strong { font-size:19px; }
.participle-workup-dialog .participle-derivation-steps span { font-size:24px; }
.participle-workup-dialog .study-note { font-size:16px; line-height:1.5; margin:0; }
.syntax-jump-bar .syntax-card { border-left:5px solid var(--gold); }
.syntax-detail-stack { display:grid; gap:24px; margin-top:26px; }
.syntax-detail { scroll-margin-top:100px; }
.syntax-detail>h2 { font-size:clamp(28px,3vw,42px); }
.sentence-type-section { margin-top:24px; border-left:5px solid var(--gold); scroll-margin-top:100px; }
.sentence-type-section h3,.sentence-types-intro h3 { margin:0 0 14px; font:600 clamp(27px,3vw,38px)/1.2 var(--serif); }
.sentence-type-section>p,.sentence-types-intro p { font-size:18px; line-height:1.65; }
.sentence-type-section .grammar-pattern-example { display:grid; gap:8px; padding:18px 20px; margin:18px 0; border:1px solid var(--line); border-radius:12px; background:var(--wash); }
.sentence-type-section [lang="sa-Deva"] { font:700 29px/1.55 var(--sanskrit-serif); }
.sentence-type-section [lang="sa-Latn"] { color:var(--orange-dark); font:600 21px/1.5 var(--serif); }
.sentence-type-section .sentence-evidence { font-size:15px; color:var(--soft); }
[data-tab-value="verbal-forms"] .grammar-topic-grid article>span { display:block; font:700 clamp(24px,2.3vw,32px)/1.2 var(--serif); text-transform:none; letter-spacing:0; }
[data-tab-value="verbal-forms"] .grammar-topic-grid h3 { font-size:21px; color:var(--soft); }
.site-footer { min-height:0; }
.site-footer-art { max-height:230px; object-fit:cover; object-position:bottom; }
.site-footer-copy { position:relative; inset:auto; min-height:400px; padding:52px 24px 245px; transform:none; }
.site-footer-copy p { font-size:12px; }
.site-footer-copy small { font-size:16px; }
.footer-study-guides { max-width:900px; font-size:15px; gap:10px 20px; }
.tools-hero h1 { margin:8px 0; font:500 clamp(52px,7vw,100px)/1.1 var(--serif); }

/* Small, additive subject introductions; the existing lesson layouts stay intact. */
.module-tabs.subject-overview-tabs { grid-template-columns:repeat(var(--subject-tab-count),minmax(0,1fr)); }
.module-tabs.subject-overview-tabs.number-tabs { grid-template-columns:repeat(7,minmax(0,1fr)); }
.subject-overview-sections { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
.subject-overview-section { border-top:3px solid var(--gold); padding:24px 0; }
.subject-overview-section h3 { margin:0 0 14px; font:600 clamp(24px,2vw,32px)/1.2 var(--serif); }
.subject-overview-section p { margin:0; color:var(--soft); font-size:19px; line-height:1.65; }
.subject-overview-links { display:flex; flex-wrap:wrap; gap:12px 22px; margin-top:18px; }
.subject-overview-links a,.subject-overview-next a,.subject-overview-example a { min-height:44px; padding:11px 17px; color:var(--orange-dark); font-size:17px; font-weight:700; text-decoration:none; border:1px solid var(--line); border-radius:10px; background:var(--surface-raised); }
.subject-overview-content a:hover,.subject-overview-content a:focus-visible { border-color:var(--orange); background:var(--wash); }
.subject-overview-content a:focus-visible { outline:2px solid var(--orange); outline-offset:3px; }
.subject-overview-example { margin:20px 0 0; padding:20px 24px; border:1px solid var(--line); border-left:4px solid var(--gold); border-radius:12px; background:var(--wash); }
.subject-overview-example-label { color:var(--orange-dark); font-size:13px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.subject-overview-example-text { margin:8px 0 12px; font:600 clamp(23px,2vw,29px)/1.6 var(--serif); white-space:pre-line; overflow-wrap:anywhere; }
.subject-overview-example-text [lang="sa-Deva"] { font-family:var(--sanskrit-serif); font-weight:700; }
.subject-overview-example figcaption:last-child { margin-top:16px; }
.subject-overview-next { margin-top:20px; border-top:1px solid var(--line); padding-top:24px; font-size:20px; }
@media(max-width:1180px) {
  .module-tabs.subject-overview-tabs { grid-template-columns:repeat(var(--subject-tab-count),minmax(140px,1fr)); overflow-x:auto; }
  .module-tabs.subject-overview-tabs.number-tabs { grid-template-columns:repeat(var(--subject-tab-count),minmax(112px,1fr)); }
}
@media(max-width:700px) {
  .subject-overview-sections { grid-template-columns:1fr; gap:0; }
  .subject-overview-section p { font-size:18px; }
  .subject-overview-example { padding:16px; }
}
.tool-hub-label { display:block; margin:20px 0 8px; font-weight:700; }
#tool-hub-search { width:100%; padding:14px 18px; border:1px solid var(--line); border-radius:12px; font-size:18px; color:var(--ink); background:var(--surface-raised); }
.tool-hub-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.tool-hub-card { display:block; padding:24px; border:1px solid var(--line); border-left:5px solid var(--gold); border-radius:16px; color:var(--ink); background:var(--surface-raised); text-decoration:none; }
.tool-hub-card:hover,.tool-hub-card:focus-visible { border-color:var(--orange); background:var(--wash); }
.tool-hub-card>span { color:var(--orange-dark); font-size:13px; font-weight:700; }
.tool-hub-card h3 { margin:8px 0; font:600 27px/1.2 var(--serif); }
.tool-hub-card p { font-size:17px; line-height:1.55; }
.tool-hub-card b { color:var(--orange-dark); }
.morphology-keyboard,.converter-keys { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
.verb-keyboard-group,.dictionary-keyboard-group { display:grid; grid-template-columns:135px minmax(0,1fr); gap:10px; width:100%; align-items:start; min-width:0; }
.verb-keyboard-group>span,.dictionary-keyboard-group>span { width:auto; padding-top:10px; font-size:11px; line-height:1.35; }
.keyboard-key-grid { display:grid; grid-template-columns:repeat(11,minmax(0,1fr)); gap:5px; min-width:0; }
.keyboard-key-grid button { width:100%; min-width:0; min-height:38px; padding:5px 2px; font-size:20px; border:1px solid var(--line); border-radius:7px; background:var(--surface-raised); color:var(--ink); cursor:pointer; }
.keyboard-key-grid button[lang="sa-Deva"] { font-family:var(--sanskrit-serif); }
.keyboard-editing-keys { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.keyboard-editing-keys button { min-height:40px; padding:8px 14px; border:1px solid var(--gold); border-radius:8px; color:var(--orange-dark); background:var(--surface-raised); font-size:16px; font-weight:700; cursor:pointer; }
.keyboard-entry-note { display:block; font-size:14px; line-height:1.6; color:var(--soft); }
.number-full-sanskrit-keyboard { grid-column:1/-1; display:grid; gap:12px; min-width:0; }
.sentence-candidate-overview,.sentence-provider-panel { margin:20px 0; padding:24px; border:1px solid var(--line); border-left:5px solid var(--gold); border-radius:16px; background:var(--surface-raised); }
.sentence-candidate-overview h3,.sentence-provider-panel h3 { margin:0 0 12px; font:600 30px/1.2 var(--serif); }
.sentence-candidate-overview p,.sentence-provider-panel p { font-size:17px; line-height:1.65; }
.sentence-candidate-overview label { display:block; font-weight:700; }
.sentence-candidate-overview select { display:block; width:100%; min-width:0; margin:8px 0; padding:12px; border:1px solid var(--line); border-radius:10px; color:var(--ink); background:var(--surface); font-size:16px; }
.sentence-candidate-overview details { margin-top:16px; }
.sentence-candidate-overview summary { cursor:pointer; font-weight:700; color:var(--orange-dark); }
.sentence-local-evidence { border-top:1px solid var(--line); margin-top:14px; padding-top:10px; }
.sentence-local-evidence p { font-size:15px; line-height:1.6; }
.sentence-provider-panel label { display:flex; align-items:flex-start; gap:10px; margin:18px 0; font-size:17px; }
.sentence-provider-panel input[type="checkbox"] { flex:0 0 auto; width:20px; height:20px; }
.sentence-provider-panel button { padding:12px 18px; border:1px solid var(--orange); border-radius:10px; color:var(--orange-dark); background:var(--wash); font-weight:700; cursor:pointer; }
.sentence-provider-panel button:disabled { opacity:.6; cursor:wait; }
.sentence-provider-table td { font-size:17px; }
@media(max-width:760px) {
  .glossary-controls { grid-template-columns:1fr; }
  .glossary-results { grid-template-columns:1fr; }
  .subject-tabs .glossary-subject-tab { grid-column:1/-1; }
  .subject-tabs .resources-subject-tab { grid-column:1; }
  .glossary-hero>div { max-width:100%; padding-right:0; }
  .glossary-hero-art { opacity:.35; object-position:65% center; }
  .glossary-book-text { display:none; }
  .glossary-browser { grid-template-columns:58px minmax(0,1fr); gap:10px; }
  .glossary-entry>summary { grid-template-columns:minmax(0,1fr) 22px; gap:12px; padding:18px 14px; }
  .glossary-term { grid-column:1; }
  .glossary-term>strong { font-size:25px; }
  .glossary-term>[lang] { font-size:23px; }
  .glossary-definition { grid-column:1; font-size:17px; }
  .glossary-arrow { grid-column:2; grid-row:1/3; }
  .glossary-entry-body { padding:10px 14px 18px; }
  .glossary-entry nav a { max-width:100%; overflow-wrap:anywhere; }
  .pronunciation-browser .phoneme-grid,.pronunciation-browser .consonant-phoneme-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .pronunciation-browser .phoneme-grid button { padding:12px 8px; grid-template-columns:minmax(0,1fr); gap:2px; }
  .pronunciation-browser .phoneme-grid button>b { font-size:32px; }
  .pronunciation-browser .phoneme-grid button>span { font-size:22px; }
  .pronunciation-browser .phoneme-grid button>small { font-size:13px; }
  .tool-hub-grid { grid-template-columns:1fr; }
  .verb-keyboard-group,.dictionary-keyboard-group { grid-template-columns:minmax(0,1fr); }
  .keyboard-key-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .converter-keys { display:grid; }
  .keyboard .dev-keys { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .nominal-module-tabs.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .compound-mode-tabs button { min-width:0; }
  .compound-sentence-set>article { grid-template-columns:1fr; }
  .compound-sentence-set dl { border-left:0; }
  .compound-sentence-set dl>div { padding:5px 8px; }
  .participle-workup-dialog { padding:24px 14px 14px; }
  .participle-workup-dialog .participle-derivation-card { grid-template-columns:1fr; }
  .participle-workup-dialog .participle-root-summary { display:none; }
  .participle-workup-dialog .participle-derivation-steps li div { grid-template-columns:1fr; gap:4px; }
  .participle-workup-dialog .study-note { grid-column:1; }
  .site-footer-copy { min-height:0; padding:40px 18px 180px; }
  .site-footer-art { max-height:180px; }
  .site-footer-brand { gap:8px; }
  .site-footer-brand strong { font-size:21px; }
}
