/* =====================================================================
   சித்தப்பித்தன் — public theme
   Warm "parchment & ink" palette, Tamil-first typography.
   ===================================================================== */

/* ---------------------------------------------------------------------
   நிறத் தோற்றம் (theme)

   மூன்று நிலைகள்:
     · data-theme="light"  → வெளிச்சம், OS எதுவாக இருந்தாலும்
     · data-theme="dark"   → இருள், OS எதுவாக இருந்தாலும்
     · attribute இல்லை     → OS-ன் விருப்பப்படி (தானியங்கி)

   PHP cookie-ஐப் படித்து <html>-ல் attribute-ஐ *server-லேயே* வைக்கிறது.
   எனவே பக்கம் ஏறும்போது தவறான நிறம் ஒரு கணம் மின்னாது.
   --------------------------------------------------------------------- */

:root {
    color-scheme: light;

    --bg:          #faf7f1;
    --bg-alt:      #f3ede2;
    --surface:     #ffffff;
    --ink:         #2c2418;
    --ink-soft:    #574a39;
    --muted:       #7d705b;
    --border:      #e7ded0;
    --brand:       #a8482a;
    --brand-dark:  #86341c;
    --brand-soft:  #f7ece7;
    --gold:        #c08a2e;
    --warn-bg:     #fff3cd;
    --warn-ink:    #7a5b00;
    --warn-border: #ffe08a;
    --radius:      14px;
    --shadow-sm:   0 2px 10px rgba(90, 60, 20, .06);
    --shadow-md:   0 10px 30px rgba(90, 60, 20, .10);
    --shadow-lg:   0 20px 60px rgba(90, 60, 20, .14);

    --font-ui:     'Anek Tamil', 'Segoe UI', system-ui, sans-serif;
    --font-read:   'Noto Serif Tamil', 'Latha', Georgia, serif;
    /* இவை மூன்றும் அமைப்புகளில் தனியாகத் தேர்ந்தால் மட்டும் மாறும்;
       இல்லையெனில் தள எழுத்துருவையே பின்பற்றும். */
    --font-title:  var(--font-ui);   /* படைப்பின் தலைப்பு */
    --font-brand:  var(--font-ui);   /* தளத்தின் பெயர் */
    --font-menu:   var(--font-ui);   /* மேல் பட்டி */
}

/* இருள் மதிப்புகள் — ஒரே இடத்தில் வைத்து இரண்டு தேர்வுகளிலும் பயன்படுத்த
   முடியாது (CSS-ல் variable-களை அப்படி மறுபயன்படுத்த வழியில்லை), எனவே
   இரண்டு தொகுதிகள். ஒன்றை மாற்றினால் மற்றதையும் மாற்றவும். */

/* 1. தானியங்கி — பயனர் வெளிப்படையாக light கேட்காதவரை */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg:         #16130f;
        --bg-alt:     #1e1a15;
        --surface:    #201b16;
        --ink:        #f0e7da;
        --ink-soft:   #d6c9b6;
        --muted:      #a3947f;
        --border:     #332c24;
        --brand:      #e0794f;
        --brand-dark: #c8613a;
        --brand-soft: #2c211b;
        --warn-bg:    #3a2f12;
        --warn-ink:   #f2d79a;
        --warn-border:#5d4a1e;
        --shadow-sm:  0 2px 10px rgba(0, 0, 0, .35);
        --shadow-md:  0 10px 30px rgba(0, 0, 0, .45);
        --shadow-lg:  0 20px 60px rgba(0, 0, 0, .55);
    }
}

/* 2. வெளிப்படையான தேர்வு — OS-ஐ மீறும் */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg:         #16130f;
    --bg-alt:     #1e1a15;
    --surface:    #201b16;
    --ink:        #f0e7da;
    --ink-soft:   #d6c9b6;
    --muted:      #a3947f;
    --border:     #332c24;
    --brand:      #e0794f;
    --brand-dark: #c8613a;
    --brand-soft: #2c211b;
    --warn-bg:    #3a2f12;
    --warn-ink:   #f2d79a;
    --warn-border:#5d4a1e;
    --shadow-sm:  0 2px 10px rgba(0, 0, 0, .35);
    --shadow-md:  0 10px 30px rgba(0, 0, 0, .45);
    --shadow-lg:  0 20px 60px rgba(0, 0, 0, .55);
}

/* ---------------------------------------------------------------------
   Bootstrap-ஐ நம் நிறங்களுக்குக் கொண்டுவரல்
   ---------------------------------------------------------------------
   Bootstrap-ன் அட்டவணை, படிவம், dropdown எல்லாம் தன் சொந்த variable-களைப்
   பார்க்கின்றன (--bs-body-bg …). அவற்றை ஒவ்வொரு component-ஆக மீறுவதற்குப்
   பதிலாக, ஒரே இடத்தில் நம் variable-களுக்கே இணைத்துவிடுகிறோம் — நம்முடையவை
   தோற்றத்துக்கேற்ப மாறுவதால், Bootstrap-ம் இரு தோற்றத்திலும் தானாகப் பொருந்தும்.

   [data-bs-theme="light|dark"] என்ற இரட்டைத் தேர்வு Bootstrap-ன் சொந்த
   விதிகளை மீறத் தேவை (அவற்றின் specificity ஒரே அளவு).
   --------------------------------------------------------------------- */
:root,
:root[data-bs-theme="light"],
:root[data-bs-theme="dark"] {
    --bs-body-bg:          var(--bg);
    --bs-body-color:       var(--ink);
    --bs-emphasis-color:   var(--ink);
    --bs-heading-color:    var(--ink);
    --bs-secondary-color:  var(--muted);
    --bs-tertiary-color:   var(--muted);
    --bs-secondary-bg:     var(--bg-alt);
    --bs-tertiary-bg:      var(--bg-alt);
    --bs-border-color:     var(--border);
    --bs-link-color:       var(--brand);
    --bs-link-hover-color: var(--brand-dark);
    --bs-code-color:       var(--brand);
    --bs-highlight-bg:     var(--brand-soft);
}

/* அட்டவணை — தனக்கென பின்னணி இல்லை; இருக்கும் அட்டையின் நிறமே தெரியட்டும்.
   (இதனால்தான் நிர்வாகப் பட்டியல்கள் panel-லிருந்து வேறுபட்டுத் தெரிந்தன.) */
.table {
    --bs-table-bg:            transparent;
    --bs-table-color:         var(--ink);
    --bs-table-border-color:  var(--border);
    --bs-table-hover-bg:      var(--bg-alt);
    --bs-table-hover-color:   var(--ink);
    --bs-table-striped-bg:    var(--bg-alt);
    --bs-table-striped-color: var(--ink);
    --bs-table-active-bg:     var(--brand-soft);
    --bs-table-active-color:  var(--ink);
}

/* உள்ளீடுகள் + dropdown — background-color மட்டும் (background shorthand
   போட்டால் form-select-ன் அம்புக்குறி அழிந்துவிடும்). */
.form-control,
.form-select {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--ink);
}
.form-control:focus,
.form-select:focus {
    background-color: var(--surface);
    border-color: var(--brand);
    color: var(--ink);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 18%, transparent);
}
.form-control::placeholder { color: var(--muted); opacity: 1; }
.form-control:disabled,
.form-select:disabled { background-color: var(--bg-alt); color: var(--muted); }

/* விரியும் பட்டியலின் உள் உருப்படிகள் — இவை OS வரைவது, எனவே தனியாக */
.form-select option,
.form-control option { background-color: var(--surface); color: var(--ink); }

.form-check-input { background-color: var(--surface); border-color: var(--border); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 18%, transparent);
}

.dropdown-menu {
    --bs-dropdown-bg:                var(--surface);
    --bs-dropdown-color:             var(--ink);
    --bs-dropdown-border-color:      var(--border);
    --bs-dropdown-link-color:        var(--ink-soft);
    --bs-dropdown-link-hover-color:  var(--brand);
    --bs-dropdown-link-hover-bg:     var(--bg-alt);
    --bs-dropdown-link-active-color: #fff;
    --bs-dropdown-link-active-bg:    var(--brand);
    --bs-dropdown-divider-bg:        var(--border);
}
.modal      { --bs-modal-bg: var(--surface); --bs-modal-color: var(--ink); --bs-modal-border-color: var(--border); }
.offcanvas  { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--ink); --bs-offcanvas-border-color: var(--border); }
.list-group { --bs-list-group-bg: var(--surface); --bs-list-group-color: var(--ink); --bs-list-group-border-color: var(--border); }
.card       { --bs-card-bg: var(--surface); --bs-card-color: var(--ink); --bs-card-border-color: var(--border); }

/* --------------------------- theme toggle -------------------------- */
.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-alt);
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }
/* அழுத்தினால் என்ன ஆகும் என்பதைக் காட்டும் icon:
   வெளிச்சத்தில் நிலவு (→ இருளுக்கு), இருளில் சூரியன் (→ வெளிச்சத்திற்கு) */
.theme-toggle .ti-to-light { display: none; }
.theme-toggle .ti-to-dark  { display: block; }

:root[data-theme="dark"] .theme-toggle .ti-to-light { display: block; }
:root[data-theme="dark"] .theme-toggle .ti-to-dark  { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .ti-to-light { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .ti-to-dark  { display: none; }
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.container.narrow { max-width: 780px; }

/* ----------------------------- buttons ----------------------------- */
.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 500;
    border-radius: 999px;
    padding: .55rem 1.3rem;
}
.btn-brand:hover, .btn-brand:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}
.btn-outline-brand {
    border: 1px solid var(--brand);
    color: var(--brand);
    background: transparent;
    font-weight: 500;
    border-radius: 999px;
    padding: .55rem 1.3rem;
}
.btn-outline-brand:hover {
    background: var(--brand);
    color: #fff;
}

/* ------------------------------ header -----------------------------
   இரண்டு வரிசை:
     1. .header-top — logo/பெயர் (இடது)  ·  கருவிகள் (வலது)
     2. .header-nav — முழு அகல மெனு
   ------------------------------------------------------------------- */
.site-header {
    background: var(--surface); /* color-mix ஆதரவு இல்லாத browser-க்கு */
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-top > .container {
    display: flex; align-items: center; gap: 1rem;
    padding-block: .55rem;
}
.site-brand {
    display: flex; align-items: center; gap: .65rem;
    margin-inline-end: auto; min-width: 0;
}
.site-brand:hover .brand-logo { box-shadow: var(--shadow-md); }

.header-tools {
    display: flex; align-items: center; gap: .55rem;
    flex-wrap: wrap; justify-content: flex-end;
}
.header-tools .btn-outline-brand { padding: .35rem 1rem; }

.menu-btn {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-alt); color: var(--ink-soft);
}
.menu-btn:hover { color: var(--brand); border-color: var(--brand); }

.header-nav { border-top: 1px solid var(--border); }
.main-menu {
    font-family: var(--font-menu);   /* துணைப் பட்டிகளுக்கும் இதுவே இறங்கும் */
    display: flex; flex-wrap: wrap; align-items: center;
    list-style: none; margin: 0; padding: 0; gap: .1rem;
}
.main-menu a {
    display: block;
    padding: .6rem .85rem;
    border-radius: 999px;
    color: var(--ink-soft);
    font-weight: 500;
    white-space: nowrap;
}
.main-menu a:hover { color: var(--brand); background: var(--brand-soft); }
.main-menu a.active { color: var(--brand); background: var(--brand-soft); }

.mobile-search { padding: .25rem 0 .75rem; }
.mobile-search .form-control { width: 100%; }

/* விரியும் மெனு — பிரிவுகள் அதிகமானால் ஒரே நெடுவரிசையில் மிக நீளம்.
   எனவே கட்டமாக: அகலம் இருந்தால் மூன்று, குறுகிய திரையில் ஒன்று. */
@media (max-width: 991.98px) {
    .header-nav .main-menu {
        display: grid;
        grid-template-columns: 1fr;
        gap: .15rem;
        align-items: stretch;
        padding: .5rem 0;
    }
    .main-menu a { border-radius: 8px; white-space: normal; }
    .brand-tagline { display: none; }
}
@media (min-width: 480px) and (max-width: 991.98px) {
    .header-nav .main-menu { grid-template-columns: repeat(3, 1fr); column-gap: .5rem; }
}

.navbar-brand { display: flex; align-items: center; gap: .65rem; }
.brand-mark {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--gold));
    color: #fff; font-weight: 700; font-size: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.brand-mark.lg { width: 56px; height: 56px; font-size: 1.7rem; border-radius: 16px; }

/* தள logo — வெளிப்புற laurel வளையம் நீக்கப்பட்டு, வட்டமாக வெட்டப்பட்ட PNG.
   மூலைகள் வெளிப்படையானவை, எனவே பின்னணி நிறம் தேவையில்லை. */
.brand-logo {
    width: 44px; height: 44px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}
.brand-logo.lg {
    width: 84px; height: 84px;
    box-shadow: var(--shadow-md);
}
.navbar-brand:hover .brand-logo { box-shadow: var(--shadow-md); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: var(--font-brand);
    font-weight: 700; font-size: 1.3rem; color: var(--ink); line-height: 1.15;
}
.brand-tagline {
    display: block;
    color: var(--muted); font-size: .74rem; letter-spacing: .02em;
    line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.nav-search { position: relative; }
.nav-search .form-control {
    border-radius: 999px; padding-inline-end: 2.2rem;
    border-color: var(--border); background-color: var(--bg-alt); color: var(--ink);
    min-width: 0; width: 150px;
}
.nav-search .btn-search {
    position: absolute; inset-inline-end: 2px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--muted);
}

/* --------------------------- மொழி மாற்றி --------------------------- */
.lang-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-alt);
}
.lang-toggle a {
    padding: .28rem .7rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.4;
}
.lang-toggle a:hover { color: var(--brand); }
.lang-toggle a.active {
    background: var(--brand);
    color: #fff;
}

/* ------------------------------- hero ------------------------------ */
.hero {
    /* slider நிழலுக்காக விட்ட இடம் திரையை மீறி கிடைமட்ட scrollbar வராமல் இருக்க */
    overflow: hidden;
    padding: 4.5rem 0 3.5rem;
    background:
        radial-gradient(900px 400px at 85% -10%, var(--brand-soft), transparent 70%),
        var(--bg);
}
.hero-kicker {
    color: var(--brand); font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; font-size: .78rem; margin-bottom: .5rem;
}
.hero-title {
    /* முகப்பில் பெரிதாக நிற்பதும் தளத்தின் பெயரே — எனவே அதே எழுத்துரு */
    font-family: var(--font-brand);
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 700; line-height: 1.15; margin-bottom: 1rem;
}
.hero-lead {
    font-family: var(--font-read);
    color: var(--ink-soft); font-size: 1.06rem; line-height: 1.9;
    max-width: 46ch; margin-bottom: 1.6rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.hero-stat { margin-top: 1.4rem; color: var(--muted); font-size: .92rem; }
.hero-stat strong { color: var(--ink); }

.hero-feature {
    display: block; position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 1.8rem;
    box-shadow: var(--shadow-md);
    transition: transform .25s ease, box-shadow .25s ease;
}
.hero-feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-badge {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--gold); color: #fff;
    font-size: .74rem; font-weight: 600;
    padding: .25rem .7rem; border-radius: 999px;
}
.feature-cat { display: block; color: var(--brand); font-weight: 600; font-size: .85rem; margin-top: .9rem; }
.feature-title { font-size: 1.7rem; font-weight: 700; color: var(--ink); margin: .35rem 0 .5rem; }
.feature-sub { color: var(--muted); font-size: .95rem; margin-bottom: .6rem; }
.feature-excerpt {
    font-family: var(--font-read); color: var(--ink-soft);
    line-height: 1.9; font-size: .96rem; margin-bottom: 1rem;
}
.feature-more { color: var(--brand); font-weight: 600; font-size: .92rem; }

/* சமீபத்தில் சேர்த்தவை — முகப்பு slider.
   card சட்டம் இல்லை: பின்னணி ஊடுருவும், கோடு இல்லை, நிழல் இல்லை.
   உரை மட்டுமே மாறும். எழுத்து அமைப்பு மட்டும் post card-ன் அதே வகுப்புகள். */
.hero-recent .carousel-inner {
    /* fade முறையில் slide-கள் 100% நகர்வதில்லை — clipping தேவையில்லை */
    overflow: visible;
}
.hero-recent .card-body {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.hero-recent .card-title { font-size: 1.45rem; }
/* முகப்புச் slider-ல் துணைத் தலைப்பு வேண்டாம் — கவிதையே பேசட்டும் */
.hero-recent .card-subtitle { display: none; }
/* சட்டமில்லாத இடத்தில் புள்ளிக்கோடு தனியாகத் தொங்கும் — நீக்கிவிடுகிறோம் */
.hero-recent .card-meta { border-top: 0; padding-top: .4rem; }
/* slide மாறும்போது உயரம் துள்ளாமல் இருக்க */
.hero-recent .carousel-item { min-height: 230px; }

/* மென்மையான நகர்வு + மங்கி வந்து மங்கி மறையும் விளைவு.
   அடிப்படை .carousel-fade — அதனுடன் சிறிய கிடைமட்ட நகர்வையும் சேர்க்கிறோம்.
   (Bootstrap-இன் விதிகளை மீற .hero-recent.carousel-fade என இரட்டை class) */
.hero-recent.carousel-fade .carousel-item {
    opacity: 0;
    transform: translateX(28px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.22, .61, .36, 1);
}
.hero-recent.carousel-fade .carousel-item-prev { transform: translateX(-28px); }

/* உள்ளே வருவது — நடுவில், முழுத் தெளிவு */
.hero-recent.carousel-fade .carousel-item.active,
.hero-recent.carousel-fade .carousel-item-next.carousel-item-start,
.hero-recent.carousel-fade .carousel-item-prev.carousel-item-end {
    opacity: 1;
    transform: translateX(0);
}

/* வெளியே செல்வது — எதிர்த் திசையில் நகர்ந்து மங்கும்
   (Bootstrap இதற்கு transition: opacity 0s .6s வைக்கிறது; அதை மீறுகிறோம்) */
.hero-recent.carousel-fade .active.carousel-item-start,
.hero-recent.carousel-fade .active.carousel-item-end {
    opacity: 0;
    transition: opacity .7s ease, transform .7s cubic-bezier(.22, .61, .36, 1);
}
.hero-recent.carousel-fade .active.carousel-item-start { transform: translateX(-28px); }
.hero-recent.carousel-fade .active.carousel-item-end   { transform: translateX(28px); }

@media (prefers-reduced-motion: reduce) {
    .hero-recent.carousel-fade .carousel-item,
    .hero-recent.carousel-fade .active.carousel-item-start,
    .hero-recent.carousel-fade .active.carousel-item-end { transform: none; transition: opacity .3s ease; }
}

/* அகலமான சிறப்புப் படைப்பு — "சமீபத்தியவை" பகுதியின் மேலே */
.feature-wide { padding: 2rem 2.2rem; }
.feature-wide .feature-title { font-size: 2rem; }
.feature-wide .feature-excerpt { max-width: 70ch; }

/* ----------------------------- sections ---------------------------- */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
    font-size: 1.6rem; font-weight: 700; margin-bottom: 1.6rem;
    position: relative; padding-inline-start: .9rem;
}
.section-title::before {
    content: ''; position: absolute; inset-inline-start: 0; top: .25em; bottom: .25em;
    width: 4px; border-radius: 4px;
    background: linear-gradient(var(--brand), var(--gold));
}
.link-more { font-weight: 600; font-size: .95rem; }

