/* ==========================================================================
   UECF.NET — Matthew Henry Bible Commentary (web edition)
   Visual language shared with the UECF.NET NKJV Chronological Study Bible
   and KJV Study Bible: ink / gold / maroon / cream, Fraunces + Source Sans 3
   for the interface, Merriweather for the commentary itself.
   ========================================================================== */

:root{
  --ink:#101B31;
  --ink-soft:#2C3E60;
  --gold:#C79A3D;
  --gold-soft:#E4C685;
  --maroon:#8B3A42;
  --teal:#2F5D62;
  --cream:#FAF6EC;
  --cream-dim:#F0E7D5;
  --line:#E2D8C0;

  --font-display:'Fraunces', 'Noto Serif Telugu', Georgia, 'Times New Roman', serif;
  --font-body:'Source Sans 3', 'Noto Sans Telugu', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-commentary:'Merriweather', 'Noto Serif Telugu', Georgia, 'Times New Roman', serif;

  --bg:var(--cream);
  --bg-panel:#ffffff;
  --bg-panel-alt:var(--cream-dim);
  --text:var(--ink);
  --text-soft:var(--ink-soft);
  --border:var(--line);
  --accent:var(--maroon);
  --accent-soft:var(--gold);
  --link:var(--maroon);
  --highlight-bg:#FCEFC7;
  --note-bg:#F6EEDC;
  --note-border:#D9C69A;
  --outline-bg:#F3F0E6;
  --shadow:0 10px 30px rgba(16,27,49,.14);

  --commentary-size:1.06rem;
  --commentary-line:1.85;
}

:root[data-theme="dark"]{
  --bg:#0B1220; --bg-panel:#141F35; --bg-panel-alt:#101A2E;
  --text:#EAEAF2; --text-soft:#B9C2D8; --border:#2B3A5A;
  --accent:#E0A96D; --accent-soft:#C79A3D; --link:#E8B86D;
  --highlight-bg:#3A331A; --note-bg:#1B2338; --note-border:#4A4A2E;
  --outline-bg:#182035; --shadow:0 10px 30px rgba(0,0,0,.45);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0B1220; --bg-panel:#141F35; --bg-panel-alt:#101A2E;
    --text:#EAEAF2; --text-soft:#B9C2D8; --border:#2B3A5A;
    --accent:#E0A96D; --accent-soft:#C79A3D; --link:#E8B86D;
    --highlight-bg:#3A331A; --note-bg:#1B2338; --note-border:#4A4A2E;
    --outline-bg:#182035; --shadow:0 10px 30px rgba(0,0,0,.45);
  }
}

