/* ==========================================================================
   Telugu Gospel Lyrics — UX POLISH LAYER (Phase 10.5, v3.2.1)

   ADDITIVE ONLY. This file does not redefine brand tokens, does not change
   typography families, and does not restyle existing components beyond
   spacing / touch-target / focus refinements. It loads last so its rules win
   without needing !important.

   Sections:
     1. Hero (search-first)
     2. Alphabet grid
     3. Category cards
     4. Song summary card
     5. Discovery + linking rails
     6. Sidebar
     7. Footer discovery mesh
     8. Search page
     9. Skeletons + empty states
    10. Accessibility + motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HERO — search first
   -------------------------------------------------------------------------- */
.tgl-hero--search .tgl-hero__inner {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) 16px clamp(28px, 5vw, 56px);
  text-align: center;
}
.tgl-hero--search .tgl-hero__title {
  font-size: clamp(1.6rem, 4.4vw, 2.8rem);
  line-height: 1.15;
  margin: 6px 0 10px;
  text-wrap: balance;
}
.tgl-hero--search .tgl-hero__sub {
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  line-height: 1.6;
  max-width: 62ch;
  margin: 0 auto 22px;
  opacity: 0.92;
}
.tgl-hero__searchwrap {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
/* The Search Engine combobox, sized up for the hero. */
.tgl-hero__searchwrap .tgl-searchform {
  display: flex;
  gap: 8px;
  position: relative;
}
.tgl-hero__searchwrap .tgl-searchform__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 18px;
  font-size: 1.05rem;
  border-radius: 12px;
}
.tgl-hero__searchwrap .tgl-searchform__submit {
  flex: 0 0 auto;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}
/* Suggestion list — absolutely positioned so opening it causes no shift. */
.tgl-searchform__suggestions {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
  text-align: left;
}
.tgl-searchform__suggestions[hidden] { display: none; }
.tgl-searchform__suggestions li {
  margin: 0;
  padding: 0;
}
.tgl-searchform__suggestions a,
.tgl-searchform__suggestions .tgl-suggest__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.tgl-searchform__suggestions li[aria-selected="true"] > *,
.tgl-searchform__suggestions a:hover,
.tgl-searchform__suggestions a:focus-visible {
  background: rgba(0, 0, 0, 0.06);
}
.tgl-suggest__type {
  margin-left: auto;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
  flex: 0 0 auto;
}
.tgl-suggest__label { min-width: 0; overflow-wrap: anywhere; }

.tgl-hero__quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.tgl-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tgl-hero__chip:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); }
.tgl-hero__chip-icon { font-size: 0.95em; line-height: 1; }

.tgl-hero__stats {
  margin: 16px 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
}
.tgl-hero__stat + .tgl-hero__stat::before {
  content: "·";
  margin: 0 8px;
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   2. ALPHABET — bigger targets, clearer grouping
   -------------------------------------------------------------------------- */
.tgl-alphabet { padding-block: 20px; }
.tgl-alphabet__group + .tgl-alphabet__group { margin-top: 18px; }
.tgl-alphabet__group > h3 {
  font-size: 1rem;
  margin: 0 0 10px;
  opacity: 0.85;
}
.tgl-alphabet__grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}
.tgl-alphabet__grid > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 4px 2px;
  border-radius: 8px;
  border: 1px solid var(--tgl-line, rgba(0, 33, 71, 0.12));
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  line-height: 1.1;
  transition: background 0.15s ease, transform 0.15s ease;
}
.tgl-alphabet__grid > a:hover { transform: translateY(-1px); background: rgba(0, 0, 0, 0.05); }
.tgl-alphabet__grid > a.is-active {
  border-color: currentColor;
  background: rgba(0, 33, 71, 0.04);
  border-color: var(--tgl-gold);
}
.tgl-alpha__count {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.8;
  color: var(--tgl-gold);
}
.tgl-alphabet__grid > a.is-empty { opacity: 0.4; pointer-events: none; }

/* --------------------------------------------------------------------------
   3. CATEGORY CARDS
   -------------------------------------------------------------------------- */
