/*
 * Study home (/study/), redesigned October 2026, phone first.
 *
 * Everything is scoped to .study-home so nothing leaks onto other study pages.
 * Colours come from the brand variables (base.css, flash-messages.css,
 * bible_study_brand.css): navy for actions, gold for "act on this", ember for
 * warmth (streaks, rewards, the custom-study tool). The value after each comma
 * is only a fallback.
 *
 * base.min.css makes every h1-h3 uppercase with wide letter spacing, and
 * styles bare buttons. The heading and tab rules below undo that inside this
 * page, so titles read like the pricing and dashboard pages.
 */

.study-home {
    --sh-navy: var(--brand-navy, #2b3a7f);
    --sh-navy-dark: var(--brand-navy-dark, #1e2b69);
    --sh-navy-tint: var(--brand-navy-subtle-bg, #eef2ff);
    --sh-ink: var(--brand-dark, #11192c);
    --sh-body: var(--text-primary, #1f2937);
    /* 5.3:1 on the page background, 6.3:1 on white (see bible_study_brand.css). */
    --sh-muted: var(--study-text-muted, #56607a);
    --sh-line: var(--border-subtle, #e2e8f0);
    --sh-soft: var(--brand-light-bg, #f8fafc);
    --sh-gold: var(--brand-accent, #fcd34d);
    --sh-gold-tint: var(--brand-accent-light, #fef5d8);
    --sh-gold-ink: var(--brand-accent-ink, #806000);
    --sh-ember: var(--brand-orange, #fa8334);
    --sh-ember-tint: var(--status-success-bg, rgba(228, 141, 92, 0.16));
    --sh-ember-line: var(--status-success-border, rgba(228, 141, 92, 0.45));
    --sh-ember-ink: var(--status-success-ink, #9a4a1c);
    --sh-radius: 1.25rem;
    --sh-shadow: 0 1px 2px rgba(17, 25, 44, 0.04), 0 8px 24px rgba(17, 25, 44, 0.06);
    --sh-shadow-lift: 0 2px 4px rgba(17, 25, 44, 0.06), 0 16px 36px rgba(17, 25, 44, 0.12);
    --sh-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --sh-display: var(--study-font-display, 'Playfair Display', serif);
    --sh-sans: var(--study-font-body, 'Inter', sans-serif);

    /* With the study shell's own 0.5rem this gives a 16px gutter on phones. */
    padding: 0 0.5rem;
    color: var(--sh-body);
    font-family: var(--sh-sans);
    font-size: 1rem;
    line-height: 1.5;
}

@media (min-width: 769px) {
    .study-home {
        padding: 0;
    }
}

/* Class rules below set display; keep the hidden attribute in charge. */
.study-home [hidden] {
    display: none !important;
}

.study-home h1,
.study-home h2,
.study-home h3 {
    margin: 0;
    font-family: var(--sh-display);
    font-weight: 600;
    /* Capitals with light spacing, as on the Bible verse and chapter pages
       (owner decision, November 24, 2026). Sizes below follow those pages too:
       30px page title, 20px section title, 16px card title. */
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* base.min.css sets every paragraph in the serif; this page sets copy in Inter
   and keeps the serif for titles and the few lines that quote or name a study. */
.study-home p {
    margin: 0;
    font-family: var(--sh-sans);
}

.study-home :is(a, button, summary):focus-visible {
    outline: 3px solid var(--sh-navy);
    outline-offset: 2px;
}

.study-home :is(.sh-hero, .sh-wisdom) :is(a, button, summary):focus-visible {
    outline-color: var(--sh-gold);
}

.sh-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Hero: the one next step ---------- */

.sh-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    gap: 1.25rem;
    padding: 1.5rem 1.25rem 1.375rem;
    border-radius: 1.5rem;
    /* Dusk sky: night navy at the top, the last ember light low in the corner. */
    background: linear-gradient(160deg, var(--sh-ink) 0%, var(--sh-navy-dark) 45%, var(--sh-navy) 74%, rgba(250, 131, 52, 0.85) 125%);
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(17, 25, 44, 0.22);
}

.sh-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background:
        radial-gradient(55% 45% at 88% 0%, rgba(252, 211, 77, 0.2), transparent 70%),
        radial-gradient(45% 55% at 0% 100%, rgba(255, 255, 255, 0.07), transparent 70%);
    pointer-events: none;
}

.sh-hero__main {
    display: grid;
    gap: 0.75rem;
    align-content: start;
    min-width: 0;
}

.sh-kicker {
    color: var(--sh-gold);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.3;
    text-transform: uppercase;
}

.study-home .sh-hero__title {
    color: #ffffff;
    font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.study-home .sh-hero__study {
    color: rgba(255, 255, 255, 0.86);
    font-family: var(--sh-display);
    font-size: 1.0625rem;
    font-style: italic;
}

.sh-hero__lead {
    max-width: 34rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.55;
}

/* On small phones the three checkmarks say the same thing in less space, which
   keeps "Start this study" on the first screen. */
@media (max-width: 639px) {
    .sh-hero__lead {
        display: none;
    }
}

.study-home .study-notice {
    margin: 1.5rem 0 0;
}

.sh-hero__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.study-home a.sh-hero__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 2.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.sh-hero__more .material-icons {
    font-size: 1.125rem;
    transition: transform 0.25s var(--sh-ease);
}

.study-home a.sh-hero__more:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sh-hero__more:hover .material-icons {
    transform: translateY(3px);
}

.sh-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1rem;
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
}

.sh-benefits li {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9375rem;
    font-weight: 500;
}

.sh-benefits .material-icons {
    color: var(--sh-gold);
    font-size: 1.125rem;
}

/* Frosted dark glass: stays readable wherever it sits on the gradient. */
.sh-glass {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1.125rem;
    background: rgba(17, 25, 44, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
}

.sh-hero__side {
    display: grid;
    gap: 0.875rem;
    align-content: start;
    min-width: 0;
    padding: 1.125rem;
}

@media (min-width: 640px) {
    .sh-hero__actions {
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
    }
}

@media (min-width: 900px) {
    .sh-hero {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        align-items: center;
        gap: 2.5rem;
        padding: 2.5rem;
    }

    .sh-hero__side {
        padding: 1.5rem;
    }
}

/* Progress through the open study: one segment per session. */
.sh-progress {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
}

.study-home .sh-progress__where {
    color: #ffffff;
    font-family: var(--sh-display);
    font-size: 1.125rem;
    font-weight: 600;
}

.sh-progress__done {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8125rem;
    font-weight: 500;
}

.sh-path {
    display: grid;
    grid-template-columns: repeat(var(--sh-steps, 6), minmax(0, 1fr));
    gap: 6px;
    align-items: center;
}

.sh-path__step {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.sh-path__step.is-done {
    background: var(--sh-gold);
    transform-origin: left center;
    animation: sh-grow 0.5s var(--sh-ease) both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

.sh-path__step.is-current {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.35);
    animation: sh-glow 2.4s ease-in-out infinite;
}

.sh-streak {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- First study: the starter card in the hero ---------- */

.sh-starter {
    gap: 0.75rem;
}

.sh-starter__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--sh-gold);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sh-starter__eyebrow .material-icons {
    font-size: 1rem;
}

.study-home .sh-starter__title {
    color: #ffffff;
    font-size: 1.375rem;
    line-height: 1.2;
}

.sh-starter__desc {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.sh-starter__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

@media (min-width: 480px) {
    .sh-starter__actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .sh-starter__actions .sh-btn--lg {
        width: auto;
    }
}

.sh-reward {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.375rem 0.5rem 0.75rem;
    border: 1px dashed rgba(250, 131, 52, 0.55);
    border-radius: 0.875rem;
    background: rgba(250, 131, 52, 0.14);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.sh-reward > span:nth-child(2) {
    flex: 1 1 auto;
}

.sh-reward > .material-icons {
    color: var(--sh-ember);
    animation: sh-flicker 3s ease-in-out infinite;
}

/* ---------- Buttons ---------- */

.study-home .sh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.625rem 1.125rem;
    border: 1px solid transparent;
    border-radius: 0.875rem;
    font-family: var(--sh-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s var(--sh-ease), box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.study-home .sh-btn .material-icons {
    font-size: 1.25rem;
}

.study-home .sh-btn:active {
    transform: scale(0.97);
}

.study-home .sh-btn--lg {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    font-size: 1rem;
}

@media (min-width: 640px) {
    .study-home .sh-btn--lg {
        width: auto;
    }
}

.study-home .sh-btn--gold {
    background: var(--sh-gold);
    color: var(--sh-ink);
    box-shadow: 0 8px 22px rgba(252, 211, 77, 0.28);
}

.study-home .sh-btn--gold:hover {
    color: var(--sh-ink);
    box-shadow: 0 12px 28px rgba(252, 211, 77, 0.42);
    transform: translateY(-1px);
}

.study-home .sh-btn--navy {
    background: var(--sh-navy);
    color: #ffffff;
}

.study-home .sh-btn--navy:hover {
    background: var(--sh-navy-dark);
    color: #ffffff;
}

.study-home .sh-btn--glass {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.study-home .sh-btn--glass:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.study-home .sh-btn--quiet {
    border-color: var(--sh-line);
    background: #ffffff;
    color: var(--sh-navy);
}

.study-home .sh-btn--quiet:hover {
    border-color: var(--sh-navy);
    background: var(--sh-navy-tint);
    color: var(--sh-navy);
}

/* "Opening..." feedback: the icon turns into a spinner while the next page loads. */
.sh-spin {
    display: none;
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: sh-spin 0.7s linear infinite;
}

.study-home .is-busy .sh-spin,
.study-home .sh-btn.is-busy .sh-spin {
    display: inline-block;
}

.study-home .is-busy [data-sh-icon] {
    display: none;
}

.study-home .is-busy,
.study-home .is-busy * {
    cursor: progress;
}

/* ---------- Chips and facts ---------- */

.sh-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--sh-line);
    border-radius: 999px;
    background: var(--sh-soft);
    color: var(--sh-muted);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.sh-chip .material-icons {
    font-size: 0.9375rem;
}

.sh-chip--navy {
    border-color: rgba(43, 58, 127, 0.14);
    background: var(--sh-navy-tint);
    color: var(--sh-navy);
}

.sh-chip--gold {
    border-color: rgba(128, 96, 0, 0.18);
    background: var(--sh-gold-tint);
    color: var(--sh-gold-ink);
}

.sh-chip--ember {
    border-color: var(--sh-ember-line);
    background: var(--sh-ember-tint);
    color: var(--sh-ember-ink);
}

.sh-chip--ember-dark {
    border-color: rgba(250, 131, 52, 0.45);
    background: rgba(250, 131, 52, 0.18);
    color: #ffffff;
}

.sh-chip--ember-dark .material-icons {
    color: var(--sh-ember);
}

.sh-chip--gold-dark {
    border-color: rgba(252, 211, 77, 0.4);
    background: rgba(252, 211, 77, 0.14);
    color: var(--sh-gold);
}

.sh-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 0.875rem;
    margin: 0;
    padding: 0;
    color: var(--sh-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    list-style: none;
}

.sh-facts li {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sh-facts .material-icons {
    color: var(--sh-navy);
    font-size: 1rem;
}

.sh-facts--dark {
    color: rgba(255, 255, 255, 0.88);
}

.sh-facts--dark .material-icons {
    color: var(--sh-gold);
}

.sh-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--sh-navy-tint);
    color: var(--sh-navy);
    font-family: var(--sh-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
}

/* ---------- Info bubbles ---------- */

.sh-tip {
    position: relative;
    display: inline-block;
    flex: none;
}

.sh-tip > summary {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    color: var(--sh-muted);
    list-style: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sh-tip > summary::-webkit-details-marker {
    display: none;
}

.sh-tip > summary::marker {
    content: "";
}

.sh-tip > summary .material-icons {
    font-size: 1.125rem;
}

.sh-tip > summary:hover,
.sh-tip[open] > summary {
    background: var(--sh-navy-tint);
    color: var(--sh-navy);
}

.sh-tip > summary:active {
    transform: scale(0.92);
}

.sh-tip--dark > summary {
    color: rgba(255, 255, 255, 0.82);
}

.sh-tip--dark > summary:hover,
.sh-tip--dark[open] > summary {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.study-home .sh-tip__bubble {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: -0.25rem;
    z-index: 40;
    width: min(18rem, calc(100vw - 2rem));
    padding: 0.75rem 0.875rem;
    border-radius: 0.875rem;
    background: var(--sh-ink);
    box-shadow: 0 16px 40px rgba(17, 25, 44, 0.28);
    color: #ffffff;
    font-family: var(--sh-sans);
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.5;
    text-align: left;
    text-transform: none;
    white-space: normal;
    /* study_home.js nudges the bubble sideways to keep it on screen. */
    translate: var(--sh-tip-dx, 0px) 0;
    transform-origin: top right;
    animation: sh-pop 0.18s var(--sh-ease) both;
}

.sh-tip__bubble::before {
    content: "";
    position: absolute;
    top: -5px;
    /* The bubble moved by --sh-tip-dx; the arrow moves back so it still points at the (i). */
    right: calc(0.875rem + var(--sh-tip-dx, 0px));
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: inherit;
    transform: rotate(45deg);
}

.study-home .sh-tip--dark .sh-tip__bubble {
    background: #ffffff;
    color: var(--sh-ink);
}

/* ---------- Layout and sections ---------- */

.sh-layout {
    display: grid;
    gap: 2.25rem;
    margin-top: 2rem;
}

.sh-main,
.sh-aside {
    display: grid;
    gap: 2.25rem;
    align-content: start;
    min-width: 0;
}

@media (min-width: 1024px) {
    .sh-layout {
        grid-template-columns: minmax(0, 1fr) 21rem;
        gap: 2.5rem;
        margin-top: 2.5rem;
    }

    .sh-main {
        gap: 2.75rem;
    }

    .sh-aside {
        gap: 1.5rem;
    }
}

.sh-section {
    min-width: 0;
    scroll-margin-top: 1.5rem;
}

.sh-section:focus {
    outline: none;
}

.sh-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.sh-section__head--stack {
    align-items: flex-start;
}

.study-home .sh-section__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sh-navy);
    font-size: 1.375rem;
    line-height: 1.2;
}

.study-home .sh-section__title--sm {
    color: var(--sh-ink);
    font-size: 1.125rem;
}

@media (min-width: 768px) {
    .study-home .sh-section__title {
        font-size: 1.25rem;
    }

    .study-home .sh-section__title--sm {
        font-size: 1.125rem;
    }
}

.sh-section__sub {
    margin-top: 0.25rem;
    color: var(--sh-muted);
    font-size: 0.9375rem;
}

.study-home a.sh-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 2.75rem;
    color: var(--sh-navy);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.sh-link .material-icons {
    font-size: 1.125rem;
    transition: transform 0.2s var(--sh-ease);
}

.study-home a.sh-link:hover {
    color: var(--sh-navy-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.study-home a.sh-link:hover .material-icons {
    transform: translateX(2px);
}

/* ---------- Swipe rails (phones) that become grids (tablet and up) ---------- */

.sh-rail {
    position: relative;
    /* Runs edge to edge on a phone so the next card peeks in. */
    margin: 0 -1rem;
}

.sh-rail__track {
    display: grid;
    grid-auto-columns: min(84%, 20rem);
    grid-auto-flow: column;
    gap: 0.875rem;
    margin: 0;
    padding: 0.25rem 1rem 0.75rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    list-style: none;
}

.sh-rail__track::-webkit-scrollbar {
    display: none;
}

.sh-rail__track > li {
    scroll-snap-align: start;
}

.sh-rail__hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    color: var(--sh-muted);
    font-size: 0.75rem;
    font-weight: 600;
    transition: opacity 0.4s ease;
}

.sh-rail__hint .material-icons {
    font-size: 1rem;
    animation: sh-nudge 1.8s ease-in-out infinite;
}

.sh-rail__hint.is-gone {
    opacity: 0;
}

@media (min-width: 768px) {
    .sh-rail {
        margin: 0;
    }

    .sh-rail__track {
        grid-auto-columns: auto;
        grid-auto-flow: row;
        grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
        gap: 1rem;
        padding: 0;
        overflow: visible;
        scroll-snap-type: none;
    }

    .sh-rail__hint {
        display: none !important;
    }
}

/* ---------- Cards ---------- */

.sh-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    height: 100%;
    padding: 1.125rem;
    border: 1px solid var(--sh-line);
    border-radius: var(--sh-radius);
    background: #ffffff;
    box-shadow: var(--sh-shadow);
    transition: transform 0.25s var(--sh-ease), box-shadow 0.25s ease, border-color 0.25s ease;
}

.sh-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.study-home .sh-card__title {
    color: var(--sh-ink);
    font-size: 1.125rem;
    line-height: 1.25;
}

.study-home a.sh-card__link {
    color: inherit;
    text-decoration: none;
}

/* The whole card opens the study; the title link stretches over it. */
.sh-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.sh-card__next,
.sh-card__desc {
    display: -webkit-box;
    overflow: hidden;
    color: var(--sh-muted);
    font-size: 0.875rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
}

.sh-card__next {
    -webkit-line-clamp: 2;
}

.sh-card__desc {
    -webkit-line-clamp: 3;
}

.sh-card__bottom {
    display: grid;
    gap: 0.625rem;
    margin-top: auto;
    padding-top: 0.25rem;
}

.sh-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sh-card__progress {
    color: var(--sh-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}

.sh-card__go {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--sh-navy);
    font-size: 0.875rem;
    font-weight: 700;
}

.sh-card__go .material-icons {
    font-size: 1.125rem;
    transition: transform 0.2s var(--sh-ease);
}

.sh-card__actions {
    display: flex;
    gap: 0.5rem;
}

.sh-card__actions .sh-btn {
    flex: 1 1 0;
}

.sh-card--study:active {
    transform: scale(0.985);
}

.sh-card--study:focus-within {
    border-color: var(--sh-navy);
    box-shadow: 0 0 0 3px rgba(43, 58, 127, 0.16), var(--sh-shadow);
}

/* The stretched link carries the focus ring for the whole card. */
.sh-card--study .sh-card__link:focus-visible {
    outline: none;
}

@media (hover: hover) {
    .sh-card--study:hover,
    .sh-card--suggest:hover {
        border-color: rgba(43, 58, 127, 0.22);
        box-shadow: var(--sh-shadow-lift);
        transform: translateY(-2px);
    }

    .sh-card--study:hover .sh-card__go .material-icons {
        transform: translateX(3px);
    }
}

.sh-meter {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--sh-navy-tint);
}

.sh-meter__fill {
    display: block;
    width: var(--sh-pct, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--sh-navy);
    transform-origin: left center;
    animation: sh-grow 0.9s var(--sh-ease) 0.15s both;
}

.sh-meter--dark {
    height: 8px;
    background: rgba(255, 255, 255, 0.16);
}

.sh-meter--dark .sh-meter__fill {
    background: var(--sh-gold);
}

/* ---------- AI writing tools ---------- */

.sh-balance {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0.125rem 0.125rem 0.75rem;
    border: 1px solid var(--sh-line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--sh-body);
    font-size: 0.875rem;
    font-weight: 600;
}

.sh-balance > .material-icons {
    color: var(--sh-gold-ink);
    font-size: 1.125rem;
}

.sh-balance.is-short {
    border-color: rgba(128, 96, 0, 0.3);
    background: var(--sh-gold-tint);
}

.sh-tools {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.study-home a.sh-tool {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.875rem;
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--sh-line);
    border-radius: var(--sh-radius);
    background: #ffffff;
    box-shadow: var(--sh-shadow);
    color: var(--sh-body);
    text-decoration: none;
    transition: transform 0.25s var(--sh-ease), box-shadow 0.25s ease, border-color 0.25s ease;
}

.study-home a.sh-tool--feature {
    border-color: var(--sh-ember-line);
    background: linear-gradient(165deg, #ffffff 35%, var(--sh-gold-tint) 130%);
}

.sh-tool__icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    background: var(--sh-navy-tint);
    color: var(--sh-navy);
    transition: transform 0.3s var(--sh-ease);
}

.sh-tool--feature .sh-tool__icon {
    background: var(--sh-ember-tint);
    color: var(--sh-ember-ink);
}

.sh-tool__text {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.sh-tool__title {
    color: var(--sh-ink);
    font-family: var(--sh-display);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.25;
}

.sh-tool__body {
    color: var(--sh-muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

.sh-tool__cost {
    justify-self: start;
    margin-top: 0.375rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--sh-gold-tint);
    color: var(--sh-gold-ink);
    font-size: 0.75rem;
    font-weight: 700;
}

.sh-tool__chev,
.sh-tool .sh-spin {
    align-self: center;
    color: var(--sh-navy);
    transition: transform 0.2s var(--sh-ease);
}

.study-home a.sh-tool:active {
    transform: scale(0.985);
}

@media (hover: hover) {
    .study-home a.sh-tool:hover {
        border-color: rgba(43, 58, 127, 0.25);
        box-shadow: var(--sh-shadow-lift);
        transform: translateY(-2px);
    }

    .study-home a.sh-tool:hover .sh-tool__chev {
        transform: translateX(3px);
    }

    .study-home a.sh-tool:hover .sh-tool__icon {
        transform: rotate(-6deg) scale(1.06);
    }
}

@media (min-width: 768px) {
    .sh-tools {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .study-home a.sh-tool {
        grid-template-columns: minmax(0, 1fr);
        padding: 1.125rem 2.75rem 1.125rem 1.125rem;
    }

    .sh-tool__chev,
    .sh-tool .sh-spin {
        position: absolute;
        top: 1.25rem;
        right: 1rem;
    }
}

.sh-topup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin-top: 0.875rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(128, 96, 0, 0.2);
    border-radius: 0.875rem;
    background: var(--sh-gold-tint);
    color: var(--sh-gold-ink);
    font-size: 0.9375rem;
    font-weight: 500;
}

.sh-topup > .material-icons {
    font-size: 1.125rem;
}

.study-home .sh-topup a.sh-link {
    color: var(--sh-navy);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Lists: lessons, briefs, browse ---------- */

.study-home .sh-tabs {
    display: inline-flex;
    gap: 0.25rem;
    max-width: 100%;
    margin-bottom: 1rem;
    padding: 0.25rem;
    overflow-x: auto;
    border-radius: 999px;
    background: var(--sh-navy-tint);
}

.study-home .sh-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    margin: 0;
    padding: 0.5rem 0.875rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: var(--sh-navy);
    font-family: var(--sh-sans);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.study-home .sh-tabs__tab:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--sh-navy);
}

.study-home .sh-tabs__tab[aria-selected="true"] {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(17, 25, 44, 0.12);
    color: var(--sh-ink);
}

.study-home .sh-tabs__tab[aria-selected="true"] .sh-count {
    background: var(--sh-navy);
    color: #ffffff;
}

.sh-panel + .sh-panel {
    margin-top: 1.5rem;
}

[data-sh-tabs].is-tabbed .sh-panel + .sh-panel {
    margin-top: 0;
}

.sh-panel.is-entering {
    animation: sh-fade 0.25s var(--sh-ease) both;
}

.study-home .sh-panel__title {
    margin-bottom: 0.625rem;
    color: var(--sh-ink);
    font-size: 1.0625rem;
}

.sh-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .sh-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.study-home a.sh-row,
.study-home a.sh-browse {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--sh-line);
    border-radius: 1rem;
    background: #ffffff;
    color: var(--sh-body);
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--sh-ease);
}

.study-home a.sh-row:hover,
.study-home a.sh-browse:hover {
    border-color: rgba(43, 58, 127, 0.25);
    box-shadow: var(--sh-shadow);
}

.study-home a.sh-row:active,
.study-home a.sh-browse:active {
    transform: scale(0.985);
}

.sh-row__icon {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: var(--sh-ember-tint);
    color: var(--sh-ember-ink);
}

.sh-row__icon .material-icons {
    font-size: 1.125rem;
}

.sh-row__text {
    display: grid;
    min-width: 0;
}

.sh-row__title,
.sh-row__meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sh-row__title {
    color: var(--sh-ink);
    font-weight: 600;
}

.sh-row__meta {
    color: var(--sh-muted);
    font-size: 0.8125rem;
}

.sh-row__chev,
.sh-row .sh-spin,
.sh-browse > .material-icons {
    color: var(--sh-navy);
}

.study-home a.sh-browse {
    font-weight: 600;
}

.study-home a.sh-link--add {
    margin-top: 0.25rem;
}

/* ---------- Community wisdom (dark panel) ---------- */

.sh-wisdom {
    padding: 1.375rem;
    border-radius: 1.5rem;
    background:
        radial-gradient(120% 70% at 100% 0%, rgba(252, 211, 77, 0.12), transparent 60%),
        radial-gradient(90% 60% at 0% 100%, rgba(250, 131, 52, 0.14), transparent 60%),
        var(--sh-ink);
    box-shadow: 0 18px 40px rgba(17, 25, 44, 0.2);
    color: #ffffff;
}

.sh-wisdom__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.study-home .sh-wisdom__title {
    color: #ffffff;
    font-size: 1.375rem;
}

.sh-wisdom__sub {
    margin: 0.25rem 0 1rem !important;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.875rem;
}

.sh-wisdom__list {
    display: grid;
    gap: 0.625rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sh-insight {
    display: grid;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.06);
    transition: background-color 0.2s ease;
}

.sh-insight:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sh-insight__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--sh-gold);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sh-insight__tag .material-icons {
    font-size: 0.9375rem;
}

.sh-insight--question .sh-insight__tag {
    color: var(--sh-ember);
}

.sh-insight__ref {
    color: #ffffff;
    font-family: var(--sh-display);
    font-size: 1.0625rem;
    font-weight: 600;
}

.sh-insight__meta {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.8125rem;
}

.sh-insight__quote {
    color: rgba(255, 255, 255, 0.88);
    font-family: var(--sh-display);
    font-size: 0.9375rem;
    font-style: italic;
    line-height: 1.45;
}

.sh-wisdom__empty {
    display: flex;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.sh-wisdom__empty .material-icons {
    color: var(--sh-gold);
    font-size: 1.125rem;
}

/* ---------- Finished studies ---------- */

.sh-finished {
    padding: 1.25rem;
    border: 1px solid var(--sh-line);
    border-radius: var(--sh-radius);
    background: #ffffff;
    box-shadow: var(--sh-shadow);
}

.sh-finished__list {
    display: grid;
    gap: 0.25rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.study-home a.sh-finished__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 2.75rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.75rem;
    color: var(--sh-body);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.study-home a.sh-finished__item:hover {
    background: var(--sh-soft);
}

.sh-finished__item .material-icons {
    padding: 0.3rem;
    border-radius: 999px;
    background: var(--sh-gold-tint);
    color: var(--sh-gold-ink);
    font-size: 1.125rem;
}

/* ---------- Motion ---------- */

@keyframes sh-spin {
    to { transform: rotate(360deg); }
}

@keyframes sh-grow {
    from { transform: scaleX(0); }
}

@keyframes sh-glow {
    0%, 100% { box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.35); }
    50% { box-shadow: 0 0 0 5px rgba(252, 211, 77, 0.12); }
}

@keyframes sh-flicker {
    0%, 100% { transform: scale(1) rotate(0deg); }
    40% { transform: scale(1.12) rotate(-6deg); }
    60% { transform: scale(0.96) rotate(4deg); }
}

@keyframes sh-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

@keyframes sh-pop {
    from { opacity: 0; transform: translateY(-4px) scale(0.96); }
}

@keyframes sh-fade {
    from { opacity: 0; transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
    .study-home *,
    .study-home *::before,
    .study-home *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* A loading spinner is feedback, not decoration: keep it turning, slowly. */
    .study-home .sh-spin {
        animation: sh-spin 1.6s linear infinite !important;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html:has(.study-home) {
        scroll-behavior: smooth;
    }
}