@font-face{font-family:'Noto Sans Telugu'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/NotoSansTelugu-Regular.woff2') format('woff2');}
@font-face{font-family:'Noto Sans Telugu'; font-style:normal; font-weight:700; font-display:swap;
  src:url('../fonts/NotoSansTelugu-Bold.woff2') format('woff2');}
@font-face{font-family:'Noto Serif Telugu'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/NotoSerifTelugu-Regular.woff2') format('woff2');}
@font-face{font-family:'Noto Serif Telugu'; font-style:normal; font-weight:700; font-display:swap;
  src:url('../fonts/NotoSerifTelugu-Bold.woff2') format('woff2');}

*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html{-webkit-text-size-adjust:100%; scroll-behavior:smooth;}
@media (prefers-reduced-motion:reduce){ html{scroll-behavior:auto;} *{transition:none!important;} }
body{margin:0; font-family:var(--font-body); color:var(--text); background:var(--bg); line-height:1.5;}
h1,h2,h3,h4{font-family:var(--font-display); color:var(--text); margin:0 0 .5em; line-height:1.25;}
a{color:var(--link); text-decoration:none;}
a:hover{text-decoration:underline;}
button,select,input{font-family:inherit;}
img{max-width:100%; height:auto;}
hr{border:0; border-top:1px solid var(--border); margin:26px 0;}

.sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}
.skip-link{position:absolute; left:-999px; top:0; background:var(--gold); color:var(--ink);
  padding:10px 16px; z-index:200; font-weight:700; border-radius:0 0 6px 0;}
.skip-link:focus{left:0;}
:focus-visible{outline:3px solid var(--gold); outline-offset:2px; border-radius:3px;}

/* ---------- Header (tablet / desktop) ---------- */
.mh-header{background:var(--ink); color:var(--cream); border-bottom:3px solid var(--gold);}
:root[data-theme="dark"] .mh-header{background:#0B1220;}
.mh-header-inner{max-width:1400px; margin:0 auto; padding:10px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;}
.mh-brand{display:flex; align-items:center; gap:12px; color:var(--cream);}
.mh-brand:hover{text-decoration:none;}
.mh-brand img{border-radius:6px; display:block;}
.mh-brand-text{display:flex; flex-direction:column; line-height:1.25;}
.mh-brand-text strong{font-family:var(--font-display); font-size:1.05rem; color:var(--cream);}
.mh-brand-text small{font-size:.72rem; letter-spacing:.08em; text-transform:uppercase;
  color:var(--gold-soft); font-weight:700;}
.mh-header-nav{display:flex; align-items:center; gap:4px;}
.mh-header-nav a{color:var(--cream); font-size:.9rem; font-weight:600; padding:8px 12px; border-radius:4px;}
.mh-header-nav a:hover{background:rgba(228,198,133,.15); color:var(--gold-soft); text-decoration:none;}

.mh-menu{position:relative;}
.mh-menu-trigger{background:none; border:none; color:var(--cream); font-size:.9rem; font-weight:600;
  padding:8px 12px; border-radius:4px; cursor:pointer;}
.mh-menu-trigger:hover{background:rgba(228,198,133,.15); color:var(--gold-soft);}
.mh-menu-drop{display:none; position:absolute; right:0; top:calc(100% + 6px); background:var(--bg-panel);
  border:1px solid var(--border); border-radius:8px; padding:6px; min-width:250px;
  box-shadow:var(--shadow); z-index:80;}
.mh-menu-drop.show{display:block;}
.mh-menu-drop a{display:block; padding:9px 12px; border-radius:5px; color:var(--text);
  font-size:.88rem; font-weight:500;}
.mh-menu-drop a:hover{background:var(--bg-panel-alt); text-decoration:none; color:var(--accent);}

/* ---------- Mobile top bar ---------- */
.mh-mtop{display:none; position:sticky; top:0; z-index:75; background:var(--ink); color:var(--cream);
  align-items:center; gap:10px; padding:10px 14px; padding-top:calc(10px + env(safe-area-inset-top));
  border-bottom:2px solid var(--gold);}
:root[data-theme="dark"] .mh-mtop{background:#0B1220;}
.mh-mtop-btn{width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,.08);
  border:1px solid rgba(228,198,133,.4); color:var(--cream); display:flex; align-items:center;
  justify-content:center; font-size:1rem; flex:0 0 auto; cursor:pointer; text-decoration:none;}
.mh-mtop-title{flex:1 1 auto; min-width:0; text-align:center;}
.mh-mtop-title strong{font-family:var(--font-display); font-size:.95rem; display:block;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--cream);}

/* ---------- Toolbar ---------- */
.mh-toolbar{position:sticky; top:0; z-index:70; background:var(--bg-panel);
  border-bottom:1px solid var(--border); box-shadow:0 2px 10px rgba(16,27,49,.06);}
.mh-toolbar-inner{max-width:1400px; margin:0 auto; padding:10px 20px;
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;}
.mh-select,.mh-input,.mh-btn{border:1px solid var(--border); background:var(--bg); color:var(--text);
  border-radius:7px; padding:8px 11px; font-size:.9rem;}
.mh-select{max-width:190px; cursor:pointer;}
.mh-btn{cursor:pointer; font-weight:600; white-space:nowrap;}
.mh-btn:hover{background:var(--bg-panel-alt); border-color:var(--accent-soft);}
.mh-btn[aria-pressed="true"]{background:var(--gold); border-color:var(--gold); color:var(--ink);}
.mh-group{display:flex; align-items:center; gap:6px;}
.mh-search-btn{flex:1 1 260px; min-width:200px; text-align:left; color:var(--text-soft);
  cursor:pointer; display:flex; align-items:center; gap:8px;}
.mh-search-btn kbd{margin-left:auto; font-size:.7rem; border:1px solid var(--border);
  border-radius:4px; padding:1px 5px; font-family:var(--font-body);}
.mh-sheet-handle{display:none;}
.mh-sheet-backdrop{display:none;}

/* ---------- Layout ---------- */
.mh-layout{max-width:1400px; margin:0 auto; padding:20px; display:grid;
  grid-template-columns:290px minmax(0,1fr); gap:26px; align-items:start;}
.mh-side{position:sticky; top:78px; max-height:calc(100vh - 96px); overflow-y:auto;
  background:var(--bg-panel); border:1px solid var(--border); border-radius:12px; padding:14px;}
.mh-side h2{font-size:.78rem; letter-spacing:.09em; text-transform:uppercase;
  color:var(--text-soft); margin:14px 0 8px;}
.mh-side h2:first-of-type{margin-top:4px;}
.mh-side-tabs{display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:10px;}
.mh-side-tabs button{flex:1; background:none; border:none; border-bottom:3px solid transparent;
  padding:8px 4px; font-size:.82rem; font-weight:700; color:var(--text-soft); cursor:pointer;}
.mh-side-tabs button.active{color:var(--accent); border-bottom-color:var(--gold);}
.mh-book-list{display:flex; flex-direction:column; gap:1px;}
.mh-book-list a{padding:6px 9px; border-radius:5px; font-size:.9rem; color:var(--text);
  display:flex; justify-content:space-between; gap:8px;}
.mh-book-list a:hover{background:var(--bg-panel-alt); text-decoration:none; color:var(--accent);}
.mh-book-list a.active{background:var(--gold); color:var(--ink); font-weight:700;}
.mh-book-list a .n{font-size:.74rem; color:var(--text-soft); font-variant-numeric:tabular-nums;}
.mh-book-list a.active .n{color:var(--ink);}
.mh-group-label{font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; font-weight:700;
  color:var(--accent-soft); margin:12px 0 4px; padding-left:9px;}
.mh-chapter-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(42px,1fr)); gap:5px;}
.mh-chapter-grid a{display:flex; align-items:center; justify-content:center; padding:8px 2px;
  border:1px solid var(--border); border-radius:6px; font-size:.85rem; font-weight:600;
  color:var(--text); background:var(--bg); font-variant-numeric:tabular-nums;}