/* ------------------------- sidebar panels -------------------------- */
.side-sticky {
    position: sticky;
    top: 90px;              /* sticky nav-க்குக் கீழே */
}
.side-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.side-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1.1rem;
    border-bottom: 1px solid var(--border);
}
.side-head h2 {
    font-size: 1.02rem; font-weight: 700; margin: 0; color: var(--ink);
}
.side-head a { color: var(--muted); font-size: .9rem; }
.side-head a:hover { color: var(--brand); }

/* ------------------- category cards (sidebar) ---------------------- */
.cat-mini-list { display: flex; flex-direction: column; padding: .4rem; }

.cat-mini {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .7rem;
    border-radius: 10px;
    transition: background .18s ease, transform .18s ease;
}
.cat-mini:hover { background: var(--bg-alt); transform: translateX(2px); }

.cat-mini-icon {
    flex: 0 0 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--brand-soft); color: var(--brand);
    font-size: .95rem;
}
.cat-mini-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cat-mini-name {
    color: var(--ink); font-weight: 600; font-size: .95rem; line-height: 1.35;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-mini:hover .cat-mini-name { color: var(--brand); }
.cat-mini-count { color: var(--muted); font-size: .78rem; }
.cat-mini-arrow { color: var(--border); font-size: .8rem; }
.cat-mini:hover .cat-mini-arrow { color: var(--brand); }

.cat-mini-add .cat-mini-icon {
    background: transparent;
    border: 1px dashed var(--border);
}
.cat-mini-add:hover .cat-mini-icon { border-color: var(--brand); }

/* --------------------------- category tiles ------------------------ */
.cat-tile {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: .5rem; padding: 1.6rem 1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); height: 100%;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.cat-tile:hover {
    transform: translateY(-3px); border-color: var(--brand);
    box-shadow: var(--shadow-md);
}
.cat-icon {
    display: grid; place-items: center;
    width: 52px; height: 52px; border-radius: 14px;
    background: var(--brand-soft); color: var(--brand); font-size: 1.35rem;
}
.cat-name { font-weight: 600; color: var(--ink); font-size: 1.05rem; }
.cat-count { color: var(--muted); font-size: .82rem; }

/* உள்நுழைந்தவர்களுக்கு மட்டும் தெரியும் "புதிய பிரிவு" tile */
.cat-tile-add {
    border-style: dashed;
    background: transparent;
}
.cat-tile-add .cat-icon { background: transparent; border: 1px dashed var(--border); }
.cat-tile-add:hover .cat-icon { border-color: var(--brand); }

/* ----------------------------- post card --------------------------- */
.post-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.post-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand);
}
.card-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card .card-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.card-cat {
    font-size: .8rem; font-weight: 600; color: var(--brand);
    display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .5rem;
}
.card-title {
    font-family: var(--font-title);
    font-size: 1.18rem; font-weight: 600; line-height: 1.45; margin-bottom: .35rem;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); }
.card-subtitle { color: var(--muted); font-size: .88rem; margin-bottom: .5rem; }
.card-excerpt {
    font-family: var(--font-read); color: var(--ink-soft);
    font-size: .92rem; line-height: 1.85; flex: 1; margin-bottom: 1rem;
}

/* card-ல் கவிதை முன்னோட்டம் — வரிகள் சேமித்தபடியே, மடங்காமல்.
   அகலம் தாண்டும் வரி மடங்காமல் "…" ஆகக் குறுக்கப்படும். */
.card-verse {
    display: flex; flex-direction: column;
    min-width: 0;
    flex: 1;
    margin-bottom: 1rem;
    font-family: var(--font-read);
    color: var(--ink-soft);
    font-size: .92rem;
    line-height: 1.9;
}
.card-verse .vp-line {
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.feature-verse { font-size: 1rem; line-height: 2; margin-bottom: 1.1rem; }
.card-meta {
    display: flex; gap: 1rem; color: var(--muted); font-size: .8rem;
    padding-top: .8rem; border-top: 1px dashed var(--border);
}

/* --------------------------- popular list -------------------------- */
.popular-list { list-style: none; padding: 0; margin: 0; counter-reset: pl; }
.popular-list li {
    display: flex; align-items: center; gap: 1rem;
    padding: .9rem 0; border-bottom: 1px solid var(--border);
}
.popular-list li:last-child { border-bottom: 0; }
.popular-list .rank {
    flex: 0 0 38px; height: 38px; display: grid; place-items: center;
    border-radius: 10px; background: var(--brand-soft); color: var(--brand);
    font-weight: 700;
}
.popular-list a { display: flex; flex-direction: column; min-width: 0; }
.pl-title { color: var(--ink); font-weight: 600; }
.popular-list a:hover .pl-title { color: var(--brand); }
.pl-meta { color: var(--muted); font-size: .82rem; }

/* அதிகம் படிக்கப்பட்டவை — tile ஆக. கோட்டுப் பட்டியலுக்குப் பதிலாக tile,
   ஏனெனில் நெடுவரிசைகளுக்கு இடையே கீழ்க்கோடு சீராகத் தெரியாது.
   480-ல் இரண்டு, 992-ல் மூன்று. 9 உருப்படி = சரியாக 3 வரிசை. */
@media (min-width: 480px) {
    .popular-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: .9rem;
    }
    .popular-list li {
        padding: .9rem 1.1rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
    }
    /* மேலே உள்ள :last-child { border-bottom: 0 } tile-க்குப் பொருந்தாது */
    .popular-list li:last-child { border-bottom: 1px solid var(--border); }
    .popular-list li:hover {
        border-color: var(--brand);
        box-shadow: var(--shadow-sm);
        transform: translateY(-2px);
    }
}
@media (min-width: 992px) {
    .popular-list { grid-template-columns: repeat(3, 1fr); }
}

/* --------------------------- collections --------------------------- */

/* தொகுப்புப் பக்கத்தின் முன்னேற்றப் பட்டை */
.coll-progress { max-width: 460px; margin: 1.2rem auto 0; }
.coll-progress-bar {
    display: block; width: 100%;
    height: 10px; border-radius: 999px; overflow: hidden;
    background: var(--bg-alt); border: 1px solid var(--border);
}
.coll-progress-bar > span {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--gold));
    transition: width .6s ease;
}
.coll-progress-text { color: var(--muted); font-size: .9rem; margin-top: .6rem; }
.coll-progress-text strong { color: var(--brand); font-size: 1.05rem; }

/* எண் வரிசைப் பட்டியல் */
.coll-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.coll-list a {
    display: flex; align-items: center; gap: 1rem;
    padding: .9rem 1.1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.coll-list a:hover {
    border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-2px);
}
.cl-no {
    flex: 0 0 46px; height: 46px; display: grid; place-items: center;
    border-radius: 12px; background: var(--brand-soft); color: var(--brand);
    font-weight: 700; font-size: 1.05rem;
}
.cl-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cl-title { color: var(--ink); font-weight: 600; }
.coll-list a:hover .cl-title { color: var(--brand); }
.cl-sub, .cl-meta { color: var(--muted); font-size: .82rem; }
.cl-go { color: var(--muted); font-size: .85rem; }
.coll-list a:hover .cl-go { color: var(--brand); }

/* படைப்புப் பக்கத்தில் "இந்தத் தொடரின் 42 / 108" குறி */
.series-chip {
    display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    background: var(--brand-soft); border: 1px solid var(--border);
    border-radius: 999px; padding: .35rem .5rem .35rem .9rem;
    color: var(--brand); font-size: .88rem; font-weight: 600;
    margin-bottom: .9rem;
}
.series-chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.series-chip .sc-no {
    background: var(--brand); color: #fff;
    border-radius: 999px; padding: .1rem .6rem; font-size: .82rem;
}

/* தொகுப்புக்குள் முன் / பின் */
.series-nav {
    margin-top: 2.5rem; padding: 1.1rem 1.2rem;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.sn-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .5rem;
    color: var(--muted); font-size: .88rem; font-weight: 600;
    margin-bottom: .8rem;
}
.sn-head a { color: var(--brand); }

/* ------------------- படைப்புப் பக்கத்தின் பக்கவாட்டு மரம் -------------
   1200px-க்குக் கீழ் .single-layout வெறும் block — படைப்பு முன்பு போலவே,
   மரம் அதற்குக் கீழே. அகலம் இருந்தால் மட்டுமே இரு நெடுவரிசை. */
.tree-side {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .8rem;
    margin: 2rem auto 0; max-width: 720px;
}
.tree-side-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .5rem; padding: .2rem .5rem .7rem;
    color: var(--ink); font-weight: 600; font-size: .95rem;
    border-bottom: 1px solid var(--border); margin-bottom: .5rem;
}
.tree-side-head a { color: var(--muted); font-size: .85rem; }
.tree-side-head a:hover { color: var(--brand); }

/* பார்வை முறை மாற்றி — பிரிவு வாரியா / தொகுப்பு வாரியா */
.tree-modes {
    display: flex; gap: 0; margin-bottom: .6rem;
    border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.tree-mode {
    flex: 1; text-align: center;
    padding: .4rem .5rem; font-size: .82rem; font-weight: 600;
    color: var(--muted); background: var(--surface);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tree-mode + .tree-mode { border-inline-start: 1px solid var(--border); }
.tree-mode:hover { color: var(--brand); }
.tree-mode.active { background: var(--brand); color: #fff; }

/* வடிகட்டிப் பெட்டி */
.tree-find { position: relative; margin-bottom: .6rem; }
.tree-find i {
    position: absolute; inset-inline-start: .7rem; top: 50%;
    transform: translateY(-50%); color: var(--muted); font-size: .8rem;
}
.tree-find .form-control { padding-inline-start: 2.1rem; font-size: .9rem; }
.tree-none { color: var(--muted); font-size: .86rem; padding: .6rem .8rem; margin: 0; }

/* இப்போது படிப்பது */
.tree-leaf.is-here {
    background: var(--brand-soft);
    box-shadow: inset 3px 0 0 var(--brand);
}
.tree-leaf.is-here .tree-name { color: var(--brand); font-weight: 600; }

@media (min-width: 1200px) {
    .single-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 2rem;
        align-items: start;
        max-width: 1340px;
        margin-inline: auto;
        padding-inline: 1.25rem;
        /* மேல் இடைவெளியை இங்கே வைத்து, .single-head-ல் இருந்து எடுக்கிறோம்.
           இதனால் இரு நெடுவரிசையும் **ஒரே உயரத்தில்** தொடங்கும் — வலப்பக்கம்
           மேலே காலியாகத் தெரியாது. */
        padding-block-start: 2.8rem;
    }
    .single-layout .single .single-head { padding-block-start: 0; }
    .single-layout > .tree-side { align-self: start; }
    /* நெடுவரிசைக்குள் வந்துவிட்டதால் உள்ளே இருக்கும் container-கள்
       தங்கள் சொந்த அகலக் கட்டுப்பாட்டை விட வேண்டும் */
    .single-layout .single .container,
    .single-layout .single .container.narrow {
        max-width: none; margin-inline: 0; padding-inline: 0; width: auto;
    }
    .single-layout .single .section-alt {
        border-radius: var(--radius); padding-inline: 1.5rem;
    }
    /* sticky top — தலைப்புப் பட்டையின் உயரத்துக்கு (இரு வரிசை) சற்று மேல் */
    .tree-side {
        position: sticky; top: 5.5rem;
        margin: 0; max-width: none;
        max-height: calc(100vh - 7rem);
        overflow-y: auto; overscroll-behavior: contain;
    }
    /* குறுகிய இடம் — தேதி வேண்டாம் */
    .tree-side .tree-date { display: none; }
    .tree-side .tree-kids { margin-inline-start: .5rem; padding-inline-start: .6rem; }
    .tree-side .tree-row { padding: .45rem .6rem; }
    .tree-side .tree-leaf { font-size: .88rem; }
}

/* முகப்பில் தொகுப்பு அட்டைகள் */
.coll-tiles { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .coll-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .coll-tiles { grid-template-columns: repeat(3, 1fr); } }
.coll-tile {
    display: flex; flex-direction: column; gap: .5rem;
    padding: 1.2rem 1.3rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.coll-tile:hover {
    border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-3px);
}
.ct-head { display: flex; align-items: center; gap: .6rem; color: var(--brand); font-size: 1.3rem; }
/* அட்டையில் தொகுப்பின் பெயர் — படைப்பு அட்டையின் தலைப்போடு
   ஒரே எழுத்துருவில் இருக்க வேண்டும், அருகருகே நிற்பவை. */
.ct-name {
    font-family: var(--font-title);
    color: var(--ink); font-weight: 600; font-size: 1.05rem;
}
.coll-tile:hover .ct-name { color: var(--brand); }
.ct-desc { color: var(--muted); font-size: .87rem; font-family: var(--font-read); margin: 0; }
.ct-count { color: var(--muted); font-size: .85rem; }
.ct-count strong { color: var(--brand); }

/* ---------------------------- page head ---------------------------- */
.page-head {
    padding: 3rem 0 2rem; text-align: center;
    background: radial-gradient(700px 300px at 50% -40%, var(--brand-soft), transparent 70%);
    border-bottom: 1px solid var(--border);
}
.page-head-icon {
    display: inline-grid; place-items: center;
    width: 60px; height: 60px; border-radius: 18px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--brand); font-size: 1.5rem; margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
/* பக்கத்தின் பெரிய தலைப்பு — தொகுப்பு, பிரிவு, தேடல், பற்றி…
   படைப்பின் தலைப்பு எந்த எழுத்துருவிலோ இதுவும் அதே. இரண்டும்
   "தலைப்பு" என்ற ஒரே வகைதானே; வெவ்வேறாக இருந்தால் உறுத்தும். */
.page-head-title {
    font-family: var(--font-title);
    font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; margin-bottom: .4rem;
}
.page-head-desc { color: var(--ink-soft); font-family: var(--font-read); max-width: 60ch; margin: 0 auto .5rem; }
.page-head-count { color: var(--muted); font-size: .9rem; margin: 0; }

/* --------------------------- single post --------------------------- */
.single-head { padding: 2.8rem 0 1.5rem; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; display: flex; gap: .5rem; align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

.draft-badge {
    display: inline-block; background: var(--warn-bg); color: var(--warn-ink);
    border: 1px solid var(--warn-border); border-radius: 999px;
    padding: .2rem .8rem; font-size: .8rem; margin-bottom: .8rem;
}
.single-title {
    font-family: var(--font-title);
    font-size: clamp(1.9rem, 5vw, 2.9rem); font-weight: 700; line-height: 1.3;
}
.single-subtitle {
    font-family: var(--font-read); color: var(--muted);
    font-size: 1.05rem; margin-top: .5rem;
}
.single-meta {
    display: flex; flex-wrap: wrap; gap: 1.2rem;
    color: var(--muted); font-size: .88rem;
    margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.single-meta .edit-link { color: var(--brand); font-weight: 600; }
/* சில edit-link-கள் <button> — நிர்வாகிக்கான சுவரொட்டி முன்னோட்டம்.
   இணைப்பைப் போலவே தெரிய வேண்டும். */
.single-meta button.edit-link {
    border: 0; background: none; padding: 0; font: inherit; cursor: pointer;
}
.single-meta button.edit-link:hover { text-decoration: underline; }
/* பா வகை — சொடுக்கினால் அதே வகை அனைத்தும் */
.pa-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--brand-soft); border: 1px solid var(--border);
    border-radius: 999px; padding: .1rem .7rem;
    color: var(--brand); font-size: .82rem; font-weight: 600;
}
.pa-chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.single-cover {
    width: 100%; border-radius: var(--radius);
    margin: 1.5rem 0; box-shadow: var(--shadow-md);
}

.single-body {
    font-family: var(--font-read);
    color: var(--ink-soft);
    font-size: 1.08rem;
    line-height: 2.1;
    padding: 1rem 0 2rem;
}
.single-body h2, .single-body h3, .single-body h4 {
    font-family: var(--font-ui); color: var(--ink);
    font-weight: 600; margin: 2rem 0 .8rem;
}
.single-body h2 { font-size: 1.5rem; }
.single-body h3 { font-size: 1.28rem; }

/* ---------------------------------------------------------------------
   எழுதியபடியே (as-typed)

   உள்ளடக்கம் **எளிய உரையாகச்** சேமிக்கப்படுகிறது; இங்கே அப்படியே
   காட்டுகிறோம் — `pre-wrap`:
     · வரி முறிவுகள், இடைவெளிகள், tab எல்லாம் அப்படியே
     · ஆனால் அகலம் தாண்டும் நீளமான வரி **மடங்கும்** — பக்கவாட்டில்
       நகர்த்த வேண்டியதில்லை

   முன்பு இது `pre` ஆக இருந்தது. விரிவுரை, இலக்கணக் குறிப்பு போன்ற
   நீளமான பத்திகளுக்கு அது ஒவ்வொரு பெட்டியிலும் ஒரு கிடைமட்டச்
   சறுக்கியைக் கொண்டுவந்தது — படிக்கவே முடியவில்லை. இப்போது தட்டச்சு
   செய்த வடிவம் அப்படியே இருக்கும், படிப்பதும் எளிது.

   --------------------------------------------------------------------- */
.as-typed {
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
    tab-size: 4;
}
.single-body blockquote {
    border-inline-start: 4px solid var(--brand);
    background: var(--bg-alt);
    padding: 1rem 1.3rem; border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.6rem 0; color: var(--ink);
}
.single-body img { max-width: 100%; border-radius: var(--radius); margin: 1rem 0; }
.single-body ul, .single-body ol { padding-inline-start: 1.5rem; margin-bottom: 1.3rem; }
.single-body li { margin-bottom: .5rem; }
.single-body pre {
    background: var(--bg-alt); border: 1px solid var(--border);
    padding: 1rem; border-radius: var(--radius); overflow-x: auto;
}
.single-body table { width: 100%; border-collapse: collapse; margin-bottom: 1.3rem; }
.single-body th, .single-body td { border: 1px solid var(--border); padding: .6rem .8rem; }
.single-body th { background: var(--bg-alt); }

/* ---------------------------------------------------------------------
   கவிதை / செய்யுள் — ஆசிரியர் type செய்தது அப்படியே.

   · white-space: pre  → வரி எங்கும் தானாக மடங்காது, இடைவெளிகளும் அப்படியே
   · text-align: left  → வரி முன் விட்ட இடைவெளி (indent) சிதையாது
   · margin-inline-end: auto → பத்தி எப்போதும் இடதுபுறம் ஒட்டி நிற்கும்
   · overflow-x: auto  → வரி அகலமாக இருந்தால் மடங்காமல் பக்கவாட்டில் நகரும்
   --------------------------------------------------------------------- */
/* is-plain / is-prose — இப்போது இரண்டும் ஒன்றே (எழுதியபடியே).
   வேறுபாடு கவிதைக்கு (is-verse) மட்டுமே: அங்கே வரி மடங்காது. */
.single-body.is-plain div,
.single-body.is-plain blockquote,
.single-body.is-prose div,
.single-body.is-prose blockquote { white-space: pre-wrap; }
.single-body.is-plain { line-height: 1.9; }

.single-body.is-verse {
    font-size: 1.16rem;
    line-height: 2;
    letter-spacing: .01em;
    overflow-x: auto;
}
.single-body.is-verse p,
.single-body.is-verse div,
.single-body.is-verse blockquote,
.single-body.is-verse pre {
    white-space: pre;
    text-align: left;
    width: fit-content;
    min-width: 0;
    margin-left: 0;      /* எப்போதும் இடதுபுறம் */
    margin-right: auto;
    /* வரிகளுக்கு இடையே இடைவெளி இல்லை — ஆசிரியர் Enter அழுத்திய இடத்தில்
       மட்டுமே வரி மாறும். பத்திகளுக்கு இடையே இடைவெளி வேண்டுமானால்
       editor-ல் ஒரு காலி வரி விட்டால் போதும் (Enter இரண்டு முறை). */
    margin-top: 0;
    margin-bottom: 0;
    tab-size: 4;
}
.single-body.is-verse blockquote {
    border: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
}
.single-body.is-verse pre {
    font-family: inherit;
    font-size: inherit;
    border: 0;
    background: transparent;
    padding: 0;
}
/* Quill-ன் align வகுப்புகள் கவிதையிலும் வேலை செய்ய */
.single-body.is-verse .ql-align-center { text-align: center; }
.single-body.is-verse .ql-align-right  { text-align: right; }

/* சிறிய திரையில் எழுத்தைச் சற்றுச் சிறிதாக்கினால் பெரும்பாலான வரிகள்
   பக்கவாட்டில் நகர்த்தாமலேயே பொருந்தும் — வரி மடங்குவதில்லை. */
@media (max-width: 575.98px) {
    .single-body.is-verse { font-size: .98rem; line-height: 1.95; }
}

/* ------------------ பொருள் (பொழிப்புரை / விரிவுரை) ------------------ */
.meaning {
    margin: 1.8rem 0;
    padding: 1.2rem 1.4rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-alt);
}
.meaning-short {
    border-inline-start: 4px solid var(--brand);
    background: var(--brand-soft);
}
.meaning-head {
    display: flex; align-items: center; gap: .5rem;
    font-family: var(--font-ui);
    font-size: .82rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--brand);
    margin: 0 0 .7rem;
}
.meaning-body {
    font-family: var(--font-read);
    color: var(--ink);
    font-size: 1rem; line-height: 2;
    margin: 0;
}
.meaning-body p:last-child { margin-bottom: 0; }
/* விரிவுரை உரைநடை — கவிதை விதிகள் இங்கே பொருந்தக் கூடாது */
.meaning-body.single-body { padding: 0; }