.tgl-ts-catgrid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
.tgl-ts-catcard {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.tgl-ts-catcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
}
.tgl-ts-catcard__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 1.15rem;
  line-height: 1;
}
.tgl-ts-catcard__text { min-width: 0; }
.tgl-ts-catcard__name {
  display: block;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tgl-ts-catcard__count {
  display: block;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   4. SONG SUMMARY CARD
   -------------------------------------------------------------------------- */
.tgl-summary { padding: 14px 16px; margin: 0 0 16px; border-radius: 12px; background: var(--tgl-card, #fff); border: 1px solid var(--tgl-line, #e6e8ee); }
.tgl-summary__title { display: none; }
.tgl-summary__grid { display: flex; flex-direction: column; gap: 6px; }
.tgl-summary__row { display: grid; grid-template-columns: 90px 10px 1fr; font-size: 14px; line-height: 1.4; align-items: start; }
.tgl-summary__label { color: var(--tgl-muted, #5a6472); font-weight: 600; text-align: left; }
.tgl-summary__sep { color: var(--tgl-muted, #5a6472); opacity: 0.6; text-align: center; }
.tgl-summary__value { color: var(--tgl-navy); font-weight: 500; text-align: left; }
.tgl-summary__value a { color: var(--tgl-navy); text-decoration: underline; }
.tgl-summary__value a:hover { color: var(--tgl-gold); }

/* --------------------------------------------------------------------------
   5. DISCOVERY + LINKING RAILS — consistent cards, never ad-interrupted
   -------------------------------------------------------------------------- */
.tgl-discovery { margin: 26px 0; }
.tgl-discovery__title {
  font-size: 1.15rem;
  margin: 0 0 12px;
}
.tgl-discovery__title a { text-decoration: none; color: inherit; }
.tgl-discovery__title a:hover { text-decoration: underline; }
.tgl-discovery__list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.tgl-discovery__item { margin: 0; }
.tgl-discovery__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tgl-discovery__link:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); }
.tgl-discovery__thumb, .tgl-related-thumb, .tgl-pcard__media, .tgl-pcard__img, .tgl-sidebar img { display: none !important; }
.tgl-discovery__item { border-bottom: 1px solid var(--tgl-line); }
.tgl-discovery__link { padding: 8px 0 !important; border: 0 !important; background: transparent !important; min-height: 0 !important; }
.tgl-discovery__link:hover { background: transparent !important; color: var(--tgl-gold) !important; }
.tgl-discovery__label { font-size: 15px; font-weight: 600; }

  min-width: 0;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
/* Sidebar + continue-reading variants stay single column. */
.tgl-sidebar .tgl-discovery__list,
.tgl-continue .tgl-discovery__list { grid-template-columns: minmax(0, 1fr); }

.tgl-continue { margin: 26px 0; }

/* --------------------------------------------------------------------------
   6. SIDEBAR — simplified, sticky unit respects the footer
   -------------------------------------------------------------------------- */
.tgl-sidebar .tgl-widget { margin-bottom: 22px; }
.tgl-sidebar .tgl-widget-title {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.72;
  margin: 0 0 10px;
}
.tgl-sidebar .tgl-searchform { display: flex; gap: 6px; position: relative; }
.tgl-sidebar .tgl-searchform__input { flex: 1 1 auto; min-width: 0; min-height: 44px; }
.tgl-sidebar .tgl-searchform__submit { min-height: 44px; }

/* The sticky rail: `position:sticky` inside a normal-flow column already
   stops at the end of the column, which sits above the footer — so the unit
   can never overlap the footer and never needs JS to release it. */
@media (min-width: 1024px) {
  .tgl-sidebar__sticky {
    position: sticky;
    top: calc(var(--tgl-header-height, 64px) + 16px);
  }
}
@media (max-width: 1023px) {
  .tgl-sidebar__sticky { position: static; }
}

/* --------------------------------------------------------------------------
   7. FOOTER DISCOVERY MESH
   -------------------------------------------------------------------------- */
.tgl-footer-discovery {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tgl-footer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tgl-footer-chips li { margin: 0; }
.tgl-footer-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
  text-decoration: none;
}
.tgl-footer-chips a:hover { background: rgba(255, 255, 255, 0.12); }

/* --------------------------------------------------------------------------
   8. SEARCH PAGE
   -------------------------------------------------------------------------- */
.tgl-search-head { margin-bottom: 18px; }
.tgl-search-head .tgl-searchform { display: flex; gap: 8px; position: relative; max-width: 640px; }
.tgl-search-head .tgl-searchform__input { flex: 1 1 auto; min-width: 0; min-height: 52px; font-size: 1.02rem; }
.tgl-search-head .tgl-searchform__submit { min-height: 52px; padding: 0 20px; }
.tgl-search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 4px;
}
.tgl-search-filters select,
.tgl-search-filters input { min-height: 44px; }

/* --------------------------------------------------------------------------
   9. SKELETONS + EMPTY STATES
   -------------------------------------------------------------------------- */
.tgl-skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,.06) 25%, rgba(0,0,0,.11) 37%, rgba(0,0,0,.06) 63%);
  background-size: 400% 100%;
  animation: tgl-shimmer 1.3s ease infinite;
}
.tgl-skeleton--line { height: 14px; margin-bottom: 8px; }
.tgl-skeleton--card { height: 56px; margin-bottom: 10px; }
@keyframes tgl-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.tgl-empty {
  padding: 26px 20px;
  border-radius: 14px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  text-align: center;
}
.tgl-empty__title { margin: 0 0 6px; font-size: 1.1rem; }
.tgl-empty__text { margin: 0 0 14px; opacity: 0.78; }

/* --------------------------------------------------------------------------
   10. ACCESSIBILITY + MOTION
   -------------------------------------------------------------------------- */
.tgl-hero__chip:focus-visible,
.tgl-alphabet__grid > a:focus-visible,
.tgl-ts-catcard:focus-visible,
.tgl-discovery__link:focus-visible,
.tgl-footer-chips a:focus-visible,
.tgl-searchform__input:focus-visible,
.tgl-searchform__submit:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .tgl-hero__chip,
  .tgl-ts-catcard,
  .tgl-discovery__link,
  .tgl-alphabet__grid > a { transition: none; }
  .tgl-hero__chip:hover,
  .tgl-ts-catcard:hover,
  .tgl-discovery__link:hover,
  .tgl-alphabet__grid > a:hover { transform: none; }
  .tgl-skeleton { animation: none; }
}

/* Mobile density: tighten the rails, keep targets big. */
@media (max-width: 600px) {
  .tgl-discovery__list { grid-template-columns: minmax(0, 1fr); }
  .tgl-ts-catgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tgl-alphabet__grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
  .tgl-summary { padding: 14px; }
  .tgl-hero--search .tgl-hero__inner { padding-top: 26px; }
}

/* ==========================================================================
   v3.2.2 — SIDEBAR RAIL, CARD, BUTTON AND TYPOGRAPHY STANDARD

   Everything below is additive polish loaded after the base stylesheet.
   It defines ONE card shell, ONE chip, ONE button set and ONE type scale,
   used by the sidebar, the discovery blocks and the song page alike, so the
   components can no longer drift apart.
   ========================================================================== */

:root {
  --tgl-rail-gap: 18px;
  --tgl-rail-radius: 16px;
  --tgl-rail-pad: 16px;
  --tgl-rail-border: var(--tgl-line);
  --tgl-rail-surface: var(--tgl-card);
  --tgl-rail-hover: rgba(0, 33, 71, 0.04);
  --tgl-rail-muted: var(--tgl-muted);
  --tgl-touch: 44px;
}

/* --------------------------------------------------------------------------
   1. THE RAIL
   -------------------------------------------------------------------------- */
.tgl-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--tgl-rail-gap);
  min-width: 0;
}