.mh-chapter-grid a:hover{background:var(--bg-panel-alt); border-color:var(--accent-soft); text-decoration:none;}
.mh-chapter-grid a.active{background:var(--accent); border-color:var(--accent); color:#fff;}
.mh-side-links a{display:block; padding:8px 9px; border-radius:5px; font-size:.88rem; color:var(--text);}
.mh-side-links a:hover{background:var(--bg-panel-alt); color:var(--accent); text-decoration:none;}

/* ---------- Main column ---------- */
.mh-main{min-width:0;}
.mh-crumbs{font-size:.76rem; letter-spacing:.09em; text-transform:uppercase; font-weight:700;
  color:var(--text-soft); margin:0 0 6px;}
.mh-crumbs a{color:var(--text-soft);}
.mh-chapter-head{border-bottom:2px solid var(--gold); padding-bottom:14px; margin-bottom:18px;}
.mh-chapter-head h1{font-size:clamp(1.6rem,3.4vw,2.25rem); margin:0 0 4px;}
.mh-chapter-head .mh-sub{color:var(--text-soft); font-size:.92rem; margin:0;}
.mh-head-actions{display:flex; flex-wrap:wrap; gap:6px; margin-top:12px;}

.mh-chapter-nav{display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin:18px 0; padding:10px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border);}
.mh-chapter-nav .mid{font-size:.85rem; color:var(--text-soft); text-align:center; flex:1 1 auto;}
.mh-chapter-nav .mh-btn{flex:0 0 auto;}

/* Book intro + chapter outline cards */
.mh-card{background:var(--note-bg); border:1px solid var(--note-border); border-left:4px solid var(--gold);
  border-radius:10px; padding:16px 18px; margin:0 0 22px;}
:root[data-theme="dark"] .mh-card{background:var(--bg-panel-alt);}
.mh-card h2{font-size:.78rem; letter-spacing:.1em; text-transform:uppercase; color:var(--accent);
  margin:0 0 10px;}
.mh-card p{margin:0 0 10px; font-family:var(--font-commentary); font-size:.97rem; line-height:1.75;}
.mh-card p:last-child{margin-bottom:0;}
.mh-outline{list-style:none; margin:0; padding:0; counter-reset:o;}
.mh-outline li{margin:0 0 6px; padding-left:2px; font-size:.95rem;}
.mh-outline li:last-child{margin-bottom:0;}
.mh-outline a{color:var(--text); display:flex; gap:10px; align-items:baseline; padding:4px 6px;
  border-radius:5px;}
