/* ================================================
   Safar Resources - Shared Components

   Everything here works inside .sr-content-wrapper on any theme. Rules for
   <button> elements carry :not(#sr-x), which lifts them above broad theme
   rules such as `button:not(:hover):not(:active)` without !important.
   ================================================ */

/* --- Scope ---
   Every toolbox page's root carries .sr-content-wrapper; the modal and the
   toasts are added to <body>, so they carry their own class. Inside these
   three, the theme's fonts, colours, alignment, letter spacing and casing
   are reset, and nothing in the plugin's CSS matches outside them except the
   body-class rule for the shop header below. --- */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts) {
    font-family: var(--sr-font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--sr-neutral-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    word-spacing: normal;
}

:is(.sr-content-wrapper, .sr-modal, .sr-toasts) *,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts) *::before,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts) *::after {
    box-sizing: border-box;
}

/* Headings and text take the plugin's fonts, whatever the theme sets on h1 to
   h6 and p; each component then sets its own size. */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts) :where(h1, h2, h3, h4, h5, h6) {
    font-family: var(--sr-font-heading);
    font-weight: 700;
    font-style: normal;
    letter-spacing: normal;
    text-transform: none;
    color: var(--sr-neutral-heading);
}

/* Lists, links and form controls too: themes often give ul, ol, a, input or
   button their own font, and every child of a list then inherits it. */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts) :where(p, ul, ol, li, dl, dd, dt, label, legend, blockquote, figcaption, span, a, button, input, select, textarea, small, strong, em, b, i, time, nav, table, th, td) {
    font-family: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

:where(.sr-content-wrapper, .sr-modal, .sr-toasts) :where(h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, fieldset, blockquote, dl, dd) {
    margin: 0;
    padding: 0;
}

:where(.sr-content-wrapper, .sr-modal, .sr-toasts) :where(ul[class], ol[class]) {
    list-style: none;
}

:where(.sr-content-wrapper, .sr-modal, .sr-toasts) :where(img, svg) {
    max-width: 100%;
}

:is(.sr-content-wrapper, .sr-modal, .sr-toasts) :where(button, input, select, textarea) {
    font-family: inherit;
    letter-spacing: inherit;
    text-transform: none;
}

/* A plugin button with no style of its own draws nothing: no theme
   background, border, shadow or colour in any state. Each component sets
   what it needs on top of this. The states add no weight, so any component
   rule for the button wins, while the theme's button:hover and
   button:not(:hover):not(:active) rules do not. */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) :where(button):where(:not([class*="splide"])) {
    background-color: transparent;
    background-image: none;
    border-color: transparent;
    box-shadow: none;
    color: inherit;
    text-decoration: none;
    text-shadow: none;
    outline-offset: 0;
}

.sr-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* The shop's header sits above the hero, which pulls up behind it. Only on
   toolbox pages (the router adds the body class). */
.safar-resources .sr-content-wrapper {
    min-height: 60vh;
}

/* The hero's blue runs up behind the shop's header. The header keeps the
   theme's own stacking, so its menus open over everything below. */
.safar-resources #brx-header {
    background: #2FAEDB;
}

/* While a toolbox overlay is open (a modal, or the hub's filter sheet on a
   phone), it covers the shop's header too: the phone header is fixed at the
   top of the theme's stacking order, so it steps down only then. */
html.sr-modal-open .safar-resources #brx-header,
.safar-resources:has(.sr-hub.is-sheet-open) #brx-header {
    position: relative;
    /* The theme sets its phone header's order with !important. */
    z-index: 1 !important;
}

/* The share menu's bottom sheet (phones) covers the header the same way. */
@media (max-width: 599px) {
    .safar-resources.sr-share-open #brx-header {
        position: relative;
        z-index: 1 !important;
    }
}

/* Optical centring. Flex rows centre on the line box, and Inter's line box
   centres on its capital letters, so an icon beside a mostly lower-case
   label ("My resources", "No reviews yet") sits about 1px above the words
   as people read them. These icons drop by --sr-icon-drop (0.07em of the
   label's size). dev/align-check.mjs measures every icon beside text; rerun
   it after changing a label's font or an icon. */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts) :is(
    .sr-mylink > svg,
    .sr-search__scope-btn svg,
    .sr-lmenu__btn svg,
    .sr-t-back svg,
    .sr-detail__rating .sr-star,
    .sr-reviews__summary .sr-star,
    .sr-author__mark,
    .sr-other__icon,
    .sr-stars-input__row
) {
    position: relative;
    top: var(--sr-icon-drop);
}

/* A card's stars sit beside smaller text than the stars' row is tall, so
   they rise by the same amount instead. */
.sr-resource-card__rating-stars .sr-stars {
    position: relative;
    top: calc(-1 * var(--sr-icon-drop));
}

/* --- Container --- */
.sr-container {
    width: 100%;
    max-width: calc(var(--sr-container-max) + 2 * var(--sr-container-padding));
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--sr-container-padding);
    padding-right: var(--sr-container-padding);
}

/* --- Section headings used by the shared blocks --- */
.sr-section-heading {
    font-family: var(--sr-font-heading);
    font-weight: 700;
    font-size: 32px;
    line-height: 1.4;
    color: var(--sr-neutral-heading);
    letter-spacing: 0;
    text-transform: none;
}

.sr-section-heading--large {
    font-size: 40px;
    line-height: 1.2;
}

/* ================================================
   Resource card
   ================================================ */
.sr-resource-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--sr-line);
    border-radius: 16px;
    font-family: var(--sr-font-body);
    color: var(--sr-neutral-body);
    text-align: left;
    transition: box-shadow var(--sr-transition-base), border-color var(--sr-transition-base);
}

.sr-resource-card:hover,
.sr-resource-card:focus-within {
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.sr-resource-card__thumbnail {
    position: relative;
    display: block;
    border-radius: 10px;
    background: #F5F6F7;
    text-decoration: none;
}

.sr-resource-card__thumbnail > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 290 / 203;
    /* Shown whole until card.js has compared the picture with the slot. */
    object-fit: contain;
    border-radius: 10px;
    background: #F5F6F7;
}

/* Pictures shaped like the slot fill it; anything else, usually a worksheet
   screenshot, sits whole on the grey ground like a sheet on a desk. card.js
   adds the class. Shared by cards, the Save and Notes modals and My shares. */
