/* ═══════════════════════════════════════
   TOKENS
═══════════════════════════════════════ */
:root {
    --g50: #f0faf0;
    --g100: #d6f0d6;
    --g200: #aad8aa;
    --g300: #72bc72;
    --g400: #3d9e3d;
    --g500: #2d8a2d;
    --g600: #1f6e1f;
    --g700: #155015;
    --g800: #0d360d;
    --ink: #0e1a0e;
    --ink2: #2c3e2c;
    --ink3: #4a604a;
    --muted: #7a8f7a;
    --rule: #e0ece0;
    --bg: #f7fbf7;
    --white: #ffffff;
    --wa: #25d366;
    --wa-dk: #1db954;
    --fb: 'DM Sans', sans-serif;
    --fh: 'Sora', sans-serif;
    --fm: 'Roboto Mono', monospace;
    --fk: 'Caveat', cursive;
    --fte: 'Noto Sans Telugu', sans-serif;
    --ease: cubic-bezier(.4, 0, .2, 1);
    --nav-h: 56px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --shadow-sm: 0 2px 10px rgba(45, 138, 45, .07);
    --shadow-md: 0 4px 20px rgba(45, 138, 45, .11);
}

/* ═══════════════════════════════════════
   RESET
═══════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--fb);
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: var(--g50);
}

::-webkit-scrollbar-thumb {
    background: var(--g300);
    border-radius: 3px;
}

/* ═══════════════════════════════════════
   NAV
═══════════════════════════════════════ */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    background: rgba(247, 251, 247, .96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 1px 12px rgba(45, 138, 45, .06);
}

.nav-brand {
    font-family: var(--fk);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--g600);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink3);
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: 100px;
    padding: 7px 14px;
    transition: background .18s, border-color .18s, color .18s;
}

.nav-back svg {
    flex-shrink: 0;
}

.nav-back:hover {
    background: var(--g50);
    border-color: var(--g200);
    color: var(--g600);
}

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
.page-hero {
    padding-top: var(--nav-h);
    background: linear-gradient(145deg, var(--g800) 0%, var(--g700) 55%, var(--g600) 100%);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 2.75rem 1.25rem 3rem;
    text-align: center;
}

.hero-eyebrow {
    display: inline-block;
    font-family: var(--fm);
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--g300);
    margin-bottom: .85rem;
}

.hero-heading {
    font-family: var(--fh);
    font-size: clamp(1.5rem, 4.5vw, 2.6rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: .7rem;
}

.hero-sub {
    font-size: .88rem;
    color: rgba(255, 255, 255, .6);
    line-height: 1.75;
    max-width: 460px;
    margin: 0 auto 1.1rem;
}

/* ── Hero search ── */
.hero-search {
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
}

.hero-search-inner {
    flex: 1;
    position: relative;
}

.hero-search-inner svg {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

#year-search {
    width: 100%;
    padding: 13px 40px 13px 42px;
    border: 1.5px solid rgba(255, 255, 255, .18);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .12);
    font-family: var(--fb);
    font-size: .95rem;
    color: #fff;
    outline: none;
    transition: border-color .22s var(--ease), background .22s var(--ease), box-shadow .22s var(--ease);
    -webkit-appearance: none;
    appearance: none;
}

#year-search::placeholder {
    color: rgba(255, 255, 255, .45);
}

#year-search:focus {
    border-color: rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .18);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .1);
}

#year-search::-webkit-outer-spin-button,
#year-search::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#year-search[type=number] {
    -moz-appearance: textfield;
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, .18);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: .68rem;
    transition: background .2s;
}

.search-clear-btn.show {
    display: flex;
}

.search-clear-btn:hover {
    background: rgba(255, 255, 255, .3);
}

/* ═══════════════════════════════════════
   MAIN WRAP
═══════════════════════════════════════ */
.main-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 0;
}

/* ═══════════════════════════════════════
   SEARCH RESULT CARD (shown when searching)
═══════════════════════════════════════ */
#search-result {
    display: none;
    margin-bottom: 1.25rem;
}

.result-card {
    background: var(--white);
    border: 1.5px solid var(--g300);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: fadeUp .25s var(--ease) both;
}

