.lifespan-data-panel {
    position: relative;
    overflow: hidden;
    margin-top: clamp(2.4rem, 5vw, 4.5rem);
    border: 1px solid rgba(129, 103, 255, .24);
    border-radius: 22px;
    background:
        linear-gradient(150deg, rgba(12, 5, 31, .96), rgba(6, 2, 20, .94)),
        radial-gradient(circle at 100% 0, rgba(0, 240, 255, .08), transparent 34%);
    box-shadow: 0 24px 72px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 255, 255, .025);
}

.lifespan-data-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, .55), rgba(0, 255, 136, .42), transparent);
    pointer-events: none;
}

.lifespan-data-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border-bottom: 1px solid rgba(129, 103, 255, .14);
    background: linear-gradient(90deg, rgba(129, 103, 255, .055), transparent 58%);
}

.lifespan-data-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(0, 240, 255, .28);
    border-radius: 12px;
    color: var(--bright-cyan);
    background: rgba(0, 240, 255, .06);
    font: 800 .6rem/1 'Orbitron', sans-serif;
    letter-spacing: .08em;
    box-shadow: inset 0 0 18px rgba(0, 240, 255, .045);
}

.lifespan-data-kicker {
    margin-bottom: .45rem;
    color: var(--bio-green);
    font: 700 .65rem/1.2 'JetBrains Mono', monospace;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.lifespan-data-head h2 {
    margin: 0;
    color: #fff;
    font: 800 clamp(1.05rem, 2.4vw, 1.5rem)/1.25 'Orbitron', sans-serif;
    letter-spacing: -.02em;
}

.lifespan-data-head h2 span { color: var(--bright-cyan); }

.lifespan-data-head p {
    max-width: 900px;
    margin: .65rem 0 0;
    color: rgba(255, 255, 255, .58);
    font-size: .78rem;
    line-height: 1.7;
}

.lifespan-data-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .78rem clamp(1rem, 3vw, 1.6rem);
    border-bottom: 1px solid rgba(129, 103, 255, .12);
    color: rgba(255, 255, 255, .43);
    background: rgba(129, 103, 255, .035);
    font: 600 .68rem/1.4 'Martian Mono', monospace;
}

.lifespan-data-toolbar p { margin: 0; }
.lifespan-data-toolbar strong { color: var(--bright-cyan); font-weight: 700; }
.lifespan-data-toolbar > span { white-space: nowrap; }

.lifespan-table-frame {
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    margin: clamp(.8rem, 2vw, 1.4rem);
    border: 1px solid rgba(129, 103, 255, .18);
    border-radius: 14px;
    background: rgba(4, 1, 14, .58);
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 103, 255, .55) rgba(255, 255, 255, .025);
}

.lifespan-table-frame:focus-visible {
    outline: 2px solid rgba(0, 240, 255, .75);
    outline-offset: 3px;
}

.lifespan-table {
    width: 100%;
    min-width: 1160px;
    border-collapse: separate;
    border-spacing: 0;
}

.lifespan-table caption {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lifespan-table thead {
    position: sticky;
    top: 0;
    z-index: 4;
}

.lifespan-table th {
    padding: 0;
    border-bottom: 1px solid rgba(0, 240, 255, .22);
    background: linear-gradient(135deg, rgba(58, 36, 112, .98), rgba(14, 37, 61, .98));
    box-shadow: 0 8px 22px rgba(0, 0, 0, .2);
    text-align: left;
    white-space: nowrap;
}

.lifespan-table th + th { border-left: 1px solid rgba(255, 255, 255, .035); }

.lifespan-table th button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    width: 100%;
    min-height: 48px;
    padding: .7rem .85rem;
    border: 0;
    color: var(--bright-cyan);
    background: transparent;
    font: 700 .64rem/1.25 'Orbitron', sans-serif;
    letter-spacing: .045em;
    text-align: left;
    cursor: pointer;
    transition: color .16s ease, background .16s ease;
}

.lifespan-table th button:hover {
    color: #fff;
    background: rgba(0, 240, 255, .065);
}

.lifespan-table th button:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid rgba(0, 240, 255, .82);
    outline-offset: -3px;
    color: #fff;
    background: rgba(0, 240, 255, .085);
}

.lifespan-table th[aria-sort="ascending"] button,
.lifespan-table th[aria-sort="descending"] button {
    color: #fff;
    background: linear-gradient(135deg, rgba(0, 240, 255, .09), rgba(0, 255, 136, .055));
}

.lifespan-sort-icon {
    min-width: 1em;
    color: var(--bio-green);
    font: 800 .78rem/1 'Martian Mono', monospace;
    opacity: .78;
}

.lifespan-table td {
    height: 48px;
    padding: .65rem .9rem;
    border-bottom: 1px solid rgba(129, 103, 255, .075);
    color: rgba(255, 255, 255, .72);
    background: rgba(10, 3, 27, .24);
    font: 500 .72rem/1.45 'Martian Mono', monospace;
    vertical-align: middle;
}

