/* =========================================================================
   Sumjho — single consolidated stylesheet.
   Structure: shared base (vars, resets, primitives) → per-page sections,
   each scoped under body.<page> so identically-named selectors
   (.page-header, .logo, .menu-*, .poem-row ...) never collide across pages.
   Shared chrome (breadcrumb / footer / utility corner) is global.
   ========================================================================= */

/* ---------- shared base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #101010; --surface: #14201a; --text: #ffffff;
  --text-soft: #a8a8a0; --text-faint: #5c5c54;
  --accent: #5c8a6e; --divider: #2a3530; --accent-text: #ffffff;
  --header-scrolled-bg: #0a1410;
  --bg-2: var(--surface); --bg-3: var(--surface); --text-mid: var(--text-soft);
  --accent-soft: rgba(92,138,110,0.18); --accent-glow: rgba(92,138,110,0.45);
  --green-bright: var(--accent); --active-misra-bg: var(--bg); --active-misra: var(--accent);
  --border: var(--divider); --border-mid: var(--divider);
}
[data-theme="light"] {
  --bg: #f5f1e8; --surface: #ffffff; --text: #1a1a1a;
  --text-soft: #5c5c54; --text-faint: #a8a8a0;
  --accent: #4a7559; --divider: #d8d2c4; --accent-text: #ffffff;
  --header-scrolled-bg: #ffffff;
  --bg-2: var(--surface); --bg-3: var(--surface); --text-mid: var(--text-soft);
  --accent-soft: rgba(74,117,89,0.14); --accent-glow: rgba(74,117,89,0.40);
  --green-bright: var(--accent); --active-misra-bg: var(--bg); --active-misra: var(--accent);
  --border: var(--divider); --border-mid: var(--divider);
}

/* per-page content width (was a divergent :root value) */
body.support       { --chrome-content-width: 560px; }
body.reading-room  { --chrome-content-width: 980px; }

html, body {
  background: var(--bg); color: var(--text);
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  font-feature-settings: "kern";
}
body { overflow-x: hidden; }
.urdu, .ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-feature-settings: "liga","calt"; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a { color: inherit; }
.logo { display: block; }
.menu-banner-logo { display: inline-block; }
.logo-light { display: none; }
[data-theme="light"] .logo-dark  { display: none; }
[data-theme="light"] .logo-light { display: block; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }


/* ================= reading room (scoped under body.reading-room) ================= */
body.reading-room .page-header {
  position: sticky; top: 0; z-index: 20;
  height: 180px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 22px 24px 0;
  background: var(--header-scrolled-bg);
  border-bottom: 1px solid transparent;
  overflow: hidden;
  transition: height 220ms ease, padding 220ms ease,
              border-color 220ms ease;}
body.reading-room .page-header.scrolled {
  height: 64px;
  padding: 8px 24px 0;
  border-bottom-color: var(--divider);}
body.reading-room .logo-link {
  grid-column: 2;
  display: inline-flex;
  justify-self: center;
  line-height: 0;
  text-decoration: none;
  transform-origin: top center;
  transition: transform 220ms ease;}
body.reading-room .page-header.scrolled .logo-link {
  transform: scale(0.357);   /* 50/140 — fits cleanly into shrunk header */}
body.reading-room .logo {
  height: 140px;
  width: auto;}
body.reading-room .menu-btn {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  margin-top: 4px;
  background: var(--surface);
  border: none;
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  transition: background 0.15s;}
body.reading-room .menu-btn:hover { background: var(--divider);}
body.reading-room .poem-bar {
  position: sticky; top: 64px; z-index: 10;
  background: var(--bg);
  padding: 0;
  margin-top: 6px;}
body.reading-room .poem-bar-inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--divider);}
body.reading-room .title-row {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  line-height: 1.3;}
body.reading-room .title-ur {
  font-size: 26px;
  color: var(--text);
  line-height: 1.4;}
body.reading-room .title-en {
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text-soft);}
body.reading-room .love-save-row {
  margin-top: 12px;
  display: flex; justify-content: center; align-items: center; gap: 14px;}
body.reading-room .ls-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0;       /* quiet inline — no chip/box */
  -webkit-appearance: none; appearance: none;
  color: var(--text-soft); font-size: 13px; line-height: 1;
  cursor: pointer;
  transition: color 0.15s;}
body.reading-room .ls-btn:hover { color: var(--text);}
body.reading-room .ls-btn.active { color: var(--accent);}
body.reading-room .ls-btn.active .ls-icon { fill: currentColor;}
body.reading-room .ls-icon { width: 17px; height: 17px;}
body.reading-room .ls-sep { color: var(--text-faint); font-size: 12px; line-height: 1;}
body.reading-room .listen-row {
  margin-top: 10px;
  display: flex; justify-content: center; align-items: center;
  gap: 14px; flex-wrap: wrap;}
body.reading-room .listen-row .sep { color: var(--text-faint); font-size: 12px; line-height: 1;}
body.reading-room .reciter-credit {
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.02em;}
body.reading-room .lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  background: none;
  border: none;
  padding: 2px 4px;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.15s;}
body.reading-room .lang-toggle:hover, body.reading-room .lang-toggle:focus-visible { color: var(--text); outline: none;}
body.reading-room .lang-toggle .switch {
  position: relative;
  box-sizing: border-box;
  display: inline-block;
  width: 24px;
  height: 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--divider);
  transition: background 150ms ease, border-color 150ms ease;}
body.reading-room .lang-toggle .switch::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 150ms ease, background 150ms ease;}
body.reading-room .lang-toggle[aria-pressed="true"] .switch {
  background: var(--accent);
  border-color: var(--accent);}
body.reading-room .lang-toggle[aria-pressed="true"] .switch::after {
  transform: translateX(12px);
  background: var(--accent-text);}
body.reading-room .lang-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;}
body.reading-room .lang-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px 6px;
  color: var(--text-soft);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s;}
body.reading-room .lang-menu-trigger:hover, body.reading-room .lang-menu-trigger:focus-visible, body.reading-room .lang-menu-trigger[aria-expanded="true"] { color: var(--text); outline: none;}
body.reading-room .lang-menu-trigger .ti-language { display: block;}
body.reading-room .lang-menu-trigger .ti-chevron-down { display: block;}
body.reading-room .lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: #1a1f1c;
  border: 0.5px solid #2a2824;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  z-index: 100;}