:is(.sr-resource-card__thumbnail, .sr-msummary__thumb, .sr-share__thumb) > img.is-fill {
    object-fit: cover;
    object-position: center top;
}

:is(.sr-resource-card__thumbnail, .sr-msummary__thumb, .sr-share__thumb) > img.is-whole {
    object-fit: contain;
    object-position: center;
    padding: 12px;
    background: transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.sr-resource-card__thumbnail-placeholder {
    width: 100%;
    aspect-ratio: 290 / 203;
    border-radius: 10px;
    background: #F5F6F7;
}

.sr-resource-card__thumbnail:focus-visible {
    outline: 2px solid var(--sr-focus);
    outline-offset: 2px;
}

/* Ribbons sit on the top edge of the image, 10px in from the right. */
.sr-resource-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.sr-resource-card__title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 54px;
}

.sr-resource-card__title,
.sr-resource-card__title:visited {
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--sr-font-body);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    color: var(--sr-neutral-body);
    text-decoration: none;
    transition: color var(--sr-transition-fast);
}

.sr-resource-card:hover .sr-resource-card__title,
.sr-resource-card__title:hover,
.sr-resource-card__title:focus-visible {
    color: var(--sr-blue-1);
    text-decoration: none;
}

.sr-resource-card__title:focus-visible {
    outline: 2px solid var(--sr-focus);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Stretch the title link over the whole card so the card is one target. */
.sr-resource-card__title::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
}

.sr-resource-card__thumbnail,
.sr-resource-card__bookmark,
.sr-resource-card__notes-link,
.sr-resource-card__rating-stars {
    position: relative;
    z-index: 1;
}

/* Bookmark: a bare icon with a 32px target. */
.sr-resource-card__bookmark:not(#sr-x) {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    /* Centred on the title's first line. */
    margin: -3px -9px 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    color: var(--sr-neutral-light-text);
    cursor: pointer;
    transition: color var(--sr-transition-fast), background var(--sr-transition-fast);
}

.sr-resource-card__bookmark svg {
    display: block;
    width: 15px;
    height: 22px;
}

.sr-resource-card__bookmark:not(#sr-x):hover {
    background: var(--sr-bg-skyblue);
    color: var(--sr-sky-blue-1);
    border: 0;
    box-shadow: none;
}

.sr-resource-card__bookmark:not(#sr-x):focus {
    outline: none;
    background: transparent;
    box-shadow: none;
}

.sr-resource-card__bookmark:not(#sr-x):focus-visible {
    background: var(--sr-bg-skyblue);
    box-shadow: var(--sr-focus-ring);
    color: var(--sr-sky-blue-1);
}

.sr-resource-card__bookmark:not(#sr-x):active {
    background: #D6EEF9;
    color: var(--sr-sky-blue-1);
}

.sr-resource-card__bookmark--saved:not(#sr-x),
.sr-resource-card__bookmark--saved:not(#sr-x):hover {
    color: var(--sr-sky-blue-1);
}

.sr-resource-card__bookmark:not(#sr-x)[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

.sr-resource-card__meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.sr-resource-card__author {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 6px;
    min-width: 0;
    font-size: 12px;
    line-height: 17px;
}

.sr-resource-card__author-prefix {
    color: var(--sr-neutral-light-text);
}

.sr-resource-card__author-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: var(--sr-neutral-body);
}

.sr-resource-card__author-mark {
    display: inline-flex;
    flex-shrink: 0;
}

.sr-resource-card__author-mark svg {
    display: block;
    width: 14px;
    height: 14px;
}

.sr-resource-card__author-avatar {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: cover;
}

/* The institute follows the name after a dot, on the same line when it fits. */
.sr-resource-card__author-institute {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sr-neutral-light-text);
}

.sr-resource-card__author-institute::before {
    content: "·";
    margin-right: 6px;
}

.sr-resource-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sr-resource-card__rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 14px;
}

.sr-resource-card__rating-stars {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sr-resource-card__rating-score {
    font-size: 12px;
    line-height: 1;
    color: var(--sr-neutral-body);
}

.sr-resource-card__rating-none {
    font-size: 12px;
    line-height: 1;
    color: var(--sr-neutral-light-text);
}

.sr-resource-card__notes-link,
.sr-resource-card__notes-link:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: var(--sr-blue-1);
    text-decoration: none;
    border-radius: 4px;
}

