.share-shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.share-shelf-card {
    background: var(--share-shelf-card-fill, #fff);
    border: 1px solid var(--share-shelf-card-border, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 520px;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    position: relative;
}

.share-shelf-card__top-actions {
    align-items: center;
    display: flex;
    gap: 0.35rem;
    position: absolute;
    right: 0.65rem;
    top: 0.65rem;
    z-index: 60;
}

.share-shelf-card__expand-icon,
.share-shelf-card__icon-button {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(17, 17, 17, 0.14);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    color: #111;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 800;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
    line-height: 1;
    list-style: none;
    min-width: 34px;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    width: 34px;
}

.share-shelf-card__icon-button {
    cursor: pointer;
    padding: 0;
    user-select: none;
}


.share-shelf-card__eye,
.share-shelf-card__ellipsis {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    line-height: 1;
}

.share-shelf-card__eye svg {
    display: block;
    height: 18px;
    width: 18px;
}

.share-shelf-card__ellipsis {
    font-size: 1.15rem;
    font-weight: 900;
    transform: translateY(-1px);
}

.share-shelf-card__expand-icon:hover,
.share-shelf-card__expand-icon:focus,
.share-shelf-card__icon-button:hover,
.share-shelf-card__icon-button:focus {
    background: #111;
    color: #fff;
    transform: translateY(-1px) scale(1.04);
}

.share-shelf-card__image {
    align-items: center;
    aspect-ratio: 16 / 9;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.share-shelf-card__image img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.share-shelf-card--image-contain .share-shelf-card__image {
    padding: 0.75rem;
}

.share-shelf-card--image-contain .share-shelf-card__image img {
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    width: 100%;
}


.share-shelf-card__embed {
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.45);
    overflow: hidden;
    position: relative;
    width: 100%;
}

.share-shelf-card__embed iframe,
.share-shelf-card__embed embed,
.share-shelf-card__embed object,
.share-shelf-card__embed video {
    border: 0;
    display: block;
    height: 100%;
    inset: 0;
    position: absolute;
    width: 100%;
}

.share-shelf-card__embed > * {
    max-width: 100%;
}

.share-shelf-card__body {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 1rem;
}

.share-shelf-card__type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 0.4rem;
}

.share-shelf-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
}

.share-shelf-card__source {
    font-size: 0.9rem;
    opacity: 0.75;
    margin-bottom: 0.75rem;
}

.share-shelf-card__excerpt {
    border-left: 3px solid rgba(0, 0, 0, 0.16);
    font-style: italic;
    line-height: 1.55;
    margin: 0 0 0.75rem;
    max-height: 7.4rem;
    overflow-y: auto;
    padding-left: 0.8rem;
    padding-right: 0.35rem;
    scrollbar-width: thin;
}

.share-shelf-card__note {
    line-height: 1.55;
    margin: 0 0 1rem;
    max-height: 9.6rem;
    overflow-y: auto;
    padding-right: 0.35rem;
    scrollbar-width: thin;
}

.share-shelf-card__footer {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    padding-top: 0.75rem;
    width: 100%;
}

.share-shelf-card__terms {
    margin-top: auto;
}

.share-shelf-card__actions {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.75rem;
    min-height: 3.1rem;
    padding-top: 0.9rem;
    width: 100%;
}

.share-shelf-card__actions--empty {
    justify-content: center;
}

.share-shelf-card__cta-spacer {
    min-height: 2.3rem;
    width: 100%;
}

.share-shelf-card__action {
    border: 1px solid #ddd;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 700;
    justify-content: center;
    line-height: 1;
    padding: 0.65rem 0.85rem;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, letter-spacing 0.18s ease;
}

.share-shelf-card__action--primary {
    background: #111;
    border-color: #111;
    color: #fff;
    width: 100%;
}

.share-shelf-card__action--secondary,
.share-shelf-card__action--ghost {
    background: #fff;
    color: inherit;
}

.share-shelf-card__action--ghost {
    opacity: 0.72;
}


.share-shelf-card__action:hover,
.share-shelf-card__action:focus {
    text-decoration: none;
}

.share-shelf-card__action--primary:hover,
.share-shelf-card__action--primary:focus {
    background: #3f3f46;
    border-color: #3f3f46;
    box-shadow: 0 10px 20px rgba(17, 17, 17, 0.18);
    color: #fff;
    letter-spacing: 0.015em;
    transform: translateY(-1px);
}