body.reading-room .lang-menu[hidden] { display: none;}
body.reading-room .lang-menu .lang-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  margin: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-mid);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;}
body.reading-room .lang-menu .lang-menu-row:hover, body.reading-room .lang-menu .lang-menu-row:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;}
body.reading-room .lang-menu .lang-menu-label { text-align: left;}
body.reading-room .lang-menu .lang-toggle .switch {
  width: 28px;
  height: 14px;
  border-radius: 999px;
  background: #3a3830;
  border: none;}
body.reading-room .lang-menu .lang-toggle .switch::after {
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: #fff;}
body.reading-room .lang-menu .lang-toggle[aria-pressed="true"] .switch {
  background: #5c8a6e;
  border: none;}
body.reading-room .lang-menu .lang-toggle[aria-pressed="true"] .switch::after {
  transform: translateX(14px);
  background: #fff;}
body.reading-room .misra-roman, body.reading-room .misra-en {
  overflow: hidden;
  max-height: 120px;
  opacity: 1;
  transition: max-height 200ms ease,
              opacity 200ms ease 80ms,
              margin-top 200ms ease;}
body.reading-room #play-all {
  background: none;
  border: none;
  color: var(--text-mid);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;}
body.reading-room #play-all:hover { color: var(--text);}
body.reading-room #play-all.playing .listen-icon-circle {
  background: var(--accent); color: #0a1410; border-color: var(--accent);}
body.reading-room .listen-icon-circle {
  width: 22px; height: 22px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  color: var(--accent);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;}
body.reading-room .listen-icon-circle svg { width: 8px; height: 8px; fill: currentColor; margin-left: 1px;}
body.reading-room #status {
  color: var(--text-soft); font-size: 11px;
  font-family: ui-monospace, monospace;
  display: none; align-items: center; justify-content: center;
  margin-top: 8px;}
body.reading-room #status.loading { display: flex;}
body.reading-room #status .dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
  margin-right: 8px;}
body.reading-room body.audio-loading #play-all, body.reading-room body.audio-loading .misra-play {
  opacity: 0.4;
  pointer-events: none;
  cursor: wait;}
body.reading-room .reader { padding: 30px 24px 80px; max-width: 980px; margin: 0 auto;}
body.reading-room .menu-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 20, 16, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
  display: none;}
body.reading-room .menu-overlay.open { display: block;}
body.reading-room .menu-overlay-inner {
  max-width: 980px; margin: 0 auto;
  padding: 28px 24px 80px;
  position: relative;}
body.reading-room .menu-close {
  position: fixed; top: 22px; right: 24px;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  color: var(--text);
  width: 36px; height: 36px; border-radius: 8px;
  font-size: 22px; line-height: 1; z-index: 101;}
body.reading-room .menu-close:hover { border-color: var(--accent-glow); color: var(--accent);}
body.reading-room .menu-banner {
  text-align: center; margin-bottom: 36px;
  padding-bottom: 22px; border-bottom: 1px solid var(--border);}
body.reading-room .menu-banner .wordmark-row {
  display: inline-flex; align-items: baseline; gap: 12px; line-height: 1;}
body.reading-room .menu-banner .wordmark-en, body.reading-room .menu-banner .wordmark-ur {
  font-size: 30px; color: var(--text); line-height: 1;}
body.reading-room .menu-banner .wordmark-en { font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;}
body.reading-room .menu-banner .wordmark-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl;}
body.reading-room .menu-banner-logo { height: 84px;}
body.reading-room .menu-banner .menu-tagline {
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 8px;
  letter-spacing: 0.04em;}
body.reading-room .menu-section { margin-bottom: 36px;}
body.reading-room .menu-section-header {
  display: flex; align-items: baseline; gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;}
body.reading-room .menu-section-header .sect-ur {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 24px; color: var(--text); direction: rtl; line-height: 1.3;}
body.reading-room .menu-section-header .sect-en {
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;}
body.reading-room .poet-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 12px;
  transition: border-color 0.18s, background 0.18s;}
body.reading-room .poet-card:hover { border-color: var(--border-mid); background: var(--bg-3);}
body.reading-room .poet-card.expanded { border-color: var(--accent-glow);}
body.reading-room .poet-card-head {
  display: grid; grid-template-columns: 1fr auto;
  gap: 18px; align-items: start;
  cursor: pointer;}
body.reading-room .poet-id-block .name-ur {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 28px;
  color: var(--text);
  direction: rtl;
  line-height: 1.4;}
body.reading-room .poet-id-block .name-en-row {
  margin-top: 4px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;}
body.reading-room .poet-id-block .name-en {
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px; color: var(--text-mid);}
body.reading-room .poet-id-block .dates {
  font-family: ui-monospace, monospace;
  font-size: 11px; color: var(--text-soft);}
body.reading-room .poet-id-block .tag {
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  font-style: italic; font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;}
body.reading-room .status-badge {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: nowrap;}
body.reading-room .status-badge.available { color: var(--accent); border-color: var(--accent-glow);}
body.reading-room .status-badge.partial { color: var(--accent); border-color: var(--accent-glow);}
body.reading-room .poet-works {
  display: none;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);}
body.reading-room .poet-card.expanded .poet-works { display: block;}
body.reading-room .work-row { padding: 10px 0; border-bottom: 1px solid var(--border);}
body.reading-room .work-row:last-child { border-bottom: none;}
body.reading-room .work-head {
  display: grid; grid-template-columns: 1fr auto;
  gap: 14px; align-items: baseline;}
body.reading-room .work-row.expandable .work-head { cursor: pointer;}
body.reading-room .work-head .name-ur {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 22px;
  color: var(--text);
  direction: rtl; line-height: 1.4;}
body.reading-room .work-head .name-en-row {
  margin-top: 2px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-soft);}
body.reading-room .work-head .name-en { color: var(--text-mid); font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;}
body.reading-room .work-head .translated { font-style: italic; color: var(--text-soft);}
body.reading-room .work-head .work-stats {
  font-family: ui-monospace, monospace;
  font-size: 10px; color: var(--text-faint);
  text-align: right; white-space: nowrap;}
