.lp-study-gallery {
    overflow: hidden;
}

.lp-gallery-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .65rem;
    margin: 0 0 1rem;
}

.lp-gallery-summary > div {
    min-width: 0;
    padding: .85rem 1rem;
    border: 1px solid var(--lp-border, rgba(195, 180, 255, .14));
    border-radius: 13px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--portal-accent) 7%, transparent), transparent 68%),
        rgba(255, 255, 255, .025);
}

.lp-gallery-summary strong {
    display: block;
    color: #fff;
    font: 850 1.15rem/1.1 'Orbitron', sans-serif;
}

.lp-gallery-summary span {
    display: block;
    margin-top: .28rem;
    color: var(--lp-muted, rgba(226, 221, 244, .64));
    font-size: .64rem;
    line-height: 1.4;
}

.lp-gallery-boundary {
    margin: 0 0 1rem;
}

.lp-gallery-toolbar {
    display: grid;
    grid-template-columns: minmax(250px, 2fr) repeat(2, minmax(150px, 1fr)) auto;
    align-items: end;
    gap: .72rem;
    margin-bottom: 1rem;
    padding: .9rem;
    border: 1px solid var(--lp-border, rgba(195, 180, 255, .14));
    border-radius: 15px;
    background: rgba(7, 2, 21, .68);
}

.lp-gallery-field {
    display: grid;
    gap: .34rem;
    min-width: 0;
}

.lp-gallery-field > span {
    color: rgba(255, 255, 255, .68);
    font-size: .61rem;
    font-weight: 760;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.lp-gallery-field input,
.lp-gallery-field select {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 .72rem;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 10px;
    outline: none;
    color: #fff;
    background: rgba(255, 255, 255, .045);
    font: 650 .72rem/1 'Rajdhani', sans-serif;
}

.lp-gallery-field input::placeholder {
    color: rgba(255, 255, 255, .36);
}

.lp-gallery-field select {
    color-scheme: dark;
}

.lp-gallery-field select option,
.lp-gallery-field select optgroup {
    color: #f4f0ff;
    background-color: #160a2c;
}

.lp-gallery-field select option:checked {
    color: #8fffc4;
    background-color: #241046;
}

.lp-gallery-field input:hover,
.lp-gallery-field select:hover {
    border-color: rgba(255, 255, 255, .25);
}

.lp-gallery-field input:focus-visible,
.lp-gallery-field select:focus-visible {
    border-color: var(--portal-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-accent) 15%, transparent);
}

.lp-gallery-reset {
    height: 42px;
    padding: 0 .9rem;
    border: 1px solid color-mix(in srgb, var(--portal-accent) 34%, transparent);
    border-radius: 10px;
    color: color-mix(in srgb, var(--portal-accent) 82%, #fff);
    background: color-mix(in srgb, var(--portal-accent) 7%, transparent);
    font: 780 .68rem/1 'Orbitron', sans-serif;
    cursor: pointer;
}

.lp-gallery-reset:hover {
    border-color: color-mix(in srgb, var(--portal-accent) 68%, transparent);
    background: color-mix(in srgb, var(--portal-accent) 13%, transparent);
}

.lp-gallery-reset:focus-visible {
    outline: 2px solid var(--portal-accent);
    outline-offset: 3px;
}

.lp-gallery-count {
    grid-column: 1 / -1;
    margin: -.05rem 0 0;
    color: var(--lp-muted, rgba(226, 221, 244, .64));
    font-size: .67rem;
}

.lp-study-species-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .78rem;
}

.lp-study-species-card {
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--lp-border, rgba(195, 180, 255, .14));
    border-radius: 15px;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--portal-accent) 7%, transparent), transparent 42%),
        linear-gradient(155deg, rgba(18, 7, 42, .92), rgba(5, 0, 15, .9));
    box-shadow: inset 0 1px rgba(255, 255, 255, .04);
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.lp-study-species-card:hover {
    z-index: 1;
    border-color: color-mix(in srgb, var(--portal-accent) 48%, transparent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22), inset 0 1px rgba(255, 255, 255, .05);
    transform: translateY(-3px);
}

.lp-study-species-card.is-image-only {
    border-color: rgba(255, 255, 255, .095);
}

.lp-study-species-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 255, 255, .14), rgba(255, 255, 255, .025) 54%, transparent 72%),
        rgba(8, 2, 24, .9);
}