.mh-outline a:hover{background:rgba(199,154,61,.16); text-decoration:none; color:var(--accent);}
.mh-outline .vs{flex:0 0 auto; font-size:.76rem; font-weight:700; color:var(--accent);
  background:var(--bg-panel); border:1px solid var(--note-border); border-radius:20px;
  padding:2px 9px; font-variant-numeric:tabular-nums; min-width:56px; text-align:center;}

/* ---------- Commentary sections ---------- */
.mh-commentary{font-family:var(--font-commentary); font-size:var(--commentary-size);
  line-height:var(--commentary-line);}
.mh-section{padding:2px 0 6px; margin:0 0 26px; scroll-margin-top:150px;}
.mh-section + .mh-section{border-top:1px dashed var(--border); padding-top:20px;}
.mh-section:target,.mh-section.mh-flash{background:var(--highlight-bg); border-radius:10px;
  box-shadow:0 0 0 12px var(--highlight-bg); transition:background .4s, box-shadow .4s;}
.mh-sec-head{display:flex; flex-wrap:wrap; align-items:baseline; gap:10px; margin:0 0 10px;}
.mh-sec-ref{font-family:var(--font-display); font-size:1.12rem; font-weight:700; color:var(--accent);
  margin:0;}
.mh-sec-title{font-family:var(--font-body); font-size:.94rem; font-weight:600; color:var(--text-soft);
  font-style:italic;}
.mh-sec-tools{margin-left:auto; display:flex; gap:4px; opacity:0; transition:opacity .18s;}
.mh-section:hover .mh-sec-tools,.mh-section:focus-within .mh-sec-tools{opacity:1;}
@media (hover:none){ .mh-sec-tools{opacity:1;} }
.mh-mini{border:1px solid var(--border); background:var(--bg-panel); color:var(--text-soft);
  border-radius:6px; padding:3px 8px; font-size:.74rem; font-weight:600; cursor:pointer;}
.mh-mini:hover{background:var(--bg-panel-alt); color:var(--accent); border-color:var(--accent-soft);}
.mh-mini[aria-pressed="true"]{background:var(--gold); color:var(--ink); border-color:var(--gold);}
.mh-commentary p{margin:0 0 1.05em;}
.mh-commentary p:last-child{margin-bottom:0;}
.mh-ref-link{color:var(--link); border-bottom:1px dotted var(--accent-soft); white-space:nowrap;}
.mh-ref-link:hover{text-decoration:none; background:var(--highlight-bg);}

.mh-src{font-size:.74rem; color:var(--text-soft); font-family:var(--font-body); font-style:normal;
  opacity:.75;}

/* ---------- Bookmarks ---------- */
.mh-bm-list{display:flex; flex-direction:column; gap:4px;}
.mh-bm{display:flex; align-items:center; gap:8px; padding:7px 9px; border:1px solid var(--border);
  border-radius:7px; background:var(--bg);}
.mh-bm a{flex:1 1 auto; font-size:.88rem; color:var(--text); min-width:0;}
.mh-bm a small{display:block; color:var(--text-soft); font-size:.75rem; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis;}
.mh-bm button{background:none; border:none; color:var(--text-soft); cursor:pointer; font-size:.95rem;
  padding:2px 4px;}
.mh-bm button:hover{color:var(--accent);}
.mh-empty{font-size:.86rem; color:var(--text-soft); font-style:italic; padding:6px 2px;}

/* ---------- Search modal ---------- */
.mh-modal{position:fixed; inset:0; z-index:150; background:rgba(16,27,49,.55);
  display:flex; align-items:flex-start; justify-content:center; padding:6vh 16px 16px;
  backdrop-filter:blur(2px);}
.mh-modal[hidden]{display:none;}
.mh-modal-panel{background:var(--bg-panel); border:1px solid var(--border); border-radius:14px;
  width:min(820px,100%); max-height:86vh; display:flex; flex-direction:column; overflow:hidden;
  box-shadow:var(--shadow);}
.mh-modal-field{display:flex; align-items:center; gap:10px; padding:14px 16px;
  border-bottom:1px solid var(--border);}
.mh-modal-field input{flex:1 1 auto; border:none; background:none; color:var(--text);
  font-size:1.05rem; padding:6px 0; outline:none;}