body.reading-room .work-poems {
  display: none;
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);}
body.reading-room .work-row.expanded .work-poems { display: block;}
body.reading-room .work-row.expandable .work-head::after {
  content: '▾'; color: var(--text-faint); margin-left: 8px; font-size: 9px;}
body.reading-room .work-row.expanded.expandable .work-head::after { color: var(--accent);}
body.reading-room .poem-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 6px;
  border-radius: 4px;}
body.reading-room .poem-row .poem-num {
  font-family: ui-monospace, monospace;
  color: var(--text-faint);
  font-size: 11px; text-align: right;}
body.reading-room .poem-row .poem-titles {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0;}
body.reading-room .poem-row .name-ur {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 17px; color: var(--text);
  direction: rtl; line-height: 1.5;}
body.reading-room .poem-row .name-en { font-size: 12px; color: var(--text-soft);}
body.reading-room .poem-row.available { cursor: pointer;}
body.reading-room .poem-row.available .name-en { color: var(--text-mid);}
body.reading-room .poem-row.available:hover { background: rgba(29, 201, 162, 0.08);}
body.reading-room .poem-row.available:hover .name-en { color: var(--accent);}
body.reading-room .poem-row.current { background: rgba(29, 201, 162, 0.06); border-left: 2px solid var(--accent);}
body.reading-room .poem-row.current .name-en { color: var(--accent);}
body.reading-room .poem-row .status-badge { font-size: 8.5px; padding: 2px 6px;}
body.reading-room .menu-foot {
  border-top: 1px solid var(--divider);
  margin-top: 32px;
  padding-top: 22px;
  text-align: center;}
body.reading-room .theme-toggle {
  font-size: 13px;
  color: var(--text-soft);
  padding: 6px 0;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;}
body.reading-room .theme-toggle:hover { color: var(--text); text-decoration: underline;}
@media (max-width: 640px) {
  body.reading-room .page-header { height: 140px; padding: 18px 16px 0;}
  body.reading-room .page-header.scrolled { height: 56px; padding: 6px 16px 0;}
  body.reading-room .logo { height: 108px;}
  body.reading-room .page-header.scrolled .logo-link { transform: scale(0.407);}
  body.reading-room .crumbs { font-size: 11px;}
  body.reading-room .poem-bar { top: 56px;}
  body.reading-room .poem-bar-inner { padding: 14px 16px 12px;}
  body.reading-room .title-en, body.reading-room .title-ur { font-size: 19px;}
  body.reading-room .listen-row { flex-direction: column; gap: 6px;}
  body.reading-room .listen-row .sep { display: none;}
  body.reading-room .reader { padding: 22px 16px 64px;}
  body.reading-room .misra-row { padding: 14px 0;}
  body.reading-room .menu-overlay-inner { padding: 22px 16px 64px;}
  body.reading-room .menu-banner .wordmark-en, body.reading-room .menu-banner .wordmark-ur { font-size: 26px;}
  body.reading-room .poet-id-block .name-ur { font-size: 24px;}
  body.reading-room .work-head .name-ur { font-size: 19px;}
  body.reading-room .poet-card { padding: 14px 16px;}
  body.reading-room .menu-close { top: 16px; right: 16px;}
}
body.reading-room .stanza {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 30px;}
body.reading-room .stanza:first-child { border-top: none; padding-top: 0; margin-top: 0;}
body.reading-room .misra-row {
  padding: 22px 16px;
  transition: background 0.2s;}
body.reading-room .misra-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;}
body.reading-room .misra-row.active { background: var(--active-misra-bg);}
body.reading-room .misra-row.active .misra-text {
  color: var(--green-bright);
  text-shadow: 0 0 8px rgba(29, 201, 162, 0.55),
               0 0 16px rgba(29, 201, 162, 0.35);}