.lp-study-species-media > a,
.lp-study-species-media-static {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.lp-study-species-media img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    transition: transform .28s ease, filter .28s ease;
}

.lp-study-species-media.is-atlas-art img {
    padding: .55rem;
    object-fit: contain;
    filter: drop-shadow(0 9px 11px rgba(0, 0, 0, .22));
}

.lp-study-species-media.is-reference-photo img {
    object-fit: cover;
}

.lp-study-species-card:hover .lp-study-species-media img {
    transform: scale(1.035);
}

.lp-study-species-index {
    position: absolute;
    z-index: 3;
    top: .52rem;
    left: .52rem;
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 23px;
    padding: 0 .35rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 7px;
    color: rgba(255, 255, 255, .82);
    background: rgba(6, 1, 18, .72);
    backdrop-filter: blur(8px);
    font: 760 .58rem/1 'Orbitron', sans-serif;
}

.lp-study-species-overlay {
    position: absolute;
    z-index: 3;
    right: .48rem;
    bottom: .48rem;
    left: .48rem;
    overflow: hidden;
    padding: .45rem .52rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    color: rgba(255, 255, 255, .86);
    background: rgba(6, 1, 18, .76);
    backdrop-filter: blur(9px);
    font-size: .58rem;
    font-weight: 780;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lp-study-species-card.has-atlas .lp-study-species-overlay {
    border-color: color-mix(in srgb, var(--portal-accent) 32%, transparent);
    color: color-mix(in srgb, var(--portal-accent) 84%, #fff);
}

.lp-study-species-media > a:focus-visible {
    outline: 3px solid var(--portal-accent);
    outline-offset: -4px;
}

.lp-study-species-fallback {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .2);
    font: 850 2.2rem/1 'Orbitron', sans-serif;
}

.lp-study-species-media.is-missing img {
    display: none;
}

.lp-study-species-body {
    display: flex;
    min-height: 218px;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: .78rem;
}

.lp-study-species-order {
    display: inline-flex;
    max-width: 100%;
    padding: .24rem .44rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    color: rgba(255, 255, 255, .52);
    background: rgba(255, 255, 255, .025);
    font-size: .53rem;
    font-weight: 760;
    letter-spacing: .065em;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.lp-study-species-body h3 {
    margin: .52rem 0 0;
    color: #fff;
    font: 800 clamp(.76rem, .8vw, .9rem)/1.32 'Orbitron', sans-serif;
    overflow-wrap: anywhere;
}

.lp-study-species-latin {
    margin: .24rem 0 0;
    color: rgba(255, 255, 255, .6);
    font: 600 .66rem/1.36 Georgia, serif;
    overflow-wrap: anywhere;
}

.lp-study-evidence {
    width: 100%;
    margin-top: .58rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.lp-study-evidence > p {
    margin: 0 0 .4rem;
    color: rgba(255, 255, 255, .58);
    font-size: .55rem;
    line-height: 1.3;
}

.lp-study-evidence > p strong {
    color: #fff;
    font: 800 .65rem/1 'Orbitron', sans-serif;
}

.lp-study-source-chips,
.lp-study-tissue-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.lp-study-tissue-chips {
    margin-top: .32rem;
}

.lp-study-source-chips a,
.lp-study-source-chips span,
.lp-study-tissue-chips span {
    min-width: 0;
    padding: .2rem .32rem;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    color: rgba(255, 255, 255, .62);
    background: rgba(255, 255, 255, .025);
    font-size: .45rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.lp-study-source-chips a {
    border-color: color-mix(in srgb, var(--portal-accent) 30%, transparent);
    color: color-mix(in srgb, var(--portal-accent) 78%, #fff);
}

.lp-study-source-chips a:hover,
.lp-study-source-chips a:focus-visible {
    border-color: var(--portal-accent);
    color: #fff;
}

.lp-study-species-status {
    display: flex;
    align-items: center;
    gap: .34rem;
    margin: .62rem 0 0;
    color: color-mix(in srgb, var(--portal-accent) 80%, #fff);
    font-size: .57rem;
    font-weight: 740;
    line-height: 1.38;
}

.lp-status-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--portal-accent);
    box-shadow: 0 0 9px color-mix(in srgb, var(--portal-accent) 58%, transparent);
}

.lp-study-species-status.is-unlinked {
    color: rgba(255, 255, 255, .45);
}

.lp-study-species-note {
    margin: .3rem 0 0;
    color: rgba(255, 255, 255, .4);
    font-size: .54rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.lp-study-card-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .38rem;
    margin-top: auto;
    padding-top: .68rem;
}

.lp-study-card-action {
    display: flex;
    min-width: 0;
    min-height: 34px;
    padding: .38rem .28rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .74);
    background: rgba(255, 255, 255, .025);
    font-size: .5rem;
    font-weight: 790;
    line-height: 1.24;
    text-align: center;
    text-decoration: none;
}

.lp-study-card-action.is-rnaseq {
    border-color: color-mix(in srgb, var(--portal-accent) 48%, transparent);
    color: #071710;
    background: color-mix(in srgb, var(--portal-accent) 85%, #fff);
    box-shadow: 0 0 16px color-mix(in srgb, var(--portal-accent) 10%, transparent);
}

.lp-study-card-action.is-content {
    border-color: color-mix(in srgb, var(--portal-accent) 36%, transparent);
    color: color-mix(in srgb, var(--portal-accent) 82%, #fff);
    background: color-mix(in srgb, var(--portal-accent) 6%, transparent);
}

.lp-study-card-action.is-disabled {
    border-color: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .015);
    cursor: not-allowed;
}

a.lp-study-card-action:hover {
    border-color: rgba(255, 255, 255, .72);
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

a.lp-study-card-action:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.lp-study-species-source {
    margin-top: .42rem;
    color: rgba(255, 255, 255, .42);
    font-size: .52rem;
    font-weight: 720;
    line-height: 1.3;
    text-decoration: none;
}

.lp-study-species-source:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lp-study-species-source:focus-visible {
    outline: 2px solid var(--portal-accent);
    outline-offset: 3px;
    border-radius: 3px;
}

.lp-gallery-empty {
    margin-top: .85rem;
    padding: 1rem;
    border: 1px dashed rgba(255, 255, 255, .16);
    border-radius: 13px;
    color: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .025);
    text-align: center;
}

.lp-gallery-empty strong,
.lp-gallery-empty span {
    display: block;
}

.lp-gallery-empty span {
    margin-top: .25rem;
    color: rgba(255, 255, 255, .48);
    font-size: .68rem;
}

.lp-tissue-heading {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(300px, 1.18fr);
    gap: clamp(1rem, 3vw, 2.5rem);
    align-items: end;
    margin: clamp(2rem, 4vw, 3.4rem) 0 1rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, .09);
}

.lp-tissue-heading h3 {
    margin: .35rem 0 0;
    color: #fff;
    font: 820 clamp(1rem, 1.5vw, 1.35rem)/1.3 'Orbitron', sans-serif;
}

.lp-tissue-heading p {
    margin: 0;
    color: var(--lp-copy, rgba(244, 242, 255, .74));
    font-size: .75rem;
    line-height: 1.7;
}

.lp-study-tissue-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .72rem;
}

.lp-study-tissue-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--lp-border, rgba(195, 180, 255, .14));
    border-radius: 14px;
    background: linear-gradient(155deg, rgba(18, 7, 42, .9), rgba(5, 0, 15, .84));
}