.result-card-header {
    background: linear-gradient(120deg, var(--g700), var(--g600));
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.result-year-badge {
    font-family: var(--fh);
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.result-meta {
    flex: 1;
}

.result-batch {
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.result-range {
    font-family: var(--fm);
    font-size: .65rem;
    color: rgba(255, 255, 255, .6);
    letter-spacing: .05em;
}

.result-status-pill {
    font-family: var(--fm);
    font-size: .58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 11px;
    border-radius: 100px;
}

.result-status-pill.active {
    background: rgba(37, 211, 102, .2);
    color: #7dffa8;
    border: 1px solid rgba(37, 211, 102, .3);
}

.result-status-pill.empty {
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .5);
    border: 1px solid rgba(255, 255, 255, .15);
}

.result-card-body {
    padding: 1rem 1.25rem;
}

.wa-join-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--wa);
    color: #fff;
    border-radius: 100px;
    padding: 11px 24px;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    width: 100%;
    transition: background .2s, transform .22s, box-shadow .22s;
    box-shadow: 0 3px 14px rgba(37, 211, 102, .3);
    margin-bottom: .65rem;
}

.wa-join-btn:hover {
    background: var(--wa-dk);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(37, 211, 102, .4);
}

.wa-join-btn svg {
    flex-shrink: 0;
}

.result-note {
    font-size: .74rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.55;
}

.result-no-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--bg);
    border: 1px dashed var(--rule);
    border-radius: var(--radius-sm);
    padding: .9rem 1rem;
    font-size: .83rem;
    color: var(--ink3);
    line-height: 1.6;
}

.result-no-group svg {
    color: var(--g400);
    flex-shrink: 0;
    margin-top: 1px;
}

.result-no-group a {
    color: var(--g600);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ═══════════════════════════════════════
   NO-RESULTS STATE
═══════════════════════════════════════ */
#no-results {
    display: none;
    text-align: center;
    padding: 2.5rem 1rem;
    animation: fadeUp .25s var(--ease) both;
}

.nr-emoji {
    font-size: 2.2rem;
    margin-bottom: .65rem;
}

#no-results p {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.7;
}

#no-results strong {
    color: var(--ink3);
}

/* ═══════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .85rem;
    padding-bottom: .6rem;
    border-bottom: 1.5px solid var(--rule);
}

.section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--fh);
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink2);
    text-transform: uppercase;
    letter-spacing: .07em;
}

.section-title svg {
    color: var(--g500);
}

.section-count {
    font-family: var(--fm);
    font-size: .65rem;
    color: var(--muted);
    letter-spacing: .05em;
}

/* ═══════════════════════════════════════
   ACTIVE GROUPS LIST
═══════════════════════════════════════ */
#active-section {
    margin-bottom: 1.5rem;
}

.active-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.batch-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    background: var(--white);
    border: 1.5px solid var(--rule);
    border-radius: var(--radius-md);
    padding: .85rem 1rem;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
    animation: fadeUp .3s var(--ease) both;
    text-decoration: none;
    color: inherit;
}

.batch-row:hover {
    border-color: var(--g300);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.batch-row-badge {
    flex-shrink: 0;
    width: 52px;
    height: 44px;
    background: var(--g500);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fh);
    font-size: .9rem;
    font-weight: 800;
    color: #fff;
}

.batch-row-info {
    flex: 1;
    min-width: 0;
}

.batch-row-main {
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink);
}

.batch-row-sub {
    font-family: var(--fm);
    font-size: .63rem;
    color: var(--muted);
    letter-spacing: .04em;
    margin-top: 2px;
}

.batch-row-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    width: auto !important;
    height: 40px;
    gap: 7px;
    background: var(--wa);
    color: #fff;
    border-radius: 100px;
    padding: 8px 16px;
    font-size: .82rem;
    font-weight: 700;
    transition: background .2s, transform .2s;
    white-space: nowrap;
}

.batch-row-action svg {
    flex-shrink: 0;
}

.batch-row:hover .batch-row-action {
    background: var(--wa-dk);
    transform: scale(1.04);
}

/* ── "View all" toggle ── */
.view-all-wrap {
    text-align: center;
    padding: 1.25rem 0 1.5rem;
}

#toggle-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--g600);
    background: var(--white);
    border: 1.5px solid var(--g200);
    border-radius: 100px;
    padding: 9px 20px;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

#toggle-all-btn:hover {
    background: var(--g50);
    border-color: var(--g300);
}

#toggle-all-btn svg {
    transition: transform .3s var(--ease);
}

#toggle-all-btn.open svg {
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════
   ALL BATCHES (collapsed by default)
═══════════════════════════════════════ */
#all-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s var(--ease);
    margin-bottom: 0;
}

#all-section.open {
    max-height: 4000px;
    margin-bottom: 1.5rem;
}

.all-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.all-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    padding: .7rem 1rem;
    animation: fadeUp .3s var(--ease) both;
    cursor: default;
    transition: border-color .18s, background .18s;
}