body.reading-room .misra-row.active .misra-roman { color: var(--green-bright);}
body.reading-room .misra-row.active .misra-en { color: var(--green-bright);}
body.reading-room .misra-row.no-audio { opacity: 0.45;}
body.reading-room .misra-play {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-mid);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;}
body.reading-room .misra-play:hover { color: var(--accent); border-color: var(--accent-glow);}
body.reading-room .misra-row.active .misra-play { background: var(--accent); color: #0a1410; border-color: var(--accent);}
body.reading-room .misra-row.no-audio .misra-play { visibility: hidden;}
body.reading-room .misra-play svg { width: 8px; height: 8px; fill: currentColor;}
body.reading-room .misra-content { min-width: 0; text-align: right;}
body.reading-room .misra-content .misra-text, body.reading-room .misra-content .misra-roman, body.reading-room .misra-content .misra-en { max-width: 720px; margin-left: auto; margin-right: 0;}
body.reading-room .misra-text {
  font-size: 30px;
  /* .urdu already sets dir:rtl; right-align is the natural reading edge and
     keeps the Urdu / roman / English lines sharing one right margin. */}
body.reading-room .misra-text .word { display: inline; transition: color 0.15s, background 0.15s; padding: 0 1px; border-radius: 2px;}
body.reading-room .misra-row.active .misra-text .word.current {
  color: var(--green-bright);
  background: transparent;
  text-shadow: 0 0 8px rgba(29, 201, 162, 0.55), 0 0 16px rgba(29, 201, 162, 0.35);}
body.reading-room .misra-roman {
  margin-top: 8px;
  color: var(--text-soft);
  font-style: italic;
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  }
body.reading-room .misra-en {
  margin-top: 6px;
  color: var(--text-mid);
  font-style: normal;
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;}
body.reading-room .misra-meta {
  color: var(--text-faint);
  font-size: 10px;
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  letter-spacing: 0.04em;
  text-align: left;}
body.reading-room .misra-meta .joined-tag {
  display: inline-block;
  padding: 1px 5px; margin-left: 6px;
  background: rgba(29, 201, 162, 0.1);
  color: var(--accent);
  border-radius: 2px;}
body.reading-room .misra-row.joined-group { padding-bottom: 4px;}
body.reading-room .misra-row.joined-tail { padding-top: 4px; padding-bottom: 12px; border-top: 1px dashed var(--border);}
body.reading-room .misra-row.joined-tail .misra-play { visibility: hidden;}
body.reading-room .misra-row.joined-group .misra-meta { display: none;}
body.reading-room .misra-row.joined-tail .misra-meta { display: none;}
body.reading-room .joined-tag-marker { color: var(--accent); font-size: 10px; letter-spacing: 0.1em;}
body.reading-room .banner {
  padding: 14px 20px; margin: 16px 20px;
  background: var(--bg-3); border-left: 3px solid var(--accent);
  color: var(--text-mid); font-size: 13px; border-radius: 3px;}
body.reading-room .banner.error { border-left-color: #cf5d5d; color: #e3c4c4;}
body.reading-room .loader { text-align: center; padding: 80px 20px; color: var(--text-soft);}

/* ================= home / index (scoped under body.home) ================= */
body.home .container { max-width: 640px; margin: 0 auto; padding: 0 24px;}
body.home .page-header {
  position: sticky; top: 0; z-index: 20;
  height: 140px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 24px 24px 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  overflow: hidden;
  transition: height 220ms ease, padding 220ms ease,
              background 220ms ease, border-color 220ms ease;}
body.home .page-header.scrolled {
  height: 64px;
  padding: 8px 24px 0;
  background: var(--header-scrolled-bg);
  border-bottom-color: var(--divider);}
body.home .logo-link {
  grid-column: 2;
  display: inline-flex;
  justify-self: center;
  line-height: 0;
  text-decoration: none;
  transform-origin: top center;
  transition: transform 220ms ease;}
body.home .page-header.scrolled .logo-link { transform: scale(0.5);}
body.home .logo {
  width: 100px;
  height: auto;}
body.home .menu-btn {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  margin-top: 4px;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  transition: background 0.15s;}
body.home .menu-btn:hover { background: var(--divider);}
body.home .masthead { text-align: center; padding: 6px 0 30px;}
body.home .masthead-inner { max-width: 640px; margin: 0 auto; padding: 0 24px;}
body.home .tagline {
  font-size: 13px;
  font-style: italic;
  color: var(--text-soft);}
body.home .masthead-intro:not(:empty) {
  margin-top: 18px;
  font-size: 15px; line-height: 1.6; color: var(--text-soft);}
body.home .masthead-search { margin-top: 22px; position: relative;}
body.home .masthead-search-input {
  width: 100%;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--divider); border-radius: 10px;
  padding: 13px 18px; font-family: inherit; font-size: 15px;}
body.home .masthead-search-input::placeholder { color: var(--text-faint);}
body.home .masthead-search-input:focus { outline: none; border-color: var(--accent);}
body.home .masthead-counts {
  margin-top: 16px; font-size: 11px; letter-spacing: 1px; color: var(--text-faint);}
body.home .menu-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  overflow-y: auto;
  display: none;}
body.home .menu-overlay.open { display: block;}
body.home .menu-overlay-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 48px;}
body.home .menu-close {
  position: fixed; top: 18px; right: 18px; z-index: 110;
  background: var(--surface);
  color: var(--text);
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;}
body.home .menu-close:hover { background: var(--divider);}
body.home .menu-banner {
  text-align: center;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--divider);}
body.home .menu-banner-logo { height: 84px; width: auto;}
body.home .menu-banner .menu-sub {
  font-style: italic;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 8px;}
body.home .menu-section { margin-bottom: 32px;}
body.home .menu-section-header {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  text-transform: uppercase;
  margin-bottom: 16px;}
body.home .poet-card {
  padding: 18px 0;
  border-top: 1px solid var(--divider);
  cursor: pointer;}
body.home .poet-card:hover .poet-name-en { color: var(--accent);}
body.home .poet-card-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;}
body.home .poet-name-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-size: 22px; color: var(--text);}
body.home .poet-name-en {
  font-size: 14px; color: var(--text-soft);
  transition: color 0.15s;}
body.home .poet-name-en .dates { color: var(--text-faint); margin-left: 6px; font-feature-settings: "tnum";}
body.home .poet-tag {
  font-size: 12px; color: var(--text-faint);
  font-style: italic;
  margin-top: 4px;}
body.home .poet-works {
  display: none;
  margin-top: 14px;
  padding-left: 0;}
body.home .poet-card.expanded .poet-works { display: block;}
body.home .work-row {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  padding: 10px 0;
  align-items: baseline;
  font-size: 14px;}
body.home .work-row.expandable { cursor: pointer;}
body.home .work-row .work-name-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-size: 18px; color: var(--text);}
body.home .work-row .work-name-en { color: var(--text-soft); font-size: 13px; margin-top: 2px;}
body.home .work-row .work-name-en .translated { color: var(--text-faint); font-style: italic; margin-left: 6px;}
body.home .work-row .work-stats { color: var(--text-faint); font-size: 12px; text-align: right; white-space: nowrap;}
body.home .work-row .work-stats .status-available { color: var(--accent); font-style: normal;}
body.home .work-row .work-stats .status-coming { font-style: italic;}
body.home .work-poems { display: none; padding-left: 14px; margin-top: 10px; border-left: 1px solid var(--divider);}
body.home .work-row.expanded .work-poems { display: block;}
body.home .poem-row {
  display: grid; grid-template-columns: 40px 1fr auto;
  gap: 14px;
  padding: 7px 4px;
  align-items: baseline;
  border-radius: 4px;
  font-size: 14px;}
body.home .poem-row .poem-num { color: var(--text-faint); font-size: 12px; text-align: right; font-feature-settings: "tnum";}
body.home .poem-row .poem-titles { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; min-width: 0;}
body.home .poem-row .poem-name-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-size: 17px; color: var(--text);}
body.home .poem-row .poem-name-en { color: var(--text-faint); font-size: 12px;}
body.home .poem-row .poem-status { color: var(--text-faint); font-size: 11px; font-style: italic; white-space: nowrap;}
body.home .poem-row.available { cursor: pointer;}
body.home .poem-row.available .poem-name-en { color: var(--text-soft);}
body.home .poem-row.available .poem-status { color: var(--accent); font-style: normal;}
body.home .poem-row.available:hover { background: var(--surface);}
body.home .poem-row.current { background: var(--surface);}
body.home .poem-row.current .poem-status { color: var(--accent); font-style: normal;}
body.home .menu-foot {
  border-top: 1px solid var(--divider);
  margin-top: 32px;
  padding-top: 22px;
  text-align: center;}