.tgl-rail {
  background: var(--tgl-rail-surface);
  border: 1px solid var(--tgl-rail-border);
  border-radius: var(--tgl-rail-radius);
  padding: var(--tgl-rail-pad);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tgl-rail--search { padding: 14px; }
.tgl-rail--search .tgl-searchform {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
}
.tgl-rail--search .tgl-searchform__input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 48px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
}
.tgl-rail--search .tgl-searchform__submit {
  flex: 0 0 auto !important;
  min-height: 48px !important;
  padding: 0 20px !important;
  border-radius: 8px !important;
  background: var(--tgl-navy, #001B44) !important;
  color: #fff !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
}
.tgl-rail--search .tgl-searchform__submit:hover {
  background: var(--tgl-gold, #F2A900) !important;
}
@media (max-width: 400px) {
  .tgl-rail--search .tgl-searchform__submit { padding: 0 12px !important; }
}
@media (max-width: 340px) {
  .tgl-rail--search .tgl-searchform__submit { padding: 0 10px !important; }
  .tgl-rail--search .tgl-searchform__label { display: none !important; }
  .tgl-rail--search .tgl-searchform__icon { display: block !important; }
}

.tgl-rail__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.tgl-rail__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  color: var(--tgl-navy);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.tgl-rail__title > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.tgl-rail__icon { flex: 0 0 auto; font-size: 1.15rem; line-height: 1; }
.tgl-rail__more {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--tgl-rail-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  min-height: 44px;
}
.tgl-rail__more:hover,
.tgl-rail__more:focus-visible { text-decoration: underline; }

/* --------------------------------------------------------------------------
   1b. DONATE / SUPPORT CARD
   -------------------------------------------------------------------------- */
.tgl-rail--donate { background: #FFF5F7; border-color: #FFD6DE; }
.tgl-donate-card { text-align: center; }
.tgl-donate-card__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.tgl-donate-card__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}
.tgl-donate-card__icon svg { display: block; width: 44px; height: 44px; }
.tgl-donate-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0A3A8A;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.tgl-donate-card__text {
  margin: 0 0 16px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tgl-muted, #6B6B6B);
}
.tgl-donate-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 2px solid #E91E63;
  border-radius: 999px;
  background: #fff;
  color: #E91E63;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease;
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.12);
}
.tgl-donate-card__btn svg { flex: 0 0 auto; }
.tgl-donate-card__btn:hover,
.tgl-donate-card__btn:focus-visible {
  background: #E91E63;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(233, 30, 99, 0.35);
}