.share-shelf-card__action--secondary:hover,
.share-shelf-card__action--secondary:focus,
.share-shelf-card__action--ghost:hover,
.share-shelf-card__action--ghost:focus {
    background: #111;
    border-color: #111;
    color: #fff;
}

.share-shelf-card__actions-secondary {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
}

.share-shelf-card__cta-row {
    display: flex;
    width: 100%;
}

.share-shelf-card__excerpt::-webkit-scrollbar,
.share-shelf-card__note::-webkit-scrollbar {
    width: 6px;
}

.share-shelf-card__excerpt::-webkit-scrollbar-thumb,
.share-shelf-card__note::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 999px;
}

.share-shelf-card__topics,
.share-shelf-card__collections {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 0;
}

.share-shelf-card__topics span,
.share-shelf-card__collections span {
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    opacity: 0.75;
    padding: 5px 8px;
}

.share-shelf-page {
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 1180px;
    padding: clamp(24px, 5vw, 64px) 20px;
}

.share-shelf-page *,
.share-shelf-page *::before,
.share-shelf-page *::after {
    box-sizing: inherit;
}

.share-shelf-hero {
    margin: 0 auto 2rem;
    max-width: 760px;
    text-align: center;
}

.share-shelf-hero h1,
.share-shelf-single-card__header h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    margin: 0 0 0.8rem;
}

.share-shelf-hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-left: auto;
    margin-right: auto;
    opacity: 0.78;
}

.share-shelf-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin: 0 0 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
}

.share-shelf-archive__grid {
    align-items: stretch;
    grid-auto-rows: 1fr;
}

.share-shelf-pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 2.5rem 0 0;
}

.share-shelf-pagination .page-numbers {
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    text-decoration: none;
}

.share-shelf-pagination .current {
    font-weight: 700;
}