body.home .theme-toggle {
  font-size: 13px;
  color: var(--text-soft);
  padding: 6px 0;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;}
body.home .theme-toggle:hover { color: var(--text); text-decoration: underline;}
@media (max-width: 640px) {
  body.home .container { padding: 0 18px;}
  body.home .page-header { height: 120px; padding: 18px 16px 0;}
  body.home .page-header.scrolled { height: 56px; padding: 6px 16px 0;}
  body.home .logo { width: 84px;}
  body.home .page-header.scrolled .logo-link { transform: scale(0.52);}
  body.home .menu-close { top: 12px; right: 12px;}
  body.home .menu-overlay-inner { padding: 28px 18px 40px;}
}

/* ================= browse (scoped under body.browse) ================= */
body.browse .page-header {
  position: sticky; top: 0; z-index: 20;
  height: 140px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 24px 24px 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  overflow: hidden;
  transition: height 220ms ease, padding 220ms ease,
              background 220ms ease, border-color 220ms ease;}
body.browse .page-header.scrolled {
  height: 64px;
  padding: 8px 24px 0;
  background: var(--header-scrolled-bg);
  border-bottom-color: var(--divider);}
body.browse .logo-link {
  grid-column: 2;
  display: inline-flex;
  justify-self: center;
  line-height: 0;
  text-decoration: none;
  transform-origin: top center;
  transition: transform 220ms ease;}
body.browse .page-header.scrolled .logo-link { transform: scale(0.5);}
body.browse .logo { width: 100px; height: auto;}
body.browse .menu-btn {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  margin-top: 4px;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  transition: background 0.15s;}
body.browse .menu-btn:hover { background: var(--divider);}
body.browse .menu-overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto; display: none;}
body.browse .menu-overlay.open { display: block;}
body.browse .menu-overlay-inner { max-width: 720px; margin: 0 auto; padding: 32px 24px 48px;}
body.browse .menu-close {
  position: fixed; top: 18px; right: 18px; z-index: 110;
  background: var(--surface); color: var(--text);
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;}
body.browse .menu-close:hover { background: var(--divider);}
body.browse .menu-banner { text-align: center; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--divider);}
body.browse .menu-banner-logo { height: 84px; width: auto;}
body.browse .menu-banner .menu-sub { font-style: italic; font-size: 12px; color: var(--text-soft); margin-top: 8px;}
body.browse .menu-section { margin-bottom: 32px;}
body.browse .menu-section-header { font-size: 11px; letter-spacing: 0.1em; color: var(--text-soft); text-transform: uppercase; margin-bottom: 16px;}
body.browse .poet-card { padding: 18px 0; border-top: 1px solid var(--divider); cursor: pointer;}
body.browse .poet-card:hover .poet-name-en { color: var(--accent);}
body.browse .poet-card-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;}
body.browse .poet-name-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-size: 22px; color: var(--text);}
body.browse .poet-name-en { font-size: 14px; color: var(--text-soft); transition: color 0.15s;}
body.browse .poet-name-en .dates { color: var(--text-faint); margin-left: 6px; font-feature-settings: "tnum";}
body.browse .poet-tag { font-size: 12px; color: var(--text-faint); font-style: italic; margin-top: 4px;}
body.browse .poet-works { display: none; margin-top: 14px; padding-left: 0;}
body.browse .poet-card.expanded .poet-works { display: block;}
body.browse .work-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 10px 0; align-items: baseline; font-size: 14px;}
body.browse .work-row.expandable { cursor: pointer;}
body.browse .work-row .work-name-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-size: 18px; color: var(--text);}
body.browse .work-row .work-name-en { color: var(--text-soft); font-size: 13px; margin-top: 2px;}
body.browse .work-row .work-name-en .translated { color: var(--text-faint); font-style: italic; margin-left: 6px;}
body.browse .work-row .work-stats { color: var(--text-faint); font-size: 12px; text-align: right; white-space: nowrap;}
body.browse .work-row .work-stats .status-available { color: var(--accent); font-style: normal;}
body.browse .work-row .work-stats .status-coming { font-style: italic;}
body.browse .work-poems { display: none; padding-left: 14px; margin-top: 10px; border-left: 1px solid var(--divider);}
body.browse .work-row.expanded .work-poems { display: block;}
body.browse .poem-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; padding: 7px 4px; align-items: baseline; border-radius: 4px; font-size: 14px;}
body.browse .poem-row .poem-num { color: var(--text-faint); font-size: 12px; text-align: right; font-feature-settings: "tnum";}
body.browse .poem-row .poem-titles { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; min-width: 0;}
body.browse .poem-row .poem-name-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-size: 17px; color: var(--text);}
body.browse .poem-row .poem-name-en { color: var(--text-faint); font-size: 12px;}
body.browse .poem-row .poem-status { color: var(--text-faint); font-size: 11px; font-style: italic; white-space: nowrap;}
body.browse .poem-row.available { cursor: pointer;}
body.browse .poem-row.available .poem-name-en { color: var(--text-soft);}
body.browse .poem-row.available .poem-status { color: var(--accent); font-style: normal;}
body.browse .poem-row.available:hover { background: var(--surface);}
body.browse .menu-foot { border-top: 1px solid var(--divider); margin-top: 32px; padding-top: 22px; text-align: center;}
body.browse .theme-toggle { font-size: 13px; color: var(--text-soft); padding: 6px 0; font-family: inherit; text-decoration: none; cursor: pointer; transition: color 0.15s;}
body.browse .theme-toggle:hover { color: var(--text); text-decoration: underline;}
@media (max-width: 640px) {
  body.browse .page-header { height: 120px; padding: 18px 16px 0;}
  body.browse .page-header.scrolled { height: 56px; padding: 6px 16px 0;}
  body.browse .logo { width: 84px;}
  body.browse .page-header.scrolled .logo-link { transform: scale(0.52);}
  body.browse .menu-close { top: 12px; right: 12px;}
  body.browse .menu-overlay-inner { padding: 28px 18px 40px;}
}