/* --------------------------------------------------------------------------
   2. SONG LISTS — ranked and thumbnailed
   -------------------------------------------------------------------------- */
.tgl-rail__songs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  counter-reset: tgl-rank;
}
.tgl-rail__songlink {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: var(--tgl-touch);
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}
.tgl-rail__songlink:hover,
.tgl-rail__songlink:focus-visible { background: var(--tgl-rail-hover); }

.tgl-rail__rank {
  flex: 0 0 auto;
  width: 24px;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: rgba(15, 23, 42, 0.28);
}
.tgl-rail__songs--ranked > li:nth-child(1) .tgl-rail__rank,
.tgl-rail__songs--ranked > li:nth-child(2) .tgl-rail__rank,
.tgl-rail__songs--ranked > li:nth-child(3) .tgl-rail__rank {
  color: var(--tgl-gold, #b8860b);
}

.tgl-rail__thumb {
  display: none !important;
}
.tgl-rail__songtitle {
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   3. CHIPS — artists, ministries, categories, searches
   -------------------------------------------------------------------------- */
.tgl-rail__chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tgl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--tgl-rail-border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.02);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  width: fit-content;
}
.tgl-chip:hover,
.tgl-chip:focus-visible {
  background: var(--tgl-rail-hover);
  border-color: rgba(15, 23, 42, 0.2);
}
.tgl-chip__label { min-width: 0; overflow-wrap: anywhere; }
.tgl-chip__count {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--tgl-rail-muted);
}