/* அச்சில் மட்டும் தெரிய வேண்டியவை — திரையில் இல்லை */
.print-only { display: none; }

/* --------------------- படிக்கும் எழுத்து அளவு -----------------------
   --read-scale-ஐ readsize.js <html>-ல் வைக்கும். படைப்பு, பொருள்,
   இலக்கணம் மட்டும் பெரிதாகும் — மெனுவும் அட்டைகளும் அப்படியே. */
:root { --read-scale: 1; }
.single-body        { font-size: calc(1.08rem * var(--read-scale)); }
.single-body.is-verse { font-size: calc(1.16rem * var(--read-scale)); }
.meaning-body       { font-size: calc(1rem * var(--read-scale)); }

.read-tools {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .8rem; margin-top: .8rem;
}
.readsize { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.readsize button {
    border: 0; background: var(--surface); color: var(--ink-soft);
    padding: .25rem .7rem; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.readsize button + button { border-inline-start: 1px solid var(--border); }
.readsize button:hover { background: var(--bg-alt); color: var(--brand); }
.readsize button span { font-size: .75em; vertical-align: super; }
.readsize .rs-now { min-width: 3.4rem; color: var(--muted); font-weight: 500; }
.read-random { color: var(--muted); font-size: .85rem; }
.read-random:hover { color: var(--brand); }

.source-note {
    font-family: var(--font-read); color: var(--muted);
    font-size: .92rem; font-style: italic;
    border-top: 1px dashed var(--border); padding-top: 1rem;
}

.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0; }
.tag-chip {
    background: var(--bg-alt); border: 1px solid var(--border);
    color: var(--ink-soft); border-radius: 999px;
    padding: .3rem .85rem; font-size: .85rem;
}
.tag-chip:hover, .tag-chip.active {
    background: var(--brand); border-color: var(--brand); color: #fff;
}
.tag-chip .tc-n { opacity: .65; font-size: .78rem; }

.share-row { display: flex; gap: .6rem; margin: 1.5rem 0 2rem; flex-wrap: wrap; }
/* தலைப்புக்குக் கீழ் உள்ள சுருக்கமான வரிசை */
.share-compact { margin: 1rem 0 0; }

.share-wrap { position: relative; }
.share-menu {
    position: absolute; inset-block-start: calc(100% + .4rem); inset-inline-start: 0;
    z-index: 60; min-width: 190px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.share-menu a {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem .9rem;
    color: var(--ink-soft); font-size: .9rem;
    border-bottom: 1px solid var(--border);
}
.share-menu a:last-child { border-bottom: 0; }
.share-menu a:hover { background: var(--bg-alt); color: var(--brand); }
.share-menu i { width: 18px; text-align: center; color: var(--brand); }

/* அச்சிடும்போது பகிர்வுப் பொத்தான்கள் தேவையில்லை — style.css-ன் print
   பகுதியில் .share-row ஏற்கனவே மறைக்கப்படுகிறது. */

/* முந்தையது / அடுத்தது — முழு அகலம் வேண்டாம்; இடது, வலது ஓரங்களில்.
   ஒன்று மட்டும் இருந்தாலும் அது தன் பக்கத்திலேயே நிற்கும்
   (post.php-ல் காலி <span> ஒன்று இடத்தைப் பிடிக்கிறது). */
.post-nav {
    display: flex; align-items: stretch; justify-content: space-between;
    gap: .8rem; margin: 2rem 0 1rem;
}
.pn {
    flex: 0 1 auto; min-width: 0; max-width: 46%;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .75rem 1rem;
    display: flex; flex-direction: column; gap: .2rem;
}
.pn:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.pn.next { margin-inline-start: auto; text-align: end; }
.pn-label { color: var(--muted); font-size: .78rem; white-space: nowrap; }
/* தலைப்பு நீளமானால் ஒரே வரியில் … ஆகும் — பெட்டி வளராது */
.pn-title {
    color: var(--ink); font-weight: 600; font-size: .93rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 480px) {
    .pn { padding: .6rem .8rem; max-width: 47%; }
    .pn-title { font-size: .86rem; }
}

/* ---------------------------- filter bar --------------------------- */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .9rem;
}
.fb-field { position: relative; display: flex; align-items: center; }
.fb-grow { flex: 1 1 260px; }
.fb-field i { position: absolute; inset-inline-start: .8rem; color: var(--muted); }
.fb-field .form-control { padding-inline-start: 2.3rem; }
.fb-select { max-width: 200px; }
.filter-bar .form-control, .filter-bar .form-select {
    border-color: var(--border); background-color: var(--bg); color: var(--ink);
}

/* ------------------------------ misc ------------------------------- */
.empty-state {
    text-align: center; padding: 3.5rem 1rem; color: var(--muted);
    background: var(--surface); border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty-state i { font-size: 2.4rem; color: var(--border); display: block; margin-bottom: .8rem; }

.stat-tile {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem; text-align: center;
    display: flex; flex-direction: column; gap: .2rem;
}
.stat-n { font-size: 1.8rem; font-weight: 700; color: var(--brand); line-height: 1; }
.stat-l { color: var(--muted); font-size: .82rem; }

.about-cats { display: flex; flex-direction: column; gap: .8rem; }
.about-cat {
    display: flex; align-items: center; gap: 1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.2rem;
}
.about-cat:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.ac-icon {
    display: grid; place-items: center; flex: 0 0 46px; height: 46px;
    border-radius: 12px; background: var(--brand-soft); color: var(--brand);
}
.ac-body { flex: 1; display: flex; flex-direction: column; }
.ac-name { color: var(--ink); font-weight: 600; }
.ac-name em { color: var(--muted); font-style: normal; font-weight: 400; font-size: .88rem; }
.ac-desc { color: var(--muted); font-size: .85rem; }
.ac-count { color: var(--brand); font-weight: 700; font-size: 1.15rem; }

/* ------------------------- "பற்றி" பக்கம் ------------------------- */

/* அறிமுகப் பத்தி — வாசிக்கும் எழுத்துருவில், சற்றுப் பெரிதாக */
.about-intro {
    font-family: var(--font-read);
    font-size: 1.05rem;
    line-height: 2;
    color: var(--ink-soft);
}
.about-lead {
    color: var(--muted); font-size: .92rem;
    max-width: 62ch; margin: -.4rem 0 1.1rem;
}

/* தொகுப்புகள் — பெயர், முன்னேற்றம், ஒரு மெல்லிய பட்டை */
.about-colls { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 576px) { .about-colls { grid-template-columns: 1fr 1fr; } }
.about-coll {
    display: flex; flex-direction: column; gap: .35rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.1rem;
}
.about-coll:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.acl-name  { color: var(--ink); font-weight: 600; }
.acl-count { color: var(--muted); font-size: .85rem; }
.acl-bar {
    display: block; height: 5px; border-radius: 99px;
    background: var(--border); overflow: hidden; margin-top: .2rem;
}
.acl-bar > span { display: block; height: 100%; background: var(--brand); }

/* பா வகைகள் — சிறு பொத்தான்கள் */
.about-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.about-chip {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 99px; padding: .35rem .85rem;
    color: var(--ink-soft); font-size: .88rem;
}
.about-chip:hover { border-color: var(--brand); color: var(--brand); }
.about-chip span {
    background: var(--brand-soft); color: var(--brand);
    border-radius: 99px; padding: 0 .45rem;
    font-size: .75rem; font-weight: 700;
}

/* கண்டடையும் வழிகள் */
.about-ways { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 576px) { .about-ways { grid-template-columns: 1fr 1fr; } }
.about-way {
    display: grid; grid-template-columns: 44px 1fr; gap: .2rem .9rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.1rem;
}
.about-way:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.aw-icon {
    grid-row: 1 / span 2; display: grid; place-items: center;
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--brand-soft); color: var(--brand);
}
.aw-name { color: var(--ink); font-weight: 600; align-self: end; }
.aw-desc { color: var(--muted); font-size: .85rem; line-height: 1.6; }

/* படிப்பதை எளிதாக்கும் வசதிகள் */
.about-list { list-style: none; padding: 0; margin: 0; }
.about-list li {
    display: flex; gap: .7rem; align-items: flex-start;
    color: var(--ink-soft); font-size: .95rem;
    padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.about-list li:last-child { border-bottom: 0; }
.about-list i { color: var(--brand); margin-top: .25rem; }

/* குறிப்புகள் — சொல்லும் மதிப்பும் */
.about-facts { display: grid; gap: .6rem; margin: 0; }
.about-facts > div {
    display: flex; flex-wrap: wrap; gap: .3rem 1rem;
    justify-content: space-between; align-items: baseline;
    padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.about-facts > div:last-child { border-bottom: 0; }
.about-facts dt { color: var(--muted); font-size: .88rem; font-weight: 400; }
.about-facts dd { color: var(--ink); margin: 0; font-weight: 600; }

/* தொடர்பு — தொட்டவுடன் அழைப்பு / WhatsApp / மின்னஞ்சல் திறக்கும் */
.contact-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.2rem;
}
.ct-name {
    font-family: var(--font-read); font-size: 1.1rem; font-weight: 600;
    color: var(--ink); margin: 0 0 .9rem;
}
.contact-rows { display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .contact-rows { grid-template-columns: 1fr 1fr; } }
.ct-row {
    display: flex; align-items: center; gap: .8rem;
    border: 1px solid var(--border); border-radius: 12px;
    padding: .7rem .9rem; background: var(--bg-alt);
}
.ct-row:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.ct-ico {
    display: grid; place-items: center; flex: 0 0 38px; height: 38px;
    border-radius: 10px; background: var(--brand-soft); color: var(--brand);
}
.ct-body  { display: flex; flex-direction: column; min-width: 0; }
.ct-label { color: var(--muted); font-size: .75rem; }
.ct-value { color: var(--ink); font-weight: 600; font-size: .92rem;
            overflow-wrap: anywhere; }

/* அடிக்குறிப்பில் — சின்னங்கள் மட்டும் */
.footer-contact { display: flex; gap: .55rem; margin-top: .9rem; }
.footer-contact a {
    display: grid; place-items: center; width: 34px; height: 34px;
    border: 1px solid var(--border); border-radius: 50%;
    color: var(--muted); font-size: .85rem;
}
.footer-contact a:hover { border-color: var(--brand); color: var(--brand); }

/* உரிமைக் குறிப்பு — அமைதியான பெட்டி */
.about-note {
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.2rem;
    color: var(--ink-soft); font-size: .92rem; line-height: 1.9;
}

.pagination .page-link {
    color: var(--brand); border-color: var(--border);
    background-color: var(--surface); border-radius: 10px; margin: 0 3px;
}
.pagination .active .page-link {
    background-color: var(--brand); border-color: var(--brand); color: #fff;
}
.pagination .disabled .page-link { color: var(--muted); opacity: .55; }
.page-gap { border: 0; background: transparent; }
.pager-note { text-align: center; color: var(--muted); font-size: .84rem; margin: .6rem 0 0; }

/* --------------------------- உலாவல் பட்டை -------------------------- */
.browse-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: .6rem;
    margin-bottom: 1.4rem;
}
.bb-spacer { flex: 1 1 auto; }
/* நடுவில் நிற்கும் கருவிப் பட்டை — பக்கத் தலைப்பும் நடுவில் இருக்கும்
   பக்கங்களுக்கு (தொகுப்பு). */
.browse-bar.is-centre { justify-content: center; }
.bb-label { color: var(--muted); font-size: .85rem; margin: 0; }
.bb-select { width: auto; min-width: 150px; }
.bb-group { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.bb-btn {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px;
    color: var(--muted); background: var(--surface);
}
.bb-btn + .bb-btn { border-inline-start: 1px solid var(--border); }
.bb-btn:hover { color: var(--brand); }
.bb-btn.active { background: var(--brand); color: #fff; }
.bb-link { color: var(--brand); font-size: .9rem; font-weight: 600; }

/* ------------------------ சுருக்கப் பட்டியல் ------------------------ */
.post-rows { display: flex; flex-direction: column; gap: .5rem; }
.post-row {
    display: flex; align-items: center; gap: 1rem;
    padding: .8rem 1.1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.post-row:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.pr-no {
    flex: 0 0 40px; height: 40px; display: grid; place-items: center;
    border-radius: 10px; background: var(--brand-soft); color: var(--brand);
    font-weight: 700; font-size: .95rem;
}
.pr-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pr-title { color: var(--ink); font-weight: 600; }
.post-row:hover .pr-title { color: var(--brand); }
/* முதல் வரி — மடங்காமல், நீளமானால் … */
.pr-line {
    color: var(--muted); font-size: .86rem; font-family: var(--font-read);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pr-meta {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: .15rem; color: var(--muted); font-size: .78rem; white-space: nowrap;
}
@media (max-width: 575.98px) {
    .pr-meta { display: none; }
}

/* -------------------------- அகர வரிசை ------------------------------ */
.letter-grid {
    display: grid; gap: .6rem;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}
.letter-chip {
    display: flex; flex-direction: column; align-items: center; gap: .1rem;
    padding: .7rem .4rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; text-align: center;
    transition: border-color .18s ease, transform .18s ease;
}
.letter-chip:hover { border-color: var(--brand); transform: translateY(-2px); }
.letter-chip.active { background: var(--brand); border-color: var(--brand); }
.lc-l { font-size: 1.25rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.lc-n { font-size: .75rem; color: var(--muted); }
.letter-chip.active .lc-l, .letter-chip.active .lc-n { color: #fff; }
.letter-hint { color: var(--muted); font-size: .9rem; text-align: center; margin-top: 1.4rem; }

/* ----------------------- தேடல் பரிந்துரைகள் ------------------------ */
.suggest-box {
    position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: calc(100% + .4rem);
    z-index: 60;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow-lg);
    overflow: hidden auto; max-height: 70vh;
    min-width: 280px;
}
.sg-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .9rem;
    border-bottom: 1px solid var(--border);
}
.sg-item:last-of-type { border-bottom: 0; }
.sg-item:hover, .sg-item.active { background: var(--bg-alt); }
.sg-icon { color: var(--brand); width: 18px; flex: 0 0 18px; font-size: .9rem; }
.sg-text { display: flex; flex-direction: column; min-width: 0; }
.sg-title {
    color: var(--ink); font-weight: 600; font-size: .92rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sg-meta {
    color: var(--muted); font-size: .76rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sg-all {
    display: block; padding: .6rem .9rem; text-align: center;
    background: var(--bg-alt); color: var(--brand);
    font-size: .85rem; font-weight: 600;
}
.sg-all:hover { background: var(--brand-soft); }

/* --- வகைத் தலைப்பு —‌ படைப்பா, பிரிவா, பக்கமா என்பது தெரிய --- */
.sg-group {
    padding: .45rem .9rem .25rem;
    color: var(--muted); font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}
.sg-group:first-child { border-top: 0; }

/* படைப்பின் பொருந்திய வரி இரண்டு வரிவரை தெரியட்டும் — "ஏன் இது
   வந்தது" என்பது ஒரு வரியில் அடங்காமல் போகலாம். */
.sg-post .sg-meta {
    white-space: normal;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* வகைக்கேற்ற சின்ன நிறம் — கண்ணுக்கு வேறுபாடு */
.sg-cat  .sg-icon { color: #8a5a12; }
.sg-coll .sg-icon { color: #6d4aa8; }
.sg-tag  .sg-icon { color: #1c6b8c; }
.sg-word .sg-icon { color: #2e7d32; }
.sg-page .sg-icon { color: var(--muted); }

/* ------------------------------ login ------------------------------ */
.login-wrap { display: grid; place-items: center; min-height: 60vh; padding: 1rem; }
.login-card {
    width: 100%; max-width: 400px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 2rem; box-shadow: var(--shadow-md);
}
.login-head { text-align: center; margin-bottom: 1.5rem; }
.login-head .brand-mark { margin: 0 auto .8rem; }
.login-head h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .2rem; }
.login-head p { color: var(--muted); font-size: .9rem; margin: 0; }
.login-card .form-control { background-color: var(--bg); border-color: var(--border); color: var(--ink); }
.login-back { display: block; text-align: center; margin-top: 1.2rem; color: var(--muted); font-size: .88rem; }

/* ------------------------------ footer ----------------------------- */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: 2rem;
}
.footer-brand {
    display: inline-flex; align-items: center; gap: .7rem;
    font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-bottom: .7rem;
}
.footer-brand:hover { color: var(--brand); }
.footer-about {
    color: var(--muted); font-size: .9rem; line-height: 1.9;
    font-family: var(--font-read); max-width: 42ch; margin-bottom: 0;
}
.footer-head { color: var(--ink); font-weight: 600; font-size: .95rem; margin-bottom: .8rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .45rem; }
.footer-links a { color: var(--muted); font-size: .9rem; }
.footer-links a:hover { color: var(--brand); }

/* பிரிவுகள் — நெடுவரிசை எண்ணிக்கையை நாமே சொல்கிறோம். முன்பு column-width
   ஆக இருந்தது; உலாவி இடத்தைப் பார்த்து 2 என முடிவு செய்துவிட்டது.

   கைபேசியிலும் இரண்டு நெடுவரிசை — ஒற்றை வரிசையில் அடிக்குறிப்பு
   தேவையின்றி நீளமாகி, படிப்பவர் நிறையச் சுருட்ட வேண்டியிருந்தது. */
.footer-links-cols { columns: 2; column-gap: 1rem; }
.footer-links-cols li { break-inside: avoid; -webkit-column-break-inside: avoid; }
/* 480-லிருந்தே மூன்று — tab அளவிலும் மூன்றாகவே இருக்க வேண்டும் */
@media (min-width: 480px) { .footer-links-cols { columns: 3; } }

/* இணைப்புகள் — இரண்டு நெடுவரிசை, கைபேசியிலிருந்தே */
.footer-links-2 { columns: 2; column-gap: 1rem; }
.footer-links-2 li { break-inside: avoid; -webkit-column-break-inside: avoid; }

/* குறுகிய நெடுவரிசையில் நீளமான தமிழ்ப் பெயர் பொருந்த */
.footer-links-cols a { display: inline-block; }

/* மிகக் குறுகிய திரை — இரண்டு நெடுவரிசை பொருந்த சிறிதே இறுக்கம்.
   "சிவ வெண்பாக்கள்" போன்ற நீளமான பெயர் உடையாமல் இருக்க. */
@media (max-width: 479.98px) {
    .footer-links-cols, .footer-links-2 { column-gap: .7rem; }
    .footer-links-cols li, .footer-links-2 li { margin-bottom: .35rem; }
    .footer-links-cols a, .footer-links-2 a { font-size: .82rem; }
    .footer-links-cols i, .footer-links-2 i { margin-inline-end: .25rem; }
}

.footer-rule { border-color: var(--border); margin: 2rem 0 1.2rem; }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
}
.footer-copy { color: var(--muted); font-size: .85rem; }
.footer-prefs { display: flex; align-items: center; gap: .6rem; }
.footer-prefs .theme-toggle { width: 30px; height: 30px; font-size: .8rem; }
@media (max-width: 575.98px) {
    .footer-bottom { justify-content: center; text-align: center; }
}

/* இலக்கணக் குறிப்பு — உள்ளடங்கிய பட்டியல்கள் அதிகம், எனவே சற்று
   இறுக்கமான இடைவெளியும் தெளிவான உள்தள்ளலும் */
.meaning-gram .meaning-body ul,
.meaning-gram .meaning-body ol { padding-inline-start: 1.4rem; margin-bottom: .8rem; }
.meaning-gram .meaning-body li { margin-bottom: .35rem; }
.meaning-gram .meaning-body li > ul,
.meaning-gram .meaning-body li > ol { margin-top: .35rem; }
.meaning-gram .meaning-body strong { color: var(--ink); }
.meaning-gram .meaning-body :is(h3, h4) {
    font-size: 1rem; font-weight: 600; color: var(--brand);
    margin: 1.2rem 0 .5rem;
}

/* --------------------------- மதிப்பீடு ------------------------------ */
.rate-box {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
    margin: 2rem 0 1rem; padding: 1rem 1.2rem;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.rate-left { display: flex; align-items: center; gap: .7rem; }
.rate-avg { font-size: 1.9rem; font-weight: 700; color: var(--brand); line-height: 1; }
.rate-meta, .rate-label { color: var(--muted); font-size: .85rem; }
/* "சராசரி" மேலே, எண்ணிக்கை கீழே — பெரிய எண் யாருடையது என்பதில்
   குழப்பம் வரக் கூடாது */
.rate-meta { display: flex; flex-direction: column; line-height: 1.35; }
.rate-meta strong { color: var(--ink-soft); font-weight: 600; }
.rate-meta em { font-style: normal; font-size: .78rem; }
.rate-right { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }

/* ஒவ்வொரு நட்சத்திரமும் ஒரு சிறு form-ன் பொத்தான் — JavaScript இல்லாமலும்
   வாக்களிக்க முடியும். hover-ல் அதுவரையிலான நட்சத்திரங்கள் ஒளிரும். */
.stars { display: inline-flex; gap: .15rem; }
.stars form { margin: 0; }
.star {
    border: 0; background: transparent; padding: .1rem .12rem;
    color: var(--border); font-size: 1.15rem; line-height: 1; cursor: pointer;
    transition: color .15s ease, transform .15s ease;
}
.star.on { color: var(--gold); }
.star.mine { color: var(--brand); }
.stars:hover .star { color: var(--border); }
.stars form:hover .star,
.stars form:hover ~ form .star { color: var(--border); }
.stars:hover form:has(~ form:hover) .star,
.stars form:hover .star { color: var(--gold); transform: scale(1.12); }

/* அட்டை / பட்டியலில் சிறு நட்சத்திரங்கள் */
.card-stars {
    display: inline-flex; align-items: center; gap: .1rem;
    color: var(--gold); font-size: .72rem; white-space: nowrap;
}
.card-stars .cs-n { color: var(--ink-soft); font-weight: 600; margin-inline-start: .3rem; }
.card-stars .cs-c { color: var(--muted); margin-inline-start: .15rem; }
.pr-meta .card-stars { margin-inline-start: .5rem; }

/* ---------------------- பிடித்திருக்கிறது ---------------------- */

/* பகிர் / நகலெடு / அச்சிடு வரிசையிலேயே — தனிப் பெட்டி இல்லை.
   படித்து முடித்தவுடன் செய்வன எல்லாம் ஒரே இடத்தில். */
.share-row { align-items: center; }
.share-like { margin: 0; display: inline-flex; }
.share-row .like-note { align-self: center; }

.like-btn {
    display: inline-flex; align-items: center; gap: .55rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 99px; padding: .55rem 1.15rem;
    color: var(--ink-soft); font-size: .92rem; font-weight: 600;
    cursor: pointer; transition: .18s ease;
}
.like-btn i { font-size: 1rem; color: var(--muted); transition: .18s ease; }
.like-btn:hover { border-color: var(--brand); color: var(--brand); }
.like-btn:hover i { color: var(--brand); transform: scale(1.12); }

/* கொடுத்தபின் — நிரம்பிய இதயம், மென்மையான பின்னணி */
.like-btn.on {
    background: var(--brand-soft); border-color: var(--brand); color: var(--brand);
}
.like-btn.on i { color: var(--brand); }

/* சுருக்கமான வரிசையில் — btn-sm அளவுக்கு ஒத்து */
.like-btn.like-sm { padding: .38rem .9rem; font-size: .85rem; }
.like-btn.like-sm i { font-size: .9rem; }

.like-btn .lk-n {
    background: var(--brand); color: #fff;
    border-radius: 99px; min-width: 1.5rem; padding: 0 .45rem;
    font-size: .78rem; line-height: 1.5rem; text-align: center;
}
.like-note { color: var(--muted); font-size: .85rem; margin: 0; }

/* குறுகிய திரையில் — குறிப்பு வரி தனியாக முழு அகலத்தில் */
@media (max-width: 575.98px) {
    .share-row .like-note { flex: 1 0 100%; margin-top: -.2rem; }
}

/* அட்டை / பட்டியலில் சிறு இதயம் */
.card-likes {
    display: inline-flex; align-items: center; gap: .25rem;
    color: var(--muted); font-size: .72rem; white-space: nowrap;
}
.card-likes i { color: var(--brand); }
.pr-meta .card-likes { margin-inline-start: .5rem; }

/* --------------------------- கருத்துகள் ----------------------------- */
.comments { padding-block: 1rem 3rem; }
.cm-count {
    display: inline-block; margin-inline-start: .4rem;
    background: var(--brand-soft); color: var(--brand);
    border-radius: 999px; padding: .05rem .6rem;
    font-size: .8rem; vertical-align: middle;
}
.cm-list { list-style: none; margin: 0 0 2rem; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.cm-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .9rem 1.1rem;
}
.cm-head { display: flex; align-items: baseline; gap: .7rem; margin-bottom: .35rem; flex-wrap: wrap; }
.cm-who { font-weight: 600; color: var(--ink); }
.cm-when { color: var(--muted); font-size: .78rem; }
.cm-body { margin: 0; color: var(--ink-soft); font-family: var(--font-read); line-height: 1.9; }
.cm-empty { color: var(--muted); font-size: .92rem; margin-bottom: 2rem; }

.cm-form {
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.2rem;
}
.cm-form-head { font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem; color: var(--ink); }
/* பொறி — கண்ணுக்குத் தெரியாமல், ஆனால் display:none அல்ல (சில bot-கள்
   மறைந்த புலங்களைத் தவிர்க்கின்றன) */
.cm-trap {
    position: absolute; inset-inline-start: -9999px;
    width: 1px; height: 1px; overflow: hidden;
}

/* ----------------------------- அட்டவணை ------------------------------
   <details>/<summary> மரக் காட்சி. உள்ளடங்கிய நிலைகளுக்கு இடது ஓரக்
   கோடு — கண்ணுக்கு எது எதற்குள் என்பது உடனே தெரியும். */
.tree { display: flex; flex-direction: column; gap: .3rem; }

.tree-row {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .8rem;
    border-radius: 10px;
    cursor: pointer;
    list-style: none;                 /* summary-ன் இயல்பு முக்கோணம் வேண்டாம் */
}
.tree-row::-webkit-details-marker { display: none; }
.tree-row:hover { background: var(--bg-alt); }

.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-icon { color: var(--brand); width: 18px; text-align: center; flex: 0 0 18px; }
.tree-chev {
    color: var(--muted); font-size: .72rem; width: 12px; flex: 0 0 12px;
    transition: transform .18s ease;
}
details[open] > .tree-row > .tree-chev { transform: rotate(90deg); }

.tree-n {
    flex: 0 0 auto; color: var(--muted); font-size: .78rem;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: 999px; padding: .05rem .55rem;
}
.tree-row-cat  { background: var(--surface); border: 1px solid var(--border); font-weight: 600; color: var(--ink); }
.tree-row-coll { font-weight: 600; color: var(--ink-soft); }

/* உள் நிலைகள் — இடது ஓரக் கோட்டுடன் */
.tree-kids {
    margin-inline-start: 1.1rem;
    padding-inline-start: .8rem;
    border-inline-start: 1px solid var(--border);
    display: flex; flex-direction: column; gap: .15rem;
    padding-block: .35rem;
}

.tree-leaf { color: var(--ink-soft); font-size: .93rem; }
.tree-leaf:hover .tree-name { color: var(--brand); }
.tree-no {
    flex: 0 0 30px; text-align: center;
    color: var(--brand); font-weight: 700; font-size: .82rem;
}
.tree-date { flex: 0 0 auto; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.tree-empty { color: var(--muted); font-size: .86rem; padding: .3rem .8rem; margin: 0; }
.tree-more {
    color: var(--brand); font-size: .84rem; font-weight: 600;
    padding: .4rem .8rem;
}
.tree-cat[data-empty="1"] .tree-row-cat { opacity: .6; }

@media (max-width: 575.98px) {
    .tree-date { display: none; }
    .tree-kids { margin-inline-start: .5rem; padding-inline-start: .6rem; }
}

/* ------------------------ படமாக வெளியிட்ட படைப்பு --------------------
   PNG ஊடுருவும் பின்னணியுடன், வெளிச்சத் தோற்றத்தின் மையில் வரையப்பட்டது.
   இருள் தோற்றத்தில் நிறத்தைத் தலைகீழாக்கினால் வெளிர் எழுத்தாகும். */
.verse-figure { margin: 1.5rem 0; text-align: center; }
.verse-img { max-width: 100%; height: auto; }
:root[data-theme="dark"] .verse-img { filter: invert(1) brightness(1.15); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .verse-img { filter: invert(1) brightness(1.15); }
}

/* நிர்வாகத்தில் முன்னோட்டம் */
.verse-preview {
    max-width: 100%; border: 1px solid var(--border);
    border-radius: 10px; background: var(--bg);
}

/* -------------------------- நகலெடுப்புத் தடை ------------------------
   JS-ஐ மட்டும் நம்பாமல் CSS-லும். உள்ளீட்டுப் பெட்டிகளில் தேர்வு
   வேண்டும் — இல்லையெனில் தேட முடியாது. */
.is-protected {
    -webkit-user-select: none; -moz-user-select: none; user-select: none;
    -webkit-touch-callout: none;   /* iOS-ல் நீண்ட அழுத்தத்தில் மெனு வராமல் */
}
.is-protected input,
.is-protected textarea,
.is-protected select,
.is-protected [contenteditable="true"] {
    -webkit-user-select: text; -moz-user-select: text; user-select: text;
    -webkit-touch-callout: default;
}
.is-protected img { -webkit-user-drag: none; user-drag: none; pointer-events: none; }
.is-protected a img { pointer-events: auto; }

.protect-toast {
    position: fixed; inset-block-end: 1.5rem; inset-inline-start: 50%;
    transform: translate(-50%, 12px);
    background: var(--ink); color: var(--bg);
    padding: .6rem 1.1rem; border-radius: 999px;
    font-size: .86rem; box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none; z-index: 200;
    transition: opacity .25s ease, transform .25s ease;
    max-width: min(90vw, 420px); text-align: center;
}
.protect-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ----------------------------- to top ------------------------------ */
.to-top {
    position: fixed; inset-block-end: 1.5rem; inset-inline-end: 1.5rem;
    width: 44px; height: 44px; border-radius: 50%;
    border: 0; background: var(--brand); color: #fff;
    box-shadow: var(--shadow-md);
    opacity: 0; pointer-events: none; transform: translateY(10px);
    transition: opacity .25s, transform .25s;
    z-index: 50;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ------------------------------ print ------------------------------ */
/* =====================================================================
   அச்சு — A4
   ---------------------------------------------------------------------
   திரைக்கான எல்லாக் கருவிகளையும் நீக்கி, படைப்பை மட்டும் தாளில்.
   நிறங்கள் தோற்றத்தைப் பொறுத்து மாறக் கூடாது — அச்சில் எப்போதும்
   வெள்ளைத் தாளில் கருப்பு எழுத்து.
   ===================================================================== */
@media print {
    @page {
        size: A4;
        margin: 20mm 18mm;
    }

    /* --- தேவையில்லாதவை --------------------------------------------- */
    .site-header, .site-nav, .header-top, .header-nav,
    .site-footer, .share-row, .post-nav, .series-nav, .to-top,
    .tag-row, .rate-box, .like-box, .comments, .tree-side, .suggest-box,
    .protect-toast, .breadcrumb, .crumbs, .pager, .browse-bar,
    .section-alt, .edit-link, .draft-badge,
    /* கருவிகள் — தாளில் அழுத்த ஒன்றுமில்லை */
    .read-tools, .readsize, .read-random, .view-menu, .nav-view,
    .space-tools, .book-bar, .book-hint,
    /* திரையில் மட்டும் பொருள் உள்ளவை (எ.கா. பார்வைகள்) */
    .no-print { display: none !important; }

    /* --- அச்சில் மட்டும் தெரிவன ------------------------------------- */
    .print-only { display: flex !important; }
    .print-head {
        justify-content: space-between; align-items: baseline; gap: 4mm;
        border-bottom: .3pt solid #999; padding-bottom: 2mm; margin-bottom: 6mm;
        font-size: 8pt; color: #555 !important;
    }
    .print-head span:last-child { word-break: break-all; text-align: right; }

    /* --- தாளின் அடியில் QR -------------------------------------------
       அளவு: 22mm. இதற்குக் கீழே இறங்கினால் சாதாரண கைபேசி இருட்டில்
       தடுமாறும்; இதற்கு மேல் சென்றால் செய்யுளை விடக் குறியீடு
       பெரிதாகி, தாளின் கவனம் தவறான இடத்துக்குப் போகும்.

       page-break-inside: avoid — குறியீடு இரு பக்கமாக உடைந்தால்
       அது எதற்கும் உதவாது. */
    .print-qr {
        flex-direction: column; align-items: center; gap: 1.5mm;
        margin-top: 8mm; padding-top: 4mm;
        border-top: .3pt solid #bbb;
        break-inside: avoid; page-break-inside: avoid;
    }
    .print-qr svg { width: 22mm; height: 22mm; }
    .print-qr p { margin: 0; font-size: 7.5pt; color: #555 !important; }

    /* --- அடிப்படை ---------------------------------------------------- */
    html, body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
    }
    body { margin: 0; }
    a { color: #000 !important; text-decoration: none; }

    /* இரு நெடுவரிசை அமைப்பு அச்சில் வேண்டாம் */
    .single-layout { display: block !important; max-width: none; padding: 0; }
    .container, .container.narrow { max-width: none !important; width: auto !important;
                                     margin: 0 !important; padding: 0 !important; }
    .single-head { padding: 0 0 6mm !important; }
    .section { padding: 0 !important; }

    /* --- தலைப்பு ----------------------------------------------------- */
    .single-title {
        font-size: 20pt; line-height: 1.35; color: #000 !important;
        margin: 0 0 2mm;
    }
    .single-subtitle {
        font-size: 11pt; color: #333 !important; font-style: italic;
        margin: 0 0 3mm;
    }
    .single-meta {
        border: 0 !important; border-top: .3pt solid #999 !important;
        padding-top: 2mm; margin-top: 0;
        font-size: 8.5pt; color: #444 !important; gap: 4mm;
    }
    .pa-chip, .series-chip {
        background: transparent !important; border: .3pt solid #999 !important;
        color: #000 !important; padding: 0 2mm;
    }
    .series-chip .sc-no { background: transparent !important; color: #000 !important; }

    /* --- படைப்பு ----------------------------------------------------- */
    .single-body {
        font-size: 12pt; line-height: 1.75; color: #000 !important;
        padding: 4mm 0 0;
    }
    /* கவிதை வரி — தாளிலும் ஆசிரியர் எழுதியபடியே, நடுவில் பக்கம் மாறாமல் */
    .single-body.is-verse { overflow: visible !important; font-size: 12.5pt; }
    .single-body.is-verse p,
    .single-body.is-verse div { break-inside: avoid; page-break-inside: avoid; }

    /* படமாக வெளியிட்ட படைப்பு — நிறத் தலைகீழ் அச்சில் வேண்டாம் */
    .verse-img { filter: none !important; max-width: 100% !important; }

    /* --- பொருள் / இலக்கணம் ------------------------------------------- */
    .meaning {
        border: .3pt solid #999 !important; border-radius: 0;
        background: transparent !important;
        padding: 3mm 4mm; margin: 5mm 0;
        break-inside: avoid; page-break-inside: avoid;
    }
    .meaning-head {
        font-size: 9pt; color: #000 !important;
        letter-spacing: .06em; margin-bottom: 2mm;
    }
    .meaning-body { font-size: 10.5pt; line-height: 1.7; color: #000 !important; }
    .meaning-gram .meaning-body :is(h3, h4) { color: #000 !important; font-size: 10.5pt; }
    .source-note {
        border-top: .3pt dashed #999 !important;
        color: #333 !important; font-size: 9.5pt;
    }

    /* --- படங்கள் ----------------------------------------------------- */
    .single-cover { max-height: 90mm; object-fit: contain; box-shadow: none !important; }
    img { break-inside: avoid; page-break-inside: avoid; }

    /* தலைப்பு தனியாக ஒரு பக்கத்தின் அடியில் நின்றுவிடக் கூடாது */
    h1, h2, h3 { break-after: avoid; page-break-after: avoid; }

    /* --- ஒரு செய்யுளை மட்டும் அச்சிடுதல் --- */
    /* வாசகரின் திரைக்குரியவை தாளில் இடம் பெறக் கூடாது */
    .read-print, .preview-bar, .rel-why, .otd-when,
    .audio-box, .post-audio, audio, .gl-tip, .sub-box { display: none !important; }

    /* எதுகை · மோனை நிறங்கள் — திரையில் உதவி, தாளில் குழப்பம்.
       கருப்பு வெள்ளை அச்சில் பின்னணி சாம்பலாகிச் சொல்லை மறைக்கும். */
    .ry-monai, .ry-ethukai {
        color: inherit !important; background: transparent !important;
        font-weight: inherit !important; padding: 0 !important;
    }

    /* அரும்பத அகராதிக் குறிப்பு — புள்ளிக்கோடு தேவையில்லை,
       ஆனால் சொல் அப்படியே இருக்க வேண்டும். */
    .gl-word { border: 0 !important; text-decoration: none !important; color: #000 !important; }

    /* தளத்தின் பெயரும் முகவரியும் ஒரு முறை — யாருடைய படைப்பு
       என்பது தாளிலிருந்து தெரிய வேண்டும். */
    .single-body.is-verse { orphans: 3; widows: 3; }
}

/* --------------------------- responsive ---------------------------- */
@media (max-width: 767.98px) {
    .hero { padding: 2.5rem 0; }
    .section { padding: 2.5rem 0; }
    .nav-search { margin: .6rem 0; }
    .nav-search .form-control { width: 100%; }
}

/* ====================================================================
   உட்பிரிவுகள் (sub-categories)
   ==================================================================== */

/* --- மெனு: பெரிய திரையில் தொங்கும் பட்டியல் --- */
.main-menu li.has-kids { position: relative; }
.main-menu .kid-caret {
    font-size: .62em; margin-inline-start: .3rem;
    opacity: .65; vertical-align: middle;
}
.sub-menu {
    list-style: none; margin: 0; padding: .4rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-lg);
    min-width: 13rem;
}
.sub-menu a {
    display: block; padding: .45rem .7rem; border-radius: 8px;
    color: var(--ink-soft); font-size: .9rem; white-space: nowrap;
}
.sub-menu a:hover, .sub-menu a.active { background: var(--bg-alt); color: var(--brand); }

@media (min-width: 992px) {
    .main-menu li.has-kids > .sub-menu {
        position: absolute; inset-block-start: 100%; inset-inline-start: 0;
        z-index: 70; display: none;
    }
    /* :focus-within — விசைப்பலகையில் Tab செய்து வருபவருக்கும் திறக்கும் */
    .main-menu li.has-kids:hover > .sub-menu,
    .main-menu li.has-kids:focus-within > .sub-menu { display: block; }
}
@media (max-width: 991.98px) {
    /* கைபேசி — தொங்கும் பட்டியல் வேலைக்காகாது; உள்ளடங்கிய வரிசையாக */
    .sub-menu {
        border: 0; box-shadow: none; background: transparent;
        padding: 0 0 .3rem 1.1rem; min-width: 0;
    }
    .main-menu .kid-caret { display: none; }
}

/* --- அடிக்குறிப்பு --- */
.footer-links li.foot-kid { padding-inline-start: 1rem; }
.footer-links li.foot-kid a { font-size: .85rem; opacity: .9; }

/* --- பிரிவுப் பக்கம் --- */
.page-head-up { margin: 0 0 .4rem; font-size: .88rem; }
.page-head-up a { color: var(--muted); }
.page-head-up a:hover { color: var(--brand); }

.kid-chips {
    display: flex; flex-wrap: wrap; gap: .45rem;
    justify-content: center; margin-top: 1rem;
}
.kid-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 99px; padding: .32rem .85rem;
    color: var(--ink-soft); font-size: .85rem;
}
.kid-chip:hover { border-color: var(--brand); color: var(--brand); }
.kid-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* --- "பற்றி" பக்கம் --- */
.about-cat-kid {
    margin-inline-start: 1.6rem;
    background: var(--bg-alt);
}
.about-cat-kid .ac-icon { flex-basis: 36px; height: 36px; font-size: .85rem; }
.about-cat-kid .ac-name { font-weight: 500; font-size: .95rem; }

/* ====================================================================
   காட்சித் தேர்வுப் பட்டியல் (View)

   Windows Explorer-ன் View பட்டியலைப் போல — ஒரே இடத்தில் எல்லா
   முறைகளும், இப்போதையதற்கு ஒரு புள்ளி.
   ==================================================================== */
.view-menu { position: relative; }
.vm-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: .4rem .85rem;
    color: var(--ink-soft); font-size: .88rem; cursor: pointer;
}
.vm-btn:hover, .vm-btn[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }
.vm-caret { font-size: .62em; opacity: .7; }

.vm-list {
    position: absolute; inset-block-start: calc(100% + .4rem); inset-inline-end: 0;
    z-index: 80; min-width: 15rem; padding: .35rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-lg);
    text-align: start;
    /* திறக்கும்போது viewmenu.js இதை fixed ஆக்கி, திரையில் இடம்
       இருக்கும் அளவுக்கு உயரத்தைக் கட்டுப்படுத்தும். அப்போது
       உள்ளேயே உருள வேண்டும் — பக்கம் உருளக் கூடாது. */
    overflow-y: auto;
    overscroll-behavior: contain;
}
/* பொத்தான் நடுவில் இருந்தால் பட்டியலும் அதன் கீழ் நடுவிலேயே —
   ஓரத்திலிருந்து தொங்கினால் அது இடம் மாறியது போலத் தெரியும். */
.browse-bar.is-centre .vm-list {
    inset-inline-end: auto; inset-inline-start: 50%;
    transform: translateX(-50%);
}
.vm-item {
    display: grid; grid-template-columns: 1rem 1.4rem 1fr;
    align-items: center; gap: .3rem;
    padding: .45rem .5rem; border-radius: 8px;
    color: var(--ink-soft); font-size: .9rem; white-space: nowrap;
}
.vm-item:hover { background: var(--bg-alt); color: var(--brand); }
.vm-item.on    { color: var(--brand); font-weight: 600; }
.vm-dot  { text-align: center; color: var(--brand); font-size: 1.1rem; line-height: 1; }
.vm-ico  { text-align: center; opacity: .85; }
.vm-rule { border-color: var(--border); margin: .3rem .5rem; }

/* ====================================================================
   தொகுப்புக் காட்சிகள்
   ==================================================================== */

/* --- அட்டைகள்: பெரிய / சாதாரண / சிறிய ---
   கடைசி வரிசையில் ஒன்றோ இரண்டோ மட்டும் மிஞ்சினால் அவை இடதுபுறம்
   ஒட்டிக்கொள்ளாமல் நடுவில் நிற்கும் — பக்கம் ஒருபக்கமாகச் சாயாது. */
.coll-grid {
    display: grid; gap: 1.1rem; grid-template-columns: 1fr;
    justify-content: center;
}
.coll-list, .coll-content, .coll-table { margin-inline: auto; }
.cg-cell   { position: relative; display: flex; }
.cg-cell > .post-card { flex: 1; }

/* எண் — அட்டையின் மூலையில் ஒரு சிறு வட்டம் */
.cg-no {
    position: absolute; inset-block-start: -.5rem; inset-inline-start: -.5rem;
    z-index: 2; display: grid; place-items: center;
    min-width: 1.8rem; height: 1.8rem; padding: 0 .4rem;
    border-radius: 99px; background: var(--brand); color: #fff;
    font-size: .78rem; font-weight: 700;
}
@media (min-width: 576px) {
    .coll-grid.is-cards { grid-template-columns: repeat(2, 1fr); }
    .coll-grid.is-small { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
    .coll-grid.is-large { grid-template-columns: repeat(2, 1fr); }
    .coll-grid.is-cards { grid-template-columns: repeat(3, 1fr); }
    .coll-grid.is-small { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
    .coll-grid.is-small { grid-template-columns: repeat(4, 1fr); }
}
/* சிறிய அட்டைகள் — சுருக்கம் வேண்டாம், தலைப்பு போதும் */
.coll-grid.is-small .card-excerpt,
.coll-grid.is-small .card-subtitle,
.coll-grid.is-small .card-cover { display: none; }
.coll-grid.is-small .card-body  { padding: .8rem .9rem; }
.coll-grid.is-small .card-title { font-size: .98rem; }

/* --- விவரம் (அட்டவணை) --- */
.coll-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.coll-table th {
    text-align: start; color: var(--muted); font-weight: 600;
    font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
    padding: .6rem .7rem; border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.coll-table td {
    padding: .7rem; border-bottom: 1px solid var(--border);
    color: var(--ink-soft); vertical-align: top;
}
.coll-table tbody tr:hover td { background: var(--bg-alt); }
.coll-table a { color: var(--ink); font-weight: 600; }
.coll-table a:hover { color: var(--brand); }
.coll-table .num { text-align: end; white-space: nowrap; color: var(--muted); }
.coll-table .ct-sub  { color: var(--muted); font-size: .84rem; margin-top: .15rem; }
.coll-table .ct-date { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.coll-table .ct-extra { white-space: nowrap; }

/* --- உள்ளடக்கம் (தலைப்பு + சில வரிகள்) --- */
.coll-content { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.coll-content a {
    display: grid; grid-template-columns: 2.6rem 1fr; gap: .9rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.1rem;
}
.coll-content a:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.cc-no {
    display: grid; place-items: center; align-self: start;
    width: 2.6rem; height: 2.6rem; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.cc-body  { min-width: 0; }
.cc-title { display: block; color: var(--ink); font-weight: 600; margin-bottom: .35rem; }
.cc-lines {
    display: block; font-family: var(--font-read);
    color: var(--ink-soft); font-size: .9rem; line-height: 1.9;
}

/* --- முழுவதும் ஒரே பக்கத்தில் ---
   ஒவ்வொன்றும் ஒரே அளவில், ஒரே வடிவில் — கீழே கீழே படித்துக்கொண்டே
   போகலாம். வாசிக்கும் அகலம் குறுகியதாகவே இருக்கட்டும். */
.coll-full { max-width: 46rem; margin-inline: auto; }
.cf-piece {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}
.cf-piece:last-child { border-bottom: 0; }
.cf-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; margin-bottom: .9rem; }
.cf-no {
    display: grid; place-items: center;
    min-width: 1.9rem; height: 1.9rem; padding: 0 .45rem;
    border-radius: 99px; background: var(--brand-soft); color: var(--brand);
    font-size: .8rem; font-weight: 700;
}
.cf-title { font-size: 1.25rem; font-weight: 700; margin: 0; }
.cf-title a { color: var(--ink); }
.cf-title a:hover { color: var(--brand); }
.cf-sub { flex: 1 0 100%; color: var(--muted); font-size: .9rem; margin: 0; }

.cf-body {
    font-family: var(--font-read);
    font-size: 1.08rem; line-height: 2;
    color: var(--ink);
}
.cf-meaning {
    margin-top: 1rem; padding: .9rem 1.1rem;
    background: var(--bg-alt); border-inline-start: 3px solid var(--brand);
    border-radius: 0 10px 10px 0;
    font-family: var(--font-read);
    color: var(--ink-soft); font-size: .95rem; line-height: 1.9;
}
.cf-tag {
    display: block; color: var(--brand);
    font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; margin-bottom: .3rem;
}
.cf-foot { margin: .9rem 0 0; }
.cf-foot a { color: var(--muted); font-size: .85rem; }
.cf-foot a:hover { color: var(--brand); }

/* அச்சிடும்போது — தொகுப்பு முழுவதும் ஒரு சிறு நூலாக */
@media print {
    .view-menu, .cf-foot { display: none !important; }
    .cf-piece { break-inside: avoid; padding: 1.2rem 0; }
}

/* --------------------------- தொகுப்பு முன்னுரை ---------------------------
   படைப்புகளுக்கு முன் ஒரு முறை: இது எதைப் பற்றியது, ஏன் எழுதப்படுகிறது.
   வாசிக்கும் அகலம் குறுகியதாக — நீளமான வரி கண்ணுக்குச் சோர்வு. */
.coll-intro-wrap { padding-block-end: 0; }
.coll-intro {
    position: relative;
    max-width: 46rem; margin-inline: auto;
    padding: 1.6rem 1.8rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.coll-intro .ci-body {
    font-family: var(--font-read);
    font-size: 1.04rem; line-height: 2;
    color: var(--ink-soft);
}
.coll-intro .ci-body strong { color: var(--ink); }

/* நீளமானால் சுருக்கு — JavaScript இதைச் சேர்க்கும் */
.coll-intro.is-clipped .ci-body {
    max-height: 15rem; overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
}
.coll-intro .ci-more {
    display: inline-flex; align-items: center; gap: .4rem;
    margin-top: .8rem; padding: .3rem .8rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 99px; cursor: pointer;
    color: var(--brand); font-size: .85rem; font-weight: 600;
}
.coll-intro .ci-more:hover { border-color: var(--brand); }
.coll-intro:not(.is-clipped) .ci-more i { transform: rotate(180deg); }

@media (max-width: 575.98px) {
    .coll-intro { padding: 1.1rem 1.2rem; }
    .coll-intro .ci-body { font-size: .98rem; line-height: 1.95; }
}

/* அச்சிடும்போது — முன்னுரை முழுவதும், பொத்தான் இல்லாமல் */
@media print {
    .coll-intro { background: none; border: 0; border-inline-start: 2px solid #000; padding: 0 0 0 4mm; }
    .coll-intro.is-clipped .ci-body { max-height: none; -webkit-mask-image: none; mask-image: none; }
    .coll-intro .ci-more { display: none !important; }
}

/* மெனுவின் உட்பட்டியலில் — தொகுப்பின் எண்ணிக்கை (12 / 108) */
.sub-menu a { display: flex; align-items: center; gap: .4rem; }
.sub-menu .sm-n {
    margin-inline-start: auto; padding-inline-start: .8rem;
    color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums;
}
.sub-menu a:hover .sm-n, .sub-menu a.active .sm-n { color: inherit; opacity: .8; }
.sub-menu .sm-rule {
    height: 1px; margin: .3rem .4rem;
    background: var(--border);
}

/* ------------------ தொகுப்புத் தலைப்பு — இரு பக்கம் ------------------
   முகப்புப் பக்கத்தின் அமைப்பே: இடதுபுறம் அடையாளம், வலதுபுறம் முன்னுரை.
   பெரிய திரையில் மட்டும் — கைபேசியில் ஒன்றுக்குக் கீழ் ஒன்றாக, அப்போது
   நடுவில் நிற்பதே இயல்பு. */
@media (min-width: 992px) {
    .page-head.coll-head-split {
        text-align: start;
        padding: 3.2rem 0 2.6rem;
        background: radial-gradient(760px 320px at 18% -40%, var(--brand-soft), transparent 70%);
    }
    .coll-head-split .page-head-desc  { margin-inline: 0; }
    .coll-head-split .coll-progress   { margin-inline: 0; }
    .coll-head-split .coll-intro      { max-width: none; }

    /* வலதுபுறத்தில் இடம் குறைவு — சற்று முன்பே சுருக்கு */
    .coll-head-split .coll-intro.is-clipped .ci-body { max-height: 13rem; }
}

/* தலைப்புப் பகுதிக்குள் வரும்போது முன்னுரை சற்று அமைதியாக —
   தனிப் பிரிவாக இல்லாததால் அதே அளவு கவனம் தேவையில்லை. */
.coll-head-split .coll-intro {
    background: var(--surface);
    padding: 1.3rem 1.5rem;
}
.coll-head-split .coll-intro .ci-body { font-size: .98rem; line-height: 1.95; }
.coll-head-split .hero-kicker { margin-bottom: .6rem; }

/* இலக்கு எட்டிய தொகுப்பு — பட்டைக்குப் பதிலாக ஒரு நிறைவுக் குறிப்பு */
.coll-done {
    display: inline-flex; align-items: center; gap: .45rem;
    margin: .9rem 0 0; padding: .35rem .9rem;
    background: var(--brand-soft); border-radius: 99px;
    color: var(--brand); font-size: .88rem; font-weight: 600;
}
.about-coll .acl-count i { color: var(--brand); margin-inline-end: .2rem; }

/* ---------------- மெனு வரிசையின் வலது மூலையில் "காட்சி" ----------------
   கருவி என்பதால் கருவிகள் இருக்கும் இடத்தில் — மேலே தேடல், அதற்குக்
   கீழ் இது. உள்ளடக்கத்தின் நடுவில் இருந்தபோது அது படைப்புகளையும்
   தலைப்பையும் பிரித்து ஒரு தடையாக நின்றது. */
/* மெனு வரிசை — மெனுவும் "காட்சி"யும் ஒரே கிடைமட்டத்தில். "காட்சி"
   மெனுவுக்கு வெளியே இருப்பதால் கைபேசியிலும் ☰ திறக்காமல் தெரியும். */
.header-nav > .container {
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
}
.header-nav > .container > .collapse { flex: 1 1 auto; min-width: 0; }
.nav-view { flex: 0 0 auto; margin-inline-start: auto; }
/* வலது ஓரத்தில் திறந்தால் திரைக்கு வெளியே போகக் கூடாது */
.nav-view .vm-list { inset-inline-end: 0; inset-inline-start: auto; transform: none; }

@media (min-width: 992px) {
    /* d-lg-block என்பது display:block !important — எனவே இங்கே
       அதே வலிமையுடன் மாற்ற வேண்டியிருக்கிறது. */
    .header-nav > .container > .collapse {
        display: flex !important;
        align-items: center;
        gap: 1rem;
    }
    .header-nav .main-menu { flex: 1 1 auto; min-width: 0; }
}

/* கைபேசி — மெனு மூடியிருந்தாலும் "காட்சி" வரிசையில் தெரியும்.
   மெனு விரிந்தால் அது கீழே இறங்கும், இது மேலேயே இருக்கும். */
@media (max-width: 991.98px) {
    .header-nav > .container { padding-block: .35rem; }
    .header-nav > .container > .collapse:not(.show) { flex: 0 0 0; }
    .nav-view { margin-inline-start: auto; }
    .nav-view .vm-btn { padding: .32rem .7rem; font-size: .84rem; }
    .nav-view .vm-list { min-width: 13rem; }
}

/* ====================================================================
   முப்பரிமாண வெளி (space.php)
   ==================================================================== */
.space-head { padding: 2rem 0 1.2rem; text-align: center; }
.space-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 700; margin: 0 0 .3rem; }
.space-title i { color: var(--brand); margin-inline-end: .4rem; }
.space-title small { color: var(--muted); font-weight: 400; font-size: .55em; }
.space-lead { color: var(--ink-soft); margin: 0 auto .7rem; max-width: 56ch; }
.space-hint {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem;
    color: var(--muted); font-size: .82rem; margin: 0;
}
.space-hint i { color: var(--brand); margin-inline-end: .25rem; }

/* காட்சிக் களம் — திரையின் பெரும்பகுதி, ஆனால் தலைப்பு தெரியட்டும் */
.space-stage {
    position: relative;
    height: min(74vh, 760px);
    min-height: 420px;
    margin: 0 auto 3rem;
    max-width: 1600px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
}
.space-canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.space-fallback, .space-loading {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .7rem; text-align: center; padding: 2rem;
    color: var(--muted);
}
.space-fallback i { font-size: 2rem; color: var(--brand); }
.space-fallback p, .space-loading p { margin: 0; max-width: 42ch; }

.sp-spin {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--brand);
    animation: sp-turn .8s linear infinite;
}
@keyframes sp-turn { to { transform: rotate(360deg); } }

/* தொட்ட அட்டையின் தலைப்பு — WebGL-க்குள் படிக்க முடியாத அளவு சிறியது */
.space-tip {
    position: absolute; inset-block-end: 1rem; inset-inline-start: 50%;
    transform: translateX(-50%);
    max-width: min(90%, 40rem);
    padding: .5rem 1.1rem; border-radius: 99px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    color: var(--ink); font-weight: 600; font-size: .92rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none;
}

.space-tools {
    position: absolute; inset-block-start: .8rem; inset-inline-end: .8rem;
    display: flex; flex-direction: column; gap: .4rem;
}
.sp-btn {
    display: grid; place-items: center; width: 38px; height: 38px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--ink-soft);
    cursor: pointer; font-size: .9rem;
}
.sp-btn:hover { border-color: var(--brand); color: var(--brand); }
.sp-btn.off { opacity: .5; }

@media (max-width: 575.98px) {
    .space-stage { height: 66vh; border-radius: 0; border-inline: 0; }
}

/* அச்சிட முடியாது — இது ஒரு நேரலைக் காட்சி */
@media print { .space-stage, .space-hint { display: none !important; } }

/* தலைப்பில் "முப்பரிமாண வெளி" இணைப்பு — அந்தப் பக்கத்தில் இருந்தால் ஒளிரும் */
.space-link.on {
    background: var(--brand); border-color: var(--brand); color: #fff;
}

/* நூல் காட்சியில் நூலின் அகலம் போதும் — பக்கம் முழுவதும் தேவையில்லை */
.page-collection .book-wrap { padding-inline: .5rem; }

/* ====================================================================
   கைபேசித் தலைப்பு

   வரிசை 1 — தளத்தின் பெயர், நடுவில்
   வரிசை 2 — கருவிகள் அனைத்தும் ஒரே வரிசையில்:
             மொழி · நிறம் · வெளி · முப்பரிமாணம் · தேடல் · காட்சி · ☰

   முன்பு பெயர் இடதுபுறமும் கருவிகள் வலதுபுறமும் இருந்தன; தமிழ்ப்
   பெயர் நீளமானதால் இரண்டும் நெருக்கியடித்தன. தேடலும் "காட்சி"யும்
   மெனுவுக்குள் ஒளிந்திருந்தன — ☰ திறக்காமல் தெரியவே இல்லை.
   ==================================================================== */
@media (max-width: 991.98px) {
    .header-top > .container {
        flex-direction: column;
        align-items: center;
        gap: .5rem;
        padding-block: .7rem;
    }

    /* --- வரிசை 1: பெயர் நடுவில் ---
       margin-inline-end:auto என்பது கணினியில் கருவிகளை வலதுபுறம்
       தள்ளுகிறது; நெடுவரிசையானபின் அது பெயரை இடதுபுறம் ஒட்டவைக்கும். */
    .site-brand {
        width: 100%; margin-inline-end: 0;
        justify-content: center; text-align: center;
    }
    .brand-text { align-items: center; }
    .brand-tagline { text-align: center; }

    /* --- வரிசை 2: கருவிகள் --- */
    .header-tools {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: .4rem;
    }

    /* தேடல் — தனி வரியில், முழு அகலம்.
       பொத்தான்களுடன் சேர்த்து வைத்தபோது அது இடத்தைப் பிடித்து ☰-ஐ
       கீழே தள்ளியது; பொத்தான்கள் இரு வரியில் சிதறின. மூன்று
       வரிசைகள் — பெயர் · பொத்தான்கள் · தேடல் — தெளிவானது. */
    .header-tools .nav-search {
        flex: 1 0 100%; order: 1; margin: .1rem 0 0; max-width: none;
    }
    .header-tools .nav-search .form-control { width: 100%; }

    /* பொத்தான்களும் ☰-ம் ஒரே வரியில் */
    .header-tools > :not(.nav-search) { order: 0; }

    .header-tools .nav-view { margin-inline-start: 0; }
    .header-tools .nav-view .vm-btn { padding: .34rem .7rem; font-size: .84rem; }

    /* உள்நுழைந்திருந்தால் "நிர்வாகம்" பொத்தான் — சுருக்கமாக */
    .header-tools .btn-outline-brand { padding: .32rem .7rem; font-size: .84rem; }

    /* மெனு வரிசை — இப்போது இதில் மெனு மட்டுமே */
    .header-nav > .container > .collapse:not(.show) { flex: 0 0 100%; }
}

/* மிகக் குறுகிய திரை — பொத்தான்கள் ஒரே வரியில் அடங்க சற்றுச் சிறிதாக */
@media (max-width: 400px) {
    .header-tools { gap: .3rem; }
    .header-tools .theme-toggle { width: 34px; height: 34px; font-size: .82rem; }
    .header-tools .menu-btn { width: 34px; height: 34px; }
    .header-tools .lang-toggle a { padding: .22rem .5rem; font-size: .8rem; }
    .header-tools .nav-view .vm-btn { padding: .28rem .55rem; font-size: .8rem; }
    .header-tools .nav-view .vm-btn span { display: none; }   /* சின்னம் போதும் */
}

/* ====================================================================
   படைப்பின் படங்கள்

   கவிதைக்குக் கீழே, பொருளுக்கு முன். அமைதியாக — படம் படைப்பைத்
   துணை செய்ய வேண்டும், மேலெழக் கூடாது.
   ==================================================================== */
.post-gallery { margin: 2rem 0 .5rem; display: grid; gap: 1rem; }
.post-gallery figure { margin: 0; }

/* ஒரே படம் — வாசிக்கும் அகலத்துக்கே, நடுவில் */
.post-gallery.gal-one { grid-template-columns: 1fr; }
/* பல படம் — சம அளவுக் கட்டங்கள் */
@media (min-width: 576px) {
    .post-gallery.gal-many { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
    .post-gallery.gal-many { grid-template-columns: repeat(3, 1fr); }
}

.post-gallery .pg-open {
    display: block; width: 100%; padding: 0; cursor: zoom-in;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.post-gallery .pg-open:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.post-gallery img { display: block; width: 100%; height: auto; }
/* பல படம் — ஒரே உயரம், இல்லையெனில் வரிசை சீரற்றுத் தெரியும் */
.post-gallery.gal-many img { aspect-ratio: 4 / 3; object-fit: cover; }

.post-gallery figcaption {
    margin-top: .45rem; text-align: center;
    color: var(--muted); font-size: .84rem; line-height: 1.6;
}

/* ------------------------ பெரிதாகக் காட்டுதல் ------------------------ */
body.lb-on { overflow: hidden; }
.lb {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    gap: .5rem; padding: 1.2rem;
    background: rgba(0, 0, 0, .88);
}
.lb[hidden] { display: none; }
.lb .lb-fig { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.lb img {
    max-width: 100%; max-height: 82vh;
    border-radius: 8px; background: #fff;
}
.lb figcaption {
    margin-top: .7rem; color: #e8eaec; font-size: .9rem; line-height: 1.6;
}
.lb .lb-x, .lb .lb-nav {
    background: rgba(255, 255, 255, .12); color: #fff;
    border: 0; border-radius: 50%; cursor: pointer;
    width: 44px; height: 44px; flex: 0 0 auto;
    font-size: 1.6rem; line-height: 1;
}
.lb .lb-x:hover, .lb .lb-nav:hover { background: rgba(255, 255, 255, .25); }
.lb .lb-x {
    position: absolute; inset-block-start: 1rem; inset-inline-end: 1rem;
    font-size: 1.9rem;
}
.lb.lb-one .lb-nav { display: none; }

@media (max-width: 575.98px) {
    .lb { padding: .6rem; }
    .lb .lb-nav { width: 38px; height: 38px; font-size: 1.3rem; }
}

/* அச்சு — படங்கள் வரட்டும், ஆனால் பக்கத்தை உடைக்காமல் */
@media print {
    .post-gallery { grid-template-columns: repeat(2, 1fr) !important; gap: 4mm; }
    .post-gallery .pg-open { border: .3pt solid #999; box-shadow: none; }
    .post-gallery figure { break-inside: avoid; page-break-inside: avoid; }
    .lb { display: none !important; }
}

/* ==== assets/popview.js + காட்சியகத்தின் மிதக்கும் சாளரம் ====
   நிர்வாகப் பக்கங்களிலும் பொதுப் பக்கங்களிலும் (படைப்புப்
   பக்கத்தில் நிர்வாகிக்கு) இது தேவை — எனவே admin.css அல்ல,
   இங்கே. ==================================================== */
/* ====================================================================
   இரட்டைத் தொடுதல் முன்னோட்டம் — திரையின் பாதி

   திரை முழுவதையும் மறைக்கும் பெட்டி அல்ல. நடுவில் மிதக்கும் ஒரு
   சாளரம், பின்னால் பட்டியல் தெரிந்துகொண்டேயே இருக்கும். மூலையிலிருந்து
   இழுத்து அளவை மாற்றிக்கொள்ளலாம்.
   ==================================================================== */
.gp-pop {
    position: fixed; z-index: 1060;
    inset-block-start: 50%; inset-inline-start: 50%;
    transform: translate(-50%, -50%);

    width: 50vw; height: 50vh;
    min-width: 280px; min-height: 220px;
    max-width: 92vw; max-height: 88vh;

    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .45);
    overflow: hidden; resize: both;
}
.gp-pop[hidden] { display: none; }

.gp-pop-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .6rem; padding: .5rem .5rem .5rem .8rem;
    border-bottom: 1px solid var(--border); background: var(--bg-alt);
    color: var(--ink); font-size: .86rem; font-weight: 600;
}
/* தலைப்பு மட்டும் சுருங்கட்டும் — பொத்தான்கள் அல்ல */
.gp-pop-head > span:first-child {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gp-pop-act { display: flex; align-items: center; gap: .4rem; flex: 0 0 auto; }
.gp-pop-img {
    flex: 1 1 auto; min-height: 0;
    display: grid; place-items: center;
    background: var(--bg-alt); padding: .6rem;
}
.gp-pop-img img { max-width: 100%; max-height: 100%; object-fit: contain; }

@media (max-width: 767.98px) {
    .gp-pop { width: 92vw; height: 60vh; resize: none; }
}
.gp-x {
    border: 0; background: none; cursor: pointer; line-height: 1;
    color: var(--muted); font-size: 1.3rem; padding: 0 .25rem;
    border-radius: 6px;
}
.gp-x:hover { color: var(--ink); background: var(--border); }

/* ====================================================================
   சுவரொட்டிக் காட்சி — சுவரொட்டி உள்ள படைப்புகள் மட்டும்

   உரை இங்கே முதன்மையல்ல; படமே பேசட்டும். எனவே பெரிய கட்டங்கள்,
   கீழே ஒரு வரித் தலைப்பு மட்டும். சுவரொட்டிகள் பல்வேறு விகிதத்தில்
   இருக்கும் (1:1, 4:5, 16:9) — எனவே object-fit: contain, வெட்டாமல்.
   ==================================================================== */
.poster-grid {
    display: grid; gap: 1.2rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
@media (min-width: 1400px) {
    .poster-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

.pgi { margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.pgi-shot {
    display: grid; place-items: center;
    background: var(--bg-alt);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: .5rem; overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.pgi-shot:hover {
    border-color: var(--brand); box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.pgi-shot img { max-width: 100%; height: auto; display: block; border-radius: 4px; }

.pgi figcaption { text-align: center; line-height: 1.4; }
.pgi figcaption a {
    font-family: var(--font-title);
    color: var(--ink); font-weight: 600; font-size: .95rem;
}
.pgi figcaption a:hover { color: var(--brand); }

/* அச்சில் — படங்கள் வரட்டும், ஆனால் பக்கத்தை உடைக்காமல் */
@media print {
    .poster-grid { grid-template-columns: repeat(2, 1fr); gap: 4mm; }
    .pgi { break-inside: avoid; page-break-inside: avoid; }
    .pgi-shot { box-shadow: none; border: .3pt solid #999; }
}

/* --- ஒரு பக்கத்துக்கு எத்தனை --- */
.per-page { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.pp-label { color: var(--muted); font-size: .82rem; margin-inline-end: .2rem; }
.pp-btn {
    min-width: 2.1rem; text-align: center;
    padding: .25rem .5rem; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--ink-soft); font-size: .82rem; line-height: 1.2;
}
.pp-btn:hover  { border-color: var(--brand); color: var(--brand); }
.pp-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
@media print { .per-page { display: none !important; } }

/* --- பகுதியின் அடியில் "எல்லாம் பார்" --- */
.section-more { display: flex; justify-content: center; margin-top: 1.8rem; }
@media print { .section-more { display: none !important; } }

/* ====================================================================
   தொகுப்பின் படம்

   சின்னத்துக்குப் பதிலாக ஒரு படம் — பொதுவாக அந்தத் தொகுப்புக்காகச்
   செய்த சுவரொட்டி. சுவரொட்டிகள் பல்வேறு விகிதத்தில் இருப்பதால்
   object-fit: cover, ஆனால் ஒரே உயரத்தில் — அட்டைகள் சீராக நிற்க
   வேண்டும்.
   ==================================================================== */
/* சுவரொட்டிக்குள் எழுத்து இருக்கிறது — வெட்டினால் (cover) அது
   பாதியில் அறுபடும். எனவே contain: முழுப் படமும் தெரியும், மீதி
   இடத்தில் அமைதியான பின்னணி. */
.coll-tile.has-img .ct-img {
    display: block; width: 100%; height: 150px;
    border-radius: 12px; overflow: hidden;
    background: var(--bg-alt); border: 1px solid var(--border);
    margin-bottom: .2rem;
}
.coll-tile.has-img .ct-img img {
    width: 100%; height: 100%; object-fit: contain; display: block;
    transition: transform .35s ease;
}
.coll-tile.has-img:hover .ct-img img { transform: scale(1.04); }

/* தொகுப்புப் பக்கத் தலைப்பில் — சின்னத்தின் சிறு சதுரம் அல்ல.
   சுவரொட்டி படிக்கக்கூடிய அளவில், அதன் சொந்த விகிதத்தில். */
.coll-head-img {
    display: block; max-width: 280px; margin-bottom: 1.1rem;
    border-radius: 14px; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.coll-head-img img { width: 100%; height: auto; display: block; }

/* நடுவில் நிற்கும் தலைப்பாக இருந்தால் படமும் நடுவில் */
.page-head:not(.coll-head-split) .coll-head-img { margin-inline: auto; }

@media (max-width: 575.98px) { .coll-head-img { max-width: 200px; } }

/* திருத்தும் படிவத்தில் ஒரு சிறு முன்னோட்டம் */
.coll-cover-prev {
    display: block; max-width: 100%; max-height: 160px;
    border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-alt);
}

/* ====================================================================
   தளத்தின் தலைப்புப்படம்

   தலைப்புப் பட்டைக்கு மேலே. உருளும்போது மறையும் — ஒட்டிக்கொள்வது
   பட்டை மட்டுமே. இல்லையெனில் ஒவ்வொரு பக்கத்திலும் திரையின் பாதி
   படமாகவே இருக்கும், படிக்க இடம் குறையும்.
   ==================================================================== */
.site-banner { background: var(--bg-alt); line-height: 0; }
.site-banner img {
    display: block; width: 100%; height: auto;
    max-height: 30vh; object-fit: cover; object-position: center;
}
@media (max-width: 767.98px) { .site-banner img { max-height: 22vh; } }
@media print { .site-banner { display: none !important; } }

/* நிர்வாகத்தில் முன்னோட்டம் */
.banner-prev {
    display: block; width: 100%; height: auto; max-height: 200px;
    object-fit: cover; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-alt);
}

/* ====================================================================
   எதுகை · மோனை காட்டி

   ஒத்த ஓசைக்கு ஒரே நிறம். எனவே எந்த அடிகள் ஒன்றோடொன்று
   ஒக்கின்றன என்பது ஒரே பார்வையில் தெரியும்.

   மோனை (முதல் எழுத்து) — நிறத்தால் மட்டும்.
   எதுகை (இரண்டாம் எழுத்து) — நிறத்துடன் மெல்லிய பின்னணியும்,
   ஏனெனில் அதுவே செய்யுளைப் பிணைப்பது.
   ==================================================================== */
.read-rhyme {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: .3rem .8rem;
    color: var(--ink-soft); font-size: .85rem; cursor: pointer;
}
.read-rhyme:hover { border-color: var(--brand); color: var(--brand); }
.read-rhyme.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.ry-monai, .ry-ethukai { border-radius: 3px; }
.ry-ethukai { padding: 0 .06em; font-weight: 600; }
.ry-monai   { font-weight: 600; }

/* ஆறு ஓசைக் குழு — ஒன்றோடொன்று தெளிவாக வேறுபடும் நிறங்கள் */
.ry-h0 { color: #b3315a; } .ry-ethukai.ry-h0 { background: rgba(179,49,90,.13); }
.ry-h1 { color: #1c6b8c; } .ry-ethukai.ry-h1 { background: rgba(28,107,140,.13); }
.ry-h2 { color: #2e7d32; } .ry-ethukai.ry-h2 { background: rgba(46,125,50,.13); }
.ry-h3 { color: #8a5a12; } .ry-ethukai.ry-h3 { background: rgba(138,90,18,.15); }
.ry-h4 { color: #6d4aa8; } .ry-ethukai.ry-h4 { background: rgba(109,74,168,.13); }
.ry-h5 { color: #c2601a; } .ry-ethukai.ry-h5 { background: rgba(194,96,26,.13); }

[data-theme="dark"] .ry-h0 { color: #ff8fae; }
[data-theme="dark"] .ry-h1 { color: #7fc4e8; }
[data-theme="dark"] .ry-h2 { color: #86d68b; }
[data-theme="dark"] .ry-h3 { color: #e8bd6a; }
[data-theme="dark"] .ry-h4 { color: #c0a8ec; }
[data-theme="dark"] .ry-h5 { color: #f0a165; }

@media print { .read-rhyme { display: none !important; } }

/* ====================================================================
   அரும்பதம்

   செய்யுளில் ஒரு சொல்லுக்குக் கீழ் மெல்லிய புள்ளிக்கோடு. கத்தும்
   வண்ணம் வேண்டாம் — செய்யுளே முதன்மை; அகராதி துணை மட்டுமே.
   ==================================================================== */
.gl-word {
    border-bottom: 1px dotted var(--brand);
    cursor: help; padding-bottom: 1px;
}
.gl-word:hover, .gl-word.on { background: var(--brand-soft); border-radius: 3px; }
.gl-word:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.gl-tip {
    position: fixed; z-index: 1060; max-width: min(30rem, 88vw);
    background: var(--ink); color: var(--bg);
    padding: .5rem .8rem; border-radius: 10px;
    font-family: var(--font-ui); font-size: .88rem; line-height: 1.6;
    box-shadow: var(--shadow-lg);
}

/* --- பொது அகராதிப் பக்கம் --- */
.gl-jump {
    display: flex; flex-wrap: wrap; gap: .3rem;
    margin-bottom: 2rem; justify-content: center;
}
.gl-jump a {
    display: grid; place-items: center; min-width: 2.1rem; height: 2.1rem;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--ink-soft); font-weight: 600;
}
.gl-jump a:hover { border-color: var(--brand); color: var(--brand); }

.gl-letter {
    font-family: var(--font-title);
    font-size: 1.5rem; color: var(--brand);
    border-bottom: 2px solid var(--border);
    padding-bottom: .3rem; margin: 2rem 0 1rem;
}
.gl-list { margin: 0; }
.gl-list dt {
    font-weight: 600; color: var(--ink); font-size: 1.05rem;
    margin-top: 1rem;
}
.gl-list dd {
    margin: .2rem 0 0; color: var(--ink-soft);
    font-family: var(--font-read); line-height: 1.85;
}
.gl-note {
    display: block; margin-top: .25rem;
    color: var(--muted); font-size: .88rem;
}

@media print { .gl-jump, .gl-tip { display: none !important; } }

/* ====================================================================
   ஒலி வடிவம்
   ==================================================================== */
.post-audio {
    margin: 2rem 0 0; padding: 1rem 1.1rem;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.post-audio figcaption {
    display: flex; align-items: center; gap: .5rem;
    color: var(--muted); font-size: .85rem; margin-bottom: .6rem;
}
.post-audio figcaption span { margin-inline-start: auto; }
.post-audio audio { width: 100%; }

/* --- தொகுப்பின் ஒலிப் பட்டியல் --- */
.au-list { list-style: none; margin: 0; padding: 0; }
.au-list li {
    display: flex; align-items: center; gap: .8rem;
    padding: .6rem .2rem; border-bottom: 1px dashed var(--border);
}
.au-list li:last-child { border-bottom: 0; }
.au-play {
    flex: 0 0 auto; width: 2.4rem; height: 2.4rem;
    display: grid; place-items: center;
    border: 1px solid var(--border); border-radius: 50%;
    background: var(--surface); color: var(--brand); cursor: pointer;
}
.au-play:hover { border-color: var(--brand); }
.au-play.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.au-no { flex: 0 0 1.6rem; color: var(--muted); font-size: .8rem; text-align: end; }
.au-name { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; }
.au-name:hover { color: var(--brand); }
.au-len { color: var(--muted); font-size: .82rem; white-space: nowrap; }

.au-bar {
    position: sticky; bottom: 0; z-index: 20;
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
    margin-top: 1rem; padding: .7rem .9rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.au-now { font-weight: 600; color: var(--ink); font-size: .9rem; }
.au-bar audio { flex: 1; min-width: 14rem; }

@media print { .post-audio, .au-bar, .au-play { display: none !important; } }

/* --- சந்தா --- */
.sub-form { max-width: 32rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sub-link {
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.5rem;
}

/* ரகசிய முன்னோட்டப் பட்டை — இது வெளியிடப்படவில்லை என்பதைச் சொல்ல */
.preview-bar {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    background: #7a4a00; color: #fff;
    padding: .7rem 1rem; font-size: .9rem;
}
.preview-bar em {
    font-style: normal; background: rgba(255,255,255,.2);
    padding: .1rem .5rem; border-radius: 999px; font-size: .82rem;
}

/* ---------------------------------------------------------------
   "இதையும் படியுங்கள்" — ஏன் இது என்ற சிறு குறிப்பு
   அட்டைக்குக் கீழே, அமைதியாக. அட்டையின் உள்ளே வைத்தால்
   post_card.php எல்லா இடத்திலும் மாறும் — அது வேண்டாம்.
   --------------------------------------------------------------- */
.rel-why {
    margin: .45rem .2rem 0;
    font-size: .78rem;
    color: var(--muted, #7a7a7a);
    display: flex; align-items: center; gap: .35rem;
}
.rel-why i { font-size: .7rem; opacity: .7; }

/* ---------------------------------------------------------------
   இன்று இதே நாளில் — அட்டைக்குக் கீழ் நாள்
   --------------------------------------------------------------- */
.otd-when {
    margin: .45rem .2rem 0;
    font-size: .78rem;
    color: var(--muted, #7a7a7a);
}
.section-lead {
    margin-top: -.6rem; margin-bottom: 1.4rem;
    color: var(--muted, #7a7a7a); font-size: .92rem;
}

/* --------------------- அச்சிடு பொத்தான் --------------------- */
.read-print {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: .3rem .8rem;
    color: var(--ink-soft); font-size: .85rem; cursor: pointer;
}
.read-print:hover { border-color: var(--brand); color: var(--brand); }

/* ====================================================================
   படித்ததைத் தொடர்தல்

   வாசகரின் உலாவியில் மட்டும் நினைவு — சேவையகத்துக்கு எதுவும்
   தெரியாது. எனவே இது ஒரு "பரிந்துரை" அல்ல, ஒரு நினைவூட்டல்.
   ==================================================================== */
.continue-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
    margin: 1.5rem 0 0;
}
.continue-card {
    display: flex; align-items: center; gap: .9rem; flex: 1 1 22rem;
    padding: .85rem 1.1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-inline-start: 4px solid var(--brand);
    border-radius: var(--radius);
    text-decoration: none; color: inherit;
    transition: border-color .15s, transform .15s;
}
.continue-card:hover { transform: translateY(-1px); border-color: var(--brand); }
.continue-card .cc-ico { color: var(--brand); font-size: 1.1rem; }
.continue-card .cc-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.continue-card .cc-line {
    font-size: .78rem; color: var(--muted, #7a7a7a);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.continue-card .cc-go { font-weight: 600; }
.continue-card .cc-arrow { margin-inline-start: auto; color: var(--muted, #9a9a9a); }
.cc-forget {
    background: none; border: 0; padding: .2rem .4rem;
    color: var(--muted, #9a9a9a); font-size: .78rem; cursor: pointer;
    text-decoration: underline;
}
.cc-forget:hover { color: var(--brand); }

/* ====================================================================
   வாசகருக்கு யாப்புக் காட்சி

   சீரைப் பிரித்து, ஒவ்வொன்றுக்கும் பெயர் — வெண்பாவை வெண்பாவாகப்
   படிக்கக் கற்க. "யாப்பு" பொத்தான் அழுத்தும்வரை மூடியே.
   ==================================================================== */
.yappu-view {
    margin: 1.2rem 0 0;
    padding: 1rem 1.1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-inline-start: 3px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.yv-adi { margin-bottom: .8rem; }
.yv-adi:last-of-type { margin-bottom: .4rem; }
.yv-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .15rem; row-gap: .5rem; }
.yv-seer {
    display: inline-flex; flex-direction: column; align-items: center;
    padding: .1rem .45rem; border-radius: 6px;
    background: var(--surface);
}
/* வாசகர் பக்கத்திலும் அதே எச்சரிக்கை — சொல்லுக்குக் கட்டுப்பாடான
   அகலம் கொடுக்கக் கூடாது; தமிழ்ச் சீர் நீளமானது. நீளமெனில்
   துண்டு அடுத்த வரிக்குச் செல்லட்டும் (.yv-row wrap). */
.yv-word { font-size: 1.02rem; line-height: 1.4; white-space: nowrap; max-width: 100%; }
.yv-name { font-size: .7rem; color: var(--muted, #7a7a7a); }
.yv-thalai { align-self: center; color: var(--muted, #b0b0b0); padding: 0 .1rem; }
.yv-meta {
    font-size: .74rem; color: var(--muted, #8a8a8a);
    margin-top: .2rem; padding-inline-start: .45rem;
}
.yv-sum { font-size: .85rem; margin: .8rem 0 .3rem; }
.yv-note { font-size: .76rem; color: var(--muted, #8a8a8a); margin: 0; }

/* ====================================================================
   பாடபேதம் — வேறு பாடம்

   செம்பதிப்பு மரபு: அடிக்குறிப்பாக, சிறிய எழுத்தில், செய்யுளுக்குக்
   கீழே. படிப்பவரின் கண் முதலில் செய்யுளில் விழ வேண்டும்.
   ==================================================================== */
.post-variants {
    margin: 1.4rem 0 0;
    padding: .9rem 1.1rem;
    border-top: 1px solid var(--border);
    font-size: .88rem;
}
.post-variants h3 {
    font-size: .76rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted, #8a8a8a); margin: 0 0 .5rem;
}
.post-variants ul { list-style: none; margin: 0; padding: 0; }
.post-variants li { padding: .18rem 0; }
.post-variants .pvn {
    font-size: .72rem; padding: 0 .4rem; border-radius: 999px;
    background: var(--bg-alt); color: var(--muted, #8a8a8a);
}
.post-variants .pvb { opacity: .6; }
.post-variants .pva { font-weight: 600; }
.post-variants em { font-style: normal; color: var(--muted, #8a8a8a); font-size: .8rem; }
.post-variants .pvo { color: var(--muted, #8a8a8a); font-size: .82rem; }

/* ====================================================================
   அணுகல் தன்மை

   ----------------------------------------------------------------
   1. தாண்டிச் செல்லும் இணைப்பு

   விசைப்பலகையால் மட்டும் பயன்படுத்துபவர் ஒவ்வொரு பக்கத்திலும்
   மெனுவின் இருபது இணைப்பையும் Tab-ஆல் கடக்க வேண்டியிருந்தது.
   பார்வையில் தெரியாது; focus வந்தால் மட்டும் மேலிருந்து இறங்கும்.

   2. focus வளையம்

   :focus-visible மட்டும் — சுட்டியால் சொடுக்கும்போது வளையம்
   தேவையில்லை, விசைப்பலகையால் நகரும்போது **கட்டாயம்**. இது
   இல்லாவிட்டால் "இப்போது எங்கே இருக்கிறேன்" என்று தெரியாது.
   ==================================================================== */
.skip-link {
    position: fixed; top: -10rem; inset-inline-start: 1rem;
    z-index: 2000;
    padding: .7rem 1.2rem;
    background: var(--brand); color: #fff;
    border-radius: 0 0 10px 10px;
    text-decoration: none; font-weight: 600;
    transition: top .15s;
}
.skip-link:focus { top: 0; color: #fff; }

/* --- focus வளையம் — எல்லா ஊடாடும் உறுப்புக்கும் --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}
/* main-க்குத் தாவியபின் வளையம் வேண்டாம் — அது ஒரு இடம், பொத்தான் அல்ல */
main:focus, main:focus-visible,
.admin-content:focus, .admin-content:focus-visible { outline: none; }

/* --- தொடு இலக்கு: விரலுக்கு 44px --- */
@media (pointer: coarse) {
    .site-nav a, .main-menu a, .footer-links a,
    .read-tools button, .read-tools a,
    .lang-toggle a, .theme-toggle, .pager a {
        min-height: 44px;
        display: inline-flex; align-items: center;
    }
}

/* --- அசைவைக் குறைக்கக் கேட்டவருக்கு --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ====================================================================
   கைபேசி — புதிய பகுதிகள்

   ----------------------------------------------------------------
   வாசகர்களில் பெரும்பாலோர் கைபேசியில். 360px அகலத்தில் ஒரு
   உறுப்பு வெளியே நீண்டால் **பக்கம் முழுவதும்** பக்கவாட்டில்
   உருளும் — படிக்கவே முடியாது. அதுவே மிகப் பொதுவான கைபேசிப் பிழை.

   எனவே: நீளக்கூடிய ஒவ்வொன்றுக்கும் min-width:0, சுருங்க முடியாத
   வரிசைக்கு அதன் **சொந்த** உருளை.
   ---------------------------------------------------------------- */

/* தொடர்ந்து படியுங்கள் — 22rem அடிப்படை 360px-ல் அடங்காது */
.continue-card { min-width: 0; }
.continue-card .cc-text { min-width: 0; }
.continue-card .cc-go {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* பாடபேதம் — நீளமான அடி */
.post-variants li { overflow-wrap: anywhere; }

/* யாப்புக் காட்சி — சீர்ச் சொல் உடையக் கூடாது; எனவே இந்தப் பெட்டி
   மட்டும் பக்கவாட்டில் உருளும், பக்கம் அல்ல. */
.yappu-view { overflow-x: auto; overscroll-behavior-x: contain; }
.yv-row { min-width: 0; }
.yv-seer { max-width: 100%; min-width: 0; }

@media (max-width: 575.98px) {
    .continue-box { flex-direction: column; align-items: stretch; }
    .continue-card { flex: 1 1 auto; }
    .cc-forget { align-self: flex-end; }

    /* செய்யுள் அடி நீளமானால் — உடைக்காமல், இந்தப் பகுதி மட்டும் உருளும் */
    .single-body.is-verse { overflow-x: auto; }

    /* தொடு இலக்கு — சிறு பொத்தான்களும் விரலுக்கு எட்ட வேண்டும் */
    .read-tools { gap: .5rem; flex-wrap: wrap; }
    .read-rhyme, .read-random, .read-print { padding: .45rem .9rem; }
}

/* --- தொகுப்பின் வேகம் --- */
.coll-pace {
    font-size: .82rem;
    color: var(--muted);
    margin-top: .35rem;
}

/* ====================================================================
   காலக் கோடு

   பிரிவு "எந்த வகை", தொகுப்பு "எந்தத் தொடர்" — இது **எப்போது**.
   ஒரு மாதம் பன்னிரண்டு, அடுத்த மாதம் ஒன்றுமில்லை; அதுவும் ஒரு கதை.
   ==================================================================== */
.tl-year { margin-bottom: 2.5rem; }
.tl-y {
    display: flex; align-items: baseline; gap: .7rem;
    font-size: 1.6rem; margin: 0 0 1rem;
    padding-bottom: .4rem; border-bottom: 2px solid var(--border);
}
.tl-y span {
    font-size: .78rem; color: var(--muted);
    padding: .1rem .55rem; border-radius: 999px; background: var(--bg-alt);
}
.tl-month { margin-bottom: 1.4rem; }
.tl-m-head {
    display: flex; align-items: center; gap: .7rem;
    margin-bottom: .4rem;
}
.tl-m-name { font-weight: 600; font-size: .92rem; min-width: 6rem; }
.tl-m-bar {
    flex: 1; height: 6px; border-radius: 999px; background: var(--bg-alt);
}
.tl-m-bar span {
    display: block; height: 100%; border-radius: 999px;
    background: var(--brand); opacity: .5;
}
.tl-m-n {
    font-size: .78rem; color: var(--muted);
    min-width: 1.6rem; text-align: end;
}
.tl-list { list-style: none; margin: 0; padding: 0 0 0 .3rem; }
.tl-list li {
    display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap;
    padding: .3rem 0;
    border-inline-start: 2px solid var(--border);
    padding-inline-start: .9rem;
}
.tl-list li:hover { border-inline-start-color: var(--brand); }
.tl-list a {
    display: flex; align-items: baseline; gap: .6rem;
    text-decoration: none; color: inherit; min-width: 0; flex: 1;
}
.tl-day {
    min-width: 1.5rem; text-align: end;
    font-size: .78rem; color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.tl-name { flex: 1; min-width: 0; }
.tl-list a:hover .tl-name { color: var(--brand); }
.tl-coll, .tl-cat {
    font-size: .72rem; color: var(--muted);
    padding: .05rem .5rem; border-radius: 999px; background: var(--bg-alt);
}

@media (max-width: 575.98px) {
    .tl-m-name { min-width: 4.5rem; font-size: .85rem; }
    .tl-y { font-size: 1.3rem; }
}
.tl-m-bar.is-flat { background: none; }
.tl-note {
    max-width: 46rem; margin: .6rem auto 0;
    font-size: .82rem; color: var(--muted); line-height: 1.6;
}

/* எழுதிய நாள் — ஆண்டு / மாதம் / நாள், மூன்றும் தனித்தனி.
   "1998" மட்டுமே நினைவிருந்தால் மற்ற இரண்டையும் "—" விடலாம். */
.wr-row { display: flex; gap: .4rem; align-items: center; }
.wr-row input[type="number"] { flex: 0 0 5.5rem; }
.wr-row select { flex: 1 1 auto; min-width: 0; }
.wr-row .wr-d { flex: 0 0 4.5rem; }

/* மாதம் தெரியாத ஆண்டு — ஆண்டின் கடைசியில், மங்கலாக */
.tl-month.is-vague .tl-m-name { color: var(--muted); font-style: italic; font-weight: 400; }

/* ====================================================================
   தமிழ் இலக்கணம்

   இது ஒரு **துணைநூல்** — ஒரு முறை படித்து விட்டுப் போவதற்கானது
   அல்ல, திரும்பத் திரும்பப் பார்ப்பதற்கானது. எனவே தாவும் இணைப்பு,
   தேடல், தெளிவான தலைப்பு.
   ==================================================================== */
.il-jump {
    position: sticky; top: 0; z-index: 20;
    display: flex; flex-wrap: wrap; gap: .35rem;
    padding: .6rem 0; margin-bottom: 1rem;
    background: var(--bg); border-bottom: 1px solid var(--border);
}
.il-jump a {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .8rem; text-decoration: none; color: var(--text);
    padding: .3rem .7rem; border-radius: 999px;
    background: var(--bg-alt); border: 1px solid var(--border);
}
.il-jump a i { font-size: .72rem; color: var(--brand); }
.il-jump a:hover { border-color: var(--brand); color: var(--brand); }
.il-jump a:hover i { color: var(--brand); }

.il-find {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .8rem; margin-bottom: 2rem;
    border-radius: .6rem;
    background: var(--bg-alt); border: 1px solid var(--border);
}
.il-find > i { color: var(--muted); }
.il-find input { border: 0; background: none; box-shadow: none !important; }
.il-count { font-size: .8rem; color: var(--muted); min-width: 2rem; text-align: end; }

.il-sec { margin-bottom: 3.5rem; scroll-margin-top: 4.5rem; }
.il-h {
    display: flex; align-items: baseline; gap: .5rem;
    font-size: 1.6rem; margin: 0 0 .6rem;
    padding-bottom: .5rem; border-bottom: 2px solid var(--border);
}
.il-h i { font-size: 1.1rem; color: var(--brand); }
.il-anchor {
    margin-inline-start: auto; text-decoration: none;
    color: var(--border); font-size: .9rem;
}
.il-h:hover .il-anchor { color: var(--brand); }
.il-lead {
    max-width: 48rem; margin: 0 0 2rem;
    color: var(--muted); line-height: 1.85;
}

/* ---- ஒரு கூறு ---- */
.il-b { margin-bottom: 2rem; max-width: 52rem; }
.il-b.il-table { max-width: none; }
.il-bh {
    font-size: 1.05rem; margin: 0 0 .5rem;
    padding-inline-start: .7rem;
    border-inline-start: 3px solid var(--brand);
}
.il-b p { line-height: 1.9; margin: 0 0 .7rem; }
.il-b p:last-child { margin-bottom: 0; }

.il-l { margin: 0; padding-inline-start: 1.3rem; }
.il-l li { line-height: 1.85; padding: .15rem 0; }

/* ---- அட்டவணை ---- */
.il-tw { overflow-x: auto; margin: 0 0 .5rem; }
.il-t {
    width: 100%; border-collapse: collapse; font-size: .9rem;
    /* கலங்கள் நெருக்கமானால் படிக்க முடியாது */
    min-width: 22rem;
}
.il-t th, .il-t td {
    padding: .45rem .7rem; text-align: start; vertical-align: top;
    border-bottom: 1px solid var(--border); line-height: 1.7;
}
.il-t th {
    font-weight: 600; font-size: .82rem; color: var(--muted);
    background: var(--bg-alt); white-space: nowrap;
    position: sticky; top: 0;
}
.il-t tbody tr:hover { background: var(--bg-alt); }

/* ---- மேற்கோள் அடி ---- */
.il-v {
    margin: 0 0 .5rem; padding: .9rem 1.1rem;
    border-inline-start: 3px solid var(--brand);
    background: var(--bg-alt); border-radius: 0 .4rem .4rem 0;
    /* செய்யுளுக்கு வடிவமே பொருளின் பகுதி — வரி மடங்கக் கூடாது */
    white-space: pre-wrap; font-size: 1.02rem; line-height: 2;
}
.il-gloss { font-size: .9rem; color: var(--muted); }

.il-eg {
    font-size: .92rem; padding: .4rem .8rem; border-radius: .4rem;
    background: var(--bg-alt);
}
.il-eg span { font-weight: 600; color: var(--muted); font-size: .82rem; }

.il-note {
    font-size: .88rem; color: var(--muted);
    padding-inline-start: .8rem; border-inline-start: 2px solid var(--border);
}
.il-src { font-size: .82rem; color: var(--muted); font-style: italic; }

.il-nohit { text-align: center; color: var(--muted); padding: 3rem 0; }
.il-foot {
    max-width: 52rem; margin-top: 3rem; padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: .85rem; color: var(--muted); line-height: 1.8;
}

@media (max-width: 767.98px) {
    .il-jump { padding: .5rem 0; gap: .3rem; }
    .il-jump a span { display: none; }        /* சின்னம் மட்டும் */
    .il-jump a { padding: .45rem .6rem; }
    .il-jump a i { font-size: .85rem; }
    .il-h { font-size: 1.25rem; }
    .il-t { font-size: .82rem; }
}

@media print {
    .il-jump, .il-find, .il-anchor { display: none; }
    .il-sec { break-inside: auto; }
    .il-b { break-inside: avoid; }
    .il-t th { position: static; }
}

/* ====================================================================
   தமிழ்ப் பேரகராதி
   ==================================================================== */
.ag-find {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .8rem; margin-bottom: 1.2rem;
    border-radius: .6rem; background: var(--bg-alt); border: 1px solid var(--border);
}
.ag-find > i { color: var(--muted); }
.ag-find input { border: 0; background: none; box-shadow: none !important; }

/* எழுத்து வரிசை — மரபுத் தமிழ் வரிசையில். "ன" கடைசி. */
.ag-letters {
    display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 2rem;
    padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.ag-letters a {
    display: inline-flex; align-items: baseline; gap: .25rem;
    text-decoration: none; color: var(--text);
    padding: .3rem .6rem; border-radius: .4rem;
    background: var(--bg-alt); border: 1px solid var(--border);
}
.ag-letters a:hover { border-color: var(--brand); color: var(--brand); }
.ag-letters a.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ag-letters .ag-l { font-size: 1.05rem; }
.ag-letters .ag-n { font-size: .7rem; color: var(--muted); }
.ag-letters a.is-on .ag-n { color: rgba(255,255,255,.75); }

.ag-count { font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.ag-hint { max-width: 42rem; color: var(--muted); line-height: 1.85; }

.ag-list {
    display: grid; gap: .3rem;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
}
.ag-item {
    display: flex; align-items: baseline; gap: .5rem;
    padding: .5rem .7rem; border-radius: .4rem;
    text-decoration: none; color: inherit;
    border-inline-start: 2px solid var(--border);
}
.ag-item:hover { background: var(--bg-alt); border-inline-start-color: var(--brand); }
.ag-item .ag-w { font-weight: 600; flex: 0 0 auto; }
.ag-item:hover .ag-w { color: var(--brand); }
.ag-item .ag-d { font-size: .85rem; color: var(--muted); flex: 1; min-width: 0; }
.ag-item .ag-e { font-size: .68rem; color: var(--muted); flex: 0 0 auto; }

.ag-entry { max-width: 48rem; }
.ag-stem { font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.ag-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1.2rem; }
.ag-chip {
    font-size: .74rem; padding: .12rem .55rem; border-radius: 999px;
    background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border);
}
.ag-chip.is-era { border-color: var(--brand); color: var(--brand); }
.ag-chip.is-rom { font-family: ui-monospace, monospace; }

.ag-m { font-size: 1.1rem; line-height: 1.9; margin: 0 0 .6rem; }
.ag-en { color: var(--muted); font-size: .88rem; font-style: italic; }
.ag-senses { margin: 0 0 1rem; padding-inline-start: 1.4rem; }
.ag-senses li { line-height: 1.9; padding: .3rem 0; }
.ag-eg {
    display: block; font-size: .88rem; color: var(--muted);
    margin-top: .2rem; padding-inline-start: .7rem;
    border-inline-start: 2px solid var(--border);
}
.ag-src { display: block; font-size: .78rem; color: var(--muted); font-style: italic; }
.ag-note {
    font-size: .9rem; color: var(--muted); line-height: 1.8;
    padding: .5rem .8rem; border-radius: .4rem; background: var(--bg-alt);
}

.ag-block { margin-top: 2rem; }
.ag-block h2 {
    font-size: .82rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted); margin: 0 0 .6rem; font-weight: 600;
}
.ag-forms, .ag-words { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; }
.ag-forms span, .ag-words a {
    font-size: .85rem; padding: .15rem .55rem; border-radius: .3rem;
    background: var(--bg-alt); text-decoration: none; color: inherit;
}
.ag-words a:hover { color: var(--brand); }
.ag-near { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; }

.ag-uses { list-style: none; margin: 0; padding: 0; }
.ag-uses li {
    padding: .4rem 0 .4rem .8rem;
    border-inline-start: 2px solid var(--border);
    margin-bottom: .2rem;
}
.ag-uses li:hover { border-inline-start-color: var(--brand); }
.ag-uses a { text-decoration: none; font-weight: 500; }
.ag-line {
    display: block; font-size: .88rem; color: var(--muted);
    margin-top: .15rem; white-space: pre-wrap;
}

@media (max-width: 575.98px) {
    .ag-near { grid-template-columns: 1fr; }
    .ag-list { grid-template-columns: 1fr; }
}

/* ====================================================================
   சொல்லைத் தொட்டால் பொருள்

   செய்யுளில் எந்தச் சொல்லும் **தோற்றத்தில் மாறவில்லை** — ஆயிரம்
   சொல்லுக்குக் கீழ்க்கோடு போட்டால் செய்யுளே தெரியாது. கவிதைக்கு
   வெண்மையும் அமைதியும் தேவை. சொடுக்கியபின் மட்டுமே ஒரு மெல்லிய
   வட்டம் — அதுவும் உரையை மாற்றாமல், மேல் ஒரு தனி அடுக்காக.
   ==================================================================== */
.lex-tip {
    font-size: .78rem; color: var(--muted); margin: .6rem 0 0; opacity: .7;
}
[data-lexlook] { cursor: text; }

.lex-mark {
    position: absolute; z-index: 40; pointer-events: none; border-radius: 3px;
    background: rgba(180, 140, 60, .18);
    box-shadow: 0 0 0 1px var(--brand);
}

.lex-pop {
    position: absolute; z-index: 60;
    width: min(24rem, calc(100vw - 1.5rem));
    max-height: 60vh; overflow-y: auto;
    padding: .9rem 1rem;
    border-radius: .6rem;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,.22);
    font-size: .92rem; line-height: 1.75;
}
.lex-x {
    position: absolute; inset-inline-end: .4rem; top: .25rem;
    border: 0; background: none; cursor: pointer;
    font-size: 1.2rem; line-height: 1; color: var(--muted); padding: .2rem .35rem;
}
.lex-x:hover { color: var(--brand); }
.lex-head {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem;
    margin-bottom: .4rem; padding-inline-end: 1.4rem;
}
.lex-head b { font-size: 1.1rem; }
.lex-tag {
    font-size: .68rem; padding: .05rem .45rem; border-radius: 999px;
    background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border);
}
.lex-tag.is-poet { border-color: var(--brand); color: var(--brand); }
.lex-m { margin: 0 0 .3rem; }
.lex-en { color: var(--muted); font-size: .85rem; }
.lex-senses { margin: 0; padding-inline-start: 1.2rem; }
.lex-senses li { padding: .15rem 0; }
.lex-eg {
    display: block; font-size: .85rem; color: var(--muted);
    padding-inline-start: .6rem; border-inline-start: 2px solid var(--border);
    margin-top: .15rem;
}
.lex-note { font-size: .85rem; color: var(--muted); margin: .4rem 0 0; }
.lex-none { color: var(--muted); margin: 0; }
.lex-rule { margin: .7rem 0; border: 0; border-top: 1px solid var(--border); }
.lex-more { display: inline-block; margin-top: .5rem; font-size: .85rem; }

@media (pointer: coarse) {
    .lex-pop { font-size: .95rem; }
    .lex-x { font-size: 1.5rem; padding: .35rem .5rem; }
}
@media print { .lex-pop, .lex-mark, .lex-tip { display: none !important; } }

/* ====================================================================
   திணை

   பிரிவு "எந்த வகை"; திணை "**எதைப் பற்றி**". இரண்டும் வெவ்வேறு
   கேள்விக்கு விடை — எனவே வெவ்வேறு பக்கம்.
   ==================================================================== */
.th-set { margin-bottom: 3rem; }
.th-h {
    font-size: 1.5rem; margin: 0 0 .3rem;
    padding-bottom: .4rem; border-bottom: 2px solid var(--border);
}
.th-hint { color: var(--muted); line-height: 1.8; margin: 0 0 1.4rem; max-width: 44rem; }

.th-grid {
    display: grid; gap: .7rem;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.th-card {
    display: flex; flex-direction: column; gap: .2rem;
    padding: .9rem 1rem; border-radius: .6rem;
    text-decoration: none; color: inherit;
    background: var(--bg-alt); border: 1px solid var(--border);
    position: relative;
}
.th-card:hover { border-color: var(--brand); }
.th-name { font-size: 1.15rem; font-weight: 600; }
.th-card:hover .th-name { color: var(--brand); }
.th-n {
    position: absolute; top: .7rem; inset-inline-end: .9rem;
    font-size: .78rem; color: var(--muted);
    padding: .05rem .5rem; border-radius: 999px; background: var(--bg);
}
.th-uri { font-size: .88rem; line-height: 1.65; }
.th-nilam { font-size: .78rem; color: var(--muted); line-height: 1.6; }

.th-back { margin-bottom: 1.2rem; font-size: .9rem; }
.th-todo {
    margin-top: 2rem; padding: .6rem .9rem; border-radius: .5rem;
    font-size: .88rem; background: var(--bg-alt); border: 1px solid var(--border);
}
.th-foot {
    max-width: 46rem; margin-top: 2.5rem; padding-top: 1.2rem;
    border-top: 1px solid var(--border);
    font-size: .88rem; color: var(--muted); line-height: 1.8;
}

@media (max-width: 575.98px) {
    .th-grid { grid-template-columns: 1fr; }
}

/* ====================================================================
   வாசகரின் அலமாரி

   "பிடித்திருக்கிறது" சேவையகத்தில் — கவிஞருக்கான எண்.
   இது வாசகருக்கானது; உலாவியில் மட்டும், தளம் அறியாது.
   ==================================================================== */
.shelf-row {
    display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
    margin: .8rem 0 0;
}
#shelfBtn.is-on { border-color: var(--brand); color: var(--brand); }
.sh-go { font-size: .82rem; color: var(--muted); text-decoration: none; }
.sh-go:hover { color: var(--brand); }

.sh-list { list-style: none; margin: 0; padding: 0; }
.sh-list li {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .2rem .55rem .8rem;
    border-inline-start: 2px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.sh-list li:hover { border-inline-start-color: var(--brand); }
.sh-list a { flex: 1; min-width: 0; text-decoration: none; font-weight: 500; }
.sh-list a:hover { color: var(--brand); }
.sh-x {
    border: 0; background: none; cursor: pointer; line-height: 1;
    font-size: 1.3rem; color: var(--muted); padding: .1rem .5rem;
}
.sh-x:hover { color: #b3261e; }
.sh-tools { margin-top: 1.2rem; }
.sh-note { color: var(--muted); font-size: .9rem; margin-bottom: .8rem; }
.sh-priv {
    max-width: 44rem; margin-top: 2.5rem; padding-top: 1.2rem;
    border-top: 1px solid var(--border);
    font-size: .85rem; color: var(--muted); line-height: 1.8;
}
@media (pointer: coarse) { .sh-x { font-size: 1.6rem; padding: .3rem .6rem; } }

/* ஒரு பொருள், பல சொல் — ஒரு சொல்லுக்குப் பல பொருள் இருந்தால்
   ஒவ்வொன்றுக்கும் தனிக் கூட்டம். "கண்" விழியாகவும் துளையாகவும்
   வேறு வேறு கூட்டத்தில். */
.ag-syn { margin-bottom: .9rem; }
.ag-syn-h { font-size: .88rem; margin: 0 0 .3rem; }
.ag-syn-h i { color: var(--muted); font-size: .8rem; }

/* ====================================================================
   நூல் போலப் படித்தல்

   ஒரு பக்கம், ஒரு செய்யுள். மெனு இல்லை, பட்டை இல்லை.
   ஒரு நூலைப் படிக்கும்போது அட்டையும் விளக்கமும் இடையில்
   வருவதில்லை.
   ==================================================================== */
.rd-body {
    margin: 0; overflow: hidden;
    background: var(--bg); color: var(--text);
    height: 100vh; height: 100dvh;
}
.rd { position: relative; height: 100%; }

.rd-page {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 3rem 1.5rem 5rem;
    opacity: 0; pointer-events: none;
    transition: opacity .28s ease;
}
.rd-page.is-on { opacity: 1; pointer-events: auto; }
.rd-page:focus { outline: none; }
.rd-mid { max-width: 34rem; width: 100%; text-align: center; }

.rd-no {
    font-size: .8rem; color: var(--muted); letter-spacing: .2em;
    margin: 0 0 .8rem;
}
.rd-t { font-size: 1.5rem; margin: 0 0 .3rem; line-height: 1.4; }
.rd-sub { color: var(--muted); font-size: .92rem; margin: 0 0 1.5rem; }

/* செய்யுள் — வரிகள் இடமிருந்து, தொகுதி நடுவில்.
   இதுவே தமிழ்ச் செய்யுளின் மரபான அமைப்பு. */
.rd-verse {
    display: inline-block; text-align: start;
    white-space: pre-wrap;
    font-family: var(--font-read, inherit);
    font-size: 1.18rem; line-height: 2.1;
    margin: 1rem 0;
}
.rd-m {
    color: var(--muted); font-size: .9rem; line-height: 1.8;
    margin-top: 2rem; padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: start;
}

.rd-page.is-title h1 { font-size: 2.1rem; line-height: 1.3; margin: 0 0 .5rem; }
.rd-page.is-title hr { width: 25%; margin: 1.6rem auto; border: 0; border-top: 1px solid var(--border); }
.rd-count { color: var(--muted); font-size: .88rem; }
.rd-page.is-end .rd-fin {
    color: var(--muted); letter-spacing: .3em; font-size: .8rem;
    margin-bottom: 1.5rem;
}
.rd-out { margin-top: 2rem; }

/* --------------------------- கட்டுப்பாடு ---------------------------
   மங்கலாக; சுட்டி நகர்ந்தால் தெளிவாக. படிக்கும்போது
   கண்ணுக்குத் தொந்தரவு கூடாது. */
.rd-bar {
    position: fixed; inset-inline: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom));
    opacity: .35; transition: opacity .2s;
}
.rd-bar:hover, .rd-bar:focus-within { opacity: 1; }
.rd-bar button {
    border: 1px solid var(--border); background: var(--bg-alt); color: var(--text);
    width: 2.6rem; height: 2.6rem; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.rd-bar button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.rd-bar button:disabled { opacity: .3; cursor: default; }
.rd-pos {
    font-size: .8rem; color: var(--muted); min-width: 4rem; text-align: center;
    font-variant-numeric: tabular-nums;
}
.rd-x {
    position: fixed; top: 1rem; inset-inline-end: 1rem;
    color: var(--muted); font-size: 1.2rem; text-decoration: none;
    opacity: .4; transition: opacity .2s; padding: .5rem;
}
.rd-x:hover { opacity: 1; color: var(--brand); }

.rd-progress {
    position: fixed; inset-inline: 0; top: 0; height: 2px; background: transparent;
}
.rd-progress span { display: block; height: 100%; background: var(--brand); transition: width .28s; }

@media (max-width: 575.98px) {
    .rd-page { padding: 2.5rem 1.2rem 5rem; }
    .rd-verse { font-size: 1.08rem; line-height: 2; }
    .rd-page.is-title h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    .rd-page, .rd-progress span { transition: none; }
}

/* ==================== ஓசையைக் கேட்டல் · ஒலிபெயர்ப்பு ====================
   இரண்டும் வாசகர் பக்கத்தில். அச்சில் இரண்டும் வேண்டாம் — காகிதத்தில்
   ஒலிக்கவும் முடியாது, ஒலிபெயர்ப்பு தாளை இரட்டிப்பாக்கும். */
.osai-view {
    margin: 1.4rem auto 0; max-width: 46rem;
    padding: .9rem 1.1rem;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.osai-view .os-row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.osai-view button {
    font: inherit; cursor: pointer; padding: .35rem .9rem;
    border: 1px solid var(--brand); border-radius: 99px;
    background: var(--brand); color: #fff; font-weight: 600;
}
.osai-view button.is-off { background: var(--surface); color: var(--brand); }
.osai-view label { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; color: var(--muted); }
.osai-view .os-note { margin: .6rem 0 0; font-size: .82rem; color: var(--muted); line-height: 1.7; }
.osai-view .os-seer { padding: 0 .12em; border-radius: 3px; }
.osai-view .os-seer.is-on { background: #ffe08a; }

.oli-panel {
    margin: .9rem auto 0; max-width: 46rem;
    padding: .9rem 1.1rem;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.oli-panel .oli-iso { display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; color: var(--muted); }
.oli-text {
    margin: .6rem 0 0; font-family: var(--font-read);
    font-size: 1.02rem; line-height: 2; white-space: pre-wrap;
    color: var(--ink-soft);
}

@media print { .osai-view, .oli-panel, .oli-btn { display: none !important; } }

/* ==================== தொடக்கமும் முடிவும் (edges.php) ==================== */
.edge-form {
    max-width: 46rem; margin: 0 auto 1.4rem;
    padding: 1rem 1.2rem;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.edge-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.edge-fields label { display: block; }
.edge-fields span { display: block; font-size: .86rem; color: var(--muted); margin-bottom: .25rem; }
.edge-scope {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
    margin-top: .8rem; font-size: .88rem; color: var(--muted);
}
.edge-scope label { display: inline-flex; align-items: center; gap: .35rem; }
.edge-scope button { margin-inline-start: auto; }

.edge-count { max-width: 46rem; margin: 0 auto .8rem; color: var(--muted); font-size: .9rem; }
.edge-list { list-style: none; max-width: 46rem; margin: 0 auto; padding: 0; }
.edge-list li { padding: .7rem 0; border-top: 1px solid var(--border); }
.edge-list li:first-child { border-top: 0; }
.edge-line {
    display: block; font-family: var(--font-read);
    font-size: 1.08rem; line-height: 1.9; color: var(--ink); text-decoration: none;
}
.edge-line:hover { color: var(--brand); }
.edge-line mark { background: #ffe08a; padding: 0 .1em; border-radius: 3px; }
.edge-meta { display: block; font-size: .82rem; color: var(--muted); margin-top: .15rem; }

.edge-tabs { display: flex; gap: .5rem; max-width: 46rem; margin: 0 auto 1rem; }
.edge-tabs a {
    padding: .3rem .9rem; border-radius: 99px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--muted); font-size: .88rem; text-decoration: none;
}
.edge-tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.edge-index { max-width: 46rem; margin: 0 auto; }
.edge-index > div { padding: .55rem 0; border-top: 1px solid var(--border); }
.edge-index > div:first-child { border-top: 0; }
.edge-index dt { font-family: var(--font-read); font-size: 1.02rem; line-height: 1.85; font-weight: 400; }
.edge-index dt a { color: var(--ink); text-decoration: none; }
.edge-index dt a:hover { color: var(--brand); }
.edge-index dd { margin: .1rem 0 0; font-size: .82rem; color: var(--muted); }

@media (max-width: 575.98px) {
    .edge-fields { grid-template-columns: 1fr; }
    .edge-scope button { margin-inline-start: 0; width: 100%; }
}