/* ================= support (scoped under body.support) ================= */
body.support .page-header {
  position: sticky; top: 0; z-index: 20;
  height: 140px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 24px 24px 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  overflow: hidden;
  transition: height 220ms ease, padding 220ms ease,
              background 220ms ease, border-color 220ms ease;}
body.support .page-header.scrolled {
  height: 64px;
  padding: 8px 24px 0;
  background: var(--header-scrolled-bg);
  border-bottom-color: var(--divider);}
body.support .logo-link {
  grid-column: 2;
  display: inline-flex;
  justify-self: center;
  line-height: 0;
  text-decoration: none;
  transform-origin: top center;
  transition: transform 220ms ease;}
body.support .page-header.scrolled .logo-link { transform: scale(0.5);}
body.support .logo { width: 100px; height: auto;}
body.support .menu-btn {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  margin-top: 4px;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  transition: background 0.15s;}
body.support .menu-btn:hover { background: var(--divider);}
body.support .menu-overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto; display: none;}
body.support .menu-overlay.open { display: block;}
body.support .menu-overlay-inner { max-width: 720px; margin: 0 auto; padding: 32px 24px 48px;}
body.support .menu-close {
  position: fixed; top: 18px; right: 18px; z-index: 110;
  background: var(--surface); color: var(--text);
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;}
body.support .menu-close:hover { background: var(--divider);}
body.support .menu-banner { text-align: center; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--divider);}
body.support .menu-banner-logo { height: 84px; width: auto;}
body.support .menu-banner .menu-sub { font-style: italic; font-size: 12px; color: var(--text-soft); margin-top: 8px;}
body.support .menu-section { margin-bottom: 32px;}
body.support .menu-section-header { font-size: 11px; letter-spacing: 0.1em; color: var(--text-soft); text-transform: uppercase; margin-bottom: 16px;}
body.support .poet-card { padding: 18px 0; border-top: 1px solid var(--divider); cursor: pointer;}
body.support .poet-card:hover .poet-name-en { color: var(--accent);}
body.support .poet-card-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;}
body.support .poet-name-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-size: 22px; color: var(--text);}
body.support .poet-name-en { font-size: 14px; color: var(--text-soft); transition: color 0.15s;}
body.support .poet-name-en .dates { color: var(--text-faint); margin-left: 6px; font-feature-settings: "tnum";}
body.support .poet-tag { font-size: 12px; color: var(--text-faint); font-style: italic; margin-top: 4px;}
body.support .poet-works { display: none; margin-top: 14px; padding-left: 0;}
body.support .poet-card.expanded .poet-works { display: block;}
body.support .work-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 10px 0; align-items: baseline; font-size: 14px;}
body.support .work-row.expandable { cursor: pointer;}
body.support .work-row .work-name-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-size: 18px; color: var(--text);}
body.support .work-row .work-name-en { color: var(--text-soft); font-size: 13px; margin-top: 2px;}
body.support .work-row .work-name-en .translated { color: var(--text-faint); font-style: italic; margin-left: 6px;}
body.support .work-row .work-stats { color: var(--text-faint); font-size: 12px; text-align: right; white-space: nowrap;}
body.support .work-row .work-stats .status-available { color: var(--accent); font-style: normal;}
body.support .work-row .work-stats .status-coming { font-style: italic;}
body.support .work-poems { display: none; padding-left: 14px; margin-top: 10px; border-left: 1px solid var(--divider);}
body.support .work-row.expanded .work-poems { display: block;}
body.support .poem-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; padding: 7px 4px; align-items: baseline; border-radius: 4px; font-size: 14px;}
body.support .poem-row .poem-num { color: var(--text-faint); font-size: 12px; text-align: right; font-feature-settings: "tnum";}
body.support .poem-row .poem-titles { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; min-width: 0;}
body.support .poem-row .poem-name-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; font-size: 17px; color: var(--text);}
body.support .poem-row .poem-name-en { color: var(--text-faint); font-size: 12px;}
body.support .poem-row .poem-status { color: var(--text-faint); font-size: 11px; font-style: italic; white-space: nowrap;}
body.support .poem-row.available { cursor: pointer;}
body.support .poem-row.available .poem-name-en { color: var(--text-soft);}
body.support .poem-row.available .poem-status { color: var(--accent); font-style: normal;}
body.support .poem-row.available:hover { background: var(--surface);}
body.support .menu-foot { border-top: 1px solid var(--divider); margin-top: 32px; padding-top: 22px; text-align: center;}
body.support .theme-toggle { font-size: 13px; color: var(--text-soft); padding: 6px 0; font-family: inherit; text-decoration: none; cursor: pointer; transition: color 0.15s;}
body.support .theme-toggle:hover { color: var(--text); text-decoration: underline;}
body.support .support { padding: 24px 0 64px;}
body.support .support-inner { max-width: 560px; margin: 0 auto; padding: 0 24px; text-align: center;}
body.support .support-title {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 42px; font-weight: 600; line-height: 1.1;
  color: var(--text); margin-bottom: 24px;}
body.support .support-lede { font-size: 17px; line-height: 1.65; color: var(--text); margin: 0 auto 16px; max-width: 480px;}
body.support .support-body { font-size: 15px; line-height: 1.65; color: var(--text-soft); margin: 0 auto 30px; max-width: 480px;}
body.support .support-note { font-size: 12px; line-height: 1.6; color: var(--text-faint); margin-bottom: 4px;}
body.support .support-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 34px 0 18px;}
body.support .support-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 8px;
  font-size: 15px; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--accent);
  transition: background 0.15s, color 0.15s, opacity 0.15s;}