.sr-resource-card__notes-link:hover {
    color: var(--sr-heading-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sr-resource-card__notes-link:focus-visible {
    outline: 2px solid var(--sr-focus);
    outline-offset: 3px;
}

.sr-resource-card__notes-link svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* --- Ribbons (40x50 notched pennants) --- */
/* The design marks Safar's own resources and staff picks only; shares by
   teachers carry no ribbon, their author line says who made them. */
/* --- Tags --- */
/* Card tag: Textbook 1, Ages 4 to 6 */
.sr-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 100px;
    background: var(--sr-bg-skyblue);
    font-family: var(--sr-font-body);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    color: var(--sr-blue-1);
    white-space: nowrap;
}

/* Square tag in lists (typeahead rows) */
.sr-tag--square {
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1.5;
}

/* ================================================
   Buttons
   ================================================ */
/* Text link button: Clear filters, See more */
.sr-link:not(#sr-x) {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-family: var(--sr-font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--sr-blue-1);
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    border-radius: 2px;
}

.sr-link:not(#sr-x):hover {
    background: transparent;
    color: var(--sr-heading-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sr-link:not(#sr-x):focus {
    outline: none;
    background: transparent;
}

.sr-link:not(#sr-x):focus-visible {
    outline: 2px solid var(--sr-focus);
    outline-offset: 2px;
}

/* ================================================
   Pill buttons: Download Now, Share, Save, Log In, Load more, and the
   landing page's buttons. Green is the default.
   ================================================ */

:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 56px;
    margin: 0;
    padding: 16px 20px;
    border: 1px solid transparent;
    border-radius: 100px;
    background: var(--sr-x-green);
    box-shadow: none;
    color: #fff;
    font-family: var(--sr-x-head-font);
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: 0.32px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn svg {
    flex: none;
}

:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--green,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--green:visited {
    background: var(--sr-x-green);
    border-color: var(--sr-x-green);
    color: #fff;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--green:hover {
    background: var(--sr-x-green-hover);
    border-color: var(--sr-x-green-hover);
    color: #fff;
    box-shadow: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--green:active {
    background: var(--sr-x-green-active);
    border-color: var(--sr-x-green-active);
    color: #fff;
}

:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--blue,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--blue:visited {
    background: var(--sr-x-blue);
    border-color: var(--sr-x-blue);
    color: #fff;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--blue:hover {
    background: var(--sr-x-blue-hover);
    border-color: var(--sr-x-blue-hover);
    color: #fff;
    box-shadow: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--blue:active {
    background: var(--sr-x-blue-active);
    border-color: var(--sr-x-blue-active);
    color: #fff;
}

:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--outline-blue,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--outline-blue:visited {
    background: #fff;
    border-color: var(--sr-x-blue);
    color: var(--sr-x-blue);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--outline-blue:hover {
    background: var(--sr-x-sky-bg);
    border-color: var(--sr-x-blue);
    color: var(--sr-x-blue);
    box-shadow: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--outline-blue:active {
    background: #D6EEFA;
    border-color: var(--sr-x-blue-active);
    color: var(--sr-x-blue-active);
}

:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--outline-green,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--outline-green:visited {
    min-width: 270px;
    background: #fff;
    border-color: var(--sr-x-green);
    color: var(--sr-x-green-text);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--outline-green:hover {
    background: #F4FAED;
    border-color: var(--sr-x-green-hover);
    color: var(--sr-x-green-text);
    box-shadow: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--outline-green:active {
    background: #E6F3D6;
    border-color: var(--sr-x-green-active);
    color: var(--sr-x-green-text);
}

/* Navy (the landing page's second button) */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--navy,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--navy:visited {
    background: var(--sr-safar-blue);
    border-color: var(--sr-safar-blue);
    color: #fff;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--navy:hover {
    background: var(--sr-heading-hover);
    border-color: var(--sr-heading-hover);
    color: #fff;
    box-shadow: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--navy:active {
    background: #002C46;
    border-color: #002C46;
    color: #fff;
}

/* Sizes: wide (the landing's main buttons), small (48), compact (38), tiny (32) */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--wide {
    min-width: 270px;
    padding: 16px 32px;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--small {
    min-height: 48px;
    padding: 12px 32px;
    gap: 10px;
    font-size: 14px;
    letter-spacing: 0.28px;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--compact {
    min-height: 38px;
    padding: 9px 20px;
    font-size: 13px;
    line-height: 20px;
    letter-spacing: 0.26px;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--tiny {
    min-height: 32px;
    padding: 6px 16px;
    font-size: 12px;
    line-height: 20px;
    letter-spacing: 0.24px;
}

:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--medium {
    min-height: 48px;
    padding: 12px 32px;
}

/* Step buttons: the share form's Back, Next, Submit and small actions, drawn
   as rounded rectangles in sentence case rather than pills in capitals. */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--step {
    gap: 8px;
    min-height: 48px;
    padding: 12px 28px;
    border-radius: 10px;
    font-family: var(--sr-font-body);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--step-small {
    min-height: 40px;
    margin-top: 12px;
    padding: 8px 16px;
    font-size: 14px;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--ghost,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--ghost:visited {
    border: 1.5px solid var(--sr-x-border);
    background: transparent;
    color: var(--sr-x-blue);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--ghost:hover {
    border-color: var(--sr-x-sky);
    background: var(--sr-x-sky-bg);
    color: var(--sr-x-heading);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn--ghost:active {
    background: #D6EEF9;
    color: var(--sr-x-heading);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn:not(.sr-pbtn--ghost):active {
    transform: translateY(1px);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn[hidden] {
    display: none;
}

:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn:focus {
    outline: none;
}
/* [class] outranks the button reset at the end of this file. */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn[class]:focus-visible {
    outline: 3px solid var(--sr-x-focus);
    outline-offset: 3px;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn:disabled,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn[aria-disabled="true"],
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn[aria-busy="true"] {
    opacity: 0.6;
    cursor: default;
    transform: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pbtn[aria-busy="true"] {
    cursor: progress;
}

/* ================================================
   Focus, the resource page's stars, ribbons and author line
   ================================================ */

:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) :is(a, button, summary, select, input, textarea):focus-visible {
    outline: 3px solid var(--sr-x-focus);
    outline-offset: 2px;
}


.sr-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: none;
    vertical-align: middle;
}
.sr-star {
    position: relative;
    display: block;
    width: 20px;
    height: 18px;
}
.sr-star svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: var(--sr-x-star-off, #E4E4E7);
}
.sr-star .sr-star__on {
    fill: var(--sr-x-star, #F6BB41);
    clip-path: inset(0 calc(100% - var(--fill)) 0 0);
}
.sr-stars--card { gap: 2px; }
.sr-stars--card .sr-star { width: 15px; height: 14px; }
.sr-stars--review { gap: 4px; }
.sr-stars--review .sr-star { width: 22px; height: 20px; }
.sr-stars--summary { gap: 8px; }
.sr-stars--summary .sr-star { width: 35px; height: 32px; }

/* Ribbons: Safar Resource on the right, Staff Pick to its left. */
.sr-ribbons {
    position: absolute;
    top: 0;
    right: 30px;
    z-index: 2;
    display: flex;
    gap: 7px;
    pointer-events: none;
}
.sr-ribbon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    height: 75px;
    padding-top: 10px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 83.9%, 0 100%);
    color: #fff;
    font-family: var(--sr-x-body-font);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}
.sr-ribbon img:not(#sr-x) {
    display: block;
    height: 21px;
    width: auto;
    margin: 0 0 1px;
}
.sr-ribbon--safar { background: var(--sr-x-blue, #0168A5); }
.sr-ribbon--staff { background: var(--sr-x-purple, #8C75C1); }
.sr-ribbon--staff img:not(#sr-x) { height: 16px; margin: 2px 0 4px; }
/* Sizes: large (the resource page gallery, the defaults above), small (the
   Save and Notes modals) and card (resource cards). */
.sr-ribbons--small { right: 11px; gap: 5px; }
.sr-ribbons--small .sr-ribbon { width: 44px; height: 55px; padding-top: 7px; font-size: 7.5px; }
.sr-ribbons--small .sr-ribbon img:not(#sr-x) { height: 15px; }
.sr-ribbons--small .sr-ribbon--staff img:not(#sr-x) { height: 12px; margin: 1px 0 3px; }
.sr-ribbons--card { right: 10px; gap: 5px; }
.sr-ribbons--card .sr-ribbon { width: 40px; height: 50px; padding-top: 5px; font-size: 7px; }
.sr-ribbons--card .sr-ribbon img:not(#sr-x) { height: 14px; margin: 0 0 2px; }
.sr-ribbons--card .sr-ribbon--staff img:not(#sr-x) { height: 11px; margin: 1px 0 4px; }

.sr-author {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.sr-author__by {
    margin-right: 2px;
    color: var(--sr-x-light);
}
.sr-author__mark {
    display: block;
    width: 18px;
    height: 18px;
}
.sr-author__name {
    color: var(--sr-x-body);
}

/* --- Breadcrumb: resource page and My resources --- */
.sr-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 14px;
    line-height: 1.5;
}
.sr-crumbs li {
    display: flex;
    gap: 12px;
    min-width: 0;
    color: var(--sr-x-light);
}
.sr-crumbs li + li::before {
    content: "/";
    color: var(--sr-x-light);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-crumbs a,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-crumbs a:visited {
    color: var(--sr-x-light);
    text-decoration: none;
    background: none;
    box-shadow: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-crumbs a:hover {
    color: var(--sr-x-blue);
    text-decoration: underline;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-crumbs a:active {
    color: var(--sr-x-blue-active);
}
.sr-crumbs [aria-current] {
    color: var(--sr-x-body);
}

/* ================================================
   Chips and pills
   ================================================ */

/* Removable filter chip: Textbook 3 x */
.sr-chip,
.sr-chip:visited {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid rgba(47, 174, 219, 0.15);
    border-radius: 100px;
    background: var(--sr-bg-skyblue);
    font-family: var(--sr-font-body);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--sr-neutral-heading);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--sr-transition-fast), border-color var(--sr-transition-fast);
}

.sr-chip svg {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
}

.sr-chip:hover {
    background: #D9F0FA;
    border-color: rgba(47, 174, 219, 0.4);
    color: var(--sr-neutral-heading);
    text-decoration: none;
}

.sr-chip:focus-visible {
    outline: none;
    box-shadow: var(--sr-focus-ring);
}

.sr-chip:active {
    background: #C9E8F6;
}

/* Category chip: the type row under the results header */
.sr-cat-chip,
.sr-cat-chip:visited {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid var(--sr-neutral-border);
    border-radius: 8px;
    background: #fff;
    font-family: var(--sr-font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--sr-neutral-body);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color var(--sr-transition-fast), color var(--sr-transition-fast), background var(--sr-transition-fast);
}

.sr-cat-chip:hover {
    border-color: var(--sr-blue-2);
    color: var(--sr-blue-1);
    background: #fff;
    text-decoration: none;
}

.sr-cat-chip:focus-visible {
    outline: none;
    box-shadow: var(--sr-focus-ring);
}

.sr-cat-chip:active {
    background: var(--sr-bg-skyblue);
}

.sr-cat-chip.is-selected,
.sr-cat-chip[aria-pressed="true"] {
    border-color: var(--sr-blue-2);
    color: var(--sr-blue-1);
}

/* Lesson pill (Concept D lesson strip) */
.sr-lesson-pill,
.sr-lesson-pill:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 8px 14px;
    border: 1.5px solid var(--sr-neutral-border);
    border-radius: 20px;
    background: #fff;
    font-family: var(--sr-font-body);
    font-size: 13px;
    line-height: 1.3;
    color: var(--sr-neutral-body);
    text-decoration: none;
    transition: border-color var(--sr-transition-fast), background var(--sr-transition-fast);
}

.sr-lesson-pill__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.sr-lesson-pill__count {
    color: var(--sr-neutral-light-text);
}

a.sr-lesson-pill:hover {
    border-color: var(--sr-sky-blue-1);
    color: var(--sr-neutral-body);
    text-decoration: none;
}

.sr-lesson-pill:focus-visible,
.sr-lesson-pill a:focus-visible {
    outline: none;
    box-shadow: var(--sr-focus-ring);
}

.sr-lesson-pill.is-selected,
.sr-lesson-pill.is-selected:not(#sr-x):is(:visited, :hover, :focus, :focus-visible, :active) {
    border-color: var(--sr-safar-blue);
    background: var(--sr-safar-blue);
    color: #fff;
}

.sr-lesson-pill.is-selected:not(#sr-x):focus-visible {
    box-shadow: var(--sr-focus-ring);
}

.sr-lesson-pill.is-selected .sr-lesson-pill__count {
    color: #BFE6F5;
}

.sr-lesson-pill--empty {
    border-style: dashed;
    border-color: #C9E6F4;
}

.sr-lesson-pill--empty a,
.sr-lesson-pill--empty a:visited {
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
}

.sr-lesson-pill--empty .sr-lesson-pill__name {
    max-width: 14em;
}

.sr-lesson-pill__share,
.sr-lesson-pill__share a,
.sr-lesson-pill__share a:visited {
    color: var(--sr-sky-blue-1);
    white-space: nowrap;
}

.sr-lesson-pill--empty a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Pill: the landing's book toggles and its "Saved" and "Tailor" links,
       and the "My resources" link in every hero --- */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    margin: 0;
    padding: 7px 16px;
    border: 1.5px solid var(--sr-x-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: none;
    font-family: var(--sr-font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    color: var(--sr-x-body);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill:hover,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill:focus {
    border-color: var(--sr-x-sky);
    background: #F7FBFE;
    color: var(--sr-x-heading);
    box-shadow: none;
    outline: none;
    text-decoration: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill:focus-visible {
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--sr-x-focus);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill:active {
    background: var(--sr-x-sky-bg);
    color: var(--sr-x-heading);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill[aria-pressed="true"],
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill[aria-pressed="true"]:hover,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill[aria-pressed="true"]:focus {
    border-color: var(--sr-x-heading);
    background: var(--sr-x-heading);
    color: #fff;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill--add,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill--add:hover,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill--add:focus {
    border-style: dashed;
    border-color: #B8BCBF;
    color: var(--sr-x-blue);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill--add:hover,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-pill--add[aria-expanded="true"] {
    border-color: var(--sr-x-sky);
    background: #F7FBFE;
}
.sr-pill__count {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 9px;
    background: var(--sr-x-sky);
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    color: #fff;
}
/* News about the teacher's own shares (went live, sent back). */
.sr-pill__count--news {
    background: #B42C3C;
}

/* --- "My resources" for signed-in visitors: top right of the hero, beside
       the breadcrumb, and on the tailor page --- */
.sr-hero__account {
    position: absolute;
    top: 24px;
    right: max(var(--sr-container-padding), calc((100% - var(--sr-container-max)) / 2));
    z-index: 2;
}
.sr-crumbs-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}
.sr-mylink svg {
    flex: none;
}
@media (max-width: 767px) {
    .sr-hero__account {
        position: static;
        display: flex;
        justify-content: flex-end;
        margin: -24px var(--sr-container-padding) 16px;
    }
}

/* --- Choice chip: Add a book --- */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 0;
    padding: 9px 16px;
    border: 1.5px solid var(--sr-x-border);
    border-radius: 100px;
    background: #fff;
    box-shadow: none;
    font-family: var(--sr-font-body);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: var(--sr-x-body);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-choice:hover,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-choice:focus {
    border-color: var(--sr-x-sky);
    background: #F7FBFE;
    color: var(--sr-x-heading);
    box-shadow: none;
    outline: none;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-choice:focus-visible {
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--sr-x-focus);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-choice:active {
    background: var(--sr-x-sky-bg);
    color: var(--sr-x-heading);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-choice:disabled {
    opacity: 0.6;
    cursor: default;
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-choice[aria-pressed="true"] {
    border-color: var(--sr-x-sky);
    background: var(--sr-x-sky-bg);
    color: var(--sr-x-heading);
}
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) .sr-choice[aria-pressed="true"]::before {
    content: "";
    width: 14px;
    height: 10px;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M1.5 5l3.5 3.5L12.5 1' fill='none' stroke='%230168A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ================================================
   Form controls
   ================================================ */

/* Checkbox look (16x16), used on real inputs and on role="checkbox" links */
.sr-check {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1px solid var(--sr-checkbox-border);
    border-radius: 4px;
    background: #fff;
    transition: background var(--sr-transition-fast), border-color var(--sr-transition-fast);
}

.sr-check::after {
    content: "";
    position: absolute;
    inset: -1px;
    background: no-repeat center / 16px 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12 5L6.5 11L4 8.27273' fill='none' stroke='white' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    opacity: 0;
}

.is-checked > .sr-check,
[aria-checked="true"] > .sr-check,
input:checked + .sr-check {
    border-color: var(--sr-green-1);
    background: var(--sr-green-1);
}

.is-checked > .sr-check::after,
[aria-checked="true"] > .sr-check::after,
input:checked + .sr-check::after {
    opacity: 1;
}

/* Text input with a leading icon: the panel's search box */
.sr-searchfield {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 12px;
    border: 1px solid var(--sr-neutral-border);
    border-radius: 10px;
    background: #fff;
    transition: border-color var(--sr-transition-fast), box-shadow var(--sr-transition-fast);
}

.sr-searchfield:hover {
    border-color: var(--sr-neutral-light-text);
}

.sr-searchfield:focus-within {
    border-color: var(--sr-blue-2);
    box-shadow: var(--sr-focus-ring);
}

.sr-searchfield__icon {
    display: flex;
    flex-shrink: 0;
    color: var(--sr-neutral-light-text);
}

.sr-searchfield__input:not(#sr-x) {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    font-family: var(--sr-font-body);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.3125px;
    color: var(--sr-neutral-body);
    -webkit-appearance: none;
    appearance: none;
}

/* The field draws the ring (focus-within), so the input draws none. */
.sr-searchfield .sr-searchfield__input:not(#sr-x):focus-visible {
    outline: none;
}

.sr-searchfield__input::placeholder {
    color: var(--sr-neutral-light-text);
    opacity: 1;
}

.sr-searchfield__input::-webkit-search-cancel-button {
    cursor: pointer;
}

/* Select look: the sort menu's button */
.sr-select:not(#sr-x) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 200px;
    height: 48px;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid var(--sr-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    font-family: var(--sr-font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--sr-neutral-body);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    list-style: none;
    transition: border-color var(--sr-transition-fast), box-shadow var(--sr-transition-fast);
}

.sr-select:not(#sr-x)::-webkit-details-marker {
    display: none;
}

.sr-select:not(#sr-x):hover {
    border-color: var(--sr-neutral-light-text);
    background: #fff;
    color: var(--sr-neutral-body);
}

.sr-select:not(#sr-x):focus {
    outline: none;
}

.sr-select:not(#sr-x):focus-visible {
    border-color: var(--sr-blue-2);
    box-shadow: var(--sr-focus-ring);
}

.sr-select svg {
    flex-shrink: 0;
    transition: transform var(--sr-transition-fast);
}

[open] > .sr-select svg {
    transform: rotate(180deg);
}

/* Floating panel: sort menu, typeahead, category menu */
.sr-popover {
    background: #fff;
    border: 1px solid var(--sr-popover-border);
    border-radius: 8px;
    box-shadow: var(--sr-popover-shadow), 0 12px 32px rgba(0, 73, 116, 0.08);
}

/* ================================================
   Pagination
   ================================================ */
.sr-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sr-pagination__info {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--sr-neutral-light-text);
}

.sr-pagination__pages {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.sr-pagination__link,
.sr-pagination__link:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: var(--sr-font-body);
    font-size: 14px;
    line-height: 1;
    color: var(--sr-neutral-body);
    text-decoration: none;
    transition: background var(--sr-transition-fast), border-color var(--sr-transition-fast);
}

.sr-pagination__link--step {
    padding: 0 13px;
}

a.sr-pagination__link:hover {
    background: #F5F6F7;
    color: var(--sr-neutral-heading);
    text-decoration: none;
}

.sr-pagination__link:focus-visible {
    outline: none;
    box-shadow: var(--sr-focus-ring);
}

.sr-pagination__link[aria-current="page"] {
    background: var(--sr-bg-green);
    border-color: var(--sr-green-1);
    color: var(--sr-green-1);
}

.sr-pagination__link--gap {
    min-width: 36px;
}

.sr-pagination__link[aria-disabled="true"] {
    color: var(--sr-neutral-border);
    cursor: default;
}

/* ================================================
   Search bar, typeahead and category menu
   ================================================ */
.sr-search {
    position: relative;
    width: 100%;
    font-family: var(--sr-font-body);
    text-align: left;
}

.sr-search__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 20px;
    border: 1px solid var(--sr-search-border);
    border-radius: 100px;
    background: #fff;
    transition: box-shadow var(--sr-transition-fast), border-color var(--sr-transition-fast);
}

.sr-search__bar:hover {
    border-color: rgba(85, 86, 102, 0.45);
}

.sr-search__bar:focus-within {
    border-color: var(--sr-blue-2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6);
}

/* The bar carries the focus ring, following its pill shape, so the field
   inside it never draws a square outline of its own. */
.sr-search .sr-search__input:not(#sr-x):focus,
.sr-search .sr-search__input:not(#sr-x):focus-visible {
    outline: none;
    box-shadow: none;
}

.sr-search__submit:not(#sr-x) {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 -4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: var(--sr-blue-1);
    cursor: pointer;
}

.sr-search__submit:not(#sr-x):hover,
.sr-search__submit:not(#sr-x):focus-visible {
    background: var(--sr-bg-skyblue);
    color: var(--sr-blue-1);
    border: 0;
    outline: none;
}

.sr-search__submit:not(#sr-x):focus-visible {
    box-shadow: var(--sr-focus-ring);
}

.sr-search__input:not(#sr-x) {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    font-family: var(--sr-font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--sr-search-text);
    -webkit-appearance: none;
    appearance: none;
}

.sr-search__input::placeholder {
    color: var(--sr-search-placeholder);
    opacity: 1;
}

.sr-search__input::-webkit-search-cancel-button {
    display: none;
}

.sr-search__params {
    display: none;
}

.sr-search__scope {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 16px;
    padding-left: 16px;
    margin-right: -4px;
}

.sr-search__divider {
    display: block;
    width: 1px;
    height: 32px;
    background: var(--sr-search-divider);
}

.sr-search__scope-btn:not(#sr-x) {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    max-width: 220px;
    height: 36px;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: 100px;
    background: transparent;
    box-shadow: none;
    font-family: var(--sr-font-body);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--sr-search-text);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.sr-search__scope-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-search__scope-btn svg {
    flex-shrink: 0;
    color: var(--sr-neutral-body);
    transition: transform var(--sr-transition-fast);
}

.sr-search__scope-btn:not(#sr-x):hover,
.sr-search__scope-btn:not(#sr-x)[aria-expanded="true"] {
    background: var(--sr-bg-skyblue);
    border: 0;
    color: var(--sr-blue-1);
}

.sr-search__scope-btn:not(#sr-x)[aria-expanded="true"] svg,
.sr-search__scope-btn:hover svg {
    color: var(--sr-blue-1);
}

.sr-search__scope-btn:not(#sr-x)[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.sr-search__scope-btn:not(#sr-x):focus {
    outline: none;
}

.sr-search__scope-btn:not(#sr-x):focus-visible {
    box-shadow: var(--sr-focus-ring);
}

.sr-search__scope-btn:not(#sr-x).is-scoped {
    color: var(--sr-blue-1);
    font-weight: 600;
}

/* Typeahead panel: same width as the bar, 10px below it */
.sr-search__panel,
.sr-search__menu {
    position: absolute;
    z-index: 50;
    top: calc(100% + 10px);
    background: #fff;
    border: 1px solid var(--sr-popover-border);
    border-radius: 12px;
    box-shadow: var(--sr-popover-shadow), 0 16px 40px rgba(0, 73, 116, 0.1);
    color: var(--sr-neutral-body);
}

.sr-search__panel {
    left: 0;
    right: 0;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    padding: 40px;
}

.sr-search__panel[hidden],
.sr-search__menu[hidden] {
    display: none;
}

.sr-search__section + .sr-search__section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--sr-search-divider);
}

.sr-search__heading {
    margin: 0 0 21px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--sr-neutral-body);
}

.sr-search__rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sr-search__row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin: 0 -12px;
    padding: 0 12px;
    border-radius: 8px;
}

.sr-search__option,
.sr-search__option:visited {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 42px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sr-neutral-body);
    text-decoration: none;
    cursor: pointer;
}

.sr-search__option-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-search__option--recent .sr-search__option-text {
    font-weight: 500;
}

.sr-search__option svg {
    flex-shrink: 0;
    color: var(--sr-neutral-light-text);
}

.sr-search__match {
    font-weight: 600;
    color: var(--sr-blue-1);
}

.sr-search__row:hover,
.sr-search__row.is-active {
    background: #F3F9FC;
}

.sr-search__row.is-active .sr-search__option-text {
    color: var(--sr-neutral-heading);
}

.sr-search__remove:not(#sr-x) {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 -8px 0 auto;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: var(--sr-neutral-light-text);
    cursor: pointer;
}

.sr-search__remove:not(#sr-x):hover,
.sr-search__remove:not(#sr-x):focus-visible {
    background: var(--sr-bg-red);
    color: var(--sr-red-1);
    border: 0;
    outline: none;
}

.sr-search__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    column-gap: 21px;
    row-gap: 0;
}

.sr-search__grid .sr-search__row {
    min-height: 42px;
}

.sr-search__grid .sr-search__option {
    color: rgba(67, 74, 79, 0.75);
}

.sr-search__grid .sr-search__row.is-active .sr-search__option,
.sr-search__grid .sr-search__row:hover .sr-search__option {
    color: var(--sr-neutral-heading);
}

.sr-search__note {
    font-size: 14px;
    line-height: 1.5;
    color: var(--sr-neutral-light-text);
}

/* Category menu: three columns under the scope button */
.sr-search__menu {
    right: 0;
    display: flex;
    gap: 60px;
    max-width: calc(100vw - 32px);
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 24px;
}

.sr-search__menu-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    min-width: 120px;
}

.sr-search__menu-col + .sr-search__menu-col {
    position: relative;
}

.sr-search__menu-col + .sr-search__menu-col::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -30px;
    width: 1px;
    background: var(--sr-neutral-border);
}

.sr-search__menu-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sr-search__menu-caption {
    padding: 6px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sr-neutral-body);
}

.sr-search__menu-link,
.sr-search__menu-link:visited {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 -8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sr-neutral-body);
    text-decoration: none;
    white-space: nowrap;
}

.sr-search__menu-link--heading,
.sr-search__menu-link--heading:visited {
    font-weight: 600;
}

.sr-search__menu-link--bullet {
    padding-left: 29px;
    position: relative;
}

.sr-search__menu-link--bullet::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: currentColor;
}

.sr-search__menu-link:hover,
.sr-search__menu-link:focus-visible,
.sr-search__menu-link.is-active {
    background: var(--sr-bg-skyblue);
    color: var(--sr-blue-1);
    outline: none;
    text-decoration: none;
}

.sr-search__menu-link[aria-current="true"] {
    color: var(--sr-blue-1);
    font-weight: 600;
}

/* ================================================
   Hero banner
   ================================================ */
.sr-hero {
    position: relative;
    /* Not hidden: the search suggestions and the categories menu hang below
       the band. The art is clipped by .sr-hero__decor instead. */
    overflow: visible;
    padding: 113px 0 153px;
    background: var(--sr-sky-blue-1);
    color: #fff;
    text-align: center;
}

.sr-hero__wave {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 40px;
    color: var(--sr-sky-blue-1);
    background: #fff;
}

.sr-hero__decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.sr-hero__art {
    position: absolute;
    display: block;
    max-width: none;
    height: auto;
}

/* Placed from the 1920 frame, measured from the centre so they hug the text. */
.sr-hero__art--butterfly { top: 48px; left: calc(50% - 752px); width: 175px; }
.sr-hero__art--cloud-left { top: 251px; left: calc(50% - 860px); width: 111px; }
.sr-hero__art--cloud-right { top: 96px; left: calc(50% + 756px); width: 111px; }
.sr-hero__art--balloon { top: 211px; left: calc(50% + 584px); width: 98px; }

/* While someone types in the hero's search or opens its category menu, the
   whole hero rises above the results below, so the suggestions panel isn't
   painted under the cards' pictures, bookmarks and ribbons (z-index 1 to 2).
   Only while focused, so the shop header's own menus still open over it. */
.sr-hero:focus-within {
    z-index: 5;
}

.sr-hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.sr-hero__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.sr-hero__title {
    margin: 0;
    font-family: var(--sr-font-heading);
    font-size: 60px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    color: #fff;
    overflow-wrap: anywhere;
}

.sr-hero__subtitle {
    margin: 0;
    max-width: 960px;
    font-family: var(--sr-font-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
}

.sr-hero__note {
    margin: 0;
    font-family: var(--sr-font-body);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
}
.sr-hero__note:not(#sr-x) a,
.sr-hero__note:not(#sr-x) a:visited {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.sr-hero__note:not(#sr-x) a:hover {
    color: #fff;
    text-decoration-thickness: 2px;
}

.sr-hero__search {
    width: 100%;
    max-width: 960px;
}

.sr-hero__popular {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.sr-hero__popular-label {
    font-size: 16px;
    line-height: 1.5;
    color: #fff;
}

.sr-hero__pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sr-hero__pill,
.sr-hero__pill:visited {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.1);
    font-family: var(--sr-font-body);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--sr-transition-fast);
}

.sr-hero__pill:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    text-decoration: none;
}

.sr-hero__pill:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sr-hero__pill:active {
    background: rgba(0, 0, 0, 0.25);
}

/* ================================================
   Shared bottom blocks
   ================================================ */

/* Promotion band (Journey2Jannah) */
.sr-band {
    display: flex;
    align-items: center;
    gap: 80px;
    padding: 80px 100px;
    border-radius: 60px;
    overflow: hidden;
}

.sr-band--purple { background: var(--sr-bg-purple); }
.sr-band--blue { background: var(--sr-bg-skyblue); }

.sr-band__text {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
    max-width: 560px;
}

.sr-band__heading {
    font-family: var(--sr-font-heading);
    font-size: 40px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--sr-neutral-heading);
    text-transform: capitalize;
}

.sr-band__body {
    font-size: 18px;
    line-height: 1.5;
    color: var(--sr-neutral-body);
}

.sr-band .sr-band__button:not(#sr-x) {
    min-width: 320px;
    margin-top: 16px;
}

.sr-band__art {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.sr-band__art img {
    display: block;
    width: 100%;
    max-width: 540px;
    height: auto;
}

/* Other Resources */
.sr-other {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sr-other__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sr-other__link,
.sr-other__link:visited {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 80px;
    padding: 16px;
    border: 1px solid #E7E9EE;
    border-radius: 16px;
    background: #fff;
    color: var(--sr-neutral-body);
    text-decoration: none;
    transition: border-color var(--sr-transition-fast), box-shadow var(--sr-transition-fast);
}

.sr-other__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--sr-bg-skyblue);
    overflow: hidden;
}

.sr-other__icon img {
    display: block;
}

.sr-other__label {
    flex: 1;
    min-width: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
}

.sr-other__arrow {
    flex-shrink: 0;
    color: var(--sr-sky-blue-1);
    transition: transform var(--sr-transition-fast);
}

.sr-other__link:hover {
    border-color: var(--sr-sky-blue-1);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    color: var(--sr-neutral-heading);
    text-decoration: none;
}

.sr-other__link:hover .sr-other__arrow {
    transform: translateX(3px);
}

.sr-other__link:focus-visible {
    outline: none;
    box-shadow: var(--sr-focus-ring);
}

/* More Ways We Can Help You */
.sr-more-ways {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.sr-more-ways__heading {
    text-align: center;
}

.sr-more-ways__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sr-more-ways__tile,
.sr-more-ways__tile:visited {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-height: 280px;
    padding: 32px 24px;
    border-radius: 16px;
    background: var(--sr-bg-beige);
    text-align: center;
    text-decoration: none;
    transition: box-shadow var(--sr-transition-base), transform var(--sr-transition-base);
}

.sr-more-ways__art {
    display: block;
    width: 220px;
    height: 140px;
    margin-bottom: 8px;
    object-fit: contain;
    transition: transform var(--sr-transition-base);
}

.sr-more-ways__title {
    font-size: 18px;
    font-weight: 600;
    line-height: 20px;
    color: var(--sr-neutral-heading);
}

.sr-more-ways__text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--sr-neutral-body);
}

.sr-more-ways__tile:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    text-decoration: none;
}

.sr-more-ways__tile:hover .sr-more-ways__art {
    transform: translateY(-3px);
}

.sr-more-ways__tile:focus-visible {
    outline: none;
    box-shadow: var(--sr-focus-ring);
}

.sr-more-ways__action .sr-pbtn:not(#sr-x) {
    min-width: 270px;
}

/* --- Shared pieces at smaller widths --- */
@media (max-width: 1500px) {
    .sr-hero__art--cloud-left { left: 2%; }
    .sr-hero__art--cloud-right { left: auto; right: 2%; }
}

@media (max-width: 1280px) {
    .sr-hero__art--butterfly { left: 1%; width: 130px; }
    .sr-hero__art--balloon { left: auto; right: 3%; width: 76px; }
    .sr-band { gap: 48px; padding: 64px; }
    .sr-band__heading { font-size: 34px; line-height: 1.3; }
}

@media (max-width: 1199px) {
    .sr-hero__art--butterfly,
    .sr-hero__art--cloud-left,
    .sr-hero__art--cloud-right,
    .sr-hero__art--balloon { display: none; }
}

@media (max-width: 1024px) {
    .sr-hero { padding: 72px 0 112px; }
    .sr-hero__title { font-size: 44px; }
    .sr-other__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sr-more-ways__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sr-band { flex-direction: column; align-items: stretch; padding: 48px; border-radius: 40px; }
    .sr-band__text { max-width: none; }
    .sr-section-heading--large { font-size: 34px; }
}

@media (max-width: 767px) {
    .sr-hero { padding: 40px 0 72px; }
    .sr-hero__wave { height: 16px; }
    .sr-hero__inner { gap: 24px; }
    .sr-hero__text { gap: 12px; }
    .sr-hero__title { font-size: 34px; }
    .sr-hero__subtitle { font-size: 16px; }
    .sr-hero__popular { gap: 10px; }
    .sr-hero__popular-label { width: 100%; font-size: 14px; }
    .sr-search__bar { height: 52px; padding: 0 8px 0 16px; }
    .sr-search__scope { gap: 4px; padding-left: 4px; }
    .sr-search__scope-btn:not(#sr-x) { gap: 6px; max-width: 128px; padding: 0 8px; font-size: 12px; }
    .sr-search__panel { left: -4px; right: -4px; padding: 20px; }
    .sr-search__menu { position: fixed; top: auto; bottom: 0; left: 0; right: 0; max-width: none; max-height: 75vh; flex-direction: column; gap: 24px; border-radius: 16px 16px 0 0; }
    .sr-search__menu-col + .sr-search__menu-col::before { left: 0; right: 0; top: -12px; bottom: auto; width: auto; height: 1px; }
    .sr-search__grid { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
    .sr-section-heading { font-size: 26px; }
    .sr-section-heading--large { font-size: 28px; }
    .sr-other__list,
    .sr-more-ways__grid { grid-template-columns: minmax(0, 1fr); }
    .sr-other__link { height: auto; min-height: 72px; }
    .sr-other__label { font-size: 16px; }
    .sr-more-ways { gap: 32px; }
    .sr-more-ways__tile { min-height: 0; }
    .sr-band { padding: 32px 20px; border-radius: 24px; gap: 32px; }
    .sr-band__heading { font-size: 26px; }
    .sr-band__body { font-size: 16px; }
    .sr-band .sr-band__button:not(#sr-x) { min-width: 0; width: 100%; }
    :is(.sr-band, .sr-more-ways) .sr-pbtn:not(#sr-x) { min-height: 48px; padding: 12px 24px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    :is(.sr-content-wrapper, .sr-modal, .sr-toasts) *,
    :is(.sr-content-wrapper, .sr-modal, .sr-toasts) *::before,
    :is(.sr-content-wrapper, .sr-modal, .sr-toasts) *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Lists drawn by the plugin never show the theme's markers. */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) ul[class] > li,
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) ol[class] > li {
    list-style: none;
}

/* Some themes underline every focused link; the plugin's links draw their own focus. */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) a[class]:focus {
    text-decoration: none;
}

/* Buttons draw their own focus ring (box-shadow on :focus-visible). */
:is(.sr-content-wrapper, .sr-modal, .sr-toasts):not(#sr-x) button[class]:focus {
    outline: none;
}

/* ================================================
   Tap targets: at least 44 by 44px for a finger. An invisible layer
   centred on each small control grows its hit area, so nothing looks
   different.
   ================================================ */
.sr-resource-card__bookmark:not(#sr-x),
.sr-search__submit:not(#sr-x),
.sr-sort__option,
.sr-filter__option,
.sr-hero__pill,
.sr-pagination__link,
.sr-my-note__btn {
    position: relative;
}
.sr-resource-card__bookmark:not(#sr-x)::before,
.sr-search__submit:not(#sr-x)::before,
.sr-sort__option::before,
.sr-filter__option::before,
.sr-hero__pill::before,
.sr-pagination__link::before,
.sr-my-note__btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100%, 44px);
    height: max(100%, 44px);
    transform: translate(-50%, -50%);
}

/* News about a teacher's own shares (shared/share-news.php), on My resources and the landing page. */
.sr-my-news {
    display: grid;
    gap: 8px;
    margin: 12px 0 20px;
}
.sr-my-news__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 0;
    padding: 12px 16px;
    border-radius: 10px;
    border-left: 4px solid #3F6E14;
    background: var(--sr-bg-green);
    color: var(--sr-neutral-body);
    font-weight: 600;
    overflow-wrap: anywhere;
}
.sr-my-news__item--rejected {
    border-left-color: #B42C3C;
    background: var(--sr-bg-red);
}
.sr-my-news__item .sr-link {
    font-weight: 700;
    white-space: nowrap;
}

/* In the shop (Bricks), the phone header is fixed over the page and the
   theme pads #brx-content by 85px to clear it. Toolbox pages have no
   #brx-content, so clear it here: in the hero's colour where a page opens
   on a hero, plain space otherwise. */
@media (max-width: 900px) {
    .brx-body .sr-content-wrapper { padding-top: 85px; }
    .brx-body .sr-content-wrapper:has(> .sr-hero:first-child, > .sr-t-hero:first-child) { padding-top: 0; }
    .brx-body .sr-content-wrapper > .sr-hero:first-child { border-top: 85px solid var(--sr-sky-blue-1); }
    .brx-body .sr-content-wrapper > .sr-t-hero:first-child { border-top: 85px solid var(--t-sky, var(--sr-sky-blue-1)); }
}