.share-shelf-single-card {
    background: var(--share-shelf-card-fill, #fff);
    border: 1px solid var(--share-shelf-card-border, #e5e7eb);
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
    margin: 0 auto;
    max-width: 880px;
    overflow: hidden;
    position: relative;
}

.share-shelf-single-card__top-actions {
    align-items: center;
    display: flex;
    gap: 0.4rem;
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 8;
}

.share-shelf-single-card__top-actions .share-shelf-share-menu__panel {
    bottom: auto;
    left: auto;
    right: 0;
    top: calc(100% + 8px);
}

.share-shelf-single-card__top-actions .share-shelf-share-menu__panel::after {
    border-color: transparent transparent #fff transparent;
    border-width: 0 8px 8px 8px;
    bottom: auto;
    left: auto;
    right: 14px;
    top: -8px;
}

.share-shelf-single-card__header {
    padding: clamp(28px, 6vw, 56px) clamp(22px, 5vw, 56px) 1.5rem;
    text-align: center;
}

.share-shelf-single-card__source {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0;
    opacity: 0.72;
}

.share-shelf-single-card__source-name,
.share-shelf-single-card__author {
    display: block;
}

.share-shelf-single-card__author {
    font-size: 0.95em;
}

.share-shelf-single-card__image {
    background: #f6f6f6;
}

.share-shelf-single-card__image img,
.share-shelf-single-card__embed iframe {
    display: block;
    width: 100%;
}

.share-shelf-single-card--image-contain .share-shelf-single-card__image {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: clamp(16px, 4vw, 36px);
}

.share-shelf-single-card--image-contain .share-shelf-single-card__image img {
    height: auto;
    max-height: 560px;
    max-width: 100%;
    object-fit: contain;
    width: auto;
}

.share-shelf-single-card__embed {
    background: #f6f6f6;
}

.share-shelf-single-card__embed iframe {
    aspect-ratio: 16 / 9;
    height: auto;
}

.share-shelf-single-card__content {
    padding: clamp(24px, 5vw, 56px);
}

.share-shelf-single-card__section {
    margin-bottom: 2rem;
}

.share-shelf-single-card__section h2 {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    margin: 0 0 0.75rem;
    opacity: 0.72;
    text-transform: uppercase;
}

.share-shelf-single-card__section blockquote {
    border-left: 4px solid #ddd;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-style: italic;
    line-height: 1.55;
    margin: 0;
    padding-left: 1rem;
}

.share-shelf-single-card__section p {
    font-size: 1.08rem;
    line-height: 1.75;
}

.share-shelf-single-card__actions {
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    text-align: center;
}

.share-shelf-button {
    border: 1px solid #111;
    border-radius: 999px;
    display: inline-block;
    font-weight: 700;
    padding: 0.75rem 1rem;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, letter-spacing 0.18s ease, box-shadow 0.18s ease;
}

.share-shelf-button--primary {
    background: #111;
    border-color: #111;
    color: #fff;
    min-width: min(280px, 100%);
}

.share-shelf-button--secondary {
    background: transparent;
}

.share-shelf-term-description {
    opacity: 0.78;
}

.share-shelf-empty {
    background: #fff;
    border: 1px dashed #ccc;
    border-radius: 16px;
    margin: 2rem auto;
    max-width: 680px;
    padding: 2rem;
    text-align: center;
}

@media (max-width: 640px) {
    .share-shelf-card {
    background: var(--share-shelf-card-fill, #fff);
    border-color: var(--share-shelf-card-border, #e5e7eb);
        min-height: 0;
    }

    .share-shelf-card__actions,
    .share-shelf-card__actions-secondary,
    .share-shelf-single-card__actions {
        align-items: stretch;
        flex-direction: column;
    }
}

.share-shelf-share-menu {
    flex: 0 0 auto;
    position: relative;
}

.share-shelf-share-menu__trigger {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.share-shelf-share-menu__trigger::-webkit-details-marker {
    display: none;
}

.share-shelf-share-menu__panel {
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 16px;
    bottom: calc(100% + 8px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
    min-width: 190px;
    padding: 0.45rem;
    position: absolute;
    right: 0;
    z-index: 100;
}

.share-shelf-share-menu__panel::after {
    border-color: #fff transparent transparent transparent;
    border-style: solid;
    border-width: 8px 8px 0 8px;
    bottom: -8px;
    content: "";
    position: absolute;
    right: 20px;
}

.share-shelf-share-menu__item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: inherit;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 0.45rem;
    padding: 0.65rem 0.75rem;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.share-shelf-share-menu__item:hover,
.share-shelf-share-menu__item:focus {
    background: #f5f5f5;
    outline: none;
}


.share-shelf-share-menu--icon .share-shelf-share-menu__panel {
    bottom: auto;
    right: 0;
    top: calc(100% + 8px);
}

.share-shelf-share-menu--icon .share-shelf-share-menu__panel::after {
    border-color: transparent transparent #fff transparent;
    border-width: 0 8px 8px 8px;
    bottom: auto;
    right: 14px;
    top: -8px;
}

.share-shelf-share-menu--large .share-shelf-share-menu__trigger {
    border: 1px solid #111;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 700;
    padding: 0.75rem 1rem;
    text-decoration: none;
}

.share-shelf-single-card__actions .share-shelf-share-menu__panel {
    bottom: auto;
    left: 0;
    right: auto;
    top: calc(100% + 8px);
}

.share-shelf-single-card__actions .share-shelf-share-menu__panel::after {
    border-color: transparent transparent #fff transparent;
    border-width: 0 8px 8px 8px;
    bottom: auto;
    left: 20px;
    right: auto;
    top: -8px;
}

@media (max-width: 640px) {
    .share-shelf-card__action,
    .share-shelf-single-card__actions .share-shelf-share-menu,
    .share-shelf-single-card__actions .share-shelf-share-menu__trigger {
        width: 100%;
    }

    .share-shelf-single-card__actions .share-shelf-share-menu__panel {
        bottom: auto;
        left: 0;
        right: 0;
        top: calc(100% + 8px);
        width: 100%;
    }

    .share-shelf-share-menu__panel::after,
    .share-shelf-single-card__actions .share-shelf-share-menu__panel::after,
    .share-shelf-single-card__top-actions .share-shelf-share-menu__panel::after {
        display: none;
    }

    .share-shelf-single-card__top-actions .share-shelf-share-menu,
    .share-shelf-single-card__top-actions .share-shelf-share-menu__trigger {
        width: auto;
    }

    .share-shelf-single-card__top-actions .share-shelf-share-menu__panel {
        left: auto;
        right: 0;
        width: min(220px, calc(100vw - 48px));
    }
}


.share-shelf-card--quote {
    min-height: 420px;
}

.share-shelf-card--quote .share-shelf-card__body {
    justify-content: space-between;
}

.share-shelf-card__quote-wrap {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    min-height: 220px;
    padding: 0.75rem 0.25rem 1rem;
    text-align: center;
}

.share-shelf-card__quote {
    border: 0;
    color: inherit;
    font-size: clamp(1.2rem, 2vw, 1.75rem);
    font-style: italic;
    line-height: 1.35;
    margin: 0;
    max-width: 22rem;
    padding: 0;
}

.share-shelf-card__quote::before {
    content: "“";
}

.share-shelf-card__quote::after {
    content: "”";
}

.share-shelf-card__quote-source {
    display: block;
    font-size: 0.9rem;
    font-style: normal;
    margin-top: 0.9rem;
    opacity: 0.7;
}

.share-shelf-card__quote-source::before {
    content: "— ";
}

.share-shelf-card--quote .share-shelf-card__note {
    margin-top: 0.25rem;
    text-align: center;
}

.share-shelf-single-card--quote .share-shelf-single-card__content {
    padding-top: clamp(12px, 3vw, 32px);
}

.share-shelf-single-card__quote-section {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 260px;
    text-align: center;
}

.share-shelf-single-card__quote-section blockquote {
    border-left: 0;
    font-size: clamp(1.7rem, 4vw, 3rem);
    line-height: 1.25;
    max-width: 760px;
    padding-left: 0;
}

.share-shelf-single-card__quote-section blockquote::before {
    content: "“";
}

.share-shelf-single-card__quote-section blockquote::after {
    content: "”";
}

.share-shelf-single-card__quote-section cite {
    display: flex;
    flex-direction: column;
    font-style: normal;
    gap: 0.2rem;
    margin-top: 1.1rem;
    opacity: 0.72;
}

.share-shelf-single-card__quote-section cite::before {
    content: "— ";
}

/* Card fill color options */
.share-shelf-card--fill-white,
.share-shelf-single-card--fill-white {
    --share-shelf-card-fill: #ffffff;
    --share-shelf-card-border: #e5e7eb;
}

.share-shelf-card--fill-pastel-sky,
.share-shelf-single-card--fill-pastel-sky {
    --share-shelf-card-fill: #eaf4ff;
    --share-shelf-card-border: #cfe5fb;
}

.share-shelf-card--fill-pastel-mint,
.share-shelf-single-card--fill-pastel-mint {
    --share-shelf-card-fill: #eaf8f0;
    --share-shelf-card-border: #cfe9da;
}

.share-shelf-card--fill-pastel-peach,
.share-shelf-single-card--fill-pastel-peach {
    --share-shelf-card-fill: #fff1e8;
    --share-shelf-card-border: #f2d9ca;
}

.share-shelf-card--fill-pastel-lavender,
.share-shelf-single-card--fill-pastel-lavender {
    --share-shelf-card-fill: #f3efff;
    --share-shelf-card-border: #ddd3f8;
}

.share-shelf-card--fill-pastel-butter,
.share-shelf-single-card--fill-pastel-butter {
    --share-shelf-card-fill: #fff8dc;
    --share-shelf-card-border: #eee2ae;
}

.share-shelf-card--fill-pastel-rose,
.share-shelf-single-card--fill-pastel-rose {
    --share-shelf-card-fill: #fff0f3;
    --share-shelf-card-border: #f0ccd5;
}

.share-shelf-card--fill-pastel-sage,
.share-shelf-single-card--fill-pastel-sage {
    --share-shelf-card-fill: #f0f5e8;
    --share-shelf-card-border: #d7e2c8;
}

.share-shelf-card[class*="share-shelf-card--fill-"],
.share-shelf-single-card[class*="share-shelf-single-card--fill-"] {
    background: var(--share-shelf-card-fill, #ffffff) !important;
    border-color: var(--share-shelf-card-border, #e5e7eb) !important;
}

.share-shelf-card[class*="share-shelf-card--fill-pastel-"] .share-shelf-card__image,
.share-shelf-card[class*="share-shelf-card--fill-pastel-"] .share-shelf-card__embed,
.share-shelf-single-card[class*="share-shelf-single-card--fill-pastel-"] .share-shelf-single-card__image,
.share-shelf-single-card[class*="share-shelf-single-card--fill-pastel-"] .share-shelf-single-card__embed {
    background: rgba(255, 255, 255, 0.45);
}

.share-shelf-card[class*="share-shelf-card--fill-pastel-"] .share-shelf-card__actions {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.share-shelf-card[class*="share-shelf-card--fill-pastel-"] .share-shelf-card__action--secondary,
.share-shelf-card[class*="share-shelf-card--fill-pastel-"] .share-shelf-card__action--ghost {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 0, 0, 0.12);
}

.share-shelf-card__placeholder,
.share-shelf-single-card__placeholder {
    align-items: center;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.28));
    border-bottom: 1px solid var(--share-shelf-card-border, #e5e7eb);
    color: #1f2937;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
}

.share-shelf-card__placeholder:hover,
.share-shelf-card__placeholder:focus {
    color: #111827;
    text-decoration: none;
}

.share-shelf-card__placeholder-kicker,
.share-shelf-single-card__placeholder-kicker {
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    padding: 0.35rem 0.55rem;
    text-transform: uppercase;
}

.share-shelf-card__placeholder-text,
.share-shelf-single-card__placeholder-text {
    font-size: clamp(1.35rem, 3vw, 2.1rem);
    font-weight: 850;
    letter-spacing: -0.04em;
    line-height: 1;
}

.share-shelf-card__placeholder-title,
.share-shelf-single-card__placeholder-title {
    color: #4b5563;
    display: -webkit-box;
    font-size: 0.9rem;
    line-height: 1.25;
    max-width: 90%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.share-shelf-single-card__placeholder {
    border: 1px solid var(--share-shelf-card-border, #e5e7eb);
    border-radius: 16px;
    margin: 0 0 1.5rem;
    min-height: 280px;
}


/* Keep top-right actions readable and un-clipped on small screens. */
.share-shelf-card__top-actions,
.share-shelf-single-card__top-actions {
    z-index: 80;
}

.share-shelf-card__top-actions .share-shelf-share-menu,
.share-shelf-card__top-actions .share-shelf-share-menu__trigger,
.share-shelf-single-card__top-actions .share-shelf-share-menu,
.share-shelf-single-card__top-actions .share-shelf-share-menu__trigger {
    width: auto;
}

.share-shelf-card__top-actions .share-shelf-share-menu__panel,
.share-shelf-single-card__top-actions .share-shelf-share-menu__panel {
    left: auto;
    right: 0;
    top: calc(100% + 10px);
    width: min(220px, calc(100vw - 48px));
}

.share-shelf-card > .share-shelf-card__image,
.share-shelf-card > .share-shelf-card__embed,
.share-shelf-card > .share-shelf-media-carousel,
.share-shelf-card > .share-shelf-card__placeholder {
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

@media (max-width: 640px) {
    .share-shelf-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .share-shelf-card {
        max-width: 100%;
        min-width: 0;
    }

    .share-shelf-card__top-actions {
        right: 0.55rem;
        top: 0.55rem;
    }

    .share-shelf-card__expand-icon,
    .share-shelf-card__icon-button {
        flex-basis: 34px;
        height: 34px;
        min-width: 34px;
        width: 34px;
    }

    .share-shelf-card__top-actions .share-shelf-share-menu__panel,
    .share-shelf-single-card__top-actions .share-shelf-share-menu__panel {
        left: auto;
        right: 0;
        max-width: calc(100vw - 56px);
        width: min(220px, calc(100vw - 56px));
    }
}

.share-shelf-filters {
    align-items: end;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.045);
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
    margin: 0 0 1.5rem;
    padding: 1rem;
}

.share-shelf-filters__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.share-shelf-filters__field label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    opacity: 0.7;
    text-transform: uppercase;
}

.share-shelf-filters__field--search {
    grid-column: 1 / -1;
}

.share-shelf-filters__field input[type="search"],
.share-shelf-filters__field select {
    appearance: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    color: inherit;
    font: inherit;
    min-height: 42px;
    padding: 0.55rem 0.65rem;
    width: 100%;
}

.share-shelf-filters__actions {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.share-shelf-filters__button,
.share-shelf-filters__reset {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
    min-height: 42px;
    padding: 0.78rem 1rem;
    text-decoration: none;
    white-space: nowrap;
}

.share-shelf-filters__button {
    background: #111827;
    border: 1px solid #111827;
    color: #fff;
    cursor: pointer;
}

.share-shelf-filters__reset {
    background: #fff;
    border: 1px solid #d1d5db;
    color: inherit;
}

@media (max-width: 980px) {
    .share-shelf-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .share-shelf-filters__actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .share-shelf-filters {
        grid-template-columns: 1fr;
    }

    .share-shelf-filters__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .share-shelf-filters__button,
    .share-shelf-filters__reset {
        width: 100%;
    }
}

/* Shelf carousel layout */
.share-shelf-shelf-carousel {
    margin: 1.5rem 0;
    position: relative;
}

.share-shelf-shelf-carousel__track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 1rem;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.share-shelf-shelf-carousel__slide {
    flex: 0 0 min(86vw, 340px);
    scroll-snap-align: start;
}

.share-shelf-shelf-carousel__slide .share-shelf-card {
    min-height: 520px;
}

.share-shelf-carousel-button {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.6rem;
    font-weight: 700;
    height: 38px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    z-index: 4;
}

.share-shelf-carousel-button--prev {
    left: -0.75rem;
}

.share-shelf-carousel-button--next {
    right: -0.75rem;
}

/* Per-card image carousel */
.share-shelf-media-carousel {
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.45);
    overflow: hidden;
    position: relative;
    width: 100%;
}

.share-shelf-media-carousel__track {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.share-shelf-media-carousel__track::-webkit-scrollbar {
    display: none;
}

.share-shelf-media-carousel__slide {
    align-items: center;
    display: flex;
    flex: 0 0 100%;
    height: 100%;
    justify-content: center;
    scroll-snap-align: start;
    width: 100%;
}

.share-shelf-media-carousel__slide img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.share-shelf-card--image-contain .share-shelf-media-carousel__slide,
.share-shelf-single-card--image-contain .share-shelf-media-carousel__slide {
    padding: 0.75rem;
}

.share-shelf-card--image-contain .share-shelf-media-carousel__slide img,
.share-shelf-single-card--image-contain .share-shelf-media-carousel__slide img {
    object-fit: contain;
}

.share-shelf-single-card__gallery.share-shelf-media-carousel {
    border-radius: 18px;
    margin-bottom: 1.5rem;
}

.share-shelf-single-card__gallery .share-shelf-media-carousel__track {
    min-height: 360px;
}

.share-shelf-single-card__gallery .share-shelf-media-carousel__slide img {
    max-height: 620px;
}

@media (max-width: 720px) {
    .share-shelf-carousel-button {
        height: 34px;
        width: 34px;
    }

    .share-shelf-carousel-button--prev {
        left: 0.25rem;
    }

    .share-shelf-carousel-button--next {
        right: 0.25rem;
    }

    .share-shelf-shelf-carousel__slide {
        flex-basis: 82vw;
    }
}

.share-shelf-media-carousel .share-shelf-carousel-button--prev {
    left: 0.5rem;
}

.share-shelf-media-carousel .share-shelf-carousel-button--next {
    right: 0.5rem;
}


.share-shelf-button:hover,
.share-shelf-button:focus {
    background: #3f3f46;
    border-color: #3f3f46;
    box-shadow: 0 10px 20px rgba(17, 17, 17, 0.18);
    color: #fff;
    letter-spacing: 0.015em;
    text-decoration: none;
    transform: translateY(-1px);
}

.share-shelf-card__stats,
.share-shelf-single-card__stats {
    align-items: center;
    color: rgba(17, 17, 17, 0.62);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    gap: 0.45rem;
    line-height: 1.3;
}

.share-shelf-card__stats {
    margin: 0.5rem 0 0;
}

.share-shelf-single-card__stats {
    justify-content: center;
    margin-top: 0.8rem;
}

.share-shelf-card__stats span,
.share-shelf-single-card__stats span {
    align-items: center;
    display: inline-flex;
}

.share-shelf-card__stats span + span::before,
.share-shelf-single-card__stats span + span::before {
    content: "•";
    margin-right: 0.45rem;
    opacity: 0.55;
}

/* ShareShelf iframe embed mode */
body.share-shelf-embed-body {
    margin: 0;
    background: transparent;
}

body.share-shelf-embed-body .share-shelf-page.share-shelf-embed-page {
    max-width: none;
    margin: 0;
    padding: 12px;
}

body.share-shelf-embed-body .share-shelf-single-card {
    margin: 0 auto;
    box-shadow: none;
}