body.support .support-btn svg { width: 18px; height: 18px;}
body.support .support-btn-filled { background: var(--accent); color: var(--accent-text);}
body.support .support-btn-filled:hover, body.support .support-btn-filled:focus-visible { opacity: 0.88; outline: none;}
body.support .support-btn-outline { background: transparent; color: var(--accent);}
body.support .support-btn-outline:hover, body.support .support-btn-outline:focus-visible { background: rgba(92, 138, 110, 0.1); outline: none;}
body.support .support-secure {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 12px; color: var(--text-faint);}
body.support .support-secure svg { width: 14px; height: 14px;}
@media (max-width: 640px) {
  body.support .page-header { height: 120px; padding: 18px 16px 0;}
  body.support .page-header.scrolled { height: 56px; padding: 6px 16px 0;}
  body.support .logo { width: 84px;}
  body.support .page-header.scrolled .logo-link { transform: scale(0.52);}
  body.support .menu-close { top: 12px; right: 12px;}
  body.support .menu-overlay-inner { padding: 28px 18px 40px;}
  body.support .support-title { font-size: 34px;}
}

/* ================= shared chrome (global) ================= */
/* Sumjho — shared chrome (utility corner · breadcrumb bar · footer).
   Loaded by both /prototype/index.html and /prototype/sumjho.html on top of
   each page's own styles. Only NEW chrome lives here; the existing page
   headers (logo lockup + scroll-shrink) are left untouched and reused.

   All colours come from the theme custom properties already defined in each
   page's <head> (--bg/--surface/--text/--text-soft/--text-faint/--accent/
   --divider), so light/dark just works. No pills, gradients, or emojis. */

/* ---------- sticky-footer scaffold ----------
   Make the body a column so the footer can be pushed to the viewport bottom
   on short pages (margin-top:auto) without ever becoming a fixed overlay.
   Block children stretch to full width exactly as before; the sticky header
   and fixed overlays are unaffected. */
body { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- utility corner (search · reading list · menu) ----------
   The three icon buttons live top-right. The existing #menu-btn is moved
   into this group at runtime (mountUtilityCorner in library.js); these
   styles match the existing .menu-btn footprint so the group reads as one. */
.utility-corner {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.util-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.util-btn:hover, .util-btn:focus-visible { background: var(--divider); outline: none; }
.util-btn svg { width: 18px; height: 18px; display: block; }
.util-btn.active { color: var(--accent); }
/* The existing #menu-btn carries margin-top:4px for its old grid slot; the
   corner already handles that offset, so neutralise it inside the group. */
.utility-corner #menu-btn { margin-top: 0; }

/* ---------- breadcrumb bar ----------
   Its own row directly below the header (content path: Urdu › Iqbal › … ›
   Himala). Home omits it. Intermediate crumbs are plain text until their L2
   pages land (1.6); the leaf is the current poem. Right-aligned to match the
   original-first rule for content. */
.breadcrumb-bar {
  border-bottom: 1px solid var(--divider);
  background: var(--bg);
}
.breadcrumb-bar .breadcrumb-inner {
  /* Match each page's content column (set --chrome-content-width per page);
     defaults to 640 where unset. */
  max-width: var(--chrome-content-width, 640px);
  margin: 0 auto;
  padding: 10px 24px;
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
}
.breadcrumb-bar .crumb { color: var(--text-soft); text-decoration: none; }
.breadcrumb-bar .crumb-current { color: var(--text); }
.breadcrumb-bar .crumb-sep { color: var(--text-faint); margin: 0 8px; }
@media (max-width: 600px) {
  .breadcrumb-bar .breadcrumb-inner { font-size: 11px; padding: 8px 18px; }
}

/* ---------- inline search panel ----------
   Drops down under the header when the search icon is toggled. Live client-
   side match over the poem index; results are clean poem links. */
.search-panel {
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  display: none;
}
.search-panel.open { display: block; }
.search-panel .search-inner { max-width: 640px; margin: 0 auto; padding: 16px 24px; }
.search-panel input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
}
.search-panel input:focus { outline: none; border-color: var(--accent); }
.search-results { margin-top: 10px; max-height: 50vh; overflow-y: auto; }
.search-result {
  display: block;
  padding: 8px 6px;
  border-bottom: 1px solid var(--divider);
  text-decoration: none;
  text-align: right;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result:focus-visible { background: var(--bg); outline: none; }
.search-result .sr-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; color: var(--text); font-size: 15px; }
.search-result .sr-en { color: var(--text-soft); font-size: 12px; margin-top: 2px; }
.search-empty { color: var(--text-faint); font-size: 13px; padding: 10px 6px; text-align: right; }
/* "see all results →" — both the top bar and the masthead dropdown */
.search-seeall {
  display: block; padding: 10px 6px 4px; text-align: right;
  font-size: 12px; color: var(--accent); text-decoration: none;
}
.search-seeall:hover, .search-seeall:focus-visible { text-decoration: underline; outline: none; }

/* masthead live-search dropdown — floats below the input, shows on .open */
.search-dropdown {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--divider); border-radius: 10px;
  max-height: 60vh; overflow-y: auto; padding: 4px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  text-align: right;
}
.search-dropdown.open { display: block; }

/* ---------- reading-list panel ----------
   A slide-in drawer listing localStorage-saved poems. The save action itself
   arrives with the reading room/reading list work (1.7/1.9); until then this
   reads whatever is stored and shows the empty state. */