/* Hierarchical Tree v10.6 */
.tgl-rail__tree {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.tgl-rail__tree li {
  display: flex;
  flex-direction: column;
}
.tgl-chip-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tgl-rail__tree .tgl-chip {
  flex: 1 1 auto;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 2px 0;
  min-height: 44px;
  background: transparent;
  border-color: transparent;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tgl-rail__tree .tgl-chip:hover {
  background: var(--tgl-rail-hover);
  border-color: var(--tgl-rail-border);
}
.tgl-rail__tree .tgl-chip__count {
  background: var(--tgl-gold, #b8860b);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  min-width: 28px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tgl-tree-toggle {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--tgl-rail-muted);
  transition: transform 0.2s ease, background 0.2s ease;
}
.tgl-tree-toggle::before {
  content: "›";
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 1;
}
.tgl-tree-toggle:hover {
  background: var(--tgl-rail-hover);
  border-color: var(--tgl-rail-border);
}
.tgl-tree-toggle[aria-expanded="true"] {
  transform: rotate(90deg);
}
.tgl-tree-children {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--tgl-rail-border);
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.tgl-tree-children[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   4. SUPPORT CARD
   -------------------------------------------------------------------------- */
.tgl-rail--support {
  background: linear-gradient(160deg, rgba(184, 134, 11, 0.08), rgba(184, 134, 11, 0.02));
  border-color: rgba(184, 134, 11, 0.25);
}
.tgl-support__text {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--tgl-rail-muted);
}
.tgl-support__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.tgl-support__actions .tgl-btn { flex: 1 1 auto; justify-content: center; min-height: var(--tgl-touch); }

/* --------------------------------------------------------------------------
   5. BUTTON STANDARD
   -------------------------------------------------------------------------- */
.tgl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tgl-touch);
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.tgl-btn:hover { transform: translateY(-1px); }
.tgl-btn:active { transform: translateY(0); }
.tgl-btn--ghost {
  background: transparent;
  border-color: var(--tgl-rail-border);
  color: inherit;
}
.tgl-btn--ghost:hover { background: var(--tgl-rail-hover); }

/* --------------------------------------------------------------------------
   6. SEARCH SHORTCUTS (recent + popular)
   -------------------------------------------------------------------------- */
.tgl-searchshortcuts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.tgl-searchshortcuts__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tgl-searchshortcuts__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tgl-rail-muted);
}
.tgl-searchshortcuts__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.tgl-searchshortcuts__clear {
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 0.75rem;
  color: var(--tgl-rail-muted);
  cursor: pointer;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   7. SONG PAGE — media actions (v3.4.0)
   No embedded player is rendered; these are plain outbound links.
   -------------------------------------------------------------------------- */
.tgl-summary__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--tgl-line); }
.tgl-media-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 8px; font-size: 13px; font-weight: 700; text-decoration: none;
  background: var(--tgl-card, #fff); border: 1px solid var(--tgl-line); color: var(--tgl-navy);
}
.tgl-media-btn--youtube { background: #ff0000 !important; color: #fff !important; border: none !important; }
.tgl-media-btn--youtube:hover { background: #cc0000 !important; color: #fff !important; }
.tgl-media-btn__icon { font-size: 14px; }
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.tgl-media-btn:hover,
.tgl-media-btn:focus-visible {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.tgl-media-btn__icon { font-size: 1rem; line-height: 1; }
.tgl-media-btn--youtube { border-color: rgba(255, 0, 0, 0.35); }
.tgl-media-btn--track   { border-color: rgba(0, 0, 0, 0.2); }
@media (prefers-reduced-motion: reduce) {
  .tgl-media-btn { transition: none; }
  .tgl-media-btn:hover, .tgl-media-btn:focus-visible { transform: none; }
}

/* --------------------------------------------------------------------------
   8. STICKY SIDEBAR AD — in-flow, never overlaps the footer
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
  .tgl-sidebar__sticky {
    position: sticky;
    top: 88px;
  }
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  :root { --tgl-rail-pad: 14px; --tgl-rail-gap: 14px; }
  .tgl-rail__thumb { width: 48px; height: 48px; }
  .tgl-media-btn { flex: 1 1 100%; justify-content: center; }
}

/* --------------------------------------------------------------------------
   10. FOCUS, MOTION, DARK
   -------------------------------------------------------------------------- */
.tgl-rail a:focus-visible,
.tgl-rail button:focus-visible,
.tgl-chip:focus-visible,
.tgl-btn:focus-visible {
  outline: 3px solid var(--tgl-gold, #b8860b);
  outline-offset: 2px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .tgl-rail__songlink,
  .tgl-chip,
  .tgl-btn { transition: none; }
  .tgl-btn:hover { transform: none; }
}

/* v8.4.9 — light is the site default; system dark preference no longer
   flips these tokens. Dark mode is opt-in via the toggle (data-theme). */
:root[data-theme="dark"] {
  --tgl-rail-border: rgba(226, 232, 240, 0.14);
  --tgl-rail-surface: rgba(226, 232, 240, 0.03);
  --tgl-rail-hover: rgba(226, 232, 240, 0.08);
  --tgl-rail-muted: rgba(226, 232, 240, 0.6);
}
:root[data-theme="dark"] .tgl-rail__rank { color: rgba(226, 232, 240, 0.35); }

/* v4.1.0 — Song Summary category links are native WordPress term links. */
.tgl-summary-term{color:var(--tgl-link,#0A3A8A);text-decoration:none;border-bottom:1px solid transparent;}
.tgl-summary-term:hover,.tgl-summary-term:focus-visible{border-bottom-color:currentColor;}

/* ===========================================================================
 * PHASE 5.3 — MOBILE-FIRST HERO + ALPHABET DISCOVERY + PAGINATED LIBRARY
 * Presentation only. No query, no engine, no ad logic is touched here.
 * ======================================================================== */

/* --- Hero: compact on mobile, premium on desktop --------------------------- */
.tgl-hero--search { padding: 18px 0 22px; }
.tgl-hero--search .tgl-hero__inner { padding: 0 16px; }
.tgl-hero--search .tgl-hero__title {
  font-size: clamp(1.35rem, 6vw, 2.4rem);
  line-height: 1.2;
  margin: 4px 0 8px;
  color: var(--tgl-navy, #002147);
}
.tgl-hero--search .tgl-hero__sub {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 auto 14px;
  max-width: 62ch;
}
.tgl-hero__searchwrap { margin-bottom: 12px; }
.tgl-hero__quick { gap: 8px; }
.tgl-hero__chip { padding: 7px 12px; font-size: 0.82rem; }
.tgl-hero__stats { font-size: 0.82rem; margin-top: 10px; }

/* --- Alphabet: compact, touch friendly, never a wall of buttons ------------ */
.tgl-alphabet { padding-block: 16px; margin-bottom: 22px; }
.tgl-alphabet__group + .tgl-alphabet__group { margin-top: 14px; }
.tgl-alphabet__group > h3 { font-size: 0.78rem; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.tgl-alphabet__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}
.tgl-alphabet__grid > a {
  min-height: 44px;
  padding: 4px 2px;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.1;
  border: 1px solid var(--tgl-line, rgba(0, 33, 71, 0.12));
  color: var(--tgl-navy, #002147);
}
.tgl-alphabet__grid .tgl-alpha__count { font-size: 0.62rem; opacity: 0.65; }
.tgl-alphabet__grid > a.is-active {
  background: var(--tgl-navy, #002147);
  border-color: var(--tgl-navy, #002147);
  color: #fff;
}
.tgl-alphabet__grid > a.is-active .tgl-alpha__count { opacity: 0.85; }
.tgl-alphabet__grid--telugu > a { font-family: 'Noto Sans Telugu', system-ui, sans-serif; }

/* --- Song library rows: text-first, numbered, zero image space ------------- */
.tgl-songlist__reset { margin: 6px 0 0; font-size: 0.85rem; }
.tgl-songlist__reset a { color: var(--tgl-navy, #002147); text-decoration: none; font-weight: 600; }

.tgl-ts-songlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: tglsong var(--tgl-song-start, 0); }
.tgl-ts-songlist__item { background: var(--tgl-card); border: 1px solid var(--tgl-line); border-radius: 8px; }
.tgl-ts-songlist__item a {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 10px 12px;
}
.tgl-ts-songlist__item a::before {
  counter-increment: tglsong;
  content: counter(tglsong);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tgl-gold, #D4AF37);
  letter-spacing: -0.5px;
}
.tgl-ts-songlist__item .tgl-song-title {
  grid-column: 2;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--tgl-navy, #002147);
}
.tgl-ts-songlist__item .tgl-song-translit,
.tgl-ts-songlist__item .tgl-song-artist {
  grid-column: 2;
  font-size: 0.82rem;
  opacity: 0.72;
  line-height: 1.4;
}
/* Featured images stay assigned in WordPress but are structurally absent here. */
.tgl-ts-songlist__item img,
.tgl-ts-songlist__item .tgl-card-thumb { display: none !important; }

/* --- Pagination: compact on mobile, never overflows ------------------------ */
.tgl-pagination--songs { gap: 6px; margin: 22px 0 8px; }
.tgl-pagination--songs .page-numbers {
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 480px) {
  .tgl-pagination--songs .page-numbers.dots { display: none; }
  .tgl-pagination--songs .page-numbers { min-width: 36px; min-height: 36px; padding: 0 8px; font-size: 0.8rem; }
}

/* --- Desktop: use the width, stay dense ----------------------------------- */
@media (min-width: 768px) {
  .tgl-hero--search { padding: 34px 0 38px; }
  .tgl-alphabet__grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
  .tgl-ts-songlist { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1280px) {
  .tgl-ts-songlist { grid-template-columns: repeat(3, 1fr); }
}

/* --- PHASE 5.3: homepage rails, resources, support, thank-you ------------- */
.tgl-home-rail { margin: 22px auto; }
.tgl-home-rail .tgl-ts-songlist { counter-reset: tglsong 0; }

.tgl-home-res { margin: 22px auto; }
.tgl-home-res__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.tgl-home-res__grid a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--tgl-border, rgba(0,33,71,.12));
  border-radius: 12px;
  background: var(--tgl-surface, #fff);
  color: var(--tgl-navy, #002147);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
}
.tgl-home-res__grid a:hover,
.tgl-home-res__grid a:focus-visible { border-color: var(--tgl-gold, #D4AF37); }

.tgl-home-support {
  margin: 22px auto;
  padding: 18px 16px;
  border: 1px solid var(--tgl-border, rgba(0,33,71,.12));
  border-radius: 16px;
  background: var(--tgl-surface-alt, rgba(0,33,71,.03));
}
.tgl-home-support h2 { margin: 0 0 8px; font-size: 1.15rem; }
.tgl-home-support p { margin: 0 0 10px; font-size: .95rem; line-height: 1.7; }
.tgl-home-support__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.tgl-home-support__actions .tgl-btn { min-height: 44px; display: inline-flex; align-items: center; }

/* 14b. HOMEPAGE DONATE — mirrors the sidebar donate card. */
.tgl-home-donate {
  margin: 22px auto;
  padding: 22px 16px;
  border: 1px solid #FFD6DE;
  border-radius: 16px;
  background: #FFF5F7;
  text-align: center;
}
.tgl-home-donate .tgl-donate-card--home { max-width: 420px; margin: 0 auto; }
.tgl-home-donate .tgl-donate-card__header { justify-content: center; margin-bottom: 10px; }
.tgl-home-donate .tgl-donate-card__title { font-size: 1.25rem; }
.tgl-home-donate .tgl-donate-card__text { font-size: .95rem; margin-bottom: 18px; }
.tgl-home-donate .tgl-donate-card__btn { min-height: 48px; padding: 12px 28px; font-size: 1rem; }
@media (min-width: 640px) {
  .tgl-home-donate { padding: 28px 24px; }
  .tgl-home-donate .tgl-donate-card__title { font-size: 1.35rem; }
}

.tgl-home-thanks {
  margin: 18px auto 26px;
  text-align: center;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--tgl-muted, #4a5a6a);
}

@media (min-width: 640px) {
  .tgl-home-res__grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .tgl-home-res__grid { grid-template-columns: repeat(4, 1fr); }
  .tgl-home-support { padding: 22px 26px; }
}

/* ===========================================================================
 * PHASE 5.13.14 — HERO SEARCH: same-row on mobile + Customizer colours
 * Presentation only. No markup, no query and no ad logic is changed here.
 * ======================================================================== */
.tgl-hero__searchwrap .tgl-searchform {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  position: relative;
}
.tgl-hero__searchwrap .tgl-searchform__input {
  flex: 1 1 auto;
  min-width: 0;
}
.tgl-hero__searchwrap .tgl-searchform__submit {
  flex: 0 0 auto;
  white-space: nowrap;
  background: var(--tgl-nav-bg, var(--tgl-navy, #001B44));
  color: var(--tgl-nav-text, #FFFFFF);
  border: 0;
  transition: background 0.2s ease, color 0.2s ease;
}
.tgl-hero__searchwrap .tgl-searchform__submit:hover,
.tgl-hero__searchwrap .tgl-searchform__submit:focus,
.tgl-hero__searchwrap .tgl-searchform__submit:focus-visible,
.tgl-hero__searchwrap .tgl-searchform__submit:active {
  background: var(--tgl-gold, #F2A900);
  color: var(--tgl-nav-text, #FFFFFF);
}
.tgl-hero__searchwrap .tgl-searchform__submit:focus-visible {
  outline: 2px solid var(--tgl-nav-bg, var(--tgl-navy, #001B44));
  outline-offset: 2px;
}

/* Live-result panel: subtle busy hint, no layout jump. */
.tgl-hero__searchwrap .tgl-searchform.is-searching .tgl-searchform__input {
  background-image: linear-gradient(90deg, transparent 0%, rgba(0, 27, 68, 0.08) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: tgl-suggest-busy 900ms linear infinite;
}
@keyframes tgl-suggest-busy {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tgl-hero__searchwrap .tgl-searchform.is-searching .tgl-searchform__input { animation: none; }
}
.tgl-suggest__text { display: flex; flex-direction: column; min-width: 0; }
.tgl-suggest__sub {
  font-size: 0.82rem;
  opacity: 0.7;
  overflow-wrap: anywhere;
}
.tgl-searchform__suggestions .tgl-suggest__empty {
  padding: 12px;
  font-size: 0.9rem;
  opacity: 0.75;
  text-align: center;
}

/* Button internals: label by default, icon reserved for very narrow phones. */
.tgl-hero__searchwrap .tgl-searchform__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* The hero icon is reserved for very narrow phones. */
.tgl-hero__searchwrap .tgl-searchform__icon { display: none; flex: 0 0 auto; }

/* Phones: keep the label, trim only the horizontal padding. */
@media (max-width: 640px) {
  .tgl-hero__searchwrap .tgl-searchform { flex-wrap: nowrap; gap: 8px; }
  .tgl-hero__searchwrap .tgl-searchform__input {
    height: 48px;
    font-size: 1rem;
    padding: 0 14px;
  }
  .tgl-hero__searchwrap .tgl-searchform__submit {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 16px;
    width: auto;
    font-size: 0.95rem;
  }
}
/* 390 / 375 / 360px: comfortable input, touch-sized labelled button. */
@media (max-width: 400px) {
  .tgl-hero__searchwrap .tgl-searchform { gap: 7px; }
  .tgl-hero__searchwrap .tgl-searchform__input { padding: 0 12px; }
  .tgl-hero__searchwrap .tgl-searchform__submit { padding: 0 14px; }
}
@media (max-width: 360px) {
  .tgl-hero__searchwrap .tgl-searchform { gap: 6px; }
  .tgl-hero__searchwrap .tgl-searchform__submit { padding: 0 12px; }
}
/* 320px class devices: icon-only button, label kept for assistive tech. */
@media (max-width: 340px) {
  .tgl-hero__searchwrap .tgl-searchform__input { font-size: 0.95rem; padding: 0 11px; }
  .tgl-hero__searchwrap .tgl-searchform__icon { display: block; }
  .tgl-hero__searchwrap .tgl-searchform__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .tgl-hero__searchwrap .tgl-searchform__submit {
    gap: 0;
    width: 48px;
    min-width: 48px;
    padding: 0;
  }
}

/* ===========================================================================
 * PHASE 5.13.16 — MOBILE HERO: edge-to-edge background + guaranteed one-row search
 * Presentation only. Mobile scope only. No markup, query or ad logic changed.
 * ======================================================================== */
@media (max-width: 767px) {
  /* Hero band spans the full viewport: no side gutters around the gradient. */
  .tgl-hero,
  .tgl-hero--search {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }
  /* Content keeps a readable inset while the background stays full-bleed. */
  .tgl-hero .tgl-hero__inner,
  .tgl-hero--search .tgl-hero__inner {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Hard guarantee: input and Search button stay on the same row. */
  .tgl-hero__searchwrap .tgl-searchform {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }
  .tgl-hero__searchwrap .tgl-searchform__input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
  }
  .tgl-hero__searchwrap .tgl-searchform__submit {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 45% !important;
    white-space: nowrap !important;
  }
}
@media (max-width: 340px) {
  .tgl-hero__searchwrap .tgl-searchform__submit {
    width: 48px !important;
    min-width: 48px !important;
    padding: 0 !important;
  }
}