.lifespan-table tbody tr:nth-child(even) td { background: rgba(129, 103, 255, .025); }
.lifespan-table tbody tr:hover td { background: rgba(0, 240, 255, .045); }
.lifespan-table tbody tr:last-child td { border-bottom: 0; }
.lifespan-table tbody tr[hidden] { display: none; }

.lifespan-rank {
    width: 58px;
    color: rgba(255, 255, 255, .42) !important;
    font-variant-numeric: tabular-nums;
}

.lifespan-scientific a,
.lifespan-common {
    color: inherit;
    text-decoration: none;
    text-underline-offset: .22em;
}

.lifespan-scientific a {
    display: inline-flex;
    align-items: center;
    gap: .62rem;
    color: var(--bright-cyan);
    font: italic 600 .88rem/1.35 'Crimson Pro', serif;
}

.lifespan-species-icon {
    position: relative;
    display: inline-grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    overflow: hidden;
    place-items: center;
    border: 1px solid rgba(0, 240, 255, .2);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(129, 103, 255, .2), rgba(0, 240, 255, .08));
    box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
}

.lifespan-species-fallback {
    color: rgba(201, 249, 255, .78);
    font: 700 .56rem/1 'Martian Mono', monospace;
    letter-spacing: .02em;
}

.lifespan-species-icon img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(250, 249, 253, .96);
}

.lifespan-scientific-name { min-width: 0; }

.lifespan-common { color: rgba(255, 255, 255, .78); }

.lifespan-scientific a:hover,
.lifespan-common:hover {
    color: #fff;
}

.lifespan-scientific a:hover .lifespan-scientific-name,
.lifespan-common:hover {
    text-decoration: underline;
    text-decoration-color: rgba(0, 240, 255, .62);
}

.lifespan-scientific a:focus-visible,
.lifespan-common:focus-visible {
    border-radius: 4px;
    outline: 2px solid rgba(0, 240, 255, .8);
    outline-offset: 3px;
}

.lifespan-group-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: .18rem .5rem;
    border: 1px solid rgba(129, 103, 255, .2);
    border-radius: 999px;
    color: rgba(220, 209, 255, .78);
    background: rgba(129, 103, 255, .07);
    font-size: .63rem;
}

.lifespan-taxonomy { color: rgba(255, 255, 255, .46) !important; font-size: .68rem !important; }
.lifespan-number { color: rgba(255, 255, 255, .86) !important; font-variant-numeric: tabular-nums; }
.lifespan-table td:nth-child(7) { color: var(--bio-green) !important; font-weight: 700; }

.lifespan-data-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 clamp(1rem, 3vw, 1.6rem) clamp(1.2rem, 3vw, 1.8rem);
}

.lifespan-data-footer > p {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, .4);
    font-size: .68rem;
    line-height: 1.55;
}

.lifespan-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .42rem;
    flex-wrap: wrap;
}

.lifespan-page-button {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 .65rem;
    border: 1px solid rgba(129, 103, 255, .28);
    border-radius: 9px;
    color: rgba(255, 255, 255, .62);
    background: rgba(5, 0, 15, .78);
    font: 700 .68rem/1 'Martian Mono', monospace;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.lifespan-page-button:hover:not(:disabled) {
    border-color: rgba(0, 240, 255, .62);
    color: #fff;
    background: rgba(0, 240, 255, .065);
}

.lifespan-page-button[aria-current="page"] {
    border-color: rgba(0, 255, 136, .55);
    color: #05130d;
    background: var(--bio-green);
    box-shadow: 0 8px 20px rgba(0, 255, 136, .13);
}

.lifespan-page-button:focus-visible {
    outline: 2px solid rgba(0, 240, 255, .82);
    outline-offset: 2px;
}

.lifespan-page-button:disabled { opacity: .28; cursor: not-allowed; }

.lifespan-data-error,
.lifespan-data-noscript {
    margin: 1.3rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 77, 166, .25);
    border-radius: 10px;
    color: rgba(255, 255, 255, .72);
    background: rgba(255, 77, 166, .06);
    font-size: .78rem;
}

@media (max-width: 760px) {
    .lifespan-data-panel { margin-top: 2.2rem; border-radius: 16px; }
    .lifespan-data-head { gap: .75rem; padding: 1.15rem; }
    .lifespan-data-icon { width: 42px; height: 42px; border-radius: 10px; font-size: .53rem; }
    .lifespan-data-head p { font-size: .72rem; }
    .lifespan-data-toolbar { align-items: flex-start; flex-direction: column; gap: .3rem; padding: .75rem 1rem; }
    .lifespan-data-toolbar > span { white-space: normal; }
    .lifespan-table-frame { max-height: none; margin: .75rem; border-radius: 11px; }
    .lifespan-table { min-width: 1080px; }
    .lifespan-table th button { min-height: 46px; padding: .65rem .75rem; font-size: .6rem; }
    .lifespan-table td { height: 46px; padding: .6rem .78rem; }
    .lifespan-data-footer { align-items: stretch; flex-direction: column; padding: .2rem .85rem 1.15rem; }
    .lifespan-pagination { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .lifespan-table th button,
    .lifespan-page-button { transition: none; }
}