.rl-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 120;
  width: min(360px, 88vw);
  background: var(--surface);
  border-left: 1px solid var(--divider);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex; flex-direction: column;
}
.rl-panel.open { transform: translateX(0); }
.rl-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--divider);
}
.rl-title { font-size: 14px; color: var(--text); }
.rl-close { color: var(--text-soft); font-size: 22px; line-height: 1; }
.rl-body { padding: 8px 12px; overflow-y: auto; }
.rl-item {
  display: block; padding: 10px 8px; border-bottom: 1px solid var(--divider);
  text-decoration: none; text-align: right;
}
.rl-item .rl-ur { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; color: var(--text); }
.rl-item .rl-en { color: var(--text-soft); font-size: 12px; margin-top: 2px; }
.rl-empty { color: var(--text-faint); font-size: 13px; padding: 24px 12px; text-align: center; line-height: 1.6; }
.rl-backdrop {
  position: fixed; inset: 0; z-index: 119;
  background: rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.rl-backdrop.open { opacity: 1; pointer-events: auto; }

/* ---------- universal footer ----------
   browse / about / legal columns + wordmark, tagline, © and counts.
   Pushed to the viewport bottom on short pages by margin-top:auto. */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--divider);
  background: var(--bg);
  color: var(--text-soft);
}
.site-footer .footer-inner { max-width: 720px; margin: 0 auto; padding: 40px 24px 28px; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.footer-col h4 {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600; margin-bottom: 12px;
}
.footer-col a, .footer-col span.foot-soon {
  display: block; padding: 4px 0; font-size: 13px; text-decoration: none;
  color: var(--text-soft);
}
.footer-col a:hover, .footer-col a:focus-visible { color: var(--text); text-decoration: underline; outline: none; }
/* Links whose destination page doesn't exist yet read as muted, non-interactive. */
.footer-col span.foot-soon { color: var(--text-faint); cursor: default; }
.footer-foot {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--divider);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
}
.footer-foot .foot-wordmark { font-size: 16px; color: var(--text); letter-spacing: 0.5px; }
.footer-foot .foot-tagline { font-size: 12px; font-style: italic; color: var(--text-soft); }
/* Legal text + © cluster on the right, styled identical to the copyright
   text: muted #5f675c. Plain text for now (non-interactive) until the
   privacy/terms/rights pages exist. */
.footer-legal { margin-left: auto; display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.footer-legal span, .footer-foot .foot-meta {
  font-size: 11px; color: #5f675c; letter-spacing: 0.5px;
}
@media (max-width: 600px) {
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer-legal { margin-left: 0; width: 100%; margin-top: 4px; }
}

/* ---------- BROWSE: shelves + tiles (L1 home; tiles reused by L2 in 1.6) ----------
   Horizontally-scrolling shelves of fixed-width tiles. Original-first,
   right-aligned. The soft right-edge fade is the §2-specified "more" hint. */
.home-shelves { display: flex; flex-direction: column; padding: 12px 0 32px; }
.shelf { position: relative; padding: 14px 0; }
.shelf-head {
  display: flex; align-items: baseline; justify-content: space-between;
  max-width: 1000px; margin: 0 auto; padding: 0 24px 10px;
}
.shelf-title {
  font-size: 13px; letter-spacing: 1px; font-weight: 600;
  color: var(--text-soft); text-transform: lowercase;
}
.shelf-seeall { font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.shelf-seeall:hover, .shelf-seeall:focus-visible { text-decoration: underline; outline: none; }
.shelf-strip {
  /* Share the heading's content column so the tile row (and the first tile)
     line up to the same left/right edges as the section heading. */
  max-width: 1000px; margin: 0 auto;
  display: flex; gap: 14px;
  overflow-x: auto; overflow-y: hidden;
  padding: 4px 24px 10px;
  scroll-snap-type: x proximity;
  /* Match the padding so snap doesn't pull the first tile past the heading's
     left edge on overflowing strips (snapport start = content edge). */
  scroll-padding-left: 24px;
  -webkit-overflow-scrolling: touch;
}
.shelf-strip::-webkit-scrollbar { height: 0; background: transparent; }
/* soft right-edge fade hinting "more" — pinned to the content column's right edge */
.shelf::after {
  content: ''; position: absolute; top: 38px; bottom: 10px; width: 36px;
  right: max(0px, calc((100% - 1000px) / 2));
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
}

.tile {
  flex: 0 0 152px; width: 152px; min-height: 132px;
  display: flex; flex-direction: column; gap: 5px;
  border: 1px solid var(--divider); border-radius: 10px;
  background: var(--surface); padding: 14px;
  text-decoration: none; text-align: right;
  scroll-snap-align: start;
  transition: border-color 0.15s, background 0.15s;
}
.tile:hover, .tile:focus-visible { border-color: var(--accent); outline: none; }
.tile-ur {
  font-family: 'Noto Nastaliq Urdu', serif; direction: rtl;
  color: var(--text); font-size: 16px; line-height: 1.5;
}
.tile-en { color: var(--text-soft); font-size: 12px; }
.tile-poet, .tile-meta { color: var(--text-faint); font-size: 11px; line-height: 1.4; }
.tile.soon { opacity: 0.6; }
.tile.language-tile.soon { cursor: default; }
.tile-badges { display: flex; gap: 8px; justify-content: flex-end; margin-top: auto; padding-top: 8px; }
.badge { font-size: 9px; letter-spacing: 0.5px; text-transform: lowercase; color: var(--text-faint); }
.badge.on { color: var(--accent); }

/* ---------- L2 filtered list (browse.html) ---------- */
.browse { padding: 8px 0 40px; }
.browse-title-block { text-align: center; padding: 18px 24px 10px; }
.browse-title-ur {
  font-family: 'Noto Nastaliq Urdu', serif; direction: rtl;
  font-size: 30px; font-weight: 500; line-height: 1.5; color: var(--text);
}
.browse-title-en { margin-top: 8px; font-size: 15px; color: var(--text-soft); }
.browse-count { margin-top: 6px; font-size: 12px; color: var(--text-faint); letter-spacing: 0.5px; }

/* refine row — right-aligned controls that compose */
.refine-row {
  max-width: 880px; margin: 0 auto; padding: 4px 24px 16px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center;
}
.refine-select, .refine-search {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--divider); border-radius: 8px;
  padding: 7px 10px; font-family: inherit; font-size: 12px;
}
.refine-search { min-width: 160px; }
.refine-select:focus, .refine-search:focus { outline: none; border-color: var(--accent); }
.refine-toggle { font-size: 12px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.refine-toggle input { accent-color: var(--accent); }

/* responsive tile grid — capped at 5 columns (container width), stacks on mobile */
.browse-grid {
  max-width: 880px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
}
.browse-grid .tile { flex: initial; width: auto; }   /* fill the grid cell, not the fixed shelf width */
.browse-empty { grid-column: 1 / -1; text-align: center; color: var(--text-faint); font-size: 14px; padding: 48px 0; }
@media (max-width: 600px) {
  .refine-row { justify-content: stretch; }
  .refine-select, .refine-search { flex: 1 1 auto; }
  .browse-title-ur { font-size: 26px; }
}


/* ======================================= From index.html