.mh-modal-status{display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:9px 16px;
  border-bottom:1px solid var(--border); background:var(--bg-panel-alt); font-size:.8rem;
  color:var(--text-soft);}
.mh-filters{display:flex; flex-wrap:wrap; gap:4px; margin-left:auto;}
.mh-filters button{border:1px solid var(--border); background:var(--bg-panel); color:var(--text-soft);
  border-radius:20px; padding:3px 11px; font-size:.76rem; font-weight:600; cursor:pointer;}
.mh-filters button[aria-pressed="true"]{background:var(--accent); border-color:var(--accent); color:#fff;}
.mh-results{list-style:none; margin:0; padding:6px; overflow-y:auto; flex:1 1 auto;}
.mh-results li{border-radius:9px;}
.mh-results a{display:block; padding:11px 13px; border-radius:9px; color:var(--text);}
.mh-results a:hover,.mh-results a:focus{background:var(--bg-panel-alt); text-decoration:none;}
.mh-results .r-ref{font-family:var(--font-display); font-weight:700; color:var(--accent); font-size:.98rem;}
.mh-results .r-title{font-size:.82rem; color:var(--text-soft); font-style:italic; margin-left:8px;}
.mh-results .r-ex{display:block; font-family:var(--font-commentary); font-size:.87rem;
  color:var(--text-soft); margin-top:4px; line-height:1.6;}
.mh-results mark{background:var(--highlight-bg); color:inherit; border-radius:3px; padding:0 2px;}
:root[data-theme="dark"] .mh-results mark{color:var(--gold-soft);}

/* ---------- Toast ---------- */
.mh-toast{position:fixed; left:50%; bottom:26px; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:var(--cream); padding:11px 20px; border-radius:24px; font-size:.88rem;
  font-weight:600; opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:300;
  border:1px solid var(--gold);}
.mh-toast.show{opacity:1; transform:translateX(-50%) translateY(0);}

.mh-to-top{position:fixed; right:18px; bottom:22px; width:44px; height:44px; border-radius:50%;
  border:1px solid var(--border); background:var(--bg-panel); color:var(--accent); font-size:1.1rem;
  cursor:pointer; box-shadow:var(--shadow); opacity:0; pointer-events:none; transition:opacity .2s; z-index:60;}
.mh-to-top.show{opacity:1; pointer-events:auto;}

/* ---------- Bottom nav (phones) ---------- */
.mh-bottom-nav{display:none;}

/* ---------- Footer ---------- */
.mh-footer{background:var(--ink); color:var(--cream); margin-top:40px; padding:26px 20px;
  border-top:3px solid var(--gold); text-align:center; font-size:.86rem;}
:root[data-theme="dark"] .mh-footer{background:#0B1220;}
.mh-footer p{margin:0 0 8px; color:#D8D2C4;}
.mh-footer a{color:var(--gold-soft);}
.mh-footer strong{color:var(--cream); font-family:var(--font-display);}
.mh-footer-note{font-size:.78rem; opacity:.75; max-width:760px; margin:12px auto 0;}

/* ---------- Static content pages ---------- */
.mh-page{max-width:820px; margin:0 auto; padding:28px 20px 10px;}
.mh-page h1{font-size:clamp(1.7rem,4vw,2.4rem); border-bottom:2px solid var(--gold);
  padding-bottom:12px; margin-bottom:6px;}
.mh-page h2{font-size:1.28rem; color:var(--accent); margin-top:34px;}
.mh-page h3{font-size:1.03rem; margin-top:22px;}
.mh-page p,.mh-page li{font-family:var(--font-commentary); font-size:1rem; line-height:1.8;}
.mh-page ul,.mh-page ol{padding-left:22px;}
.mh-page li{margin-bottom:8px;}
.mh-page .lede{font-size:1.08rem; color:var(--text-soft);}
.mh-page table{width:100%; border-collapse:collapse; margin:16px 0; font-family:var(--font-body);
  font-size:.9rem;}
.mh-page th,.mh-page td{border:1px solid var(--border); padding:9px 11px; text-align:left;}
.mh-page th{background:var(--bg-panel-alt); font-weight:700;}
.mh-note{background:var(--note-bg); border:1px solid var(--note-border); border-left:4px solid var(--gold);
  border-radius:10px; padding:14px 18px; margin:20px 0;}
:root[data-theme="dark"] .mh-note{background:var(--bg-panel-alt);}
.mh-note p{margin:0 0 8px; font-size:.95rem;}
.mh-note p:last-child{margin-bottom:0;}
.mh-stats{display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin:20px 0;}
.mh-stat{background:var(--bg-panel); border:1px solid var(--border); border-radius:10px;
  padding:14px; text-align:center;}
.mh-stat strong{display:block; font-family:var(--font-display); font-size:1.6rem; color:var(--accent);}
.mh-stat span{font-size:.76rem; letter-spacing:.08em; text-transform:uppercase; color:var(--text-soft);
  font-weight:700;}

/* ---------- Home / contents view ---------- */
.mh-hero{background:linear-gradient(135deg,var(--ink) 0%,#1E3050 55%,var(--teal) 130%);
  color:var(--cream); border-radius:14px; padding:34px 30px; margin-bottom:24px;
  border:1px solid var(--border);}
.mh-hero h1{color:var(--cream); font-size:clamp(1.7rem,4vw,2.5rem); margin-bottom:8px;}
.mh-hero p{margin:0 0 6px; color:#E8E2D4; max-width:70ch;}
.mh-hero .mh-kicker{font-size:.76rem; letter-spacing:.14em; text-transform:uppercase;
  color:var(--gold-soft); font-weight:700; margin-bottom:10px;}
.mh-hero-actions{display:flex; flex-wrap:wrap; gap:8px; margin-top:18px;}
.mh-hero-actions .mh-btn{background:var(--gold); border-color:var(--gold); color:var(--ink);}
.mh-hero-actions .mh-btn.ghost{background:transparent; color:var(--cream); border-color:rgba(228,198,133,.6);}
.mh-testament{margin-bottom:26px;}
.mh-testament > h2{font-size:1.2rem; border-bottom:2px solid var(--gold); padding-bottom:8px;}
.mh-bookgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:8px;
  margin-bottom:16px;}
.mh-bookgrid a{display:flex; justify-content:space-between; align-items:center; gap:8px;
  background:var(--bg-panel); border:1px solid var(--border); border-radius:9px; padding:11px 13px;
  color:var(--text); font-weight:600; font-size:.94rem;}
.mh-bookgrid a:hover{border-color:var(--gold); background:var(--bg-panel-alt); text-decoration:none;
  color:var(--accent); transform:translateY(-1px);}
.mh-bookgrid a small{color:var(--text-soft); font-weight:600; font-size:.74rem;
  font-variant-numeric:tabular-nums;}

/* ---------- Responsive ---------- */
@media (max-width:1080px){
  .mh-layout{grid-template-columns:250px minmax(0,1fr); gap:20px;}
}
@media (max-width:860px){
  .mh-header{display:none;}
  .mh-mtop{display:flex;}
  .mh-layout{display:block; padding:14px;}
  .mh-side{position:fixed; inset:auto 0 0 0; top:auto; max-height:78vh; z-index:120;
    border-radius:16px 16px 0 0; transform:translateY(102%); transition:transform .26s ease;
    box-shadow:var(--shadow); padding-bottom:calc(20px + env(safe-area-inset-bottom));}
  .mh-side.open{transform:translateY(0);}
  .mh-sheet-backdrop{display:block; position:fixed; inset:0; background:rgba(16,27,49,.5); z-index:110;
    opacity:0; pointer-events:none; transition:opacity .22s;}
  .mh-sheet-backdrop.show{opacity:1; pointer-events:auto;}
  .mh-toolbar{position:static;}
  .mh-toolbar-inner{padding:10px 14px;}
  .mh-select{max-width:none; flex:1 1 130px;}
  .mh-toolbar .mh-desktop-only{display:none;}
  .mh-main{padding-bottom:74px;}
  .mh-bottom-nav{display:flex; position:fixed; left:0; right:0; bottom:0; z-index:100;
    background:var(--bg-panel); border-top:1px solid var(--border);
    padding-bottom:env(safe-area-inset-bottom);}
  .mh-bn-btn{flex:1; background:none; border:none; color:var(--text-soft); font-size:.66rem;
    font-weight:700; padding:8px 2px 7px; cursor:pointer; display:flex; flex-direction:column;
    align-items:center; gap:2px; text-decoration:none;}
  .mh-bn-btn .ic{font-size:1.15rem; line-height:1;}
  .mh-bn-btn:hover{color:var(--accent); text-decoration:none;}
  .mh-to-top{bottom:74px; right:14px;}
  .mh-sheet-handle{display:block; width:40px; height:4px; border-radius:3px; background:var(--border);
    margin:2px auto 10px;}
  .mh-modal{padding:0;}
  .mh-modal-panel{max-height:100vh; height:100%; border-radius:0; width:100%;}
}
@media (max-width:520px){
  :root{--commentary-size:1.02rem; --commentary-line:1.8;}
  .mh-page{padding:20px 15px 10px;}
  .mh-hero{padding:24px 20px;}
  .mh-bookgrid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));}
  .mh-sec-head{gap:6px;}
  .mh-sec-tools{margin-left:0; width:100%;}
}

/* ---------- Bilingual: language switcher, per-section English reveal ---------- */
.mh-lang-switch{display:flex; border:1px solid var(--border); border-radius:20px; overflow:hidden;
  background:var(--bg);}
.mh-lang-switch button{border:none; background:none; color:var(--text-soft); font-weight:700;
  font-size:.82rem; padding:7px 13px; cursor:pointer;}
.mh-lang-switch button[aria-pressed="true"]{background:var(--gold); color:var(--ink);}
.mh-lang-switch button:hover{color:var(--accent);}
.mh-lang-switch button[aria-pressed="true"]:hover{color:var(--ink);}

.mh-not-translated{background:var(--note-bg); border:1px solid var(--note-border);
  border-left:4px solid var(--maroon); border-radius:10px; padding:12px 16px; margin:0 0 18px;
  font-size:.92rem; color:var(--text-soft);}
:root[data-theme="dark"] .mh-not-translated{background:var(--bg-panel-alt);}
.mh-not-translated strong{color:var(--text);}

.mh-te-badge{font-size:.66rem; font-weight:700; letter-spacing:.04em; padding:1px 7px;
  border-radius:20px; background:var(--teal); color:#fff; white-space:nowrap;}
.mh-en-badge{font-size:.66rem; font-weight:700; letter-spacing:.04em; padding:1px 7px;
  border-radius:20px; background:var(--text-soft); color:var(--bg); white-space:nowrap; opacity:.8;}
.mh-bookgrid a .mh-badges{display:flex; gap:4px; flex-direction:column; align-items:flex-end;}

.mh-orig-toggle{border:1px solid var(--accent-soft); background:var(--bg-panel); color:var(--accent);
  border-radius:6px; padding:3px 10px; font-size:.74rem; font-weight:700; cursor:pointer;}
.mh-orig-toggle:hover{background:var(--gold); color:var(--ink); border-color:var(--gold);}
.mh-orig-toggle[aria-pressed="true"]{background:var(--ink); color:var(--cream); border-color:var(--ink);}
.mh-orig-block{margin-top:14px; padding:12px 16px; background:var(--bg-panel-alt);
  border:1px dashed var(--border); border-radius:10px;}
.mh-orig-block .mh-orig-label{display:block; font-size:.7rem; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--text-soft); margin-bottom:8px;}
.mh-orig-block[hidden]{display:none;}
.mh-orig-block .mh-commentary{font-family:var(--font-commentary); font-style:normal;}

[lang="te"], .mh-te-text{font-family:var(--font-te-body,var(--font-body));}
.mh-commentary[lang="te"], .mh-card .mh-commentary[lang="te"]{font-family:var(--font-te-serif,var(--font-commentary));}
h1[lang="te"],h2[lang="te"],h3[lang="te"]{font-family:var(--font-te-serif,var(--font-display));}

/* ---------- Print ---------- */
@media print{
  .mh-header,.mh-mtop,.mh-toolbar,.mh-side,.mh-bottom-nav,.mh-to-top,.mh-chapter-nav,
  .mh-sec-tools,.mh-head-actions,.mh-modal,.mh-sheet-backdrop,.skip-link{display:none!important;}
  body{background:#fff; color:#000;}
  .mh-layout{display:block; max-width:none; padding:0;}
  .mh-commentary{font-size:11.5pt; line-height:1.55;}
  .mh-section{break-inside:avoid; border-top:none;}
  .mh-footer{background:none; color:#000; border-top:1px solid #999;}
  .mh-footer a{color:#000;}
  a[href]:after{content:"";}
}