.lp-study-tissue-media {
    position: relative;
    display: grid;
    aspect-ratio: 1.18;
    place-items: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle, color-mix(in srgb, var(--portal-accent) 12%, rgba(255, 255, 255, .08)), transparent 68%);
}

.lp-study-tissue-media img {
    width: 76%;
    height: 76%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .24));
    transition: transform .24s ease;
}

.lp-study-tissue-media span {
    position: absolute;
    right: .45rem;
    bottom: .45rem;
    left: .45rem;
    padding: .42rem .4rem;
    border: 1px solid color-mix(in srgb, var(--portal-accent) 28%, transparent);
    border-radius: 7px;
    color: color-mix(in srgb, var(--portal-accent) 84%, #fff);
    background: rgba(6, 1, 18, .76);
    backdrop-filter: blur(8px);
    font-size: .55rem;
    font-weight: 780;
    text-align: center;
}

.lp-study-tissue-media:hover img {
    transform: scale(1.055);
}

.lp-study-tissue-media:focus-visible {
    outline: 3px solid var(--portal-accent);
    outline-offset: -4px;
}

.lp-study-tissue-body {
    display: flex;
    min-height: 166px;
    padding: .72rem;
    flex-direction: column;
}

.lp-tissue-scope {
    display: inline-flex;
    padding: .22rem .4rem;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    color: rgba(255, 255, 255, .48);
    background: rgba(255, 255, 255, .025);
    font-size: .5rem;
    font-weight: 760;
    line-height: 1;
}

.lp-tissue-scope.is-displayed {
    border-color: color-mix(in srgb, var(--portal-accent) 32%, transparent);
    color: color-mix(in srgb, var(--portal-accent) 80%, #fff);
    background: color-mix(in srgb, var(--portal-accent) 6%, transparent);
}

.lp-study-tissue-body h4 {
    margin: .48rem 0 0;
    color: #fff;
    font: 820 .86rem/1.25 'Orbitron', sans-serif;
}

.lp-study-tissue-body p {
    margin: .32rem 0 0;
    color: rgba(255, 255, 255, .52);
    font-size: .59rem;
    line-height: 1.45;
}

.lp-study-tissue-body p strong {
    color: #fff;
    font-family: 'Orbitron', sans-serif;
}

.lp-study-tissue-body > a {
    display: inline-flex;
    margin-top: .58rem;
    color: var(--portal-accent);
    font-size: .57rem;
    font-weight: 760;
    text-decoration: none;
}

.lp-study-tissue-body > a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lp-study-tissue-body > a:focus-visible {
    outline: 2px solid var(--portal-accent);
    outline-offset: 3px;
}

.lp-tissue-disclaimer {
    margin: .75rem 0 0;
    color: rgba(255, 255, 255, .45);
    font-size: .62rem;
    line-height: 1.55;
}

.lp-image-credits {
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 12px;
    background: rgba(255, 255, 255, .018);
}

.lp-image-credits summary {
    padding: .8rem .9rem;
    color: rgba(255, 255, 255, .66);
    font-size: .66rem;
    font-weight: 760;
    cursor: pointer;
}

.lp-image-credits summary:hover {
    color: #fff;
}

.lp-image-credits summary:focus-visible {
    outline: 2px solid var(--portal-accent);
    outline-offset: 3px;
    border-radius: 8px;
}

.lp-image-credit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem 1rem;
    padding: 0 .9rem .9rem;
}

.lp-image-credit-grid p {
    margin: 0;
    color: rgba(255, 255, 255, .47);
    font-size: .58rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.lp-image-credit-grid strong {
    color: rgba(255, 255, 255, .72);
}

.lp-image-credit-grid a {
    color: var(--portal-accent);
}

.lp-study-species-card[hidden],
.lp-gallery-empty[hidden] {
    display: none !important;
}

@media (max-width: 1480px) {
    .lp-study-species-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .lp-gallery-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lp-gallery-toolbar {
        grid-template-columns: 2fr repeat(2, minmax(140px, 1fr));
    }

    .lp-gallery-reset {
        grid-column: 1 / -1;
        width: max-content;
    }

    .lp-study-species-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .lp-study-tissue-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 880px) {
    .lp-gallery-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lp-gallery-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lp-gallery-search {
        grid-column: 1 / -1;
    }

    .lp-study-species-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lp-tissue-heading {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .lp-gallery-toolbar {
        grid-template-columns: 1fr;
        padding: .75rem;
    }

    .lp-gallery-search,
    .lp-gallery-reset {
        grid-column: auto;
        width: 100%;
    }

    .lp-study-species-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }

    .lp-study-species-body {
        min-height: 224px;
        padding: .68rem;
    }

    .lp-study-card-actions {
        gap: .3rem;
    }

    .lp-study-card-action {
        min-height: 36px;
        padding-inline: .2rem;
        font-size: .46rem;
    }

    .lp-study-tissue-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lp-image-credit-grid {
        grid-template-columns: 1fr;
    }
}


@media (prefers-reduced-motion: reduce) {
    .lp-study-species-card,
    .lp-study-species-media img,
    .lp-study-tissue-media img {
        transition: none;
    }

    .lp-study-species-card:hover,
    .lp-study-species-card:hover .lp-study-species-media img,
    .lp-study-tissue-media:hover img {
        transform: none;
    }
}