.all-row.has-group {
    border-color: var(--g100);
    cursor: pointer;
}

.all-row.has-group:hover {
    border-color: var(--g200);
    background: var(--g50);
}

.all-row-yr {
    font-family: var(--fm);
    font-size: .8rem;
    font-weight: 500;
    color: var(--g700);
    min-width: 38px;
}

.all-row-label {
    flex: 1;
    font-size: .82rem;
    color: var(--ink3);
}

.all-row-pill {
    font-family: var(--fm);
    font-size: .58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 6px 9px;
    /* border-radius: 100px; */
    border-radius: 4px;
}

.all-row-pill.ok {
    background: #e6f9e6;
    color: var(--g600);
    border: 1px solid var(--g200);
}

.all-row-pill.no {
    background: var(--g50);
    color: var(--muted);
    border: 1px solid var(--rule);
}

.all-row-wa {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--wa);
    color: #fff;
    /* border-radius: 100px; */
    border-radius: 4px;
    padding: 5px 12px;
    font-size: .75rem;
    font-weight: 700;
    transition: background .2s;
}

.all-row-wa:hover {
    background: var(--wa-dk);
}

/* ═══════════════════════════════════════
   EMPTY STATE (no active groups yet)
═══════════════════════════════════════ */
#empty-active {
    display: none;
    background: var(--white);
    border: 1.5px dashed var(--rule);
    border-radius: var(--radius-lg);
    padding: 2rem 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: .65rem;
}

#empty-active p {
    font-size: .85rem;
    color: var(--muted);
    line-height: 1.7;
}

#empty-active a {
    color: var(--g600);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ═══════════════════════════════════════
   DM BANNER
═══════════════════════════════════════ */
.dm-banner {
    max-width: 720px;
    margin: 0 auto 2rem;
    padding: 0 1.25rem;
}

.dm-banner-inner {
    background: var(--white);
    border: 1.5px solid var(--g200);
    border-left: 3px solid var(--g500);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.dm-banner-title {
    font-family: var(--fh);
    font-size: .85rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: .3rem;
}

.dm-banner-desc {
    font-size: .8rem;
    color: var(--ink3);
    line-height: 1.68;
}

.dm-banner-desc a {
    color: var(--g600);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dm-banner-desc a:hover {
    color: var(--g500);
}

.dm-divider {
    height: .5px;
    background: var(--rule);
    margin: .9rem 0;
}

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer {
    background: var(--white);
    border-top: 1px solid var(--rule);
    padding: 2.25rem 2rem;
    text-align: center;
}

.ft-logo {
    font-family: var(--fk);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--g600);
}

.ft-divider {
    width: 30px;
    height: 1.5px;
    background: var(--rule);
    margin: 1rem auto;
}

.ft-copy {
    font-size: .76rem;
    color: var(--muted);
    line-height: 1.7;
}

/* ═══════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ═══════════════════════════════════════
   MARK HIGHLIGHT
═══════════════════════════════════════ */
mark {
    background: rgba(61, 158, 61, .15);
    color: var(--g700);
    border-radius: 3px;
    padding: 0 2px;
}

/* ═══════════════════════════════════════
   FOCUS
═══════════════════════════════════════ */
:focus-visible {
    outline: 2px solid var(--g400);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ═══════════════════════════════════════
   RESPONSIVE — DESKTOP
═══════════════════════════════════════ */
@media (min-width: 860px) {
    :root {
        --nav-h: 60px;
    }

    #nav {
        padding: 0 1.75rem;
    }

    .nav-brand {
        font-size: 1.35rem;
    }

    .hero-inner {
        padding: 3.25rem 2rem 3.5rem;
    }

    .batch-row {
        padding: .9rem 1.1rem;
    }

    .batch-row-badge {
        width: 58px;
        height: 48px;
        font-size: .95rem;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE — TABLET
═══════════════════════════════════════ */
@media (max-width: 640px) {
    .main-wrap {
        padding: 1.4rem 1rem 0;
    }

    .batch-row-action span {
        /* display: none; */
    }

    .batch-row-action {
        padding: 9px 12px;
        width: auto;
        height: 40px;
        /* border-radius: 50%; */
    }

    /* .all-row-pill {
                display: none;
            } */

    .hero-search {
        flex-direction: column;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════ */
@media (max-width: 400px) {
    .batch-row-badge {
        width: 60px;
        height: 40px;
        font-size: .82rem;
    }

    .batch-row-main {
        font-size: .82rem;
    }

    .dm-banner {
        padding: 0 1rem;
    }

    footer {
        padding: 2rem 1.25rem;
    }
}

/* ═══════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}